Skip to content

Commit

Permalink
netlink: Add rx_nohandler link stat counter
Browse files Browse the repository at this point in the history
Hook up the device rx nohandler stat counter available in the upcoming
libnl 3.2.29, added in libnl commit 5040fc8a4994 ("lib/route: add
rx_nohandler link stats field").

Also add a compatibility define, so older libnl version will still work
fine.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
  • Loading branch information
tklauser authored and tgraf committed Dec 13, 2016
1 parent 3e49704 commit af8923b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/in_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ static struct bmon_module netlink_ops;
# define RTNL_LINK_IP6_CEPKTS -1
#endif

/* Not available prior to libnl 3.2.29 */
#if LIBNL_CURRENT < 224
# define RTNL_LINK_RX_NOHANDLER -1
#endif

static struct attr_map link_attrs[] = {
{
.name = "bytes",
Expand Down Expand Up @@ -101,6 +106,14 @@ static struct attr_map link_attrs[] = {
.rxid = RTNL_LINK_RX_COMPRESSED,
.txid = RTNL_LINK_TX_COMPRESSED,
},
{
.name = "nohandler",
.type = ATTR_TYPE_COUNTER,
.unit = UNIT_NUMBER,
.description = "No Handler",
.rxid = RTNL_LINK_RX_NOHANDLER,
.txid = -1,
},
{
.name = "fifoerr",
.type = ATTR_TYPE_COUNTER,
Expand Down

0 comments on commit af8923b

Please sign in to comment.