@@ -16,7 +16,7 @@ use std::os::unix::ffi::OsStrExt;
16
16
17
17
// Constants
18
18
// TCP_CA_NAME_MAX isn't defined in user space include files
19
- #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
19
+ #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
20
20
const TCP_CA_NAME_MAX : usize = 16 ;
21
21
22
22
/// Helper for implementing `SetSockOpt` for a given socket option. See
@@ -432,7 +432,18 @@ sockopt_impl!(
432
432
#[ allow( missing_docs) ]
433
433
// Not documented by Linux!
434
434
Ip6tOriginalDst , GetOnly , libc:: SOL_IPV6 , libc:: IP6T_SO_ORIGINAL_DST , libc:: sockaddr_in6) ;
435
- sockopt_impl ! (
435
+ sockopt_impl ! (
436
+ /// Specifies exact type of timestamping information collected by the kernel
437
+ /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html)
438
+ /// Takes a bitwise `or` of libc timestamping options:
439
+ /// - [SOF_TIMESTAMPING_TX_HARDWARE][::libc::SOF_TIMESTAMPING_TX_HARDWARE]:
440
+ /// - [SOF_TIMESTAMPING_TX_SOFTWARE][::libc::SOF_TIMESTAMPING_TX_SOFTWARE]:
441
+ /// - [SOF_TIMESTAMPING_RX_HARDWARE][::libc::SOF_TIMESTAMPING_RX_HARDWARE]:
442
+ /// - [SOF_TIMESTAMPING_RX_SOFTWARE][::libc::SOF_TIMESTAMPING_RX_SOFTWARE]:
443
+ /// - [SOF_TIMESTAMPING_RAW_HARDWARE][::libc::SOF_TIMESTAMPING_RAW_HARDWARE]:
444
+ /// - [SOF_TIMESTAMPING_SOFTWARE][::libc::SOF_TIMESTAMPING_SOFTWARE]
445
+ Timestamping , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPING , u32 ) ;
446
+ sockopt_impl ! (
436
447
/// Enable or disable the receiving of the `SO_TIMESTAMP` control message.
437
448
ReceiveTimestamp , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMP , bool ) ;
438
449
#[ cfg( all( target_os = "linux" ) ) ]
@@ -463,7 +474,7 @@ sockopt_impl!(
463
474
/// Enable or disable the receiving of the `SCM_CREDENTIALS` control
464
475
/// message.
465
476
PassCred , Both , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
466
- #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
477
+ #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
467
478
sockopt_impl ! (
468
479
/// This option allows the caller to set the TCP congestion control
469
480
/// algorithm to be used, on a per-socket basis.
0 commit comments