From 73a8adfc2432ec8337288cc90e7c9f4509139846 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 15 May 2024 16:01:20 +0200 Subject: monitor: Recognize flowtable add/del events These were entirely ignored before, add the necessary code analogous to e.g. objects. Signed-off-by: Phil Sutter --- include/json.h | 10 ++++++++++ include/netlink.h | 1 + include/rule.h | 1 + 3 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/json.h b/include/json.h index 39be8928..0670b871 100644 --- a/include/json.h +++ b/include/json.h @@ -11,6 +11,7 @@ struct nlmsghdr; struct rule; struct set; struct obj; +struct flowtable; struct stmt; struct symbol_table; struct table; @@ -113,6 +114,8 @@ 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_flowtable_json(struct netlink_mon_handler *monh, + const char *cmd, struct flowtable *ft); void monitor_print_rule_json(struct netlink_mon_handler *monh, const char *cmd, struct rule *r); @@ -254,6 +257,13 @@ static inline void monitor_print_obj_json(struct netlink_mon_handler *monh, /* empty */ } +static inline void +monitor_print_flowtable_json(struct netlink_mon_handler *monh, + const char *cmd, struct flowtable *ft) +{ + /* empty */ +} + static inline void monitor_print_rule_json(struct netlink_mon_handler *monh, const char *cmd, struct rule *r) { diff --git a/include/netlink.h b/include/netlink.h index cf7ba369..e9667a24 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -97,6 +97,7 @@ extern struct nftnl_table *netlink_table_alloc(const struct nlmsghdr *nlh); extern struct nftnl_chain *netlink_chain_alloc(const struct nlmsghdr *nlh); extern struct nftnl_set *netlink_set_alloc(const struct nlmsghdr *nlh); extern struct nftnl_obj *netlink_obj_alloc(const struct nlmsghdr *nlh); +extern struct nftnl_flowtable *netlink_flowtable_alloc(const struct nlmsghdr *nlh); extern struct nftnl_rule *netlink_rule_alloc(const struct nlmsghdr *nlh); struct nft_data_linearize { diff --git a/include/rule.h b/include/rule.h index 48e148e6..238be23e 100644 --- a/include/rule.h +++ b/include/rule.h @@ -551,6 +551,7 @@ extern struct flowtable *flowtable_lookup_fuzzy(const char *ft_name, const struct table **table); void flowtable_print(const struct flowtable *n, struct output_ctx *octx); +void flowtable_print_plain(const struct flowtable *ft, struct output_ctx *octx); /** * enum cmd_ops - command operations -- cgit v1.2.3