Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/net
File: if.h
/* net/if.h -- declarations for inquiring about network interfaces
[0] Fix | Delete
Copyright (C) 1997-2018 Free Software Foundation, Inc.
[1] Fix | Delete
This file is part of the GNU C Library.
[2] Fix | Delete
[3] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[4] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[5] Fix | Delete
License as published by the Free Software Foundation; either
[6] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[7] Fix | Delete
[8] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[9] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[10] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[11] Fix | Delete
Lesser General Public License for more details.
[12] Fix | Delete
[13] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[14] Fix | Delete
License along with the GNU C Library; if not, see
[15] Fix | Delete
<http://www.gnu.org/licenses/>. */
[16] Fix | Delete
[17] Fix | Delete
#ifndef _NET_IF_H
[18] Fix | Delete
#define _NET_IF_H 1
[19] Fix | Delete
[20] Fix | Delete
#include <features.h>
[21] Fix | Delete
[22] Fix | Delete
#ifdef __USE_MISC
[23] Fix | Delete
# include <sys/types.h>
[24] Fix | Delete
# include <sys/socket.h>
[25] Fix | Delete
#endif
[26] Fix | Delete
[27] Fix | Delete
[28] Fix | Delete
/* Length of interface name. */
[29] Fix | Delete
#define IF_NAMESIZE 16
[30] Fix | Delete
[31] Fix | Delete
struct if_nameindex
[32] Fix | Delete
{
[33] Fix | Delete
unsigned int if_index; /* 1, 2, ... */
[34] Fix | Delete
char *if_name; /* null terminated name: "eth0", ... */
[35] Fix | Delete
};
[36] Fix | Delete
[37] Fix | Delete
[38] Fix | Delete
#ifdef __USE_MISC
[39] Fix | Delete
/* Standard interface flags. */
[40] Fix | Delete
enum
[41] Fix | Delete
{
[42] Fix | Delete
IFF_UP = 0x1, /* Interface is up. */
[43] Fix | Delete
# define IFF_UP IFF_UP
[44] Fix | Delete
IFF_BROADCAST = 0x2, /* Broadcast address valid. */
[45] Fix | Delete
# define IFF_BROADCAST IFF_BROADCAST
[46] Fix | Delete
IFF_DEBUG = 0x4, /* Turn on debugging. */
[47] Fix | Delete
# define IFF_DEBUG IFF_DEBUG
[48] Fix | Delete
IFF_LOOPBACK = 0x8, /* Is a loopback net. */
[49] Fix | Delete
# define IFF_LOOPBACK IFF_LOOPBACK
[50] Fix | Delete
IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */
[51] Fix | Delete
# define IFF_POINTOPOINT IFF_POINTOPOINT
[52] Fix | Delete
IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */
[53] Fix | Delete
# define IFF_NOTRAILERS IFF_NOTRAILERS
[54] Fix | Delete
IFF_RUNNING = 0x40, /* Resources allocated. */
[55] Fix | Delete
# define IFF_RUNNING IFF_RUNNING
[56] Fix | Delete
IFF_NOARP = 0x80, /* No address resolution protocol. */
[57] Fix | Delete
# define IFF_NOARP IFF_NOARP
[58] Fix | Delete
IFF_PROMISC = 0x100, /* Receive all packets. */
[59] Fix | Delete
# define IFF_PROMISC IFF_PROMISC
[60] Fix | Delete
[61] Fix | Delete
/* Not supported */
[62] Fix | Delete
IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */
[63] Fix | Delete
# define IFF_ALLMULTI IFF_ALLMULTI
[64] Fix | Delete
[65] Fix | Delete
IFF_MASTER = 0x400, /* Master of a load balancer. */
[66] Fix | Delete
# define IFF_MASTER IFF_MASTER
[67] Fix | Delete
IFF_SLAVE = 0x800, /* Slave of a load balancer. */
[68] Fix | Delete
# define IFF_SLAVE IFF_SLAVE
[69] Fix | Delete
[70] Fix | Delete
IFF_MULTICAST = 0x1000, /* Supports multicast. */
[71] Fix | Delete
# define IFF_MULTICAST IFF_MULTICAST
[72] Fix | Delete
[73] Fix | Delete
IFF_PORTSEL = 0x2000, /* Can set media type. */
[74] Fix | Delete
# define IFF_PORTSEL IFF_PORTSEL
[75] Fix | Delete
IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */
[76] Fix | Delete
# define IFF_AUTOMEDIA IFF_AUTOMEDIA
[77] Fix | Delete
IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */
[78] Fix | Delete
# define IFF_DYNAMIC IFF_DYNAMIC
[79] Fix | Delete
};
[80] Fix | Delete
[81] Fix | Delete
/* The ifaddr structure contains information about one address of an
[82] Fix | Delete
interface. They are maintained by the different address families,
[83] Fix | Delete
are allocated and attached when an address is set, and are linked
[84] Fix | Delete
together so all addresses for an interface can be located. */
[85] Fix | Delete
[86] Fix | Delete
struct ifaddr
[87] Fix | Delete
{
[88] Fix | Delete
struct sockaddr ifa_addr; /* Address of interface. */
[89] Fix | Delete
union
[90] Fix | Delete
{
[91] Fix | Delete
struct sockaddr ifu_broadaddr;
[92] Fix | Delete
struct sockaddr ifu_dstaddr;
[93] Fix | Delete
} ifa_ifu;
[94] Fix | Delete
struct iface *ifa_ifp; /* Back-pointer to interface. */
[95] Fix | Delete
struct ifaddr *ifa_next; /* Next address for interface. */
[96] Fix | Delete
};
[97] Fix | Delete
[98] Fix | Delete
# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */
[99] Fix | Delete
# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */
[100] Fix | Delete
[101] Fix | Delete
/* Device mapping structure. I'd just gone off and designed a
[102] Fix | Delete
beautiful scheme using only loadable modules with arguments for
[103] Fix | Delete
driver options and along come the PCMCIA people 8)
[104] Fix | Delete
[105] Fix | Delete
Ah well. The get() side of this is good for WDSETUP, and it'll be
[106] Fix | Delete
handy for debugging things. The set side is fine for now and being
[107] Fix | Delete
very small might be worth keeping for clean configuration. */
[108] Fix | Delete
[109] Fix | Delete
struct ifmap
[110] Fix | Delete
{
[111] Fix | Delete
unsigned long int mem_start;
[112] Fix | Delete
unsigned long int mem_end;
[113] Fix | Delete
unsigned short int base_addr;
[114] Fix | Delete
unsigned char irq;
[115] Fix | Delete
unsigned char dma;
[116] Fix | Delete
unsigned char port;
[117] Fix | Delete
/* 3 bytes spare */
[118] Fix | Delete
};
[119] Fix | Delete
[120] Fix | Delete
/* Interface request structure used for socket ioctl's. All interface
[121] Fix | Delete
ioctl's must have parameter definitions which begin with ifr_name.
[122] Fix | Delete
The remainder may be interface specific. */
[123] Fix | Delete
[124] Fix | Delete
struct ifreq
[125] Fix | Delete
{
[126] Fix | Delete
# define IFHWADDRLEN 6
[127] Fix | Delete
# define IFNAMSIZ IF_NAMESIZE
[128] Fix | Delete
union
[129] Fix | Delete
{
[130] Fix | Delete
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
[131] Fix | Delete
} ifr_ifrn;
[132] Fix | Delete
[133] Fix | Delete
union
[134] Fix | Delete
{
[135] Fix | Delete
struct sockaddr ifru_addr;
[136] Fix | Delete
struct sockaddr ifru_dstaddr;
[137] Fix | Delete
struct sockaddr ifru_broadaddr;
[138] Fix | Delete
struct sockaddr ifru_netmask;
[139] Fix | Delete
struct sockaddr ifru_hwaddr;
[140] Fix | Delete
short int ifru_flags;
[141] Fix | Delete
int ifru_ivalue;
[142] Fix | Delete
int ifru_mtu;
[143] Fix | Delete
struct ifmap ifru_map;
[144] Fix | Delete
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
[145] Fix | Delete
char ifru_newname[IFNAMSIZ];
[146] Fix | Delete
__caddr_t ifru_data;
[147] Fix | Delete
} ifr_ifru;
[148] Fix | Delete
};
[149] Fix | Delete
# define ifr_name ifr_ifrn.ifrn_name /* interface name */
[150] Fix | Delete
# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
[151] Fix | Delete
# define ifr_addr ifr_ifru.ifru_addr /* address */
[152] Fix | Delete
# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
[153] Fix | Delete
# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
[154] Fix | Delete
# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
[155] Fix | Delete
# define ifr_flags ifr_ifru.ifru_flags /* flags */
[156] Fix | Delete
# define ifr_metric ifr_ifru.ifru_ivalue /* metric */
[157] Fix | Delete
# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
[158] Fix | Delete
# define ifr_map ifr_ifru.ifru_map /* device map */
[159] Fix | Delete
# define ifr_slave ifr_ifru.ifru_slave /* slave device */
[160] Fix | Delete
# define ifr_data ifr_ifru.ifru_data /* for use by interface */
[161] Fix | Delete
# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
[162] Fix | Delete
# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
[163] Fix | Delete
# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */
[164] Fix | Delete
# define ifr_newname ifr_ifru.ifru_newname /* New name */
[165] Fix | Delete
# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0)
[166] Fix | Delete
# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0)
[167] Fix | Delete
# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0)
[168] Fix | Delete
[169] Fix | Delete
[170] Fix | Delete
/* Structure used in SIOCGIFCONF request. Used to retrieve interface
[171] Fix | Delete
configuration for machine (useful for programs which must know all
[172] Fix | Delete
networks accessible). */
[173] Fix | Delete
[174] Fix | Delete
struct ifconf
[175] Fix | Delete
{
[176] Fix | Delete
int ifc_len; /* Size of buffer. */
[177] Fix | Delete
union
[178] Fix | Delete
{
[179] Fix | Delete
__caddr_t ifcu_buf;
[180] Fix | Delete
struct ifreq *ifcu_req;
[181] Fix | Delete
} ifc_ifcu;
[182] Fix | Delete
};
[183] Fix | Delete
# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
[184] Fix | Delete
# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
[185] Fix | Delete
# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */
[186] Fix | Delete
#endif /* Misc. */
[187] Fix | Delete
[188] Fix | Delete
__BEGIN_DECLS
[189] Fix | Delete
[190] Fix | Delete
/* Convert an interface name to an index, and vice versa. */
[191] Fix | Delete
extern unsigned int if_nametoindex (const char *__ifname) __THROW;
[192] Fix | Delete
extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW;
[193] Fix | Delete
[194] Fix | Delete
/* Return a list of all interfaces and their indices. */
[195] Fix | Delete
extern struct if_nameindex *if_nameindex (void) __THROW;
[196] Fix | Delete
[197] Fix | Delete
/* Free the data returned from if_nameindex. */
[198] Fix | Delete
extern void if_freenameindex (struct if_nameindex *__ptr) __THROW;
[199] Fix | Delete
[200] Fix | Delete
__END_DECLS
[201] Fix | Delete
[202] Fix | Delete
#endif /* net/if.h */
[203] Fix | Delete
[204] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function