add net_interface_stat.speed

This commit is contained in:
Doug MacEachern 2006-03-07 01:08:23 +00:00
parent 372c09119d
commit 9f5ad58812
10 changed files with 20 additions and 1 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)) {

View File

@ -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;
}

View File

@ -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;
}