pub struct UdpMedium { /* private fields */ }Expand description
UDP-specific link medium for HelloProtocol.
Handles Ed25519 signing of hello Data, signature verification of incoming hello Data, UDP address extraction, and unicast face creation.
Trait Implementations§
Source§impl LinkMedium for UdpMedium
impl LinkMedium for UdpMedium
Source§fn protocol_id(&self) -> ProtocolId
fn protocol_id(&self) -> ProtocolId
Protocol identifier (e.g.
"udp-nd", "ether-nd").Source§fn build_hello_data(&self, core: &HelloCore, interest_name: &Name) -> Bytes
fn build_hello_data(&self, core: &HelloCore, interest_name: &Name) -> Bytes
Build the hello Data reply for the given Interest name. Read more
Source§fn handle_hello_interest(
&self,
raw: &Bytes,
_incoming_face: FaceId,
meta: &InboundMeta,
core: &HelloCore,
ctx: &dyn DiscoveryContext,
) -> bool
fn handle_hello_interest( &self, raw: &Bytes, _incoming_face: FaceId, meta: &InboundMeta, core: &HelloCore, ctx: &dyn DiscoveryContext, ) -> bool
Handle a hello Interest (link-specific dispatch). Read more
Source§fn verify_and_ensure_peer(
&self,
raw: &Bytes,
payload: &HelloPayload,
meta: &InboundMeta,
core: &HelloCore,
ctx: &dyn DiscoveryContext,
) -> Option<(Name, Option<FaceId>)>
fn verify_and_ensure_peer( &self, raw: &Bytes, payload: &HelloPayload, meta: &InboundMeta, core: &HelloCore, ctx: &dyn DiscoveryContext, ) -> Option<(Name, Option<FaceId>)>
Verify signature (if applicable), extract source address, and ensure
a unicast face to the peer exists. Read more
Source§fn send_multicast(&self, ctx: &dyn DiscoveryContext, pkt: Bytes)
fn send_multicast(&self, ctx: &dyn DiscoveryContext, pkt: Bytes)
Send a packet on all multicast face(s).
Source§fn is_multicast_face(&self, face_id: FaceId) -> bool
fn is_multicast_face(&self, face_id: FaceId) -> bool
Whether
face_id is one of this medium’s multicast faces.Source§fn on_face_down(
&self,
face_id: FaceId,
_state: &mut HelloState,
_ctx: &dyn DiscoveryContext,
)
fn on_face_down( &self, face_id: FaceId, _state: &mut HelloState, _ctx: &dyn DiscoveryContext, )
Handle face-down event (clean up link-specific state).
Source§fn on_peer_removed(&self, entry: &NeighborEntry, _state: &mut HelloState)
fn on_peer_removed(&self, entry: &NeighborEntry, _state: &mut HelloState)
Clean up link-specific state when a peer is being removed
(reached miss_limit in the liveness state machine).
Auto Trait Implementations§
impl !Freeze for UdpMedium
impl !RefUnwindSafe for UdpMedium
impl Send for UdpMedium
impl Sync for UdpMedium
impl Unpin for UdpMedium
impl !UnwindSafe for UdpMedium
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more