@@ -14,41 +14,32 @@ mod os {
14
14
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
15
15
pub const AF_SYSTEM : c_int = libc:: AF_SYSTEM ;
16
16
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
17
- pub const AF_SYS_CONTROL : c_int = 2 ;
17
+ pub const AF_SYS_CONTROL : c_int = libc :: AF_SYS_CONTROL ;
18
18
19
19
pub const SOCK_STREAM : c_int = libc:: SOCK_STREAM ;
20
20
pub const SOCK_DGRAM : c_int = libc:: SOCK_DGRAM ;
21
21
pub const SOCK_SEQPACKET : c_int = libc:: SOCK_SEQPACKET ;
22
22
pub const SOCK_RAW : c_int = libc:: SOCK_RAW ;
23
- #[ cfg( not( any( target_os = "linux" , target_os = "android" ) ) ) ]
24
23
pub const SOCK_RDM : c_int = libc:: SOCK_RDM ;
25
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
26
- pub const SOCK_RDM : c_int = 4 ;
27
24
25
+ pub const SOL_SOCKET : c_int = libc:: SOL_SOCKET ;
28
26
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
29
27
pub const SOL_IP : c_int = libc:: SOL_IP ;
30
- pub const SOL_SOCKET : c_int = libc:: SOL_SOCKET ;
31
28
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
32
29
pub const SOL_TCP : c_int = libc:: SOL_TCP ;
33
30
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
34
- pub const SOL_UDP : c_int = 17 ;
31
+ pub const SOL_UDP : c_int = libc :: SOL_UDP ;
35
32
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
36
33
pub const SOL_IPV6 : c_int = libc:: SOL_IPV6 ;
37
34
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
38
35
pub const SOL_NETLINK : c_int = libc:: SOL_NETLINK ;
36
+
39
37
pub const IPPROTO_IP : c_int = libc:: IPPROTO_IP ;
40
38
pub const IPPROTO_IPV6 : c_int = libc:: IPPROTO_IPV6 ;
41
39
pub const IPPROTO_TCP : c_int = libc:: IPPROTO_TCP ;
42
- #[ cfg( any( target_os = "linux" , target_os = "android" , target_os = "dragonfly" ) ) ]
43
- pub const IPPROTO_UDP : c_int = SOL_UDP ;
44
- #[ cfg( any( target_os = "macos" ,
45
- target_os = "freebsd" ,
46
- target_os = "ios" ,
47
- target_os = "openbsd" ,
48
- target_os = "netbsd" ) ) ]
49
- pub const IPPROTO_UDP : c_int = 17 ;
40
+ pub const IPPROTO_UDP : c_int = libc:: IPPROTO_UDP ;
50
41
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
51
- pub const SYSPROTO_CONTROL : c_int = 2 ;
42
+ pub const SYSPROTO_CONTROL : c_int = libc :: SYSPROTO_CONTROL ;
52
43
53
44
pub const SO_ACCEPTCONN : c_int = libc:: SO_ACCEPTCONN ;
54
45
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
@@ -62,151 +53,84 @@ mod os {
62
53
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
63
54
pub const SO_DOMAIN : c_int = libc:: SO_DOMAIN ;
64
55
pub const SO_DONTROUTE : c_int = libc:: SO_DONTROUTE ;
65
- #[ cfg( not ( target_os = "netbsd " ) ) ]
66
- pub const SO_DONTTRUNC : c_int = 0x2000 ;
56
+ #[ cfg( any ( target_os = "macos" , target_os = "ios ") ) ]
57
+ pub const SO_DONTTRUNC : c_int = libc :: SO_DONTTRUNC ;
67
58
pub const SO_ERROR : c_int = libc:: SO_ERROR ;
68
59
pub const SO_KEEPALIVE : c_int = libc:: SO_KEEPALIVE ;
69
- #[ cfg( any( target_os = "macos" ,
70
- target_os = "freebsd" ,
71
- target_os = "ios" ,
72
- target_os = "openbsd" ,
73
- target_os = "netbsd" ) ) ]
74
- pub const SO_LABEL : c_int = 0x1010 ;
60
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "freebsd" ) ) ]
61
+ pub const SO_LABEL : c_int = libc:: SO_LABEL ;
75
62
pub const SO_LINGER : c_int = libc:: SO_LINGER ;
76
63
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
77
64
pub const SO_MARK : c_int = libc:: SO_MARK ;
78
- #[ cfg( any( target_os = "macos" ,
79
- target_os = "freebsd" ,
80
- target_os = "ios" ,
81
- target_os = "openbsd" ,
82
- target_os = "netbsd" ) ) ]
83
- pub const SO_NREAD : c_int = 0x1020 ;
84
- #[ cfg( any( target_os = "macos" ,
65
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
66
+ pub const SO_NREAD : c_int = libc:: SO_NREAD ;
67
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
68
+ pub const SO_NKE : c_int = libc:: SO_NKE ;
69
+ #[ cfg( any( target_os = "dragonfly" ,
85
70
target_os = "freebsd" ,
86
- target_os = "ios" ,
87
- target_os = "openbsd" ,
88
- target_os = "netbsd" ) ) ]
89
- pub const SO_NKE : c_int = 0x1021 ;
90
- #[ cfg( target_os = "dragonfly" ) ]
71
+ target_os = "macos" ,
72
+ target_os = "ios" ) ) ]
91
73
pub const SO_NOSIGPIPE : c_int = libc:: SO_NOSIGPIPE ;
92
74
#[ cfg( any( target_os = "macos" ,
93
- target_os = "freebsd" ,
94
- target_os = "ios" ,
95
- target_os = "openbsd" ,
96
- target_os = "netbsd" ) ) ]
97
- pub const SO_NOSIGPIPE : c_int = 0x1022 ;
98
- #[ cfg( any( target_os = "macos" ,
99
- target_os = "freebsd" ,
100
- target_os = "ios" ,
101
- target_os = "openbsd" ,
102
- target_os = "netbsd" ) ) ]
103
- pub const SO_NOADDRERR : c_int = 0x1023 ;
104
- #[ cfg( any( target_os = "macos" ,
105
- target_os = "freebsd" ,
106
- target_os = "ios" ,
107
- target_os = "openbsd" ,
108
- target_os = "netbsd" ) ) ]
109
- pub const SO_NOTIFYCONFLICT : c_int = 0x1026 ;
110
- #[ cfg( any( target_os = "macos" ,
111
- target_os = "freebsd" ,
112
- target_os = "ios" ,
113
- target_os = "openbsd" ,
114
- target_os = "netbsd" ) ) ]
115
- pub const SO_NP_EXTENSIONS : c_int = 0x1083 ;
75
+ target_os = "ios" ) ) ]
76
+ pub const SO_NOADDRERR : c_int = libc:: SO_NOADDRERR ;
77
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
78
+ pub const SO_NOTIFYCONFLICT : c_int = libc:: SO_NOTIFYCONFLICT ;
79
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
80
+ pub const SO_NP_EXTENSIONS : c_int = libc:: SO_NP_EXTENSIONS ;
116
81
#[ cfg( any( target_os = "macos" ,
117
- target_os = "freebsd" ,
118
- target_os = "ios" ,
119
- target_os = "openbsd" ,
120
- target_os = "netbsd" ) ) ]
121
- pub const SO_NWRITE : c_int = 0x1024 ;
82
+ target_os = "ios" ) ) ]
83
+ pub const SO_NWRITE : c_int = libc:: SO_NWRITE ;
122
84
pub const SO_OOBINLINE : c_int = libc:: SO_OOBINLINE ;
123
- #[ cfg( target_os = "linux" ) ]
124
- pub const SO_ORIGINAL_DST : c_int = 80 ;
85
+ #[ cfg( any ( target_os = "linux" , target_os = "android" ) ) ]
86
+ pub const SO_ORIGINAL_DST : c_int = libc :: SO_ORIGINAL_DST ;
125
87
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
126
88
pub const SO_PASSCRED : c_int = libc:: SO_PASSCRED ;
127
89
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
128
90
pub const SO_PEEK_OFF : c_int = libc:: SO_PEEK_OFF ;
129
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
91
+ #[ cfg( any( target_os = "linux" ,
92
+ target_os = "android" ,
93
+ target_os = "openbsd" ) ) ]
130
94
pub const SO_PEERCRED : c_int = libc:: SO_PEERCRED ;
131
- #[ cfg( any( target_os = "macos" ,
132
- target_os = "freebsd" ,
133
- target_os = "ios" ,
134
- target_os = "openbsd" ,
135
- target_os = "netbsd" ) ) ]
136
- pub const SO_PEERLABEL : c_int = 0x1011 ;
95
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "freebsd" ) ) ]
96
+ pub const SO_PEERLABEL : c_int = libc:: SO_PEERLABEL ;
137
97
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
138
98
pub const SO_PRIORITY : c_int = libc:: SO_PRIORITY ;
139
99
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
140
100
pub const SO_PROTOCOL : c_int = libc:: SO_PROTOCOL ;
141
101
pub const SO_RCVBUF : c_int = libc:: SO_RCVBUF ;
142
102
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
143
- pub const SO_RCVBUFFORCE : c_int = 33 ;
103
+ pub const SO_RCVBUFFORCE : c_int = libc :: SO_RCVBUFFORCE ;
144
104
pub const SO_RCVLOWAT : c_int = libc:: SO_RCVLOWAT ;
145
105
pub const SO_SNDLOWAT : c_int = libc:: SO_SNDLOWAT ;
146
106
pub const SO_RCVTIMEO : c_int = libc:: SO_RCVTIMEO ;
147
107
pub const SO_SNDTIMEO : c_int = libc:: SO_SNDTIMEO ;
148
- #[ cfg( any( target_os = "macos" ,
149
- target_os = "freebsd" ,
150
- target_os = "ios" ,
151
- target_os = "openbsd" ,
152
- target_os = "netbsd" ) ) ]
153
- pub const SO_RANDOMPORT : c_int = 0x1082 ;
154
- #[ cfg( any( target_os = "macos" ,
155
- target_os = "freebsd" ,
156
- target_os = "ios" ,
157
- target_os = "openbsd" ,
158
- target_os = "netbsd" ) ) ]
159
- pub const SO_RESTRICTIONS : c_int = 0x1081 ;
160
- #[ cfg( any( target_os = "macos" ,
161
- target_os = "freebsd" ,
162
- target_os = "ios" ,
163
- target_os = "openbsd" ,
164
- target_os = "netbsd" ) ) ]
165
- pub const SO_RESTRICT_DENYIN : c_int = 0x00000001 ;
166
- #[ cfg( any( target_os = "macos" ,
167
- target_os = "freebsd" ,
168
- target_os = "ios" ,
169
- target_os = "openbsd" ,
170
- target_os = "netbsd" ) ) ]
171
- pub const SO_RESTRICT_DENYOUT : c_int = 0x00000002 ;
172
- #[ cfg( any( target_os = "macos" ,
173
- target_os = "freebsd" ,
174
- target_os = "ios" ,
175
- target_os = "openbsd" ,
176
- target_os = "netbsd" ) ) ]
177
- #[ allow( overflowing_literals) ]
178
- pub const SO_RESTRICT_DENYSET : c_int = 0x80000000 ;
108
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
109
+ pub const SO_RANDOMPORT : c_int = libc:: SO_RANDOMPORT ;
179
110
pub const SO_REUSEADDR : c_int = libc:: SO_REUSEADDR ;
180
111
pub const SO_REUSEPORT : c_int = libc:: SO_REUSEPORT ;
181
- #[ cfg( any( target_os = "macos" ,
182
- target_os = "freebsd" ,
183
- target_os = "ios" ,
184
- target_os = "openbsd" ,
185
- target_os = "netbsd" ) ) ]
186
- pub const SO_REUSESHAREUID : c_int = 0x1025 ;
112
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
113
+ pub const SO_REUSESHAREUID : c_int = libc:: SO_REUSESHAREUID ;
187
114
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
188
115
pub const SO_RXQ_OVFL : c_int = libc:: SO_RXQ_OVFL ;
189
116
pub const SO_SNDBUF : c_int = libc:: SO_SNDBUF ;
190
117
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
191
118
pub const SO_SNDBUFFORCE : c_int = libc:: SO_SNDBUFFORCE ;
192
119
pub const SO_TIMESTAMP : c_int = libc:: SO_TIMESTAMP ;
193
- #[ cfg( not ( target_os = "netbsd " ) ) ]
194
- pub const SO_TIMESTAMP_MONOTONIC : c_int = 0x0800 ;
120
+ #[ cfg( any ( target_os = "macos" , target_os = "ios ") ) ]
121
+ pub const SO_TIMESTAMP_MONOTONIC : c_int = libc :: SO_TIMESTAMP_MONOTONIC ;
195
122
pub const SO_TYPE : c_int = libc:: SO_TYPE ;
196
123
#[ cfg( any( target_os = "macos" ,
197
124
target_os = "freebsd" ,
198
125
target_os = "ios" ,
199
126
target_os = "openbsd" ,
200
- target_os = "netbsd" ) ) ]
127
+ target_os = "netbsd" ,
128
+ target_os = "dragonfly" ) ) ]
201
129
pub const SO_USELOOPBACK : c_int = libc:: SO_USELOOPBACK ;
202
- #[ cfg( not( target_os = "netbsd" ) ) ]
203
- pub const SO_WANTMORE : c_int = 0x4000 ;
204
- #[ cfg( any( target_os = "macos" ,
205
- target_os = "freebsd" ,
206
- target_os = "ios" ,
207
- target_os = "openbsd" ,
208
- target_os = "netbsd" ) ) ]
209
- pub const SO_WANTOOBFLAG : c_int = 0x8000 ;
130
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
131
+ pub const SO_WANTMORE : c_int = libc:: SO_WANTMORE ;
132
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
133
+ pub const SO_WANTOOBFLAG : c_int = libc:: SO_WANTOOBFLAG ;
210
134
211
135
// Socket options for TCP sockets
212
136
pub const TCP_NODELAY : c_int = libc:: TCP_NODELAY ;
@@ -216,8 +140,9 @@ mod os {
216
140
target_os = "freebsd" ,
217
141
target_os = "ios" ,
218
142
target_os = "openbsd" ,
219
- target_os = "netbsd" ) ) ]
220
- pub const TCP_MAXSEG : c_int = 2 ;
143
+ target_os = "netbsd" ,
144
+ target_os = "dragonfly" ) ) ]
145
+ pub const TCP_MAXSEG : c_int = libc:: TCP_MAXSEG ;
221
146
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
222
147
pub const TCP_CORK : c_int = libc:: TCP_CORK ;
223
148
#[ cfg( any( target_os = "linux" ,
@@ -229,17 +154,9 @@ mod os {
229
154
pub const TCP_KEEPALIVE : c_int = libc:: TCP_KEEPALIVE ;
230
155
231
156
// Socket options for the IP layer of the socket
232
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
233
- pub const IP_MULTICAST_IF : c_int = 32 ;
234
- #[ cfg( any( target_os = "macos" ,
235
- target_os = "freebsd" ,
236
- target_os = "ios" ,
237
- target_os = "openbsd" ,
238
- target_os = "netbsd" ,
239
- target_os = "dragonfly" ) ) ]
240
- pub const IP_MULTICAST_IF : c_int = 9 ;
157
+ pub const IP_MULTICAST_IF : c_int = libc:: IP_MULTICAST_IF ;
241
158
242
- pub type IpMulticastTtl = uint8_t ;
159
+ pub type IpMulticastTtl = uint8_t ; //--
243
160
244
161
pub const IP_MULTICAST_TTL : c_int = libc:: IP_MULTICAST_TTL ;
245
162
pub const IP_MULTICAST_LOOP : c_int = libc:: IP_MULTICAST_LOOP ;
@@ -265,7 +182,7 @@ mod os {
265
182
target_os = "dragonfly" ) ) ]
266
183
pub const IPV6_LEAVE_GROUP : c_int = libc:: IPV6_LEAVE_GROUP ;
267
184
268
- pub type InAddrT = u32 ;
185
+ pub type InAddrT = u32 ; //--
269
186
270
187
// Declarations of special addresses
271
188
pub const INADDR_ANY : InAddrT = 0 ;
@@ -278,11 +195,8 @@ mod os {
278
195
MSG_OOB ,
279
196
MSG_PEEK ,
280
197
MSG_DONTWAIT ,
281
- #[ cfg( not( target_os = "dragonfly" ) ) ]
282
198
MSG_CTRUNC ,
283
- #[ cfg( not( target_os = "dragonfly" ) ) ]
284
199
MSG_TRUNC ,
285
- #[ cfg( not( target_os = "dragonfly" ) ) ]
286
200
MSG_EOR ,
287
201
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
288
202
MSG_ERRQUEUE ,
@@ -297,14 +211,7 @@ mod os {
297
211
pub const SHUT_RDWR : c_int = libc:: SHUT_RDWR ;
298
212
299
213
// Ancillary message types
300
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
301
214
pub const SCM_RIGHTS : c_int = libc:: SCM_RIGHTS ;
302
- #[ cfg( any( target_os = "macos" ,
303
- target_os = "freebsd" ,
304
- target_os = "ios" ,
305
- target_os = "openbsd" ,
306
- target_os = "netbsd" ) ) ]
307
- pub const SCM_RIGHTS : c_int = 1 ;
308
215
309
216
}
310
217
0 commit comments