1
2#ifndef __LINUX_NETFILTER_H
3#define __LINUX_NETFILTER_H
4
5#include <linux/types.h>
6
7#include <linux/in.h>
8#include <linux/in6.h>
9
10
11#define NF_DROP 0
12#define NF_ACCEPT 1
13#define NF_STOLEN 2
14#define NF_QUEUE 3
15#define NF_REPEAT 4
16#define NF_STOP 5
17#define NF_MAX_VERDICT NF_STOP
18
19
20
21
22#define NF_VERDICT_MASK 0x000000ff
23
24
25#define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
26
27
28#define NF_VERDICT_QMASK 0xffff0000
29#define NF_VERDICT_QBITS 16
30
31#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
32
33#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
34
35
36
37
38#define NF_VERDICT_BITS 16
39
40enum nf_inet_hooks {
41 NF_INET_PRE_ROUTING,
42 NF_INET_LOCAL_IN,
43 NF_INET_FORWARD,
44 NF_INET_LOCAL_OUT,
45 NF_INET_POST_ROUTING,
46 NF_INET_NUMHOOKS
47};
48
49enum nf_dev_hooks {
50 NF_NETDEV_INGRESS,
51 NF_NETDEV_NUMHOOKS
52};
53
54enum {
55 NFPROTO_UNSPEC = 0,
56 NFPROTO_INET = 1,
57 NFPROTO_IPV4 = 2,
58 NFPROTO_ARP = 3,
59 NFPROTO_NETDEV = 5,
60 NFPROTO_BRIDGE = 7,
61 NFPROTO_IPV6 = 10,
62 NFPROTO_DECNET = 12,
63 NFPROTO_NUMPROTO,
64};
65
66union nf_inet_addr {
67 __u32 all[4];
68 __be32 ip;
69 __be32 ip6[4];
70 struct in_addr in;
71 struct in6_addr in6;
72};
73
74#endif
75