aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/netfilter/Kbuild1
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/uapi/linux/netfilter/nf_tables.h582
-rw-r--r--include/uapi/linux/netfilter/nfnetlink.h5
4 files changed, 591 insertions, 1 deletions
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 174915420d3f..6ce0b7f566a7 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -5,6 +5,7 @@ header-y += nf_conntrack_ftp.h
5header-y += nf_conntrack_sctp.h 5header-y += nf_conntrack_sctp.h
6header-y += nf_conntrack_tcp.h 6header-y += nf_conntrack_tcp.h
7header-y += nf_conntrack_tuple_common.h 7header-y += nf_conntrack_tuple_common.h
8header-y += nf_tables.h
8header-y += nf_nat.h 9header-y += nf_nat.h
9header-y += nfnetlink.h 10header-y += nfnetlink.h
10header-y += nfnetlink_acct.h 11header-y += nfnetlink_acct.h
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
index 8dd803818ebe..319f47128db8 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -25,6 +25,10 @@ enum ip_conntrack_info {
25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
26}; 26};
27 27
28#define NF_CT_STATE_INVALID_BIT (1 << 0)
29#define NF_CT_STATE_BIT(ctinfo) (1 << ((ctinfo) % IP_CT_IS_REPLY + 1))
30#define NF_CT_STATE_UNTRACKED_BIT (1 << (IP_CT_NUMBER + 1))
31
28/* Bitset representing status of connection. */ 32/* Bitset representing status of connection. */
29enum ip_conntrack_status { 33enum ip_conntrack_status {
30 /* It's an expected connection: bit 0 set. This bit never changed */ 34 /* It's an expected connection: bit 0 set. This bit never changed */
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
new file mode 100644
index 000000000000..ec6d84a8ed1e
--- /dev/null
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -0,0 +1,582 @@
1#ifndef _LINUX_NF_TABLES_H
2#define _LINUX_NF_TABLES_H
3
4#define NFT_CHAIN_MAXNAMELEN 32
5
6enum nft_registers {
7 NFT_REG_VERDICT,
8 NFT_REG_1,
9 NFT_REG_2,
10 NFT_REG_3,
11 NFT_REG_4,
12 __NFT_REG_MAX
13};
14#define NFT_REG_MAX (__NFT_REG_MAX - 1)
15
16/**
17 * enum nft_verdicts - nf_tables internal verdicts
18 *
19 * @NFT_CONTINUE: continue evaluation of the current rule
20 * @NFT_BREAK: terminate evaluation of the current rule
21 * @NFT_JUMP: push the current chain on the jump stack and jump to a chain
22 * @NFT_GOTO: jump to a chain without pushing the current chain on the jump stack
23 * @NFT_RETURN: return to the topmost chain on the jump stack
24 *
25 * The nf_tables verdicts share their numeric space with the netfilter verdicts.
26 */
27enum nft_verdicts {
28 NFT_CONTINUE = -1,
29 NFT_BREAK = -2,
30 NFT_JUMP = -3,
31 NFT_GOTO = -4,
32 NFT_RETURN = -5,
33};
34
35/**
36 * enum nf_tables_msg_types - nf_tables netlink message types
37 *
38 * @NFT_MSG_NEWTABLE: create a new table (enum nft_table_attributes)
39 * @NFT_MSG_GETTABLE: get a table (enum nft_table_attributes)
40 * @NFT_MSG_DELTABLE: delete a table (enum nft_table_attributes)
41 * @NFT_MSG_NEWCHAIN: create a new chain (enum nft_chain_attributes)
42 * @NFT_MSG_GETCHAIN: get a chain (enum nft_chain_attributes)
43 * @NFT_MSG_DELCHAIN: delete a chain (enum nft_chain_attributes)
44 * @NFT_MSG_NEWRULE: create a new rule (enum nft_rule_attributes)
45 * @NFT_MSG_GETRULE: get a rule (enum nft_rule_attributes)
46 * @NFT_MSG_DELRULE: delete a rule (enum nft_rule_attributes)
47 */
48enum nf_tables_msg_types {
49 NFT_MSG_NEWTABLE,
50 NFT_MSG_GETTABLE,
51 NFT_MSG_DELTABLE,
52 NFT_MSG_NEWCHAIN,
53 NFT_MSG_GETCHAIN,
54 NFT_MSG_DELCHAIN,
55 NFT_MSG_NEWRULE,
56 NFT_MSG_GETRULE,
57 NFT_MSG_DELRULE,
58 NFT_MSG_MAX,
59};
60
61enum nft_list_attributes {
62 NFTA_LIST_UNPEC,
63 NFTA_LIST_ELEM,
64 __NFTA_LIST_MAX
65};
66#define NFTA_LIST_MAX (__NFTA_LIST_MAX - 1)
67
68/**
69 * enum nft_hook_attributes - nf_tables netfilter hook netlink attributes
70 *
71 * @NFTA_HOOK_HOOKNUM: netfilter hook number (NLA_U32)
72 * @NFTA_HOOK_PRIORITY: netfilter hook priority (NLA_U32)
73 */
74enum nft_hook_attributes {
75 NFTA_HOOK_UNSPEC,
76 NFTA_HOOK_HOOKNUM,
77 NFTA_HOOK_PRIORITY,
78 __NFTA_HOOK_MAX
79};
80#define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1)
81
82/**
83 * enum nft_table_attributes - nf_tables table netlink attributes
84 *
85 * @NFTA_TABLE_NAME: name of the table (NLA_STRING)
86 */
87enum nft_table_attributes {
88 NFTA_TABLE_UNSPEC,
89 NFTA_TABLE_NAME,
90 __NFTA_TABLE_MAX
91};
92#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
93
94/**
95 * enum nft_chain_attributes - nf_tables chain netlink attributes
96 *
97 * @NFTA_CHAIN_TABLE: name of the table containing the chain (NLA_STRING)
98 * @NFTA_CHAIN_HANDLE: numeric handle of the chain (NLA_U64)
99 * @NFTA_CHAIN_NAME: name of the chain (NLA_STRING)
100 * @NFTA_CHAIN_HOOK: hook specification for basechains (NLA_NESTED: nft_hook_attributes)
101 */
102enum nft_chain_attributes {
103 NFTA_CHAIN_UNSPEC,
104 NFTA_CHAIN_TABLE,
105 NFTA_CHAIN_HANDLE,
106 NFTA_CHAIN_NAME,
107 NFTA_CHAIN_HOOK,
108 __NFTA_CHAIN_MAX
109};
110#define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1)
111
112/**
113 * enum nft_rule_attributes - nf_tables rule netlink attributes
114 *
115 * @NFTA_RULE_TABLE: name of the table containing the rule (NLA_STRING)
116 * @NFTA_RULE_CHAIN: name of the chain containing the rule (NLA_STRING)
117 * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64)
118 * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes)
119 */
120enum nft_rule_attributes {
121 NFTA_RULE_UNSPEC,
122 NFTA_RULE_TABLE,
123 NFTA_RULE_CHAIN,
124 NFTA_RULE_HANDLE,
125 NFTA_RULE_EXPRESSIONS,
126 __NFTA_RULE_MAX
127};
128#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)
129
130enum nft_data_attributes {
131 NFTA_DATA_UNSPEC,
132 NFTA_DATA_VALUE,
133 NFTA_DATA_VERDICT,
134 __NFTA_DATA_MAX
135};
136#define NFTA_DATA_MAX (__NFTA_DATA_MAX - 1)
137
138/**
139 * enum nft_verdict_attributes - nf_tables verdict netlink attributes
140 *
141 * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts)
142 * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING)
143 */
144enum nft_verdict_attributes {
145 NFTA_VERDICT_UNSPEC,
146 NFTA_VERDICT_CODE,
147 NFTA_VERDICT_CHAIN,
148 __NFTA_VERDICT_MAX
149};
150#define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1)
151
152/**
153 * enum nft_expr_attributes - nf_tables expression netlink attributes
154 *
155 * @NFTA_EXPR_NAME: name of the expression type (NLA_STRING)
156 * @NFTA_EXPR_DATA: type specific data (NLA_NESTED)
157 */