]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - include/linux/netfilter.h
update to 2.6.39-rc3 headers
[lisovros/iproute2_canprio.git] / include / linux / netfilter.h
1 #ifndef __LINUX_NETFILTER_H
2 #define __LINUX_NETFILTER_H
3
4 #include <linux/types.h>
5
6
7 /* Responses from hook functions. */
8 #define NF_DROP 0
9 #define NF_ACCEPT 1
10 #define NF_STOLEN 2
11 #define NF_QUEUE 3
12 #define NF_REPEAT 4
13 #define NF_STOP 5
14 #define NF_MAX_VERDICT NF_STOP
15
16 /* we overload the higher bits for encoding auxiliary data such as the queue
17  * number or errno values. Not nice, but better than additional function
18  * arguments. */
19 #define NF_VERDICT_MASK 0x000000ff
20
21 /* extra verdict flags have mask 0x0000ff00 */
22 #define NF_VERDICT_FLAG_QUEUE_BYPASS    0x00008000
23
24 /* queue number (NF_QUEUE) or errno (NF_DROP) */
25 #define NF_VERDICT_QMASK 0xffff0000
26 #define NF_VERDICT_QBITS 16
27
28 #define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
29
30 #define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
31
32 /* only for userspace compatibility */
33 /* Generic cache responses from hook functions.
34    <= 0x2000 is used for protocol-flags. */
35 #define NFC_UNKNOWN 0x4000
36 #define NFC_ALTERED 0x8000
37
38 /* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
39 #define NF_VERDICT_BITS 16
40
41 enum nf_inet_hooks {
42         NF_INET_PRE_ROUTING,
43         NF_INET_LOCAL_IN,
44         NF_INET_FORWARD,
45         NF_INET_LOCAL_OUT,
46         NF_INET_POST_ROUTING,
47         NF_INET_NUMHOOKS
48 };
49
50 enum {
51         NFPROTO_UNSPEC =  0,
52         NFPROTO_IPV4   =  2,
53         NFPROTO_ARP    =  3,
54         NFPROTO_BRIDGE =  7,
55         NFPROTO_IPV6   = 10,
56         NFPROTO_DECNET = 12,
57         NFPROTO_NUMPROTO,
58 };
59
60 union nf_inet_addr {
61         __u32           all[4];
62         __be32          ip;
63         __be32          ip6[4];
64         struct in_addr  in;
65         struct in6_addr in6;
66 };
67
68 #endif /*__LINUX_NETFILTER_H*/