summaryrefslogtreecommitdiffstats
path: root/iptables/nft.h
diff options
context:
space:
mode:
authorGiuseppe Longo <giuseppelng@gmail.com>2013-07-26 13:05:15 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:40 +0100
commitafae1f841bc2c4b39a38fa97d271f3877d00bf3a (patch)
tree390d5811781dd8e7f15defb65d23e9be5876d587 /iptables/nft.h
parent66a5399b6a4383ea4081d99ae852eebc1d65f265 (diff)
nft: associate table configuration to handle via nft_init
We need family dependent built-in table/chain configuration. This patch is a step forward making nft family independent in order to support arptables and ebtables compatibility layers. Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft.h')
-rw-r--r--iptables/nft.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/iptables/nft.h b/iptables/nft.h
index 7a6351b7..f3317c92 100644
--- a/iptables/nft.h
+++ b/iptables/nft.h
@@ -4,6 +4,25 @@
#include "xshared.h"
#include "nft-shared.h"
+#define FILTER 0
+#define MANGLE 1
+#define RAW 2
+#define SECURITY 3
+#define NAT 4
+#define TABLES_MAX 5
+
+struct builtin_chain {
+ const char *name;
+ const char *type;
+ uint32_t prio;
+ uint32_t hook;
+};
+
+struct builtin_table {
+ const char *name;
+ struct builtin_chain chains[NF_INET_NUMHOOKS];
+};
+
struct nft_handle {
int family;
struct mnl_socket *nl;
@@ -11,9 +30,12 @@ struct nft_handle {
uint32_t seq;
bool commit;
struct nft_family_ops *ops;
+ struct builtin_table *tables;
};
-int nft_init(struct nft_handle *h);
+extern struct builtin_table xtables_ipv4[TABLES_MAX];
+
+int nft_init(struct nft_handle *h, struct builtin_table *t);
void nft_fini(struct nft_handle *h);
/*