}
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) {
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);
}
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) {
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,
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;
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);
}
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;
}
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;
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);
}
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;
}
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 {
__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,
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 {
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,
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);
}
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);
}