Lines Matching refs:iph

49 	struct iphdr    iph;  member
191 p->iph.version = 4; in parse_args()
192 p->iph.ihl = 5; in parse_args()
196 p->iph.frag_off = htons(IP_DF); in parse_args()
206 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { in parse_args()
209 p->iph.protocol = IPPROTO_IPIP; in parse_args()
213 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { in parse_args()
216 p->iph.protocol = IPPROTO_GRE; in parse_args()
220 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { in parse_args()
223 p->iph.protocol = IPPROTO_IPV6; in parse_args()
273 p->iph.frag_off = 0; in parse_args()
275 p->iph.frag_off = htons(IP_DF); in parse_args()
280 p->iph.daddr = get_addr32(*argv); in parse_args()
285 p->iph.saddr = get_addr32(*argv); in parse_args()
297 p->iph.ttl = uval; in parse_args()
308 p->iph.tos = uval; in parse_args()
310 p->iph.tos = 1; in parse_args()
330 if (p->iph.protocol == 0) { in parse_args()
332 p->iph.protocol = IPPROTO_GRE; in parse_args()
334 p->iph.protocol = IPPROTO_IPIP; in parse_args()
336 p->iph.protocol = IPPROTO_IPV6; in parse_args()
339 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) { in parse_args()
349 if (p->i_key == 0 && IN_MULTICAST(ntohl(p->iph.daddr))) { in parse_args()
350 p->i_key = p->iph.daddr; in parse_args()
353 if (p->o_key == 0 && IN_MULTICAST(ntohl(p->iph.daddr))) { in parse_args()
354 p->o_key = p->iph.daddr; in parse_args()
357 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) { in parse_args()
369 if (p.iph.ttl && p.iph.frag_off == 0) { in do_add()
373 switch (p.iph.protocol) { in do_add()
392 switch (p.iph.protocol) { in do_del()
411 p->iph.protocol == IPPROTO_IPIP ? "ip" : in print_tunnel()
412 p->iph.protocol == IPPROTO_GRE ? "gre" : in print_tunnel()
413 p->iph.protocol == IPPROTO_IPV6 ? "ipv6" : in print_tunnel()
415 p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr) : "any", in print_tunnel()
416 p->iph.saddr ? format_host(AF_INET, 4, &p->iph.saddr) : "any" in print_tunnel()
425 if (p->iph.ttl) in print_tunnel()
426 printf(" ttl %d ", p->iph.ttl); in print_tunnel()
429 if (p->iph.tos) { in print_tunnel()
431 if (p->iph.tos & 1) in print_tunnel()
433 if (p->iph.tos & ~1) in print_tunnel()
434 printf("%c%s ", p->iph.tos & 1 ? '/' : ' ', in print_tunnel()
435 rtnl_dsfield_n2a(p->iph.tos & ~1)); in print_tunnel()
437 if (!(p->iph.frag_off & htons(IP_DF))) in print_tunnel()
511 (p->iph.daddr && p1.iph.daddr != p->iph.daddr) || in do_tunnels_list()
512 (p->iph.saddr && p1.iph.saddr != p->iph.saddr) || in do_tunnels_list()
530 switch (p.iph.protocol) { in do_show()