netdevice - Low level access to Linux network devices.
Valid other members:
struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; struct sockaddr ifru_netmask; struct sockaddr ifru_hwaddr; short ifru_flags; int ifru_ivalue; int ifru_mtu; struct ifmap ifru_map; char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_newname[IFNAMSIZ]; char * ifru_data;
Privileged means that using the ioctl requires an effective user id of 0 or the CAP_NET_ADMIN capability. If this is not the case EPERM will be returned.
| Network device ioctls | | |
| Name:ifreq member:Purpose | ||
| SIOCGIFNAME:ifr_ifindex:T{ | ||
| Return the name of the passed interface index. | ||
| T} | ||
| SIOCGIFFLAGS:ifr_flags:T{ | ||
| Get the active flag word of a device. See below for valid flags. | ||
| T} | ||
| SIOCSIFFLAGS:ifr_flags:T{ | ||
| Set the active flag word of a device. See below for valid flags. | ||
| Privileged. | ||
| T} | ||
| SIOCGIFMETRIC:ifr_metric:T{ | ||
| Get the metric of a device. Currently not implemented. Returns always 0. | ||
| T} | ||
| SIOCSIFMETRIC:ifr_metric:T{ | ||
| Set the metric of a device. Currently not implemented and returns EOPNOTSUPP. | ||
| T} | ||
| SIOCSIFMTU:ifr_mtu:T{ | ||
| Set the MTU (Maximum Transfer Unit) of a device. | ||
| Privileged. | ||
| T} | ||
| SIOCGIFMTU:ifr_mtu:T{ | ||
| Get the MTU (Maximum Transfer Unit) of a device. | ||
| T} | ||
| SIOCGIFHWADDR:ifr_hwaddr:T{ | ||
| Get the hardware address of a device. | ||
| T} | ||
| SIOCSIFHWADDR:ifr_hwaddr:T{ | ||
| Set the hardware address of a device. Only implemented on a few devices. | ||
| Privileged. | ||
| T} | ||
| SIOCSIFHW BROADCAST | ifr_hwaddr:T{ | |
| Set the hardware broadcast address of a device. | ||
| Privileged. | ||
| T} | ||
| SIOCADDMULTI:ifr_hwaddr:T{ | ||
| Add an address to device's link layer multicast filters. | ||
| Privileged. | ||
| T} | ||
| SIOCDELMULTI:ifr_hwaddr:T{ | ||
| Remove an address from the device's link layer multicast filters. | ||
| Privileged. | ||
| T} | ||
| SIOCGIFINDEX:ifr_ifindex:T{ | ||
| Retrieve the interface index of an interface. | ||
| T} | ||
| SIOCGIFTXQLEN:ifr_qlen:T{ | ||
| Get the transmit queue length of a device. | ||
| T} | ||
| SIOCSIFTXQLEN:ifr_qlen:T{ | ||
| Set the transmit queue length of a device. | ||
| Privileged. | ||
| T} | ||
| SIOCSIFNAME:ifr_newname :T{ | ||
| Change the name of a device. Privileged. | ||
| T} | ||
| 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 |
| 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 | Interface Address is not permanent. |
Most protocols support their own ioctls to configure protocol specific interface options. See the protocol man pages for a description.
In addition some devices support private ioctls. These are not described here.
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |