From 0100916a952b40828d8d8bfd7aadaffee945c2d1 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 16 Dec 2014 18:30:53 +0100 Subject: BSD: Provide minimal interface information Including: - MTU - Metric - RX/TX IRQ Quota Signed-off-by: Thomas Graf --- src/in_sysctl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/in_sysctl.c b/src/in_sysctl.c index 6583574..ff71b4d 100644 --- a/src/in_sysctl.c +++ b/src/in_sysctl.c @@ -163,6 +163,7 @@ sysctl_read(void) struct element *e, *e_parent = NULL; struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; + char info_buf[64]; ifm = (struct if_msghdr *) next; if (ifm->ifm_type != RTM_IFINFO) @@ -225,6 +226,18 @@ sysctl_read(void) attr_update(e, m->attrid, rx, tx, flags); } + snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_mtu); + element_update_info(e, "MTU", info_buf); + + snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_metric); + element_update_info(e, "Metric", info_buf); + + snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_recvquota); + element_update_info(e, "RX-Quota", info_buf); + + snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_xmitquota); + element_update_info(e, "TX-Quota", info_buf); + element_notify_update(e, NULL); element_lifesign(e, 1); } -- cgit v1.2.3