@@ -128,82 +128,82 @@ macro_rules! getsockopt_impl {
128
128
/// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`.
129
129
/// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`.
130
130
macro_rules! sockopt_impl {
131
- ( GetOnly , $name: ident, $level: expr, $flag: path, bool ) => {
132
- sockopt_impl!( GetOnly , $name, $level, $flag, bool , GetBool ) ;
131
+ ( $name: ident, GetOnly , $level: expr, $flag: path, bool ) => {
132
+ sockopt_impl!( $name, GetOnly , $level, $flag, bool , GetBool ) ;
133
133
} ;
134
134
135
- ( GetOnly , $name: ident, $level: expr, $flag: path, u8 ) => {
136
- sockopt_impl!( GetOnly , $name, $level, $flag, u8 , GetU8 ) ;
135
+ ( $name: ident, GetOnly , $level: expr, $flag: path, u8 ) => {
136
+ sockopt_impl!( $name, GetOnly , $level, $flag, u8 , GetU8 ) ;
137
137
} ;
138
138
139
- ( GetOnly , $name: ident, $level: expr, $flag: path, usize ) => {
140
- sockopt_impl!( GetOnly , $name, $level, $flag, usize , GetUsize ) ;
139
+ ( $name: ident, GetOnly , $level: expr, $flag: path, usize ) => {
140
+ sockopt_impl!( $name, GetOnly , $level, $flag, usize , GetUsize ) ;
141
141
} ;
142
142
143
- ( SetOnly , $name: ident, $level: expr, $flag: path, bool ) => {
144
- sockopt_impl!( SetOnly , $name, $level, $flag, bool , SetBool ) ;
143
+ ( $name: ident, SetOnly , $level: expr, $flag: path, bool ) => {
144
+ sockopt_impl!( $name, SetOnly , $level, $flag, bool , SetBool ) ;
145
145
} ;
146
146
147
- ( SetOnly , $name: ident, $level: expr, $flag: path, u8 ) => {
148
- sockopt_impl!( SetOnly , $name, $level, $flag, u8 , SetU8 ) ;
147
+ ( $name: ident, SetOnly , $level: expr, $flag: path, u8 ) => {
148
+ sockopt_impl!( $name, SetOnly , $level, $flag, u8 , SetU8 ) ;
149
149
} ;
150
150
151
- ( SetOnly , $name: ident, $level: expr, $flag: path, usize ) => {
152
- sockopt_impl!( SetOnly , $name, $level, $flag, usize , SetUsize ) ;
151
+ ( $name: ident, SetOnly , $level: expr, $flag: path, usize ) => {
152
+ sockopt_impl!( $name, SetOnly , $level, $flag, usize , SetUsize ) ;
153
153
} ;
154
154
155
- ( Both , $name: ident, $level: expr, $flag: path, bool ) => {
156
- sockopt_impl!( Both , $name, $level, $flag, bool , GetBool , SetBool ) ;
155
+ ( $name: ident, Both , $level: expr, $flag: path, bool ) => {
156
+ sockopt_impl!( $name, Both , $level, $flag, bool , GetBool , SetBool ) ;
157
157
} ;
158
158
159
- ( Both , $name: ident, $level: expr, $flag: path, u8 ) => {
160
- sockopt_impl!( Both , $name, $level, $flag, u8 , GetU8 , SetU8 ) ;
159
+ ( $name: ident, Both , $level: expr, $flag: path, u8 ) => {
160
+ sockopt_impl!( $name, Both , $level, $flag, u8 , GetU8 , SetU8 ) ;
161
161
} ;
162
162
163
- ( Both , $name: ident, $level: expr, $flag: path, usize ) => {
164
- sockopt_impl!( Both , $name, $level, $flag, usize , GetUsize , SetUsize ) ;
163
+ ( $name: ident, Both , $level: expr, $flag: path, usize ) => {
164
+ sockopt_impl!( $name, Both , $level, $flag, usize , GetUsize , SetUsize ) ;
165
165
} ;
166
166
167
- ( Both , $name: ident, $level: expr, $flag: path, OsString <$array: ty>) => {
168
- sockopt_impl!( Both , $name, $level, $flag, OsString , GetOsString <$array>, SetOsString ) ;
167
+ ( $name: ident, Both , $level: expr, $flag: path, OsString <$array: ty>) => {
168
+ sockopt_impl!( $name, Both , $level, $flag, OsString , GetOsString <$array>, SetOsString ) ;
169
169
} ;
170
170
171
171
/*
172
172
* Matchers with generic getter types must be placed at the end, so
173
173
* they'll only match _after_ specialized matchers fail
174
174
*/
175
- ( GetOnly , $name: ident, $level: expr, $flag: path, $ty: ty) => {
176
- sockopt_impl!( GetOnly , $name, $level, $flag, $ty, GetStruct <$ty>) ;
175
+ ( $name: ident, GetOnly , $level: expr, $flag: path, $ty: ty) => {
176
+ sockopt_impl!( $name, GetOnly , $level, $flag, $ty, GetStruct <$ty>) ;
177
177
} ;
178
178
179
- ( GetOnly , $name: ident, $level: expr, $flag: path, $ty: ty, $getter: ty) => {
179
+ ( $name: ident, GetOnly , $level: expr, $flag: path, $ty: ty, $getter: ty) => {
180
180
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
181
181
pub struct $name;
182
182
183
183
getsockopt_impl!( $name, $level, $flag, $ty, $getter) ;
184
184
} ;
185
185
186
- ( SetOnly , $name: ident, $level: expr, $flag: path, $ty: ty) => {
187
- sockopt_impl!( SetOnly , $name, $level, $flag, $ty, SetStruct <$ty>) ;
186
+ ( $name: ident, SetOnly , $level: expr, $flag: path, $ty: ty) => {
187
+ sockopt_impl!( $name, SetOnly , $level, $flag, $ty, SetStruct <$ty>) ;
188
188
} ;
189
189
190
- ( SetOnly , $name: ident, $level: expr, $flag: path, $ty: ty, $setter: ty) => {
190
+ ( $name: ident, SetOnly , $level: expr, $flag: path, $ty: ty, $setter: ty) => {
191
191
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
192
192
pub struct $name;
193
193
194
194
setsockopt_impl!( $name, $level, $flag, $ty, $setter) ;
195
195
} ;
196
196
197
- ( Both , $name: ident, $level: expr, $flag: path, $ty: ty, $getter: ty, $setter: ty) => {
197
+ ( $name: ident, Both , $level: expr, $flag: path, $ty: ty, $getter: ty, $setter: ty) => {
198
198
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
199
199
pub struct $name;
200
200
201
201
setsockopt_impl!( $name, $level, $flag, $ty, $setter) ;
202
202
getsockopt_impl!( $name, $level, $flag, $ty, $getter) ;
203
203
} ;
204
204
205
- ( Both , $name: ident, $level: expr, $flag: path, $ty: ty) => {
206
- sockopt_impl!( Both , $name, $level, $flag, $ty, GetStruct <$ty>, SetStruct <$ty>) ;
205
+ ( $name: ident, Both , $level: expr, $flag: path, $ty: ty) => {
206
+ sockopt_impl!( $name, Both , $level, $flag, $ty, GetStruct <$ty>, SetStruct <$ty>) ;
207
207
} ;
208
208
}
209
209
@@ -213,17 +213,17 @@ macro_rules! sockopt_impl {
213
213
*
214
214
*/
215
215
216
- sockopt_impl ! ( Both , ReuseAddr , libc:: SOL_SOCKET , libc:: SO_REUSEADDR , bool ) ;
216
+ sockopt_impl ! ( ReuseAddr , Both , libc:: SOL_SOCKET , libc:: SO_REUSEADDR , bool ) ;
217
217
#[ cfg( not( any( target_os = "illumos" , target_os = "solaris" ) ) ) ]
218
- sockopt_impl ! ( Both , ReusePort , libc:: SOL_SOCKET , libc:: SO_REUSEPORT , bool ) ;
219
- sockopt_impl ! ( Both , TcpNoDelay , libc:: IPPROTO_TCP , libc:: TCP_NODELAY , bool ) ;
220
- sockopt_impl ! ( Both , Linger , libc:: SOL_SOCKET , libc:: SO_LINGER , libc:: linger) ;
221
- sockopt_impl ! ( SetOnly , IpAddMembership , libc:: IPPROTO_IP , libc:: IP_ADD_MEMBERSHIP , super :: IpMembershipRequest ) ;
222
- sockopt_impl ! ( SetOnly , IpDropMembership , libc:: IPPROTO_IP , libc:: IP_DROP_MEMBERSHIP , super :: IpMembershipRequest ) ;
218
+ sockopt_impl ! ( ReusePort , Both , libc:: SOL_SOCKET , libc:: SO_REUSEPORT , bool ) ;
219
+ sockopt_impl ! ( TcpNoDelay , Both , libc:: IPPROTO_TCP , libc:: TCP_NODELAY , bool ) ;
220
+ sockopt_impl ! ( Linger , Both , libc:: SOL_SOCKET , libc:: SO_LINGER , libc:: linger) ;
221
+ sockopt_impl ! ( IpAddMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_ADD_MEMBERSHIP , super :: IpMembershipRequest ) ;
222
+ sockopt_impl ! ( IpDropMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_DROP_MEMBERSHIP , super :: IpMembershipRequest ) ;
223
223
cfg_if ! {
224
224
if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
225
- sockopt_impl!( SetOnly , Ipv6AddMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_ADD_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
226
- sockopt_impl!( SetOnly , Ipv6DropMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
225
+ sockopt_impl!( Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_ADD_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
226
+ sockopt_impl!( Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
227
227
} else if #[ cfg( any( target_os = "dragonfly" ,
228
228
target_os = "freebsd" ,
229
229
target_os = "illumos" ,
@@ -232,93 +232,93 @@ cfg_if! {
232
232
target_os = "netbsd" ,
233
233
target_os = "openbsd" ,
234
234
target_os = "solaris" ) ) ] {
235
- sockopt_impl!( SetOnly , Ipv6AddMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_JOIN_GROUP , super :: Ipv6MembershipRequest ) ;
236
- sockopt_impl!( SetOnly , Ipv6DropMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_LEAVE_GROUP , super :: Ipv6MembershipRequest ) ;
235
+ sockopt_impl!( Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_JOIN_GROUP , super :: Ipv6MembershipRequest ) ;
236
+ sockopt_impl!( Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_LEAVE_GROUP , super :: Ipv6MembershipRequest ) ;
237
237
}
238
238
}
239
- sockopt_impl ! ( Both , IpMulticastTtl , libc:: IPPROTO_IP , libc:: IP_MULTICAST_TTL , u8 ) ;
240
- sockopt_impl ! ( Both , IpMulticastLoop , libc:: IPPROTO_IP , libc:: IP_MULTICAST_LOOP , bool ) ;
239
+ sockopt_impl ! ( IpMulticastTtl , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_TTL , u8 ) ;
240
+ sockopt_impl ! ( IpMulticastLoop , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_LOOP , bool ) ;
241
241
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
242
- sockopt_impl ! ( Both , IpFreebind , libc:: IPPROTO_IP , libc:: IP_FREEBIND , bool ) ;
243
- sockopt_impl ! ( Both , ReceiveTimeout , libc:: SOL_SOCKET , libc:: SO_RCVTIMEO , TimeVal ) ;
244
- sockopt_impl ! ( Both , SendTimeout , libc:: SOL_SOCKET , libc:: SO_SNDTIMEO , TimeVal ) ;
245
- sockopt_impl ! ( Both , Broadcast , libc:: SOL_SOCKET , libc:: SO_BROADCAST , bool ) ;
246
- sockopt_impl ! ( Both , OobInline , libc:: SOL_SOCKET , libc:: SO_OOBINLINE , bool ) ;
247
- sockopt_impl ! ( GetOnly , SocketError , libc:: SOL_SOCKET , libc:: SO_ERROR , i32 ) ;
248
- sockopt_impl ! ( Both , KeepAlive , libc:: SOL_SOCKET , libc:: SO_KEEPALIVE , bool ) ;
242
+ sockopt_impl ! ( IpFreebind , Both , libc:: IPPROTO_IP , libc:: IP_FREEBIND , bool ) ;
243
+ sockopt_impl ! ( ReceiveTimeout , Both , libc:: SOL_SOCKET , libc:: SO_RCVTIMEO , TimeVal ) ;
244
+ sockopt_impl ! ( SendTimeout , Both , libc:: SOL_SOCKET , libc:: SO_SNDTIMEO , TimeVal ) ;
245
+ sockopt_impl ! ( Broadcast , Both , libc:: SOL_SOCKET , libc:: SO_BROADCAST , bool ) ;
246
+ sockopt_impl ! ( OobInline , Both , libc:: SOL_SOCKET , libc:: SO_OOBINLINE , bool ) ;
247
+ sockopt_impl ! ( SocketError , GetOnly , libc:: SOL_SOCKET , libc:: SO_ERROR , i32 ) ;
248
+ sockopt_impl ! ( KeepAlive , Both , libc:: SOL_SOCKET , libc:: SO_KEEPALIVE , bool ) ;
249
249
#[ cfg( any(
250
250
target_os = "dragonfly" ,
251
251
target_os = "freebsd" ,
252
252
target_os = "macos" ,
253
253
target_os = "ios"
254
254
) ) ]
255
255
// Get the credentials of the peer process of a connected unix domain socket.
256
- sockopt_impl ! ( GetOnly , LocalPeerCred , 0 , libc:: LOCAL_PEERCRED , super :: XuCred ) ;
256
+ sockopt_impl ! ( LocalPeerCred , GetOnly , 0 , libc:: LOCAL_PEERCRED , super :: XuCred ) ;
257
257
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
258
- sockopt_impl ! ( GetOnly , PeerCredentials , libc:: SOL_SOCKET , libc:: SO_PEERCRED , super :: UnixCredentials ) ;
258
+ sockopt_impl ! ( PeerCredentials , GetOnly , libc:: SOL_SOCKET , libc:: SO_PEERCRED , super :: UnixCredentials ) ;
259
259
#[ cfg( any( target_os = "ios" ,
260
260
target_os = "macos" ) ) ]
261
- sockopt_impl ! ( Both , TcpKeepAlive , libc:: IPPROTO_TCP , libc:: TCP_KEEPALIVE , u32 ) ;
261
+ sockopt_impl ! ( TcpKeepAlive , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPALIVE , u32 ) ;
262
262
#[ cfg( any( target_os = "android" ,
263
263
target_os = "dragonfly" ,
264
264
target_os = "freebsd" ,
265
265
target_os = "linux" ,
266
266
target_os = "nacl" ) ) ]
267
- sockopt_impl ! ( Both , TcpKeepIdle , libc:: IPPROTO_TCP , libc:: TCP_KEEPIDLE , u32 ) ;
267
+ sockopt_impl ! ( TcpKeepIdle , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPIDLE , u32 ) ;
268
268
cfg_if ! {
269
269
if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
270
- sockopt_impl!( Both , TcpMaxSeg , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
270
+ sockopt_impl!( TcpMaxSeg , Both , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
271
271
} else {
272
- sockopt_impl!( GetOnly , TcpMaxSeg , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
272
+ sockopt_impl!( TcpMaxSeg , GetOnly , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
273
273
}
274
274
}
275
275
#[ cfg( not( target_os = "openbsd" ) ) ]
276
- sockopt_impl ! ( Both , TcpKeepCount , libc:: IPPROTO_TCP , libc:: TCP_KEEPCNT , u32 ) ;
276
+ sockopt_impl ! ( TcpKeepCount , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPCNT , u32 ) ;
277
277
#[ cfg( any( target_os = "android" ,
278
278
target_os = "fuchsia" ,
279
279
target_os = "linux" ) ) ]
280
- sockopt_impl ! ( Both , TcpRepair , libc:: IPPROTO_TCP , libc:: TCP_REPAIR , u32 ) ;
280
+ sockopt_impl ! ( TcpRepair , Both , libc:: IPPROTO_TCP , libc:: TCP_REPAIR , u32 ) ;
281
281
#[ cfg( not( target_os = "openbsd" ) ) ]
282
- sockopt_impl ! ( Both , TcpKeepInterval , libc:: IPPROTO_TCP , libc:: TCP_KEEPINTVL , u32 ) ;
282
+ sockopt_impl ! ( TcpKeepInterval , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPINTVL , u32 ) ;
283
283
#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
284
- sockopt_impl ! ( Both , TcpUserTimeout , libc:: IPPROTO_TCP , libc:: TCP_USER_TIMEOUT , u32 ) ;
285
- sockopt_impl ! ( Both , RcvBuf , libc:: SOL_SOCKET , libc:: SO_RCVBUF , usize ) ;
286
- sockopt_impl ! ( Both , SndBuf , libc:: SOL_SOCKET , libc:: SO_SNDBUF , usize ) ;
284
+ sockopt_impl ! ( TcpUserTimeout , Both , libc:: IPPROTO_TCP , libc:: TCP_USER_TIMEOUT , u32 ) ;
285
+ sockopt_impl ! ( RcvBuf , Both , libc:: SOL_SOCKET , libc:: SO_RCVBUF , usize ) ;
286
+ sockopt_impl ! ( SndBuf , Both , libc:: SOL_SOCKET , libc:: SO_SNDBUF , usize ) ;
287
287
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
288
- sockopt_impl ! ( SetOnly , RcvBufForce , libc:: SOL_SOCKET , libc:: SO_RCVBUFFORCE , usize ) ;
288
+ sockopt_impl ! ( RcvBufForce , SetOnly , libc:: SOL_SOCKET , libc:: SO_RCVBUFFORCE , usize ) ;
289
289
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
290
- sockopt_impl ! ( SetOnly , SndBufForce , libc:: SOL_SOCKET , libc:: SO_SNDBUFFORCE , usize ) ;
291
- sockopt_impl ! ( GetOnly , SockType , libc:: SOL_SOCKET , libc:: SO_TYPE , super :: SockType ) ;
292
- sockopt_impl ! ( GetOnly , AcceptConn , libc:: SOL_SOCKET , libc:: SO_ACCEPTCONN , bool ) ;
290
+ sockopt_impl ! ( SndBufForce , SetOnly , libc:: SOL_SOCKET , libc:: SO_SNDBUFFORCE , usize ) ;
291
+ sockopt_impl ! ( SockType , GetOnly , libc:: SOL_SOCKET , libc:: SO_TYPE , super :: SockType ) ;
292
+ sockopt_impl ! ( AcceptConn , GetOnly , libc:: SOL_SOCKET , libc:: SO_ACCEPTCONN , bool ) ;
293
293
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
294
- sockopt_impl ! ( Both , BindToDevice , libc:: SOL_SOCKET , libc:: SO_BINDTODEVICE , OsString <[ u8 ; libc:: IFNAMSIZ ] >) ;
294
+ sockopt_impl ! ( BindToDevice , Both , libc:: SOL_SOCKET , libc:: SO_BINDTODEVICE , OsString <[ u8 ; libc:: IFNAMSIZ ] >) ;
295
295
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
296
- sockopt_impl ! ( GetOnly , OriginalDst , libc:: SOL_IP , libc:: SO_ORIGINAL_DST , libc:: sockaddr_in) ;
296
+ sockopt_impl ! ( OriginalDst , GetOnly , libc:: SOL_IP , libc:: SO_ORIGINAL_DST , libc:: sockaddr_in) ;
297
297
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
298
- sockopt_impl ! ( GetOnly , Ip6tOriginalDst , libc:: SOL_IPV6 , libc:: IP6T_SO_ORIGINAL_DST , libc:: sockaddr_in6) ;
299
- sockopt_impl ! ( Both , ReceiveTimestamp , libc:: SOL_SOCKET , libc:: SO_TIMESTAMP , bool ) ;
298
+ sockopt_impl ! ( Ip6tOriginalDst , GetOnly , libc:: SOL_IPV6 , libc:: IP6T_SO_ORIGINAL_DST , libc:: sockaddr_in6) ;
299
+ sockopt_impl ! ( ReceiveTimestamp , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMP , bool ) ;
300
300
#[ cfg( all( target_os = "linux" ) ) ]
301
- sockopt_impl ! ( Both , ReceiveTimestampns , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPNS , bool ) ;
301
+ sockopt_impl ! ( ReceiveTimestampns , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPNS , bool ) ;
302
302
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
303
- sockopt_impl ! ( Both , IpTransparent , libc:: SOL_IP , libc:: IP_TRANSPARENT , bool ) ;
303
+ sockopt_impl ! ( IpTransparent , Both , libc:: SOL_IP , libc:: IP_TRANSPARENT , bool ) ;
304
304
#[ cfg( target_os = "openbsd" ) ]
305
- sockopt_impl ! ( Both , BindAny , libc:: SOL_SOCKET , libc:: SO_BINDANY , bool ) ;
305
+ sockopt_impl ! ( BindAny , Both , libc:: SOL_SOCKET , libc:: SO_BINDANY , bool ) ;
306
306
#[ cfg( target_os = "freebsd" ) ]
307
- sockopt_impl ! ( Both , BindAny , libc:: IPPROTO_IP , libc:: IP_BINDANY , bool ) ;
307
+ sockopt_impl ! ( BindAny , Both , libc:: IPPROTO_IP , libc:: IP_BINDANY , bool ) ;
308
308
#[ cfg( target_os = "linux" ) ]
309
- sockopt_impl ! ( Both , Mark , libc:: SOL_SOCKET , libc:: SO_MARK , u32 ) ;
309
+ sockopt_impl ! ( Mark , Both , libc:: SOL_SOCKET , libc:: SO_MARK , u32 ) ;
310
310
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
311
- sockopt_impl ! ( Both , PassCred , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
311
+ sockopt_impl ! ( PassCred , Both , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
312
312
#[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
313
- sockopt_impl ! ( Both , TcpCongestion , libc:: IPPROTO_TCP , libc:: TCP_CONGESTION , OsString <[ u8 ; TCP_CA_NAME_MAX ] >) ;
313
+ sockopt_impl ! ( TcpCongestion , Both , libc:: IPPROTO_TCP , libc:: TCP_CONGESTION , OsString <[ u8 ; TCP_CA_NAME_MAX ] >) ;
314
314
#[ cfg( any(
315
315
target_os = "android" ,
316
316
target_os = "ios" ,
317
317
target_os = "linux" ,
318
318
target_os = "macos" ,
319
319
target_os = "netbsd" ,
320
320
) ) ]
321
- sockopt_impl ! ( Both , Ipv4PacketInfo , libc:: IPPROTO_IP , libc:: IP_PKTINFO , bool ) ;
321
+ sockopt_impl ! ( Ipv4PacketInfo , Both , libc:: IPPROTO_IP , libc:: IP_PKTINFO , bool ) ;
322
322
#[ cfg( any(
323
323
target_os = "android" ,
324
324
target_os = "freebsd" ,
@@ -328,38 +328,38 @@ sockopt_impl!(Both, Ipv4PacketInfo, libc::IPPROTO_IP, libc::IP_PKTINFO, bool);
328
328
target_os = "netbsd" ,
329
329
target_os = "openbsd" ,
330
330
) ) ]
331
- sockopt_impl ! ( Both , Ipv6RecvPacketInfo , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVPKTINFO , bool ) ;
331
+ sockopt_impl ! ( Ipv6RecvPacketInfo , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVPKTINFO , bool ) ;
332
332
#[ cfg( any(
333
333
target_os = "freebsd" ,
334
334
target_os = "ios" ,
335
335
target_os = "macos" ,
336
336
target_os = "netbsd" ,
337
337
target_os = "openbsd" ,
338
338
) ) ]
339
- sockopt_impl ! ( Both , Ipv4RecvIf , libc:: IPPROTO_IP , libc:: IP_RECVIF , bool ) ;
339
+ sockopt_impl ! ( Ipv4RecvIf , Both , libc:: IPPROTO_IP , libc:: IP_RECVIF , bool ) ;
340
340
#[ cfg( any(
341
341
target_os = "freebsd" ,
342
342
target_os = "ios" ,
343
343
target_os = "macos" ,
344
344
target_os = "netbsd" ,
345
345
target_os = "openbsd" ,
346
346
) ) ]
347
- sockopt_impl ! ( Both , Ipv4RecvDstAddr , libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR , bool ) ;
347
+ sockopt_impl ! ( Ipv4RecvDstAddr , Both , libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR , bool ) ;
348
348
#[ cfg( target_os = "linux" ) ]
349
- sockopt_impl ! ( Both , UdpGsoSegment , libc:: SOL_UDP , libc:: UDP_SEGMENT , libc:: c_int) ;
349
+ sockopt_impl ! ( UdpGsoSegment , Both , libc:: SOL_UDP , libc:: UDP_SEGMENT , libc:: c_int) ;
350
350
#[ cfg( target_os = "linux" ) ]
351
- sockopt_impl ! ( Both , UdpGroSegment , libc:: IPPROTO_UDP , libc:: UDP_GRO , bool ) ;
351
+ sockopt_impl ! ( UdpGroSegment , Both , libc:: IPPROTO_UDP , libc:: UDP_GRO , bool ) ;
352
352
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
353
- sockopt_impl ! ( Both , RxqOvfl , libc:: SOL_SOCKET , libc:: SO_RXQ_OVFL , libc:: c_int) ;
354
- sockopt_impl ! ( Both , Ipv6V6Only , libc:: IPPROTO_IPV6 , libc:: IPV6_V6ONLY , bool ) ;
353
+ sockopt_impl ! ( RxqOvfl , Both , libc:: SOL_SOCKET , libc:: SO_RXQ_OVFL , libc:: c_int) ;
354
+ sockopt_impl ! ( Ipv6V6Only , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_V6ONLY , bool ) ;
355
355
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
356
- sockopt_impl ! ( Both , Ipv4RecvErr , libc:: IPPROTO_IP , libc:: IP_RECVERR , bool ) ;
356
+ sockopt_impl ! ( Ipv4RecvErr , Both , libc:: IPPROTO_IP , libc:: IP_RECVERR , bool ) ;
357
357
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
358
- sockopt_impl ! ( Both , Ipv6RecvErr , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVERR , bool ) ;
358
+ sockopt_impl ! ( Ipv6RecvErr , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVERR , bool ) ;
359
359
#[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux" ) ) ]
360
- sockopt_impl ! ( Both , Ipv4Ttl , libc:: IPPROTO_IP , libc:: IP_TTL , libc:: c_int) ;
360
+ sockopt_impl ! ( Ipv4Ttl , Both , libc:: IPPROTO_IP , libc:: IP_TTL , libc:: c_int) ;
361
361
#[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux" ) ) ]
362
- sockopt_impl ! ( Both , Ipv6Ttl , libc:: IPPROTO_IPV6 , libc:: IPV6_UNICAST_HOPS , libc:: c_int) ;
362
+ sockopt_impl ! ( Ipv6Ttl , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_UNICAST_HOPS , libc:: c_int) ;
363
363
364
364
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
365
365
#[ derive( Copy , Clone , Debug ) ]
0 commit comments