diff --git a/include/sigar.h b/include/sigar.h index 065e3482..edfd6e15 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -491,7 +491,8 @@ typedef struct { tx_dropped, tx_overruns, tx_collisions, - tx_carrier; + tx_carrier, + speed; } sigar_net_interface_stat_t; SIGAR_DECLARE(int) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 0c0470db..4d312c50 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -2140,6 +2140,8 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_collisions = data.if_collisions; ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; + ifstat->speed = SIGAR_FIELD_NOTIMPL; + return SIGAR_OK; } diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 76180013..2d4fe1f3 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -1840,6 +1840,8 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_overruns = SIGAR_FIELD_NOTIMPL; ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; + ifstat->speed = SIGAR_FIELD_NOTIMPL; + return SIGAR_OK; } diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 8719857c..b298d475 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -786,6 +786,8 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_collisions = SIGAR_FIELD_NOTIMPL; ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; + ifstat->speed = SIGAR_FIELD_NOTIMPL; + return SIGAR_OK; } diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index 22aeb1d8..329373bd 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1625,6 +1625,9 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_overruns = sigar_strtoul(ptr); ifstat->tx_collisions = sigar_strtoul(ptr); ifstat->tx_carrier = sigar_strtoul(ptr); + + ifstat->speed = SIGAR_FIELD_NOTIMPL; + break; } diff --git a/src/os/netware/netware_sigar.c b/src/os/netware/netware_sigar.c index 2ee9e6ce..bf7a556b 100644 --- a/src/os/netware/netware_sigar.c +++ b/src/os/netware/netware_sigar.c @@ -391,6 +391,8 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_collisions = -1; ifstat->tx_carrier = -1; + ifstat->speed = SIGAR_FIELD_NOTIMPL; + return SIGAR_OK; } diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c index 8ab8ddfa..4c54b815 100644 --- a/src/os/osf1/osf1_sigar.c +++ b/src/os/osf1/osf1_sigar.c @@ -522,6 +522,8 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_collisions = SIGAR_FIELD_NOTIMPL; ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; + ifstat->speed = SIGAR_FIELD_NOTIMPL; + return SIGAR_OK; } diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 9bbd089f..21196a4b 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -1944,6 +1944,8 @@ static int sigar_net_ifstat_get_any(sigar_t *sigar, const char *name, int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, sigar_net_interface_stat_t *ifstat) { + ifstat->speed = SIGAR_FIELD_NOTIMPL; + switch (*name) { case 'd': if (strnEQ(name, "dmfe", 4)) { diff --git a/src/os/stub/stub_sigar.c b/src/os/stub/stub_sigar.c index cc80a59c..e6d7ef7b 100644 --- a/src/os/stub/stub_sigar.c +++ b/src/os/stub/stub_sigar.c @@ -251,6 +251,7 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_overruns = -1; ifstat->tx_collisions = -1; ifstat->tx_carrier = -1; + ifstat->speed = -1; return SIGAR_OK; } diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index 050331a4..77081fcd 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -2018,6 +2018,8 @@ sigar_net_interface_stat_get(sigar_t *sigar, const char *name, ifstat->tx_collisions = SIGAR_FIELD_NOTIMPL; ifstat->tx_carrier = SIGAR_FIELD_NOTIMPL; + ifstat->speed = ifr->dwSpeed; + return SIGAR_OK; }