|
SIOCGIFNAME |
| |
Given the
ifr_ifindex, return the name of the interface in
ifr_name. This is the only ioctl which returns its result in
ifr_name.
|
|
SIOCGIFINDEX |
| |
Retrieve the interface index of the interface into
ifr_ifindex.
|
|
SIOCGIFFLAGS, SIOCSIFFLAGS |
| |
Get or set the active flag word of the device.
ifr_flags contains a bitmask of the following values:
| Device flags |
| IFF_UP | Interface is running. |
| IFF_BROADCAST | Valid broadcast address set. |
| IFF_DEBUG | Internal debugging flag. |
| IFF_LOOPBACK | Interface is a loopback interface. |
| IFF_POINTOPOINT | Interface is a point-to-point link. |
| IFF_RUNNING | Resources allocated. |
| IFF_NOARP | No arp protocol, L2 destination address not set. |
| IFF_PROMISC | Interface is in promiscuous mode. |
| IFF_NOTRAILERS | Avoid use of trailers. |
| IFF_ALLMULTI | Receive all multicast packets. |
| IFF_MASTER | Master of a load balancing bundle. |
| IFF_SLAVE | Slave of a load balancing bundle. |
| IFF_MULTICAST | Supports multicast |
| IFF_PORTSEL | Is able to select media type via ifmap. |
| IFF_AUTOMEDIA | Auto media selection active. |
| IFF_DYNAMIC | The addresses are lost when the interface goes down.
|
Setting the active flag word is a privileged operation, but any
process may read it.
|
|
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.
|
|
SIOCGIFMTU, SIOCSIFMTU |
| |
Get or set the MTU (Maximum Transfer Unit) of a device using
ifr_mtu. Setting the MTU is a privileged operation. Setting the MTU to
too small values may cause kernel crashes.
|
|
SIOCGIFHWADDR, SIOCSIFHWADDR |
| |
Get or set the hardware address of a device using
ifr_hwaddr. The hardware address is specified in a struct
sockaddr.
sa_family contains the ARPHRD_* device type,
sa_data the L2 hardware address starting from byte 0.
Setting the hardware address is a privileged operation.
|
|
SIOCSIFHWBROADCAST |
| |
Set the hardware broadcast address of a device from
ifr_hwaddr. This is a privileged operation.
|
|
SIOCGIFMAP, SIOCSIFMAP |
| |
Get or set the interfaces hardware parameters using
ifr_map. Setting the parameters is a privileged operation.
struct ifmap {
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
};
The interpretation of the ifmap structure depends on the device driver
and the architecture.
|
|
SIOCADDMULTI, SIOCDELMULTI |
| |
Add an address to or delete an address from the devices link layer
multicast filters using
ifr_hwaddr. These are privileged operations.
See also
packet(7)
for an alternative.
|
|
SIOCGIFTXQLEN, SIOCSIFTXQLEN |
| |
Get or set the transmit queue length of a device using
ifr_qlen. Setting the transmit queue length is a privileged operation.
|
|
SIOCSIFNAME |
| |
Changes the name of the interface specified in
ifr_name to
ifr_newname. This is a privileged operation. It is only allowed when the interface
is not up.
|
|
SIOCGIFCONF |
| |
Return a list of interface (transport layer) addresses. This currently
means only addresses of the AF_INET (IPv4) family for compatibility.
The user passes a
ifconf structure as argument to the ioctl. It contains a pointer to an array of
ifreq structures in
ifc_req and its length in bytes in
ifc_len. The kernel fills the ifreqs with all current L3 interface addresses that
are running:
ifr_name contains the interface name (eth0:1 etc.),
ifr_addr the address.
The kernel returns with the actual length in
ifc_len. If
ifc_len is equal to the original length the buffer probably has overflowed
and you should retry with a bigger buffer to get all addresses.
When no error occurs the ioctl returns 0;
otherwise -1. Overflow is not an error.
|
|
Most protocols support their own ioctls to configure protocol specific
interface options. See the protocol man pages for a description.
For configuring IP addresses see
In addition some devices support private ioctls.
These are not described here.