path: root/src/table.c
diff options
authorArturo Borrero <>2014-01-09 12:19:12 +0100
committerPablo Neira Ayuso <>2014-01-09 17:19:46 +0100
commitd34f0c0508f08a84f4351f2a9369e85ccccfe5a0 (patch)
tree43e2cb863ea4d26ec91d77c2b6bdf1ddca8eaf42 /src/table.c
parentfc423ae81487e906141f700c7b3515328ff62b7c (diff)
src: add interface to parse from file
This patch adds a new API to parse rule-set expressed in XML/JSON from a file. A new enum nft_parse_input type is added for this purpose. Signed-off-by: Arturo Borrero Gonzalez <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/table.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/table.c b/src/table.c
index 4f2d5d2..ad3570f 100644
--- a/src/table.c
+++ b/src/table.c
@@ -355,6 +355,13 @@ int nft_table_parse(struct nft_table *t, enum nft_parse_type type,
+int nft_table_parse_file(struct nft_table *t, enum nft_parse_type type,
+ FILE *fp, struct nft_parse_err *err)
+ return nft_table_do_parse(t, type, fp, err, NFT_PARSE_FILE);
static int nft_table_snprintf_json(char *buf, size_t size, struct nft_table *t)
return snprintf(buf, size,