tech-net archive

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

Re: SIOCGIFMAC / SIOCGIFHWADDR ioctl? (nia) writes:

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

>It does this:

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

>Do we have an equivalent to this ioctl?

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

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

Home | Main Index | Thread Index | Old Index