pub struct NatInfo {
pub nat_type: NatType,
pub public_ips: Vec<Ipv4Addr>,
pub public_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,
pub seq: u32,
}Fields§
§nat_type: NatTypenat type of the network
public_ips: Vec<Ipv4Addr>the set of public Ipv4
public_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: u16The predicted range of public ports, it is used when the nat_type is symmertric
local_ipv4: Ipv4Addrlocal IP address
ipv6: Option<Ipv6Addr>The public IPv6 addess
local_udp_ports: Vec<u16>The local ports where the UDP services bind
local_tcp_port: u16The local ports where the TCP services bind
public_tcp_port: u16The public port of TCP service, which works when there is either nat1 or no nat exists
seq: u32Both parties’ seq in the same round of hole punching need to be the same
Implementations§
source§impl NatInfo
impl NatInfo
pub fn ipv6_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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)