From 0e912b962c41798fe83a0194139f4f8e44c93092 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 18 Nov 2005 20:03:44 +0000 Subject: [PATCH] set net_interface_config.type --- src/os/darwin/darwin_sigar.c | 4 ++++ src/sigar_win32ish.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index d826ad16..6c1334fa 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -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); diff --git a/src/sigar_win32ish.c b/src/sigar_win32ish.c index b7363e71..ec48022c 100644 --- a/src/sigar_win32ish.c +++ b/src/sigar_win32ish.c @@ -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;