path: root/include
diff options
authorPablo Neira Ayuso <>2017-08-22 18:01:44 +0200
committerPablo Neira Ayuso <>2017-08-23 23:42:33 +0200
commitaf038fcf186496ba07fe1cf59263b6741a0988da (patch)
treea72b21a2d372ab7d8e14ada11eade07c9ff491ec /include
parent7c43dc46179a6f85406eb861e970cbb06bac05d2 (diff)
src: add include_paths to struct nft_ctx
Not convenient to keep this as static for the upcoming library, so let's move it where it belongs. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include')
2 files changed, 5 insertions, 3 deletions
diff --git a/include/nftables.h b/include/nftables.h
index 994b5111..8399b1ae 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -39,6 +39,8 @@ struct nft_cache {
struct nft_ctx {
+ const char *include_paths[INCLUDE_PATHS_MAX];
+ unsigned int num_include_paths;
struct output_ctx output;
bool check;
struct nft_cache cache;
@@ -46,7 +48,6 @@ struct nft_ctx {
extern unsigned int max_errors;
extern unsigned int debug_level;
-extern const char *include_paths[INCLUDE_PATHS_MAX];
enum nftables_exit_codes {
diff --git a/include/parser.h b/include/parser.h
index 5a452f77..df602682 100644
--- a/include/parser.h
+++ b/include/parser.h
@@ -33,14 +33,15 @@ struct mnl_socket;
extern void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache,
struct parser_state *state, struct list_head *msgs);
-extern int nft_parse(void *, struct parser_state *state);
+extern int nft_parse(struct nft_ctx *ctx, void *, struct parser_state *state);
extern void *scanner_init(struct parser_state *state);
extern void scanner_destroy(struct parser_state *state);
extern int scanner_read_file(void *scanner, const char *filename,
const struct location *loc);
-extern int scanner_include_file(void *scanner, const char *filename,
+extern int scanner_include_file(struct nft_ctx *ctx, void *scanner,
+ const char *filename,
const struct location *loc);
extern void scanner_push_buffer(void *scanner,
const struct input_descriptor *indesc,