set net_interface_config.type

This commit is contained in:
Doug MacEachern 2005-11-18 20:03:44 +00:00
parent ab3c15d2e7
commit 0e912b962c
2 changed files with 8 additions and 0 deletions

View File

@ -1637,6 +1637,8 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
if (ifconfig->flags & IFF_LOOPBACK) {
ifconfig->destination = ifconfig->address;
ifconfig->broadcast = 0;
SIGAR_SSTRCPY(ifconfig->type,
SIGAR_NIC_LOOPBACK);
}
else {
if (!ioctl(sock, SIOCGIFDSTADDR, &ifr)) {
@ -1646,6 +1648,8 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
if (!ioctl(sock, SIOCGIFBRDADDR, &ifr)) {
ifconfig->broadcast = ifr_s_addr(ifr);
}
SIGAR_SSTRCPY(ifconfig->type,
SIGAR_NIC_ETHERNET);
}
close(sock);

View File

@ -229,9 +229,13 @@ sigar_net_interface_config_get(sigar_t *sigar,
#else
sigar_hwaddr_set_null(ifconfig);
#endif
SIGAR_SSTRCPY(ifconfig->type,
SIGAR_NIC_LOOPBACK);
}
else {
hwaddr_lookup(ifconfig, i);
SIGAR_SSTRCPY(ifconfig->type,
SIGAR_NIC_ETHERNET);
}
if (flags & IFF_POINTTOPOINT) {
ifconfig->flags |= SIGAR_IFF_POINTOPOINT;