]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/filter.h
bpf: BPF support for sock_ops
[linux.git] / include / linux / filter.h
index 62d948f80730fdd94c587b4f0235c72cf5d3399a..738f8b14f025015e09af8a47adaf22b51945c083 100644 (file)
@@ -57,6 +57,9 @@ struct bpf_prog_aux;
 #define BPF_REG_AX             MAX_BPF_REG
 #define MAX_BPF_JIT_REG                (MAX_BPF_REG + 1)
 
+/* unused opcode to mark special call to bpf_tail_call() helper */
+#define BPF_TAIL_CALL  0xf0
+
 /* As per nm, we expose JITed images as text (code) section for
  * kallsyms. That way, tools like perf can find it to match
  * addresses.
@@ -66,8 +69,6 @@ struct bpf_prog_aux;
 /* BPF program can access up to 512 bytes of stack space. */
 #define MAX_BPF_STACK  512
 
-#define BPF_TAG_SIZE   8
-
 /* Helper macros for filter block array initializers. */
 
 /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
@@ -429,6 +430,7 @@ struct bpf_prog {
        kmemcheck_bitfield_end(meta);
        enum bpf_prog_type      type;           /* Type of BPF program */
        u32                     len;            /* Number of filter blocks */
+       u32                     jited_len;      /* Size of jited insns in bytes */
        u8                      tag[BPF_TAG_SIZE];
        struct bpf_prog_aux     *aux;           /* Auxiliary fields */
        struct sock_fprog_kern  *orig_prog;     /* Original BPF program */
@@ -896,4 +898,13 @@ static inline int bpf_tell_extensions(void)
        return SKF_AD_MAX;
 }
 
+struct bpf_sock_ops_kern {
+       struct  sock *sk;
+       u32     op;
+       union {
+               u32 reply;
+               u32 replylong[4];
+       };
+};
+
 #endif /* __LINUX_FILTER_H__ */