Home
last modified time | relevance | path

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

123

/Linux-v6.1/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()
/Linux-v6.1/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.c278 unsigned int nhoff, in nf_ct_get_tuple() argument
294 nhoff += offsetof(struct iphdr, saddr); in nf_ct_get_tuple()
298 nhoff += offsetof(struct ipv6hdr, saddr); in nf_ct_get_tuple()
305 ap = skb_header_pointer(skb, nhoff, size, _addrs); in nf_ct_get_tuple()
354 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument
361 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto()
371 dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto()
377 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto()
384 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument
388 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto()
[all …]
/Linux-v6.1/net/core/
Dflow_dissector.c210 int nhoff, int hlen) in __skb_flow_dissect_l2tpv3() argument
220 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr); in __skb_flow_dissect_l2tpv3()
439 void *target_container, const void *data, int nhoff, in __skb_flow_dissect_mpls() argument
453 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, in __skb_flow_dissect_mpls()
498 int nhoff, int hlen) in __skb_flow_dissect_arp() argument
513 arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data, in __skb_flow_dissect_arp()
526 arp_eth = __skb_header_pointer(skb, nhoff + sizeof(_arp), in __skb_flow_dissect_arp()
752 int nhoff, u8 ip_proto, int hlen) in __skb_flow_dissect_ports() argument
769 key_ports->ports = __skb_flow_get_ports(skb, nhoff, ip_proto, in __skb_flow_dissect_ports()
894 __be16 proto, int nhoff, int hlen, unsigned int flags) in bpf_flow_dissect() argument
[all …]
/Linux-v6.1/net/ipv6/
Dip6_offload.c86 int nhoff; in ipv6_gso_segment() local
112 nhoff = skb_network_header(skb) - skb_mac_header(skb); in ipv6_gso_segment()
140 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in ipv6_gso_segment()
149 ipv6h = (struct ipv6hdr *)(skb_mac_header(skb) + nhoff); in ipv6_gso_segment()
155 payload_len = skb->len - nhoff - sizeof(*ipv6h); in ipv6_gso_segment()
339 INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) in ipv6_gro_complete() argument
348 skb_set_inner_network_header(skb, nhoff); in ipv6_gro_complete()
351 payload_len = skb->len - nhoff - sizeof(*iph); in ipv6_gro_complete()
363 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete()
376 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete()
[all …]
Dudp_offload.c160 INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff) in udp6_gro_complete() argument
163 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
210 fq->nhoffset = nhoff; in ip6_frag_queue()
255 unsigned int nhoff; in ip6_frag_reasm() local
278 nhoff = fq->nhoffset; in ip6_frag_reasm()
279 skb_network_header(skb)[nhoff] = skb_transport_header(skb)[0]; in ip6_frag_reasm()
293 IP6CB(skb)->nhoff = nhoff; in ip6_frag_reasm()
353 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); in ipv6_frag_rcv()
383 ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff, in ipv6_frag_rcv()
Dip6_input.c261 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core()
367 unsigned int nhoff; in ip6_protocol_deliver_rcu() local
377 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu()
381 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu()
462 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_protocol_deliver_rcu()
Desp6_offload.c58 int nhoff; in esp6_gro_receive() local
95 nhoff = esp6_nexthdr_esp_offset(ipv6_hdr(skb), offset); in esp6_gro_receive()
96 if (!nhoff) in esp6_gro_receive()
99 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.c329 opt->nhoff = dstbuf; in ipv6_destopt_rcv()
331 opt->nhoff = opt->dst1; in ipv6_destopt_rcv()
427 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_srh_rcv()
543 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rpl_srh_rcv()
747 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rthdr_rcv()
1091 opt->nhoff = sizeof(struct ipv6hdr); in ipv6_parse_hopopts()
/Linux-v6.1/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()
/Linux-v6.1/tools/testing/selftests/bpf/prog_tests/
Dflow_dissector.c32 got.nhoff, expected.nhoff, \
124 .nhoff = ETH_HLEN,
145 .nhoff = ETH_HLEN,
168 .nhoff = ETH_HLEN + VLAN_HLEN,
191 .nhoff = ETH_HLEN + VLAN_HLEN * 2,
216 .nhoff = ETH_HLEN,
242 .nhoff = ETH_HLEN,
265 .nhoff = ETH_HLEN,
291 .nhoff = ETH_HLEN,
314 .nhoff = ETH_HLEN,
[all …]
/Linux-v6.1/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
/Linux-v6.1/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()
/Linux-v6.1/net/bridge/netfilter/
Dnf_conntrack_bridge.c207 int nhoff, len; in nf_ct_br_ip_check() local
209 nhoff = skb_network_offset(skb); in nf_ct_br_ip_check()
216 if (skb->len < nhoff + len || in nf_ct_br_ip_check()
226 int nhoff, len; in nf_ct_br_ipv6_check() local
228 nhoff = skb_network_offset(skb); in nf_ct_br_ipv6_check()
233 len = ntohs(hdr->payload_len) + sizeof(struct ipv6hdr) + nhoff; in nf_ct_br_ipv6_check()
/Linux-v6.1/net/ipv4/
Dgre_offload.c235 static int gre_gro_complete(struct sk_buff *skb, int nhoff) in gre_gro_complete() argument
237 struct gre_base_hdr *greh = (struct gre_base_hdr *)(skb->data + nhoff); in gre_gro_complete()
255 err = ptype->callbacks.gro_complete(skb, nhoff + grehlen); in gre_gro_complete()
257 skb_set_inner_mac_header(skb, nhoff + grehlen); in gre_gro_complete()
Dudp_offload.c660 int udp_gro_complete(struct sk_buff *skb, int nhoff, in udp_gro_complete() argument
663 __be16 newlen = htons(skb->len - nhoff); in udp_gro_complete()
664 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp_gro_complete()
686 nhoff + sizeof(struct udphdr)); in udp_gro_complete()
698 INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff) in udp4_gro_complete() argument
701 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp4_gro_complete()
705 uh->len = htons(skb->len - nhoff); in udp4_gro_complete()
722 uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, in udp4_gro_complete()
725 return udp_gro_complete(skb, nhoff, udp4_lib_lookup_skb); in udp4_gro_complete()
Daf_inet.c1356 int nhoff; in inet_gso_segment() local
1361 nhoff = skb_network_header(skb) - skb_mac_header(skb); in inet_gso_segment()
1400 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in inet_gso_segment()
1410 iph = (struct iphdr *)(skb_mac_header(skb) + nhoff); in inet_gso_segment()
1415 offset += skb->len - nhoff - ihl; in inet_gso_segment()
1416 tot_len = skb->len - nhoff; in inet_gso_segment()
1428 tot_len = skb->len - nhoff; in inet_gso_segment()
1432 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.c261 int nhoff) in fou_gro_complete() argument
273 err = ops->callbacks.gro_complete(skb, nhoff); in fou_gro_complete()
275 skb_set_inner_mac_header(skb, nhoff); in fou_gro_complete()
446 static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff) in gue_gro_complete() argument
448 struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff); in gue_gro_complete()
481 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); in gue_gro_complete()
483 skb_set_inner_mac_header(skb, nhoff + guehlen); in gue_gro_complete()
/Linux-v6.1/net/ipv6/netfilter/
Dnf_conntrack_reasm.c166 const struct frag_hdr *fhdr, int nhoff) in nf_ct_frag6_queue() argument
277 fq->nhoffset = nhoff; in nf_ct_frag6_queue()
441 int fhoff, nhoff, ret; in nf_ct_frag6_gather() local
453 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather()
481 ret = nf_ct_frag6_queue(fq, skb, fhdr, nhoff); in nf_ct_frag6_gather()
/Linux-v6.1/net/ethernet/
Deth.c456 int eth_gro_complete(struct sk_buff *skb, int nhoff) in eth_gro_complete() argument
458 struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff); in eth_gro_complete()
464 skb_set_inner_mac_header(skb, nhoff); in eth_gro_complete()
470 skb, nhoff + sizeof(*eh)); in eth_gro_complete()
/Linux-v6.1/net/8021q/
Dvlan_core.c506 static int vlan_gro_complete(struct sk_buff *skb, int nhoff) in vlan_gro_complete() argument
508 struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data + nhoff); in vlan_gro_complete()
517 skb, nhoff + sizeof(*vhdr)); in vlan_gro_complete()

123