/Linux-v5.4/net/xfrm/ |
D | xfrm_inout.h | 11 struct ipv6hdr *iph = ipv6_hdr(skb); in xfrm6_beet_make_header() local 13 iph->version = 6; in xfrm6_beet_make_header() 15 memcpy(iph->flow_lbl, XFRM_MODE_SKB_CB(skb)->flow_lbl, in xfrm6_beet_make_header() 16 sizeof(iph->flow_lbl)); in xfrm6_beet_make_header() 17 iph->nexthdr = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm6_beet_make_header() 19 ipv6_change_dsfield(iph, 0, XFRM_MODE_SKB_CB(skb)->tos); in xfrm6_beet_make_header() 20 iph->hop_limit = XFRM_MODE_SKB_CB(skb)->ttl; in xfrm6_beet_make_header() 25 struct iphdr *iph = ip_hdr(skb); in xfrm4_beet_make_header() local 27 iph->ihl = 5; in xfrm4_beet_make_header() 28 iph->version = 4; in xfrm4_beet_make_header() [all …]
|
/Linux-v5.4/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 …]
|
/Linux-v5.4/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 …]
|
D | test_lwt_ip_encap.c | 19 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-v5.4/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 | 35 static __always_inline int ip_decrease_ttl(struct iphdr *iph) in ip_decrease_ttl() argument 37 u32 check = (__force u32)iph->check; in ip_decrease_ttl() 40 iph->check = (__force __sum16)(check + (check >= 0xFFFF)); in ip_decrease_ttl() 41 return --iph->ttl; in ip_decrease_ttl() 51 struct iphdr *iph; in xdp_fwd_flags() local 64 iph = data + nh_off; in xdp_fwd_flags() 66 if (iph + 1 > data_end) in xdp_fwd_flags() 69 if (iph->ttl <= 1) in xdp_fwd_flags() 73 fib_params.tos = iph->tos; in xdp_fwd_flags() 74 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-v5.4/tools/testing/selftests/bpf/prog_tests/ |
D | flow_dissector.c | 40 struct iphdr iph; member 46 struct iphdr iph; member 55 struct iphdr iph; member 61 struct ipv6hdr iph; member 67 struct ipv6hdr iph; member 83 struct ipv6hdr iph; member 108 .iph.ihl = 5, 109 .iph.protocol = IPPROTO_TCP, 110 .iph.tot_len = __bpf_constant_htons(MAGIC_BYTES), 129 .iph.nexthdr = IPPROTO_TCP, [all …]
|
/Linux-v5.4/net/ipv4/ |
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 | 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 …]
|
D | xfrm4_state.c | 20 const struct iphdr *iph = ip_hdr(skb); in xfrm4_extract_header() local 22 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); in xfrm4_extract_header() 23 XFRM_MODE_SKB_CB(skb)->id = iph->id; in xfrm4_extract_header() 24 XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off; in xfrm4_extract_header() 25 XFRM_MODE_SKB_CB(skb)->tos = iph->tos; in xfrm4_extract_header() 26 XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl; in xfrm4_extract_header() 27 XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph); in xfrm4_extract_header()
|
/Linux-v5.4/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 | 46 static inline u32 hash_v4(const struct iphdr *iph, u32 initval) in hash_v4() argument 49 if ((__force u32)iph->saddr < (__force u32)iph->daddr) in hash_v4() 50 return jhash_3words((__force u32)iph->saddr, in hash_v4() 51 (__force u32)iph->daddr, iph->protocol, initval); in hash_v4() 53 return jhash_3words((__force u32)iph->daddr, in hash_v4() 54 (__force u32)iph->saddr, iph->protocol, initval); in hash_v4() 82 struct iphdr *iph, _iph; in hash_bridge() local 86 iph = skb_header_pointer(skb, skb_network_offset(skb), in hash_bridge() 87 sizeof(*iph), &_iph); in hash_bridge() 88 if (iph) in hash_bridge() [all …]
|
/Linux-v5.4/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 | nf_flow_table_ip.c | 74 static int nf_flow_nat_ip_l4proto(struct sk_buff *skb, struct iphdr *iph, in nf_flow_nat_ip_l4proto() argument 78 switch (iph->protocol) { in nf_flow_nat_ip_l4proto() 93 struct iphdr *iph, unsigned int thoff, in nf_flow_snat_ip() argument 100 addr = iph->saddr; in nf_flow_snat_ip() 102 iph->saddr = new_addr; in nf_flow_snat_ip() 105 addr = iph->daddr; in nf_flow_snat_ip() 107 iph->daddr = new_addr; in nf_flow_snat_ip() 112 csum_replace4(&iph->check, addr, new_addr); in nf_flow_snat_ip() 114 return nf_flow_nat_ip_l4proto(skb, iph, thoff, addr, new_addr); in nf_flow_snat_ip() 118 struct iphdr *iph, unsigned int thoff, in nf_flow_dnat_ip() argument [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 …]
|
/Linux-v5.4/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 …]
|
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/ |
D | en_selftest.c | 109 struct iphdr *iph; in mlx5e_test_get_udp_skb() local 126 iph = skb_put(skb, sizeof(struct iphdr)); in mlx5e_test_get_udp_skb() 143 iph->ihl = 5; in mlx5e_test_get_udp_skb() 144 iph->ttl = 32; in mlx5e_test_get_udp_skb() 145 iph->version = 4; in mlx5e_test_get_udp_skb() 146 iph->protocol = IPPROTO_UDP; in mlx5e_test_get_udp_skb() 149 iph->tot_len = htons(iplen); in mlx5e_test_get_udp_skb() 150 iph->frag_off = 0; in mlx5e_test_get_udp_skb() 151 iph->saddr = 0; in mlx5e_test_get_udp_skb() 152 iph->daddr = 0; in mlx5e_test_get_udp_skb() [all …]
|
/Linux-v5.4/net/ipv6/ |
D | sit.c | 101 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 102 remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 109 if (remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 116 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 131 __be32 remote = parms->iph.daddr; in __ipip6_bucket() 132 __be32 local = parms->iph.saddr; in __ipip6_bucket() 200 memcpy(dev->dev_addr, &t->parms.iph.saddr, 4); in ipip6_tunnel_create() 201 memcpy(dev->broadcast, &t->parms.iph.daddr, 4); in ipip6_tunnel_create() 226 __be32 remote = parms->iph.daddr; in ipip6_tunnel_locate() 227 __be32 local = parms->iph.saddr; in ipip6_tunnel_locate() [all …]
|
/Linux-v5.4/net/sched/ |
D | act_nat.c | 109 struct iphdr *iph; in tcf_nat_act() local 136 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat_act() 139 iph = ip_hdr(skb); in tcf_nat_act() 142 addr = iph->saddr; in tcf_nat_act() 144 addr = iph->daddr; in tcf_nat_act() 147 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat_act() 154 iph = ip_hdr(skb); in tcf_nat_act() 156 iph->saddr = new_addr; in tcf_nat_act() 158 iph->daddr = new_addr; in tcf_nat_act() 160 csum_replace4(&iph->check, addr, new_addr); in tcf_nat_act() [all …]
|