oui: Make parsing of oui.conf more robust
[netsniff-ng.git] / bpf_insns.h
blob193f0b70e9f5dc868f94a313f03d74c6bf12e94a
1 #ifndef BPF_INSNS_H
2 #define BPF_INSNS_H
4 #define BPF_CLASS(code) ((code) & 0x07)
5 #define BPF_LD 0x00
6 #define BPF_LDX 0x01
7 #define BPF_ST 0x02
8 #define BPF_STX 0x03
9 #define BPF_ALU 0x04
10 #define BPF_JMP 0x05
11 #define BPF_RET 0x06
12 #define BPF_MISC 0x07
14 #define BPF_SIZE(code) ((code) & 0x18)
15 #define BPF_W 0x00
16 #define BPF_H 0x08
17 #define BPF_B 0x10
19 #define BPF_MODE(code) ((code) & 0xe0)
20 #define BPF_IMM 0x00
21 #define BPF_ABS 0x20
22 #define BPF_IND 0x40
23 #define BPF_MEM 0x60
24 #define BPF_LEN 0x80
25 #define BPF_MSH 0xa0
27 #define BPF_OP(code) ((code) & 0xf0)
28 #define BPF_ADD 0x00
29 #define BPF_SUB 0x10
30 #define BPF_MUL 0x20
31 #define BPF_DIV 0x30
32 #define BPF_OR 0x40
33 #define BPF_AND 0x50
34 #define BPF_LSH 0x60
35 #define BPF_RSH 0x70
36 #define BPF_NEG 0x80
37 #define BPF_MOD 0x90
38 #define BPF_XOR 0xa0
40 #define BPF_JA 0x00
41 #define BPF_JEQ 0x10
42 #define BPF_JGT 0x20
43 #define BPF_JGE 0x30
44 #define BPF_JSET 0x40
46 #define BPF_SRC(code) ((code) & 0x08)
47 #define BPF_K 0x00
48 #define BPF_X 0x08
50 /* ret - BPF_K and BPF_X also apply */
51 #define BPF_RVAL(code) ((code) & 0x18)
52 #define BPF_A 0x10
54 #define BPF_MISCOP(code) ((code) & 0xf8)
55 #define BPF_TAX 0x00
56 #define BPF_TXA 0x80
58 #endif /* BPF_INSNS_H */