| Red Hat Documentation: man pages: man7: Linux Programmer's Manual (7) |
NETDEVICESection: Linux Programmer's Manual (7)Updated: 2 May 2025 Index NAMEnetdevice - Low level access to Linux network devices.SYNOPSIS#include <net/if.h>DESCRIPTIONThis man page describes the sockets interface which is used to configure network devices.Linux supports some standard ioctls to configure network devices. They can be used on any socket's file descriptor regardless of the family or type. They pass an ifreq structure:
struct ifreq
{
char ifr_name[IFNAMSIZ]; /* Interface name */
union {
struct sockaddr ifr_addr;
struct sockaddr ifr_dstaddr;
struct sockaddr ifr_broadaddr;
struct sockaddr ifr_netmask;
struct sockaddr ifr_hwaddr;
short ifr_flags;
int ifr_ifindex;
int ifr_metric;
int ifr_mtu;
struct ifmap ifr_map;
char ifr_slave[IFNAMSIZ];
char ifr_newname[IFNAMSIZ];
char * ifr_data;
};
}
Normally, the ioctl specifies which device to affect by setting ifr_name to the name of the interface. All other members of the structure may share memory. IOCTLSIf an ioctl is marked as privileged then using it requires an effective user id of 0 or the CAP_NET_ADMIN capability. If this is not the case EPERM will be returned.
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.
IndexThis document was created by using the manual pages. Time: 12:14:03 GMT, March 24, 2025 |
||||||||||||||||||||||||||||||||||||
|
© 2001 Red Hat, Inc. All rights reserved. About Red Hat : Legal statement : Privacy statement : Y2K statement : Contact Red Hat |