This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interface friendly names for AF_INET6




On 10/03/2016 14:49, Corinna Vinschen wrote:
On Mar 10 14:32, Corinna Vinschen wrote:
Hi Marco,


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

I assume the ifall structures are not visible outside cygwin internal, correct ?

If so a ifall_data pointer should cover my current trial.

Regards
Marco








--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]