pub struct DigipeaterConfig {
pub callsign: Ax25Address,
pub uidigipeat_aliases: Vec<String>,
pub uiflood_alias: Option<String>,
pub uitrace_alias: Option<String>,
pub dedup_ttl: Duration,
pub viscous_delay: Duration,
/* private fields */
}Expand description
Digipeater configuration.
Controls which packets are relayed and how the digipeater path is modified.
Also carries the rolling dedup cache used to suppress retransmission of
packets seen more than once within DigipeaterConfig::dedup_ttl.
Fields§
§callsign: Ax25AddressOur callsign (used for UIdigipeat and UItrace path insertion).
uidigipeat_aliases: Vec<String>UIdigipeat aliases (e.g., ["WIDE1-1"]). Relay if path contains
this alias, replace with our callsign + completion flag.
uiflood_alias: Option<String>UIflood alias base (e.g., "CA"). Relay and decrement hop count.
The SSID encodes the remaining hop count.
uitrace_alias: Option<String>UItrace alias base (e.g., "WIDE"). Relay, decrement hop count,
and insert our callsign in the path.
dedup_ttl: DurationHow long a recently-seen packet is remembered in the dedup cache.
Defaults to DEFAULT_DEDUP_TTL (30 s).
viscous_delay: DurationViscous delay — how long to hold a relay candidate before
actually transmitting it. 0 disables the feature (default).
Viscous digis defer relay for a short window so that nearby full digipeaters have a chance to transmit first; if any other digi relays the packet within the window, the viscous digi cancels its own pending relay. This lets a fill-in digi stay quiet in well-covered areas while still providing coverage in RF gaps.
Implementations§
Source§impl DigipeaterConfig
impl DigipeaterConfig
Sourcepub fn new(
callsign: Ax25Address,
uidigipeat_aliases: Vec<String>,
uiflood_alias: Option<String>,
uitrace_alias: Option<String>,
) -> DigipeaterConfig
pub fn new( callsign: Ax25Address, uidigipeat_aliases: Vec<String>, uiflood_alias: Option<String>, uitrace_alias: Option<String>, ) -> DigipeaterConfig
Build a new config with an empty dedup cache and the default TTL.
Sourcepub fn drain_ready_viscous(&mut self, now: Instant) -> Vec<Ax25Packet>
pub fn drain_ready_viscous(&mut self, now: Instant) -> Vec<Ax25Packet>
Drain any pending viscous relays whose delay window has elapsed.
Call this periodically (e.g. from the client event loop) to pick up relays whose viscous delay has expired without anyone else transmitting the same packet. Returns the frames ready to send.
The caller provides now so this module remains sans-io; pass the
same Instant used for the surrounding Self::process calls.
Source§impl DigipeaterConfig
impl DigipeaterConfig
Sourcepub fn process(&mut self, packet: &Ax25Packet, now: Instant) -> DigiAction
pub fn process(&mut self, packet: &Ax25Packet, now: Instant) -> DigiAction
Process an incoming AX.25 UI frame through digipeater logic.
Performs, in order:
- UI frame sanity (
control=0x03,PID=0xF0). - Own-callsign loop detection — if our callsign appears anywhere in the digipeater path with the H-bit set, the packet has already been through us and we must drop it to prevent routing loops.
- Dedup cache lookup — if we’ve relayed a packet with the same
source/destination/info hash within
Self::dedup_ttl, drop. - First-unused entry alias matching (
UIdigipeat,UIflood,UItrace). - On successful relay, the packet hash is recorded in the dedup cache with the current time.
The caller provides now so this module remains sans-io. Passing
the same Instant to every stateful call in a single loop
iteration keeps timing invariants consistent.
Returns DigiAction::Drop if any check fails or no alias matches.
Sourcepub fn dedup_cache_len(&self) -> usize
pub fn dedup_cache_len(&self) -> usize
Number of entries currently in the dedup cache (for tests/metrics).
Trait Implementations§
Source§impl Clone for DigipeaterConfig
impl Clone for DigipeaterConfig
Source§fn clone(&self) -> DigipeaterConfig
fn clone(&self) -> DigipeaterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more