pub struct HelloCore {
pub node_name: Name,
pub hello_prefix: Name,
pub claimed: Vec<Name>,
pub nonce_counter: AtomicU32,
pub config: Arc<RwLock<DiscoveryConfig>>,
pub strategy: Mutex<Box<dyn NeighborProbeStrategy>>,
pub served_prefixes: Mutex<Vec<Name>>,
pub state: Mutex<HelloState>,
}Expand description
Shared (non-link-specific) fields used by HelloProtocol<T>.
Exposed to LinkMedium implementations so they can access the node name,
config, strategy, and mutable state when building packets or handling
inbound messages.
The config field is held behind an Arc<RwLock<>> so that the management
handler can update Tier 2 parameters (hello intervals, timeouts, fanouts)
at runtime without restarting the protocol.
Fields§
§node_name: Name§hello_prefix: Name§claimed: Vec<Name>§nonce_counter: AtomicU32§config: Arc<RwLock<DiscoveryConfig>>Live-mutable discovery configuration.
Clone the Arc via HelloCore::config_handle to share the same
config instance with the management handler.
strategy: Mutex<Box<dyn NeighborProbeStrategy>>§served_prefixes: Mutex<Vec<Name>>§state: Mutex<HelloState>Implementations§
Source§impl HelloCore
impl HelloCore
pub fn new(node_name: Name, config: DiscoveryConfig) -> Self
Create with a pre-existing shared config handle.
Use this when the management handler needs to mutate the same config instance that the protocol reads from.
Sourcepub fn config_handle(&self) -> Arc<RwLock<DiscoveryConfig>>
pub fn config_handle(&self) -> Arc<RwLock<DiscoveryConfig>>
Return a cloneable handle to the shared config for use by the management handler.