From 35f6cd327c2ec46296adf464f981cd6cddfec27b Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Fri, 16 Jun 2017 14:54:06 +0530 Subject: src: Pass stateless, numeric, ip2name and handle variables as structure members. libnftables library will be created soon. So declare numeric_output, stateless_output, ip2name_output and handle_output as members of structure output_ctx, instead of global variables. Rename these variables as following, numeric_output -> numeric stateless_output -> stateless ip2name_output -> ip2name handle_output -> handle Also add struct output_ctx *octx as member of struct netlink_ctx. Signed-off-by: Varsha Rao Signed-off-by: Pablo Neira Ayuso --- src/ct.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ct.c') diff --git a/src/ct.c b/src/ct.c index ab50a166..c705750d 100644 --- a/src/ct.c +++ b/src/ct.c @@ -132,7 +132,8 @@ static struct symbol_table *ct_label_tbl; #define CT_LABEL_BIT_SIZE 128 -static void ct_label_type_print(const struct expr *expr) +static void ct_label_type_print(const struct expr *expr, + struct output_ctx *octx) { unsigned long bit = mpz_scan1(expr->value, 0); const struct symbolic_constant *s; @@ -286,7 +287,7 @@ static void ct_print(enum nft_ct_keys key, int8_t dir) printf("%s", ct_templates[key].token); } -static void ct_expr_print(const struct expr *expr) +static void ct_expr_print(const struct expr *expr, struct output_ctx *octx) { ct_print(expr->ct.key, expr->ct.direction); } @@ -442,11 +443,11 @@ void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr) } } -static void ct_stmt_print(const struct stmt *stmt) +static void ct_stmt_print(const struct stmt *stmt, struct output_ctx *octx) { ct_print(stmt->ct.key, stmt->ct.direction); printf(" set "); - expr_print(stmt->ct.expr); + expr_print(stmt->ct.expr, octx); } static const struct stmt_ops ct_stmt_ops = { @@ -469,7 +470,7 @@ struct stmt *ct_stmt_alloc(const struct location *loc, enum nft_ct_keys key, return stmt; } -static void notrack_stmt_print(const struct stmt *stmt) +static void notrack_stmt_print(const struct stmt *stmt, struct output_ctx *octx) { printf("notrack"); } -- cgit v1.2.3