Subject: [netatalk-admins] interface code test
From: a sun (asun@cobalt.com)
Date: Tue Dec 14 1999 - 14:54:13 EST
hi all,
i'm making some changes to the interface detection code. if you would
send me results of the code snippet at the end, i would appreciate
it. i'm especially interested in knowing what the various solaris
versions do with it. here's the type of information that i would like:
os: linux 2.2 / glibc 2.1.1
results: compiles without problems. returns
iface: lo -> 1
iface: eth0 -> 2
iface: eth0:0 -> 2
#include <stdio.h>
#include <stdlib.h>
#include <net/if.h>
main()
{
struct if_nameindex *ifstart, *ifs;
ifstart = ifs = if_nameindex();
while (ifs && (ifs->if_name)) {
printf("iface: %s -> %u\n", ifs->if_name, ifs->if_index);
ifs++;
}
if_freenameindex(ifstart);
}
This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:17:34 EST