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 Mar 10 14:32, Corinna Vinschen wrote:
> Hi Marco,
> On Mar 10 12:10, Marco Atzeri wrote:
> > I am trying to put a small interface info tool
> > to debug some hangs reported on openmpi.
> > 
> > The aim is to produce something like
> > 
> > {9F4F7FD2-5E44-4796-ABE0-0785CF76C11E} AF_INET6 (23)
> >         flags: up running multicast
> >         address: <fe80::9953:b1f5:a643:4497%15>
> >         Local Area Connection
> > {9F4F7FD2-5E44-4796-ABE0-0785CF76C11E} AF_INET (2)
> >         flags: up broadcast running multicast
> >         address: <>
> >         Local Area Connection
> > 
> > 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 Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature

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