文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>netdevice(7) - Linux man page

netdevice(7) - Linux man page

时间:2009-04-30  来源:lxcrist

netdevice(7) - Linux man page

Name

netdevice - Low level access to Linux network devices

Synopsis

#include <sys/ioctl.h>
#include <net/if.h>

Description

This 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;

    };

};

struct ifconf {

    int                ifc_len; /* size of buffer */

    union {

        char *         ifc_buf; /* buffer address */

        struct ifreq * ifc_req; /* array of structures */

    };

};

Normally, the user specifies which device to affect by setting ifr_name to the name of the interface. All other members of the structure may share memory.

相关阅读 更多 +
排行榜 更多 +
摆个车游戏

摆个车游戏

休闲益智 下载
哈基跑酷最新版

哈基跑酷最新版

休闲益智 下载
冷血射手最新版

冷血射手最新版

休闲益智 下载