/linux/tools/testing/selftests/net/ |
A D | ip_defrag.c | 106 sum = raw_checksum((uint8_t *)&iphdr->ip_src, 2 * sizeof(iphdr->ip_src), in udp_checksum() 122 sum = raw_checksum((uint8_t *)&iphdr->ip6_src, 2 * sizeof(iphdr->ip6_src), in udp6_checksum() 232 memset(iphdr, 0, sizeof(*iphdr)); in send_udp_frags() 233 iphdr->ip_hl = 5; in send_udp_frags() 234 iphdr->ip_v = 4; in send_udp_frags() 235 iphdr->ip_tos = 0; in send_udp_frags() 236 iphdr->ip_id = htons(ip_id++); in send_udp_frags() 237 iphdr->ip_ttl = 0x40; in send_udp_frags() 238 iphdr->ip_p = IPPROTO_UDP; in send_udp_frags() 240 iphdr->ip_dst = addr4; in send_udp_frags() [all …]
|
A D | gro.c | 110 next_off = offsetof(struct iphdr, protocol); in setup_sock_filter() 223 struct iphdr *iph = buf; in fill_networklayer() 244 payload_len + sizeof(struct iphdr)); in fill_networklayer() 379 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in recompute_packet() 557 struct iphdr *iph; in add_ipv4_ts_option() 571 iph = (struct iphdr *)(optpkt + ETH_HLEN); in add_ipv4_ts_option() 601 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_fragment4() 627 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ttl() 644 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_tos() 666 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ECN() [all …]
|
/linux/include/linux/ |
A 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/net/ipv4/netfilter/ |
A D | nf_reject_ipv4.c | 17 struct iphdr *iph; in nf_reject_iphdr_validate() 20 if (!pskb_may_pull(skb, sizeof(struct iphdr))) in nf_reject_iphdr_validate() 46 struct iphdr *niph; in nf_reject_skb_v4_tcp_reset() 80 struct iphdr *niph; in nf_reject_skb_v4_unreach() 166 struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb, in nf_reject_iphdr_put() 170 struct iphdr *niph, *oiph = ip_hdr(oldskb); in nf_reject_iphdr_put() 173 niph = skb_put(nskb, sizeof(struct iphdr)); in nf_reject_iphdr_put() 175 niph->ihl = sizeof(struct iphdr) / 4; in nf_reject_iphdr_put() 194 struct iphdr *niph = ip_hdr(nskb); in nf_reject_ip_tcphdr_put() 242 struct iphdr *niph; in nf_send_reset() [all …]
|
/linux/samples/bpf/ |
A D | tcbpf1_kern.c | 21 #define IP_CSUM_OFF (ETH_HLEN + offsetof(struct iphdr, check)) 22 #define TOS_OFF (ETH_HLEN + offsetof(struct iphdr, tos)) 32 #define TCP_CSUM_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, check)) 33 #define IP_SRC_OFF (ETH_HLEN + offsetof(struct iphdr, saddr)) 46 #define TCP_DPORT_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, dest)) 58 __u8 proto = load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)); in bpf_prog1()
|
A D | parse_ldabs.c | 23 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment() 30 __u64 troff = ETH_HLEN + sizeof(struct iphdr); in handle_ingress() 34 if (load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)) != IPPROTO_UDP || in handle_ingress()
|
A 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()
|
A 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)
|
A D | xdp_adjust_tail_kern.c | 72 int headroom = (int)sizeof(struct iphdr) + (int)sizeof(struct icmphdr); in send_icmp4_too_big() 82 struct iphdr *iph, *orig_iph; in send_icmp4_too_big() 92 off += sizeof(struct iphdr); in send_icmp4_too_big() 113 ipv4_csum(iph, sizeof(struct iphdr), &csum); in send_icmp4_too_big()
|
/linux/drivers/net/ethernet/qualcomm/rmnet/ |
A D | rmnet_map_data.c | 36 struct iphdr *ip4h = (struct iphdr *)skb->data; in rmnet_map_ipv4_dl_csum_trailer() 166 static void rmnet_map_complement_ipv4_txporthdr_csum_field(struct iphdr *ip4h) in rmnet_map_complement_ipv4_txporthdr_csum_field() 180 rmnet_map_ipv4_ul_csum_header(struct iphdr *iphdr, in rmnet_map_ipv4_ul_csum_header() argument 187 if (iphdr->protocol == IPPROTO_UDP) in rmnet_map_ipv4_ul_csum_header() 196 rmnet_map_complement_ipv4_txporthdr_csum_field(iphdr); in rmnet_map_ipv4_ul_csum_header() 261 u16 ip_len = ((struct iphdr *)iph)->ihl * 4; in rmnet_map_v5_checksum_uplink_packet() 263 proto = ((struct iphdr *)iph)->protocol; in rmnet_map_v5_checksum_uplink_packet() 437 void *iphdr; in rmnet_map_v4_checksum_uplink_packet() local 449 iphdr = (char *)ul_header + in rmnet_map_v4_checksum_uplink_packet() 453 rmnet_map_ipv4_ul_csum_header(iphdr, ul_header, skb); in rmnet_map_v4_checksum_uplink_packet() [all …]
|
/linux/include/net/ |
A D | inet_ecn.h | 77 static inline int IP_ECN_set_ce(struct iphdr *iph) in IP_ECN_set_ce() 105 static inline int IP_ECN_set_ect1(struct iphdr *iph) in IP_ECN_set_ect1() 115 static inline void IP_ECN_clear(struct iphdr *iph) in IP_ECN_clear() 120 static inline void ipv4_copy_dscp(unsigned int dscp, struct iphdr *inner) in ipv4_copy_dscp() 176 if (skb_network_header(skb) + sizeof(struct iphdr) <= in INET_ECN_set_ce() 195 if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) in skb_get_dsfield() 212 if (skb_network_header(skb) + sizeof(struct iphdr) <= in INET_ECN_set_ect1() 286 static inline int IP_ECN_decapsulate(const struct iphdr *oiph, in IP_ECN_decapsulate()
|
A D | ip_vs.h | 72 iphdr->off = offset; in ip_vs_fill_iph_skb_off() 85 iphdr->len = offset; in ip_vs_fill_iph_skb_off() 86 iphdr->flags = 0; in ip_vs_fill_iph_skb_off() 87 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, in ip_vs_fill_iph_skb_off() 88 &iphdr->fragoffs, in ip_vs_fill_iph_skb_off() 89 &iphdr->flags); in ip_vs_fill_iph_skb_off() 90 if (iphdr->protocol < 0) in ip_vs_fill_iph_skb_off() 95 struct iphdr _iph; in ip_vs_fill_iph_skb_off() 102 iphdr->fragoffs = 0; in ip_vs_fill_iph_skb_off() 133 hdr_flags, iphdr); in ip_vs_fill_iph_skb() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
A D | test_cls_redirect.c | 213 static __always_inline struct iphdr *pkt_parse_ipv4(buf_t *pkt, struct iphdr *scratch) in pkt_parse_ipv4() 257 static INLINING void pkt_ipv4_checksum(struct iphdr *iph) in pkt_ipv4_checksum() 271 for (size_t i = 0; i < sizeof(struct iphdr) / 2; i++) { in pkt_ipv4_checksum() 450 skb, payload_off + offsetof(struct iphdr, ttl), &ttl, in forward_with_gre() 622 case sizeof(struct iphdr): { in fill_tuple() 623 struct iphdr *ipv4 = (struct iphdr *)iph; in fill_tuple() 664 uint64_t iphlen = sizeof(struct iphdr); in classify_tcp() 738 struct iphdr _ip4; in process_icmpv4() 739 const struct iphdr *ipv4 = pkt_parse_ipv4(pkt, &_ip4); in process_icmpv4() 858 struct iphdr _ip4; in process_ipv4() [all …]
|
A D | skb_pkt_end.c | 11 #define ETH_IPV4_TCP_SIZE (14 + sizeof(struct iphdr) + sizeof(struct tcphdr)) 13 static INLINE struct iphdr *get_iphdr(struct __sk_buff *skb) in get_iphdr() 15 struct iphdr *ip = NULL; in get_iphdr() 31 struct iphdr *ip = NULL; in main_prog()
|
A 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() 343 old_eth = data + sizeof(struct iphdr); in encap_v4() 366 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in encap_v4() 402 new_eth = *data + sizeof(struct iphdr); in decap_v4() 432 struct iphdr *iph; in send_icmp_reply() 442 off += sizeof(struct iphdr); in send_icmp_reply() 453 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in send_icmp_reply() 513 struct iphdr *iph; in parse_icmp() [all …]
|
/linux/tools/testing/selftests/bpf/prog_tests/ |
A D | flow_dissector.c | 43 struct iphdr iph; 49 struct iphdr iph; 50 struct iphdr iph_inner; 58 struct iphdr iph; 121 .thoff = ETH_HLEN + sizeof(struct iphdr), 209 .thoff = ETH_HLEN + sizeof(struct iphdr), 234 .thoff = ETH_HLEN + sizeof(struct iphdr), 345 sizeof(struct iphdr), 353 sizeof(struct iphdr), 373 sizeof(struct iphdr), [all …]
|
/linux/net/ipv4/ |
A D | ah4.c | 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() 445 const struct iphdr *iph = (const struct iphdr *)skb->data; in ah4_err() [all …]
|
A 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() 504 unsigned char *optptr = opt->__data + opt->rr - sizeof(struct iphdr); in ip_options_undo() 510 unsigned char *optptr = opt->__data + opt->ts - sizeof(struct iphdr); in ip_options_undo() [all …]
|
/linux/drivers/net/wireguard/selftest/ |
A D | ratelimiter.c | 33 static __init int timings_test(struct sk_buff *skb4, struct iphdr *hdr4, in timings_test() 97 static __init int capacity_test(struct sk_buff *skb4, struct iphdr *hdr4, in capacity_test() 124 struct iphdr *hdr4; in wg_ratelimiter_selftest() 147 skb4 = alloc_skb(sizeof(struct iphdr), GFP_KERNEL); in wg_ratelimiter_selftest() 151 hdr4 = (struct iphdr *)skb_put(skb4, sizeof(*hdr4)); in wg_ratelimiter_selftest()
|
/linux/net/netfilter/ |
A 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()
|
A D | nf_flow_table_ip.c | 63 static void nf_flow_nat_ip_l4proto(struct sk_buff *skb, struct iphdr *iph, in nf_flow_nat_ip_l4proto() 78 struct sk_buff *skb, struct iphdr *iph, in nf_flow_snat_ip() 101 struct sk_buff *skb, struct iphdr *iph, in nf_flow_dnat_ip() 125 struct iphdr *iph) in nf_flow_nat_ip() 139 return thoff != sizeof(struct iphdr); in ip_has_options() 174 struct iphdr *iph; in nf_flow_tuple_ip() 179 iph = (struct iphdr *)(skb_network_header(skb) + offset); in nf_flow_tuple_ip() 205 iph = (struct iphdr *)(skb_network_header(skb) + offset); in nf_flow_tuple_ip() 340 struct iphdr *iph; in nf_flow_offload_ip_hook() 362 iph = (struct iphdr *)(skb_network_header(skb) + offset); in nf_flow_offload_ip_hook()
|
/linux/arch/powerpc/platforms/ps3/ |
A 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/tools/testing/selftests/bpf/ |
A D | xdpxceiver.c | 566 struct iphdr *ip_hdr; in pkt_generate() 576 ip_hdr = (struct iphdr *)(data + sizeof(struct ethhdr)); in pkt_generate() 612 struct iphdr *iphdr; in pkt_dump() local 616 iphdr = pkt + sizeof(*ethhdr); in pkt_dump() 617 udphdr = pkt + sizeof(*ethhdr) + sizeof(*iphdr); in pkt_dump() 629 fprintf(stdout, "\nDEBUG>> L3: ip_hdr->ihl: %02X\n", iphdr->ihl); in pkt_dump() 631 inet_ntop(AF_INET, &iphdr->saddr, s, sizeof(s))); in pkt_dump() 633 inet_ntop(AF_INET, &iphdr->daddr, s, sizeof(s))); in pkt_dump() 666 struct iphdr *iphdr = (struct iphdr *)(data + sizeof(struct ethhdr)); in is_pkt_valid() local 685 if (iphdr->version == IP_PKT_VER && iphdr->tos == IP_PKT_TOS) { in is_pkt_valid() [all …]
|
/linux/drivers/infiniband/core/ |
A D | lag.c | 18 struct iphdr *iph; in rdma_build_skb() 26 hdr_len += is_ipv4 ? sizeof(struct iphdr) : sizeof(struct ipv6hdr); in rdma_build_skb() 43 skb_push(skb, sizeof(struct iphdr)); in rdma_build_skb() 51 iphdr)); in rdma_build_skb()
|
/linux/include/net/netfilter/ |
A D | nf_tables_ipv4.h | 10 struct iphdr *ip; in nft_set_pktinfo_ipv4() 21 struct iphdr *iph, _iph; in __nft_set_pktinfo_ipv4_validate() 55 struct iphdr *iph; in nft_set_pktinfo_ipv4_ingress()
|