pub enum IpMode {
Ip4,
Ip6,
DualStack,
}
Expand description
Sets the socket type to be established and also determines the type of ENRs that we will store
in our routing table.
We store ENR’s that have a get_contractable_addr()
based on the IpMode
set.
Variants§
Ip4
IPv4 only. This creates an IPv4 only UDP socket and will only store ENRs in the local routing table if they contain a contactable IPv4 address.
Ip6
IPv6 only. This creates an IPv6 only UDP socket and will only store ENRs in the local routing table if they contain a contactable IPv6 address. Mapped addresses will be disabled.
DualStack
Two UDP sockets are in use. One for Ipv4 and one for Ipv6.
Implementations§
source§impl IpMode
impl IpMode
pub fn is_ipv4(&self) -> bool
sourcepub fn get_contactable_addr(&self, enr: &Enr) -> Option<SocketAddr>
pub fn get_contactable_addr(&self, enr: &Enr) -> Option<SocketAddr>
Get the contactable Socket address of an Enr under current configuration. When running in dual stack, an Enr that advertises both an Ipv4 and a canonical Ipv6 address will be contacted using their Ipv6 address.