Commit bd886ebb authored by Rose, Gregory V's avatar Rose, Gregory V Committed by Stephen Hemminger

iproute2: Add netlink attribute to filter dump requests

Add a new netlink attribute type to the dump request to allow
filtering of the information returned for the respective matching
interfaces.  At this time the only filter defined is to request
virtual function (VF) device info for interfaces that attached VFs.

It will also be possible to extend the request with other yet to be
defined netlink attributes in the future.
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
parent 29cea29d
......@@ -94,6 +94,9 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
struct {
struct nlmsghdr nlh;
struct rtgenmsg g;
__u16 align_rta; /* attribute has to be 32bit aligned */
struct rtattr ext_req;
__u32 ext_filter_mask;
} req;
memset(&req, 0, sizeof(req));
......@@ -104,6 +107,10 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
req.g.rtgen_family = family;
req.ext_req.rta_type = IFLA_EXT_MASK;
req.ext_req.rta_len = RTA_LENGTH(sizeof(__u32));
req.ext_filter_mask = RTEXT_FILTER_VF;
return send(rth->fd, (void*)&req, sizeof(req), 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment