Home
last modified time | relevance | path

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

12

/linux/samples/bpf/
H A Dsockex2_kern.c45 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff)
47 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
61 static inline __u64 parse_ip(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto,
66 if (unlikely(ip_is_fragment(skb, nhoff))) in parse_ip()
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()
76 verlen = load_byte(skb, nhoff + 0/*offsetof(struct iphdr, ihl)*/); in parse_ip()
78 nhoff += 20; in parse_ip()
80 nhoff in parse_ip()
46 ip_is_fragment(struct __sk_buff * ctx,__u64 nhoff) ip_is_fragment() argument
62 parse_ip(struct __sk_buff * skb,__u64 nhoff,__u64 * ip_proto,struct flow_key_record * flow) parse_ip() argument
86 parse_ipv6(struct __sk_buff * skb,__u64 nhoff,__u64 * ip_proto,struct flow_key_record * flow) parse_ipv6() argument
103 __u64 nhoff = ETH_HLEN; flow_dissector() local
[all...]
H A Dsockex3_kern.c42 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument
44 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
109 __u32 nhoff = skb->cb[0]; in parse_ip_proto() local
120 nhoff + offsetof(struct gre_hdr, flags)); in parse_ip_proto()
122 nhoff + offsetof(struct gre_hdr, proto)); in parse_ip_proto()
127 nhoff += 4; in parse_ip_proto()
129 nhoff += 4; in parse_ip_proto()
131 nhoff += 4; in parse_ip_proto()
133 nhoff += 4; in parse_ip_proto()
135 skb->cb[0] = nhoff; in parse_ip_proto()
[all …]
H A 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/net/netfilter/
H A 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 …]
H A Dnf_conntrack_core.c268 unsigned int nhoff, in nf_ct_get_tuple() argument
284 nhoff += offsetof(struct iphdr, saddr); in nf_ct_get_tuple()
288 nhoff += offsetof(struct ipv6hdr, saddr); in nf_ct_get_tuple()
295 ap = skb_header_pointer(skb, nhoff, size, _addrs); in nf_ct_get_tuple()
338 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument
345 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto()
355 dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto()
361 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto()
368 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument
372 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto()
[all …]
H A Dnft_meta.c321 int nhoff; in nft_meta_pktinfo_may_update() local
334 nhoff = VLAN_HLEN; in nft_meta_pktinfo_may_update()
341 nhoff = PPPOE_SES_HLEN; in nft_meta_pktinfo_may_update()
347 nhoff += skb_network_offset(skb); in nft_meta_pktinfo_may_update()
350 if (__nft_set_pktinfo_ipv4_validate(pkt, nhoff)) in nft_meta_pktinfo_may_update()
354 if (__nft_set_pktinfo_ipv6_validate(pkt, nhoff)) in nft_meta_pktinfo_may_update()
/linux/net/core/
H A Dflow_dissector.c211 int nhoff, int hlen) in __skb_flow_dissect_ah() argument
219 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr); in __skb_flow_dissect_ah()
233 int nhoff, int hlen) in __skb_flow_dissect_esp() argument
241 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr); in __skb_flow_dissect_esp()
255 int nhoff, int hlen) in __skb_flow_dissect_l2tpv3() argument
265 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr); in __skb_flow_dissect_l2tpv3()
517 void *target_container, const void *data, int nhoff, in __skb_flow_dissect_mpls() argument
531 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, in __skb_flow_dissect_mpls()
576 int nhoff, int hlen) in __skb_flow_dissect_arp() argument
591 arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data, in __skb_flow_dissect_arp()
[all …]
/linux/net/ipv6/ila/
H A Dila_common.c78 size_t nhoff = sizeof(struct ipv6hdr); in ila_csum_adjust_transport() local
84 if (likely(pskb_may_pull(skb, nhoff + sizeof(struct tcphdr)))) { in ila_csum_adjust_transport()
86 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
95 if (likely(pskb_may_pull(skb, nhoff + sizeof(struct udphdr)))) { in ila_csum_adjust_transport()
97 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
111 nhoff + sizeof(struct icmp6hdr)))) { in ila_csum_adjust_transport()
113 (skb_network_header(skb) + nhoff); in ila_csum_adjust_transport()
/linux/Documentation/bpf/
H A 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/tools/testing/selftests/bpf/prog_tests/
H A Dflow_dissector.c111 .nhoff = ETH_HLEN,
132 .nhoff = ETH_HLEN,
155 .nhoff = ETH_HLEN + VLAN_HLEN,
178 .nhoff = ETH_HLEN + VLAN_HLEN * 2,
203 .nhoff = ETH_HLEN,
229 .nhoff = ETH_HLEN,
252 .nhoff = ETH_HLEN,
278 .nhoff = ETH_HLEN,
301 .nhoff = ETH_HLEN,
325 .nhoff = ETH_HLEN,
[all …]
/linux/net/ipv6/
H A Dudp_offload.c166 int udp6_gro_complete(struct sk_buff *skb, int nhoff) in udp6_gro_complete() argument
170 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete()
174 udp_set_len(uh, skb->len - nhoff); in udp6_gro_complete()
185 uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, in udp6_gro_complete()
188 return udp_gro_complete(skb, nhoff, udp6_lib_lookup_skb); in udp6_gro_complete()
H A Desp6_offload.c62 int nhoff; in esp6_gro_receive() local
108 nhoff = esp6_nexthdr_esp_offset(ipv6_hdr(skb), offset); in esp6_gro_receive()
109 if (!nhoff) in esp6_gro_receive()
112 IP6CB(skb)->nhoff = nhoff; in esp6_gro_receive()
H A Dip6_input.c303 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core()
409 unsigned int nhoff; in ip6_protocol_deliver_rcu() local
419 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu()
423 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu()
506 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_protocol_deliver_rcu()
H A Dxfrm6_input.c49 skb_network_header(skb)[IP6CB(skb)->nhoff] = in xfrm6_transport_finish()
226 return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], in xfrm6_rcv_tnl()
H A Dicmp.c569 int nhoff; in icmp6_ext_append() local
599 nhoff = skb_network_offset(skb); in icmp6_ext_append()
600 payload_len = min(skb->len - nhoff, ICMP_EXT_ORIG_DGRAM_MIN_LEN); in icmp6_ext_append()
605 if (pskb_trim(skb, nhoff + ICMP_EXT_ORIG_DGRAM_MIN_LEN) || in icmp6_ext_append()
606 __skb_put_padto(skb, nhoff + ICMP_EXT_ORIG_DGRAM_MIN_LEN, false)) in icmp6_ext_append()
/linux/net/bridge/netfilter/
H A 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 = ipv6_payload_len(skb, hdr) + sizeof(struct ipv6hdr) + nhoff; in nf_ct_br_ipv6_check()
/linux/net/ipv4/
H A 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()
256 err = ptype->callbacks.gro_complete(skb, nhoff + grehlen); in gre_gro_complete()
258 skb_set_inner_mac_header(skb, nhoff + grehlen); in gre_gro_complete()
H A Dudp_offload.c918 int udp_gro_complete(struct sk_buff *skb, int nhoff, in udp_gro_complete() argument
921 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp_gro_complete()
922 unsigned int newlen = skb->len - nhoff; in udp_gro_complete()
944 nhoff + sizeof(struct udphdr)); in udp_gro_complete()
955 INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff) in udp4_gro_complete() argument
959 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp4_gro_complete()
963 udp_set_len(uh, skb->len - nhoff); in udp4_gro_complete()
974 uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, in udp4_gro_complete()
977 return udp_gro_complete(skb, nhoff, udp4_lib_lookup_skb); in udp4_gro_complete()
H A Dfou_core.c277 int nhoff) in fou_gro_complete() argument
294 err = ops->callbacks.gro_complete(skb, nhoff); in fou_gro_complete()
296 skb_set_inner_mac_header(skb, nhoff); in fou_gro_complete()
468 static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff) in gue_gro_complete() argument
470 struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff); in gue_gro_complete()
501 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); in gue_gro_complete()
503 skb_set_inner_mac_header(skb, nhoff + guehlen); in gue_gro_complete()
/linux/net/ipv6/netfilter/
H A Dnf_conntrack_reasm.c171 const struct frag_hdr *fhdr, int nhoff, in nf_ct_frag6_queue() argument
283 fq->nhoffset = nhoff; in nf_ct_frag6_queue()
450 int fhoff, nhoff, ret; in nf_ct_frag6_gather() local
463 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather()
492 ret = nf_ct_frag6_queue(fq, skb, fhdr, nhoff, &refs); in nf_ct_frag6_gather()
/linux/net/ethernet/
H A Deth.c441 int eth_gro_complete(struct sk_buff *skb, int nhoff) in eth_gro_complete() argument
443 struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff); in eth_gro_complete()
449 skb_set_inner_mac_header(skb, nhoff); in eth_gro_complete()
455 skb, nhoff + sizeof(*eh)); in eth_gro_complete()
/linux/drivers/net/ppp/
H A Dpppoe.c1178 static int pppoe_gro_complete(struct sk_buff *skb, int nhoff) in pppoe_gro_complete() argument
1180 struct pppoe_hdr *phdr = (struct pppoe_hdr *)(skb->data + nhoff); in pppoe_gro_complete()
1189 len = skb->len - (nhoff + sizeof(*phdr)); in pppoe_gro_complete()
1195 skb, nhoff + PPPOE_SES_HLEN); in pppoe_gro_complete()
1205 int len, nhoff; in pppoe_gso_segment() local
1208 nhoff = skb_network_header(skb) - skb_mac_header(skb); in pppoe_gso_segment()
1228 phdr = (struct pppoe_hdr *)(skb_mac_header(skb) + nhoff); in pppoe_gso_segment()
1229 len = skb->len - (nhoff + sizeof(*phdr)); in pppoe_gso_segment()
/linux/net/8021q/
H A Dvlan_core.c515 static int vlan_gro_complete(struct sk_buff *skb, int nhoff) in vlan_gro_complete() argument
517 struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data + nhoff); in vlan_gro_complete()
526 skb, nhoff + sizeof(*vhdr)); in vlan_gro_complete()
/linux/tools/testing/selftests/bpf/progs/
H A Dbpf_flow.c418 keys->nhoff += sizeof(*vlan); in PROG()
426 keys->nhoff += sizeof(*vlan); in PROG()
/linux/drivers/net/ethernet/mellanox/mlx5/core/
H A Den_rx.c1147 int nhoff = ETH_HLEN + rq->hw_gro_data->fk.control.thoff; in mlx5e_shampo_update_fin_psh_flags() local
1148 int len = nhoff + sizeof(struct tcphdr); in mlx5e_shampo_update_fin_psh_flags()
1153 last_tcp_hd = (struct tcphdr *)(last_hd_addr + nhoff); in mlx5e_shampo_update_fin_psh_flags()
1210 int nhoff = rq->hw_gro_data->fk.control.thoff - sizeof(struct iphdr); in mlx5e_shampo_update_hdr() local
1211 struct iphdr *ipv4 = (struct iphdr *)(skb->data + nhoff); in mlx5e_shampo_update_hdr()
1212 __be16 newlen = htons(skb->len - nhoff); in mlx5e_shampo_update_hdr()
1222 int nhoff = rq->hw_gro_data->fk.control.thoff - sizeof(struct ipv6hdr); in mlx5e_shampo_update_hdr() local
1223 struct ipv6hdr *ipv6 = (struct ipv6hdr *)(skb->data + nhoff); in mlx5e_shampo_update_hdr()
1225 ipv6->payload_len = htons(skb->len - nhoff - sizeof(*ipv6)); in mlx5e_shampo_update_hdr()
2301 int nhoff = len - sizeof(struct iphdr); in mlx5e_handle_rx_cqe_mpwrq_shampo() local
[all …]

12