summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorJohn Fastabend2017-08-16 07:33:09 +0200
committerDavid S. Miller2017-08-16 20:27:53 +0200
commit8a31db5615667956c513d205cfb06885c3ec6d0b (patch)
treeec01c39868af7a4f6da9e0ccaae3734e2a9c45eb /include/uapi/linux/bpf.h
parentbpf: sockmap with sk redirect support (diff)
downloadkernel-qcow2-linux-8a31db5615667956c513d205cfb06885c3ec6d0b.tar.gz
kernel-qcow2-linux-8a31db5615667956c513d205cfb06885c3ec6d0b.tar.xz
kernel-qcow2-linux-8a31db5615667956c513d205cfb06885c3ec6d0b.zip
bpf: add access to sock fields and pkt data from sk_skb programs
Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 7f774769e3f5..5ecbe812a2cc 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -712,6 +712,15 @@ struct __sk_buff {
__u32 data;
__u32 data_end;
__u32 napi_id;
+
+ /* accessed by BPF_PROG_TYPE_sk_skb types */
+ __u32 family;
+ __u32 remote_ip4; /* Stored in network byte order */
+ __u32 local_ip4; /* Stored in network byte order */
+ __u32 remote_ip6[4]; /* Stored in network byte order */
+ __u32 local_ip6[4]; /* Stored in network byte order */
+ __u32 remote_port; /* Stored in network byte order */
+ __u32 local_port; /* stored in host byte order */
};
struct bpf_tunnel_key {