diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-12-13 10:24:26 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2016-12-13 11:50:49 +0100 |
commit | af8923b779898033a9237e36a78c96f2d7e4d0bf (patch) | |
tree | fbaa5780e60bbc9aaf575a8a23ba67f727bac4e9 | |
parent | 3e4970485dccdbaf046eb71482ad62c8f3a73f7a (diff) |
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>
-rw-r--r-- | src/in_netlink.c | 13 |
1 files changed, 13 insertions, 0 deletions
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", @@ -102,6 +107,14 @@ static struct attr_map link_attrs[] = { .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, .unit = UNIT_NUMBER, |