pub struct NatInfo {
pub nat_type: NatType,
pub public_ips: Vec<Ipv4Addr>,
pub public_udp_ports: Vec<u16>,
pub mapping_tcp_addr: Vec<SocketAddr>,
pub mapping_udp_addr: Vec<SocketAddr>,
pub public_port_range: u16,
pub local_ipv4: Ipv4Addr,
pub ipv6: Option<Ipv6Addr>,
pub local_udp_ports: Vec<u16>,
pub local_tcp_port: u16,
pub public_tcp_port: u16,
}
Fields§
§nat_type: NatType
nat type of the network
public_ips: Vec<Ipv4Addr>
the set of public Ipv4
public_udp_ports: Vec<u16>
the set of public ports mapped from the nat
mapping_tcp_addr: Vec<SocketAddr>
the set of mapped addresses where TCP
serves on
mapping_udp_addr: Vec<SocketAddr>
the set of mapped addresses where UDP
serves on
public_port_range: u16
The predicted range of public ports, it is used when the nat_type is symmetric
local_ipv4: Ipv4Addr
local IP address
ipv6: Option<Ipv6Addr>
The public IPv6 address
local_udp_ports: Vec<u16>
The local ports where the UDP
services bind
local_tcp_port: u16
The local ports where the TCP
services bind
public_tcp_port: u16
The public port of TCP
service, which works when there is either nat1
or no nat
exists
Implementations§
Source§impl NatInfo
impl NatInfo
pub fn ipv6_udp_addr(&self) -> Vec<SocketAddr>
pub fn ipv6_tcp_addr(&self) -> Option<SocketAddr>
pub fn public_ipv4_addr(&self) -> Vec<SocketAddr>
pub fn local_ipv4_addrs(&self) -> Vec<SocketAddr>
pub fn local_ipv4_tcp(&self) -> Option<SocketAddr>
pub fn public_ipv4_tcp(&self) -> Vec<SocketAddr>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NatInfo
impl<'de> Deserialize<'de> for NatInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NatInfo
impl RefUnwindSafe for NatInfo
impl Send for NatInfo
impl Sync for NatInfo
impl Unpin for NatInfo
impl UnwindSafe for NatInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more