What I think I'm going to do is split up the network interface list
code per variant.. will post a patch soon
( adam stokes ) || ( adam.stokes(a)gmail.com )
On Tue, Jan 4, 2011 at 7:10 PM, Adam Stokes <adam.stokes(a)gmail.com> wrote:
sigar enumerates pre-defined int's when doing a network list on
w32
for (i=0; i<ift->dwNumEntries; i++) {
char name[16];
int key;
MIB_IFROW *ifr = ift->table + i;
sigar_cache_entry_t *entry;
if (strEQ(ifr->bDescr, MS_LOOPBACK_ADAPTER)) {
/* special-case */
sprintf(name, NETIF_LA "%d", la++);
}
else if (ifr->dwType == MIB_IF_TYPE_LOOPBACK) {
sprintf(name, "lo%d", lo++);
}
else if ((ifr->dwType == MIB_IF_TYPE_ETHERNET) ||
(ifr->dwType == IF_TYPE_IEEE80211))
{
sprintf(name, "eth%d", eth++);
}
else {
continue; /*XXX*/
}
So rather than returning w32 friendly adapter name we are left with
things like ethX, loX, etc. The problem with this is that when
attempting to start/stop the network interfaces Windows has no idea
what eth0 is. The fix would be to pull the 'adaptername/friendlyname'
from the interface table structure but that requires getting the patch
accepted upstream. There is always the option of doing a one-off patch
and wouldn't require any additional testing.
thoughts?
( adam stokes ) || ( adam.stokes(a)gmail.com )