diff options
author | Phil Sutter <phil@nwl.cc> | 2018-10-11 17:49:00 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-15 13:37:51 +0200 |
commit | 9e88aae28e9f44d010f3ecf7577357f4c0e7d622 (patch) | |
tree | e76ae3b1c7719ca9d5525acb4903d4843a8c0088 /include/json.h | |
parent | 90ed4fb3855f0d9d881b812c75e338e5e93081ba (diff) |
monitor: Use libnftables JSON output
This switches 'nft monitor' JSON output from using libnftnl's to
libnftables' implementation.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/json.h')
-rw-r--r-- | include/json.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/json.h b/include/json.h index 66337548..d2dc92d9 100644 --- a/include/json.h +++ b/include/json.h @@ -9,9 +9,11 @@ struct expr; struct netlink_ctx; struct rule; struct set; +struct obj; struct stmt; struct symbol_table; struct table; +struct netlink_mon_handler; #ifdef HAVE_LIBJANSSON @@ -88,6 +90,19 @@ int nft_parse_json_buffer(struct nft_ctx *nft, const char *buf, int nft_parse_json_filename(struct nft_ctx *nft, const char *filename, struct list_head *msgs, struct list_head *cmds); +void monitor_print_table_json(struct netlink_mon_handler *monh, + const char *cmd, struct table *t); +void monitor_print_chain_json(struct netlink_mon_handler *monh, + const char *cmd, struct chain *c); +void monitor_print_set_json(struct netlink_mon_handler *monh, + const char *cmd, struct set *s); +void monitor_print_element_json(struct netlink_mon_handler *monh, + const char *cmd, struct set *s); +void monitor_print_obj_json(struct netlink_mon_handler *monh, + const char *cmd, struct obj *o); +void monitor_print_rule_json(struct netlink_mon_handler *monh, + const char *cmd, struct rule *r); + #else /* ! HAVE_LIBJANSSON */ typedef void json_t; @@ -183,6 +198,42 @@ nft_parse_json_filename(struct nft_ctx *nft, const char *filename, return -EINVAL; } +static inline void monitor_print_table_json(struct netlink_mon_handler *monh, + const char *cmd, struct table *t) +{ + /* empty */ +} + +static inline void monitor_print_chain_json(struct netlink_mon_handler *monh, + const char *cmd, struct chain *c) +{ + /* empty */ +} + +static inline void monitor_print_set_json(struct netlink_mon_handler *monh, + const char *cmd, struct set *s) +{ + /* empty */ +} + +static inline void monitor_print_element_json(struct netlink_mon_handler *monh, + const char *cmd, struct set *s) +{ + /* empty */ +} + +static inline void monitor_print_obj_json(struct netlink_mon_handler *monh, + const char *cmd, struct obj *o) +{ + /* empty */ +} + +static inline void monitor_print_rule_json(struct netlink_mon_handler *monh, + const char *cmd, struct rule *r) +{ + /* empty */ +} + #endif /* HAVE_LIBJANSSON */ #endif /* NFTABLES_JSON_H */ |