pub struct NetworkLayerHandler {
pub local_network: u16,
pub routers: Vec<RouterInfo>,
pub stats: NetworkStatistics,
/* private fields */
}Expand description
Network layer message handler
Fields§
§local_network: u16Local network number
routers: Vec<RouterInfo>Router information cache
stats: NetworkStatisticsNetwork statistics
Implementations§
Source§impl NetworkLayerHandler
impl NetworkLayerHandler
Sourcepub fn process_npdu(
&mut self,
npdu: &Npdu,
source_address: &NetworkAddress,
) -> Result<Option<NetworkResponse>>
pub fn process_npdu( &mut self, npdu: &Npdu, source_address: &NetworkAddress, ) -> Result<Option<NetworkResponse>>
Process an incoming NPDU
Sourcepub fn who_is_router(&mut self, _network: Option<u16>) -> Npdu
pub fn who_is_router(&mut self, _network: Option<u16>) -> Npdu
Send Who-Is-Router-To-Network message
Sourcepub fn i_am_router(&mut self, _networks: &[u16]) -> Npdu
pub fn i_am_router(&mut self, _networks: &[u16]) -> Npdu
Send I-Am-Router-To-Network message
Sourcepub fn update_router(&mut self, router_info: RouterInfo)
pub fn update_router(&mut self, router_info: RouterInfo)
Update router information
Sourcepub fn find_router(&self, network: u16) -> Option<&RouterInfo>
pub fn find_router(&self, network: u16) -> Option<&RouterInfo>
Find best router for a network
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NetworkLayerHandler
impl RefUnwindSafe for NetworkLayerHandler
impl Send for NetworkLayerHandler
impl Sync for NetworkLayerHandler
impl Unpin for NetworkLayerHandler
impl UnsafeUnpin for NetworkLayerHandler
impl UnwindSafe for NetworkLayerHandler
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