get mac address for netware

This commit is contained in:
Doug MacEachern 2005-09-04 01:32:42 +00:00
parent ff4d75d357
commit a556c5e839
1 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <novsock2.h> #include <novsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <monitor.h>
#endif #endif
int sigar_get_iftype(const char *name, int *type, int *inst) 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) static void hwaddr_lookup(sigar_net_interface_config_t *ifconfig, int num)
{ {
uint8_t addr[6];
if (netware_net_macaddr(num, addr) == 0) {
sigar_hwaddr_format(ifconfig->hwaddr, addr);
}
else {
sigar_hwaddr_set_null(ifconfig); sigar_hwaddr_set_null(ifconfig);
}
} }
#endif /* WIN32 */ #endif /* WIN32 */
@ -216,7 +224,11 @@ sigar_net_interface_config_get(sigar_t *sigar,
ifconfig->flags |= SIGAR_IFF_LOOPBACK; ifconfig->flags |= SIGAR_IFF_LOOPBACK;
ifconfig->destination = ifconfig->address; ifconfig->destination = ifconfig->address;
ifconfig->broadcast = 0; ifconfig->broadcast = 0;
#ifdef NETWARE
hwaddr_lookup(ifconfig, i+1);
#else
sigar_hwaddr_set_null(ifconfig); sigar_hwaddr_set_null(ifconfig);
#endif
} }
else { else {
hwaddr_lookup(ifconfig, i); hwaddr_lookup(ifconfig, i);