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/evaluate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/evaluate.c') diff --git a/src/evaluate.c b/src/evaluate.c index 311c86c5..04367ced 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -30,6 +30,7 @@ #include #include +static struct output_ctx octx_debug_dummy; static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr); static const char *byteorder_names[] = { @@ -1698,7 +1699,9 @@ static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr) struct error_record *erec; erec = erec_create(EREC_INFORMATIONAL, &(*expr)->location, "Evaluate %s", (*expr)->ops->name); - erec_print(stdout, erec); expr_print(*expr); printf("\n\n"); + erec_print(stdout, erec); + expr_print(*expr, &octx_debug_dummy); + printf("\n\n"); } #endif @@ -2662,7 +2665,8 @@ int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt) struct error_record *erec; erec = erec_create(EREC_INFORMATIONAL, &stmt->location, "Evaluate %s", stmt->ops->name); - erec_print(stdout, erec); stmt_print(stmt); printf("\n\n"); + erec_print(stdout, erec); stmt_print(stmt, &octx_debug_dummy); + printf("\n\n"); } #endif @@ -3320,6 +3324,7 @@ int cmd_evaluate(struct eval_ctx *ctx, struct cmd *cmd) #ifdef DEBUG if (debug_level & DEBUG_EVALUATION) { struct error_record *erec; + erec = erec_create(EREC_INFORMATIONAL, &cmd->location, "Evaluate %s", cmd_op_to_name(cmd->op)); erec_print(stdout, erec); printf("\n\n"); -- cgit v1.2.3