Home
last modified time | relevance | path

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

/linux-4.1.27/samples/bpf/
Dsockex2_kern.c45 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument
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, in parse_ip() argument
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 += (verlen & 0xF) << 2; in parse_ip()
[all …]
/linux-4.1.27/net/core/
Dflow_dissector.c75 void *data, __be16 proto, int nhoff, int hlen) in __skb_flow_dissect() argument
82 nhoff = skb_network_offset(skb); in __skb_flow_dissect()
94 iph = __skb_header_pointer(skb, nhoff, sizeof(_iph), data, hlen, &_iph); in __skb_flow_dissect()
97 nhoff += iph->ihl * 4; in __skb_flow_dissect()
118 iph = __skb_header_pointer(skb, nhoff, sizeof(_iph), data, hlen, &_iph); in __skb_flow_dissect()
123 nhoff += sizeof(struct ipv6hdr); in __skb_flow_dissect()
142 flow->thoff = (u16)nhoff; in __skb_flow_dissect()
154 vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan), data, hlen, &_vlan); in __skb_flow_dissect()
159 nhoff += sizeof(*vlan); in __skb_flow_dissect()
167 hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr); in __skb_flow_dissect()
[all …]
/linux-4.1.27/net/netfilter/
Dxt_HMARK.c133 hmark_set_tuple_ports(const struct sk_buff *skb, unsigned int nhoff, in hmark_set_tuple_ports() argument
142 nhoff += protoff; in hmark_set_tuple_ports()
143 if (skb_copy_bits(skb, nhoff, &t->uports, sizeof(t->uports)) < 0) in hmark_set_tuple_ports()
171 unsigned int nhoff = 0; in hmark_pkt_set_htuple_ipv6() local
176 nexthdr = ipv6_find_hdr(skb, &nhoff, -1, &fragoff, &flag); in hmark_pkt_set_htuple_ipv6()
183 if (get_inner6_hdr(skb, &nhoff)) { in hmark_pkt_set_htuple_ipv6()
184 ip6 = skb_header_pointer(skb, nhoff, sizeof(_ip6), &_ip6); in hmark_pkt_set_htuple_ipv6()
189 nexthdr = ipv6_find_hdr(skb, &nhoff, -1, &fragoff, &flag); in hmark_pkt_set_htuple_ipv6()
207 hmark_set_tuple_ports(skb, nhoff, t, info); in hmark_pkt_set_htuple_ipv6()
232 static int get_inner_hdr(const struct sk_buff *skb, int iphsz, int *nhoff) in get_inner_hdr() argument
[all …]
Dnf_conntrack_l3proto_generic.c34 static bool generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, in generic_pkt_to_tuple() argument
57 static int generic_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in generic_get_l4proto() argument
Dnf_conntrack_core.c167 unsigned int nhoff, in nf_ct_get_tuple() argument
178 if (l3proto->pkt_to_tuple(skb, nhoff, tuple) == 0) in nf_ct_get_tuple()
188 bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff, in nf_ct_get_tuplepr() argument
200 ret = l3proto->get_l4proto(skb, nhoff, &protoff, &protonum); in nf_ct_get_tuplepr()
208 ret = nf_ct_get_tuple(skb, nhoff, protoff, l3num, protonum, tuple, in nf_ct_get_tuplepr()
/linux-4.1.27/net/ipv6/
Dip6_offload.c69 int nhoff; in ipv6_gso_segment() local
88 nhoff = skb_network_header(skb) - skb_mac_header(skb); in ipv6_gso_segment()
119 ipv6h = (struct ipv6hdr *)(skb_mac_header(skb) + nhoff); in ipv6_gso_segment()
120 ipv6h->payload_len = htons(skb->len - nhoff - sizeof(*ipv6h)); in ipv6_gso_segment()
261 static int ipv6_gro_complete(struct sk_buff *skb, int nhoff) in ipv6_gro_complete() argument
264 struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); in ipv6_gro_complete()
267 iph->payload_len = htons(skb->len - nhoff - sizeof(*iph)); in ipv6_gro_complete()
271 nhoff += sizeof(*iph) + ipv6_exthdrs_len(iph, &ops); in ipv6_gro_complete()
275 err = ops->callbacks.gro_complete(skb, nhoff); in ipv6_gro_complete()
Dip6_input.c154 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ipv6_rcv()
206 unsigned int nhoff; in ip6_input_finish() local
219 nhoff = IP6CB(skb)->nhoff; in ip6_input_finish()
220 nexthdr = skb_network_header(skb)[nhoff]; in ip6_input_finish()
259 ICMPV6_UNK_NEXTHDR, nhoff); in ip6_input_finish()
Dudp_offload.c157 static int udp6_gro_complete(struct sk_buff *skb, int nhoff) in udp6_gro_complete() argument
160 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete()
164 uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, in udp6_gro_complete()
170 return udp_gro_complete(skb, nhoff); in udp6_gro_complete()
Dreassembly.c210 struct frag_hdr *fhdr, int nhoff) in ip6_frag_queue() argument
343 fq->nhoffset = nhoff; in ip6_frag_queue()
385 unsigned int nhoff; in ip6_frag_reasm() local
455 nhoff = fq->nhoffset; in ip6_frag_reasm()
456 skb_network_header(head)[nhoff] = skb_transport_header(head)[0]; in ip6_frag_reasm()
495 IP6CB(head)->nhoff = nhoff; in ip6_frag_reasm()
552 IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); in ipv6_frag_rcv()
564 ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff); in ipv6_frag_rcv()
Dxfrm6_policy.c135 u16 nhoff = IP6CB(skb)->nhoff; in _decode_session6() local
139 if (!nhoff) in _decode_session6()
140 nhoff = offsetof(struct ipv6hdr, nexthdr); in _decode_session6()
142 nexthdr = nh[nhoff]; in _decode_session6()
Dxfrm6_input.c34 skb_network_header(skb)[IP6CB(skb)->nhoff] = in xfrm6_transport_finish()
53 return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], in xfrm6_rcv()
Dexthdrs.c276 opt->nhoff = dstbuf; in ipv6_destopt_rcv()
278 opt->nhoff = opt->dst1; in ipv6_destopt_rcv()
352 opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb); in ipv6_rthdr_rcv()
639 opt->nhoff = sizeof(struct ipv6hdr); in ipv6_parse_hopopts()
Doutput_core.c147 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in __ip6_local_out_sk()
Dxfrm6_tunnel.c229 return skb_network_header(skb)[IP6CB(skb)->nhoff]; in xfrm6_tunnel_input()
/linux-4.1.27/net/ipv4/
Dudp_offload.c379 int udp_gro_complete(struct sk_buff *skb, int nhoff) in udp_gro_complete() argument
382 __be16 newlen = htons(skb->len - nhoff); in udp_gro_complete()
383 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp_gro_complete()
400 nhoff + sizeof(struct udphdr), in udp_gro_complete()
410 skb_set_inner_mac_header(skb, nhoff + sizeof(struct udphdr)); in udp_gro_complete()
415 static int udp4_gro_complete(struct sk_buff *skb, int nhoff) in udp4_gro_complete() argument
418 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp4_gro_complete()
422 uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, in udp4_gro_complete()
428 return udp_gro_complete(skb, nhoff); in udp4_gro_complete()
Dgre_offload.c227 static int gre_gro_complete(struct sk_buff *skb, int nhoff) in gre_gro_complete() argument
229 struct gre_base_hdr *greh = (struct gre_base_hdr *)(skb->data + nhoff); in gre_gro_complete()
248 err = ptype->callbacks.gro_complete(skb, nhoff + grehlen); in gre_gro_complete()
252 skb_set_inner_mac_header(skb, nhoff + grehlen); in gre_gro_complete()
Dgeneve.c216 static int geneve_gro_complete(struct sk_buff *skb, int nhoff, in geneve_gro_complete() argument
225 udp_tunnel_gro_complete(skb, nhoff); in geneve_gro_complete()
227 gh = (struct genevehdr *)(skb->data + nhoff); in geneve_gro_complete()
234 err = ptype->callbacks.gro_complete(skb, nhoff + gh_len); in geneve_gro_complete()
Daf_inet.c1211 int nhoff; in inet_gso_segment() local
1232 nhoff = skb_network_header(skb) - skb_mac_header(skb); in inet_gso_segment()
1273 iph = (struct iphdr *)(skb_mac_header(skb) + nhoff); in inet_gso_segment()
1279 offset += skb->len - nhoff - ihl; in inet_gso_segment()
1283 iph->tot_len = htons(skb->len - nhoff); in inet_gso_segment()
1402 static int inet_gro_complete(struct sk_buff *skb, int nhoff) in inet_gro_complete() argument
1404 __be16 newlen = htons(skb->len - nhoff); in inet_gro_complete()
1405 struct iphdr *iph = (struct iphdr *)(skb->data + nhoff); in inet_gro_complete()
1411 skb_set_inner_network_header(skb, nhoff); in inet_gro_complete()
1425 err = ops->callbacks.gro_complete(skb, nhoff + sizeof(*iph)); in inet_gro_complete()
Dfou.c199 static int fou_gro_complete(struct sk_buff *skb, int nhoff, in fou_gro_complete() argument
207 udp_tunnel_gro_complete(skb, nhoff); in fou_gro_complete()
215 err = ops->callbacks.gro_complete(skb, nhoff); in fou_gro_complete()
369 static int gue_gro_complete(struct sk_buff *skb, int nhoff, in gue_gro_complete() argument
373 struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff); in gue_gro_complete()
389 err = ops->callbacks.gro_complete(skb, nhoff + guehlen); in gue_gro_complete()
/linux-4.1.27/include/net/netfilter/
Dnf_conntrack_l3proto.h30 bool (*pkt_to_tuple)(const struct sk_buff *skb, unsigned int nhoff,
49 int (*get_l4proto)(const struct sk_buff *skb, unsigned int nhoff,
Dnf_conntrack_core.h42 bool nf_ct_get_tuple(const struct sk_buff *skb, unsigned int nhoff,
Dnf_conntrack.h193 bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
Dnf_tables.h20 u8 nhoff; member
/linux-4.1.27/net/ipv4/netfilter/
Dnf_conntrack_l3proto_ipv4.c34 static bool ipv4_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, in ipv4_pkt_to_tuple() argument
39 ap = skb_header_pointer(skb, nhoff + offsetof(struct iphdr, saddr), in ipv4_pkt_to_tuple()
66 static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv4_get_l4proto() argument
72 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); in ipv4_get_l4proto()
81 *dataoff = nhoff + (iph->ihl << 2); in ipv4_get_l4proto()
88 nhoff, iph->ihl << 2, skb->len); in ipv4_get_l4proto()
Dnf_log_arp.c47 const struct sk_buff *skb, unsigned int nhoff) in dump_arp_packet() argument
/linux-4.1.27/net/ethernet/
Deth.c448 int eth_gro_complete(struct sk_buff *skb, int nhoff) in eth_gro_complete() argument
450 struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff); in eth_gro_complete()
456 skb_set_inner_mac_header(skb, nhoff); in eth_gro_complete()
461 err = ptype->callbacks.gro_complete(skb, nhoff + in eth_gro_complete()
/linux-4.1.27/net/ipv6/netfilter/
Dnf_conntrack_l3proto_ipv6.c37 static bool ipv6_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, in ipv6_pkt_to_tuple() argument
43 ap = skb_header_pointer(skb, nhoff + offsetof(struct ipv6hdr, saddr), in ipv6_pkt_to_tuple()
70 static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, in ipv6_get_l4proto() argument
73 unsigned int extoff = nhoff + sizeof(struct ipv6hdr); in ipv6_get_l4proto()
78 if (skb_copy_bits(skb, nhoff + offsetof(struct ipv6hdr, nexthdr), in ipv6_get_l4proto()
Dnf_conntrack_reasm.c220 const struct frag_hdr *fhdr, int nhoff) in nf_ct_frag6_queue() argument
358 fq->nhoffset = nhoff; in nf_ct_frag6_queue()
576 int fhoff, nhoff; in nf_ct_frag6_gather() local
586 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) in nf_ct_frag6_gather()
615 if (nf_ct_frag6_queue(fq, clone, fhdr, nhoff) < 0) { in nf_ct_frag6_gather()
/linux-4.1.27/include/net/
Dudp_tunnel.h104 static inline void udp_tunnel_gro_complete(struct sk_buff *skb, int nhoff) in udp_tunnel_gro_complete() argument
108 uh = (struct udphdr *)(skb->data + nhoff - sizeof(struct udphdr)); in udp_tunnel_gro_complete()
Dflow_keys.h31 void *data, __be16 proto, int nhoff, int hlen);
Dudp.h163 int udp_gro_complete(struct sk_buff *skb, int nhoff);
/linux-4.1.27/drivers/net/ethernet/sfc/
Drx.c848 int nhoff; in efx_filter_rfs() local
866 nhoff = sizeof(struct vlan_hdr); in efx_filter_rfs()
869 nhoff = 0; in efx_filter_rfs()
886 (const struct iphdr *)(skb->data + nhoff); in efx_filter_rfs()
888 EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip)); in efx_filter_rfs()
894 EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4); in efx_filter_rfs()
895 ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); in efx_filter_rfs()
898 (const struct ipv6hdr *)(skb->data + nhoff); in efx_filter_rfs()
901 nhoff + sizeof(*ip6) + 4); in efx_filter_rfs()
/linux-4.1.27/include/linux/
Detherdevice.h56 int eth_gro_complete(struct sk_buff *skb, int nhoff);
Dipv6.h103 __u16 nhoff; member
Dnetdevice.h1988 int (*gro_complete)(struct sk_buff *skb, int nhoff);
2004 int nhoff,
/linux-4.1.27/drivers/net/
Dvxlan.c647 static int vxlan_gro_complete(struct sk_buff *skb, int nhoff, in vxlan_gro_complete() argument
650 udp_tunnel_gro_complete(skb, nhoff); in vxlan_gro_complete()
652 return eth_gro_complete(skb, nhoff + sizeof(struct vxlanhdr)); in vxlan_gro_complete()
/linux-4.1.27/drivers/net/ethernet/mellanox/mlx4/
Den_netdev.c311 int nhoff = skb_network_offset(skb); in mlx4_en_filter_rfs() local
317 ip = (const struct iphdr *)(skb->data + nhoff); in mlx4_en_filter_rfs()
323 ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); in mlx4_en_filter_rfs()