net: move definitions of BPF_S_* to net/core/filter.c
authorChangli Gao <xiaosuo@gmail.com>
Tue, 16 Nov 2010 20:28:24 +0000 (20:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Nov 2010 18:59:51 +0000 (10:59 -0800)
BPF_S_* are used internally, should not be exposed to the others.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
net/core/filter.c

index 69b43dbea6c6ac444dfbf8c0daf1650942a9a9b1..151f5d703b7e19d158e500d8ebdf688b3d3dd047 100644 (file)
@@ -91,54 +91,6 @@ struct sock_fprog {  /* Required for SO_ATTACH_FILTER. */
 #define         BPF_TAX         0x00
 #define         BPF_TXA         0x80
 
-enum {
-       BPF_S_RET_K = 0,
-       BPF_S_RET_A,
-       BPF_S_ALU_ADD_K,
-       BPF_S_ALU_ADD_X,
-       BPF_S_ALU_SUB_K,
-       BPF_S_ALU_SUB_X,
-       BPF_S_ALU_MUL_K,
-       BPF_S_ALU_MUL_X,
-       BPF_S_ALU_DIV_X,
-       BPF_S_ALU_AND_K,
-       BPF_S_ALU_AND_X,
-       BPF_S_ALU_OR_K,
-       BPF_S_ALU_OR_X,
-       BPF_S_ALU_LSH_K,
-       BPF_S_ALU_LSH_X,
-       BPF_S_ALU_RSH_K,
-       BPF_S_ALU_RSH_X,
-       BPF_S_ALU_NEG,
-       BPF_S_LD_W_ABS,
-       BPF_S_LD_H_ABS,
-       BPF_S_LD_B_ABS,
-       BPF_S_LD_W_LEN,
-       BPF_S_LD_W_IND,
-       BPF_S_LD_H_IND,
-       BPF_S_LD_B_IND,
-       BPF_S_LD_IMM,
-       BPF_S_LDX_W_LEN,
-       BPF_S_LDX_B_MSH,
-       BPF_S_LDX_IMM,
-       BPF_S_MISC_TAX,
-       BPF_S_MISC_TXA,
-       BPF_S_ALU_DIV_K,
-       BPF_S_LD_MEM,
-       BPF_S_LDX_MEM,
-       BPF_S_ST,
-       BPF_S_STX,
-       BPF_S_JMP_JA,
-       BPF_S_JMP_JEQ_K,
-       BPF_S_JMP_JEQ_X,
-       BPF_S_JMP_JGE_K,
-       BPF_S_JMP_JGE_X,
-       BPF_S_JMP_JGT_K,
-       BPF_S_JMP_JGT_X,
-       BPF_S_JMP_JSET_K,
-       BPF_S_JMP_JSET_X,
-};
-
 #ifndef BPF_MAXINSNS
 #define BPF_MAXINSNS 4096
 #endif
index 03dc0710194f12c5251d1e291c26a12247d5ea49..15a545d39cd34d9060f74f10c8daf0236abb803e 100644 (file)
 #include <asm/unaligned.h>
 #include <linux/filter.h>
 
+enum {
+       BPF_S_RET_K = 0,
+       BPF_S_RET_A,
+       BPF_S_ALU_ADD_K,
+       BPF_S_ALU_ADD_X,
+       BPF_S_ALU_SUB_K,
+       BPF_S_ALU_SUB_X,
+       BPF_S_ALU_MUL_K,
+       BPF_S_ALU_MUL_X,
+       BPF_S_ALU_DIV_X,
+       BPF_S_ALU_AND_K,
+       BPF_S_ALU_AND_X,
+       BPF_S_ALU_OR_K,
+       BPF_S_ALU_OR_X,
+       BPF_S_ALU_LSH_K,
+       BPF_S_ALU_LSH_X,
+       BPF_S_ALU_RSH_K,
+       BPF_S_ALU_RSH_X,
+       BPF_S_ALU_NEG,
+       BPF_S_LD_W_ABS,
+       BPF_S_LD_H_ABS,
+       BPF_S_LD_B_ABS,
+       BPF_S_LD_W_LEN,
+       BPF_S_LD_W_IND,
+       BPF_S_LD_H_IND,
+       BPF_S_LD_B_IND,
+       BPF_S_LD_IMM,
+       BPF_S_LDX_W_LEN,
+       BPF_S_LDX_B_MSH,
+       BPF_S_LDX_IMM,
+       BPF_S_MISC_TAX,
+       BPF_S_MISC_TXA,
+       BPF_S_ALU_DIV_K,
+       BPF_S_LD_MEM,
+       BPF_S_LDX_MEM,
+       BPF_S_ST,
+       BPF_S_STX,
+       BPF_S_JMP_JA,
+       BPF_S_JMP_JEQ_K,
+       BPF_S_JMP_JEQ_X,
+       BPF_S_JMP_JGE_K,
+       BPF_S_JMP_JGE_X,
+       BPF_S_JMP_JGT_K,
+       BPF_S_JMP_JGT_X,
+       BPF_S_JMP_JSET_K,
+       BPF_S_JMP_JSET_X,
+};
+
 /* No hurry in this branch */
 static void *__load_pointer(struct sk_buff *skb, int k)
 {