diff options
| author | Phil Sutter <phil@nwl.cc> | 2024-05-15 16:01:20 +0200 |
|---|---|---|
| committer | Phil Sutter <phil@nwl.cc> | 2024-11-06 11:00:21 +0100 |
| commit | 73a8adfc2432ec8337288cc90e7c9f4509139846 (patch) | |
| tree | 32716796633d8a0e1250cb15a169abc94dabacd7 /include | |
| parent | c1c0c54e237c880adaa8172b93d7450e6c617cfc (diff) | |
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 <phil@nwl.cc>
Diffstat (limited to 'include')
| -rw-r--r-- | include/json.h | 10 | ||||
| -rw-r--r-- | include/netlink.h | 1 | ||||
| -rw-r--r-- | include/rule.h | 1 |
3 files changed, 12 insertions, 0 deletions
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 |
