Expand description
Low-level Linux network device access
The methods in this module take a socket’s file descriptor to communicate with the kernel in their ioctl call:
- glibc uses an 
AF_UNIX,AF_INET, orAF_INET6socket. The address family itself does not matter and glibc tries the next address family if socket creation with one fails. - Android (bionic) uses an 
AF_INETsocket. - Both create the socket with 
SOCK_DGRAM|SOCK_CLOEXECtype/flag. - The manual pages specify that the ioctl calls “can be used on any socket’s file descriptor regardless of the family or type”.
 
§References
Structs§
- Inlined
Name  - The inlined interface name.
 
Functions§
- index_
to_ name  ioctl(fd, SIOCGIFNAME, ifreq)—Returns the interface name for a given index.- index_
to_ name_ inlined  ioctl(fd, SIOCGIFNAME, ifreq)—Returns the interface name for a given index.- name_
to_ index  ioctl(fd, SIOCGIFINDEX, ifreq)—Returns the interface index for a given name.