@@ -1165,8 +1165,8 @@ impl Socket {
1165
1165
///
1166
1166
/// [`SOCK_RAW`]: Type::RAW
1167
1167
/// [raw(7)]: https://man7.org/linux/man-pages/man7/raw.7.html
1168
- /// [`IP_TOS`]: Socket::set_tos
1169
1168
/// [`IP_TTL`]: Socket::set_ttl_v4
1169
+ /// [`IP_TOS`]: Socket::set_tos_v4
1170
1170
#[ cfg_attr(
1171
1171
any( target_os = "fuchsia" , target_os = "illumos" , target_os = "solaris" ) ,
1172
1172
allow( rustdoc:: broken_intra_doc_links)
@@ -1562,26 +1562,26 @@ impl Socket {
1562
1562
target_os = "illumos" ,
1563
1563
target_os = "haiku" ,
1564
1564
) ) ) ]
1565
- pub fn set_tos ( & self , tos : u32 ) -> io:: Result < ( ) > {
1565
+ pub fn set_tos_v4 ( & self , tos : u32 ) -> io:: Result < ( ) > {
1566
1566
unsafe { setsockopt ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TOS , tos as c_int ) }
1567
1567
}
1568
1568
1569
1569
/// Get the value of the `IP_TOS` option for this socket.
1570
1570
///
1571
- /// For more information about this option, see [`set_tos `].
1571
+ /// For more information about this option, see [`set_tos_v4 `].
1572
1572
///
1573
1573
/// NOTE: <https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options>
1574
1574
/// documents that not all versions of windows support `IP_TOS`.
1575
1575
///
1576
- /// [`set_tos `]: Socket::set_tos
1576
+ /// [`set_tos_v4 `]: Socket::set_tos_v4
1577
1577
#[ cfg( not( any(
1578
1578
target_os = "fuchsia" ,
1579
1579
target_os = "redox" ,
1580
1580
target_os = "solaris" ,
1581
1581
target_os = "illumos" ,
1582
1582
target_os = "haiku" ,
1583
1583
) ) ) ]
1584
- pub fn tos ( & self ) -> io:: Result < u32 > {
1584
+ pub fn tos_v4 ( & self ) -> io:: Result < u32 > {
1585
1585
unsafe {
1586
1586
getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TOS ) . map ( |tos| tos as u32 )
1587
1587
}
0 commit comments