• Home
  • Raw
  • Download

Lines Matching refs:nh_off

252 static inline bool flow_is_frag(struct __sk_buff *skb, int nh_off)  in flow_is_frag()  argument
254 return !!(load_half(skb, nh_off + offsetof(struct iphdr, frag_off)) & in flow_is_frag()
258 static inline int flow_parse_ipv4(struct __sk_buff *skb, int nh_off, in flow_parse_ipv4() argument
263 if (unlikely(flow_is_frag(skb, nh_off))) in flow_parse_ipv4()
266 *ip_proto = load_byte(skb, nh_off + offsetof(struct iphdr, in flow_parse_ipv4()
269 flow->src = load_word(skb, nh_off + offsetof(struct iphdr, saddr)); in flow_parse_ipv4()
270 flow->dst = load_word(skb, nh_off + offsetof(struct iphdr, daddr)); in flow_parse_ipv4()
273 ip_ver_len = load_byte(skb, nh_off + 0 /* offsetof(struct iphdr, ihl) */); in flow_parse_ipv4()
275 nh_off += 20; in flow_parse_ipv4()
277 nh_off += (ip_ver_len & 0xF) << 2; in flow_parse_ipv4()
279 return nh_off; in flow_parse_ipv4()
292 static inline int flow_parse_ipv6(struct __sk_buff *skb, int nh_off, in flow_parse_ipv6() argument
295 *ip_proto = load_byte(skb, nh_off + offsetof(struct ipv6hdr, nexthdr)); in flow_parse_ipv6()
297 flow->src = flow_addr_hash_ipv6(skb, nh_off + offsetof(struct ipv6hdr, saddr)); in flow_parse_ipv6()
298 flow->dst = flow_addr_hash_ipv6(skb, nh_off + offsetof(struct ipv6hdr, daddr)); in flow_parse_ipv6()
300 return nh_off + sizeof(struct ipv6hdr); in flow_parse_ipv6()
306 int poff, nh_off = BPF_LL_OFF + ETH_HLEN; in flow_dissector() local
312 proto = load_half(skb, nh_off + in flow_dissector()
314 nh_off += sizeof(struct vlan_hdr); in flow_dissector()
317 proto = load_half(skb, nh_off + in flow_dissector()
319 nh_off += sizeof(struct vlan_hdr); in flow_dissector()
323 nh_off = flow_parse_ipv4(skb, nh_off, &ip_proto, flow); in flow_dissector()
325 nh_off = flow_parse_ipv6(skb, nh_off, &ip_proto, flow); in flow_dissector()
336 __u16 gre_flags = load_half(skb, nh_off + in flow_dissector()
338 __u16 gre_proto = load_half(skb, nh_off + in flow_dissector()
344 nh_off += 4; in flow_dissector()
346 nh_off += 4; in flow_dissector()
348 nh_off += 4; in flow_dissector()
350 nh_off += 4; in flow_dissector()
353 gre_proto = load_half(skb, nh_off + in flow_dissector()
356 nh_off += sizeof(struct vlan_hdr); in flow_dissector()
359 nh_off = flow_parse_ipv4(skb, nh_off, &ip_proto, flow); in flow_dissector()
361 nh_off = flow_parse_ipv6(skb, nh_off, &ip_proto, flow); in flow_dissector()
367 nh_off = flow_parse_ipv4(skb, nh_off, &ip_proto, flow); in flow_dissector()
370 nh_off = flow_parse_ipv6(skb, nh_off, &ip_proto, flow); in flow_dissector()
375 nh_off += flow_ports_offset(ip_proto); in flow_dissector()
377 flow->ports = load_word(skb, nh_off); in flow_dissector()
378 flow->th_off = nh_off; in flow_dissector()