pub struct InterfaceAnnounceLimits<C>where
C: InterfaceAnnounceLimitTable,{ /* private fields */ }Implementations§
Source§impl<C> InterfaceAnnounceLimits<C>where
C: InterfaceAnnounceLimitTable,
impl<C> InterfaceAnnounceLimits<C>where
C: InterfaceAnnounceLimitTable,
Sourcepub fn record(&mut self, interface: InterfaceId, now: InstantMillis)
pub fn record(&mut self, interface: InterfaceId, now: InstantMillis)
RNS 1.4.2 Interface.received_announce
Sourcepub fn interface_attached(&mut self, interface: InterfaceId, now: InstantMillis)
pub fn interface_attached(&mut self, interface: InterfaceId, now: InstantMillis)
Pins the interface’s age clock: RNS thresholds key on Interface.age(), time since the interface object’s creation, so hosts call this at attach.
An interface never pinned starts its clock at the first recorded announce instead, and a returning interface keeps its original clock.
Sourcepub fn should_limit(
&mut self,
interface: InterfaceId,
now: InstantMillis,
) -> bool
pub fn should_limit( &mut self, interface: InterfaceId, now: InstantMillis, ) -> bool
RNS 1.4.2 Interface.should_ingress_limit: latch or clear the burst and report whether an unknown-destination announce arriving now should be held.
Self::record runs before this for every announce, known or unknown destination, so the announce being judged already counts toward its own reading; only unknown destinations consult this judgment, so known-destination floods raise the rate without touching the latch. Both behaviors mirror the reference’s call order.
pub fn should_limit_with_policy( &mut self, interface: InterfaceId, now: InstantMillis, policy: IngressControlPolicy, ) -> bool
Sourcepub fn next_held_release_at(
&self,
interface: InterfaceId,
) -> Option<InstantMillis>
pub fn next_held_release_at( &self, interface: InterfaceId, ) -> Option<InstantMillis>
RNS Interface.ic_held_release: the next instant a held announce may drip out, stamped now + IC_BURST_PENALTY when the burst latches.
Sourcepub fn schedule_next_held_release(
&mut self,
interface: InterfaceId,
now: InstantMillis,
)
pub fn schedule_next_held_release( &mut self, interface: InterfaceId, now: InstantMillis, )
RNS Interface.process_held_announces advances ic_held_release by IC_HELD_RELEASE_INTERVAL on each release.
pub fn schedule_next_held_release_with_policy( &mut self, interface: InterfaceId, now: InstantMillis, policy: IngressControlPolicy, )
Sourcepub fn rate_is_under_limit(
&self,
interface: InterfaceId,
now: InstantMillis,
) -> bool
pub fn rate_is_under_limit( &self, interface: InterfaceId, now: InstantMillis, ) -> bool
The gate RNS Interface.process_held_announces puts on each release: ia_freq < freq_threshold, strictly.
An interface with no samples reads under.