From 7feece21f72ebf4633048b2dd447e31da30819fb Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 8 May 2018 13:08:35 +0200 Subject: libnftables: Make some functions globally accessible This removes static flag and adds header prototype for the following functions: * must_print_eq_op() from src/expression.c * fib_result_str() from src/fib.c * set_policy2str() and chain_policy2str from src/rule.c In fib.h, include linux/netfilter/nf_tables.h to make sure enum nft_fib_result is known when including this file. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/expression.h | 2 ++ include/fib.h | 3 +++ include/rule.h | 2 ++ include/statement.h | 2 ++ 4 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/expression.h b/include/expression.h index f0ba6fc1..23d6bd23 100644 --- a/include/expression.h +++ b/include/expression.h @@ -366,6 +366,8 @@ extern struct expr *unary_expr_alloc(const struct location *loc, extern struct expr *binop_expr_alloc(const struct location *loc, enum ops op, struct expr *left, struct expr *right); +extern bool must_print_eq_op(const struct expr *expr); + extern struct expr *relational_expr_alloc(const struct location *loc, enum ops op, struct expr *left, struct expr *right); diff --git a/include/fib.h b/include/fib.h index 9ce681cc..67edccfe 100644 --- a/include/fib.h +++ b/include/fib.h @@ -1,6 +1,9 @@ #ifndef NFTABLES_FIB_H #define NFTABLES_FIB_H +#include + +extern const char *fib_result_str(enum nft_fib_result result); extern struct expr *fib_expr_alloc(const struct location *loc, unsigned int flags, unsigned int result); diff --git a/include/rule.h b/include/rule.h index 2c44ccea..cfecf7ff 100644 --- a/include/rule.h +++ b/include/rule.h @@ -204,6 +204,7 @@ extern struct chain *chain_lookup(const struct table *table, extern const char *family2str(unsigned int family); extern const char *hooknum2str(unsigned int family, unsigned int hooknum); +extern const char *chain_policy2str(uint32_t policy); extern void chain_print_plain(const struct chain *chain, struct output_ctx *octx); @@ -284,6 +285,7 @@ extern void set_add_hash(struct set *set, struct table *table); extern struct set *set_lookup(const struct table *table, const char *name); extern struct set *set_lookup_global(uint32_t family, const char *table, const char *name, struct nft_cache *cache); +extern const char *set_policy2str(uint32_t policy); extern void set_print(const struct set *set, struct output_ctx *octx); extern void set_print_plain(const struct set *s, struct output_ctx *octx); diff --git a/include/statement.h b/include/statement.h index 5987b181..fc80dbd5 100644 --- a/include/statement.h +++ b/include/statement.h @@ -21,6 +21,7 @@ struct objref_stmt { struct expr *expr; }; +const char *objref_type_name(uint32_t type); struct stmt *objref_stmt_alloc(const struct location *loc); struct counter_stmt { @@ -75,6 +76,7 @@ struct log_stmt { uint32_t flags; }; +extern const char *log_level(uint32_t level); extern struct stmt *log_stmt_alloc(const struct location *loc); -- cgit v1.2.3