add net_interface_stat.speed for solaris

This commit is contained in:
Doug MacEachern 2006-03-07 01:20:58 +00:00
parent 9f5ad58812
commit ce71b968c6
3 changed files with 20 additions and 0 deletions

View File

@ -182,6 +182,7 @@ static char *kstat_keys_hme[] = {
"oflo", /* TX_OVERRUNS */
"collisions", /* TX_COLLISIONS */
"nocarrier", /* TX_CARRIER */
"ifspeed", /* SPEED */
NULL
};
@ -199,6 +200,7 @@ static char *kstat_keys_dmfe[] = {
"oflo", /* TX_OVERRUNS */
"collisions", /* TX_COLLISIONS */
"nocarrier", /* TX_CARRIER */
"ifspeed", /* SPEED */
NULL
};
@ -216,6 +218,7 @@ static char *kstat_keys_ge[] = {
"toolong_errors", /* TX_OVERRUNS */
"collisions", /* TX_COLLISIONS */
"nocarrier", /* TX_CARRIER */
"ifspeed", /* SPEED */
NULL
};
@ -233,6 +236,7 @@ static char *kstat_keys_eri[] = {
"rx_overflow", /* TX_OVERRUNS */
"collisions", /* TX_COLLISIONS */
"nocarrier", /* TX_CARRIER */
"ifspeed", /* SPEED */
NULL
};

View File

@ -79,6 +79,7 @@ typedef enum {
KSTAT_HME_TX_OVERRUNS,
KSTAT_HME_TX_COLLISIONS,
KSTAT_HME_TX_CARRIER,
KSTAT_HME_SPEED,
KSTAT_HME_MAX
} kstat_hme_off_e;
@ -96,6 +97,7 @@ typedef enum {
KSTAT_DMFE_TX_OVERRUNS,
KSTAT_DMFE_TX_COLLISIONS,
KSTAT_DMFE_TX_CARRIER,
KSTAT_DMFE_SPEED,
KSTAT_DMFE_MAX
} kstat_dmfe_off_e;
@ -113,6 +115,7 @@ typedef enum {
KSTAT_GE_TX_OVERRUNS,
KSTAT_GE_TX_COLLISIONS,
KSTAT_GE_TX_CARRIER,
KSTAT_GE_SPEED,
KSTAT_GE_MAX
} kstat_ge_off_e;
@ -130,6 +133,7 @@ typedef enum {
KSTAT_ERI_TX_OVERRUNS,
KSTAT_ERI_TX_COLLISIONS,
KSTAT_ERI_TX_CARRIER,
KSTAT_ERI_SPEED,
KSTAT_ERI_MAX
} kstat_eri_off_e;

View File

@ -1661,6 +1661,7 @@ static int sigar_net_ifstat_get_hme(sigar_t *sigar, const char *name,
ifstat->tx_overruns = kHME(KSTAT_HME_TX_OVERRUNS); /*XXX*/
ifstat->tx_collisions = kHME(KSTAT_HME_TX_COLLISIONS);
ifstat->tx_carrier = kHME(KSTAT_HME_TX_CARRIER);
ifstat->speed = kHME(KSTAT_HME_SPEED);
return SIGAR_OK;
}
@ -1700,6 +1701,8 @@ static int sigar_net_ifstat_get_dmfe(sigar_t *sigar, const char *name,
ifstat->tx_collisions = kDMFE(KSTAT_DMFE_TX_COLLISIONS);
ifstat->tx_carrier = kDMFE(KSTAT_DMFE_TX_CARRIER);
ifstat->speed = kDMFE(KSTAT_DMFE_SPEED);
return SIGAR_OK;
}
@ -1738,6 +1741,8 @@ static int sigar_net_ifstat_get_ge(sigar_t *sigar, const char *name,
ifstat->tx_collisions = kGE(KSTAT_GE_TX_COLLISIONS);
ifstat->tx_carrier = kGE(KSTAT_GE_TX_CARRIER);
ifstat->speed = kGE(KSTAT_GE_SPEED);
return SIGAR_OK;
}
@ -1776,6 +1781,8 @@ static int sigar_net_ifstat_get_eri(sigar_t *sigar, const char *name,
ifstat->tx_collisions = kERI(KSTAT_ERI_TX_COLLISIONS);
ifstat->tx_carrier = kERI(KSTAT_ERI_TX_CARRIER);
ifstat->speed = kERI(KSTAT_ERI_SPEED);
return SIGAR_OK;
}
@ -1816,6 +1823,8 @@ static int sigar_net_ifstat_get_lo(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;
}
@ -1848,6 +1857,9 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
else if (strEQ(ptr, "ierrors")) {
ifstat->rx_errors = value;
}
else if (strEQ(ptr, "ifspeed")) {
ifstat->speed = value;
}
break;
case 'f':
if (strEQ(ptr, "framing")) {