netlink: Add rx_nohandler link stat counter

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>
This commit is contained in:
Tobias Klauser 2016-12-13 10:24:26 +01:00 committed by Thomas Graf
parent 3e4970485d
commit af8923b779

View File

@ -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",
@ -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,