Lines Matching refs:skb
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()
86 static inline __u64 parse_ipv6(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto, in parse_ipv6() argument
89 *ip_proto = load_byte(skb, in parse_ipv6()
91 flow->src = ipv6_addr_hash(skb, in parse_ipv6()
93 flow->dst = ipv6_addr_hash(skb, in parse_ipv6()
100 static inline bool flow_dissector(struct __sk_buff *skb, in flow_dissector() argument
105 __u64 proto = load_half(skb, 12); in flow_dissector()
109 proto = load_half(skb, nhoff + offsetof(struct vlan_hdr, in flow_dissector()
115 proto = load_half(skb, nhoff + offsetof(struct vlan_hdr, in flow_dissector()
121 nhoff = parse_ip(skb, nhoff, &ip_proto, flow); in flow_dissector()
123 nhoff = parse_ipv6(skb, nhoff, &ip_proto, flow); in flow_dissector()
134 __u64 gre_flags = load_half(skb, in flow_dissector()
136 __u64 gre_proto = load_half(skb, in flow_dissector()
152 proto = load_half(skb, in flow_dissector()
159 nhoff = parse_ip(skb, nhoff, &ip_proto, flow); in flow_dissector()
161 nhoff = parse_ipv6(skb, nhoff, &ip_proto, flow); in flow_dissector()
167 nhoff = parse_ip(skb, nhoff, &ip_proto, flow); in flow_dissector()
170 nhoff = parse_ipv6(skb, nhoff, &ip_proto, flow); in flow_dissector()
180 flow->ports = load_word(skb, nhoff); in flow_dissector()
201 int bpf_prog2(struct __sk_buff *skb) in bpf_prog2() argument
207 if (!flow_dissector(skb, &flow)) in bpf_prog2()
214 __sync_fetch_and_add(&value->bytes, skb->len); in bpf_prog2()
216 struct pair val = {1, skb->len}; in bpf_prog2()