Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: fusl/include/net/if.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #ifndef _NET_IF_H 1 #ifndef _NET_IF_H
2 #define _NET_IF_H 2 #define _NET_IF_H
3 3
4 #ifdef __cplusplus 4 #ifdef __cplusplus
5 extern "C" { 5 extern "C" {
6 #endif 6 #endif
7 7
8 #include <features.h> 8 #include <features.h>
9 9
10 #define IF_NAMESIZE 16 10 #define IF_NAMESIZE 16
11 11
12 struct if_nameindex 12 struct if_nameindex {
13 { 13 unsigned int if_index;
14 » unsigned int if_index; 14 char* if_name;
15 » char *if_name;
16 }; 15 };
17 16
18 unsigned int if_nametoindex (const char *); 17 unsigned int if_nametoindex(const char*);
19 char *if_indextoname (unsigned int, char *); 18 char* if_indextoname(unsigned int, char*);
20 struct if_nameindex *if_nameindex (void); 19 struct if_nameindex* if_nameindex(void);
21 void if_freenameindex (struct if_nameindex *); 20 void if_freenameindex(struct if_nameindex*);
22
23
24
25 21
26 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 22 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
27 23
28 #include <sys/socket.h> 24 #include <sys/socket.h>
29 25
30 #define IFF_UP» 0x1 26 #define IFF_UP 0x1
31 #define IFF_BROADCAST 0x2 27 #define IFF_BROADCAST 0x2
32 #define IFF_DEBUG 0x4 28 #define IFF_DEBUG 0x4
33 #define IFF_LOOPBACK 0x8 29 #define IFF_LOOPBACK 0x8
34 #define IFF_POINTOPOINT 0x10 30 #define IFF_POINTOPOINT 0x10
35 #define IFF_NOTRAILERS 0x20 31 #define IFF_NOTRAILERS 0x20
36 #define IFF_RUNNING 0x40 32 #define IFF_RUNNING 0x40
37 #define IFF_NOARP 0x80 33 #define IFF_NOARP 0x80
38 #define IFF_PROMISC 0x100 34 #define IFF_PROMISC 0x100
39 #define IFF_ALLMULTI 0x200 35 #define IFF_ALLMULTI 0x200
40 #define IFF_MASTER 0x400 36 #define IFF_MASTER 0x400
41 #define IFF_SLAVE 0x800 37 #define IFF_SLAVE 0x800
42 #define IFF_MULTICAST 0x1000 38 #define IFF_MULTICAST 0x1000
43 #define IFF_PORTSEL 0x2000 39 #define IFF_PORTSEL 0x2000
44 #define IFF_AUTOMEDIA 0x4000 40 #define IFF_AUTOMEDIA 0x4000
45 #define IFF_DYNAMIC 0x8000 41 #define IFF_DYNAMIC 0x8000
46 #define IFF_LOWER_UP 0x10000 42 #define IFF_LOWER_UP 0x10000
47 #define IFF_DORMANT 0x20000 43 #define IFF_DORMANT 0x20000
48 #define IFF_ECHO 0x40000 44 #define IFF_ECHO 0x40000
49 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST| \ 45 #define IFF_VOLATILE \
50 IFF_ECHO|IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) 46 (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_BROADCAST | IFF_ECHO | IFF_MASTER | \
47 IFF_SLAVE | IFF_RUNNING | IFF_LOWER_UP | IFF_DORMANT)
51 48
52 struct ifaddr { 49 struct ifaddr {
53 » struct sockaddr ifa_addr; 50 struct sockaddr ifa_addr;
54 » union { 51 union {
55 » » struct sockaddr»ifu_broadaddr; 52 struct sockaddr ifu_broadaddr;
56 » » struct sockaddr»ifu_dstaddr; 53 struct sockaddr ifu_dstaddr;
57 » } ifa_ifu; 54 } ifa_ifu;
58 » struct iface *ifa_ifp; 55 struct iface* ifa_ifp;
59 » struct ifaddr *ifa_next; 56 struct ifaddr* ifa_next;
60 }; 57 };
61 58
62 #define ifa_broadaddr» ifa_ifu.ifu_broadaddr 59 #define ifa_broadaddr ifa_ifu.ifu_broadaddr
63 #define ifa_dstaddr» ifa_ifu.ifu_dstaddr 60 #define ifa_dstaddr ifa_ifu.ifu_dstaddr
64 61
65 struct ifmap { 62 struct ifmap {
66 » unsigned long int mem_start; 63 unsigned long int mem_start;
67 » unsigned long int mem_end; 64 unsigned long int mem_end;
68 » unsigned short int base_addr; 65 unsigned short int base_addr;
69 » unsigned char irq; 66 unsigned char irq;
70 » unsigned char dma; 67 unsigned char dma;
71 » unsigned char port; 68 unsigned char port;
72 }; 69 };
73 70
74 #define IFHWADDRLEN» 6 71 #define IFHWADDRLEN 6
75 #define IFNAMSIZ» IF_NAMESIZE 72 #define IFNAMSIZ IF_NAMESIZE
76 73
77 struct ifreq { 74 struct ifreq {
78 » union { 75 union {
79 » » char ifrn_name[IFNAMSIZ]; 76 char ifrn_name[IFNAMSIZ];
80 » } ifr_ifrn; 77 } ifr_ifrn;
81 » union { 78 union {
82 » » struct sockaddr ifru_addr; 79 struct sockaddr ifru_addr;
83 » » struct sockaddr ifru_dstaddr; 80 struct sockaddr ifru_dstaddr;
84 » » struct sockaddr ifru_broadaddr; 81 struct sockaddr ifru_broadaddr;
85 » » struct sockaddr ifru_netmask; 82 struct sockaddr ifru_netmask;
86 » » struct sockaddr ifru_hwaddr; 83 struct sockaddr ifru_hwaddr;
87 » » short int ifru_flags; 84 short int ifru_flags;
88 » » int ifru_ivalue; 85 int ifru_ivalue;
89 » » int ifru_mtu; 86 int ifru_mtu;
90 » » struct ifmap ifru_map; 87 struct ifmap ifru_map;
91 » » char ifru_slave[IFNAMSIZ]; 88 char ifru_slave[IFNAMSIZ];
92 » » char ifru_newname[IFNAMSIZ]; 89 char ifru_newname[IFNAMSIZ];
93 » » void *ifru_data; 90 void* ifru_data;
94 » } ifr_ifru; 91 } ifr_ifru;
95 }; 92 };
96 93
97 #define ifr_name» ifr_ifrn.ifrn_name 94 #define ifr_name ifr_ifrn.ifrn_name
98 #define ifr_hwaddr» ifr_ifru.ifru_hwaddr 95 #define ifr_hwaddr ifr_ifru.ifru_hwaddr
99 #define ifr_addr» ifr_ifru.ifru_addr 96 #define ifr_addr ifr_ifru.ifru_addr
100 #define ifr_dstaddr» ifr_ifru.ifru_dstaddr 97 #define ifr_dstaddr ifr_ifru.ifru_dstaddr
101 #define ifr_broadaddr» ifr_ifru.ifru_broadaddr 98 #define ifr_broadaddr ifr_ifru.ifru_broadaddr
102 #define ifr_netmask» ifr_ifru.ifru_netmask 99 #define ifr_netmask ifr_ifru.ifru_netmask
103 #define ifr_flags» ifr_ifru.ifru_flags 100 #define ifr_flags ifr_ifru.ifru_flags
104 #define ifr_metric» ifr_ifru.ifru_ivalue 101 #define ifr_metric ifr_ifru.ifru_ivalue
105 #define ifr_mtu»» ifr_ifru.ifru_mtu 102 #define ifr_mtu ifr_ifru.ifru_mtu
106 #define ifr_map»» ifr_ifru.ifru_map 103 #define ifr_map ifr_ifru.ifru_map
107 #define ifr_slave» ifr_ifru.ifru_slave 104 #define ifr_slave ifr_ifru.ifru_slave
108 #define ifr_data» ifr_ifru.ifru_data 105 #define ifr_data ifr_ifru.ifru_data
109 #define ifr_ifindex» ifr_ifru.ifru_ivalue 106 #define ifr_ifindex ifr_ifru.ifru_ivalue
110 #define ifr_bandwidth» ifr_ifru.ifru_ivalue 107 #define ifr_bandwidth ifr_ifru.ifru_ivalue
111 #define ifr_qlen» ifr_ifru.ifru_ivalue 108 #define ifr_qlen ifr_ifru.ifru_ivalue
112 #define ifr_newname» ifr_ifru.ifru_newname 109 #define ifr_newname ifr_ifru.ifru_newname
113 #define _IOT_ifreq» _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0) 110 #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) 111 #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) 112 #define _IOT_ifreq_int _IOT(_IOTS(char), IFNAMSIZ, _IOTS(int), 1, 0, 0)
116 113
117 struct ifconf { 114 struct ifconf {
118 » int ifc_len;» » 115 int ifc_len;
119 » union { 116 union {
120 » » void *ifcu_buf; 117 void* ifcu_buf;
121 » » struct ifreq *ifcu_req; 118 struct ifreq* ifcu_req;
122 » } ifc_ifcu; 119 } ifc_ifcu;
123 }; 120 };
124 121
125 #define ifc_buf»» ifc_ifcu.ifcu_buf 122 #define ifc_buf ifc_ifcu.ifcu_buf
126 #define ifc_req»» ifc_ifcu.ifcu_req 123 #define ifc_req ifc_ifcu.ifcu_req
127 #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) 124 #define _IOT_ifconf _IOT(_IOTS(struct ifconf), 1, 0, 0, 0, 0)
128 125
129 #endif 126 #endif
130 127
131 #ifdef __cplusplus 128 #ifdef __cplusplus
132 } 129 }
133 #endif 130 #endif
134 131
135 #endif 132 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698