~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

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
 
 
81
 
 
82
#ifdef __cplusplus
 
83
}
 
84
#endif
 
85
 
 
86
#endif
 
87