Home
last modified time | relevance | path

Searched refs:iphdr (Results 1 – 25 of 392) sorted by relevance

12345678910>>...16

/linux-6.3-rc2/include/linux/
A Dip.h19 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()
39 static inline unsigned int iph_totlen(const struct sk_buff *skb, const struct iphdr *iph) in iph_totlen()
55 static inline void iph_set_totlen(struct iphdr *iph, unsigned int len) in iph_set_totlen()
/linux-6.3-rc2/tools/testing/selftests/net/
A Dip_defrag.c106 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 Dnat6to4.c77 if (bpf_ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr)) in sched_cls_ingress6_nat_6_prog()
94 struct iphdr ip = { in sched_cls_ingress6_nat_6_prog()
96 .ihl = sizeof(struct iphdr) / sizeof(__u32), // u4 in sched_cls_ingress6_nat_6_prog()
98 .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16 in sched_cls_ingress6_nat_6_prog()
136 if (data + l2_header_size + sizeof(struct iphdr) > data_end) in sched_cls_ingress6_nat_6_prog()
145 *(struct iphdr *)(new_eth + 1) = ip; in sched_cls_ingress6_nat_6_prog()
156 const struct iphdr *const ip4 = (void *)(eth + 1); in sched_cls_egress4_snat4_prog()
A Dgro.c111 next_off = offsetof(struct iphdr, protocol); in setup_sock_filter()
224 struct iphdr *iph = buf; in fill_networklayer()
245 payload_len + sizeof(struct iphdr)); in fill_networklayer()
380 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in recompute_packet()
558 struct iphdr *iph; in add_ipv4_ts_option()
572 iph = (struct iphdr *)(optpkt + ETH_HLEN); in add_ipv4_ts_option()
602 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_fragment4()
628 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ttl()
645 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_tos()
667 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ECN()
[all …]
A Dtap.c266 struct iphdr *iph = (struct iphdr *)buf; in build_ipv4_header()
311 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_valid_udp_gso()
313 vh->csum_start = ETH_HLEN + sizeof(struct iphdr); in build_test_packet_valid_udp_gso()
316 vh->gso_size = ETH_DATA_LEN - sizeof(struct iphdr); in build_test_packet_valid_udp_gso()
348 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto()
351 vh->gso_size = ETH_DATA_LEN - sizeof(struct iphdr); in build_test_packet_crash_tap_invalid_eth_proto()
355 cur += sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto()
/linux-6.3-rc2/net/ipv4/netfilter/
A Dnf_reject_ipv4.c17 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()
168 struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb, in nf_reject_iphdr_put()
172 struct iphdr *niph, *oiph = ip_hdr(oldskb); in nf_reject_iphdr_put()
175 niph = skb_put(nskb, sizeof(struct iphdr)); in nf_reject_iphdr_put()
177 niph->ihl = sizeof(struct iphdr) / 4; in nf_reject_iphdr_put()
196 struct iphdr *niph = ip_hdr(nskb); in nf_reject_ip_tcphdr_put()
244 struct iphdr *niph; in nf_send_reset()
[all …]
/linux-6.3-rc2/samples/bpf/
A Dtcbpf1_kern.c21 #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 Dparse_ldabs.c23 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 Dtcp_tos_reflect_kern.c28 struct iphdr *hdr; in bpf_basertt()
47 hdr_size = sizeof(struct iphdr); in bpf_basertt()
54 hdr = (struct iphdr *) header; in bpf_basertt()
A Dtest_lwt_bpf.c64 struct iphdr *iph = data; in do_test_data()
76 #define IP_CSUM_OFF offsetof(struct iphdr, check)
77 #define IP_DST_OFF offsetof(struct iphdr, daddr)
78 #define IP_SRC_OFF offsetof(struct iphdr, saddr)
79 #define IP_PROTO_OFF offsetof(struct iphdr, protocol)
A Dxdp_adjust_tail_kern.c72 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-6.3-rc2/tools/testing/selftests/bpf/progs/
A Dskb_pkt_end.c11 #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 Dtest_cls_redirect.c213 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 Dtest_xdp_noinline.c224 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-6.3-rc2/include/net/
A Dinet_ecn.h77 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 Dip_vs.h75 iphdr->off = offset; in ip_vs_fill_iph_skb_off()
88 iphdr->len = offset; in ip_vs_fill_iph_skb_off()
89 iphdr->flags = 0; in ip_vs_fill_iph_skb_off()
90 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, in ip_vs_fill_iph_skb_off()
91 &iphdr->fragoffs, in ip_vs_fill_iph_skb_off()
92 &iphdr->flags); in ip_vs_fill_iph_skb_off()
93 if (iphdr->protocol < 0) in ip_vs_fill_iph_skb_off()
98 struct iphdr _iph; in ip_vs_fill_iph_skb_off()
105 iphdr->fragoffs = 0; in ip_vs_fill_iph_skb_off()
136 hdr_flags, iphdr); in ip_vs_fill_iph_skb()
[all …]
/linux-6.3-rc2/tools/testing/selftests/bpf/prog_tests/
A Dflow_dissector.c46 struct iphdr iph;
52 struct iphdr iph;
53 struct iphdr iph_inner;
61 struct iphdr iph;
125 .thoff = ETH_HLEN + sizeof(struct iphdr),
217 .thoff = ETH_HLEN + sizeof(struct iphdr),
243 .thoff = ETH_HLEN + sizeof(struct iphdr),
359 sizeof(struct iphdr),
367 sizeof(struct iphdr),
388 sizeof(struct iphdr),
[all …]
/linux-6.3-rc2/net/ipv4/
A Dah4.c83 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 Dip_options.c50 memcpy(iph + sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build()
95 dopt->rr = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo()
109 dopt->ts = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo()
170 dopt->srr = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo()
177 dopt->cipso = dopt->optlen+sizeof(struct iphdr); in __ip_options_echo()
197 unsigned char *optptr = skb_network_header(skb) + sizeof(struct iphdr); in ip_options_fragment()
257 iph = optptr - sizeof(struct iphdr); in __ip_options_compile()
485 unsigned char *optptr = opt->__data + opt->srr - sizeof(struct iphdr); in ip_options_undo()
491 unsigned char *optptr = opt->__data + opt->rr - sizeof(struct iphdr); in ip_options_undo()
497 unsigned char *optptr = opt->__data + opt->ts - sizeof(struct iphdr); in ip_options_undo()
[all …]
/linux-6.3-rc2/drivers/net/ethernet/qualcomm/rmnet/
A Drmnet_map_data.c37 struct iphdr *ip4h = (struct iphdr *)skb->data; in rmnet_map_ipv4_dl_csum_trailer()
167 static void rmnet_map_complement_ipv4_txporthdr_csum_field(struct iphdr *ip4h) in rmnet_map_complement_ipv4_txporthdr_csum_field()
181 rmnet_map_ipv4_ul_csum_header(struct iphdr *iphdr, in rmnet_map_ipv4_ul_csum_header() argument
188 if (iphdr->protocol == IPPROTO_UDP) in rmnet_map_ipv4_ul_csum_header()
197 rmnet_map_complement_ipv4_txporthdr_csum_field(iphdr); in rmnet_map_ipv4_ul_csum_header()
262 u16 ip_len = ((struct iphdr *)iph)->ihl * 4; in rmnet_map_v5_checksum_uplink_packet()
264 proto = ((struct iphdr *)iph)->protocol; in rmnet_map_v5_checksum_uplink_packet()
436 void *iphdr; in rmnet_map_v4_checksum_uplink_packet() local
448 iphdr = (char *)ul_header + in rmnet_map_v4_checksum_uplink_packet()
452 rmnet_map_ipv4_ul_csum_header(iphdr, ul_header, skb); in rmnet_map_v4_checksum_uplink_packet()
[all …]
/linux-6.3-rc2/drivers/net/wireguard/selftest/
A Dratelimiter.c33 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-6.3-rc2/net/netfilter/
A Dxt_DSCP.c36 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-6.3-rc2/arch/powerpc/platforms/ps3/
A Dgelic_udbg.c62 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-6.3-rc2/include/net/netfilter/
A Dnf_tables_ipv4.h10 struct iphdr *ip; in nft_set_pktinfo_ipv4()
21 struct iphdr *iph, _iph; in __nft_set_pktinfo_ipv4_validate()
57 struct iphdr *iph; in nft_set_pktinfo_ipv4_ingress()
/linux-6.3-rc2/drivers/infiniband/core/
A Dlag.c17 struct iphdr *iph; in rdma_build_skb()
25 hdr_len += is_ipv4 ? sizeof(struct iphdr) : sizeof(struct ipv6hdr); in rdma_build_skb()
42 skb_push(skb, sizeof(struct iphdr)); in rdma_build_skb()
50 iphdr)); in rdma_build_skb()

Completed in 35 milliseconds

12345678910>>...16