1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI__LINUX_NETFILTER_H
3 #define _UAPI__LINUX_NETFILTER_H
5 #include <linux/types.h>
6 #include <linux/compiler.h>
10 /* Responses from hook functions. */
16 #define NF_STOP 5 /* Deprecated, for userspace nf_queue compatibility. */
17 #define NF_MAX_VERDICT NF_STOP
19 /* we overload the higher bits for encoding auxiliary data such as the queue
20 * number or errno values. Not nice, but better than additional function
22 #define NF_VERDICT_MASK 0x000000ff
24 /* extra verdict flags have mask 0x0000ff00 */
25 #define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
27 /* queue number (NF_QUEUE) or errno (NF_DROP) */
28 #define NF_VERDICT_QMASK 0xffff0000
29 #define NF_VERDICT_QBITS 16
31 #define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
33 #define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
35 /* only for userspace compatibility */
38 /* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
39 #define NF_VERDICT_BITS 16
49 NF_INET_INGRESS
= NF_INET_NUMHOOKS
,
66 #ifndef __KERNEL__ /* no longer supported by kernel */
80 #endif /* _UAPI__LINUX_NETFILTER_H */