netfilter.h revision 5a67f8f9d3a7f80a49554fb1ca4e68a1effd5399
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. Not nice, but better than additional function arguments. */ 18#define NF_VERDICT_MASK 0x0000ffff 19#define NF_VERDICT_BITS 16 20 21#define NF_VERDICT_QMASK 0xffff0000 22#define NF_VERDICT_QBITS 16 23 24#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) 25 26/* only for userspace compatibility */ 27/* Generic cache responses from hook functions. 28 <= 0x2000 is used for protocol-flags. */ 29#define NFC_UNKNOWN 0x4000 30#define NFC_ALTERED 0x8000 31 32enum nf_inet_hooks { 33 NF_INET_PRE_ROUTING, 34 NF_INET_LOCAL_IN, 35 NF_INET_FORWARD, 36 NF_INET_LOCAL_OUT, 37 NF_INET_POST_ROUTING, 38 NF_INET_NUMHOOKS 39}; 40 41union nf_inet_addr { 42 __u32 all[4]; 43 __be32 ip; 44 __be32 ip6[4]; 45 struct in_addr in; 46 struct in6_addr in6; 47}; 48 49#endif /*__LINUX_NETFILTER_H*/ 50