I am using getifaddrs to obtain all the AF_INET and AF_INET6
interface, however I can only obtain the friendly name of the
AF_INET using
ioctl(sock, SIOCGIFFRNDLYNAM
getifaddrs should return the friendly name. Strruct ifall
has a member ifa_frndlyname, type struct ifreq_frndlyname,
which is filled for AF_INET and AF_INET6 interfaces.
Oh, I see. The friendlyname is there, but struct ifaddrs is missing a
pointer to it. That's the confusion you get when reusing the same
function and structure type for multiple APIs.
This could be easily rectified by utilizing the ifa_data pointer which
is unused so far. It could point to a structure pointing to the other
values collected but not yet exposed by getifaddrs, e.g.:
struct ifall_data
{
struct sockaddr ifa_hwaddr;
int ifa_metric;
int ifa_mtu;
int ifa_ifindex;
struct ifreq_frndlyname ifa_frndlyname;
};
ifa_data = pointer to ifall_data;
Would that help to get this into Cygwin 2.5.0?
Corinna