Chinaunix首页 | 论坛 | 博客
  • 博客访问: 192452
  • 博文数量: 73
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 1160
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-23 15:53
文章分类

全部博文(73)

文章存档

2011年(1)

2009年(72)

我的朋友

分类: LINUX

2009-04-30 14:07:25

netdevice(7) - Linux man page

Name

netdevice - Low level access to Linux network devices

Synopsis

#include <>
#include <>

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.

阅读(934) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~