summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorVarsha Rao <rvarsha016@gmail.com>2017-06-16 14:54:06 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2017-06-18 11:23:00 +0200
commit35f6cd327c2ec46296adf464f981cd6cddfec27b (patch)
tree7341c05e6f7499fa3da18a4e50dd9db0ca36339b /src/evaluate.c
parent509671dfa03365bba727b8be5e522b737da93a6f (diff)
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 <rvarsha016@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c9
1 files changed, 7 insertions, 2 deletions
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 <utils.h>
#include <xt.h>
+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");