/Linux-v4.19/net/netfilter/ipvs/ |
D | ip_vs_proto_ah_esp.c | 45 const struct ip_vs_iphdr *iph, in ah_esp_conn_fill_param_proto() argument 48 if (likely(!ip_vs_iph_inverse(iph))) in ah_esp_conn_fill_param_proto() 50 &iph->saddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto() 51 &iph->daddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 54 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto() 55 &iph->saddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 60 const struct ip_vs_iphdr *iph) in ah_esp_conn_in_get() argument 65 ah_esp_conn_fill_param_proto(ipvs, af, iph, &p); in ah_esp_conn_in_get() 74 ip_vs_iph_icmp(iph) ? "ICMP+" : "", in ah_esp_conn_in_get() 75 ip_vs_proto_get(iph->protocol)->name, in ah_esp_conn_in_get() [all …]
|
D | ip_vs_core.c | 246 int *ignored, struct ip_vs_iphdr *iph) in ip_vs_sched_persist() argument 259 if (likely(!ip_vs_iph_inverse(iph))) { in ip_vs_sched_persist() 260 src_addr = &iph->saddr; in ip_vs_sched_persist() 261 dst_addr = &iph->daddr; in ip_vs_sched_persist() 263 src_addr = &iph->daddr; in ip_vs_sched_persist() 264 dst_addr = &iph->saddr; in ip_vs_sched_persist() 297 int protocol = iph->protocol; in ip_vs_sched_persist() 344 dest = sched->schedule(svc, skb, iph); in ip_vs_sched_persist() 382 && iph->protocol == IPPROTO_UDP) ? in ip_vs_sched_persist() 388 ip_vs_conn_fill_param(svc->ipvs, svc->af, iph->protocol, src_addr, in ip_vs_sched_persist() [all …]
|
/Linux-v4.19/samples/bpf/ |
D | xdp_tx_iptunnel_kern.c | 84 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local 92 if (iph + 1 > data_end) in handle_ipv4() 95 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 99 vip.protocol = iph->protocol; in handle_ipv4() 101 vip.daddr.v4 = iph->daddr; in handle_ipv4() 103 payload_len = ntohs(iph->tot_len); in handle_ipv4() 119 iph = data + sizeof(*new_eth); in handle_ipv4() 120 old_eth = data + sizeof(*iph); in handle_ipv4() 124 iph + 1 > data_end) in handle_ipv4() 129 iph->version = 4; in handle_ipv4() [all …]
|
D | parse_varlen.c | 53 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() 64 if (iph->protocol == IPPROTO_IPIP) { in parse_ipv4() 65 iph = data + nh_off + ihl_len; in parse_ipv4() 66 if (iph + 1 > data_end) in parse_ipv4() 68 ihl_len += iph->ihl * 4; in parse_ipv4() 71 if (iph->protocol == IPPROTO_TCP) in parse_ipv4() [all …]
|
D | xdp_fwd_kern.c | 34 static __always_inline int ip_decrease_ttl(struct iphdr *iph) in ip_decrease_ttl() argument 36 u32 check = (__force u32)iph->check; in ip_decrease_ttl() 39 iph->check = (__force __sum16)(check + (check >= 0xFFFF)); 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() [all …]
|
D | xdp_adjust_tail_kern.c | 79 struct iphdr *iph, *orig_iph; in send_icmp4_too_big() local 88 iph = data + off; in send_icmp4_too_big() 99 iph->ttl = DEFAULT_TTL; in send_icmp4_too_big() 100 iph->daddr = orig_iph->saddr; in send_icmp4_too_big() 101 iph->saddr = orig_iph->daddr; in send_icmp4_too_big() 102 iph->version = 4; in send_icmp4_too_big() 103 iph->ihl = 5; in send_icmp4_too_big() 104 iph->protocol = IPPROTO_ICMP; in send_icmp4_too_big() 105 iph->tos = 0; in send_icmp4_too_big() 106 iph->tot_len = htons( in send_icmp4_too_big() [all …]
|
/Linux-v4.19/tools/testing/selftests/bpf/ |
D | test_xdp.c | 87 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local 95 if (iph + 1 > data_end) in handle_ipv4() 98 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 102 vip.protocol = iph->protocol; in handle_ipv4() 104 vip.daddr.v4 = iph->daddr; in handle_ipv4() 106 payload_len = bpf_ntohs(iph->tot_len); in handle_ipv4() 120 iph = data + sizeof(*new_eth); in handle_ipv4() 121 old_eth = data + sizeof(*iph); in handle_ipv4() 125 iph + 1 > data_end) in handle_ipv4() 130 iph->version = 4; in handle_ipv4() [all …]
|
/Linux-v4.19/net/ipv4/ |
D | xfrm4_mode_beet.c | 22 struct iphdr *iph = ip_hdr(skb); in xfrm4_beet_make_header() local 24 iph->ihl = 5; in xfrm4_beet_make_header() 25 iph->version = 4; in xfrm4_beet_make_header() 27 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_beet_make_header() 28 iph->tos = XFRM_MODE_SKB_CB(skb)->tos; in xfrm4_beet_make_header() 30 iph->id = XFRM_MODE_SKB_CB(skb)->id; in xfrm4_beet_make_header() 31 iph->frag_off = XFRM_MODE_SKB_CB(skb)->frag_off; in xfrm4_beet_make_header() 32 iph->ttl = XFRM_MODE_SKB_CB(skb)->ttl; in xfrm4_beet_make_header() 85 struct iphdr *iph; in xfrm4_beet_input() local 110 skb_push(skb, sizeof(*iph)); in xfrm4_beet_input() [all …]
|
D | xfrm4_input.c | 36 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() local 38 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, in xfrm4_rcv_encap_finish() 39 iph->tos, skb->dev)) in xfrm4_rcv_encap_finish() 55 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() local 57 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_transport_finish() 61 return -iph->protocol; in xfrm4_transport_finish() 65 iph->tot_len = htons(skb->len); in xfrm4_transport_finish() 66 ip_send_check(iph); in xfrm4_transport_finish() 91 struct iphdr *iph; in xfrm4_udp_encap_rcv() local 150 iph = ip_hdr(skb); in xfrm4_udp_encap_rcv() [all …]
|
D | ipip.c | 137 const struct iphdr *iph = (const struct iphdr *)skb->data; in ipip_err() local 171 iph->daddr, iph->saddr, 0); in ipip_err() 179 iph->protocol, 0); in ipip_err() 184 ipv4_redirect(skb, net, t->parms.link, 0, iph->protocol, 0); in ipip_err() 188 if (t->parms.iph.daddr == 0) { in ipip_err() 193 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipip_err() 224 const struct iphdr *iph; in ipip_tunnel_rcv() local 226 iph = ip_hdr(skb); in ipip_tunnel_rcv() 228 iph->saddr, iph->daddr, 0); in ipip_tunnel_rcv() 232 if (tunnel->parms.iph.protocol != ipproto && in ipip_tunnel_rcv() [all …]
|
D | ah4.c | 79 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) in ip_clear_mutable_options() argument 81 unsigned char *optptr = (unsigned char *)(iph+1); in ip_clear_mutable_options() 82 int l = iph->ihl*4 - sizeof(struct iphdr); in ip_clear_mutable_options() 122 struct iphdr *iph; in ah_output_done() local 130 iph = AH_SKB_CB(skb)->tmp; in ah_output_done() 131 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done() 134 top_iph->tos = iph->tos; in ah_output_done() 135 top_iph->ttl = iph->ttl; in ah_output_done() 136 top_iph->frag_off = iph->frag_off; in ah_output_done() 138 top_iph->daddr = iph->daddr; in ah_output_done() [all …]
|
D | ip_input.c | 264 const struct iphdr *iph; in ip_rcv_options() local 279 iph = ip_hdr(skb); in ip_rcv_options() 281 opt->optlen = iph->ihl*4 - sizeof(struct iphdr); in ip_rcv_options() 295 &iph->saddr, in ip_rcv_options() 296 &iph->daddr); in ip_rcv_options() 313 const struct iphdr *iph = ip_hdr(skb); in ip_rcv_finish_core() local 322 !ip_is_fragment(iph)) { in ip_rcv_finish_core() 324 int protocol = iph->protocol; in ip_rcv_finish_core() 332 iph = ip_hdr(skb); in ip_rcv_finish_core() 341 err = ip_route_input_noref(skb, iph->daddr, iph->saddr, in ip_rcv_finish_core() [all …]
|
/Linux-v4.19/include/net/netfilter/ |
D | nf_tables_ipv4.h | 23 struct iphdr *iph, _iph; in __nft_set_pktinfo_ipv4_validate() local 26 iph = skb_header_pointer(skb, skb_network_offset(skb), sizeof(*iph), in __nft_set_pktinfo_ipv4_validate() 28 if (!iph) in __nft_set_pktinfo_ipv4_validate() 31 if (iph->ihl < 5 || iph->version != 4) in __nft_set_pktinfo_ipv4_validate() 34 len = ntohs(iph->tot_len); in __nft_set_pktinfo_ipv4_validate() 35 thoff = iph->ihl * 4; in __nft_set_pktinfo_ipv4_validate() 42 pkt->tprot = iph->protocol; in __nft_set_pktinfo_ipv4_validate() 44 pkt->xt.fragoff = ntohs(iph->frag_off) & IP_OFFSET; in __nft_set_pktinfo_ipv4_validate()
|
D | nf_queue.h | 44 static inline u32 hash_v4(const struct iphdr *iph, u32 initval) in hash_v4() argument 47 if ((__force u32)iph->saddr < (__force u32)iph->daddr) in hash_v4() 48 return jhash_3words((__force u32)iph->saddr, in hash_v4() 49 (__force u32)iph->daddr, iph->protocol, initval); in hash_v4() 51 return jhash_3words((__force u32)iph->daddr, in hash_v4() 52 (__force u32)iph->saddr, iph->protocol, initval); in hash_v4() 80 struct iphdr *iph, _iph; in hash_bridge() local 84 iph = skb_header_pointer(skb, skb_network_offset(skb), in hash_bridge() 85 sizeof(*iph), &_iph); in hash_bridge() 86 if (iph) in hash_bridge() [all …]
|
/Linux-v4.19/net/netfilter/ |
D | nf_flow_table_ip.c | 73 static int nf_flow_nat_ip_l4proto(struct sk_buff *skb, struct iphdr *iph, in nf_flow_nat_ip_l4proto() argument 77 switch (iph->protocol) { in nf_flow_nat_ip_l4proto() 92 struct iphdr *iph, unsigned int thoff, in nf_flow_snat_ip() argument 99 addr = iph->saddr; in nf_flow_snat_ip() 101 iph->saddr = new_addr; in nf_flow_snat_ip() 104 addr = iph->daddr; in nf_flow_snat_ip() 106 iph->daddr = new_addr; in nf_flow_snat_ip() 111 csum_replace4(&iph->check, addr, new_addr); in nf_flow_snat_ip() 113 return nf_flow_nat_ip_l4proto(skb, iph, thoff, addr, new_addr); in nf_flow_snat_ip() 117 struct iphdr *iph, unsigned int thoff, in nf_flow_dnat_ip() argument [all …]
|
D | xt_iprange.c | 23 const struct iphdr *iph = ip_hdr(skb); in iprange_mt4() local 27 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); in iprange_mt4() 28 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); in iprange_mt4() 32 &iph->saddr, in iprange_mt4() 40 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); in iprange_mt4() 41 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); in iprange_mt4() 45 &iph->daddr, in iprange_mt4() 72 const struct ipv6hdr *iph = ipv6_hdr(skb); in iprange_mt6() local 76 m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); in iprange_mt6() 77 m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr); in iprange_mt6() [all …]
|
D | xt_TPROXY.c | 43 const struct iphdr *iph = ip_hdr(skb); in tproxy_tg4() local 55 sk = nf_tproxy_get_sock_v4(net, skb, iph->protocol, in tproxy_tg4() 56 iph->saddr, iph->daddr, in tproxy_tg4() 60 laddr = nf_tproxy_laddr4(skb, laddr, iph->daddr); in tproxy_tg4() 71 sk = nf_tproxy_get_sock_v4(net, skb, iph->protocol, in tproxy_tg4() 72 iph->saddr, laddr, in tproxy_tg4() 83 iph->protocol, &iph->daddr, ntohs(hp->dest), in tproxy_tg4() 91 iph->protocol, &iph->saddr, ntohs(hp->source), in tproxy_tg4() 92 &iph->daddr, ntohs(hp->dest), skb->mark); in tproxy_tg4() 119 const struct ipv6hdr *iph = ipv6_hdr(skb); in tproxy_tg6_v1() local [all …]
|
/Linux-v4.19/net/sched/ |
D | act_nat.c | 100 struct iphdr *iph; in tcf_nat_act() local 127 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat_act() 130 iph = ip_hdr(skb); in tcf_nat_act() 133 addr = iph->saddr; in tcf_nat_act() 135 addr = iph->daddr; in tcf_nat_act() 138 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat_act() 145 iph = ip_hdr(skb); in tcf_nat_act() 147 iph->saddr = new_addr; in tcf_nat_act() 149 iph->daddr = new_addr; in tcf_nat_act() 151 csum_replace4(&iph->check, addr, new_addr); in tcf_nat_act() [all …]
|
/Linux-v4.19/drivers/net/ethernet/mellanox/mlx5/core/ |
D | en_selftest.c | 119 struct iphdr *iph; in mlx5e_test_get_udp_skb() local 123 (sizeof(*ethh) + sizeof(*iph) + sizeof(*udph)); in mlx5e_test_get_udp_skb() 139 iph = skb_put(skb, sizeof(struct iphdr)); in mlx5e_test_get_udp_skb() 156 iph->ihl = 5; in mlx5e_test_get_udp_skb() 157 iph->ttl = 32; in mlx5e_test_get_udp_skb() 158 iph->version = 4; in mlx5e_test_get_udp_skb() 159 iph->protocol = IPPROTO_UDP; in mlx5e_test_get_udp_skb() 161 iph->tot_len = htons(iplen); in mlx5e_test_get_udp_skb() 162 iph->frag_off = 0; in mlx5e_test_get_udp_skb() 163 iph->saddr = 0; in mlx5e_test_get_udp_skb() [all …]
|
/Linux-v4.19/net/ipv6/ |
D | sit.c | 105 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 106 remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 113 if (remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 120 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 135 __be32 remote = parms->iph.daddr; in __ipip6_bucket() 136 __be32 local = parms->iph.saddr; in __ipip6_bucket() 204 memcpy(dev->dev_addr, &t->parms.iph.saddr, 4); in ipip6_tunnel_create() 205 memcpy(dev->broadcast, &t->parms.iph.daddr, 4); in ipip6_tunnel_create() 230 __be32 remote = parms->iph.daddr; in ipip6_tunnel_locate() 231 __be32 local = parms->iph.saddr; in ipip6_tunnel_locate() [all …]
|
D | ip6_offload.c | 144 static int ipv6_exthdrs_len(struct ipv6hdr *iph, in ipv6_exthdrs_len() argument 147 struct ipv6_opt_hdr *opth = (void *)iph; in ipv6_exthdrs_len() 148 int len = 0, proto, optlen = sizeof(*iph); in ipv6_exthdrs_len() 150 proto = iph->nexthdr; in ipv6_exthdrs_len() 173 struct ipv6hdr *iph; in ipv6_gro_receive() local 181 hlen = off + sizeof(*iph); in ipv6_gro_receive() 182 iph = skb_gro_header_fast(skb, off); in ipv6_gro_receive() 184 iph = skb_gro_header_slow(skb, hlen, off); in ipv6_gro_receive() 185 if (unlikely(!iph)) in ipv6_gro_receive() 190 skb_gro_pull(skb, sizeof(*iph)); in ipv6_gro_receive() [all …]
|
/Linux-v4.19/net/ipv4/netfilter/ |
D | nft_fib_ipv4.c | 38 struct iphdr *iph, _iph; in nft_fib4_eval_type() local 46 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval_type() 47 if (!iph) { in nft_fib4_eval_type() 53 addr = iph->daddr; in nft_fib4_eval_type() 55 addr = iph->saddr; in nft_fib4_eval_type() 72 struct iphdr *iph, _iph; in nft_fib4_eval() local 105 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval() 106 if (!iph) { in nft_fib4_eval() 111 if (ipv4_is_zeronet(iph->saddr)) { in nft_fib4_eval() 112 if (ipv4_is_lbcast(iph->daddr) || in nft_fib4_eval() [all …]
|
D | nft_chain_route_ipv4.c | 33 const struct iphdr *iph; in nf_route_table_hook() local 40 iph = ip_hdr(skb); in nf_route_table_hook() 41 saddr = iph->saddr; in nf_route_table_hook() 42 daddr = iph->daddr; in nf_route_table_hook() 43 tos = iph->tos; in nf_route_table_hook() 47 iph = ip_hdr(skb); in nf_route_table_hook() 49 if (iph->saddr != saddr || in nf_route_table_hook() 50 iph->daddr != daddr || in nf_route_table_hook() 52 iph->tos != tos) { in nf_route_table_hook()
|
D | ipt_SYNPROXY.c | 25 struct iphdr *iph; in synproxy_build_ip() local 28 iph = skb_put(skb, sizeof(*iph)); in synproxy_build_ip() 29 iph->version = 4; in synproxy_build_ip() 30 iph->ihl = sizeof(*iph) / 4; in synproxy_build_ip() 31 iph->tos = 0; in synproxy_build_ip() 32 iph->id = 0; in synproxy_build_ip() 33 iph->frag_off = htons(IP_DF); in synproxy_build_ip() 34 iph->ttl = net->ipv4.sysctl_ip_default_ttl; in synproxy_build_ip() 35 iph->protocol = IPPROTO_TCP; in synproxy_build_ip() 36 iph->check = 0; in synproxy_build_ip() [all …]
|
/Linux-v4.19/include/net/ |
D | dsfield.h | 16 static inline __u8 ipv4_get_dsfield(const struct iphdr *iph) in ipv4_get_dsfield() argument 18 return iph->tos; in ipv4_get_dsfield() 28 static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, in ipv4_change_dsfield() argument 31 __u32 check = ntohs((__force __be16)iph->check); in ipv4_change_dsfield() 34 dsfield = (iph->tos & mask) | value; in ipv4_change_dsfield() 35 check += iph->tos; in ipv4_change_dsfield() 39 iph->check = (__force __sum16)htons(check); in ipv4_change_dsfield() 40 iph->tos = dsfield; in ipv4_change_dsfield()
|