From f858f20abb8e6b6881d4c343b737a09697c95779 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 6 Nov 2014 18:28:33 +0100 Subject: include: add cli.h Needed by follow up patches to use autotools. Signed-off-by: Pablo Neira Ayuso --- include/cli.h | 18 ++++++++++++++++++ include/nftables.h | 14 ++------------ src/cli.c | 1 + src/main.c | 1 + 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 include/cli.h diff --git a/include/cli.h b/include/cli.h new file mode 100644 index 00000000..89cb9761 --- /dev/null +++ b/include/cli.h @@ -0,0 +1,18 @@ +#ifndef _NFT_CLI_H_ +#define _NFT_CLI_H_ + +#include + +struct parser_state; +#ifdef HAVE_LIBREADLINE +extern int cli_init(struct parser_state *state); +#else +static inline int cli_init(struct parser_state *state) +{ + return -1; +} +#endif +extern void cli_exit(void); +extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0); + +#endif diff --git a/include/nftables.h b/include/nftables.h index 4c33ec63..cf19de82 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -31,18 +31,6 @@ extern unsigned int handle_output; extern unsigned int debug_level; extern const char *include_paths[INCLUDE_PATHS_MAX]; -struct parser_state; -#ifdef HAVE_LIBREADLINE -extern int cli_init(struct parser_state *state); -#else -static inline int cli_init(struct parser_state *state) -{ - return -1; -} -#endif -extern void cli_exit(void); -extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0); - enum nftables_exit_codes { NFT_EXIT_SUCCESS = 0, NFT_EXIT_FAILURE = 1, @@ -116,6 +104,8 @@ struct input_descriptor { off_t line_offset; }; +struct parser_state; + int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs); #endif /* NFTABLES_NFTABLES_H */ diff --git a/src/cli.c b/src/cli.c index f748a0e2..6f2847b8 100644 --- a/src/cli.c +++ b/src/cli.c @@ -27,6 +27,7 @@ #include #include #include +#include #define CMDLINE_HISTFILE ".nft.history" diff --git a/src/main.c b/src/main.c index 16259143..b447aad0 100644 --- a/src/main.c +++ b/src/main.c @@ -25,6 +25,7 @@ #include #include #include +#include unsigned int max_errors = 10; unsigned int numeric_output; -- cgit v1.2.3