Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_NF_TABLES_H |
| 2 | #define _LINUX_NF_TABLES_H |
| 3 | |
Pablo Neira Ayuso | 1cae565 | 2015-03-05 15:05:36 +0100 | [diff] [blame] | 4 | #define NFT_TABLE_MAXNAMELEN 32 |
Pablo Neira Ayuso | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 5 | #define NFT_CHAIN_MAXNAMELEN 32 |
| 6 | #define NFT_USERDATA_MAXLEN 256 |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 7 | |
Patrick McHardy | 49499c3 | 2015-04-11 02:27:37 +0100 | [diff] [blame] | 8 | /** |
| 9 | * enum nft_registers - nf_tables registers |
| 10 | * |
| 11 | * nf_tables used to have five registers: a verdict register and four data |
| 12 | * registers of size 16. The data registers have been changed to 16 registers |
| 13 | * of size 4. For compatibility reasons, the NFT_REG_[1-4] registers still |
| 14 | * map to areas of size 16, the 4 byte registers are addressed using |
| 15 | * NFT_REG32_00 - NFT_REG32_15. |
| 16 | */ |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 17 | enum nft_registers { |
| 18 | NFT_REG_VERDICT, |
| 19 | NFT_REG_1, |
| 20 | NFT_REG_2, |
| 21 | NFT_REG_3, |
| 22 | NFT_REG_4, |
Patrick McHardy | 49499c3 | 2015-04-11 02:27:37 +0100 | [diff] [blame] | 23 | __NFT_REG_MAX, |
| 24 | |
| 25 | NFT_REG32_00 = 8, |
| 26 | MFT_REG32_01, |
| 27 | NFT_REG32_02, |
| 28 | NFT_REG32_03, |
| 29 | NFT_REG32_04, |
| 30 | NFT_REG32_05, |
| 31 | NFT_REG32_06, |
| 32 | NFT_REG32_07, |
| 33 | NFT_REG32_08, |
| 34 | NFT_REG32_09, |
| 35 | NFT_REG32_10, |
| 36 | NFT_REG32_11, |
| 37 | NFT_REG32_12, |
| 38 | NFT_REG32_13, |
| 39 | NFT_REG32_14, |
| 40 | NFT_REG32_15, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 41 | }; |
| 42 | #define NFT_REG_MAX (__NFT_REG_MAX - 1) |
| 43 | |
Patrick McHardy | 49499c3 | 2015-04-11 02:27:37 +0100 | [diff] [blame] | 44 | #define NFT_REG_SIZE 16 |
| 45 | #define NFT_REG32_SIZE 4 |
| 46 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 47 | /** |
| 48 | * enum nft_verdicts - nf_tables internal verdicts |
| 49 | * |
| 50 | * @NFT_CONTINUE: continue evaluation of the current rule |
| 51 | * @NFT_BREAK: terminate evaluation of the current rule |
| 52 | * @NFT_JUMP: push the current chain on the jump stack and jump to a chain |
| 53 | * @NFT_GOTO: jump to a chain without pushing the current chain on the jump stack |
| 54 | * @NFT_RETURN: return to the topmost chain on the jump stack |
| 55 | * |
| 56 | * The nf_tables verdicts share their numeric space with the netfilter verdicts. |
| 57 | */ |
| 58 | enum nft_verdicts { |
| 59 | NFT_CONTINUE = -1, |
| 60 | NFT_BREAK = -2, |
| 61 | NFT_JUMP = -3, |
| 62 | NFT_GOTO = -4, |
| 63 | NFT_RETURN = -5, |
| 64 | }; |
| 65 | |
| 66 | /** |
| 67 | * enum nf_tables_msg_types - nf_tables netlink message types |
| 68 | * |
| 69 | * @NFT_MSG_NEWTABLE: create a new table (enum nft_table_attributes) |
| 70 | * @NFT_MSG_GETTABLE: get a table (enum nft_table_attributes) |
| 71 | * @NFT_MSG_DELTABLE: delete a table (enum nft_table_attributes) |
| 72 | * @NFT_MSG_NEWCHAIN: create a new chain (enum nft_chain_attributes) |
| 73 | * @NFT_MSG_GETCHAIN: get a chain (enum nft_chain_attributes) |
| 74 | * @NFT_MSG_DELCHAIN: delete a chain (enum nft_chain_attributes) |
| 75 | * @NFT_MSG_NEWRULE: create a new rule (enum nft_rule_attributes) |
| 76 | * @NFT_MSG_GETRULE: get a rule (enum nft_rule_attributes) |
| 77 | * @NFT_MSG_DELRULE: delete a rule (enum nft_rule_attributes) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 78 | * @NFT_MSG_NEWSET: create a new set (enum nft_set_attributes) |
| 79 | * @NFT_MSG_GETSET: get a set (enum nft_set_attributes) |
| 80 | * @NFT_MSG_DELSET: delete a set (enum nft_set_attributes) |
| 81 | * @NFT_MSG_NEWSETELEM: create a new set element (enum nft_set_elem_attributes) |
| 82 | * @NFT_MSG_GETSETELEM: get a set element (enum nft_set_elem_attributes) |
| 83 | * @NFT_MSG_DELSETELEM: delete a set element (enum nft_set_elem_attributes) |
Pablo Neira Ayuso | 84d7fce | 2014-09-04 14:30:22 +0200 | [diff] [blame] | 84 | * @NFT_MSG_NEWGEN: announce a new generation, only for events (enum nft_gen_attributes) |
| 85 | * @NFT_MSG_GETGEN: get the rule-set generation (enum nft_gen_attributes) |
Florian Westphal | 33d5a7b | 2015-11-28 21:53:04 +0100 | [diff] [blame] | 86 | * @NFT_MSG_TRACE: trace event (enum nft_trace_attributes) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 87 | */ |
| 88 | enum nf_tables_msg_types { |
| 89 | NFT_MSG_NEWTABLE, |
| 90 | NFT_MSG_GETTABLE, |
| 91 | NFT_MSG_DELTABLE, |
| 92 | NFT_MSG_NEWCHAIN, |
| 93 | NFT_MSG_GETCHAIN, |
| 94 | NFT_MSG_DELCHAIN, |
| 95 | NFT_MSG_NEWRULE, |
| 96 | NFT_MSG_GETRULE, |
| 97 | NFT_MSG_DELRULE, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 98 | NFT_MSG_NEWSET, |
| 99 | NFT_MSG_GETSET, |
| 100 | NFT_MSG_DELSET, |
| 101 | NFT_MSG_NEWSETELEM, |
| 102 | NFT_MSG_GETSETELEM, |
| 103 | NFT_MSG_DELSETELEM, |
Pablo Neira Ayuso | 84d7fce | 2014-09-04 14:30:22 +0200 | [diff] [blame] | 104 | NFT_MSG_NEWGEN, |
| 105 | NFT_MSG_GETGEN, |
Florian Westphal | 33d5a7b | 2015-11-28 21:53:04 +0100 | [diff] [blame] | 106 | NFT_MSG_TRACE, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 107 | NFT_MSG_MAX, |
| 108 | }; |
| 109 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 110 | /** |
| 111 | * enum nft_list_attributes - nf_tables generic list netlink attributes |
| 112 | * |
| 113 | * @NFTA_LIST_ELEM: list element (NLA_NESTED) |
| 114 | */ |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 115 | enum nft_list_attributes { |
| 116 | NFTA_LIST_UNPEC, |
| 117 | NFTA_LIST_ELEM, |
| 118 | __NFTA_LIST_MAX |
| 119 | }; |
| 120 | #define NFTA_LIST_MAX (__NFTA_LIST_MAX - 1) |
| 121 | |
| 122 | /** |
| 123 | * enum nft_hook_attributes - nf_tables netfilter hook netlink attributes |
| 124 | * |
| 125 | * @NFTA_HOOK_HOOKNUM: netfilter hook number (NLA_U32) |
| 126 | * @NFTA_HOOK_PRIORITY: netfilter hook priority (NLA_U32) |
Pablo Neira Ayuso | 2cbce13 | 2015-06-12 13:55:41 +0200 | [diff] [blame] | 127 | * @NFTA_HOOK_DEV: netdevice name (NLA_STRING) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 128 | */ |
| 129 | enum nft_hook_attributes { |
| 130 | NFTA_HOOK_UNSPEC, |
| 131 | NFTA_HOOK_HOOKNUM, |
| 132 | NFTA_HOOK_PRIORITY, |
Pablo Neira Ayuso | 2cbce13 | 2015-06-12 13:55:41 +0200 | [diff] [blame] | 133 | NFTA_HOOK_DEV, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 134 | __NFTA_HOOK_MAX |
| 135 | }; |
| 136 | #define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1) |
| 137 | |
| 138 | /** |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 139 | * enum nft_table_flags - nf_tables table flags |
| 140 | * |
| 141 | * @NFT_TABLE_F_DORMANT: this table is not active |
| 142 | */ |
| 143 | enum nft_table_flags { |
| 144 | NFT_TABLE_F_DORMANT = 0x1, |
| 145 | }; |
| 146 | |
| 147 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 148 | * enum nft_table_attributes - nf_tables table netlink attributes |
| 149 | * |
| 150 | * @NFTA_TABLE_NAME: name of the table (NLA_STRING) |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 151 | * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) |
Tomasz Bursztyka | d8bcc768 | 2013-12-12 15:00:42 +0200 | [diff] [blame] | 152 | * @NFTA_TABLE_USE: number of chains in this table (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 153 | */ |
| 154 | enum nft_table_attributes { |
| 155 | NFTA_TABLE_UNSPEC, |
| 156 | NFTA_TABLE_NAME, |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 157 | NFTA_TABLE_FLAGS, |
Tomasz Bursztyka | d8bcc768 | 2013-12-12 15:00:42 +0200 | [diff] [blame] | 158 | NFTA_TABLE_USE, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 159 | __NFTA_TABLE_MAX |
| 160 | }; |
| 161 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) |
| 162 | |
| 163 | /** |
| 164 | * enum nft_chain_attributes - nf_tables chain netlink attributes |
| 165 | * |
| 166 | * @NFTA_CHAIN_TABLE: name of the table containing the chain (NLA_STRING) |
| 167 | * @NFTA_CHAIN_HANDLE: numeric handle of the chain (NLA_U64) |
| 168 | * @NFTA_CHAIN_NAME: name of the chain (NLA_STRING) |
| 169 | * @NFTA_CHAIN_HOOK: hook specification for basechains (NLA_NESTED: nft_hook_attributes) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 170 | * @NFTA_CHAIN_POLICY: numeric policy of the chain (NLA_U32) |
| 171 | * @NFTA_CHAIN_USE: number of references to this chain (NLA_U32) |
Pablo Neira Ayuso | 9370761 | 2013-10-10 23:21:26 +0200 | [diff] [blame] | 172 | * @NFTA_CHAIN_TYPE: type name of the string (NLA_NUL_STRING) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 173 | * @NFTA_CHAIN_COUNTERS: counter specification of the chain (NLA_NESTED: nft_counter_attributes) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 174 | */ |
| 175 | enum nft_chain_attributes { |
| 176 | NFTA_CHAIN_UNSPEC, |
| 177 | NFTA_CHAIN_TABLE, |
| 178 | NFTA_CHAIN_HANDLE, |
| 179 | NFTA_CHAIN_NAME, |
| 180 | NFTA_CHAIN_HOOK, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 181 | NFTA_CHAIN_POLICY, |
| 182 | NFTA_CHAIN_USE, |
Pablo Neira Ayuso | 9370761 | 2013-10-10 23:21:26 +0200 | [diff] [blame] | 183 | NFTA_CHAIN_TYPE, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 184 | NFTA_CHAIN_COUNTERS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 185 | __NFTA_CHAIN_MAX |
| 186 | }; |
| 187 | #define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1) |
| 188 | |
| 189 | /** |
| 190 | * enum nft_rule_attributes - nf_tables rule netlink attributes |
| 191 | * |
| 192 | * @NFTA_RULE_TABLE: name of the table containing the rule (NLA_STRING) |
| 193 | * @NFTA_RULE_CHAIN: name of the chain containing the rule (NLA_STRING) |
| 194 | * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64) |
| 195 | * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 196 | * @NFTA_RULE_COMPAT: compatibility specifications of the rule (NLA_NESTED: nft_rule_compat_attributes) |
Eric Leblond | 5e94846 | 2013-10-10 13:41:44 +0200 | [diff] [blame] | 197 | * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64) |
Pablo Neira Ayuso | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 198 | * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 199 | */ |
| 200 | enum nft_rule_attributes { |
| 201 | NFTA_RULE_UNSPEC, |
| 202 | NFTA_RULE_TABLE, |
| 203 | NFTA_RULE_CHAIN, |
| 204 | NFTA_RULE_HANDLE, |
| 205 | NFTA_RULE_EXPRESSIONS, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 206 | NFTA_RULE_COMPAT, |
Eric Leblond | 5e94846 | 2013-10-10 13:41:44 +0200 | [diff] [blame] | 207 | NFTA_RULE_POSITION, |
Pablo Neira Ayuso | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 208 | NFTA_RULE_USERDATA, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 209 | __NFTA_RULE_MAX |
| 210 | }; |
| 211 | #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) |
| 212 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 213 | /** |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 214 | * enum nft_rule_compat_flags - nf_tables rule compat flags |
| 215 | * |
| 216 | * @NFT_RULE_COMPAT_F_INV: invert the check result |
| 217 | */ |
| 218 | enum nft_rule_compat_flags { |
| 219 | NFT_RULE_COMPAT_F_INV = (1 << 1), |
| 220 | NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV, |
| 221 | }; |
| 222 | |
| 223 | /** |
| 224 | * enum nft_rule_compat_attributes - nf_tables rule compat attributes |
| 225 | * |
| 226 | * @NFTA_RULE_COMPAT_PROTO: numerice value of handled protocol (NLA_U32) |
| 227 | * @NFTA_RULE_COMPAT_FLAGS: bitmask of enum nft_rule_compat_flags (NLA_U32) |
| 228 | */ |
| 229 | enum nft_rule_compat_attributes { |
| 230 | NFTA_RULE_COMPAT_UNSPEC, |
| 231 | NFTA_RULE_COMPAT_PROTO, |
| 232 | NFTA_RULE_COMPAT_FLAGS, |
| 233 | __NFTA_RULE_COMPAT_MAX |
| 234 | }; |
| 235 | #define NFTA_RULE_COMPAT_MAX (__NFTA_RULE_COMPAT_MAX - 1) |
| 236 | |
| 237 | /** |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 238 | * enum nft_set_flags - nf_tables set flags |
| 239 | * |
| 240 | * @NFT_SET_ANONYMOUS: name allocation, automatic cleanup on unlink |
| 241 | * @NFT_SET_CONSTANT: set contents may not change while bound |
| 242 | * @NFT_SET_INTERVAL: set contains intervals |
| 243 | * @NFT_SET_MAP: set is used as a dictionary |
Patrick McHardy | 761da29 | 2015-03-26 12:39:36 +0000 | [diff] [blame] | 244 | * @NFT_SET_TIMEOUT: set uses timeouts |
Patrick McHardy | 7c6c6e9 | 2015-04-11 10:46:41 +0100 | [diff] [blame] | 245 | * @NFT_SET_EVAL: set contains expressions for evaluation |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 246 | */ |
| 247 | enum nft_set_flags { |
| 248 | NFT_SET_ANONYMOUS = 0x1, |
| 249 | NFT_SET_CONSTANT = 0x2, |
| 250 | NFT_SET_INTERVAL = 0x4, |
| 251 | NFT_SET_MAP = 0x8, |
Patrick McHardy | 761da29 | 2015-03-26 12:39:36 +0000 | [diff] [blame] | 252 | NFT_SET_TIMEOUT = 0x10, |
Patrick McHardy | 7c6c6e9 | 2015-04-11 10:46:41 +0100 | [diff] [blame] | 253 | NFT_SET_EVAL = 0x20, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 254 | }; |
| 255 | |
| 256 | /** |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 257 | * enum nft_set_policies - set selection policy |
| 258 | * |
| 259 | * @NFT_SET_POL_PERFORMANCE: prefer high performance over low memory use |
| 260 | * @NFT_SET_POL_MEMORY: prefer low memory use over high performance |
| 261 | */ |
| 262 | enum nft_set_policies { |
| 263 | NFT_SET_POL_PERFORMANCE, |
| 264 | NFT_SET_POL_MEMORY, |
| 265 | }; |
| 266 | |
| 267 | /** |
| 268 | * enum nft_set_desc_attributes - set element description |
| 269 | * |
| 270 | * @NFTA_SET_DESC_SIZE: number of elements in set (NLA_U32) |
| 271 | */ |
| 272 | enum nft_set_desc_attributes { |
| 273 | NFTA_SET_DESC_UNSPEC, |
| 274 | NFTA_SET_DESC_SIZE, |
| 275 | __NFTA_SET_DESC_MAX |
| 276 | }; |
| 277 | #define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1) |
| 278 | |
| 279 | /** |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 280 | * enum nft_set_attributes - nf_tables set netlink attributes |
| 281 | * |
| 282 | * @NFTA_SET_TABLE: table name (NLA_STRING) |
| 283 | * @NFTA_SET_NAME: set name (NLA_STRING) |
| 284 | * @NFTA_SET_FLAGS: bitmask of enum nft_set_flags (NLA_U32) |
| 285 | * @NFTA_SET_KEY_TYPE: key data type, informational purpose only (NLA_U32) |
| 286 | * @NFTA_SET_KEY_LEN: key data length (NLA_U32) |
| 287 | * @NFTA_SET_DATA_TYPE: mapping data type (NLA_U32) |
| 288 | * @NFTA_SET_DATA_LEN: mapping data length (NLA_U32) |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 289 | * @NFTA_SET_POLICY: selection policy (NLA_U32) |
| 290 | * @NFTA_SET_DESC: set description (NLA_NESTED) |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 291 | * @NFTA_SET_ID: uniquely identifies a set in a transaction (NLA_U32) |
Patrick McHardy | 761da29 | 2015-03-26 12:39:36 +0000 | [diff] [blame] | 292 | * @NFTA_SET_TIMEOUT: default timeout value (NLA_U64) |
| 293 | * @NFTA_SET_GC_INTERVAL: garbage collection interval (NLA_U32) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 294 | */ |
| 295 | enum nft_set_attributes { |
| 296 | NFTA_SET_UNSPEC, |
| 297 | NFTA_SET_TABLE, |
| 298 | NFTA_SET_NAME, |
| 299 | NFTA_SET_FLAGS, |
| 300 | NFTA_SET_KEY_TYPE, |
| 301 | NFTA_SET_KEY_LEN, |
| 302 | NFTA_SET_DATA_TYPE, |
| 303 | NFTA_SET_DATA_LEN, |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 304 | NFTA_SET_POLICY, |
| 305 | NFTA_SET_DESC, |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 306 | NFTA_SET_ID, |
Patrick McHardy | 761da29 | 2015-03-26 12:39:36 +0000 | [diff] [blame] | 307 | NFTA_SET_TIMEOUT, |
| 308 | NFTA_SET_GC_INTERVAL, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 309 | __NFTA_SET_MAX |
| 310 | }; |
| 311 | #define NFTA_SET_MAX (__NFTA_SET_MAX - 1) |
| 312 | |
| 313 | /** |
| 314 | * enum nft_set_elem_flags - nf_tables set element flags |
| 315 | * |
| 316 | * @NFT_SET_ELEM_INTERVAL_END: element ends the previous interval |
| 317 | */ |
| 318 | enum nft_set_elem_flags { |
| 319 | NFT_SET_ELEM_INTERVAL_END = 0x1, |
| 320 | }; |
| 321 | |
| 322 | /** |
| 323 | * enum nft_set_elem_attributes - nf_tables set element netlink attributes |
| 324 | * |
| 325 | * @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data) |
| 326 | * @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes) |
| 327 | * @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32) |
Patrick McHardy | c3e1b00 | 2015-03-26 12:39:37 +0000 | [diff] [blame] | 328 | * @NFTA_SET_ELEM_TIMEOUT: timeout value (NLA_U64) |
| 329 | * @NFTA_SET_ELEM_EXPIRATION: expiration time (NLA_U64) |
Patrick McHardy | 68e942e | 2015-04-05 14:43:38 +0200 | [diff] [blame] | 330 | * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY) |
Patrick McHardy | f25ad2e | 2015-04-11 10:46:39 +0100 | [diff] [blame] | 331 | * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 332 | */ |
| 333 | enum nft_set_elem_attributes { |
| 334 | NFTA_SET_ELEM_UNSPEC, |
| 335 | NFTA_SET_ELEM_KEY, |
| 336 | NFTA_SET_ELEM_DATA, |
| 337 | NFTA_SET_ELEM_FLAGS, |
Patrick McHardy | c3e1b00 | 2015-03-26 12:39:37 +0000 | [diff] [blame] | 338 | NFTA_SET_ELEM_TIMEOUT, |
| 339 | NFTA_SET_ELEM_EXPIRATION, |
Patrick McHardy | 68e942e | 2015-04-05 14:43:38 +0200 | [diff] [blame] | 340 | NFTA_SET_ELEM_USERDATA, |
Patrick McHardy | f25ad2e | 2015-04-11 10:46:39 +0100 | [diff] [blame] | 341 | NFTA_SET_ELEM_EXPR, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 342 | __NFTA_SET_ELEM_MAX |
| 343 | }; |
| 344 | #define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1) |
| 345 | |
| 346 | /** |
| 347 | * enum nft_set_elem_list_attributes - nf_tables set element list netlink attributes |
| 348 | * |
| 349 | * @NFTA_SET_ELEM_LIST_TABLE: table of the set to be changed (NLA_STRING) |
| 350 | * @NFTA_SET_ELEM_LIST_SET: name of the set to be changed (NLA_STRING) |
| 351 | * @NFTA_SET_ELEM_LIST_ELEMENTS: list of set elements (NLA_NESTED: nft_set_elem_attributes) |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 352 | * @NFTA_SET_ELEM_LIST_SET_ID: uniquely identifies a set in a transaction (NLA_U32) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 353 | */ |
| 354 | enum nft_set_elem_list_attributes { |
| 355 | NFTA_SET_ELEM_LIST_UNSPEC, |
| 356 | NFTA_SET_ELEM_LIST_TABLE, |
| 357 | NFTA_SET_ELEM_LIST_SET, |
| 358 | NFTA_SET_ELEM_LIST_ELEMENTS, |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 359 | NFTA_SET_ELEM_LIST_SET_ID, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 360 | __NFTA_SET_ELEM_LIST_MAX |
| 361 | }; |
| 362 | #define NFTA_SET_ELEM_LIST_MAX (__NFTA_SET_ELEM_LIST_MAX - 1) |
| 363 | |
| 364 | /** |
| 365 | * enum nft_data_types - nf_tables data types |
| 366 | * |
| 367 | * @NFT_DATA_VALUE: generic data |
| 368 | * @NFT_DATA_VERDICT: netfilter verdict |
| 369 | * |
| 370 | * The type of data is usually determined by the kernel directly and is not |
| 371 | * explicitly specified by userspace. The only difference are sets, where |
| 372 | * userspace specifies the key and mapping data types. |
| 373 | * |
| 374 | * The values 0xffffff00-0xffffffff are reserved for internally used types. |
| 375 | * The remaining range can be freely used by userspace to encode types, all |
| 376 | * values are equivalent to NFT_DATA_VALUE. |
| 377 | */ |
| 378 | enum nft_data_types { |
| 379 | NFT_DATA_VALUE, |
| 380 | NFT_DATA_VERDICT = 0xffffff00U, |
| 381 | }; |
| 382 | |
| 383 | #define NFT_DATA_RESERVED_MASK 0xffffff00U |
| 384 | |
| 385 | /** |
| 386 | * enum nft_data_attributes - nf_tables data netlink attributes |
| 387 | * |
| 388 | * @NFTA_DATA_VALUE: generic data (NLA_BINARY) |
| 389 | * @NFTA_DATA_VERDICT: nf_tables verdict (NLA_NESTED: nft_verdict_attributes) |
| 390 | */ |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 391 | enum nft_data_attributes { |
| 392 | NFTA_DATA_UNSPEC, |
| 393 | NFTA_DATA_VALUE, |
| 394 | NFTA_DATA_VERDICT, |
| 395 | __NFTA_DATA_MAX |
| 396 | }; |
| 397 | #define NFTA_DATA_MAX (__NFTA_DATA_MAX - 1) |
| 398 | |
Patrick McHardy | 7d74026 | 2015-04-11 02:27:39 +0100 | [diff] [blame] | 399 | /* Maximum length of a value */ |
| 400 | #define NFT_DATA_VALUE_MAXLEN 64 |
| 401 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 402 | /** |
| 403 | * enum nft_verdict_attributes - nf_tables verdict netlink attributes |
| 404 | * |
| 405 | * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts) |
| 406 | * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING) |
| 407 | */ |
| 408 | enum nft_verdict_attributes { |
| 409 | NFTA_VERDICT_UNSPEC, |
| 410 | NFTA_VERDICT_CODE, |
| 411 | NFTA_VERDICT_CHAIN, |
| 412 | __NFTA_VERDICT_MAX |
| 413 | }; |
| 414 | #define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1) |
| 415 | |
| 416 | /** |
| 417 | * enum nft_expr_attributes - nf_tables expression netlink attributes |
| 418 | * |
| 419 | * @NFTA_EXPR_NAME: name of the expression type (NLA_STRING) |
| 420 | * @NFTA_EXPR_DATA: type specific data (NLA_NESTED) |
| 421 | */ |
| 422 | enum nft_expr_attributes { |
| 423 | NFTA_EXPR_UNSPEC, |
| 424 | NFTA_EXPR_NAME, |
| 425 | NFTA_EXPR_DATA, |
| 426 | __NFTA_EXPR_MAX |
| 427 | }; |
| 428 | #define NFTA_EXPR_MAX (__NFTA_EXPR_MAX - 1) |
| 429 | |
| 430 | /** |
| 431 | * enum nft_immediate_attributes - nf_tables immediate expression netlink attributes |
| 432 | * |
| 433 | * @NFTA_IMMEDIATE_DREG: destination register to load data into (NLA_U32) |
| 434 | * @NFTA_IMMEDIATE_DATA: data to load (NLA_NESTED: nft_data_attributes) |
| 435 | */ |
| 436 | enum nft_immediate_attributes { |
| 437 | NFTA_IMMEDIATE_UNSPEC, |
| 438 | NFTA_IMMEDIATE_DREG, |
| 439 | NFTA_IMMEDIATE_DATA, |
| 440 | __NFTA_IMMEDIATE_MAX |
| 441 | }; |
| 442 | #define NFTA_IMMEDIATE_MAX (__NFTA_IMMEDIATE_MAX - 1) |
| 443 | |
| 444 | /** |
| 445 | * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes |
| 446 | * |
| 447 | * @NFTA_BITWISE_SREG: source register (NLA_U32: nft_registers) |
| 448 | * @NFTA_BITWISE_DREG: destination register (NLA_U32: nft_registers) |
| 449 | * @NFTA_BITWISE_LEN: length of operands (NLA_U32) |
| 450 | * @NFTA_BITWISE_MASK: mask value (NLA_NESTED: nft_data_attributes) |
| 451 | * @NFTA_BITWISE_XOR: xor value (NLA_NESTED: nft_data_attributes) |
| 452 | * |
| 453 | * The bitwise expression performs the following operation: |
| 454 | * |
| 455 | * dreg = (sreg & mask) ^ xor |
| 456 | * |
| 457 | * which allow to express all bitwise operations: |
| 458 | * |
| 459 | * mask xor |
| 460 | * NOT: 1 1 |
| 461 | * OR: 0 x |
| 462 | * XOR: 1 x |
| 463 | * AND: x 0 |
| 464 | */ |
| 465 | enum nft_bitwise_attributes { |
| 466 | NFTA_BITWISE_UNSPEC, |
| 467 | NFTA_BITWISE_SREG, |
| 468 | NFTA_BITWISE_DREG, |
| 469 | NFTA_BITWISE_LEN, |
| 470 | NFTA_BITWISE_MASK, |
| 471 | NFTA_BITWISE_XOR, |
| 472 | __NFTA_BITWISE_MAX |
| 473 | }; |
| 474 | #define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1) |
| 475 | |
| 476 | /** |
| 477 | * enum nft_byteorder_ops - nf_tables byteorder operators |
| 478 | * |
| 479 | * @NFT_BYTEORDER_NTOH: network to host operator |
| 480 | * @NFT_BYTEORDER_HTON: host to network opertaor |
| 481 | */ |
| 482 | enum nft_byteorder_ops { |
| 483 | NFT_BYTEORDER_NTOH, |
| 484 | NFT_BYTEORDER_HTON, |
| 485 | }; |
| 486 | |
| 487 | /** |
| 488 | * enum nft_byteorder_attributes - nf_tables byteorder expression netlink attributes |
| 489 | * |
| 490 | * @NFTA_BYTEORDER_SREG: source register (NLA_U32: nft_registers) |
| 491 | * @NFTA_BYTEORDER_DREG: destination register (NLA_U32: nft_registers) |
| 492 | * @NFTA_BYTEORDER_OP: operator (NLA_U32: enum nft_byteorder_ops) |
| 493 | * @NFTA_BYTEORDER_LEN: length of the data (NLA_U32) |
| 494 | * @NFTA_BYTEORDER_SIZE: data size in bytes (NLA_U32: 2 or 4) |
| 495 | */ |
| 496 | enum nft_byteorder_attributes { |
| 497 | NFTA_BYTEORDER_UNSPEC, |
| 498 | NFTA_BYTEORDER_SREG, |
| 499 | NFTA_BYTEORDER_DREG, |
| 500 | NFTA_BYTEORDER_OP, |
| 501 | NFTA_BYTEORDER_LEN, |
| 502 | NFTA_BYTEORDER_SIZE, |
| 503 | __NFTA_BYTEORDER_MAX |
| 504 | }; |
| 505 | #define NFTA_BYTEORDER_MAX (__NFTA_BYTEORDER_MAX - 1) |
| 506 | |
| 507 | /** |
| 508 | * enum nft_cmp_ops - nf_tables relational operator |
| 509 | * |
| 510 | * @NFT_CMP_EQ: equal |
| 511 | * @NFT_CMP_NEQ: not equal |
| 512 | * @NFT_CMP_LT: less than |
| 513 | * @NFT_CMP_LTE: less than or equal to |
| 514 | * @NFT_CMP_GT: greater than |
| 515 | * @NFT_CMP_GTE: greater than or equal to |
| 516 | */ |
| 517 | enum nft_cmp_ops { |
| 518 | NFT_CMP_EQ, |
| 519 | NFT_CMP_NEQ, |
| 520 | NFT_CMP_LT, |
| 521 | NFT_CMP_LTE, |
| 522 | NFT_CMP_GT, |
| 523 | NFT_CMP_GTE, |
| 524 | }; |
| 525 | |
| 526 | /** |
| 527 | * enum nft_cmp_attributes - nf_tables cmp expression netlink attributes |
| 528 | * |
| 529 | * @NFTA_CMP_SREG: source register of data to compare (NLA_U32: nft_registers) |
| 530 | * @NFTA_CMP_OP: cmp operation (NLA_U32: nft_cmp_ops) |
| 531 | * @NFTA_CMP_DATA: data to compare against (NLA_NESTED: nft_data_attributes) |
| 532 | */ |
| 533 | enum nft_cmp_attributes { |
| 534 | NFTA_CMP_UNSPEC, |
| 535 | NFTA_CMP_SREG, |
| 536 | NFTA_CMP_OP, |
| 537 | NFTA_CMP_DATA, |
| 538 | __NFTA_CMP_MAX |
| 539 | }; |
| 540 | #define NFTA_CMP_MAX (__NFTA_CMP_MAX - 1) |
| 541 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 542 | /** |
| 543 | * enum nft_lookup_attributes - nf_tables set lookup expression netlink attributes |
| 544 | * |
| 545 | * @NFTA_LOOKUP_SET: name of the set where to look for (NLA_STRING) |
| 546 | * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers) |
| 547 | * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers) |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 548 | * @NFTA_LOOKUP_SET_ID: uniquely identifies a set in a transaction (NLA_U32) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 549 | */ |
| 550 | enum nft_lookup_attributes { |
| 551 | NFTA_LOOKUP_UNSPEC, |
| 552 | NFTA_LOOKUP_SET, |
| 553 | NFTA_LOOKUP_SREG, |
| 554 | NFTA_LOOKUP_DREG, |
Pablo Neira Ayuso | 958bee1 | 2014-04-03 11:48:44 +0200 | [diff] [blame] | 555 | NFTA_LOOKUP_SET_ID, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 556 | __NFTA_LOOKUP_MAX |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 557 | }; |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 558 | #define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 559 | |
Patrick McHardy | 22fe54d | 2015-04-05 14:41:08 +0200 | [diff] [blame] | 560 | enum nft_dynset_ops { |
| 561 | NFT_DYNSET_OP_ADD, |
| 562 | NFT_DYNSET_OP_UPDATE, |
| 563 | }; |
| 564 | |
| 565 | /** |
| 566 | * enum nft_dynset_attributes - dynset expression attributes |
| 567 | * |
| 568 | * @NFTA_DYNSET_SET_NAME: name of set the to add data to (NLA_STRING) |
| 569 | * @NFTA_DYNSET_SET_ID: uniquely identifier of the set in the transaction (NLA_U32) |
| 570 | * @NFTA_DYNSET_OP: operation (NLA_U32) |
| 571 | * @NFTA_DYNSET_SREG_KEY: source register of the key (NLA_U32) |
| 572 | * @NFTA_DYNSET_SREG_DATA: source register of the data (NLA_U32) |
| 573 | * @NFTA_DYNSET_TIMEOUT: timeout value for the new element (NLA_U64) |
Patrick McHardy | 3e135cd | 2015-04-11 10:46:42 +0100 | [diff] [blame] | 574 | * @NFTA_DYNSET_EXPR: expression (NLA_NESTED: nft_expr_attributes) |
Patrick McHardy | 22fe54d | 2015-04-05 14:41:08 +0200 | [diff] [blame] | 575 | */ |
| 576 | enum nft_dynset_attributes { |
| 577 | NFTA_DYNSET_UNSPEC, |
| 578 | NFTA_DYNSET_SET_NAME, |
| 579 | NFTA_DYNSET_SET_ID, |
| 580 | NFTA_DYNSET_OP, |
| 581 | NFTA_DYNSET_SREG_KEY, |
| 582 | NFTA_DYNSET_SREG_DATA, |
| 583 | NFTA_DYNSET_TIMEOUT, |
Patrick McHardy | 3e135cd | 2015-04-11 10:46:42 +0100 | [diff] [blame] | 584 | NFTA_DYNSET_EXPR, |
Patrick McHardy | 22fe54d | 2015-04-05 14:41:08 +0200 | [diff] [blame] | 585 | __NFTA_DYNSET_MAX, |
| 586 | }; |
| 587 | #define NFTA_DYNSET_MAX (__NFTA_DYNSET_MAX - 1) |
| 588 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 589 | /** |
| 590 | * enum nft_payload_bases - nf_tables payload expression offset bases |
| 591 | * |
| 592 | * @NFT_PAYLOAD_LL_HEADER: link layer header |
| 593 | * @NFT_PAYLOAD_NETWORK_HEADER: network header |
| 594 | * @NFT_PAYLOAD_TRANSPORT_HEADER: transport header |
| 595 | */ |
| 596 | enum nft_payload_bases { |
| 597 | NFT_PAYLOAD_LL_HEADER, |
| 598 | NFT_PAYLOAD_NETWORK_HEADER, |
| 599 | NFT_PAYLOAD_TRANSPORT_HEADER, |
| 600 | }; |
| 601 | |
| 602 | /** |
Patrick McHardy | 7ec3f7b | 2015-11-24 10:00:22 +0000 | [diff] [blame] | 603 | * enum nft_payload_csum_types - nf_tables payload expression checksum types |
| 604 | * |
| 605 | * @NFT_PAYLOAD_CSUM_NONE: no checksumming |
| 606 | * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791) |
| 607 | */ |
| 608 | enum nft_payload_csum_types { |
| 609 | NFT_PAYLOAD_CSUM_NONE, |
| 610 | NFT_PAYLOAD_CSUM_INET, |
| 611 | }; |
| 612 | |
| 613 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 614 | * enum nft_payload_attributes - nf_tables payload expression netlink attributes |
| 615 | * |
| 616 | * @NFTA_PAYLOAD_DREG: destination register to load data into (NLA_U32: nft_registers) |
| 617 | * @NFTA_PAYLOAD_BASE: payload base (NLA_U32: nft_payload_bases) |
| 618 | * @NFTA_PAYLOAD_OFFSET: payload offset relative to base (NLA_U32) |
| 619 | * @NFTA_PAYLOAD_LEN: payload length (NLA_U32) |
Patrick McHardy | 7ec3f7b | 2015-11-24 10:00:22 +0000 | [diff] [blame] | 620 | * @NFTA_PAYLOAD_SREG: source register to load data from (NLA_U32: nft_registers) |
| 621 | * @NFTA_PAYLOAD_CSUM_TYPE: checksum type (NLA_U32) |
| 622 | * @NFTA_PAYLOAD_CSUM_OFFSET: checksum offset relative to base (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 623 | */ |
| 624 | enum nft_payload_attributes { |
| 625 | NFTA_PAYLOAD_UNSPEC, |
| 626 | NFTA_PAYLOAD_DREG, |
| 627 | NFTA_PAYLOAD_BASE, |
| 628 | NFTA_PAYLOAD_OFFSET, |
| 629 | NFTA_PAYLOAD_LEN, |
Patrick McHardy | 7ec3f7b | 2015-11-24 10:00:22 +0000 | [diff] [blame] | 630 | NFTA_PAYLOAD_SREG, |
| 631 | NFTA_PAYLOAD_CSUM_TYPE, |
| 632 | NFTA_PAYLOAD_CSUM_OFFSET, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 633 | __NFTA_PAYLOAD_MAX |
| 634 | }; |
| 635 | #define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1) |
| 636 | |
| 637 | /** |
| 638 | * enum nft_exthdr_attributes - nf_tables IPv6 extension header expression netlink attributes |
| 639 | * |
| 640 | * @NFTA_EXTHDR_DREG: destination register (NLA_U32: nft_registers) |
| 641 | * @NFTA_EXTHDR_TYPE: extension header type (NLA_U8) |
| 642 | * @NFTA_EXTHDR_OFFSET: extension header offset (NLA_U32) |
| 643 | * @NFTA_EXTHDR_LEN: extension header length (NLA_U32) |
| 644 | */ |
| 645 | enum nft_exthdr_attributes { |
| 646 | NFTA_EXTHDR_UNSPEC, |
| 647 | NFTA_EXTHDR_DREG, |
| 648 | NFTA_EXTHDR_TYPE, |
| 649 | NFTA_EXTHDR_OFFSET, |
| 650 | NFTA_EXTHDR_LEN, |
| 651 | __NFTA_EXTHDR_MAX |
| 652 | }; |
| 653 | #define NFTA_EXTHDR_MAX (__NFTA_EXTHDR_MAX - 1) |
| 654 | |
| 655 | /** |
| 656 | * enum nft_meta_keys - nf_tables meta expression keys |
| 657 | * |
| 658 | * @NFT_META_LEN: packet length (skb->len) |
| 659 | * @NFT_META_PROTOCOL: packet ethertype protocol (skb->protocol), invalid in OUTPUT |
| 660 | * @NFT_META_PRIORITY: packet priority (skb->priority) |
| 661 | * @NFT_META_MARK: packet mark (skb->mark) |
| 662 | * @NFT_META_IIF: packet input interface index (dev->ifindex) |
| 663 | * @NFT_META_OIF: packet output interface index (dev->ifindex) |
| 664 | * @NFT_META_IIFNAME: packet input interface name (dev->name) |
| 665 | * @NFT_META_OIFNAME: packet output interface name (dev->name) |
| 666 | * @NFT_META_IIFTYPE: packet input interface type (dev->type) |
| 667 | * @NFT_META_OIFTYPE: packet output interface type (dev->type) |
| 668 | * @NFT_META_SKUID: originating socket UID (fsuid) |
| 669 | * @NFT_META_SKGID: originating socket GID (fsgid) |
| 670 | * @NFT_META_NFTRACE: packet nftrace bit |
| 671 | * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) |
| 672 | * @NFT_META_SECMARK: packet secmark (skb->secmark) |
Patrick McHardy | 124edfa | 2014-01-03 12:16:17 +0000 | [diff] [blame] | 673 | * @NFT_META_NFPROTO: netfilter protocol |
Patrick McHardy | 4566bf2 | 2014-01-03 12:16:18 +0000 | [diff] [blame] | 674 | * @NFT_META_L4PROTO: layer 4 protocol number |
Tomasz Bursztyka | f5efc69 | 2014-04-14 15:41:28 +0300 | [diff] [blame] | 675 | * @NFT_META_BRI_IIFNAME: packet input bridge interface name |
| 676 | * @NFT_META_BRI_OIFNAME: packet output bridge interface name |
Ana Rey | e2a093f | 2014-08-06 13:52:49 +0200 | [diff] [blame] | 677 | * @NFT_META_PKTTYPE: packet type (skb->pkt_type), special handling for loopback |
Ana Rey | afc5be30 | 2014-08-24 14:08:36 +0200 | [diff] [blame] | 678 | * @NFT_META_CPU: cpu id through smp_processor_id() |
Ana Rey | 3045d76 | 2014-09-02 20:36:14 +0200 | [diff] [blame] | 679 | * @NFT_META_IIFGROUP: packet input interface group |
| 680 | * @NFT_META_OIFGROUP: packet output interface group |
Ana Rey | ce67417 | 2014-11-03 18:10:50 +0100 | [diff] [blame] | 681 | * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 682 | */ |
| 683 | enum nft_meta_keys { |
| 684 | NFT_META_LEN, |
| 685 | NFT_META_PROTOCOL, |
| 686 | NFT_META_PRIORITY, |
| 687 | NFT_META_MARK, |
| 688 | NFT_META_IIF, |
| 689 | NFT_META_OIF, |
| 690 | NFT_META_IIFNAME, |
| 691 | NFT_META_OIFNAME, |
| 692 | NFT_META_IIFTYPE, |
| 693 | NFT_META_OIFTYPE, |
| 694 | NFT_META_SKUID, |
| 695 | NFT_META_SKGID, |
| 696 | NFT_META_NFTRACE, |
| 697 | NFT_META_RTCLASSID, |
| 698 | NFT_META_SECMARK, |
Patrick McHardy | 124edfa | 2014-01-03 12:16:17 +0000 | [diff] [blame] | 699 | NFT_META_NFPROTO, |
Patrick McHardy | 4566bf2 | 2014-01-03 12:16:18 +0000 | [diff] [blame] | 700 | NFT_META_L4PROTO, |
Tomasz Bursztyka | f5efc69 | 2014-04-14 15:41:28 +0300 | [diff] [blame] | 701 | NFT_META_BRI_IIFNAME, |
| 702 | NFT_META_BRI_OIFNAME, |
Ana Rey | e2a093f | 2014-08-06 13:52:49 +0200 | [diff] [blame] | 703 | NFT_META_PKTTYPE, |
Ana Rey | afc5be30 | 2014-08-24 14:08:36 +0200 | [diff] [blame] | 704 | NFT_META_CPU, |
Ana Rey | 3045d76 | 2014-09-02 20:36:14 +0200 | [diff] [blame] | 705 | NFT_META_IIFGROUP, |
| 706 | NFT_META_OIFGROUP, |
Ana Rey | ce67417 | 2014-11-03 18:10:50 +0100 | [diff] [blame] | 707 | NFT_META_CGROUP, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 708 | }; |
| 709 | |
| 710 | /** |
| 711 | * enum nft_meta_attributes - nf_tables meta expression netlink attributes |
| 712 | * |
| 713 | * @NFTA_META_DREG: destination register (NLA_U32) |
| 714 | * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys) |
Arturo Borrero Gonzalez | e035b77 | 2013-12-26 16:38:01 +0100 | [diff] [blame] | 715 | * @NFTA_META_SREG: source register (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 716 | */ |
| 717 | enum nft_meta_attributes { |
| 718 | NFTA_META_UNSPEC, |
| 719 | NFTA_META_DREG, |
| 720 | NFTA_META_KEY, |
Arturo Borrero Gonzalez | e035b77 | 2013-12-26 16:38:01 +0100 | [diff] [blame] | 721 | NFTA_META_SREG, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 722 | __NFTA_META_MAX |
| 723 | }; |
| 724 | #define NFTA_META_MAX (__NFTA_META_MAX - 1) |
| 725 | |
| 726 | /** |
| 727 | * enum nft_ct_keys - nf_tables ct expression keys |
| 728 | * |
| 729 | * @NFT_CT_STATE: conntrack state (bitmask of enum ip_conntrack_info) |
| 730 | * @NFT_CT_DIRECTION: conntrack direction (enum ip_conntrack_dir) |
| 731 | * @NFT_CT_STATUS: conntrack status (bitmask of enum ip_conntrack_status) |
| 732 | * @NFT_CT_MARK: conntrack mark value |
| 733 | * @NFT_CT_SECMARK: conntrack secmark value |
| 734 | * @NFT_CT_EXPIRATION: relative conntrack expiration time in ms |
| 735 | * @NFT_CT_HELPER: connection tracking helper assigned to conntrack |
| 736 | * @NFT_CT_L3PROTOCOL: conntrack layer 3 protocol |
| 737 | * @NFT_CT_SRC: conntrack layer 3 protocol source (IPv4/IPv6 address) |
| 738 | * @NFT_CT_DST: conntrack layer 3 protocol destination (IPv4/IPv6 address) |
| 739 | * @NFT_CT_PROTOCOL: conntrack layer 4 protocol |
| 740 | * @NFT_CT_PROTO_SRC: conntrack layer 4 protocol source |
| 741 | * @NFT_CT_PROTO_DST: conntrack layer 4 protocol destination |
| 742 | */ |
| 743 | enum nft_ct_keys { |
| 744 | NFT_CT_STATE, |
| 745 | NFT_CT_DIRECTION, |
| 746 | NFT_CT_STATUS, |
| 747 | NFT_CT_MARK, |
| 748 | NFT_CT_SECMARK, |
| 749 | NFT_CT_EXPIRATION, |
| 750 | NFT_CT_HELPER, |
| 751 | NFT_CT_L3PROTOCOL, |
| 752 | NFT_CT_SRC, |
| 753 | NFT_CT_DST, |
| 754 | NFT_CT_PROTOCOL, |
| 755 | NFT_CT_PROTO_SRC, |
| 756 | NFT_CT_PROTO_DST, |
Florian Westphal | d2bf2f3 | 2014-02-18 15:25:32 +0100 | [diff] [blame] | 757 | NFT_CT_LABELS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 758 | }; |
| 759 | |
| 760 | /** |
| 761 | * enum nft_ct_attributes - nf_tables ct expression netlink attributes |
| 762 | * |
| 763 | * @NFTA_CT_DREG: destination register (NLA_U32) |
| 764 | * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) |
| 765 | * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 766 | * @NFTA_CT_SREG: source register (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 767 | */ |
| 768 | enum nft_ct_attributes { |
| 769 | NFTA_CT_UNSPEC, |
| 770 | NFTA_CT_DREG, |
| 771 | NFTA_CT_KEY, |
| 772 | NFTA_CT_DIRECTION, |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 773 | NFTA_CT_SREG, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 774 | __NFTA_CT_MAX |
| 775 | }; |
| 776 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) |
| 777 | |
Pablo Neira Ayuso | d2168e8 | 2015-08-05 12:38:44 +0200 | [diff] [blame] | 778 | enum nft_limit_type { |
| 779 | NFT_LIMIT_PKTS, |
| 780 | NFT_LIMIT_PKT_BYTES |
| 781 | }; |
| 782 | |
Pablo Neira Ayuso | c7862a5 | 2015-12-28 18:21:44 +0100 | [diff] [blame^] | 783 | enum nft_limit_flags { |
| 784 | NFT_LIMIT_F_INV = (1 << 0), |
| 785 | }; |
| 786 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 787 | /** |
| 788 | * enum nft_limit_attributes - nf_tables limit expression netlink attributes |
| 789 | * |
| 790 | * @NFTA_LIMIT_RATE: refill rate (NLA_U64) |
| 791 | * @NFTA_LIMIT_UNIT: refill unit (NLA_U64) |
Pablo Neira Ayuso | 3e87baa | 2015-08-02 18:02:14 +0200 | [diff] [blame] | 792 | * @NFTA_LIMIT_BURST: burst (NLA_U32) |
Pablo Neira Ayuso | d2168e8 | 2015-08-05 12:38:44 +0200 | [diff] [blame] | 793 | * @NFTA_LIMIT_TYPE: type of limit (NLA_U32: enum nft_limit_type) |
Pablo Neira Ayuso | c7862a5 | 2015-12-28 18:21:44 +0100 | [diff] [blame^] | 794 | * @NFTA_LIMIT_FLAGS: flags (NLA_U32: enum nft_limit_flags) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 795 | */ |
| 796 | enum nft_limit_attributes { |
| 797 | NFTA_LIMIT_UNSPEC, |
| 798 | NFTA_LIMIT_RATE, |
| 799 | NFTA_LIMIT_UNIT, |
Pablo Neira Ayuso | 3e87baa | 2015-08-02 18:02:14 +0200 | [diff] [blame] | 800 | NFTA_LIMIT_BURST, |
Pablo Neira Ayuso | d2168e8 | 2015-08-05 12:38:44 +0200 | [diff] [blame] | 801 | NFTA_LIMIT_TYPE, |
Pablo Neira Ayuso | c7862a5 | 2015-12-28 18:21:44 +0100 | [diff] [blame^] | 802 | NFTA_LIMIT_FLAGS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 803 | __NFTA_LIMIT_MAX |
| 804 | }; |
| 805 | #define NFTA_LIMIT_MAX (__NFTA_LIMIT_MAX - 1) |
| 806 | |
| 807 | /** |
| 808 | * enum nft_counter_attributes - nf_tables counter expression netlink attributes |
| 809 | * |
| 810 | * @NFTA_COUNTER_BYTES: number of bytes (NLA_U64) |
| 811 | * @NFTA_COUNTER_PACKETS: number of packets (NLA_U64) |
| 812 | */ |
| 813 | enum nft_counter_attributes { |
| 814 | NFTA_COUNTER_UNSPEC, |
| 815 | NFTA_COUNTER_BYTES, |
| 816 | NFTA_COUNTER_PACKETS, |
| 817 | __NFTA_COUNTER_MAX |
| 818 | }; |
| 819 | #define NFTA_COUNTER_MAX (__NFTA_COUNTER_MAX - 1) |
| 820 | |
| 821 | /** |
| 822 | * enum nft_log_attributes - nf_tables log expression netlink attributes |
| 823 | * |
| 824 | * @NFTA_LOG_GROUP: netlink group to send messages to (NLA_U32) |
| 825 | * @NFTA_LOG_PREFIX: prefix to prepend to log messages (NLA_STRING) |
| 826 | * @NFTA_LOG_SNAPLEN: length of payload to include in netlink message (NLA_U32) |
| 827 | * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U32) |
Pablo Neira Ayuso | 09d27b8 | 2014-06-25 13:37:13 +0200 | [diff] [blame] | 828 | * @NFTA_LOG_LEVEL: log level (NLA_U32) |
| 829 | * @NFTA_LOG_FLAGS: logging flags (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 830 | */ |
| 831 | enum nft_log_attributes { |
| 832 | NFTA_LOG_UNSPEC, |
| 833 | NFTA_LOG_GROUP, |
| 834 | NFTA_LOG_PREFIX, |
| 835 | NFTA_LOG_SNAPLEN, |
| 836 | NFTA_LOG_QTHRESHOLD, |
Pablo Neira Ayuso | 09d27b8 | 2014-06-25 13:37:13 +0200 | [diff] [blame] | 837 | NFTA_LOG_LEVEL, |
| 838 | NFTA_LOG_FLAGS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 839 | __NFTA_LOG_MAX |
| 840 | }; |
| 841 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) |
| 842 | |
| 843 | /** |
Eric Leblond | 0aff078 | 2013-12-06 00:24:13 +0100 | [diff] [blame] | 844 | * enum nft_queue_attributes - nf_tables queue expression netlink attributes |
| 845 | * |
| 846 | * @NFTA_QUEUE_NUM: netlink queue to send messages to (NLA_U16) |
| 847 | * @NFTA_QUEUE_TOTAL: number of queues to load balance packets on (NLA_U16) |
| 848 | * @NFTA_QUEUE_FLAGS: various flags (NLA_U16) |
| 849 | */ |
| 850 | enum nft_queue_attributes { |
| 851 | NFTA_QUEUE_UNSPEC, |
| 852 | NFTA_QUEUE_NUM, |
| 853 | NFTA_QUEUE_TOTAL, |
| 854 | NFTA_QUEUE_FLAGS, |
| 855 | __NFTA_QUEUE_MAX |
| 856 | }; |
| 857 | #define NFTA_QUEUE_MAX (__NFTA_QUEUE_MAX - 1) |
| 858 | |
| 859 | #define NFT_QUEUE_FLAG_BYPASS 0x01 /* for compatibility with v2 */ |
| 860 | #define NFT_QUEUE_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */ |
| 861 | #define NFT_QUEUE_FLAG_MASK 0x03 |
| 862 | |
| 863 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 864 | * enum nft_reject_types - nf_tables reject expression reject types |
| 865 | * |
| 866 | * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable |
| 867 | * @NFT_REJECT_TCP_RST: reject using TCP RST |
Pablo Neira Ayuso | 51b0a5d | 2014-09-26 14:35:14 +0200 | [diff] [blame] | 868 | * @NFT_REJECT_ICMPX_UNREACH: abstracted ICMP unreachable for bridge and inet |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 869 | */ |
| 870 | enum nft_reject_types { |
| 871 | NFT_REJECT_ICMP_UNREACH, |
| 872 | NFT_REJECT_TCP_RST, |
Pablo Neira Ayuso | 51b0a5d | 2014-09-26 14:35:14 +0200 | [diff] [blame] | 873 | NFT_REJECT_ICMPX_UNREACH, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 874 | }; |
| 875 | |
| 876 | /** |
Pablo Neira Ayuso | 51b0a5d | 2014-09-26 14:35:14 +0200 | [diff] [blame] | 877 | * enum nft_reject_code - Generic reject codes for IPv4/IPv6 |
| 878 | * |
| 879 | * @NFT_REJECT_ICMPX_NO_ROUTE: no route to host / network unreachable |
| 880 | * @NFT_REJECT_ICMPX_PORT_UNREACH: port unreachable |
| 881 | * @NFT_REJECT_ICMPX_HOST_UNREACH: host unreachable |
| 882 | * @NFT_REJECT_ICMPX_ADMIN_PROHIBITED: administratively prohibited |
| 883 | * |
| 884 | * These codes are mapped to real ICMP and ICMPv6 codes. |
| 885 | */ |
| 886 | enum nft_reject_inet_code { |
| 887 | NFT_REJECT_ICMPX_NO_ROUTE = 0, |
| 888 | NFT_REJECT_ICMPX_PORT_UNREACH, |
| 889 | NFT_REJECT_ICMPX_HOST_UNREACH, |
| 890 | NFT_REJECT_ICMPX_ADMIN_PROHIBITED, |
| 891 | __NFT_REJECT_ICMPX_MAX |
| 892 | }; |
Pablo Neira Ayuso | f0d1f04 | 2014-10-07 19:02:11 +0200 | [diff] [blame] | 893 | #define NFT_REJECT_ICMPX_MAX (__NFT_REJECT_ICMPX_MAX - 1) |
Pablo Neira Ayuso | 51b0a5d | 2014-09-26 14:35:14 +0200 | [diff] [blame] | 894 | |
| 895 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 896 | * enum nft_reject_attributes - nf_tables reject expression netlink attributes |
| 897 | * |
| 898 | * @NFTA_REJECT_TYPE: packet type to use (NLA_U32: nft_reject_types) |
| 899 | * @NFTA_REJECT_ICMP_CODE: ICMP code to use (NLA_U8) |
| 900 | */ |
| 901 | enum nft_reject_attributes { |
| 902 | NFTA_REJECT_UNSPEC, |
| 903 | NFTA_REJECT_TYPE, |
| 904 | NFTA_REJECT_ICMP_CODE, |
| 905 | __NFTA_REJECT_MAX |
| 906 | }; |
| 907 | #define NFTA_REJECT_MAX (__NFTA_REJECT_MAX - 1) |
| 908 | |
| 909 | /** |
| 910 | * enum nft_nat_types - nf_tables nat expression NAT types |
| 911 | * |
| 912 | * @NFT_NAT_SNAT: source NAT |
| 913 | * @NFT_NAT_DNAT: destination NAT |
| 914 | */ |
| 915 | enum nft_nat_types { |
| 916 | NFT_NAT_SNAT, |
| 917 | NFT_NAT_DNAT, |
| 918 | }; |
| 919 | |
| 920 | /** |
| 921 | * enum nft_nat_attributes - nf_tables nat expression netlink attributes |
| 922 | * |
| 923 | * @NFTA_NAT_TYPE: NAT type (NLA_U32: nft_nat_types) |
Tomasz Bursztyka | eb31628 | 2013-10-10 13:39:19 +0200 | [diff] [blame] | 924 | * @NFTA_NAT_FAMILY: NAT family (NLA_U32) |
| 925 | * @NFTA_NAT_REG_ADDR_MIN: source register of address range start (NLA_U32: nft_registers) |
| 926 | * @NFTA_NAT_REG_ADDR_MAX: source register of address range end (NLA_U32: nft_registers) |
| 927 | * @NFTA_NAT_REG_PROTO_MIN: source register of proto range start (NLA_U32: nft_registers) |
| 928 | * @NFTA_NAT_REG_PROTO_MAX: source register of proto range end (NLA_U32: nft_registers) |
Arturo Borrero | e42eff8 | 2014-09-04 14:06:14 +0200 | [diff] [blame] | 929 | * @NFTA_NAT_FLAGS: NAT flags (see NF_NAT_RANGE_* in linux/netfilter/nf_nat.h) (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 930 | */ |
| 931 | enum nft_nat_attributes { |
| 932 | NFTA_NAT_UNSPEC, |
| 933 | NFTA_NAT_TYPE, |
Tomasz Bursztyka | eb31628 | 2013-10-10 13:39:19 +0200 | [diff] [blame] | 934 | NFTA_NAT_FAMILY, |
| 935 | NFTA_NAT_REG_ADDR_MIN, |
| 936 | NFTA_NAT_REG_ADDR_MAX, |
| 937 | NFTA_NAT_REG_PROTO_MIN, |
| 938 | NFTA_NAT_REG_PROTO_MAX, |
Arturo Borrero | e42eff8 | 2014-09-04 14:06:14 +0200 | [diff] [blame] | 939 | NFTA_NAT_FLAGS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 940 | __NFTA_NAT_MAX |
| 941 | }; |
| 942 | #define NFTA_NAT_MAX (__NFTA_NAT_MAX - 1) |
| 943 | |
Arturo Borrero | 9ba1f726 | 2014-09-08 13:45:00 +0200 | [diff] [blame] | 944 | /** |
| 945 | * enum nft_masq_attributes - nf_tables masquerade expression attributes |
| 946 | * |
| 947 | * @NFTA_MASQ_FLAGS: NAT flags (see NF_NAT_RANGE_* in linux/netfilter/nf_nat.h) (NLA_U32) |
| 948 | */ |
| 949 | enum nft_masq_attributes { |
Pablo Neira Ayuso | 39e393b | 2014-09-11 11:02:39 +0200 | [diff] [blame] | 950 | NFTA_MASQ_UNSPEC, |
Arturo Borrero | 9ba1f726 | 2014-09-08 13:45:00 +0200 | [diff] [blame] | 951 | NFTA_MASQ_FLAGS, |
| 952 | __NFTA_MASQ_MAX |
| 953 | }; |
| 954 | #define NFTA_MASQ_MAX (__NFTA_MASQ_MAX - 1) |
| 955 | |
Pablo Neira Ayuso | 84d7fce | 2014-09-04 14:30:22 +0200 | [diff] [blame] | 956 | /** |
Arturo Borrero | e9105f1 | 2014-10-17 12:39:09 +0200 | [diff] [blame] | 957 | * enum nft_redir_attributes - nf_tables redirect expression netlink attributes |
| 958 | * |
| 959 | * @NFTA_REDIR_REG_PROTO_MIN: source register of proto range start (NLA_U32: nft_registers) |
| 960 | * @NFTA_REDIR_REG_PROTO_MAX: source register of proto range end (NLA_U32: nft_registers) |
| 961 | * @NFTA_REDIR_FLAGS: NAT flags (see NF_NAT_RANGE_* in linux/netfilter/nf_nat.h) (NLA_U32) |
| 962 | */ |
| 963 | enum nft_redir_attributes { |
| 964 | NFTA_REDIR_UNSPEC, |
| 965 | NFTA_REDIR_REG_PROTO_MIN, |
| 966 | NFTA_REDIR_REG_PROTO_MAX, |
| 967 | NFTA_REDIR_FLAGS, |
| 968 | __NFTA_REDIR_MAX |
| 969 | }; |
| 970 | #define NFTA_REDIR_MAX (__NFTA_REDIR_MAX - 1) |
| 971 | |
| 972 | /** |
Pablo Neira Ayuso | d877f07 | 2015-05-31 18:04:11 +0200 | [diff] [blame] | 973 | * enum nft_dup_attributes - nf_tables dup expression netlink attributes |
| 974 | * |
| 975 | * @NFTA_DUP_SREG_ADDR: source register of address (NLA_U32: nft_registers) |
| 976 | * @NFTA_DUP_SREG_DEV: source register of output interface (NLA_U32: nft_register) |
| 977 | */ |
| 978 | enum nft_dup_attributes { |
| 979 | NFTA_DUP_UNSPEC, |
| 980 | NFTA_DUP_SREG_ADDR, |
| 981 | NFTA_DUP_SREG_DEV, |
| 982 | __NFTA_DUP_MAX |
| 983 | }; |
| 984 | #define NFTA_DUP_MAX (__NFTA_DUP_MAX - 1) |
| 985 | |
| 986 | /** |
Pablo Neira Ayuso | 84d7fce | 2014-09-04 14:30:22 +0200 | [diff] [blame] | 987 | * enum nft_gen_attributes - nf_tables ruleset generation attributes |
| 988 | * |
| 989 | * @NFTA_GEN_ID: Ruleset generation ID (NLA_U32) |
| 990 | */ |
| 991 | enum nft_gen_attributes { |
| 992 | NFTA_GEN_UNSPEC, |
| 993 | NFTA_GEN_ID, |
| 994 | __NFTA_GEN_MAX |
| 995 | }; |
| 996 | #define NFTA_GEN_MAX (__NFTA_GEN_MAX - 1) |
| 997 | |
Florian Westphal | 33d5a7b | 2015-11-28 21:53:04 +0100 | [diff] [blame] | 998 | /** |
| 999 | * enum nft_trace_attributes - nf_tables trace netlink attributes |
| 1000 | * |
| 1001 | * @NFTA_TRACE_TABLE: name of the table (NLA_STRING) |
| 1002 | * @NFTA_TRACE_CHAIN: name of the chain (NLA_STRING) |
| 1003 | * @NFTA_TRACE_RULE_HANDLE: numeric handle of the rule (NLA_U64) |
| 1004 | * @NFTA_TRACE_TYPE: type of the event (NLA_U32: nft_trace_types) |
| 1005 | * @NFTA_TRACE_VERDICT: verdict returned by hook (NLA_NESTED: nft_verdicts) |
| 1006 | * @NFTA_TRACE_ID: pseudo-id, same for each skb traced (NLA_U32) |
| 1007 | * @NFTA_TRACE_LL_HEADER: linklayer header (NLA_BINARY) |
| 1008 | * @NFTA_TRACE_NETWORK_HEADER: network header (NLA_BINARY) |
| 1009 | * @NFTA_TRACE_TRANSPORT_HEADER: transport header (NLA_BINARY) |
| 1010 | * @NFTA_TRACE_IIF: indev ifindex (NLA_U32) |
| 1011 | * @NFTA_TRACE_IIFTYPE: netdev->type of indev (NLA_U16) |
| 1012 | * @NFTA_TRACE_OIF: outdev ifindex (NLA_U32) |
| 1013 | * @NFTA_TRACE_OIFTYPE: netdev->type of outdev (NLA_U16) |
| 1014 | * @NFTA_TRACE_MARK: nfmark (NLA_U32) |
| 1015 | * @NFTA_TRACE_NFPROTO: nf protocol processed (NLA_U32) |
| 1016 | * @NFTA_TRACE_POLICY: policy that decided fate of packet (NLA_U32) |
| 1017 | */ |
| 1018 | enum nft_trace_attibutes { |
| 1019 | NFTA_TRACE_UNSPEC, |
| 1020 | NFTA_TRACE_TABLE, |
| 1021 | NFTA_TRACE_CHAIN, |
| 1022 | NFTA_TRACE_RULE_HANDLE, |
| 1023 | NFTA_TRACE_TYPE, |
| 1024 | NFTA_TRACE_VERDICT, |
| 1025 | NFTA_TRACE_ID, |
| 1026 | NFTA_TRACE_LL_HEADER, |
| 1027 | NFTA_TRACE_NETWORK_HEADER, |
| 1028 | NFTA_TRACE_TRANSPORT_HEADER, |
| 1029 | NFTA_TRACE_IIF, |
| 1030 | NFTA_TRACE_IIFTYPE, |
| 1031 | NFTA_TRACE_OIF, |
| 1032 | NFTA_TRACE_OIFTYPE, |
| 1033 | NFTA_TRACE_MARK, |
| 1034 | NFTA_TRACE_NFPROTO, |
| 1035 | NFTA_TRACE_POLICY, |
| 1036 | __NFTA_TRACE_MAX |
| 1037 | }; |
| 1038 | #define NFTA_TRACE_MAX (__NFTA_TRACE_MAX - 1) |
| 1039 | |
| 1040 | enum nft_trace_types { |
| 1041 | NFT_TRACETYPE_UNSPEC, |
| 1042 | NFT_TRACETYPE_POLICY, |
| 1043 | NFT_TRACETYPE_RETURN, |
| 1044 | NFT_TRACETYPE_RULE, |
| 1045 | __NFT_TRACETYPE_MAX |
| 1046 | }; |
| 1047 | #define NFT_TRACETYPE_MAX (__NFT_TRACETYPE_MAX - 1) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 1048 | #endif /* _LINUX_NF_TABLES_H */ |