| /linux/samples/bpf/ |
| H A D | sockex2_kern.c | 45 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 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 | 63 u32 nhoff, thoff; in nft_inner_parse_l2l3() 120 nhoff = off; in nft_inner_parse_l2l3() 126 iph = skb_header_pointer(pkt->skb, nhoff, sizeof(_iph), &_iph); in nft_inner_parse_l2l3() 133 ctx->inner_nhoff = nhoff; in nft_inner_parse_l2l3() 136 thoff = nhoff + (iph->ihl * 4); in nft_inner_parse_l2l3() 150 ip6h = skb_header_pointer(pkt->skb, nhoff, sizeof(_ip6h), &_ip6h); in nft_inner_parse_l2l3() 157 ctx->inner_nhoff = nhoff; in nft_inner_parse_l2l3() 160 thoff = nhoff; in nft_inner_parse_l2l3() 166 thoff = nhoff + sizeof(_ip6h); in nft_inner_parse_l2l3() 56 u32 nhoff, thoff; nft_inner_parse_l2l3() local
|
| 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() 341 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument 348 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto() 358 dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto() 364 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto() 371 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument 375 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto() [all …]
|
| H A D | nf_log_syslog.c | 62 const struct sk_buff *skb, unsigned int nhoff) in dump_arp_packet() argument 70 ah = skb_header_pointer(skb, nhoff, sizeof(_arph), &_arph); in dump_arp_packet() 99 ap = skb_header_pointer(skb, nhoff + sizeof(_arph), sizeof(_arpp), &_arpp); in dump_arp_packet()
|
| /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() 156 skb->network_header = skb_mac_header(skb) + nhoff - skb->head; in ipv6_gso_segment() 165 ipv6h = (struct ipv6hdr *)(skb_mac_header(skb) + nhoff); in ipv6_gso_segment() 171 payload_len = skb->len - nhoff - sizeof(*ipv6h); in ipv6_gso_segment() 340 INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) in ipv6_gro_complete() argument 349 skb_set_inner_network_header(skb, nhoff); in ipv6_gro_complete() 352 payload_len = skb->len - nhoff - sizeof(*iph); in ipv6_gro_complete() 364 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete() 377 iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete() [all …]
|
| H A D | reassembly.c | 109 struct frag_hdr *fhdr, int nhoff, in ip6_frag_queue() argument 215 fq->nhoffset = nhoff; in ip6_frag_queue() 262 unsigned int nhoff; in ip6_frag_reasm() local 285 nhoff = fq->nhoffset; in ip6_frag_reasm() 286 skb_network_header(skb)[nhoff] = skb_transport_header(skb)[0]; in ip6_frag_reasm() 300 IP6CB(skb)->nhoff = nhoff; in ip6_frag_reasm() 356 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); in ipv6_frag_rcv() 387 ret = ip6_frag_queue(net, fq, skb, fhdr, IP6CB(skb)->nhoff, in ipv6_frag_rcv()
|
| H A D | ip6_input.c | 263 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core() 368 unsigned int nhoff; in ip6_protocol_deliver_rcu() local 378 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu() 382 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu() 461 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_protocol_deliver_rcu()
|
| H A D | esp6_offload.c | 62 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 D | xfrm6_input.c | 48 skb_network_header(skb)[IP6CB(skb)->nhoff] = in xfrm6_transport_finish() 225 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() 530 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rpl_srh_rcv() 715 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rthdr_rcv() 1059 opt->nhoff = sizeof(struct ipv6hdr); in ipv6_parse_hopopts()
|
| /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/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/tools/testing/selftests/bpf/prog_tests/ |
| H A D | flow_dissector.c | 111 .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/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 | 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()
|
| /linux/net/ipv6/netfilter/ |
| H A D | nf_conntrack_reasm.c | 171 const struct frag_hdr *fhdr, int nhoff, in nf_ct_frag6_queue() argument 283 fq->nhoffset = nhoff; in nf_ct_frag6_queue() 449 int fhoff, nhoff, ret; in nf_ct_frag6_gather() local 462 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather() 491 ret = nf_ct_frag6_queue(fq, skb, fhdr, nhoff, &refs); in nf_ct_frag6_gather()
|
| /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 | 66 int inet_gro_complete(struct sk_buff *skb, int nhoff);
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | bpf_flow.c | 418 keys->nhoff += sizeof(*vlan); in PROG() 426 keys->nhoff += sizeof(*vlan); in PROG()
|
| /linux/drivers/net/bonding/ |
| H A D | bond_main.c | 4024 int hlen, __be16 l2_proto, int *nhoff, int *ip_proto, bool l34) in bond_flow_ip() argument 4030 data = bond_pull_data(skb, data, hlen, *nhoff + sizeof(*iph)); in bond_flow_ip() 4034 iph = (const struct iphdr *)(data + *nhoff); in bond_flow_ip() 4036 *nhoff += iph->ihl << 2; in bond_flow_ip() 4040 data = bond_pull_data(skb, data, hlen, *nhoff + sizeof(*iph6)); in bond_flow_ip() 4044 iph6 = (const struct ipv6hdr *)(data + *nhoff); in bond_flow_ip() 4046 *nhoff += sizeof(*iph6); in bond_flow_ip() 4053 fk->ports.ports = skb_flow_get_ports(skb, *nhoff, *ip_proto, data, hlen); in bond_flow_ip() 4084 __be16 l2_proto, int nhoff, int hlen, struct flow_keys *fk) in bond_flow_dissect() argument 4094 fk, data, l2_proto, nhoff, hlen, 0); in bond_flow_dissect() [all …]
|
| /linux/include/net/netfilter/ |
| H A D | nf_conntrack.h | 200 bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
|