From e6723abac82460b73979ebe08d5b3e1baf50b927 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 12 Nov 2018 12:44:56 +0100 Subject: nft: add NFT_TABLE_* enumeration Signed-off-by: Pablo Neira Ayuso --- iptables/nft.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'iptables/nft.h') 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 -#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), -- cgit v1.2.3