/Linux-v5.4/tools/testing/selftests/net/ |
D | ip_defrag.c | 29 #define IP4_HLEN (sizeof(struct iphdr)) 101 static uint16_t udp_checksum(struct ip *iphdr, struct udphdr *udphdr) in udp_checksum() argument 106 sum = raw_checksum((uint8_t *)&iphdr->ip_src, 2 * sizeof(iphdr->ip_src), in udp_checksum() 117 static uint16_t udp6_checksum(struct ip6_hdr *iphdr, struct udphdr *udphdr) in udp6_checksum() argument 122 sum = raw_checksum((uint8_t *)&iphdr->ip6_src, 2 * sizeof(iphdr->ip6_src), in udp6_checksum() 176 struct ip *iphdr = (struct ip *)ip_frame; in send_fragment() local 180 iphdr->ip_off = htons(offset / 8); in send_fragment() 183 iphdr->ip_off = htons(offset / 8 | IP4_MF); in send_fragment() 185 iphdr->ip_len = htons(frag_len); in send_fragment() 206 struct ip *iphdr = (struct ip *)ip_frame; in send_udp_frags() local [all …]
|
/Linux-v5.4/include/linux/ |
D | ip.h | 19 static inline struct iphdr *ip_hdr(const struct sk_buff *skb) in ip_hdr() 21 return (struct iphdr *)skb_network_header(skb); in ip_hdr() 24 static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb) in inner_ip_hdr() 26 return (struct iphdr *)skb_inner_network_header(skb); in inner_ip_hdr() 29 static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) in ipip_hdr() 31 return (struct iphdr *)skb_transport_header(skb); in ipip_hdr()
|
/Linux-v5.4/drivers/net/ethernet/qualcomm/rmnet/ |
D | rmnet_map_data.c | 47 struct iphdr *ip4h; in rmnet_map_ipv4_dl_csum_trailer() 51 ip4h = (struct iphdr *)(skb->data); in rmnet_map_ipv4_dl_csum_trailer() 181 static void rmnet_map_complement_ipv4_txporthdr_csum_field(void *iphdr) in rmnet_map_complement_ipv4_txporthdr_csum_field() argument 183 struct iphdr *ip4h = (struct iphdr *)iphdr; in rmnet_map_complement_ipv4_txporthdr_csum_field() 187 txphdr = iphdr + ip4h->ihl * 4; in rmnet_map_complement_ipv4_txporthdr_csum_field() 196 rmnet_map_ipv4_ul_csum_header(void *iphdr, in rmnet_map_ipv4_ul_csum_header() argument 200 struct iphdr *ip4h = (struct iphdr *)iphdr; in rmnet_map_ipv4_ul_csum_header() 204 (unsigned char *)iphdr)); in rmnet_map_ipv4_ul_csum_header() 219 rmnet_map_complement_ipv4_txporthdr_csum_field(iphdr); in rmnet_map_ipv4_ul_csum_header() 394 void *iphdr; in rmnet_map_checksum_uplink_packet() local [all …]
|
/Linux-v5.4/samples/bpf/ |
D | tcbpf1_kern.c | 20 #define IP_CSUM_OFF (ETH_HLEN + offsetof(struct iphdr, check)) 21 #define TOS_OFF (ETH_HLEN + offsetof(struct iphdr, tos)) 31 #define TCP_CSUM_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, check)) 32 #define IP_SRC_OFF (ETH_HLEN + offsetof(struct iphdr, saddr)) 45 #define TCP_DPORT_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, dest)) 57 __u8 proto = load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)); in bpf_prog1()
|
D | parse_ldabs.c | 22 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment() 29 __u64 troff = ETH_HLEN + sizeof(struct iphdr); in handle_ingress() 33 if (load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)) != IPPROTO_UDP || in handle_ingress()
|
D | tcp_tos_reflect_kern.c | 28 struct iphdr *hdr; in bpf_basertt() 47 hdr_size = sizeof(struct iphdr); in bpf_basertt() 54 hdr = (struct iphdr *) header; in bpf_basertt()
|
D | xdp_adjust_tail_kern.c | 69 int headroom = (int)sizeof(struct iphdr) + (int)sizeof(struct icmphdr); in send_icmp4_too_big() 79 struct iphdr *iph, *orig_iph; in send_icmp4_too_big() 89 off += sizeof(struct iphdr); in send_icmp4_too_big() 110 ipv4_csum(iph, sizeof(struct iphdr), &csum); in send_icmp4_too_big()
|
D | test_lwt_bpf.c | 72 struct iphdr *iph = data; in do_test_data() 84 #define IP_CSUM_OFF offsetof(struct iphdr, check) 85 #define IP_DST_OFF offsetof(struct iphdr, daddr) 86 #define IP_SRC_OFF offsetof(struct iphdr, saddr) 87 #define IP_PROTO_OFF offsetof(struct iphdr, protocol)
|
D | sockex2_kern.c | 47 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment() 69 *ip_proto = load_byte(skb, nhoff + offsetof(struct iphdr, protocol)); in parse_ip() 72 flow->src = load_word(skb, nhoff + offsetof(struct iphdr, saddr)); in parse_ip() 73 flow->dst = load_word(skb, nhoff + offsetof(struct iphdr, daddr)); in parse_ip()
|
/Linux-v5.4/net/ipv4/netfilter/ |
D | nf_reject_ipv4.c | 44 struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb, in nf_reject_iphdr_put() 48 struct iphdr *niph, *oiph = ip_hdr(oldskb); in nf_reject_iphdr_put() 51 niph = skb_put(nskb, sizeof(struct iphdr)); in nf_reject_iphdr_put() 53 niph->ihl = sizeof(struct iphdr) / 4; in nf_reject_iphdr_put() 72 struct iphdr *niph = ip_hdr(nskb); in nf_reject_ip_tcphdr_put() 104 struct iphdr *niph; in nf_send_reset() 115 nskb = alloc_skb(sizeof(struct iphdr) + sizeof(struct tcphdr) + in nf_send_reset() 172 struct iphdr *iph = ip_hdr(skb_in); in nf_send_unreach()
|
D | nf_log_ipv4.c | 39 struct iphdr _iph; in dump_ipv4_packet() 40 const struct iphdr *ih; in dump_ipv4_packet() 77 ih->ihl * 4 > sizeof(struct iphdr)) { in dump_ipv4_packet() 79 unsigned char _opt[4 * 15 - sizeof(struct iphdr)]; in dump_ipv4_packet() 82 optsize = ih->ihl * 4 - sizeof(struct iphdr); in dump_ipv4_packet() 117 = 8 + sizeof(struct iphdr), in dump_ipv4_packet() 119 = 8 + sizeof(struct iphdr), in dump_ipv4_packet() 121 = 8 + sizeof(struct iphdr), in dump_ipv4_packet() 124 = 8 + sizeof(struct iphdr), in dump_ipv4_packet() 126 = 8 + sizeof(struct iphdr), in dump_ipv4_packet()
|
/Linux-v5.4/tools/testing/selftests/bpf/prog_tests/ |
D | flow_dissector.c | 40 struct iphdr iph; 46 struct iphdr iph; 47 struct iphdr iph_inner; 55 struct iphdr iph; 117 .thoff = ETH_HLEN + sizeof(struct iphdr), 159 .thoff = ETH_HLEN + VLAN_HLEN + sizeof(struct iphdr), 205 .thoff = ETH_HLEN + sizeof(struct iphdr), 230 .thoff = ETH_HLEN + sizeof(struct iphdr), 341 sizeof(struct iphdr), 348 .thoff = ETH_HLEN + sizeof(struct iphdr) + [all …]
|
/Linux-v5.4/net/ipv4/ |
D | ah4.c | 80 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) 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() 127 struct iphdr *top_iph = ip_hdr(skb); in ah_output_done() 140 memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); in ah_output_done() 157 struct iphdr *iph, *top_iph; in ah_output() 200 memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); in ah_output() 256 memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); in ah_output() 269 struct iphdr *work_iph; in ah_input_done() 315 struct iphdr *iph, *work_iph; in ah_input() [all …]
|
D | ip_options.c | 50 memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build() 108 dopt->rr = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo() 122 dopt->ts = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo() 183 dopt->srr = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo() 190 dopt->cipso = dopt->optlen+sizeof(struct iphdr); in __ip_options_echo() 210 unsigned char *optptr = skb_network_header(skb) + sizeof(struct iphdr); in ip_options_fragment() 270 iph = optptr - sizeof(struct iphdr); in __ip_options_compile() 498 unsigned char *optptr = opt->__data+opt->srr-sizeof(struct iphdr); in ip_options_undo() 503 unsigned char *optptr = opt->__data+opt->rr-sizeof(struct iphdr); in ip_options_undo() 508 unsigned char *optptr = opt->__data+opt->ts-sizeof(struct iphdr); in ip_options_undo() [all …]
|
D | icmp.c | 462 const struct iphdr *iph, in icmp_route_lookup() 571 struct iphdr *iph; in __icmp_send() 730 room -= sizeof(struct iphdr) + icmp_param.replyopts.opt.opt.optlen; in __icmp_send() 752 const struct iphdr *iph = (const struct iphdr *) skb->data; in icmp_socket_deliver() 788 const struct iphdr *iph; in icmp_unreach() 801 if (!pskb_may_pull(skb, sizeof(struct iphdr))) in icmp_unreach() 805 iph = (const struct iphdr *)skb->data; in icmp_unreach() 901 if (skb->len < sizeof(struct iphdr)) { in icmp_redirect() 906 if (!pskb_may_pull(skb, sizeof(struct iphdr))) { in icmp_redirect() 1010 if (!pskb_may_pull(skb, sizeof(*icmph) + sizeof(struct iphdr))) in icmp_rcv() [all …]
|
D | xfrm4_input.c | 36 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() 55 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() 91 struct iphdr *iph; in xfrm4_udp_encap_rcv()
|
/Linux-v5.4/include/net/ |
D | ip_vs.h | 71 int hdr_flags, struct ip_vs_iphdr *iphdr) in ip_vs_fill_iph_skb_off() argument 73 iphdr->hdr_flags = hdr_flags; in ip_vs_fill_iph_skb_off() 74 iphdr->off = offset; in ip_vs_fill_iph_skb_off() 84 iphdr->saddr.in6 = iph->saddr; in ip_vs_fill_iph_skb_off() 85 iphdr->daddr.in6 = iph->daddr; in ip_vs_fill_iph_skb_off() 87 iphdr->len = offset; in ip_vs_fill_iph_skb_off() 88 iphdr->flags = 0; in ip_vs_fill_iph_skb_off() 89 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, in ip_vs_fill_iph_skb_off() 90 &iphdr->fragoffs, in ip_vs_fill_iph_skb_off() 91 &iphdr->flags); in ip_vs_fill_iph_skb_off() [all …]
|
D | inet_ecn.h | 75 static inline int IP_ECN_set_ce(struct iphdr *iph) in IP_ECN_set_ce() 102 static inline void IP_ECN_clear(struct iphdr *iph) in IP_ECN_clear() 107 static inline void ipv4_copy_dscp(unsigned int dscp, struct iphdr *inner) in ipv4_copy_dscp() 147 if (skb_network_header(skb) + sizeof(struct iphdr) <= in INET_ECN_set_ce() 217 static inline int IP_ECN_decapsulate(const struct iphdr *oiph, in IP_ECN_decapsulate()
|
D | dsfield.h | 16 static inline __u8 ipv4_get_dsfield(const struct iphdr *iph) in ipv4_get_dsfield() 28 static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, in ipv4_change_dsfield()
|
/Linux-v5.4/net/netfilter/ |
D | xt_DSCP.c | 34 if (skb_ensure_writable(skb, sizeof(struct iphdr))) in dscp_tg() 75 struct iphdr *iph = ip_hdr(skb); in tos_tg() 82 if (skb_ensure_writable(skb, sizeof(struct iphdr))) in tos_tg() 102 if (skb_ensure_writable(skb, sizeof(struct iphdr))) in tos_tg6()
|
/Linux-v5.4/drivers/infiniband/sw/rxe/ |
D | rxe_icrc.c | 41 struct iphdr *ip4h = NULL; in rxe_icrc_hdr() 49 sizeof(struct iphdr) : sizeof(struct ipv6hdr)); in rxe_icrc_hdr() 64 ip4h = (struct iphdr *)pshdr; in rxe_icrc_hdr()
|
/Linux-v5.4/tools/testing/selftests/bpf/progs/ |
D | test_xdp_noinline.c | 224 off += sizeof(struct iphdr); in calc_offset() 226 off += sizeof(struct icmphdr) + sizeof(struct iphdr); in calc_offset() 330 struct iphdr *iph; in encap_v4() 337 if (bpf_xdp_adjust_head(xdp, 0 - (int)sizeof(struct iphdr))) in encap_v4() 343 old_eth = data + sizeof(struct iphdr); in encap_v4() 356 iph->tot_len = bpf_htons(pkt_bytes + sizeof(struct iphdr)); in encap_v4() 366 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in encap_v4() 369 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) in encap_v4() 402 new_eth = *data + sizeof(struct iphdr); in decap_v4() 406 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) in decap_v4() [all …]
|
/Linux-v5.4/arch/powerpc/platforms/ps3/ |
D | gelic_udbg.c | 62 static __iomem struct iphdr *h_ip; 162 h_ip = (struct iphdr *)(h_vlan + 1); in gelic_debug_init() 165 h_ip = (struct iphdr *)(h_eth + 1); in gelic_debug_init() 168 header_size += sizeof(struct iphdr); in gelic_debug_init() 200 sizeof(struct iphdr); in gelic_sendbuf()
|
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/ |
D | en_selftest.c | 99 #define MLX5E_TEST_PKT_SIZE (sizeof(struct ethhdr) + sizeof(struct iphdr) +\ 109 struct iphdr *iph; in mlx5e_test_get_udp_skb() 126 iph = skb_put(skb, sizeof(struct iphdr)); in mlx5e_test_get_udp_skb() 147 iplen = sizeof(struct iphdr) + sizeof(struct udphdr) + in mlx5e_test_get_udp_skb() 190 struct iphdr *iph; in mlx5e_test_loopback_validate()
|
/Linux-v5.4/tools/testing/selftests/bpf/ |
D | test_queue_stack_map.h | 41 struct iphdr *iph = (struct iphdr *)(eth + 1); in _test()
|