path: root/include/datatype.h
diff options
authorVarsha Rao <>2017-06-16 14:54:06 +0530
committerPablo Neira Ayuso <>2017-06-18 11:23:00 +0200
commit35f6cd327c2ec46296adf464f981cd6cddfec27b (patch)
tree7341c05e6f7499fa3da18a4e50dd9db0ca36339b /include/datatype.h
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 <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/datatype.h')
1 files changed, 5 insertions, 3 deletions
diff --git a/include/datatype.h b/include/datatype.h
index 04b7d880..58c4d3e0 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -145,7 +145,8 @@ struct datatype {
const char *desc;
const struct datatype *basetype;
const char *basefmt;
- void (*print)(const struct expr *expr);
+ void (*print)(const struct expr *expr,
+ struct output_ctx *octx);
struct error_record *(*parse)(const struct expr *sym,
struct expr **res);
const struct symbol_table *sym_tbl;
@@ -157,7 +158,7 @@ extern const struct datatype *datatype_lookup_byname(const char *name);
extern struct error_record *symbol_parse(const struct expr *sym,
struct expr **res);
-extern void datatype_print(const struct expr *expr);
+extern void datatype_print(const struct expr *expr, struct output_ctx *octx);
static inline bool datatype_equal(const struct datatype *d1,
const struct datatype *d2)
@@ -205,7 +206,8 @@ extern struct error_record *symbolic_constant_parse(const struct expr *sym,
const struct symbol_table *tbl,
struct expr **res);
extern void symbolic_constant_print(const struct symbol_table *tbl,
- const struct expr *expr, bool quotes);
+ const struct expr *expr, bool quotes,
+ struct output_ctx *octx);
extern void symbol_table_print(const struct symbol_table *tbl,
const struct datatype *dtype,
enum byteorder byteorder);