From af8923b779898033a9237e36a78c96f2d7e4d0bf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 13 Dec 2016 10:24:26 +0100 Subject: 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 --- src/in_netlink.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/in_netlink.c b/src/in_netlink.c index ef98ae0..4b5e3b1 100644 --- a/src/in_netlink.c +++ b/src/in_netlink.c @@ -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, -- cgit v1.2.3