Some synthesis :
This man page describes the sockets interface which is used to configure network devices.
They pass an ifreq structure
SIOCGIFFLAGS, SIOCSIFFLAGS
Get or set the active flag word of the device. ifr_flags contains a bit mask. [IFF_*]
Setting the active flag word is a privileged operation, but any process may read it.
SIOCGIFADDR, SIOCSIFADDR
Get or set the address of the device using ifr_addr. Setting the interface address is a privileged operation. For compatibility, only AF_INET addresses are accepted or returned.
SIOCGIFDSTADDR, SIOCSIFDSTADDR
Get or set the destination address of a point-to-point device using ifr_dstaddr.
SIOCGIFBRDADDR, SIOCSIFBRDADDR
Get or set the broadcast address for a device using ifr_brdaddr.
SIOCGIFNETMASK, SIOCSIFNETMASK
Get or set the network mask for a device using ifr_netmask.
SIOCGIFMETRIC, SIOCSIFMETRIC
Get or set the metric of the device using ifr_metric. This is currently not implemented; it sets ifr_metric to 0 if you attempt to read it and returns EOPNOTSUPP if you attempt to set it.
[...]
SEE ALSO
proc(5), capabilities(7), ip(7), rtnetlink(7)
|