[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180929175931.18448-12-dsahern@kernel.org>
Date: Sat, 29 Sep 2018 10:59:31 -0700
From: David Ahern <dsahern@...nel.org>
To: netdev@...r.kernel.org
Cc: stephen@...workplumber.org, christian@...uner.io,
David Ahern <dsahern@...il.com>
Subject: [PATCH iproute2-next 11/11] libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter
From: David Ahern <dsahern@...il.com>
rtnl_wilddump_stats_req_filter only takes RTM_GETSTATS as the type argument
so rename to rtnl_statsdump_req_filter for consistency with other request
functions and hardcode the type argument.
Signed-off-by: David Ahern <dsahern@...il.com>
---
bridge/vlan.c | 8 ++------
include/libnetlink.h | 3 +--
ip/iplink.c | 4 +---
ip/iplink_xstats.c | 4 +---
lib/libnetlink.c | 5 ++---
misc/ifstat.c | 4 ++--
6 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/bridge/vlan.c b/bridge/vlan.c
index 59ed1964bcd2..239907bdad89 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -603,9 +603,7 @@ static int vlan_show(int argc, char **argv)
__u32 filt_mask;
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
exit(1);
}
@@ -619,9 +617,7 @@ static int vlan_show(int argc, char **argv)
}
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS_SLAVE);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send slave dump request");
exit(1);
}
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 29eb906ec9eb..8655e0b75c38 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -76,8 +76,7 @@ typedef int (*req_filter_fn_t)(struct nlmsghdr *nlh, int reqlen);
int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int fam,
req_filter_fn_t fn)
__attribute__((warn_unused_result));
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
__attribute__((warn_unused_result));
int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req,
int len)
diff --git a/ip/iplink.c b/ip/iplink.c
index d99c49ed244a..50ccb49a0263 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1601,9 +1601,7 @@ static int iplink_afstats(int argc, char **argv)
}
}
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return 1;
}
diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c
index 10f953bc4584..908d9228369f 100644
--- a/ip/iplink_xstats.c
+++ b/ip/iplink_xstats.c
@@ -65,9 +65,7 @@ int iplink_ifla_xstats(int argc, char **argv)
else
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return -1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index bc72272be9c4..e12ce63bd05a 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -400,8 +400,7 @@ int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int family,
return send(rth->fd, &req, req.nlh.nlmsg_len, 0);
}
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
{
struct {
struct nlmsghdr nlh;
@@ -410,7 +409,7 @@ int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct if_stats_msg));
- req.nlh.nlmsg_type = type;
+ req.nlh.nlmsg_type = RTM_GETSTATS;
req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 36eba605d5ba..f12c88f295c3 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -203,8 +203,8 @@ static void load_info(void)
if (is_extended) {
ll_init_map(&rth);
filter_mask = IFLA_STATS_FILTER_BIT(filter_type);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC, RTM_GETSTATS,
- filter_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC,
+ filter_mask) < 0) {
perror("Cannot send dump request");
exit(1);
}
--
2.11.0
Powered by blists - more mailing lists