]> git.ipfire.org Git - thirdparty/iproute2.git/commit
libnetlink: Add filtering to rtnl_statsdump_req_filter()
authorPetr Machata <petrm@nvidia.com>
Fri, 22 Apr 2022 08:30:50 +0000 (10:30 +0200)
committerDavid Ahern <dsahern@kernel.org>
Thu, 28 Apr 2022 02:12:42 +0000 (20:12 -0600)
commita463d6b19107373748f6f930170b4c106bee0c42
treed38406546b4360875bb72e1d96b8ec3a39a76d62
parent38ae12d39632c164835a4b2954344189a58af830
libnetlink: Add filtering to rtnl_statsdump_req_filter()

A number of functions in the rtnl_*_req family accept a caller-provided
callback to set up arbitrary filtering. rtnl_statsdump_req_filter()
currently only allows setting a field in the IFSM header, not custom
attributes. So far these were not necessary, but with introduction of more
detailed filtering settings, the callback becomes necessary.

To that end, add a filter_fn and filter_data arguments to the function.
Unlike the other filters, this one is typed to expect an IFSM pointer, to
permit tweaking the header itself as well.

Pass NULLs in the existing callers.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
bridge/vlan.c
include/libnetlink.h
ip/iplink.c
ip/iplink_xstats.c
lib/libnetlink.c
misc/ifstat.c