From e77b31f53a61a8995cd6baf91a6e557260f401bd Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 8 May 2018 13:08:36 +0200 Subject: libnftables: Introduce a few helper functions This adds a bunch of functions for conversion of different values into string (and vice-versa). * log_level_parse(): A simple helper to turn log level string representation into log level value. * nat_etype2str(): Translate nat statement type into string representation. * ct_dir2str(): Convert IP_CT_DIR_* values into string representation. * ct_label2str(): Convert ct_label values into string representation. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/ct.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ct.h') diff --git a/include/ct.h b/include/ct.h index dadd820f..4c5bd804 100644 --- a/include/ct.h +++ b/include/ct.h @@ -33,6 +33,8 @@ extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr); extern struct stmt *notrack_stmt_alloc(const struct location *loc); extern struct stmt *flow_offload_stmt_alloc(const struct location *loc, const char *table_name); +extern const char *ct_dir2str(int dir); +extern const char *ct_label2str(unsigned long value); extern const struct datatype ct_dir_type; extern const struct datatype ct_state_type; -- cgit v1.2.3