Lines Matching refs:ip_proto
203 __u8 ip_proto; in flower_parse_ip_proto() local
209 ip_proto = IPPROTO_TCP; in flower_parse_ip_proto()
211 ip_proto = IPPROTO_UDP; in flower_parse_ip_proto()
213 ip_proto = IPPROTO_SCTP; in flower_parse_ip_proto()
217 ip_proto = IPPROTO_ICMP; in flower_parse_ip_proto()
221 ip_proto = IPPROTO_ICMPV6; in flower_parse_ip_proto()
223 ret = get_u8(&ip_proto, str, 16); in flower_parse_ip_proto()
227 addattr8(n, MAX_MSG, type, ip_proto); in flower_parse_ip_proto()
228 *p_ip_proto = ip_proto; in flower_parse_ip_proto()
398 static int flower_icmp_attr_type(__be16 eth_type, __u8 ip_proto, in flower_icmp_attr_type() argument
401 if (eth_type == htons(ETH_P_IP) && ip_proto == IPPROTO_ICMP) in flower_icmp_attr_type()
405 else if (eth_type == htons(ETH_P_IPV6) && ip_proto == IPPROTO_ICMPV6) in flower_icmp_attr_type()
413 static int flower_icmp_attr_mask_type(__be16 eth_type, __u8 ip_proto, in flower_icmp_attr_mask_type() argument
416 if (eth_type == htons(ETH_P_IP) && ip_proto == IPPROTO_ICMP) in flower_icmp_attr_mask_type()
420 else if (eth_type == htons(ETH_P_IPV6) && ip_proto == IPPROTO_ICMPV6) in flower_icmp_attr_mask_type()
428 static int flower_parse_icmp(char *str, __u16 eth_type, __u8 ip_proto, in flower_parse_icmp() argument
433 value_type = flower_icmp_attr_type(eth_type, ip_proto, field); in flower_parse_icmp()
434 mask_type = flower_icmp_attr_mask_type(eth_type, ip_proto, field); in flower_parse_icmp()
441 static int flower_port_attr_type(__u8 ip_proto, enum flower_endpoint endpoint) in flower_port_attr_type() argument
443 if (ip_proto == IPPROTO_TCP) in flower_port_attr_type()
447 else if (ip_proto == IPPROTO_UDP) in flower_port_attr_type()
451 else if (ip_proto == IPPROTO_SCTP) in flower_port_attr_type()
459 static int flower_parse_port(char *str, __u8 ip_proto, in flower_parse_port() argument
467 type = flower_port_attr_type(ip_proto, endpoint); in flower_parse_port()
584 __u8 ip_proto = 0xff; in flower_parse_opt() local
699 &ip_proto, n); in flower_parse_opt()
752 ret = flower_parse_port(*argv, ip_proto, in flower_parse_opt()
760 ret = flower_parse_port(*argv, ip_proto, in flower_parse_opt()
778 ret = flower_parse_icmp(*argv, eth_type, ip_proto, in flower_parse_opt()
786 ret = flower_parse_icmp(*argv, eth_type, ip_proto, in flower_parse_opt()
1000 __u8 ip_proto; in flower_print_ip_proto() local
1005 ip_proto = rta_getattr_u8(ip_proto_attr); in flower_print_ip_proto()
1007 if (ip_proto == IPPROTO_TCP) in flower_print_ip_proto()
1009 else if (ip_proto == IPPROTO_UDP) in flower_print_ip_proto()
1011 else if (ip_proto == IPPROTO_SCTP) in flower_print_ip_proto()
1013 else if (ip_proto == IPPROTO_ICMP) in flower_print_ip_proto()
1015 else if (ip_proto == IPPROTO_ICMPV6) in flower_print_ip_proto()
1018 fprintf(f, "%02x", ip_proto); in flower_print_ip_proto()
1019 *p_ip_proto = ip_proto; in flower_print_ip_proto()
1179 __u8 ip_proto = 0xff; in flower_print_opt() local
1220 flower_print_ip_proto(f, &ip_proto, tb[TCA_FLOWER_KEY_IP_PROTO]); in flower_print_opt()
1239 nl_type = flower_port_attr_type(ip_proto, FLOWER_ENDPOINT_DST); in flower_print_opt()
1242 nl_type = flower_port_attr_type(ip_proto, FLOWER_ENDPOINT_SRC); in flower_print_opt()
1249 nl_type = flower_icmp_attr_type(eth_type, ip_proto, in flower_print_opt()
1251 nl_mask_type = flower_icmp_attr_mask_type(eth_type, ip_proto, in flower_print_opt()
1257 nl_type = flower_icmp_attr_type(eth_type, ip_proto, in flower_print_opt()
1259 nl_mask_type = flower_icmp_attr_mask_type(eth_type, ip_proto, in flower_print_opt()