Maintainer notes

Miscellaneous details.

Networking

Linux supports if_nameindex which is in POSIX net/if.h and returns an array of if_nameindex with fields if_index and if_name (at least). Indices are positive integers, names are stuff like lo and eth0 as displayed by /sbin/ifconfig; this isn't actually useful for our needs, as it doesn't connect to IP addresses.

Ulrich Drepper said that SIOCGIFCONF only returns active interfaces (but this is apparently actually a bug), while SIOCGIF{NAME,INDEX} can query all defined interfaces, even ones that are currently down. A reply to that pointed to netlink facilities, for which socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE) sounds like it may give us something to select on to discover when interface changes happen. The disussion also mentions rtnetlink, which is a sub-set of the netlink messages.

Elsewhere I find reference to sysctl() for BSD and Sun—my Linux man pages only mention sysctl as a system command (section 8) and its config file (section 5, /etc/sysctl.conf). This also discusses struct ifreq, as used on Linux, except that it doesn't have a .ifr_flags, so it's a different structure; the one on Linux has far more details (see net/if.h, near its end).

RFC 2553 specifies lots of details about IPv6 and integration with existing networking infrastructure. Details include:

Android's C library has limitations, notably a lack of condition variables in its pthread implementation, which I'll need to work round. It also mentions some interesting-sounding timer functions: timer_create(), timer_gettime(), timer_settime() and timer_getoverrun(), which appear to be POSIX.

Experiment with python's netifaces module reveals interfaces in family AF_PACKET = 17 = AF_LINK may exist, as well as the more familiar AF_INET = 2 and AF_INET6 = 10.

TODO

Edward Welbourne