summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2014-12-16 18:30:53 +0100
committerThomas Graf <tgraf@suug.ch>2014-12-16 18:31:27 +0100
commit0100916a952b40828d8d8bfd7aadaffee945c2d1 (patch)
treee6003c789b66ffc79f09eb81b0d12c74626e3dd7
parentea065c5619aefa81a17d1225e62c10b20da4632d (diff)
BSD: Provide minimal interface information
Including: - MTU - Metric - RX/TX IRQ Quota Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r--src/in_sysctl.c13
1 files changed, 13 insertions, 0 deletions
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);
}