Skip to main content

Netmap

Struct Netmap 

Source
pub struct Netmap<const PEERS: usize = MAX_PEERS> {
    pub peers: PeerTable<PEERS>,
    pub peers_truncated: bool,
    pub derp: DerpMap,
    pub dns: DnsConfig,
    pub node_key: Option<NodePublic>,
    pub disco_key: Option<DiscoPublic>,
    pub addresses: Vec<Cidr, { crate::netmap::MAX_ADDRESSES }>,
    pub primary_routes: Vec<Cidr, { crate::netmap::MAX_PRIMARY_ROUTES }>,
    pub home_derp: u16,
    pub packet_filter: PacketPolicy,
    pub responses: usize,
}
Expand description

The state a netmap is accumulated into.

Fields§

§peers: PeerTable<PEERS>§peers_truncated: bool

The control map named more peers than this target retains, or named a peer whose addresses or allowed IPs exceed the per-peer bounds.

Selection is deterministic and independent of server order: a full table keeps the highest-ranked non-self records (online first, then the lowest node id), skipping oversized records. With the alloc feature the table is full only at PEERS or when the allocator refuses to grow it. This lets memory-constrained targets remain connected to control instead of rejecting the entire map.

§derp: DerpMap§dns: DnsConfig

The tailnet’s DNS configuration, minus the unbounded Routes map.

§node_key: Option<NodePublic>

This node’s own record, once the server has sent one.

§disco_key: Option<DiscoPublic>§addresses: Vec<Cidr, { crate::netmap::MAX_ADDRESSES }>§primary_routes: Vec<Cidr, { crate::netmap::MAX_PRIMARY_ROUTES }>

Routes this control plane has approved for this node.

§home_derp: u16

Preferred relay for this node.

§packet_filter: PacketPolicy

Staged packet-filter policy. No packet is forwarded until at least one syntactically valid policy update has been received.

§responses: usize

How many complete MapResponses have been applied.

Implementations§

Source§

impl<const PEERS: usize> Netmap<PEERS>

Source

pub const fn new() -> Self

Source

pub fn has_assigned_ipv4(&self) -> bool

Source

pub fn ipv4_default_route_approved(&self) -> bool

Approval of 0.0.0.0/0 is independent of IPv6 uplink capability.

Source

pub fn ipv6_default_route_approved(&self) -> bool

Only an explicitly approved ::/0 authorizes IPv6 exit forwarding.

Source

pub fn default_routes_approved(&self) -> bool

Whether both exit-route families are approved. Family-specific packet paths must use the corresponding approval query instead.

Trait Implementations§

Source§

impl<const PEERS: usize> Clone for Netmap<PEERS>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const PEERS: usize> Default for Netmap<PEERS>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<const PEERS: usize> Freeze for Netmap<PEERS>
where PeerTable<PEERS>: Freeze,

§

impl<const PEERS: usize> RefUnwindSafe for Netmap<PEERS>
where PeerTable<PEERS>: RefUnwindSafe,

§

impl<const PEERS: usize> Send for Netmap<PEERS>
where PeerTable<PEERS>: Send,

§

impl<const PEERS: usize> Sync for Netmap<PEERS>
where PeerTable<PEERS>: Sync,

§

impl<const PEERS: usize> Unpin for Netmap<PEERS>
where PeerTable<PEERS>: Unpin,

§

impl<const PEERS: usize> UnsafeUnpin for Netmap<PEERS>
where PeerTable<PEERS>: UnsafeUnpin,

§

impl<const PEERS: usize> UnwindSafe for Netmap<PEERS>
where PeerTable<PEERS>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.