tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SIOCGIFMAC / SIOCGIFHWADDR ioctl?



nia%NetBSD.org@localhost (nia) writes:

>I am working on porting some code from Linux / macOS / FreeBSD.

>It does this:

>#ifdef FREEBSD
>	if (ioctl(sock, SIOCGIFMAC, &ifr) == 0)
>#else  
>	if (ioctl(sock, SIOCGIFHWADDR, &ifr) == 0)
>#endif

>Do we have an equivalent to this ioctl?

getifaddrs() returns all addresses of an interface including those for
AF_LINK.

ifconfig(8) validates these by calling SIGCGLIFADDR on them.




Home | Main Index | Thread Index | Old Index