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 | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 4 | #define NFT_CHAIN_MAXNAMELEN 32 |
| 5 | #define NFT_USERDATA_MAXLEN 256 |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 6 | |
| 7 | enum nft_registers { |
| 8 | NFT_REG_VERDICT, |
| 9 | NFT_REG_1, |
| 10 | NFT_REG_2, |
| 11 | NFT_REG_3, |
| 12 | NFT_REG_4, |
| 13 | __NFT_REG_MAX |
| 14 | }; |
| 15 | #define NFT_REG_MAX (__NFT_REG_MAX - 1) |
| 16 | |
| 17 | /** |
| 18 | * enum nft_verdicts - nf_tables internal verdicts |
| 19 | * |
| 20 | * @NFT_CONTINUE: continue evaluation of the current rule |
| 21 | * @NFT_BREAK: terminate evaluation of the current rule |
| 22 | * @NFT_JUMP: push the current chain on the jump stack and jump to a chain |
| 23 | * @NFT_GOTO: jump to a chain without pushing the current chain on the jump stack |
| 24 | * @NFT_RETURN: return to the topmost chain on the jump stack |
| 25 | * |
| 26 | * The nf_tables verdicts share their numeric space with the netfilter verdicts. |
| 27 | */ |
| 28 | enum nft_verdicts { |
| 29 | NFT_CONTINUE = -1, |
| 30 | NFT_BREAK = -2, |
| 31 | NFT_JUMP = -3, |
| 32 | NFT_GOTO = -4, |
| 33 | NFT_RETURN = -5, |
| 34 | }; |
| 35 | |
| 36 | /** |
| 37 | * enum nf_tables_msg_types - nf_tables netlink message types |
| 38 | * |
| 39 | * @NFT_MSG_NEWTABLE: create a new table (enum nft_table_attributes) |
| 40 | * @NFT_MSG_GETTABLE: get a table (enum nft_table_attributes) |
| 41 | * @NFT_MSG_DELTABLE: delete a table (enum nft_table_attributes) |
| 42 | * @NFT_MSG_NEWCHAIN: create a new chain (enum nft_chain_attributes) |
| 43 | * @NFT_MSG_GETCHAIN: get a chain (enum nft_chain_attributes) |
| 44 | * @NFT_MSG_DELCHAIN: delete a chain (enum nft_chain_attributes) |
| 45 | * @NFT_MSG_NEWRULE: create a new rule (enum nft_rule_attributes) |
| 46 | * @NFT_MSG_GETRULE: get a rule (enum nft_rule_attributes) |
| 47 | * @NFT_MSG_DELRULE: delete a rule (enum nft_rule_attributes) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 48 | * @NFT_MSG_NEWSET: create a new set (enum nft_set_attributes) |
| 49 | * @NFT_MSG_GETSET: get a set (enum nft_set_attributes) |
| 50 | * @NFT_MSG_DELSET: delete a set (enum nft_set_attributes) |
| 51 | * @NFT_MSG_NEWSETELEM: create a new set element (enum nft_set_elem_attributes) |
| 52 | * @NFT_MSG_GETSETELEM: get a set element (enum nft_set_elem_attributes) |
| 53 | * @NFT_MSG_DELSETELEM: delete a set element (enum nft_set_elem_attributes) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 54 | */ |
| 55 | enum nf_tables_msg_types { |
| 56 | NFT_MSG_NEWTABLE, |
| 57 | NFT_MSG_GETTABLE, |
| 58 | NFT_MSG_DELTABLE, |
| 59 | NFT_MSG_NEWCHAIN, |
| 60 | NFT_MSG_GETCHAIN, |
| 61 | NFT_MSG_DELCHAIN, |
| 62 | NFT_MSG_NEWRULE, |
| 63 | NFT_MSG_GETRULE, |
| 64 | NFT_MSG_DELRULE, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 65 | NFT_MSG_NEWSET, |
| 66 | NFT_MSG_GETSET, |
| 67 | NFT_MSG_DELSET, |
| 68 | NFT_MSG_NEWSETELEM, |
| 69 | NFT_MSG_GETSETELEM, |
| 70 | NFT_MSG_DELSETELEM, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 71 | NFT_MSG_MAX, |
| 72 | }; |
| 73 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 74 | /** |
| 75 | * enum nft_list_attributes - nf_tables generic list netlink attributes |
| 76 | * |
| 77 | * @NFTA_LIST_ELEM: list element (NLA_NESTED) |
| 78 | */ |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 79 | enum nft_list_attributes { |
| 80 | NFTA_LIST_UNPEC, |
| 81 | NFTA_LIST_ELEM, |
| 82 | __NFTA_LIST_MAX |
| 83 | }; |
| 84 | #define NFTA_LIST_MAX (__NFTA_LIST_MAX - 1) |
| 85 | |
| 86 | /** |
| 87 | * enum nft_hook_attributes - nf_tables netfilter hook netlink attributes |
| 88 | * |
| 89 | * @NFTA_HOOK_HOOKNUM: netfilter hook number (NLA_U32) |
| 90 | * @NFTA_HOOK_PRIORITY: netfilter hook priority (NLA_U32) |
| 91 | */ |
| 92 | enum nft_hook_attributes { |
| 93 | NFTA_HOOK_UNSPEC, |
| 94 | NFTA_HOOK_HOOKNUM, |
| 95 | NFTA_HOOK_PRIORITY, |
| 96 | __NFTA_HOOK_MAX |
| 97 | }; |
| 98 | #define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1) |
| 99 | |
| 100 | /** |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 101 | * enum nft_table_flags - nf_tables table flags |
| 102 | * |
| 103 | * @NFT_TABLE_F_DORMANT: this table is not active |
| 104 | */ |
| 105 | enum nft_table_flags { |
| 106 | NFT_TABLE_F_DORMANT = 0x1, |
| 107 | }; |
| 108 | |
| 109 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 110 | * enum nft_table_attributes - nf_tables table netlink attributes |
| 111 | * |
| 112 | * @NFTA_TABLE_NAME: name of the table (NLA_STRING) |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 113 | * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) |
Tomasz Bursztyka | d8bcc768 | 2013-12-12 15:00:42 +0200 | [diff] [blame] | 114 | * @NFTA_TABLE_USE: number of chains in this table (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 115 | */ |
| 116 | enum nft_table_attributes { |
| 117 | NFTA_TABLE_UNSPEC, |
| 118 | NFTA_TABLE_NAME, |
Pablo Neira Ayuso | 9ddf632 | 2013-10-10 13:26:33 +0200 | [diff] [blame] | 119 | NFTA_TABLE_FLAGS, |
Tomasz Bursztyka | d8bcc768 | 2013-12-12 15:00:42 +0200 | [diff] [blame] | 120 | NFTA_TABLE_USE, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 121 | __NFTA_TABLE_MAX |
| 122 | }; |
| 123 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) |
| 124 | |
| 125 | /** |
| 126 | * enum nft_chain_attributes - nf_tables chain netlink attributes |
| 127 | * |
| 128 | * @NFTA_CHAIN_TABLE: name of the table containing the chain (NLA_STRING) |
| 129 | * @NFTA_CHAIN_HANDLE: numeric handle of the chain (NLA_U64) |
| 130 | * @NFTA_CHAIN_NAME: name of the chain (NLA_STRING) |
| 131 | * @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] | 132 | * @NFTA_CHAIN_POLICY: numeric policy of the chain (NLA_U32) |
| 133 | * @NFTA_CHAIN_USE: number of references to this chain (NLA_U32) |
Pablo Neira Ayuso | 9370761 | 2013-10-10 23:21:26 +0200 | [diff] [blame] | 134 | * @NFTA_CHAIN_TYPE: type name of the string (NLA_NUL_STRING) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 135 | * @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] | 136 | */ |
| 137 | enum nft_chain_attributes { |
| 138 | NFTA_CHAIN_UNSPEC, |
| 139 | NFTA_CHAIN_TABLE, |
| 140 | NFTA_CHAIN_HANDLE, |
| 141 | NFTA_CHAIN_NAME, |
| 142 | NFTA_CHAIN_HOOK, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 143 | NFTA_CHAIN_POLICY, |
| 144 | NFTA_CHAIN_USE, |
Pablo Neira Ayuso | 9370761 | 2013-10-10 23:21:26 +0200 | [diff] [blame] | 145 | NFTA_CHAIN_TYPE, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 146 | NFTA_CHAIN_COUNTERS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 147 | __NFTA_CHAIN_MAX |
| 148 | }; |
| 149 | #define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1) |
| 150 | |
| 151 | /** |
| 152 | * enum nft_rule_attributes - nf_tables rule netlink attributes |
| 153 | * |
| 154 | * @NFTA_RULE_TABLE: name of the table containing the rule (NLA_STRING) |
| 155 | * @NFTA_RULE_CHAIN: name of the chain containing the rule (NLA_STRING) |
| 156 | * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64) |
| 157 | * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 158 | * @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] | 159 | * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64) |
Pablo Neira Ayuso | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 160 | * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 161 | */ |
| 162 | enum nft_rule_attributes { |
| 163 | NFTA_RULE_UNSPEC, |
| 164 | NFTA_RULE_TABLE, |
| 165 | NFTA_RULE_CHAIN, |
| 166 | NFTA_RULE_HANDLE, |
| 167 | NFTA_RULE_EXPRESSIONS, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 168 | NFTA_RULE_COMPAT, |
Eric Leblond | 5e94846 | 2013-10-10 13:41:44 +0200 | [diff] [blame] | 169 | NFTA_RULE_POSITION, |
Pablo Neira Ayuso | 0768b3b | 2014-02-19 17:27:06 +0100 | [diff] [blame] | 170 | NFTA_RULE_USERDATA, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 171 | __NFTA_RULE_MAX |
| 172 | }; |
| 173 | #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) |
| 174 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 175 | /** |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 176 | * enum nft_rule_compat_flags - nf_tables rule compat flags |
| 177 | * |
| 178 | * @NFT_RULE_COMPAT_F_INV: invert the check result |
| 179 | */ |
| 180 | enum nft_rule_compat_flags { |
| 181 | NFT_RULE_COMPAT_F_INV = (1 << 1), |
| 182 | NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV, |
| 183 | }; |
| 184 | |
| 185 | /** |
| 186 | * enum nft_rule_compat_attributes - nf_tables rule compat attributes |
| 187 | * |
| 188 | * @NFTA_RULE_COMPAT_PROTO: numerice value of handled protocol (NLA_U32) |
| 189 | * @NFTA_RULE_COMPAT_FLAGS: bitmask of enum nft_rule_compat_flags (NLA_U32) |
| 190 | */ |
| 191 | enum nft_rule_compat_attributes { |
| 192 | NFTA_RULE_COMPAT_UNSPEC, |
| 193 | NFTA_RULE_COMPAT_PROTO, |
| 194 | NFTA_RULE_COMPAT_FLAGS, |
| 195 | __NFTA_RULE_COMPAT_MAX |
| 196 | }; |
| 197 | #define NFTA_RULE_COMPAT_MAX (__NFTA_RULE_COMPAT_MAX - 1) |
| 198 | |
| 199 | /** |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 200 | * enum nft_set_flags - nf_tables set flags |
| 201 | * |
| 202 | * @NFT_SET_ANONYMOUS: name allocation, automatic cleanup on unlink |
| 203 | * @NFT_SET_CONSTANT: set contents may not change while bound |
| 204 | * @NFT_SET_INTERVAL: set contains intervals |
| 205 | * @NFT_SET_MAP: set is used as a dictionary |
| 206 | */ |
| 207 | enum nft_set_flags { |
| 208 | NFT_SET_ANONYMOUS = 0x1, |
| 209 | NFT_SET_CONSTANT = 0x2, |
| 210 | NFT_SET_INTERVAL = 0x4, |
| 211 | NFT_SET_MAP = 0x8, |
| 212 | }; |
| 213 | |
| 214 | /** |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 215 | * enum nft_set_policies - set selection policy |
| 216 | * |
| 217 | * @NFT_SET_POL_PERFORMANCE: prefer high performance over low memory use |
| 218 | * @NFT_SET_POL_MEMORY: prefer low memory use over high performance |
| 219 | */ |
| 220 | enum nft_set_policies { |
| 221 | NFT_SET_POL_PERFORMANCE, |
| 222 | NFT_SET_POL_MEMORY, |
| 223 | }; |
| 224 | |
| 225 | /** |
| 226 | * enum nft_set_desc_attributes - set element description |
| 227 | * |
| 228 | * @NFTA_SET_DESC_SIZE: number of elements in set (NLA_U32) |
| 229 | */ |
| 230 | enum nft_set_desc_attributes { |
| 231 | NFTA_SET_DESC_UNSPEC, |
| 232 | NFTA_SET_DESC_SIZE, |
| 233 | __NFTA_SET_DESC_MAX |
| 234 | }; |
| 235 | #define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1) |
| 236 | |
| 237 | /** |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 238 | * enum nft_set_attributes - nf_tables set netlink attributes |
| 239 | * |
| 240 | * @NFTA_SET_TABLE: table name (NLA_STRING) |
| 241 | * @NFTA_SET_NAME: set name (NLA_STRING) |
| 242 | * @NFTA_SET_FLAGS: bitmask of enum nft_set_flags (NLA_U32) |
| 243 | * @NFTA_SET_KEY_TYPE: key data type, informational purpose only (NLA_U32) |
| 244 | * @NFTA_SET_KEY_LEN: key data length (NLA_U32) |
| 245 | * @NFTA_SET_DATA_TYPE: mapping data type (NLA_U32) |
| 246 | * @NFTA_SET_DATA_LEN: mapping data length (NLA_U32) |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 247 | * @NFTA_SET_POLICY: selection policy (NLA_U32) |
| 248 | * @NFTA_SET_DESC: set description (NLA_NESTED) |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 249 | */ |
| 250 | enum nft_set_attributes { |
| 251 | NFTA_SET_UNSPEC, |
| 252 | NFTA_SET_TABLE, |
| 253 | NFTA_SET_NAME, |
| 254 | NFTA_SET_FLAGS, |
| 255 | NFTA_SET_KEY_TYPE, |
| 256 | NFTA_SET_KEY_LEN, |
| 257 | NFTA_SET_DATA_TYPE, |
| 258 | NFTA_SET_DATA_LEN, |
Patrick McHardy | c50b960 | 2014-03-28 10:19:47 +0000 | [diff] [blame] | 259 | NFTA_SET_POLICY, |
| 260 | NFTA_SET_DESC, |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 261 | __NFTA_SET_MAX |
| 262 | }; |
| 263 | #define NFTA_SET_MAX (__NFTA_SET_MAX - 1) |
| 264 | |
| 265 | /** |
| 266 | * enum nft_set_elem_flags - nf_tables set element flags |
| 267 | * |
| 268 | * @NFT_SET_ELEM_INTERVAL_END: element ends the previous interval |
| 269 | */ |
| 270 | enum nft_set_elem_flags { |
| 271 | NFT_SET_ELEM_INTERVAL_END = 0x1, |
| 272 | }; |
| 273 | |
| 274 | /** |
| 275 | * enum nft_set_elem_attributes - nf_tables set element netlink attributes |
| 276 | * |
| 277 | * @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data) |
| 278 | * @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes) |
| 279 | * @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32) |
| 280 | */ |
| 281 | enum nft_set_elem_attributes { |
| 282 | NFTA_SET_ELEM_UNSPEC, |
| 283 | NFTA_SET_ELEM_KEY, |
| 284 | NFTA_SET_ELEM_DATA, |
| 285 | NFTA_SET_ELEM_FLAGS, |
| 286 | __NFTA_SET_ELEM_MAX |
| 287 | }; |
| 288 | #define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1) |
| 289 | |
| 290 | /** |
| 291 | * enum nft_set_elem_list_attributes - nf_tables set element list netlink attributes |
| 292 | * |
| 293 | * @NFTA_SET_ELEM_LIST_TABLE: table of the set to be changed (NLA_STRING) |
| 294 | * @NFTA_SET_ELEM_LIST_SET: name of the set to be changed (NLA_STRING) |
| 295 | * @NFTA_SET_ELEM_LIST_ELEMENTS: list of set elements (NLA_NESTED: nft_set_elem_attributes) |
| 296 | */ |
| 297 | enum nft_set_elem_list_attributes { |
| 298 | NFTA_SET_ELEM_LIST_UNSPEC, |
| 299 | NFTA_SET_ELEM_LIST_TABLE, |
| 300 | NFTA_SET_ELEM_LIST_SET, |
| 301 | NFTA_SET_ELEM_LIST_ELEMENTS, |
| 302 | __NFTA_SET_ELEM_LIST_MAX |
| 303 | }; |
| 304 | #define NFTA_SET_ELEM_LIST_MAX (__NFTA_SET_ELEM_LIST_MAX - 1) |
| 305 | |
| 306 | /** |
| 307 | * enum nft_data_types - nf_tables data types |
| 308 | * |
| 309 | * @NFT_DATA_VALUE: generic data |
| 310 | * @NFT_DATA_VERDICT: netfilter verdict |
| 311 | * |
| 312 | * The type of data is usually determined by the kernel directly and is not |
| 313 | * explicitly specified by userspace. The only difference are sets, where |
| 314 | * userspace specifies the key and mapping data types. |
| 315 | * |
| 316 | * The values 0xffffff00-0xffffffff are reserved for internally used types. |
| 317 | * The remaining range can be freely used by userspace to encode types, all |
| 318 | * values are equivalent to NFT_DATA_VALUE. |
| 319 | */ |
| 320 | enum nft_data_types { |
| 321 | NFT_DATA_VALUE, |
| 322 | NFT_DATA_VERDICT = 0xffffff00U, |
| 323 | }; |
| 324 | |
| 325 | #define NFT_DATA_RESERVED_MASK 0xffffff00U |
| 326 | |
| 327 | /** |
| 328 | * enum nft_data_attributes - nf_tables data netlink attributes |
| 329 | * |
| 330 | * @NFTA_DATA_VALUE: generic data (NLA_BINARY) |
| 331 | * @NFTA_DATA_VERDICT: nf_tables verdict (NLA_NESTED: nft_verdict_attributes) |
| 332 | */ |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 333 | enum nft_data_attributes { |
| 334 | NFTA_DATA_UNSPEC, |
| 335 | NFTA_DATA_VALUE, |
| 336 | NFTA_DATA_VERDICT, |
| 337 | __NFTA_DATA_MAX |
| 338 | }; |
| 339 | #define NFTA_DATA_MAX (__NFTA_DATA_MAX - 1) |
| 340 | |
| 341 | /** |
| 342 | * enum nft_verdict_attributes - nf_tables verdict netlink attributes |
| 343 | * |
| 344 | * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts) |
| 345 | * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING) |
| 346 | */ |
| 347 | enum nft_verdict_attributes { |
| 348 | NFTA_VERDICT_UNSPEC, |
| 349 | NFTA_VERDICT_CODE, |
| 350 | NFTA_VERDICT_CHAIN, |
| 351 | __NFTA_VERDICT_MAX |
| 352 | }; |
| 353 | #define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1) |
| 354 | |
| 355 | /** |
| 356 | * enum nft_expr_attributes - nf_tables expression netlink attributes |
| 357 | * |
| 358 | * @NFTA_EXPR_NAME: name of the expression type (NLA_STRING) |
| 359 | * @NFTA_EXPR_DATA: type specific data (NLA_NESTED) |
| 360 | */ |
| 361 | enum nft_expr_attributes { |
| 362 | NFTA_EXPR_UNSPEC, |
| 363 | NFTA_EXPR_NAME, |
| 364 | NFTA_EXPR_DATA, |
| 365 | __NFTA_EXPR_MAX |
| 366 | }; |
| 367 | #define NFTA_EXPR_MAX (__NFTA_EXPR_MAX - 1) |
| 368 | |
| 369 | /** |
| 370 | * enum nft_immediate_attributes - nf_tables immediate expression netlink attributes |
| 371 | * |
| 372 | * @NFTA_IMMEDIATE_DREG: destination register to load data into (NLA_U32) |
| 373 | * @NFTA_IMMEDIATE_DATA: data to load (NLA_NESTED: nft_data_attributes) |
| 374 | */ |
| 375 | enum nft_immediate_attributes { |
| 376 | NFTA_IMMEDIATE_UNSPEC, |
| 377 | NFTA_IMMEDIATE_DREG, |
| 378 | NFTA_IMMEDIATE_DATA, |
| 379 | __NFTA_IMMEDIATE_MAX |
| 380 | }; |
| 381 | #define NFTA_IMMEDIATE_MAX (__NFTA_IMMEDIATE_MAX - 1) |
| 382 | |
| 383 | /** |
| 384 | * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes |
| 385 | * |
| 386 | * @NFTA_BITWISE_SREG: source register (NLA_U32: nft_registers) |
| 387 | * @NFTA_BITWISE_DREG: destination register (NLA_U32: nft_registers) |
| 388 | * @NFTA_BITWISE_LEN: length of operands (NLA_U32) |
| 389 | * @NFTA_BITWISE_MASK: mask value (NLA_NESTED: nft_data_attributes) |
| 390 | * @NFTA_BITWISE_XOR: xor value (NLA_NESTED: nft_data_attributes) |
| 391 | * |
| 392 | * The bitwise expression performs the following operation: |
| 393 | * |
| 394 | * dreg = (sreg & mask) ^ xor |
| 395 | * |
| 396 | * which allow to express all bitwise operations: |
| 397 | * |
| 398 | * mask xor |
| 399 | * NOT: 1 1 |
| 400 | * OR: 0 x |
| 401 | * XOR: 1 x |
| 402 | * AND: x 0 |
| 403 | */ |
| 404 | enum nft_bitwise_attributes { |
| 405 | NFTA_BITWISE_UNSPEC, |
| 406 | NFTA_BITWISE_SREG, |
| 407 | NFTA_BITWISE_DREG, |
| 408 | NFTA_BITWISE_LEN, |
| 409 | NFTA_BITWISE_MASK, |
| 410 | NFTA_BITWISE_XOR, |
| 411 | __NFTA_BITWISE_MAX |
| 412 | }; |
| 413 | #define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1) |
| 414 | |
| 415 | /** |
| 416 | * enum nft_byteorder_ops - nf_tables byteorder operators |
| 417 | * |
| 418 | * @NFT_BYTEORDER_NTOH: network to host operator |
| 419 | * @NFT_BYTEORDER_HTON: host to network opertaor |
| 420 | */ |
| 421 | enum nft_byteorder_ops { |
| 422 | NFT_BYTEORDER_NTOH, |
| 423 | NFT_BYTEORDER_HTON, |
| 424 | }; |
| 425 | |
| 426 | /** |
| 427 | * enum nft_byteorder_attributes - nf_tables byteorder expression netlink attributes |
| 428 | * |
| 429 | * @NFTA_BYTEORDER_SREG: source register (NLA_U32: nft_registers) |
| 430 | * @NFTA_BYTEORDER_DREG: destination register (NLA_U32: nft_registers) |
| 431 | * @NFTA_BYTEORDER_OP: operator (NLA_U32: enum nft_byteorder_ops) |
| 432 | * @NFTA_BYTEORDER_LEN: length of the data (NLA_U32) |
| 433 | * @NFTA_BYTEORDER_SIZE: data size in bytes (NLA_U32: 2 or 4) |
| 434 | */ |
| 435 | enum nft_byteorder_attributes { |
| 436 | NFTA_BYTEORDER_UNSPEC, |
| 437 | NFTA_BYTEORDER_SREG, |
| 438 | NFTA_BYTEORDER_DREG, |
| 439 | NFTA_BYTEORDER_OP, |
| 440 | NFTA_BYTEORDER_LEN, |
| 441 | NFTA_BYTEORDER_SIZE, |
| 442 | __NFTA_BYTEORDER_MAX |
| 443 | }; |
| 444 | #define NFTA_BYTEORDER_MAX (__NFTA_BYTEORDER_MAX - 1) |
| 445 | |
| 446 | /** |
| 447 | * enum nft_cmp_ops - nf_tables relational operator |
| 448 | * |
| 449 | * @NFT_CMP_EQ: equal |
| 450 | * @NFT_CMP_NEQ: not equal |
| 451 | * @NFT_CMP_LT: less than |
| 452 | * @NFT_CMP_LTE: less than or equal to |
| 453 | * @NFT_CMP_GT: greater than |
| 454 | * @NFT_CMP_GTE: greater than or equal to |
| 455 | */ |
| 456 | enum nft_cmp_ops { |
| 457 | NFT_CMP_EQ, |
| 458 | NFT_CMP_NEQ, |
| 459 | NFT_CMP_LT, |
| 460 | NFT_CMP_LTE, |
| 461 | NFT_CMP_GT, |
| 462 | NFT_CMP_GTE, |
| 463 | }; |
| 464 | |
| 465 | /** |
| 466 | * enum nft_cmp_attributes - nf_tables cmp expression netlink attributes |
| 467 | * |
| 468 | * @NFTA_CMP_SREG: source register of data to compare (NLA_U32: nft_registers) |
| 469 | * @NFTA_CMP_OP: cmp operation (NLA_U32: nft_cmp_ops) |
| 470 | * @NFTA_CMP_DATA: data to compare against (NLA_NESTED: nft_data_attributes) |
| 471 | */ |
| 472 | enum nft_cmp_attributes { |
| 473 | NFTA_CMP_UNSPEC, |
| 474 | NFTA_CMP_SREG, |
| 475 | NFTA_CMP_OP, |
| 476 | NFTA_CMP_DATA, |
| 477 | __NFTA_CMP_MAX |
| 478 | }; |
| 479 | #define NFTA_CMP_MAX (__NFTA_CMP_MAX - 1) |
| 480 | |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 481 | /** |
| 482 | * enum nft_lookup_attributes - nf_tables set lookup expression netlink attributes |
| 483 | * |
| 484 | * @NFTA_LOOKUP_SET: name of the set where to look for (NLA_STRING) |
| 485 | * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers) |
| 486 | * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers) |
| 487 | */ |
| 488 | enum nft_lookup_attributes { |
| 489 | NFTA_LOOKUP_UNSPEC, |
| 490 | NFTA_LOOKUP_SET, |
| 491 | NFTA_LOOKUP_SREG, |
| 492 | NFTA_LOOKUP_DREG, |
| 493 | __NFTA_LOOKUP_MAX |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 494 | }; |
Patrick McHardy | 20a6934 | 2013-10-11 12:06:22 +0200 | [diff] [blame] | 495 | #define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 496 | |
| 497 | /** |
| 498 | * enum nft_payload_bases - nf_tables payload expression offset bases |
| 499 | * |
| 500 | * @NFT_PAYLOAD_LL_HEADER: link layer header |
| 501 | * @NFT_PAYLOAD_NETWORK_HEADER: network header |
| 502 | * @NFT_PAYLOAD_TRANSPORT_HEADER: transport header |
| 503 | */ |
| 504 | enum nft_payload_bases { |
| 505 | NFT_PAYLOAD_LL_HEADER, |
| 506 | NFT_PAYLOAD_NETWORK_HEADER, |
| 507 | NFT_PAYLOAD_TRANSPORT_HEADER, |
| 508 | }; |
| 509 | |
| 510 | /** |
| 511 | * enum nft_payload_attributes - nf_tables payload expression netlink attributes |
| 512 | * |
| 513 | * @NFTA_PAYLOAD_DREG: destination register to load data into (NLA_U32: nft_registers) |
| 514 | * @NFTA_PAYLOAD_BASE: payload base (NLA_U32: nft_payload_bases) |
| 515 | * @NFTA_PAYLOAD_OFFSET: payload offset relative to base (NLA_U32) |
| 516 | * @NFTA_PAYLOAD_LEN: payload length (NLA_U32) |
| 517 | */ |
| 518 | enum nft_payload_attributes { |
| 519 | NFTA_PAYLOAD_UNSPEC, |
| 520 | NFTA_PAYLOAD_DREG, |
| 521 | NFTA_PAYLOAD_BASE, |
| 522 | NFTA_PAYLOAD_OFFSET, |
| 523 | NFTA_PAYLOAD_LEN, |
| 524 | __NFTA_PAYLOAD_MAX |
| 525 | }; |
| 526 | #define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1) |
| 527 | |
| 528 | /** |
| 529 | * enum nft_exthdr_attributes - nf_tables IPv6 extension header expression netlink attributes |
| 530 | * |
| 531 | * @NFTA_EXTHDR_DREG: destination register (NLA_U32: nft_registers) |
| 532 | * @NFTA_EXTHDR_TYPE: extension header type (NLA_U8) |
| 533 | * @NFTA_EXTHDR_OFFSET: extension header offset (NLA_U32) |
| 534 | * @NFTA_EXTHDR_LEN: extension header length (NLA_U32) |
| 535 | */ |
| 536 | enum nft_exthdr_attributes { |
| 537 | NFTA_EXTHDR_UNSPEC, |
| 538 | NFTA_EXTHDR_DREG, |
| 539 | NFTA_EXTHDR_TYPE, |
| 540 | NFTA_EXTHDR_OFFSET, |
| 541 | NFTA_EXTHDR_LEN, |
| 542 | __NFTA_EXTHDR_MAX |
| 543 | }; |
| 544 | #define NFTA_EXTHDR_MAX (__NFTA_EXTHDR_MAX - 1) |
| 545 | |
| 546 | /** |
| 547 | * enum nft_meta_keys - nf_tables meta expression keys |
| 548 | * |
| 549 | * @NFT_META_LEN: packet length (skb->len) |
| 550 | * @NFT_META_PROTOCOL: packet ethertype protocol (skb->protocol), invalid in OUTPUT |
| 551 | * @NFT_META_PRIORITY: packet priority (skb->priority) |
| 552 | * @NFT_META_MARK: packet mark (skb->mark) |
| 553 | * @NFT_META_IIF: packet input interface index (dev->ifindex) |
| 554 | * @NFT_META_OIF: packet output interface index (dev->ifindex) |
| 555 | * @NFT_META_IIFNAME: packet input interface name (dev->name) |
| 556 | * @NFT_META_OIFNAME: packet output interface name (dev->name) |
| 557 | * @NFT_META_IIFTYPE: packet input interface type (dev->type) |
| 558 | * @NFT_META_OIFTYPE: packet output interface type (dev->type) |
| 559 | * @NFT_META_SKUID: originating socket UID (fsuid) |
| 560 | * @NFT_META_SKGID: originating socket GID (fsgid) |
| 561 | * @NFT_META_NFTRACE: packet nftrace bit |
| 562 | * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) |
| 563 | * @NFT_META_SECMARK: packet secmark (skb->secmark) |
Patrick McHardy | 124edfa | 2014-01-03 12:16:17 +0000 | [diff] [blame] | 564 | * @NFT_META_NFPROTO: netfilter protocol |
Patrick McHardy | 4566bf2 | 2014-01-03 12:16:18 +0000 | [diff] [blame] | 565 | * @NFT_META_L4PROTO: layer 4 protocol number |
Tomasz Bursztyka | f5efc69 | 2014-04-14 15:41:28 +0300 | [diff] [blame^] | 566 | * @NFT_META_BRI_IIFNAME: packet input bridge interface name |
| 567 | * @NFT_META_BRI_OIFNAME: packet output bridge interface name |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 568 | */ |
| 569 | enum nft_meta_keys { |
| 570 | NFT_META_LEN, |
| 571 | NFT_META_PROTOCOL, |
| 572 | NFT_META_PRIORITY, |
| 573 | NFT_META_MARK, |
| 574 | NFT_META_IIF, |
| 575 | NFT_META_OIF, |
| 576 | NFT_META_IIFNAME, |
| 577 | NFT_META_OIFNAME, |
| 578 | NFT_META_IIFTYPE, |
| 579 | NFT_META_OIFTYPE, |
| 580 | NFT_META_SKUID, |
| 581 | NFT_META_SKGID, |
| 582 | NFT_META_NFTRACE, |
| 583 | NFT_META_RTCLASSID, |
| 584 | NFT_META_SECMARK, |
Patrick McHardy | 124edfa | 2014-01-03 12:16:17 +0000 | [diff] [blame] | 585 | NFT_META_NFPROTO, |
Patrick McHardy | 4566bf2 | 2014-01-03 12:16:18 +0000 | [diff] [blame] | 586 | NFT_META_L4PROTO, |
Tomasz Bursztyka | f5efc69 | 2014-04-14 15:41:28 +0300 | [diff] [blame^] | 587 | NFT_META_BRI_IIFNAME, |
| 588 | NFT_META_BRI_OIFNAME, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 589 | }; |
| 590 | |
| 591 | /** |
| 592 | * enum nft_meta_attributes - nf_tables meta expression netlink attributes |
| 593 | * |
| 594 | * @NFTA_META_DREG: destination register (NLA_U32) |
| 595 | * @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] | 596 | * @NFTA_META_SREG: source register (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 597 | */ |
| 598 | enum nft_meta_attributes { |
| 599 | NFTA_META_UNSPEC, |
| 600 | NFTA_META_DREG, |
| 601 | NFTA_META_KEY, |
Arturo Borrero Gonzalez | e035b77 | 2013-12-26 16:38:01 +0100 | [diff] [blame] | 602 | NFTA_META_SREG, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 603 | __NFTA_META_MAX |
| 604 | }; |
| 605 | #define NFTA_META_MAX (__NFTA_META_MAX - 1) |
| 606 | |
| 607 | /** |
| 608 | * enum nft_ct_keys - nf_tables ct expression keys |
| 609 | * |
| 610 | * @NFT_CT_STATE: conntrack state (bitmask of enum ip_conntrack_info) |
| 611 | * @NFT_CT_DIRECTION: conntrack direction (enum ip_conntrack_dir) |
| 612 | * @NFT_CT_STATUS: conntrack status (bitmask of enum ip_conntrack_status) |
| 613 | * @NFT_CT_MARK: conntrack mark value |
| 614 | * @NFT_CT_SECMARK: conntrack secmark value |
| 615 | * @NFT_CT_EXPIRATION: relative conntrack expiration time in ms |
| 616 | * @NFT_CT_HELPER: connection tracking helper assigned to conntrack |
| 617 | * @NFT_CT_L3PROTOCOL: conntrack layer 3 protocol |
| 618 | * @NFT_CT_SRC: conntrack layer 3 protocol source (IPv4/IPv6 address) |
| 619 | * @NFT_CT_DST: conntrack layer 3 protocol destination (IPv4/IPv6 address) |
| 620 | * @NFT_CT_PROTOCOL: conntrack layer 4 protocol |
| 621 | * @NFT_CT_PROTO_SRC: conntrack layer 4 protocol source |
| 622 | * @NFT_CT_PROTO_DST: conntrack layer 4 protocol destination |
| 623 | */ |
| 624 | enum nft_ct_keys { |
| 625 | NFT_CT_STATE, |
| 626 | NFT_CT_DIRECTION, |
| 627 | NFT_CT_STATUS, |
| 628 | NFT_CT_MARK, |
| 629 | NFT_CT_SECMARK, |
| 630 | NFT_CT_EXPIRATION, |
| 631 | NFT_CT_HELPER, |
| 632 | NFT_CT_L3PROTOCOL, |
| 633 | NFT_CT_SRC, |
| 634 | NFT_CT_DST, |
| 635 | NFT_CT_PROTOCOL, |
| 636 | NFT_CT_PROTO_SRC, |
| 637 | NFT_CT_PROTO_DST, |
Florian Westphal | d2bf2f3 | 2014-02-18 15:25:32 +0100 | [diff] [blame] | 638 | NFT_CT_LABELS, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 639 | }; |
| 640 | |
| 641 | /** |
| 642 | * enum nft_ct_attributes - nf_tables ct expression netlink attributes |
| 643 | * |
| 644 | * @NFTA_CT_DREG: destination register (NLA_U32) |
| 645 | * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) |
| 646 | * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 647 | * @NFTA_CT_SREG: source register (NLA_U32) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 648 | */ |
| 649 | enum nft_ct_attributes { |
| 650 | NFTA_CT_UNSPEC, |
| 651 | NFTA_CT_DREG, |
| 652 | NFTA_CT_KEY, |
| 653 | NFTA_CT_DIRECTION, |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 654 | NFTA_CT_SREG, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 655 | __NFTA_CT_MAX |
| 656 | }; |
| 657 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) |
| 658 | |
| 659 | /** |
| 660 | * enum nft_limit_attributes - nf_tables limit expression netlink attributes |
| 661 | * |
| 662 | * @NFTA_LIMIT_RATE: refill rate (NLA_U64) |
| 663 | * @NFTA_LIMIT_UNIT: refill unit (NLA_U64) |
| 664 | */ |
| 665 | enum nft_limit_attributes { |
| 666 | NFTA_LIMIT_UNSPEC, |
| 667 | NFTA_LIMIT_RATE, |
| 668 | NFTA_LIMIT_UNIT, |
| 669 | __NFTA_LIMIT_MAX |
| 670 | }; |
| 671 | #define NFTA_LIMIT_MAX (__NFTA_LIMIT_MAX - 1) |
| 672 | |
| 673 | /** |
| 674 | * enum nft_counter_attributes - nf_tables counter expression netlink attributes |
| 675 | * |
| 676 | * @NFTA_COUNTER_BYTES: number of bytes (NLA_U64) |
| 677 | * @NFTA_COUNTER_PACKETS: number of packets (NLA_U64) |
| 678 | */ |
| 679 | enum nft_counter_attributes { |
| 680 | NFTA_COUNTER_UNSPEC, |
| 681 | NFTA_COUNTER_BYTES, |
| 682 | NFTA_COUNTER_PACKETS, |
| 683 | __NFTA_COUNTER_MAX |
| 684 | }; |
| 685 | #define NFTA_COUNTER_MAX (__NFTA_COUNTER_MAX - 1) |
| 686 | |
| 687 | /** |
| 688 | * enum nft_log_attributes - nf_tables log expression netlink attributes |
| 689 | * |
| 690 | * @NFTA_LOG_GROUP: netlink group to send messages to (NLA_U32) |
| 691 | * @NFTA_LOG_PREFIX: prefix to prepend to log messages (NLA_STRING) |
| 692 | * @NFTA_LOG_SNAPLEN: length of payload to include in netlink message (NLA_U32) |
| 693 | * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U32) |
| 694 | */ |
| 695 | enum nft_log_attributes { |
| 696 | NFTA_LOG_UNSPEC, |
| 697 | NFTA_LOG_GROUP, |
| 698 | NFTA_LOG_PREFIX, |
| 699 | NFTA_LOG_SNAPLEN, |
| 700 | NFTA_LOG_QTHRESHOLD, |
| 701 | __NFTA_LOG_MAX |
| 702 | }; |
| 703 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) |
| 704 | |
| 705 | /** |
Eric Leblond | 0aff078 | 2013-12-06 00:24:13 +0100 | [diff] [blame] | 706 | * enum nft_queue_attributes - nf_tables queue expression netlink attributes |
| 707 | * |
| 708 | * @NFTA_QUEUE_NUM: netlink queue to send messages to (NLA_U16) |
| 709 | * @NFTA_QUEUE_TOTAL: number of queues to load balance packets on (NLA_U16) |
| 710 | * @NFTA_QUEUE_FLAGS: various flags (NLA_U16) |
| 711 | */ |
| 712 | enum nft_queue_attributes { |
| 713 | NFTA_QUEUE_UNSPEC, |
| 714 | NFTA_QUEUE_NUM, |
| 715 | NFTA_QUEUE_TOTAL, |
| 716 | NFTA_QUEUE_FLAGS, |
| 717 | __NFTA_QUEUE_MAX |
| 718 | }; |
| 719 | #define NFTA_QUEUE_MAX (__NFTA_QUEUE_MAX - 1) |
| 720 | |
| 721 | #define NFT_QUEUE_FLAG_BYPASS 0x01 /* for compatibility with v2 */ |
| 722 | #define NFT_QUEUE_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */ |
| 723 | #define NFT_QUEUE_FLAG_MASK 0x03 |
| 724 | |
| 725 | /** |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 726 | * enum nft_reject_types - nf_tables reject expression reject types |
| 727 | * |
| 728 | * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable |
| 729 | * @NFT_REJECT_TCP_RST: reject using TCP RST |
| 730 | */ |
| 731 | enum nft_reject_types { |
| 732 | NFT_REJECT_ICMP_UNREACH, |
| 733 | NFT_REJECT_TCP_RST, |
| 734 | }; |
| 735 | |
| 736 | /** |
| 737 | * enum nft_reject_attributes - nf_tables reject expression netlink attributes |
| 738 | * |
| 739 | * @NFTA_REJECT_TYPE: packet type to use (NLA_U32: nft_reject_types) |
| 740 | * @NFTA_REJECT_ICMP_CODE: ICMP code to use (NLA_U8) |
| 741 | */ |
| 742 | enum nft_reject_attributes { |
| 743 | NFTA_REJECT_UNSPEC, |
| 744 | NFTA_REJECT_TYPE, |
| 745 | NFTA_REJECT_ICMP_CODE, |
| 746 | __NFTA_REJECT_MAX |
| 747 | }; |
| 748 | #define NFTA_REJECT_MAX (__NFTA_REJECT_MAX - 1) |
| 749 | |
| 750 | /** |
| 751 | * enum nft_nat_types - nf_tables nat expression NAT types |
| 752 | * |
| 753 | * @NFT_NAT_SNAT: source NAT |
| 754 | * @NFT_NAT_DNAT: destination NAT |
| 755 | */ |
| 756 | enum nft_nat_types { |
| 757 | NFT_NAT_SNAT, |
| 758 | NFT_NAT_DNAT, |
| 759 | }; |
| 760 | |
| 761 | /** |
| 762 | * enum nft_nat_attributes - nf_tables nat expression netlink attributes |
| 763 | * |
| 764 | * @NFTA_NAT_TYPE: NAT type (NLA_U32: nft_nat_types) |
Tomasz Bursztyka | eb31628 | 2013-10-10 13:39:19 +0200 | [diff] [blame] | 765 | * @NFTA_NAT_FAMILY: NAT family (NLA_U32) |
| 766 | * @NFTA_NAT_REG_ADDR_MIN: source register of address range start (NLA_U32: nft_registers) |
| 767 | * @NFTA_NAT_REG_ADDR_MAX: source register of address range end (NLA_U32: nft_registers) |
| 768 | * @NFTA_NAT_REG_PROTO_MIN: source register of proto range start (NLA_U32: nft_registers) |
| 769 | * @NFTA_NAT_REG_PROTO_MAX: source register of proto range end (NLA_U32: nft_registers) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 770 | */ |
| 771 | enum nft_nat_attributes { |
| 772 | NFTA_NAT_UNSPEC, |
| 773 | NFTA_NAT_TYPE, |
Tomasz Bursztyka | eb31628 | 2013-10-10 13:39:19 +0200 | [diff] [blame] | 774 | NFTA_NAT_FAMILY, |
| 775 | NFTA_NAT_REG_ADDR_MIN, |
| 776 | NFTA_NAT_REG_ADDR_MAX, |
| 777 | NFTA_NAT_REG_PROTO_MIN, |
| 778 | NFTA_NAT_REG_PROTO_MAX, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 779 | __NFTA_NAT_MAX |
| 780 | }; |
| 781 | #define NFTA_NAT_MAX (__NFTA_NAT_MAX - 1) |
| 782 | |
| 783 | #endif /* _LINUX_NF_TABLES_H */ |