10 #define IF_NAMESIZE 16
14 unsigned int if_index;
18 unsigned int if_nametoindex (const char *);
19 char *if_indextoname (unsigned int, char *);
20 struct if_nameindex *if_nameindex (void);
21 void if_freenameindex (struct if_nameindex *);
26 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
28 #include <sys/socket.h>
31 #define IFF_BROADCAST 0x2
33 #define IFF_LOOPBACK 0x8
34 #define IFF_POINTOPOINT 0x10
35 #define IFF_NOTRAILERS 0x20
36 #define IFF_RUNNING 0x40
37 #define IFF_NOARP 0x80
38 #define IFF_PROMISC 0x100
39 #define IFF_ALLMULTI 0x200
40 #define IFF_MASTER 0x400
41 #define IFF_SLAVE 0x800
42 #define IFF_MULTICAST 0x1000
43 #define IFF_PORTSEL 0x2000
44 #define IFF_AUTOMEDIA 0x4000
45 #define IFF_DYNAMIC 0x8000
46 #define IFF_LOWER_UP 0x10000
47 #define IFF_DORMANT 0x20000
48 #define IFF_ECHO 0x40000
49 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST| \
50 IFF_ECHO|IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
53 struct sockaddr ifa_addr;
55 struct sockaddr ifu_broadaddr;
56 struct sockaddr ifu_dstaddr;
58 struct iface *ifa_ifp;
59 struct ifaddr *ifa_next;
62 #define ifa_broadaddr ifa_ifu.ifu_broadaddr
63 #define ifa_dstaddr ifa_ifu.ifu_dstaddr
66 unsigned long int mem_start;
67 unsigned long int mem_end;
68 unsigned short int base_addr;
75 #define IFNAMSIZ IF_NAMESIZE
79 char ifrn_name[IFNAMSIZ];
82 struct sockaddr ifru_addr;
83 struct sockaddr ifru_dstaddr;
84 struct sockaddr ifru_broadaddr;
85 struct sockaddr ifru_netmask;
86 struct sockaddr ifru_hwaddr;
90 struct ifmap ifru_map;
91 char ifru_slave[IFNAMSIZ];
92 char ifru_newname[IFNAMSIZ];
97 #define ifr_name ifr_ifrn.ifrn_name
98 #define ifr_hwaddr ifr_ifru.ifru_hwaddr
99 #define ifr_addr ifr_ifru.ifru_addr
100 #define ifr_dstaddr ifr_ifru.ifru_dstaddr
101 #define ifr_broadaddr ifr_ifru.ifru_broadaddr
102 #define ifr_netmask ifr_ifru.ifru_netmask
103 #define ifr_flags ifr_ifru.ifru_flags
104 #define ifr_metric ifr_ifru.ifru_ivalue
105 #define ifr_mtu ifr_ifru.ifru_mtu
106 #define ifr_map ifr_ifru.ifru_map
107 #define ifr_slave ifr_ifru.ifru_slave
108 #define ifr_data ifr_ifru.ifru_data
109 #define ifr_ifindex ifr_ifru.ifru_ivalue
110 #define ifr_bandwidth ifr_ifru.ifru_ivalue
111 #define ifr_qlen ifr_ifru.ifru_ivalue
112 #define ifr_newname ifr_ifru.ifru_newname
113 #define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0)
114 #define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0)
115 #define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0)
121 struct ifreq *ifcu_req;
125 #define ifc_buf ifc_ifcu.ifcu_buf
126 #define ifc_req ifc_ifcu.ifcu_req
127 #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)