add net_interface_config.speed

This commit is contained in:
Doug MacEachern 2006-03-05 02:22:01 +00:00
parent 81a29ba2a2
commit be0dd1c35e
5 changed files with 7 additions and 1 deletions

View File

@ -467,7 +467,8 @@ typedef struct {
netmask,
flags,
mtu,
metric;
metric,
speed;
} sigar_net_interface_config_t;
SIGAR_DECLARE(int)

View File

@ -1756,6 +1756,7 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
ifm = iter.data.ifm;
SIGAR_SSTRCPY(ifconfig->name, name);
ifconfig->speed = SIGAR_FIELD_NOTIMPL;
sdl = (struct sockaddr_dl *)(ifm + 1);
sigar_hwaddr_format(ifconfig->hwaddr,

View File

@ -1981,6 +1981,7 @@ int sigar_get_ifentry_config(sigar_t *sigar,
}
ifconfig->mtu = ifr->dwMtu;
ifconfig->speed = ifr->dwSpeed;
sigar_hwaddr_format(ifconfig->hwaddr,
ifr->bPhysAddr);

View File

@ -1206,6 +1206,7 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
SIGAR_SSTRCPY(ifconfig->name, name);
SIGAR_SSTRCPY(ifr.ifr_name, name);
ifconfig->speed = SIGAR_FIELD_NOTIMPL;
#define ifr_s_addr(ifr) \
((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr

View File

@ -256,6 +256,8 @@ sigar_net_interface_config_get(sigar_t *sigar,
SIGAR_SSTRCPY(ifconfig->description,
ifconfig->name);
ifconfig->speed = SIGAR_FIELD_NOTIMPL;
hwaddr_lookup(sigar, ifconfig, i);
if (flags & IFF_POINTTOPOINT) {