Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef _LINUX_IF_H
     13 #define _LINUX_IF_H
     14 
     15 #include <linux/types.h>
     16 #include <linux/socket.h>
     17 #include <linux/compiler.h>
     18 
     19 #define IFNAMSIZ 16
     20 #include <linux/hdlc/ioctl.h>
     21 
     22 #define IFF_UP 0x1
     23 #define IFF_BROADCAST 0x2
     24 #define IFF_DEBUG 0x4
     25 #define IFF_LOOPBACK 0x8
     26 #define IFF_POINTOPOINT 0x10
     27 #define IFF_NOTRAILERS 0x20
     28 #define IFF_RUNNING 0x40
     29 #define IFF_NOARP 0x80
     30 #define IFF_PROMISC 0x100
     31 #define IFF_ALLMULTI 0x200
     32 
     33 #define IFF_MASTER 0x400
     34 #define IFF_SLAVE 0x800
     35 
     36 #define IFF_MULTICAST 0x1000
     37 
     38 #define IFF_PORTSEL 0x2000
     39 #define IFF_AUTOMEDIA 0x4000
     40 #define IFF_DYNAMIC 0x8000
     41 
     42 #define IFF_LOWER_UP 0x10000
     43 #define IFF_DORMANT 0x20000
     44 
     45 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|  IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
     46 
     47 #define IFF_802_1Q_VLAN 0x1
     48 #define IFF_EBRIDGE 0x2
     49 #define IFF_SLAVE_INACTIVE 0x4
     50 #define IFF_MASTER_8023AD 0x8
     51 #define IFF_MASTER_ALB 0x10
     52 
     53 #define IF_GET_IFACE 0x0001
     54 #define IF_GET_PROTO 0x0002
     55 
     56 #define IF_IFACE_V35 0x1000
     57 #define IF_IFACE_V24 0x1001
     58 #define IF_IFACE_X21 0x1002
     59 #define IF_IFACE_T1 0x1003
     60 #define IF_IFACE_E1 0x1004
     61 #define IF_IFACE_SYNC_SERIAL 0x1005
     62 #define IF_IFACE_X21D 0x1006
     63 
     64 #define IF_PROTO_HDLC 0x2000
     65 #define IF_PROTO_PPP 0x2001
     66 #define IF_PROTO_CISCO 0x2002
     67 #define IF_PROTO_FR 0x2003
     68 #define IF_PROTO_FR_ADD_PVC 0x2004
     69 #define IF_PROTO_FR_DEL_PVC 0x2005
     70 #define IF_PROTO_X25 0x2006
     71 #define IF_PROTO_HDLC_ETH 0x2007
     72 #define IF_PROTO_FR_ADD_ETH_PVC 0x2008
     73 #define IF_PROTO_FR_DEL_ETH_PVC 0x2009
     74 #define IF_PROTO_FR_PVC 0x200A
     75 #define IF_PROTO_FR_ETH_PVC 0x200B
     76 #define IF_PROTO_RAW 0x200C
     77 
     78 enum {
     79  IF_OPER_UNKNOWN,
     80  IF_OPER_NOTPRESENT,
     81  IF_OPER_DOWN,
     82  IF_OPER_LOWERLAYERDOWN,
     83  IF_OPER_TESTING,
     84  IF_OPER_DORMANT,
     85  IF_OPER_UP,
     86 };
     87 
     88 enum {
     89  IF_LINK_MODE_DEFAULT,
     90  IF_LINK_MODE_DORMANT,
     91 };
     92 
     93 struct ifmap
     94 {
     95  unsigned long mem_start;
     96  unsigned long mem_end;
     97  unsigned short base_addr;
     98  unsigned char irq;
     99  unsigned char dma;
    100  unsigned char port;
    101 
    102 };
    103 
    104 struct if_settings
    105 {
    106  unsigned int type;
    107  unsigned int size;
    108  union {
    109 
    110  raw_hdlc_proto __user *raw_hdlc;
    111  cisco_proto __user *cisco;
    112  fr_proto __user *fr;
    113  fr_proto_pvc __user *fr_pvc;
    114  fr_proto_pvc_info __user *fr_pvc_info;
    115 
    116  sync_serial_settings __user *sync;
    117  te1_settings __user *te1;
    118  } ifs_ifsu;
    119 };
    120 
    121 struct ifreq
    122 {
    123 #define IFHWADDRLEN 6
    124  union
    125  {
    126  char ifrn_name[IFNAMSIZ];
    127  } ifr_ifrn;
    128 
    129  union {
    130  struct sockaddr ifru_addr;
    131  struct sockaddr ifru_dstaddr;
    132  struct sockaddr ifru_broadaddr;
    133  struct sockaddr ifru_netmask;
    134  struct sockaddr ifru_hwaddr;
    135  short ifru_flags;
    136  int ifru_ivalue;
    137  int ifru_mtu;
    138  struct ifmap ifru_map;
    139  char ifru_slave[IFNAMSIZ];
    140  char ifru_newname[IFNAMSIZ];
    141  void __user * ifru_data;
    142  struct if_settings ifru_settings;
    143  } ifr_ifru;
    144 };
    145 
    146 #define ifr_name ifr_ifrn.ifrn_name
    147 #define ifr_hwaddr ifr_ifru.ifru_hwaddr
    148 #define ifr_addr ifr_ifru.ifru_addr
    149 #define ifr_dstaddr ifr_ifru.ifru_dstaddr
    150 #define ifr_broadaddr ifr_ifru.ifru_broadaddr
    151 #define ifr_netmask ifr_ifru.ifru_netmask
    152 #define ifr_flags ifr_ifru.ifru_flags
    153 #define ifr_metric ifr_ifru.ifru_ivalue
    154 #define ifr_mtu ifr_ifru.ifru_mtu
    155 #define ifr_map ifr_ifru.ifru_map
    156 #define ifr_slave ifr_ifru.ifru_slave
    157 #define ifr_data ifr_ifru.ifru_data
    158 #define ifr_ifindex ifr_ifru.ifru_ivalue
    159 #define ifr_bandwidth ifr_ifru.ifru_ivalue
    160 #define ifr_qlen ifr_ifru.ifru_ivalue
    161 #define ifr_newname ifr_ifru.ifru_newname
    162 #define ifr_settings ifr_ifru.ifru_settings
    163 
    164 struct ifconf
    165 {
    166  int ifc_len;
    167  union
    168  {
    169  char __user *ifcu_buf;
    170  struct ifreq __user *ifcu_req;
    171  } ifc_ifcu;
    172 };
    173 #define ifc_buf ifc_ifcu.ifcu_buf
    174 #define ifc_req ifc_ifcu.ifcu_req
    175 
    176 #endif
    177