Skip to content

Commit 6a800c0

Browse files
committed
fixup
1 parent 11572c2 commit 6a800c0

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/sys/socket/sockopt.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ sockopt_impl!(
252252
/// Permits multiple AF_INET or AF_INET6 sockets to be bound to an
253253
/// identical socket address.
254254
ReusePort, Both, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool);
255+
#[cfg(feature = "net")]
255256
sockopt_impl!(
256-
#[cfg(feature = "net")]
257257
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
258258
/// Under most circumstances, TCP sends data when it is presented; when
259259
/// outstanding data has not yet been acknowledged, it gathers small amounts
@@ -268,27 +268,27 @@ sockopt_impl!(
268268
/// queued messages for the socket have been successfully sent or the
269269
/// linger timeout has been reached.
270270
Linger, Both, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger);
271+
#[cfg(feature = "net")]
271272
sockopt_impl!(
272-
#[cfg(feature = "net")]
273273
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
274274
/// Join a multicast group
275275
IpAddMembership, SetOnly, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP,
276276
super::IpMembershipRequest);
277+
#[cfg(feature = "net")]
277278
sockopt_impl!(
278-
#[cfg(feature = "net")]
279279
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
280280
/// Leave a multicast group.
281281
IpDropMembership, SetOnly, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP,
282282
super::IpMembershipRequest);
283283
cfg_if! {
284284
if #[cfg(any(target_os = "android", target_os = "linux"))] {
285+
#[cfg(feature = "net")]
285286
sockopt_impl!(
286-
#[cfg(feature = "net")]
287287
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
288288
/// Join an IPv6 multicast group.
289289
Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_ADD_MEMBERSHIP, super::Ipv6MembershipRequest);
290+
#[cfg(feature = "net")]
290291
sockopt_impl!(
291-
#[cfg(feature = "net")]
292292
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
293293
/// Leave an IPv6 multicast group.
294294
Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_DROP_MEMBERSHIP, super::Ipv6MembershipRequest);
@@ -300,35 +300,35 @@ cfg_if! {
300300
target_os = "netbsd",
301301
target_os = "openbsd",
302302
target_os = "solaris"))] {
303+
#[cfg(feature = "net")]
303304
sockopt_impl!(
304-
#[cfg(feature = "net")]
305305
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
306306
/// Join an IPv6 multicast group.
307307
Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6,
308308
libc::IPV6_JOIN_GROUP, super::Ipv6MembershipRequest);
309+
#[cfg(feature = "net")]
309310
sockopt_impl!(
310-
#[cfg(feature = "net")]
311311
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
312312
/// Leave an IPv6 multicast group.
313313
Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6,
314314
libc::IPV6_LEAVE_GROUP, super::Ipv6MembershipRequest);
315315
}
316316
}
317+
#[cfg(feature = "net")]
317318
sockopt_impl!(
318-
#[cfg(feature = "net")]
319319
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
320320
/// Set or read the time-to-live value of outgoing multicast packets for
321321
/// this socket.
322322
IpMulticastTtl, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_TTL, u8);
323+
#[cfg(feature = "net")]
323324
sockopt_impl!(
324-
#[cfg(feature = "net")]
325325
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
326326
/// Set or read a boolean integer argument that determines whether sent
327327
/// multicast packets should be looped back to the local sockets.
328328
IpMulticastLoop, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_LOOP, bool);
329329
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
330+
#[cfg(feature = "net")]
330331
sockopt_impl!(
331-
#[cfg(feature = "net")]
332332
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
333333
/// If enabled, this boolean option allows binding to an IP address that
334334
/// is nonlocal or does not (yet) exist.
@@ -368,8 +368,8 @@ sockopt_impl!(
368368
PeerCredentials, GetOnly, libc::SOL_SOCKET, libc::SO_PEERCRED, super::UnixCredentials);
369369
#[cfg(any(target_os = "ios",
370370
target_os = "macos"))]
371+
#[cfg(feature = "net")]
371372
sockopt_impl!(
372-
#[cfg(feature = "net")]
373373
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
374374
/// Specify the amount of time, in seconds, that the connection must be idle
375375
/// before keepalive probes (if enabled) are sent.
@@ -379,8 +379,8 @@ sockopt_impl!(
379379
target_os = "freebsd",
380380
target_os = "linux",
381381
target_os = "nacl"))]
382+
#[cfg(feature = "net")]
382383
sockopt_impl!(
383-
#[cfg(feature = "net")]
384384
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
385385
/// The time (in seconds) the connection needs to remain idle before TCP
386386
/// starts sending keepalive probes
@@ -397,8 +397,8 @@ cfg_if! {
397397
}
398398
}
399399
#[cfg(not(target_os = "openbsd"))]
400+
#[cfg(feature = "net")]
400401
sockopt_impl!(
401-
#[cfg(feature = "net")]
402402
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
403403
/// The maximum number of keepalive probes TCP should send before
404404
/// dropping the connection.
@@ -411,14 +411,14 @@ sockopt_impl!(
411411
// Not documented by Linux!
412412
TcpRepair, Both, libc::IPPROTO_TCP, libc::TCP_REPAIR, u32);
413413
#[cfg(not(target_os = "openbsd"))]
414+
#[cfg(feature = "net")]
414415
sockopt_impl!(
415-
#[cfg(feature = "net")]
416416
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
417417
/// The time (in seconds) between individual keepalive probes.
418418
TcpKeepInterval, Both, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32);
419419
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
420+
#[cfg(feature = "net")]
420421
sockopt_impl!(
421-
#[cfg(feature = "net")]
422422
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
423423
/// Specifies the maximum amount of time in milliseconds that transmitted
424424
/// data may remain unacknowledged before TCP will forcibly close the
@@ -454,8 +454,8 @@ sockopt_impl!(
454454
/// Bind this socket to a particular device like “eth0”.
455455
BindToDevice, Both, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsString<[u8; libc::IFNAMSIZ]>);
456456
#[cfg(any(target_os = "android", target_os = "linux"))]
457+
#[cfg(feature = "net")]
457458
sockopt_impl!(
458-
#[cfg(feature = "net")]
459459
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
460460
#[allow(missing_docs)]
461461
// Not documented by Linux!
@@ -473,21 +473,21 @@ sockopt_impl!(
473473
/// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message.
474474
ReceiveTimestampns, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool);
475475
#[cfg(any(target_os = "android", target_os = "linux"))]
476+
#[cfg(feature = "net")]
476477
sockopt_impl!(
477-
#[cfg(feature = "net")]
478478
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
479479
/// Setting this boolean option enables transparent proxying on this socket.
480480
IpTransparent, Both, libc::SOL_IP, libc::IP_TRANSPARENT, bool);
481481
#[cfg(target_os = "openbsd")]
482+
#[cfg(feature = "net")]
482483
sockopt_impl!(
483-
#[cfg(feature = "net")]
484484
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
485485
/// Allows the socket to be bound to addresses which are not local to the
486486
/// machine, so it can be used to make a transparent proxy.
487487
BindAny, Both, libc::SOL_SOCKET, libc::SO_BINDANY, bool);
488488
#[cfg(target_os = "freebsd")]
489+
#[cfg(feature = "net")]
489490
sockopt_impl!(
490-
#[cfg(feature = "net")]
491491
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
492492
/// Can `bind(2)` to any address, even one not bound to any available
493493
/// network interface in the system.
@@ -503,8 +503,8 @@ sockopt_impl!(
503503
/// message.
504504
PassCred, Both, libc::SOL_SOCKET, libc::SO_PASSCRED, bool);
505505
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
506+
#[cfg(feature = "net")]
506507
sockopt_impl!(
507-
#[cfg(feature = "net")]
508508
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
509509
/// This option allows the caller to set the TCP congestion control
510510
/// algorithm to be used, on a per-socket basis.
@@ -516,8 +516,8 @@ sockopt_impl!(
516516
target_os = "macos",
517517
target_os = "netbsd",
518518
))]
519+
#[cfg(feature = "net")]
519520
sockopt_impl!(
520-
#[cfg(feature = "net")]
521521
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
522522
/// Pass an `IP_PKTINFO` ancillary message that contains a pktinfo
523523
/// structure that supplies some information about the incoming packet.
@@ -531,8 +531,8 @@ sockopt_impl!(
531531
target_os = "netbsd",
532532
target_os = "openbsd",
533533
))]
534+
#[cfg(feature = "net")]
534535
sockopt_impl!(
535-
#[cfg(feature = "net")]
536536
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
537537
/// Set delivery of the `IPV6_PKTINFO` control message on incoming
538538
/// datagrams.
@@ -544,8 +544,8 @@ sockopt_impl!(
544544
target_os = "netbsd",
545545
target_os = "openbsd",
546546
))]
547+
#[cfg(feature = "net")]
547548
sockopt_impl!(
548-
#[cfg(feature = "net")]
549549
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
550550
/// The `recvmsg(2)` call returns a `struct sockaddr_dl` corresponding to
551551
/// the interface on which the packet was received.
@@ -557,22 +557,22 @@ sockopt_impl!(
557557
target_os = "netbsd",
558558
target_os = "openbsd",
559559
))]
560+
#[cfg(feature = "net")]
560561
sockopt_impl!(
561-
#[cfg(feature = "net")]
562562
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
563563
/// The `recvmsg(2)` call will return the destination IP address for a UDP
564564
/// datagram.
565565
Ipv4RecvDstAddr, Both, libc::IPPROTO_IP, libc::IP_RECVDSTADDR, bool);
566566
#[cfg(target_os = "linux")]
567+
#[cfg(feature = "net")]
567568
sockopt_impl!(
568-
#[cfg(feature = "net")]
569569
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
570570
#[allow(missing_docs)]
571571
// Not documented by Linux!
572572
UdpGsoSegment, Both, libc::SOL_UDP, libc::UDP_SEGMENT, libc::c_int);
573573
#[cfg(target_os = "linux")]
574+
#[cfg(feature = "net")]
574575
sockopt_impl!(
575-
#[cfg(feature = "net")]
576576
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
577577
#[allow(missing_docs)]
578578
// Not documented by Linux!
@@ -583,8 +583,8 @@ sockopt_impl!(
583583
/// be attached to received skbs indicating the number of packets dropped by
584584
/// the socket since its creation.
585585
RxqOvfl, Both, libc::SOL_SOCKET, libc::SO_RXQ_OVFL, libc::c_int);
586+
#[cfg(feature = "net")]
586587
sockopt_impl!(
587-
#[cfg(feature = "net")]
588588
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
589589
/// The socket is restricted to sending and receiving IPv6 packets only.
590590
Ipv6V6Only, Both, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool);

0 commit comments

Comments
 (0)