#[non_exhaustive]pub struct Foreign {
pub bbmd: SocketAddrV4,
pub ttl: u16,
pub renewal: Duration,
pub response_timeout: Duration,
pub retry: Retry,
pub hold: u16,
pub trust: ForwardedTrust,
}Expand description
A foreign device’s registration with its BBMD (Annex J.5.2).
It is #[non_exhaustive], so a new setting isn’t a breaking change:
outside this crate, start from Foreign::new and set the fields to
change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bbmd: SocketAddrV4The BBMD, at its B/IP address. Replies are matched against this address and port.
ttl: u16The time-to-live sent with each registration, in seconds; above 0.
renewal: DurationHow often to register again: above zero and below the time-to-live.
A shorter one than MIN_RENEWAL is raised to it. Registering more
often than the time-to-live needs keeps a NAT mapping open (Annex
J.7.5).
response_timeout: DurationHow long an attempt waits for its result: above zero. One longer
than the renewal interval is cut to it. It also sets the answer
window the lease counts on (Lease).
retry: RetryWhen a failed attempt is tried again.
hold: u16How many broadcasts the caller can keep while the first attempt is
outstanding. Node::admit_broadcast
asks it to hold them until that attempt is answered or times out.
With 0 they are sent at once.
trust: ForwardedTrustWhich Forwarded-NPDUs are taken.
Implementations§
Source§impl Foreign
impl Foreign
Sourcepub const fn new(bbmd: SocketAddrV4, ttl: u16) -> Self
pub const fn new(bbmd: SocketAddrV4, ttl: u16) -> Self
Registration with bbmd for ttl seconds: renewed every half
time-to-live (at least MIN_RENEWAL), a response timeout of that
or DEFAULT_RESPONSE_TIMEOUT if shorter, Retry::Backoff, no
broadcasts held, and Forwarded-NPDUs taken only from bbmd.
Sourcepub const fn ttl_duration(&self) -> Duration
pub const fn ttl_duration(&self) -> Duration
The time-to-live as a duration.
Sourcepub const fn effective_renewal(&self) -> Duration
pub const fn effective_renewal(&self) -> Duration
The renewal interval in use: renewal, at least
MIN_RENEWAL.
Sourcepub const fn effective_response_timeout(&self) -> Duration
pub const fn effective_response_timeout(&self) -> Duration
The response timeout in use: response_timeout,
at most the effective renewal.