Home
last modified time | relevance | path

Searched refs:iph (Results 1 – 25 of 301) sorted by relevance

12345678910>>...13

/linux-6.3-rc2/net/xfrm/
A Dxfrm_inout.h11 const struct iphdr *iph = ip_hdr(skb); in xfrm4_extract_header() local
14 XFRM_MODE_SKB_CB(skb)->id = iph->id; in xfrm4_extract_header()
16 XFRM_MODE_SKB_CB(skb)->tos = iph->tos; in xfrm4_extract_header()
17 XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl; in xfrm4_extract_header()
18 XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph); in xfrm4_extract_header()
26 struct ipv6hdr *iph = ipv6_hdr(skb); in xfrm6_extract_header() local
45 iph->version = 6; in xfrm6_beet_make_header()
48 sizeof(iph->flow_lbl)); in xfrm6_beet_make_header()
57 struct iphdr *iph = ip_hdr(skb); in xfrm4_beet_make_header() local
59 iph->ihl = 5; in xfrm4_beet_make_header()
[all …]
/linux-6.3-rc2/include/net/netfilter/
A Dnf_tables_ipv4.h21 struct iphdr *iph, _iph; in __nft_set_pktinfo_ipv4_validate() local
25 sizeof(*iph), &_iph); in __nft_set_pktinfo_ipv4_validate()
26 if (!iph) in __nft_set_pktinfo_ipv4_validate()
29 if (iph->ihl < 5 || iph->version != 4) in __nft_set_pktinfo_ipv4_validate()
33 thoff = iph->ihl * 4; in __nft_set_pktinfo_ipv4_validate()
42 pkt->tprot = iph->protocol; in __nft_set_pktinfo_ipv4_validate()
57 struct iphdr *iph; in nft_set_pktinfo_ipv4_ingress() local
63 iph = ip_hdr(pkt->skb); in nft_set_pktinfo_ipv4_ingress()
64 if (iph->ihl < 5 || iph->version != 4) in nft_set_pktinfo_ipv4_ingress()
68 thoff = iph->ihl * 4; in nft_set_pktinfo_ipv4_ingress()
[all …]
A Dnf_queue.h49 static inline u32 hash_v4(const struct iphdr *iph, u32 initval) in hash_v4() argument
52 if ((__force u32)iph->saddr < (__force u32)iph->daddr) in hash_v4()
53 return jhash_3words((__force u32)iph->saddr, in hash_v4()
54 (__force u32)iph->daddr, iph->protocol, initval); in hash_v4()
56 return jhash_3words((__force u32)iph->daddr, in hash_v4()
57 (__force u32)iph->saddr, iph->protocol, initval); in hash_v4()
85 struct iphdr *iph, _iph; in hash_bridge() local
89 iph = skb_header_pointer(skb, skb_network_offset(skb), in hash_bridge()
90 sizeof(*iph), &_iph); in hash_bridge()
91 if (iph) in hash_bridge()
[all …]
/linux-6.3-rc2/net/netfilter/ipvs/
A Dip_vs_proto_ah_esp.c41 const struct ip_vs_iphdr *iph, in ah_esp_conn_fill_param_proto() argument
44 if (likely(!ip_vs_iph_inverse(iph))) in ah_esp_conn_fill_param_proto()
46 &iph->saddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
50 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
56 const struct ip_vs_iphdr *iph) in ah_esp_conn_in_get() argument
72 IP_VS_DBG_ADDR(af, &iph->saddr), in ah_esp_conn_in_get()
73 IP_VS_DBG_ADDR(af, &iph->daddr)); in ah_esp_conn_in_get()
82 const struct ip_vs_iphdr *iph) in ah_esp_conn_out_get() argument
94 IP_VS_DBG_ADDR(af, &iph->saddr), in ah_esp_conn_out_get()
95 IP_VS_DBG_ADDR(af, &iph->daddr)); in ah_esp_conn_out_get()
[all …]
A Dip_vs_core.c509 iph); in ip_vs_schedule()
835 icmph->icmp6_cksum = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, in ip_vs_nat_icmp_v6()
917 struct iphdr *iph; in ip_vs_out_icmp() local
934 iph = ip_hdr(skb); in ip_vs_out_icmp()
942 &iph->saddr, &iph->daddr); in ip_vs_out_icmp()
1437 if (ip_vs_has_real_service(ipvs, af, iph.protocol, &iph.saddr, in ip_vs_out_hook()
1450 iph.len)))) { in ip_vs_out_hook()
1614 &iph->saddr, &iph->daddr); in ip_vs_in_icmp()
1730 &iph->saddr); in ip_vs_in_icmp()
1843 &iph->saddr, &iph->daddr); in ip_vs_in_icmp_v6()
[all …]
/linux-6.3-rc2/tools/testing/selftests/bpf/progs/
A Dxdping_kern.c65 struct iphdr *iph; in icmp_check() local
73 iph = data + sizeof(*eth); in icmp_check()
78 if (bpf_ntohs(iph->tot_len) - sizeof(*iph) != ICMP_ECHO_LEN) in icmp_check()
97 struct iphdr *iph; in xdping_client() local
111 raddr = iph->saddr; in xdping_client()
139 iph->saddr = iph->daddr; in xdping_client()
140 iph->daddr = raddr; in xdping_client()
160 struct iphdr *iph; in xdping_server() local
171 raddr = iph->saddr; in xdping_server()
175 iph->saddr = iph->daddr; in xdping_server()
[all …]
A Dtest_xdp.c93 if (iph + 1 > data_end) in handle_ipv4()
96 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
123 iph + 1 > data_end) in handle_ipv4()
128 iph->version = 4; in handle_ipv4()
129 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
130 iph->frag_off = 0; in handle_ipv4()
132 iph->check = 0; in handle_ipv4()
133 iph->tos = 0; in handle_ipv4()
134 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
137 iph->ttl = 8; in handle_ipv4()
[all …]
A Dtest_xdp_loop.c89 if (iph + 1 > data_end) in handle_ipv4()
92 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
119 iph + 1 > data_end) in handle_ipv4()
124 iph->version = 4; in handle_ipv4()
125 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
126 iph->frag_off = 0; in handle_ipv4()
128 iph->check = 0; in handle_ipv4()
129 iph->tos = 0; in handle_ipv4()
130 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
133 iph->ttl = 8; in handle_ipv4()
[all …]
A Dtest_lwt_ip_encap.c19 struct iphdr iph; in bpf_lwt_encap_gre() member
26 hdr.iph.ihl = 5; in bpf_lwt_encap_gre()
27 hdr.iph.version = 4; in bpf_lwt_encap_gre()
28 hdr.iph.ttl = 0x40; in bpf_lwt_encap_gre()
29 hdr.iph.protocol = 47; /* IPPROTO_GRE */ in bpf_lwt_encap_gre()
31 hdr.iph.saddr = 0x640110ac; /* 172.16.1.100 */ in bpf_lwt_encap_gre()
32 hdr.iph.daddr = 0x641010ac; /* 172.16.16.100 */ in bpf_lwt_encap_gre()
34 hdr.iph.saddr = 0xac100164; /* 172.16.1.100 */ in bpf_lwt_encap_gre()
35 hdr.iph.daddr = 0xac101064; /* 172.16.16.100 */ in bpf_lwt_encap_gre()
39 hdr.iph.tot_len = bpf_htons(skb->len + sizeof(struct encap_hdr)); in bpf_lwt_encap_gre()
/linux-6.3-rc2/samples/bpf/
A Dxdp_tx_iptunnel_kern.c92 if (iph + 1 > data_end) in handle_ipv4()
95 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
101 vip.daddr.v4 = iph->daddr; in handle_ipv4()
124 iph + 1 > data_end) in handle_ipv4()
129 iph->version = 4; in handle_ipv4()
130 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
131 iph->frag_off = 0; in handle_ipv4()
133 iph->check = 0; in handle_ipv4()
134 iph->tos = 0; in handle_ipv4()
135 iph->tot_len = htons(payload_len + sizeof(*iph)); in handle_ipv4()
[all …]
A Dparse_varlen.c53 struct iphdr *iph; in parse_ipv4() local
56 iph = data + nh_off; in parse_ipv4()
57 if (iph + 1 > data_end) in parse_ipv4()
60 if (ip_is_fragment(iph)) in parse_ipv4()
62 ihl_len = iph->ihl * 4; in parse_ipv4()
66 if (iph + 1 > data_end) in parse_ipv4()
68 ihl_len += iph->ihl * 4; in parse_ipv4()
81 struct iphdr *iph; in parse_ipv6() local
93 if (iph + 1 > data_end) in parse_ipv6()
95 ihl_len += iph->ihl * 4; in parse_ipv6()
[all …]
A Dxdp_fwd_kern.c36 u32 check = (__force u32)iph->check; in ip_decrease_ttl()
40 return --iph->ttl; in ip_decrease_ttl()
50 struct iphdr *iph; in xdp_fwd_flags() local
63 iph = data + nh_off; in xdp_fwd_flags()
65 if (iph + 1 > data_end) in xdp_fwd_flags()
68 if (iph->ttl <= 1) in xdp_fwd_flags()
72 fib_params.tos = iph->tos; in xdp_fwd_flags()
73 fib_params.l4_protocol = iph->protocol; in xdp_fwd_flags()
77 fib_params.ipv4_src = iph->saddr; in xdp_fwd_flags()
78 fib_params.ipv4_dst = iph->daddr; in xdp_fwd_flags()
[all …]
A Dxdp_adjust_tail_kern.c82 struct iphdr *iph, *orig_iph; in send_icmp4_too_big() local
91 iph = data + off; in send_icmp4_too_big()
102 iph->ttl = DEFAULT_TTL; in send_icmp4_too_big()
103 iph->daddr = orig_iph->saddr; in send_icmp4_too_big()
104 iph->saddr = orig_iph->daddr; in send_icmp4_too_big()
105 iph->version = 4; in send_icmp4_too_big()
106 iph->ihl = 5; in send_icmp4_too_big()
108 iph->tos = 0; in send_icmp4_too_big()
109 iph->tot_len = htons( in send_icmp4_too_big()
111 iph->check = 0; in send_icmp4_too_big()
[all …]
/linux-6.3-rc2/tools/testing/selftests/bpf/prog_tests/
A Dflow_dissector.c46 struct iphdr iph; member
52 struct iphdr iph; member
61 struct iphdr iph; member
67 struct ipv6hdr iph; member
116 .iph.ihl = 5,
160 .iph.ihl = 5,
206 .iph.ihl = 5,
233 .iph.ihl = 5,
352 .iph.ihl = 5,
381 .iph.ihl = 5,
[all …]
A Dxdp_metadata.c133 iph->check = 0; in ip_csum()
134 p = (void *)iph; in ip_csum()
141 iph->check = ~sum; in ip_csum()
149 struct iphdr *iph; in generate_packet() local
172 iph->ihl = 0x5; in generate_packet()
173 iph->tos = 0x9; in generate_packet()
175 iph->id = 0; in generate_packet()
176 iph->frag_off = 0; in generate_packet()
177 iph->ttl = 0; in generate_packet()
181 ip_csum(iph); in generate_packet()
[all …]
/linux-6.3-rc2/include/net/
A Dinet_ecn.h79 u32 ecn = (iph->tos + 1) & INET_ECN_MASK; in IP_ECN_set_ce()
100 iph->check = csum16_add(iph->check, check_add); in IP_ECN_set_ce()
101 iph->tos |= INET_ECN_CE; in IP_ECN_set_ce()
110 iph->check = csum16_add(iph->check, htons(0x1)); in IP_ECN_set_ect1()
111 iph->tos ^= INET_ECN_MASK; in IP_ECN_set_ect1()
117 iph->tos &= ~INET_ECN_MASK; in IP_ECN_clear()
138 if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) in IP6_ECN_set_ce()
141 from = *(__be32 *)iph; in IP6_ECN_set_ce()
143 *(__be32 *)iph = to; in IP6_ECN_set_ce()
157 from = *(__be32 *)iph; in IP6_ECN_set_ect1()
[all …]
/linux-6.3-rc2/net/ipv4/
A Dxfrm4_input.c31 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() local
33 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, in xfrm4_rcv_encap_finish()
34 iph->tos, skb->dev)) in xfrm4_rcv_encap_finish()
50 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() local
56 return -iph->protocol; in xfrm4_transport_finish()
60 iph->tot_len = htons(skb->len); in xfrm4_transport_finish()
61 ip_send_check(iph); in xfrm4_transport_finish()
86 struct iphdr *iph; in xfrm4_udp_encap_rcv() local
145 iph = ip_hdr(skb); in xfrm4_udp_encap_rcv()
146 iphlen = iph->ihl << 2; in xfrm4_udp_encap_rcv()
[all …]
A Dip_input.c277 iph = ip_hdr(skb); in ip_rcv_options()
328 err = ip_route_use_hint(skb, iph->daddr, iph->saddr, iph->tos, in ip_rcv_finish_core()
344 iph = ip_hdr(skb); in ip_rcv_finish_core()
354 iph = ip_hdr(skb); in ip_rcv_finish_core()
365 err = ip_route_input_noref(skb, iph->daddr, iph->saddr, in ip_rcv_finish_core()
366 iph->tos, dev); in ip_rcv_finish_core()
483 iph = ip_hdr(skb); in ip_rcv_core()
496 if (iph->ihl < 5 || iph->version != 4) in ip_rcv_core()
509 iph = ip_hdr(skb); in ip_rcv_core()
511 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) in ip_rcv_core()
[all …]
A Dah4.c123 struct iphdr *iph; in ah_output_done() local
135 top_iph->tos = iph->tos; in ah_output_done()
136 top_iph->ttl = iph->ttl; in ah_output_done()
182 if (!iph) in ah_output()
194 iph->tos = top_iph->tos; in ah_output()
260 kfree(iph); in ah_output()
360 iph = ip_hdr(skb); in ah_input()
386 iph->ttl = 0; in ah_input()
387 iph->tos = 0; in ah_input()
388 iph->frag_off = 0; in ah_input()
[all …]
A Dipip.c139 iph->daddr, iph->saddr, 0); in ipip_err()
182 if (t->parms.iph.daddr == 0) { in ipip_err()
218 const struct iphdr *iph; in ipip_tunnel_rcv() local
220 iph = ip_hdr(skb); in ipip_tunnel_rcv()
222 iph->saddr, iph->daddr, 0); in ipip_tunnel_rcv()
227 tunnel->parms.iph.protocol != 0) in ipip_tunnel_rcv()
335 if (p->iph.version != 4 || in ipip_tunnel_ctl()
337 p->iph.ihl != 5 || (p->iph.frag_off & htons(~IP_DF))) in ipip_tunnel_ctl()
412 parms->iph.version = 4; in ipip_netlink_parms()
413 parms->iph.protocol = IPPROTO_IPIP; in ipip_netlink_parms()
[all …]
/linux-6.3-rc2/net/netfilter/
A Dxt_iprange.c20 const struct iphdr *iph = ip_hdr(skb); in iprange_mt4() local
24 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); in iprange_mt4()
25 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); in iprange_mt4()
29 &iph->saddr, in iprange_mt4()
37 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); in iprange_mt4()
38 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); in iprange_mt4()
42 &iph->daddr, in iprange_mt4()
69 const struct ipv6hdr *iph = ipv6_hdr(skb); in iprange_mt6() local
73 m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); in iprange_mt6()
78 &iph->saddr, in iprange_mt6()
[all …]
/linux-6.3-rc2/net/ipv6/
A Dip6_offload.c171 proto = iph->nexthdr; in ipv6_exthdrs_len()
194 struct ipv6hdr *iph; in ipv6_gro_receive() local
202 hlen = off + sizeof(*iph); in ipv6_gro_receive()
204 if (unlikely(!iph)) in ipv6_gro_receive()
213 proto = iph->nexthdr; in ipv6_gro_receive()
227 iph = ipv6_hdr(skb); in ipv6_gro_receive()
260 if (memcmp(iph + 1, iph2 + 1, in ipv6_gro_receive()
323 struct ipv6hdr *iph; in ipv6_gro_complete() local
354 iph->nexthdr = NEXTHDR_HOP; in ipv6_gro_complete()
355 iph->payload_len = 0; in ipv6_gro_complete()
[all …]
/linux-6.3-rc2/net/ipv6/netfilter/
A Dnft_fib_ipv6.c25 struct ipv6hdr *iph) in nft_fib6_flowi_init() argument
30 fl6->daddr = iph->daddr; in nft_fib6_flowi_init()
31 fl6->saddr = iph->saddr; in nft_fib6_flowi_init()
37 fl6->daddr = iph->saddr; in nft_fib6_flowi_init()
38 fl6->saddr = iph->daddr; in nft_fib6_flowi_init()
61 struct ipv6hdr *iph) in __nft_fib6_eval_type() argument
133 struct ipv6hdr *iph, _iph; in nft_fib6_eval_type() local
136 if (!iph) { in nft_fib6_eval_type()
141 *dest = __nft_fib6_eval_type(priv, pkt, iph); in nft_fib6_eval_type()
163 struct ipv6hdr *iph, _iph; in nft_fib6_eval() local
[all …]
/linux-6.3-rc2/net/ipv4/netfilter/
A Dnft_fib_ipv4.c34 struct iphdr *iph, _iph; in nft_fib4_eval_type() local
43 if (!iph) { in nft_fib4_eval_type()
49 addr = iph->daddr; in nft_fib4_eval_type()
51 addr = iph->saddr; in nft_fib4_eval_type()
63 struct iphdr *iph, _iph; in nft_fib4_eval() local
97 if (!iph) { in nft_fib4_eval()
102 if (ipv4_is_zeronet(iph->saddr)) { in nft_fib4_eval()
103 if (ipv4_is_lbcast(iph->daddr) || in nft_fib4_eval()
116 fl4.daddr = iph->daddr; in nft_fib4_eval()
117 fl4.saddr = get_saddr(iph->saddr); in nft_fib4_eval()
[all …]
/linux-6.3-rc2/net/sched/
A Dact_nat.c120 struct iphdr *iph; in tcf_nat_act() local
148 iph = ip_hdr(skb); in tcf_nat_act()
151 addr = iph->saddr; in tcf_nat_act()
153 addr = iph->daddr; in tcf_nat_act()
163 iph = ip_hdr(skb); in tcf_nat_act()
165 iph->saddr = new_addr; in tcf_nat_act()
167 iph->daddr = new_addr; in tcf_nat_act()
175 ihl = iph->ihl * 4; in tcf_nat_act()
178 switch (iph->frag_off & htons(IP_OFFSET) ? 0 : iph->protocol) { in tcf_nat_act()
228 addr = iph->daddr; in tcf_nat_act()
[all …]

Completed in 55 milliseconds

12345678910>>...13