Interface friendly names for AF_INET6

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Mar 10 17:41:00 GMT 2016


On Mar 10 15:30, Marco Atzeri wrote:
> 
> 
> 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.

Try the latest snapshot.  The ifa_data member now contains a pointer
to a struct ifa_hwdata which is defined in <ifaddrs.h>.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160310/7ed63f3d/attachment.sig>


More information about the Cygwin mailing list