/kernel/linux/linux-5.10/net/xfrm/ |
D | xfrm_inout.h | 11 const struct iphdr *iph = ip_hdr(skb); in xfrm4_extract_header() local 13 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); in xfrm4_extract_header() 14 XFRM_MODE_SKB_CB(skb)->id = iph->id; in xfrm4_extract_header() 15 XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off; 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 28 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); in xfrm6_extract_header() 31 XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); in xfrm6_extract_header() [all …]
|
/kernel/linux/linux-5.10/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() 59 struct iphdr *iph; in nft_set_pktinfo_ipv4_ingress() local 62 if (!pskb_may_pull(skb, sizeof(*iph))) in nft_set_pktinfo_ipv4_ingress() [all …]
|
D | nf_queue.h | 49 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 …]
|
/kernel/linux/linux-5.10/net/netfilter/ipvs/ |
D | ip_vs_proto_ah_esp.c | 41 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() 47 &iph->daddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 50 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto() 51 &iph->saddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 56 const struct ip_vs_iphdr *iph) in ah_esp_conn_in_get() argument 61 ah_esp_conn_fill_param_proto(ipvs, af, iph, &p); in ah_esp_conn_in_get() 70 ip_vs_iph_icmp(iph) ? "ICMP+" : "", in ah_esp_conn_in_get() 71 ip_vs_proto_get(iph->protocol)->name, in ah_esp_conn_in_get() [all …]
|
D | ip_vs_core.c | 74 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph)); 80 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph)); 267 int *ignored, struct ip_vs_iphdr *iph) in ip_vs_sched_persist() argument 280 if (likely(!ip_vs_iph_inverse(iph))) { in ip_vs_sched_persist() 281 src_addr = &iph->saddr; in ip_vs_sched_persist() 282 dst_addr = &iph->daddr; in ip_vs_sched_persist() 284 src_addr = &iph->daddr; in ip_vs_sched_persist() 285 dst_addr = &iph->saddr; in ip_vs_sched_persist() 318 int protocol = iph->protocol; in ip_vs_sched_persist() 365 dest = sched->schedule(svc, skb, iph); in ip_vs_sched_persist() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
D | xdping_kern.c | 65 struct iphdr *iph; in icmp_check() local 67 if (data + sizeof(*eth) + sizeof(*iph) + ICMP_ECHO_LEN > data_end) in icmp_check() 73 iph = data + sizeof(*eth); in icmp_check() 75 if (iph->protocol != IPPROTO_ICMP) in icmp_check() 78 if (bpf_ntohs(iph->tot_len) - sizeof(*iph) != ICMP_ECHO_LEN) in icmp_check() 81 icmph = data + sizeof(*eth) + sizeof(*iph); in icmp_check() 97 struct iphdr *iph; in xdping_client() local 109 iph = data + sizeof(*eth); in xdping_client() 110 icmph = data + sizeof(*eth) + sizeof(*iph); in xdping_client() 111 raddr = iph->saddr; in xdping_client() [all …]
|
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 …]
|
D | test_xdp_loop.c | 83 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local 91 if (iph + 1 > data_end) in handle_ipv4() 94 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 98 vip.protocol = iph->protocol; in handle_ipv4() 100 vip.daddr.v4 = iph->daddr; in handle_ipv4() 102 payload_len = bpf_ntohs(iph->tot_len); in handle_ipv4() 116 iph = data + sizeof(*new_eth); in handle_ipv4() 117 old_eth = data + sizeof(*iph); in handle_ipv4() 121 iph + 1 > data_end) in handle_ipv4() 126 iph->version = 4; in handle_ipv4() [all …]
|
/kernel/linux/linux-5.10/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 …]
|
/kernel/linux/linux-5.10/include/net/ |
D | inet_ecn.h | 76 static inline int IP_ECN_set_ce(struct iphdr *iph) in IP_ECN_set_ce() argument 78 u32 check = (__force u32)iph->check; in IP_ECN_set_ce() 79 u32 ecn = (iph->tos + 1) & INET_ECN_MASK; in IP_ECN_set_ce() 98 iph->check = (__force __sum16)(check + (check>=0xFFFF)); in IP_ECN_set_ce() 99 iph->tos |= INET_ECN_CE; in IP_ECN_set_ce() 103 static inline int IP_ECN_set_ect1(struct iphdr *iph) in IP_ECN_set_ect1() argument 105 u32 check = (__force u32)iph->check; in IP_ECN_set_ect1() 107 if ((iph->tos & INET_ECN_MASK) != INET_ECN_ECT_0) in IP_ECN_set_ect1() 112 iph->check = (__force __sum16)(check + (check>=0xFFFF)); in IP_ECN_set_ect1() 113 iph->tos ^= INET_ECN_MASK; in IP_ECN_set_ect1() [all …]
|
/kernel/linux/linux-5.10/net/ipv4/ |
D | xfrm4_input.c | 31 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 52 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_transport_finish() 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() [all …]
|
D | ip_input.c | 260 const struct iphdr *iph; in ip_rcv_options() local 274 iph = ip_hdr(skb); in ip_rcv_options() 276 opt->optlen = iph->ihl*4 - sizeof(struct iphdr); in ip_rcv_options() 290 &iph->saddr, in ip_rcv_options() 291 &iph->daddr); in ip_rcv_options() 305 static bool ip_can_use_hint(const struct sk_buff *skb, const struct iphdr *iph, in ip_can_use_hint() argument 308 return hint && !skb_dst(skb) && ip_hdr(hint)->daddr == iph->daddr && in ip_can_use_hint() 309 ip_hdr(hint)->tos == iph->tos; in ip_can_use_hint() 318 const struct iphdr *iph = ip_hdr(skb); in ip_rcv_finish_core() local 323 if (ip_can_use_hint(skb, iph, hint)) { in ip_rcv_finish_core() [all …]
|
D | ipip.c | 132 const struct iphdr *iph = (const struct iphdr *)skb->data; in ipip_err() local 139 iph->daddr, iph->saddr, 0); in ipip_err() 173 ipv4_update_pmtu(skb, net, info, t->parms.link, iph->protocol); in ipip_err() 178 ipv4_redirect(skb, net, t->parms.link, iph->protocol); in ipip_err() 182 if (t->parms.iph.daddr == 0) { in ipip_err() 187 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) 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() 226 if (tunnel->parms.iph.protocol != ipproto && in ipip_tunnel_rcv() [all …]
|
D | ah4.c | 80 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) in ip_clear_mutable_options() argument 82 unsigned char *optptr = (unsigned char *)(iph+1); in ip_clear_mutable_options() 83 int l = iph->ihl*4 - sizeof(struct iphdr); in ip_clear_mutable_options() 123 struct iphdr *iph; in ah_output_done() local 131 iph = AH_SKB_CB(skb)->tmp; in ah_output_done() 132 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done() 135 top_iph->tos = iph->tos; in ah_output_done() 136 top_iph->ttl = iph->ttl; in ah_output_done() 137 top_iph->frag_off = iph->frag_off; in ah_output_done() 139 top_iph->daddr = iph->daddr; in ah_output_done() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
D | flow_dissector.c | 43 struct iphdr iph; member 49 struct iphdr iph; member 58 struct iphdr iph; member 64 struct ipv6hdr iph; member 70 struct ipv6hdr iph; member 86 struct ipv6hdr iph; member 112 .iph.ihl = 5, 113 .iph.protocol = IPPROTO_TCP, 114 .iph.tot_len = __bpf_constant_htons(MAGIC_BYTES), 133 .iph.nexthdr = IPPROTO_TCP, [all …]
|
/kernel/linux/linux-5.10/net/netfilter/ |
D | xt_iprange.c | 20 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() 74 m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr); in iprange_mt6() [all …]
|
D | xt_TPROXY.c | 39 const struct iphdr *iph = ip_hdr(skb); in tproxy_tg4() local 51 sk = nf_tproxy_get_sock_v4(net, skb, iph->protocol, in tproxy_tg4() 52 iph->saddr, iph->daddr, in tproxy_tg4() 56 laddr = nf_tproxy_laddr4(skb, laddr, iph->daddr); in tproxy_tg4() 67 sk = nf_tproxy_get_sock_v4(net, skb, iph->protocol, in tproxy_tg4() 68 iph->saddr, laddr, in tproxy_tg4() 79 iph->protocol, &iph->daddr, ntohs(hp->dest), in tproxy_tg4() 87 iph->protocol, &iph->saddr, ntohs(hp->source), in tproxy_tg4() 88 &iph->daddr, ntohs(hp->dest), skb->mark); in tproxy_tg4() 115 const struct ipv6hdr *iph = ipv6_hdr(skb); in tproxy_tg6_v1() local [all …]
|
D | nf_flow_table_ip.c | 70 static int nf_flow_nat_ip_l4proto(struct sk_buff *skb, struct iphdr *iph, in nf_flow_nat_ip_l4proto() argument 74 switch (iph->protocol) { in nf_flow_nat_ip_l4proto() 89 struct iphdr *iph, unsigned int thoff, in nf_flow_snat_ip() argument 96 addr = iph->saddr; in nf_flow_snat_ip() 98 iph->saddr = new_addr; in nf_flow_snat_ip() 101 addr = iph->daddr; in nf_flow_snat_ip() 103 iph->daddr = new_addr; in nf_flow_snat_ip() 108 csum_replace4(&iph->check, addr, new_addr); in nf_flow_snat_ip() 110 return nf_flow_nat_ip_l4proto(skb, iph, thoff, addr, new_addr); in nf_flow_snat_ip() 114 struct iphdr *iph, unsigned int thoff, in nf_flow_dnat_ip() argument [all …]
|
/kernel/linux/linux-5.10/net/sched/ |
D | act_nat.c | 106 struct iphdr *iph; in tcf_nat_act() local 133 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat_act() 136 iph = ip_hdr(skb); in tcf_nat_act() 139 addr = iph->saddr; in tcf_nat_act() 141 addr = iph->daddr; in tcf_nat_act() 144 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat_act() 151 iph = ip_hdr(skb); in tcf_nat_act() 153 iph->saddr = new_addr; in tcf_nat_act() 155 iph->daddr = new_addr; in tcf_nat_act() 157 csum_replace4(&iph->check, addr, new_addr); in tcf_nat_act() [all …]
|
/kernel/linux/linux-5.10/net/ipv6/netfilter/ |
D | nft_fib_ipv6.c | 25 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() 33 fl6->daddr = iph->saddr; in nft_fib6_flowi_init() 34 fl6->saddr = iph->daddr; in nft_fib6_flowi_init() 48 fl6->flowlabel = (*(__be32 *)iph) & IPV6_FLOWINFO_MASK; in nft_fib6_flowi_init() 55 struct ipv6hdr *iph) in __nft_fib6_eval_type() argument 71 nft_fib6_flowi_init(&fl6, priv, pkt, dev, iph); in __nft_fib6_eval_type() 126 struct ipv6hdr *iph, _iph; in nft_fib6_eval_type() local 128 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib6_eval_type() [all …]
|
/kernel/linux/linux-5.10/net/ipv4/netfilter/ |
D | nft_fib_ipv4.c | 34 struct iphdr *iph, _iph; in nft_fib4_eval_type() local 42 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval_type() 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 92 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval() 93 if (!iph) { in nft_fib4_eval() 98 if (ipv4_is_zeronet(iph->saddr)) { in nft_fib4_eval() 99 if (ipv4_is_lbcast(iph->daddr) || in nft_fib4_eval() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/ |
D | en_selftest.c | 108 struct iphdr *iph; in mlx5e_test_get_udp_skb() local 125 iph = skb_put(skb, sizeof(struct iphdr)); in mlx5e_test_get_udp_skb() 142 iph->ihl = 5; in mlx5e_test_get_udp_skb() 143 iph->ttl = 32; in mlx5e_test_get_udp_skb() 144 iph->version = 4; in mlx5e_test_get_udp_skb() 145 iph->protocol = IPPROTO_UDP; in mlx5e_test_get_udp_skb() 148 iph->tot_len = htons(iplen); in mlx5e_test_get_udp_skb() 149 iph->frag_off = 0; in mlx5e_test_get_udp_skb() 150 iph->saddr = 0; in mlx5e_test_get_udp_skb() 151 iph->daddr = 0; in mlx5e_test_get_udp_skb() [all …]
|
/kernel/linux/linux-5.10/net/ipv6/ |
D | sit.c | 108 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 109 remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 116 if (remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 123 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 138 __be32 remote = parms->iph.daddr; in __ipip6_bucket() 139 __be32 local = parms->iph.saddr; in __ipip6_bucket() 207 memcpy(dev->dev_addr, &t->parms.iph.saddr, 4); in ipip6_tunnel_create() 208 memcpy(dev->broadcast, &t->parms.iph.daddr, 4); in ipip6_tunnel_create() 231 __be32 remote = parms->iph.daddr; in ipip6_tunnel_locate() 232 __be32 local = parms->iph.saddr; in ipip6_tunnel_locate() [all …]
|