-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(ipv6_hop_limit)]
This is a tracking issue for adding methods to set the values for IPV6_UNICAST_HOPS
and IPV6_MULTICAST_HOPS
on TCP and UDP ipv6 sockets.
Public API
TCP sockets
impl TcpStream {
/// #![feature(ipv6_hop_limit)]
/// use std::net::TcpStream;
///
/// let stream = TcpStream::connect("[::1]:12345")
/// .expect("Couldn't connect to the server...");
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// ```
pub fn set_hop_limit_v6(&self, limit: u8) -> io::Result<()>;
/// Gets the value of the `IPV6_UNICAST_HOPS` option on this socket.
///
/// For more information about this option, see [`TcpStream::set_hop_limit_v6`].
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::TcpStream;
///
/// let stream = TcpStream::connect("[::1]:12345")
/// .expect("Couldn't connect to the server...");
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// assert_eq!(stream.hop_limit_v6().unwrap(), 88);
/// ```
pub fn hop_limit_v6(&self) -> io::Result<u8>;
}
impl TcpListener {
/// Sets the value for the `IPV6_UNICAST_HOPS` option on this socket.
///
/// This value sets the unicast hop limit field that is used in every packet
/// sent from this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::TcpListener;
///
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// ```
pub fn set_hop_limit_v6(&self, limit: u8) -> io::Result<()>;
/// Gets the value of the `IPV6_UNICAST_HOPS` option on this socket.
///
/// For more information about this option, see [`TcpListener::set_hop_limit_v6`].
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::TcpListener;
///
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// assert_eq!(listener.hop_limit_v6().unwrap(), 88);
/// ```
pub fn hop_limit_v6(&self) -> io::Result<u8>;
}
UDP sockets
impl UdpSocket {
/// Sets the value for the `IPV6_UNICAST_HOPS` option on this socket.
///
/// This value sets the unicast hop limit field that is used in every packet
/// sent from this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::UdpSocket;
///
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
/// socket.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// ```
pub fn set_hop_limit_v6(&self, limit: u8) -> io::Result<()>;
/// Gets the value of the `IPV6_UNICAST_HOPS` option on this socket.
///
/// For more information about this option, see [`UdpSocket::set_hop_limit_v6`].
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::UdpSocket;
///
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
/// socket.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
/// assert_eq!(socket.hop_limit_v6().unwrap(), 88);
/// ```
pub fn hop_limit_v6(&self) -> io::Result<u8>;
/// Sets the value for the `IPV6_MULTICAST_HOPS` option on this socket.
///
/// This value sets the hop limit field for outgoing multicast packets sent from this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::UdpSocket;
///
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
/// socket.set_multicast_hop_limit_v6(88).expect("set_multicast_hop_limit_v6 call failed");
/// ```
pub fn set_multicast_hop_limit_v6(&self, limit: u8) -> io::Result<()>;
/// Gets the value of the `IPV6_MULTICAST_HOPS` option on this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(ipv6_hop_limit)]
/// use std::net::UdpSocket;
///
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
/// socket.set_multicast_hop_limit_v6(88).expect("set_multicast_hop_limit_v6 call failed");
/// assert_eq!(socket.multicast_hop_limit_v6().unwrap(), 88);
/// ```
pub fn multicast_hop_limit_v6(&self) -> io::Result<u8>;
}
Steps
- Implementation:To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.Final comment period (FCP)1Stabilization PRTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
History
- Original issue UdpSocket::set_ttl does not set IPv6 hoplimit field #47727
- First (abandoned) implementation add methods to TCP and UDP sockets to modify hop limit #94678
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Rollup merge of rust-lang#138744 - Mallets:set_ipv6_sock_hop_limit, r…
Rollup merge of rust-lang#138744 - Mallets:set_ipv6_sock_hop_limit, r…
Rollup merge of rust-lang#138744 - Mallets:set_ipv6_sock_hop_limit, r…