/linux/samples/bpf/ |
H A D | sockex2_kern.c | 46 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 …]
|
H A D | sockex3_kern.c | 42 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 D | parse_ldabs.c | 21 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 D | xt_HMARK.c | 132 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 D | nft_inner.c | 56 u32 nhoff, thoff; in nft_inner_parse_l2l3() local 113 nhoff = off; in nft_inner_parse_l2l3() 119 iph = skb_header_pointer(pkt->skb, nhoff, sizeof(_iph), &_iph); in nft_inner_parse_l2l3() 126 ctx->inner_nhoff = nhoff; in nft_inner_parse_l2l3() 129 thoff = nhoff + (iph->ihl * 4); in nft_inner_parse_l2l3() 143 ip6h = skb_header_pointer(pkt->skb, nhoff, sizeof(_ip6h), &_ip6h); in nft_inner_parse_l2l3() 150 ctx->inner_nhoff = nhoff; in nft_inner_parse_l2l3() 153 thoff = nhoff; in nft_inner_parse_l2l3() 159 thoff = nhoff + sizeof(_ip6h); in nft_inner_parse_l2l3()
|
H A D | nf_conntrack_core.c | 268 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() 344 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument 351 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto() 361 dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto() 367 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto() 374 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument 378 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto() [all …]
|
/linux/net/core/ |
H A D | flow_dissector.c | 211 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/ |
H A D | ip6_offload.c | 119 int nhoff; in ipv6_gso_segment() local 126 nhoff = skb_network_header(skb) - skb_mac_header(skb); in ipv6_gso_segment() 154 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in ipv6_gso_segment() 163 ipv6h = (struct ipv6hdr *)(skb_mac_header(skb) + nhoff); in ipv6_gso_segment() 169 payload_len = skb->len - nhoff - sizeof(*ipv6h); in ipv6_gso_segment() 338 INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) in ipv6_gro_complete() argument 347 skb_set_inner_network_header(skb, nhoff); in ipv6_gro_complete() 350 payload_len = skb->len - nhoff - sizeof(*iph); in ipv6_gro_complete() 362 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete() 375 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete() 390 sit_gro_complete(struct sk_buff * skb,int nhoff) sit_gro_complete() argument 397 ip6ip6_gro_complete(struct sk_buff * skb,int nhoff) ip6ip6_gro_complete() argument 404 ip4ip6_gro_complete(struct sk_buff * skb,int nhoff) ip4ip6_gro_complete() argument [all...] |
H A D | udp_offload.c | 165 INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff) in udp6_gro_complete() argument 169 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete() 173 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()
|
H A D | reassembly.c | 107 struct frag_hdr *fhdr, int nhoff, in ip6_frag_queue() argument 214 fq->nhoffset = nhoff; in ip6_frag_queue() 260 unsigned int nhoff; in ip6_frag_reasm() local 283 nhoff = fq->nhoffset; in ip6_frag_reasm() 284 skb_network_header(skb)[nhoff] = skb_transport_header(skb)[0]; in ip6_frag_reasm() 298 IP6CB(skb)->nhoff = nhoff; in ip6_frag_reasm() 358 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); in ipv6_frag_rcv() 388 ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff, in ipv6_frag_rcv()
|
H A D | ip6_input.c | 261 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core() 366 unsigned int nhoff; in ip6_protocol_deliver_rcu() local 376 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu() 380 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu() 459 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_protocol_deliver_rcu()
|
H A D | xfrm6_input.c | 48 skb_network_header(skb)[IP6CB(skb)->nhoff] = in xfrm6_transport_finish() 220 return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], in xfrm6_rcv_tnl()
|
H A D | exthdrs.c | 329 opt->nhoff = dstbuf; in ipv6_destopt_rcv() 331 opt->nhoff = opt->dst1; in ipv6_destopt_rcv() 422 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_srh_rcv() 532 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rpl_srh_rcv() 717 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rthdr_rcv() 1061 opt->nhoff = sizeof(struct ipv6hdr); in ipv6_parse_hopopts()
|
H A D | output_core.c | 132 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in __ip6_local_out()
|
/linux/net/ipv6/ila/ |
H A D | ila_common.c | 77 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/tools/testing/selftests/bpf/prog_tests/ |
H A D | flow_dissector.c | 31 got.nhoff, expected.nhoff, \ 123 .nhoff = ETH_HLEN, 144 .nhoff = ETH_HLEN, 167 .nhoff = ETH_HLEN + VLAN_HLEN, 190 .nhoff = ETH_HLEN + VLAN_HLEN * 2, 215 .nhoff = ETH_HLEN, 241 .nhoff = ETH_HLEN, 264 .nhoff = ETH_HLEN, 290 .nhoff = ETH_HLEN, 313 .nhoff = ETH_HLEN, [all …]
|
/linux/Documentation/bpf/ |
H A D | prog_flow_dissector.rst | 26 * ``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/net/bridge/netfilter/ |
H A D | nf_conntrack_bridge.c | 207 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/net/ipv4/ |
H A D | udp_offload.c | 694 int udp_gro_complete(struct sk_buff *skb, int nhoff, in udp_gro_complete() argument 697 __be16 newlen = htons(skb->len - nhoff); in udp_gro_complete() 698 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp_gro_complete() 720 nhoff + sizeof(struct udphdr)); in udp_gro_complete() 732 INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff) in udp4_gro_complete() argument 736 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp4_gro_complete() 740 uh->len = htons(skb->len - nhoff); in udp4_gro_complete() 751 uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, in udp4_gro_complete() 754 return udp_gro_complete(skb, nhoff, udp4_lib_lookup_skb); in udp4_gro_complete()
|
H A D | gre_offload.c | 236 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 D | fou_core.c | 269 int nhoff) in fou_gro_complete() argument 291 err = ops->callbacks.gro_complete(skb, nhoff); in fou_gro_complete() 293 skb_set_inner_mac_header(skb, nhoff); in fou_gro_complete() 467 static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff) in gue_gro_complete() argument 469 struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff); in gue_gro_complete() 502 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); in gue_gro_complete() 504 skb_set_inner_mac_header(skb, nhoff + guehlen); in gue_gro_complete()
|
/linux/net/ipv6/netfilter/ |
H A D | nf_conntrack_reasm.c | 170 const struct frag_hdr *fhdr, int nhoff) in nf_ct_frag6_queue() argument 281 fq->nhoffset = nhoff; in nf_ct_frag6_queue() 446 int fhoff, nhoff, ret; in nf_ct_frag6_gather() local 458 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather() 485 ret = nf_ct_frag6_queue(fq, skb, fhdr, nhoff); in nf_ct_frag6_gather()
|
/linux/net/ethernet/ |
H A D | eth.c | 444 int eth_gro_complete(struct sk_buff *skb, int nhoff) 446 struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff); in eth_gro_complete() argument 452 skb_set_inner_mac_header(skb, nhoff); in eth_gro_complete() 458 skb, nhoff + sizeof(*eh)); in eth_gro_complete()
|
/linux/net/8021q/ |
H A D | vlan_core.c | 515 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/include/net/ |
H A D | inet_common.h | 67 int inet_gro_complete(struct sk_buff *skb, int nhoff);
|