diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-11-12 12:44:56 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-11-12 13:49:21 +0100 |
commit | e6723abac82460b73979ebe08d5b3e1baf50b927 (patch) | |
tree | 3e5986dd42e331d1df1bc36cdcfe47835933e813 /iptables/nft.h | |
parent | 21ec111803febfe11693790f44400e3f0a5e2020 (diff) |
nft: add NFT_TABLE_* enumeration
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft.h')
-rw-r--r-- | iptables/nft.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/iptables/nft.h b/iptables/nft.h index bb5f03b4..9b4ba5f9 100644 --- a/iptables/nft.h +++ b/iptables/nft.h @@ -5,12 +5,14 @@ #include "nft-shared.h" #include <libiptc/linux_list.h> -#define FILTER 0 -#define MANGLE 1 -#define RAW 2 -#define SECURITY 3 -#define NAT 4 -#define TABLES_MAX 5 +enum nft_table_type { + NFT_TABLE_FILTER = 0, + NFT_TABLE_MANGLE, + NFT_TABLE_RAW, + NFT_TABLE_SECURITY, + NFT_TABLE_NAT, +}; +#define NFT_TABLE_MAX (NFT_TABLE_NAT + 1) struct builtin_chain { const char *name; @@ -47,9 +49,9 @@ struct nft_handle { } error; }; -extern struct builtin_table xtables_ipv4[TABLES_MAX]; -extern struct builtin_table xtables_arp[TABLES_MAX]; -extern struct builtin_table xtables_bridge[TABLES_MAX]; +extern struct builtin_table xtables_ipv4[NFT_TABLE_MAX]; +extern struct builtin_table xtables_arp[NFT_TABLE_MAX]; +extern struct builtin_table xtables_bridge[NFT_TABLE_MAX]; int mnl_talk(struct nft_handle *h, struct nlmsghdr *nlh, int (*cb)(const struct nlmsghdr *nlh, void *data), |