The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

netdevice (4)
  • >> netdevice (4) ( Linux man: Специальные файлы /dev/* )
  • netdevice (7) ( Русские man: Макропакеты и соглашения )
  • netdevice (7) ( Linux man: Макропакеты и соглашения )
  •  

    NAME

    netdevice - 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.

    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_UPInterface is running.
    IFF_BROADCASTValid broadcast address set.
    IFF_DEBUGInternal debugging flag.
    IFF_LOOPBACKInterface is a loopback interface.
    IFF_POINTOPOINTInterface is a point-to-point link.
    IFF_RUNNINGResources allocated.
    IFF_NOARPNo arp protocol
    IFF_PROMISCInterface is in promiscuous mode.
    IFF_NOTRAILERSAvoid use of trailers.
    IFF_ALLMULTIReceive all multicast packets.
    IFF_MASTERMaster of a load balancing bundle.
    IFF_SLAVESlave of a load balancing bundle.
    IFF_MULTICASTSupports multicast
    IFF_PORTSELIs able to select media type via ifmap.
    IFF_AUTOMEDIAAuto media selection active.
    IFF_DYNAMICInterface 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.


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    IOCTLS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру