Pegasus InfoCorp: Web site design and web software development company

NETDEVICE (4)

Low level access to Linux network devices.

SYNOPSIS

    #include <net/if.h>

DESCRIPTION

    This man page describes the common to all protocol families sockets interface that is used to configure network devices. All network devices have an unique interface index.

IOCTLS

    Linux netdevices support some standard ioctls to configure devices. They can be used on any socket's file descriptor regardless of the family or type. They read or write an ifreq structure. ifreq contains the char ifr_name[IFNAMSIZ] string member which contains the name of the interface and another member depending on the ioctl type.

    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;
      

    Note that these overlap and only one of them can be accessed at once.

    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.