set net_interface_config.type

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

No files matched your search

+4
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);