~ubuntu-branches/ubuntu/trusty/emscripten/trusty-proposed

« back to all changes in this revision

Viewing changes to system/include/net/if.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140119141240-jg1l42cc158j59tn
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#ifndef _NET_IF_H
3
 
#define _NET_IF_H
4
 
 
5
 
#include <sys/socket.h>
6
 
#include <sys/types.h>
7
 
#include <sys/ioctl.h>
8
 
 
9
 
#ifdef __cplusplus
10
 
extern "C" {
11
 
#endif
12
 
 
13
 
struct if_nameindex {
14
 
  unsigned  if_index;
15
 
  char     *if_name;
16
 
};
17
 
 
18
 
#define IFHWADDRLEN 6
19
 
#define IFNAMSIZ 16
20
 
 
21
 
struct ifmap {
22
 
  unsigned long int mem_start;
23
 
  unsigned long int mem_end;
24
 
  unsigned short int base_addr;
25
 
  unsigned char irq;
26
 
  unsigned char dma;
27
 
  unsigned char port;
28
 
};
29
 
 
30
 
struct ifreq {
31
 
  union {
32
 
    char ifrn_name[IFNAMSIZ];
33
 
  } ifr_ifrn;
34
 
  union {
35
 
    struct sockaddr ifru_addr;
36
 
    struct sockaddr ifru_destaddr;
37
 
    struct sockaddr ifru_broadaddr;
38
 
    struct sockaddr ifru_netmask;
39
 
    struct sockaddr ifru_hwaddr;
40
 
    short int ifru_flags;
41
 
    int ifru_ivalue;
42
 
    int ifru_mtu;
43
 
    struct ifmap ifru_map;
44
 
    char ifru_slave[IFNAMSIZ];
45
 
    char ifru_newname[IFNAMSIZ];
46
 
    caddr_t ifru_data;
47
 
  } ifr_ifru;
48
 
};
49
 
#define ifr_name ifr_ifrn.ifrn_name
50
 
#define ifr_addr ifr_ifru.ifru_addr
51
 
#define ifr_destaddr ifr_ifru.ifru_destaddr
52
 
#define ifr_broadaddr ifr_ifru.ifru_broadaddr
53
 
#define ifr_netmask ifr_ifru.ifru_netmask
54
 
#define ifr_hwaddr ifr_ifru.ifru_hwaddr
55
 
#define ifr_flags ifr_ifru.ifru_flags
56
 
#define ifr_ivalue ifr_ifru.ifru_ivalue
57
 
#define ifr_mtu ifr_ifru.ifru_mtu
58
 
#define ifr_map ifr_ifru.ifru_map
59
 
#define ifr_slave ifr_ifru.ifru_slave
60
 
#define ifr_newname ifr_ifru.ifru_newname
61
 
#define ifr_data ifr_ifru.ifru_data
62
 
 
63
 
struct ifconf {
64
 
  int ifc_len;
65
 
  union {
66
 
    caddr_t ifcu_buf;
67
 
    struct ifreq* ifcu_req;
68
 
  } ifc_ifcu;
69
 
};
70
 
#define ifc_buf ifc_ifcu.ifcu_buf
71
 
#define ifc_req ifc_ifcu.ifcu_req
72
 
 
73
 
#define IF_NAMESIZE abort(0);
74
 
 
75
 
unsigned             if_nametoindex(const char *a);
76
 
char                *if_indextoname(unsigned int a, char *b);
77
 
struct if_nameindex *if_nameindex();
78
 
void                 if_freenameindex(struct if_nameindex *a);
79
 
 
80
 
#define IFF_UP          0x1
81
 
#define IFF_BROADCAST   0x2
82
 
#define IFF_DEBUG       0x4
83
 
#define IFF_LOOPBACK    0x8
84
 
#define IFF_POINTOPOINT 0x10
85
 
#define IFF_NOTRAILERS  0x20
86
 
#define IFF_RUNNING     0x40
87
 
#define IFF_NOARP       0x80
88
 
#define IFF_PROMISC     0x100
89
 
#define IFF_ALLMULTI    0x200
90
 
#define IFF_MASTER      0x400
91
 
#define IFF_SLAVE       0x800
92
 
#define IFF_MULTICAST   0x1000
93
 
#define IFF_PORTSEL     0x2000
94
 
#define IFF_AUTOMEDIA   0x4000
95
 
#define IFF_DYNAMIC     0x8000
96
 
#define IFF_LOWER_UP    0x10000
97
 
#define IFF_DORMANT     0x20000
98
 
#define IFF_ECHO        0x40000
99
 
#define IFF_VOLATILE    (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
100
 
 
101
 
#ifdef __cplusplus
102
 
}
103
 
#endif
104
 
 
105
 
#endif
106