Home
last modified time | relevance | path

Searched refs:nhoff (Results 1 – 25 of 50) sorted by relevance

12

/kernel/linux/linux-5.10/samples/bpf/
Dsockex2_kern.c46 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument
48 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
62 static inline __u64 parse_ip(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto, in parse_ip() argument
67 if (unlikely(ip_is_fragment(skb, nhoff))) in parse_ip()
70 *ip_proto = load_byte(skb, nhoff + offsetof(struct iphdr, protocol)); in parse_ip()
73 flow->src = load_word(skb, nhoff + offsetof(struct iphdr, saddr)); in parse_ip()
74 flow->dst = load_word(skb, nhoff + offsetof(struct iphdr, daddr)); in parse_ip()
77 verlen = load_byte(skb, nhoff + 0/*offsetof(struct iphdr, ihl)*/); in parse_ip()
79 nhoff += 20; in parse_ip()
81 nhoff += (verlen & 0xF) << 2; in parse_ip()
[all …]
Dsockex3_kern.c77 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument
79 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
144 __u32 nhoff = skb->cb[0]; in parse_ip_proto() local
155 nhoff + offsetof(struct gre_hdr, flags)); in parse_ip_proto()
157 nhoff + offsetof(struct gre_hdr, proto)); in parse_ip_proto()
162 nhoff += 4; in parse_ip_proto()
164 nhoff += 4; in parse_ip_proto()
166 nhoff += 4; in parse_ip_proto()
168 nhoff += 4; in parse_ip_proto()
170 skb->cb[0] = nhoff; in parse_ip_proto()
[all …]
Dparse_ldabs.c21 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument
23 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
/kernel/linux/linux-5.10/net/netfilter/
Dxt_HMARK.c132 hmark_set_tuple_ports(const struct sk_buff *skb, unsigned int nhoff, in hmark_set_tuple_ports() argument
141 nhoff += protoff; in hmark_set_tuple_ports()
142 if (skb_copy_bits(skb, nhoff, &t->uports, sizeof(t->uports)) < 0) in hmark_set_tuple_ports()
170 unsigned int nhoff = 0; in hmark_pkt_set_htuple_ipv6() local
175 nexthdr = ipv6_find_hdr(skb, &nhoff, -1, &fragoff, &flag); in hmark_pkt_set_htuple_ipv6()
182 if (get_inner6_hdr(skb, &nhoff)) { in hmark_pkt_set_htuple_ipv6()
183 ip6 = skb_header_pointer(skb, nhoff, sizeof(_ip6), &_ip6); in hmark_pkt_set_htuple_ipv6()
188 nexthdr = ipv6_find_hdr(skb, &nhoff, -1, &fragoff, &flag); in hmark_pkt_set_htuple_ipv6()
206 hmark_set_tuple_ports(skb, nhoff, t, info); in hmark_pkt_set_htuple_ipv6()
231 static int get_inner_hdr(const struct sk_buff *skb, int iphsz, int *nhoff) in get_inner_hdr() argument
[all …]
Dnf_conntrack_core.c241 unsigned int nhoff, in nf_ct_get_tuple() argument
257 nhoff += offsetof(struct iphdr, saddr); in nf_ct_get_tuple()
261 nhoff += offsetof(struct ipv6hdr, saddr); in nf_ct_get_tuple()
268 ap = skb_header_pointer(skb, nhoff, size, _addrs); in nf_ct_get_tuple()
319 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument
326 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto()
336 dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto()
342 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto()
349 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument
353 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto()
[all …]
/kernel/linux/linux-5.10/net/ipv6/
Dip6_offload.c85 int nhoff; in ipv6_gso_segment() local
89 nhoff = skb_network_header(skb) - skb_mac_header(skb); in ipv6_gso_segment()
117 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in ipv6_gso_segment()
126 ipv6h = (struct ipv6hdr *)(skb_mac_header(skb) + nhoff); in ipv6_gso_segment()
132 payload_len = skb->len - nhoff - sizeof(*ipv6h); in ipv6_gso_segment()
322 INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) in ipv6_gro_complete() argument
325 struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete()
330 skb_set_inner_network_header(skb, nhoff); in ipv6_gro_complete()
333 iph->payload_len = htons(skb->len - nhoff - sizeof(*iph)); in ipv6_gro_complete()
337 nhoff += sizeof(*iph) + ipv6_exthdrs_len(iph, &ops); in ipv6_gro_complete()
[all …]
Dudp_offload.c161 INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff) in udp6_gro_complete() argument
164 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete()
167 uh->len = htons(skb->len - nhoff); in udp6_gro_complete()
184 uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, in udp6_gro_complete()
187 return udp_gro_complete(skb, nhoff, udp6_lib_lookup_skb); in udp6_gro_complete()
Dreassembly.c107 struct frag_hdr *fhdr, int nhoff, in ip6_frag_queue() argument
209 fq->nhoffset = nhoff; in ip6_frag_queue()
254 unsigned int nhoff; in ip6_frag_reasm() local
277 nhoff = fq->nhoffset; in ip6_frag_reasm()
278 skb_network_header(skb)[nhoff] = skb_transport_header(skb)[0]; in ip6_frag_reasm()
292 IP6CB(skb)->nhoff = nhoff; in ip6_frag_reasm()
352 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); in ipv6_frag_rcv()
382 ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff, in ipv6_frag_rcv()
Dip6_input.c253 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core()
360 unsigned int nhoff; in ip6_protocol_deliver_rcu() local
369 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu()
373 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu()
450 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_protocol_deliver_rcu()
Desp6_offload.c57 int nhoff; in esp6_gro_receive() local
94 nhoff = esp6_nexthdr_esp_offset(ipv6_hdr(skb), offset); in esp6_gro_receive()
95 if (!nhoff) in esp6_gro_receive()
98 IP6CB(skb)->nhoff = nhoff; in esp6_gro_receive()
Dxfrm6_input.c46 skb_network_header(skb)[IP6CB(skb)->nhoff] = in xfrm6_transport_finish()
165 return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], in xfrm6_rcv_tnl()
Dexthdrs.c312 opt->nhoff = dstbuf; in ipv6_destopt_rcv()
314 opt->nhoff = opt->dst1; in ipv6_destopt_rcv()
409 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_srh_rcv()
526 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rpl_srh_rcv()
733 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rthdr_rcv()
1046 opt->nhoff = sizeof(struct ipv6hdr); in ipv6_parse_hopopts()
/kernel/linux/linux-5.10/net/ipv6/ila/
Dila_common.c77 size_t nhoff = sizeof(struct ipv6hdr); in ila_csum_adjust_transport() local
83 if (likely(pskb_may_pull(skb, nhoff + sizeof(struct tcphdr)))) { in ila_csum_adjust_transport()
85 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
93 if (likely(pskb_may_pull(skb, nhoff + sizeof(struct udphdr)))) { in ila_csum_adjust_transport()
95 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
108 nhoff + sizeof(struct icmp6hdr)))) { in ila_csum_adjust_transport()
110 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
/kernel/linux/linux-5.10/net/core/
Dflow_dissector.c406 void *target_container, void *data, int nhoff, int hlen, in __skb_flow_dissect_mpls() argument
420 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, in __skb_flow_dissect_mpls()
464 void *target_container, void *data, int nhoff, int hlen) in __skb_flow_dissect_arp() argument
479 arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data, in __skb_flow_dissect_arp()
492 arp_eth = __skb_header_pointer(skb, nhoff + sizeof(_arp), in __skb_flow_dissect_arp()
716 void *target_container, void *data, int nhoff, in __skb_flow_dissect_ports() argument
734 key_ports->ports = __skb_flow_get_ports(skb, nhoff, ip_proto, in __skb_flow_dissect_ports()
857 __be16 proto, int nhoff, int hlen, unsigned int flags) in bpf_flow_dissect() argument
865 flow_keys->nhoff = nhoff; in bpf_flow_dissect()
866 flow_keys->thoff = flow_keys->nhoff; in bpf_flow_dissect()
[all …]
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/
Dflow_dissector.c29 got.nhoff, expected.nhoff, \
120 .nhoff = ETH_HLEN,
140 .nhoff = ETH_HLEN,
162 .nhoff = ETH_HLEN + VLAN_HLEN,
184 .nhoff = ETH_HLEN + VLAN_HLEN * 2,
208 .nhoff = ETH_HLEN,
233 .nhoff = ETH_HLEN,
255 .nhoff = ETH_HLEN,
280 .nhoff = ETH_HLEN,
302 .nhoff = ETH_HLEN,
[all …]
/kernel/linux/linux-5.10/Documentation/bpf/
Dprog_flow_dissector.rst26 * ``nhoff`` - initial offset of the networking header
27 * ``thoff`` - initial offset of the transport header, initialized to nhoff
32 bpf_flow_keys`` fields. Input arguments ``nhoff/thoff/n_proto`` should be
54 skb->data + flow_keys->nhoff point to the first byte of L3_HEADER
55 flow_keys->thoff = nhoff
71 skb->data + flow_keys->nhoff point the to first byte of TCI
72 flow_keys->thoff = nhoff
90 skb->data + flow_keys->nhoff point the to first byte of L3_HEADER
91 flow_keys->thoff = nhoff
/kernel/linux/linux-5.10/net/nsh/
Dnsh.c82 int nhoff; in nsh_gso_segment() local
86 nhoff = skb->network_header - skb->mac_header; in nsh_gso_segment()
111 skb->network_header - nhoff, in nsh_gso_segment()
119 skb_set_mac_header(skb, -nhoff); in nsh_gso_segment()
/kernel/linux/linux-5.10/net/bridge/netfilter/
Dnf_conntrack_bridge.c206 int nhoff, len; in nf_ct_br_ip_check() local
208 nhoff = skb_network_offset(skb); in nf_ct_br_ip_check()
215 if (skb->len < nhoff + len || in nf_ct_br_ip_check()
225 int nhoff, len; in nf_ct_br_ipv6_check() local
227 nhoff = skb_network_offset(skb); in nf_ct_br_ipv6_check()
232 len = ntohs(hdr->payload_len) + sizeof(struct ipv6hdr) + nhoff; in nf_ct_br_ipv6_check()
/kernel/linux/linux-5.10/net/ipv4/
Dudp_offload.c625 int udp_gro_complete(struct sk_buff *skb, int nhoff, in udp_gro_complete() argument
628 __be16 newlen = htons(skb->len - nhoff); in udp_gro_complete()
629 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp_gro_complete()
647 nhoff + sizeof(struct udphdr)); in udp_gro_complete()
660 INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff) in udp4_gro_complete() argument
663 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp4_gro_complete()
666 uh->len = htons(skb->len - nhoff); in udp4_gro_complete()
683 uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, in udp4_gro_complete()
686 return udp_gro_complete(skb, nhoff, udp4_lib_lookup_skb); in udp4_gro_complete()
Dgre_offload.c236 static int gre_gro_complete(struct sk_buff *skb, int nhoff) in gre_gro_complete() argument
238 struct gre_base_hdr *greh = (struct gre_base_hdr *)(skb->data + nhoff); in gre_gro_complete()
257 err = ptype->callbacks.gro_complete(skb, nhoff + grehlen); in gre_gro_complete()
261 skb_set_inner_mac_header(skb, nhoff + grehlen); in gre_gro_complete()
Daf_inet.c1347 int nhoff; in inet_gso_segment() local
1352 nhoff = skb_network_header(skb) - skb_mac_header(skb); in inet_gso_segment()
1391 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in inet_gso_segment()
1401 iph = (struct iphdr *)(skb_mac_header(skb) + nhoff); in inet_gso_segment()
1406 offset += skb->len - nhoff - ihl; in inet_gso_segment()
1407 tot_len = skb->len - nhoff; in inet_gso_segment()
1419 tot_len = skb->len - nhoff; in inet_gso_segment()
1423 tot_len = skb->len - nhoff; in inet_gso_segment()
1619 int inet_gro_complete(struct sk_buff *skb, int nhoff) in inet_gro_complete() argument
1621 __be16 newlen = htons(skb->len - nhoff); in inet_gro_complete()
[all …]
Dfou.c264 int nhoff) in fou_gro_complete() argument
277 err = ops->callbacks.gro_complete(skb, nhoff); in fou_gro_complete()
279 skb_set_inner_mac_header(skb, nhoff); in fou_gro_complete()
458 static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff) in gue_gro_complete() argument
461 struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff); in gue_gro_complete()
494 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); in gue_gro_complete()
496 skb_set_inner_mac_header(skb, nhoff + guehlen); in gue_gro_complete()
/kernel/linux/linux-5.10/net/ipv6/netfilter/
Dnf_conntrack_reasm.c170 const struct frag_hdr *fhdr, int nhoff) in nf_ct_frag6_queue() argument
280 fq->nhoffset = nhoff; in nf_ct_frag6_queue()
444 int fhoff, nhoff, ret; in nf_ct_frag6_gather() local
456 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather()
484 ret = nf_ct_frag6_queue(fq, skb, fhdr, nhoff); in nf_ct_frag6_gather()
/kernel/linux/linux-5.10/net/ethernet/
Deth.c463 int eth_gro_complete(struct sk_buff *skb, int nhoff) in eth_gro_complete() argument
465 struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff); in eth_gro_complete()
471 skb_set_inner_mac_header(skb, nhoff); in eth_gro_complete()
476 err = ptype->callbacks.gro_complete(skb, nhoff + in eth_gro_complete()
/kernel/linux/linux-5.10/net/8021q/
Dvlan_core.c508 static int vlan_gro_complete(struct sk_buff *skb, int nhoff) in vlan_gro_complete() argument
510 struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data + nhoff); in vlan_gro_complete()
518 err = ptype->callbacks.gro_complete(skb, nhoff + sizeof(*vhdr)); in vlan_gro_complete()

12