@@ -252,8 +252,8 @@ sockopt_impl!(
252
252
/// Permits multiple AF_INET or AF_INET6 sockets to be bound to an
253
253
/// identical socket address.
254
254
ReusePort , Both , libc:: SOL_SOCKET , libc:: SO_REUSEPORT , bool ) ;
255
+ #[ cfg( feature = "net" ) ]
255
256
sockopt_impl ! (
256
- #[ cfg( feature = "net" ) ]
257
257
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
258
258
/// Under most circumstances, TCP sends data when it is presented; when
259
259
/// outstanding data has not yet been acknowledged, it gathers small amounts
@@ -268,27 +268,27 @@ sockopt_impl!(
268
268
/// queued messages for the socket have been successfully sent or the
269
269
/// linger timeout has been reached.
270
270
Linger , Both , libc:: SOL_SOCKET , libc:: SO_LINGER , libc:: linger) ;
271
+ #[ cfg( feature = "net" ) ]
271
272
sockopt_impl ! (
272
- #[ cfg( feature = "net" ) ]
273
273
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
274
274
/// Join a multicast group
275
275
IpAddMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_ADD_MEMBERSHIP ,
276
276
super :: IpMembershipRequest ) ;
277
+ #[ cfg( feature = "net" ) ]
277
278
sockopt_impl ! (
278
- #[ cfg( feature = "net" ) ]
279
279
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
280
280
/// Leave a multicast group.
281
281
IpDropMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_DROP_MEMBERSHIP ,
282
282
super :: IpMembershipRequest ) ;
283
283
cfg_if ! {
284
284
if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
285
+ #[ cfg( feature = "net" ) ]
285
286
sockopt_impl!(
286
- #[ cfg( feature = "net" ) ]
287
287
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
288
288
/// Join an IPv6 multicast group.
289
289
Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_ADD_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
290
+ #[ cfg( feature = "net" ) ]
290
291
sockopt_impl!(
291
- #[ cfg( feature = "net" ) ]
292
292
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
293
293
/// Leave an IPv6 multicast group.
294
294
Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
@@ -300,35 +300,35 @@ cfg_if! {
300
300
target_os = "netbsd" ,
301
301
target_os = "openbsd" ,
302
302
target_os = "solaris" ) ) ] {
303
+ #[ cfg( feature = "net" ) ]
303
304
sockopt_impl!(
304
- #[ cfg( feature = "net" ) ]
305
305
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
306
306
/// Join an IPv6 multicast group.
307
307
Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 ,
308
308
libc:: IPV6_JOIN_GROUP , super :: Ipv6MembershipRequest ) ;
309
+ #[ cfg( feature = "net" ) ]
309
310
sockopt_impl!(
310
- #[ cfg( feature = "net" ) ]
311
311
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
312
312
/// Leave an IPv6 multicast group.
313
313
Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 ,
314
314
libc:: IPV6_LEAVE_GROUP , super :: Ipv6MembershipRequest ) ;
315
315
}
316
316
}
317
+ #[ cfg( feature = "net" ) ]
317
318
sockopt_impl ! (
318
- #[ cfg( feature = "net" ) ]
319
319
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
320
320
/// Set or read the time-to-live value of outgoing multicast packets for
321
321
/// this socket.
322
322
IpMulticastTtl , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_TTL , u8 ) ;
323
+ #[ cfg( feature = "net" ) ]
323
324
sockopt_impl ! (
324
- #[ cfg( feature = "net" ) ]
325
325
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
326
326
/// Set or read a boolean integer argument that determines whether sent
327
327
/// multicast packets should be looped back to the local sockets.
328
328
IpMulticastLoop , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_LOOP , bool ) ;
329
329
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
330
+ #[ cfg( feature = "net" ) ]
330
331
sockopt_impl ! (
331
- #[ cfg( feature = "net" ) ]
332
332
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
333
333
/// If enabled, this boolean option allows binding to an IP address that
334
334
/// is nonlocal or does not (yet) exist.
@@ -368,8 +368,8 @@ sockopt_impl!(
368
368
PeerCredentials , GetOnly , libc:: SOL_SOCKET , libc:: SO_PEERCRED , super :: UnixCredentials ) ;
369
369
#[ cfg( any( target_os = "ios" ,
370
370
target_os = "macos" ) ) ]
371
+ #[ cfg( feature = "net" ) ]
371
372
sockopt_impl ! (
372
- #[ cfg( feature = "net" ) ]
373
373
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
374
374
/// Specify the amount of time, in seconds, that the connection must be idle
375
375
/// before keepalive probes (if enabled) are sent.
@@ -379,8 +379,8 @@ sockopt_impl!(
379
379
target_os = "freebsd" ,
380
380
target_os = "linux" ,
381
381
target_os = "nacl" ) ) ]
382
+ #[ cfg( feature = "net" ) ]
382
383
sockopt_impl ! (
383
- #[ cfg( feature = "net" ) ]
384
384
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
385
385
/// The time (in seconds) the connection needs to remain idle before TCP
386
386
/// starts sending keepalive probes
@@ -397,8 +397,8 @@ cfg_if! {
397
397
}
398
398
}
399
399
#[ cfg( not( target_os = "openbsd" ) ) ]
400
+ #[ cfg( feature = "net" ) ]
400
401
sockopt_impl ! (
401
- #[ cfg( feature = "net" ) ]
402
402
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
403
403
/// The maximum number of keepalive probes TCP should send before
404
404
/// dropping the connection.
@@ -411,14 +411,14 @@ sockopt_impl!(
411
411
// Not documented by Linux!
412
412
TcpRepair , Both , libc:: IPPROTO_TCP , libc:: TCP_REPAIR , u32 ) ;
413
413
#[ cfg( not( target_os = "openbsd" ) ) ]
414
+ #[ cfg( feature = "net" ) ]
414
415
sockopt_impl ! (
415
- #[ cfg( feature = "net" ) ]
416
416
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
417
417
/// The time (in seconds) between individual keepalive probes.
418
418
TcpKeepInterval , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPINTVL , u32 ) ;
419
419
#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
420
+ #[ cfg( feature = "net" ) ]
420
421
sockopt_impl ! (
421
- #[ cfg( feature = "net" ) ]
422
422
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
423
423
/// Specifies the maximum amount of time in milliseconds that transmitted
424
424
/// data may remain unacknowledged before TCP will forcibly close the
@@ -454,8 +454,8 @@ sockopt_impl!(
454
454
/// Bind this socket to a particular device like “eth0”.
455
455
BindToDevice , Both , libc:: SOL_SOCKET , libc:: SO_BINDTODEVICE , OsString <[ u8 ; libc:: IFNAMSIZ ] >) ;
456
456
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
457
+ #[ cfg( feature = "net" ) ]
457
458
sockopt_impl ! (
458
- #[ cfg( feature = "net" ) ]
459
459
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
460
460
#[ allow( missing_docs) ]
461
461
// Not documented by Linux!
@@ -473,21 +473,21 @@ sockopt_impl!(
473
473
/// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message.
474
474
ReceiveTimestampns , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPNS , bool ) ;
475
475
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
476
+ #[ cfg( feature = "net" ) ]
476
477
sockopt_impl ! (
477
- #[ cfg( feature = "net" ) ]
478
478
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
479
479
/// Setting this boolean option enables transparent proxying on this socket.
480
480
IpTransparent , Both , libc:: SOL_IP , libc:: IP_TRANSPARENT , bool ) ;
481
481
#[ cfg( target_os = "openbsd" ) ]
482
+ #[ cfg( feature = "net" ) ]
482
483
sockopt_impl ! (
483
- #[ cfg( feature = "net" ) ]
484
484
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
485
485
/// Allows the socket to be bound to addresses which are not local to the
486
486
/// machine, so it can be used to make a transparent proxy.
487
487
BindAny , Both , libc:: SOL_SOCKET , libc:: SO_BINDANY , bool ) ;
488
488
#[ cfg( target_os = "freebsd" ) ]
489
+ #[ cfg( feature = "net" ) ]
489
490
sockopt_impl ! (
490
- #[ cfg( feature = "net" ) ]
491
491
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
492
492
/// Can `bind(2)` to any address, even one not bound to any available
493
493
/// network interface in the system.
@@ -503,8 +503,8 @@ sockopt_impl!(
503
503
/// message.
504
504
PassCred , Both , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
505
505
#[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
506
+ #[ cfg( feature = "net" ) ]
506
507
sockopt_impl ! (
507
- #[ cfg( feature = "net" ) ]
508
508
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
509
509
/// This option allows the caller to set the TCP congestion control
510
510
/// algorithm to be used, on a per-socket basis.
@@ -516,8 +516,8 @@ sockopt_impl!(
516
516
target_os = "macos" ,
517
517
target_os = "netbsd" ,
518
518
) ) ]
519
+ #[ cfg( feature = "net" ) ]
519
520
sockopt_impl ! (
520
- #[ cfg( feature = "net" ) ]
521
521
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
522
522
/// Pass an `IP_PKTINFO` ancillary message that contains a pktinfo
523
523
/// structure that supplies some information about the incoming packet.
@@ -531,8 +531,8 @@ sockopt_impl!(
531
531
target_os = "netbsd" ,
532
532
target_os = "openbsd" ,
533
533
) ) ]
534
+ #[ cfg( feature = "net" ) ]
534
535
sockopt_impl ! (
535
- #[ cfg( feature = "net" ) ]
536
536
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
537
537
/// Set delivery of the `IPV6_PKTINFO` control message on incoming
538
538
/// datagrams.
@@ -544,8 +544,8 @@ sockopt_impl!(
544
544
target_os = "netbsd" ,
545
545
target_os = "openbsd" ,
546
546
) ) ]
547
+ #[ cfg( feature = "net" ) ]
547
548
sockopt_impl ! (
548
- #[ cfg( feature = "net" ) ]
549
549
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
550
550
/// The `recvmsg(2)` call returns a `struct sockaddr_dl` corresponding to
551
551
/// the interface on which the packet was received.
@@ -557,22 +557,22 @@ sockopt_impl!(
557
557
target_os = "netbsd" ,
558
558
target_os = "openbsd" ,
559
559
) ) ]
560
+ #[ cfg( feature = "net" ) ]
560
561
sockopt_impl ! (
561
- #[ cfg( feature = "net" ) ]
562
562
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
563
563
/// The `recvmsg(2)` call will return the destination IP address for a UDP
564
564
/// datagram.
565
565
Ipv4RecvDstAddr , Both , libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR , bool ) ;
566
566
#[ cfg( target_os = "linux" ) ]
567
+ #[ cfg( feature = "net" ) ]
567
568
sockopt_impl ! (
568
- #[ cfg( feature = "net" ) ]
569
569
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
570
570
#[ allow( missing_docs) ]
571
571
// Not documented by Linux!
572
572
UdpGsoSegment , Both , libc:: SOL_UDP , libc:: UDP_SEGMENT , libc:: c_int) ;
573
573
#[ cfg( target_os = "linux" ) ]
574
+ #[ cfg( feature = "net" ) ]
574
575
sockopt_impl ! (
575
- #[ cfg( feature = "net" ) ]
576
576
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
577
577
#[ allow( missing_docs) ]
578
578
// Not documented by Linux!
@@ -583,8 +583,8 @@ sockopt_impl!(
583
583
/// be attached to received skbs indicating the number of packets dropped by
584
584
/// the socket since its creation.
585
585
RxqOvfl , Both , libc:: SOL_SOCKET , libc:: SO_RXQ_OVFL , libc:: c_int) ;
586
+ #[ cfg( feature = "net" ) ]
586
587
sockopt_impl ! (
587
- #[ cfg( feature = "net" ) ]
588
588
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
589
589
/// The socket is restricted to sending and receiving IPv6 packets only.
590
590
Ipv6V6Only , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_V6ONLY , bool ) ;
0 commit comments