From a556c5e839bcdf1627e4214bc8bea747d3576a95 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 4 Sep 2005 01:32:42 +0000 Subject: [PATCH] get mac address for netware --- src/sigar_win32ish.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/sigar_win32ish.c b/src/sigar_win32ish.c index d24bfb92..01971917 100644 --- a/src/sigar_win32ish.c +++ b/src/sigar_win32ish.c @@ -13,6 +13,7 @@ #include #include #include +#include #endif int sigar_get_iftype(const char *name, int *type, int *inst) @@ -102,7 +103,14 @@ static void hwaddr_lookup(sigar_net_interface_config_t *ifconfig, int num) static void hwaddr_lookup(sigar_net_interface_config_t *ifconfig, int num) { - sigar_hwaddr_set_null(ifconfig); + uint8_t addr[6]; + + if (netware_net_macaddr(num, addr) == 0) { + sigar_hwaddr_format(ifconfig->hwaddr, addr); + } + else { + sigar_hwaddr_set_null(ifconfig); + } } #endif /* WIN32 */ @@ -216,7 +224,11 @@ sigar_net_interface_config_get(sigar_t *sigar, ifconfig->flags |= SIGAR_IFF_LOOPBACK; ifconfig->destination = ifconfig->address; ifconfig->broadcast = 0; +#ifdef NETWARE + hwaddr_lookup(ifconfig, i+1); +#else sigar_hwaddr_set_null(ifconfig); +#endif } else { hwaddr_lookup(ifconfig, i);