DiscoveryTomlConfig

Struct DiscoveryTomlConfig 

Source
pub struct DiscoveryTomlConfig {
Show 15 fields pub profile: Option<String>, pub node_name: Option<String>, pub served_prefixes: Vec<String>, pub hello_interval_base_ms: Option<u64>, pub hello_interval_max_ms: Option<u64>, pub liveness_miss_count: Option<u32>, pub swim_indirect_fanout: Option<u32>, pub gossip_fanout: Option<u32>, pub relay_records: Option<bool>, pub auto_fib_cost: Option<u32>, pub auto_fib_ttl_multiplier: Option<f32>, pub pib_path: Option<String>, pub key_name: Option<String>, pub discovery_transport: Option<String>, pub ether_iface: Option<String>,
}
Expand description

[discovery] section — neighbor and service discovery configuration.

Discovery is disabled unless node_name is set.

[discovery]
profile = "lan"
node_name = "/ndn/site/myrouter"
served_prefixes = ["/ndn/site/sensors"]
# optional per-field overrides:
hello_interval_base_ms = 5000
hello_interval_max_ms  = 60000
liveness_miss_count    = 3
gossip_fanout          = 3
relay_records          = false
auto_fib_cost          = 100
auto_fib_ttl_multiplier = 2.0

Fields§

§profile: Option<String>

Deployment profile name: static, lan, campus, mobile, high-mobility, or asymmetric. Defaults to lan.

§node_name: Option<String>

This node’s NDN name. Required to enable discovery.

If the value ends with /, the system hostname is appended automatically (e.g. "/ndn/site/""/ndn/site/router1").

§served_prefixes: Vec<String>

Prefixes published as service records at startup via ServiceDiscoveryProtocol::publish().

§hello_interval_base_ms: Option<u64>

Override hello_interval_base in milliseconds.

§hello_interval_max_ms: Option<u64>

Override hello_interval_max in milliseconds.

§liveness_miss_count: Option<u32>

Override liveness_miss_count.

§swim_indirect_fanout: Option<u32>

Override SWIM indirect-probe fanout K.

§gossip_fanout: Option<u32>

Override gossip broadcast fanout.

§relay_records: Option<bool>

Override relay_records in ServiceDiscoveryConfig.

§auto_fib_cost: Option<u32>

Override auto-FIB route cost.

§auto_fib_ttl_multiplier: Option<f32>

Override auto-FIB TTL multiplier.

§pib_path: Option<String>

Optional PIB (public information base) path for persistent key storage. Defaults to ~/.ndn/pib.db.

§key_name: Option<String>

Key name for signing hello packets. If absent, a deterministic ephemeral Ed25519 key is auto-generated from the node name.

§discovery_transport: Option<String>

Which link-layer transports to run discovery on.

Accepted values:

  • "udp" (default): UDP multicast only (224.0.23.170:6363).
  • "ether": raw Ethernet multicast only (EtherType 0x8624).
  • "both": UDP and Ethernet simultaneously.

Ethernet discovery requires CAP_NET_RAW / root on Linux, or root on macOS (PF_NDRV). The ether and both options also require at least one [[face]] entry with kind = "ether-multicast" (providing the FaceId and interface name).

§ether_iface: Option<String>

Network interface name for Ethernet discovery (e.g. "eth0", "en0").

Required when discovery_transport is "ether" or "both".

Implementations§

Source§

impl DiscoveryTomlConfig

Source

pub fn enabled(&self) -> bool

Returns true if discovery is enabled (i.e. node_name is set).

Source

pub fn resolved_node_name(&self) -> Option<String>

Resolve the effective node name, appending the system hostname if node_name ends with /.

Trait Implementations§

Source§

impl Clone for DiscoveryTomlConfig

Source§

fn clone(&self) -> DiscoveryTomlConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DiscoveryTomlConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DiscoveryTomlConfig

Source§

fn default() -> DiscoveryTomlConfig

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

impl<'de> Deserialize<'de> for DiscoveryTomlConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DiscoveryTomlConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,