libnetlink: Rename rtnl_wilddump_* to rtnl_linkdump_*

Rename rtnl_wilddump_req_filter to rtnl_linkdump_req_filter,
rtnl_wilddump_request to rtnl_linkdump_req and
rtnl_wilddump_req_filter_fn to rtnl_linkdump_req_filter_fn.

In all cases drop the type argument which at this point is only
RTM_GETLINK and hardcode in the functions.

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2018-09-29 09:56:57 -07:00
parent efb0b383d9
commit 31ae2912f7
11 changed files with 20 additions and 21 deletions

View File

@ -502,7 +502,7 @@ static int brlink_show(int argc, char **argv)
}
if (show_details) {
if (rtnl_wilddump_req_filter(&rth, PF_BRIDGE, RTM_GETLINK,
if (rtnl_linkdump_req_filter(&rth, PF_BRIDGE,
(compress_vlans ?
RTEXT_FILTER_BRVLAN_COMPRESSED :
RTEXT_FILTER_BRVLAN)) < 0) {
@ -510,7 +510,7 @@ static int brlink_show(int argc, char **argv)
exit(1);
}
} else {
if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, PF_BRIDGE) < 0) {
perror("Cannon send dump request");
exit(1);
}

View File

@ -575,7 +575,7 @@ static int vlan_show(int argc, char **argv)
new_json_obj(json);
if (!show_stats) {
if (rtnl_wilddump_req_filter(&rth, PF_BRIDGE, RTM_GETLINK,
if (rtnl_linkdump_req_filter(&rth, PF_BRIDGE,
(compress_vlans ?
RTEXT_FILTER_BRVLAN_COMPRESSED :
RTEXT_FILTER_BRVLAN)) < 0) {

View File

@ -66,15 +66,14 @@ int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
int rtnl_linkdump_req(struct rtnl_handle *rth, int fam)
__attribute__((warn_unused_result));
int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int fam, int type,
__u32 filt_mask)
int rtnl_linkdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
__attribute__((warn_unused_result));
typedef int (*req_filter_fn_t)(struct nlmsghdr *nlh, int reqlen);
int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int fam, int type,
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,

View File

@ -1778,7 +1778,7 @@ static int iplink_filter_req(struct nlmsghdr *nlh, int reqlen)
int ip_linkaddr_list(int family, req_filter_fn_t filter_fn,
struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
{
if (rtnl_wilddump_req_filter_fn(&rth, preferred_family, RTM_GETLINK,
if (rtnl_linkdump_req_filter_fn(&rth, preferred_family,
filter_fn) < 0) {
perror("Cannot send dump request");
return 1;
@ -2031,7 +2031,7 @@ void ipaddr_get_vf_rate(int vfnum, int *min, int *max, const char *dev)
exit(1);
}
if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}

View File

@ -109,7 +109,7 @@ static int iptoken_list(int argc, char **argv)
argc--; argv++;
}
if (rtnl_wilddump_request(&rth, af, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return -1;
}

View File

@ -459,7 +459,7 @@ static int print_tuntap(const struct sockaddr_nl *who,
static int do_show(int argc, char **argv)
{
if (rtnl_wilddump_req_filter_fn(&rth, AF_UNSPEC, RTM_GETLINK,
if (rtnl_linkdump_req_filter_fn(&rth, AF_UNSPEC,
tuntap_filter_req) < 0) {
perror("Cannot send dump request\n");
return -1;

View File

@ -163,7 +163,7 @@ main(int argc, char **argv)
if (rtnl_open(&rth, groups) < 0)
exit(1);
if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}

View File

@ -392,7 +392,7 @@ static int print_nlmsg_tunnel(const struct sockaddr_nl *who,
int do_tunnels_list(struct tnl_print_nlmsg_info *info)
{
if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, preferred_family) < 0) {
perror("Cannot send dump request\n");
return -1;
}

View File

@ -346,12 +346,12 @@ int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
int rtnl_linkdump_req(struct rtnl_handle *rth, int family)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
return rtnl_linkdump_req_filter(rth, family, RTEXT_FILTER_VF);
}
int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
int rtnl_linkdump_req_filter(struct rtnl_handle *rth, int family,
__u32 filt_mask)
{
struct {
@ -362,7 +362,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
__u32 ext_filter_mask;
} req = {
.nlh.nlmsg_len = sizeof(req),
.nlh.nlmsg_type = type,
.nlh.nlmsg_type = RTM_GETLINK,
.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
.nlh.nlmsg_seq = rth->dump = ++rth->seq,
.ifm.ifi_family = family,
@ -374,7 +374,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
return send(rth->fd, &req, sizeof(req), 0);
}
int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int family, int type,
int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int family,
req_filter_fn_t filter_fn)
{
struct {
@ -383,7 +383,7 @@ int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int family, int type,
char buf[1024];
} req = {
.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)),
.nlh.nlmsg_type = type,
.nlh.nlmsg_type = RTM_GETLINK,
.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
.nlh.nlmsg_seq = rth->dump = ++rth->seq,
.ifm.ifi_family = family,

View File

@ -218,7 +218,7 @@ void ll_init_map(struct rtnl_handle *rth)
if (initialized)
return;
if (rtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}

View File

@ -214,7 +214,7 @@ static void load_info(void)
exit(1);
}
} else {
if (rtnl_wilddump_request(&rth, AF_INET, RTM_GETLINK) < 0) {
if (rtnl_linkdump_req(&rth, AF_INET) < 0) {
perror("Cannot send dump request");
exit(1);
}