Ethernet interface names with cygwin 1.7.5
Mon Aug 9 09:36:00 GMT 2010
On Aug 9 11:03, email@example.com wrote:
> I am using a very simple to find all ethernet on my PC with cygwin :
> With cygwin 1.7.5 the result is :
> $ ./a.exe
> Interfaces (count = 5):
> MS TCP Loopback interface
> with release 1.5.25, the result was using the well-known names (lo0, eth0,
> eth1, etc...).
> How can retrieve the standard names with release 1.7.5 ? Is it a new
> naming convention ?
The problem with the well-known names is that they are not guaranteed to
be unique, because the order of the interfaces returned by the Windows
API can change arbitrarily.
Therefore Cygwin 1.7 starts to return the really unique Win32 interface
names, which are the above UUID-based names (plus the old "MS TCP Loopback"
The uniqueness of the interface name is quite important in a couple of
circumstances, so, starting wit Windows XP, there's no way anymore to
retrieve the old well-known names since they are just not generated.
What's left is a Cygwin-specific extension, the SIOCGIFFRNDLYNAM ioctl,
which is documented in /usr/include/cygwin/if.h, see the comment
preceeding the definition of IFRF_FRIENDLYNAMESIZ. This extension
returns the so-called "FriendlyName", which is the interface name as
shown in the Windows network properties.
Btw., Cygwin 1.7 also has the getifaddrs/freeifaddrs API to retrieve
the interface list (and the /proc/net/if_inet6 file).
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin