pub struct RouterManager {
pub local_network: u16,
pub routing_table: RoutingTable,
pub max_hop_count: u8,
pub busy_networks: Vec<u16>,
pub performance_metrics: RouterPerformanceMetrics,
}Expand description
Network layer router manager for handling routing operations
Fields§
§local_network: u16Local network number
routing_table: RoutingTableRouting table
max_hop_count: u8Maximum hop count allowed
busy_networks: Vec<u16>Router busy status per network
performance_metrics: RouterPerformanceMetricsPerformance metrics
Implementations§
Source§impl RouterManager
impl RouterManager
Sourcepub fn route_message(
&mut self,
npdu: &mut Npdu,
) -> Result<Option<NetworkAddress>>
pub fn route_message( &mut self, npdu: &mut Npdu, ) -> Result<Option<NetworkAddress>>
Process a routing request
Sourcepub fn process_network_message(
&mut self,
message: &NetworkLayerMessage,
) -> Result<Option<NetworkLayerMessage>>
pub fn process_network_message( &mut self, message: &NetworkLayerMessage, ) -> Result<Option<NetworkLayerMessage>>
Process network layer messages
Sourcepub fn add_discovered_router(
&mut self,
networks: Vec<u16>,
address: NetworkAddress,
performance_index: Option<u8>,
)
pub fn add_discovered_router( &mut self, networks: Vec<u16>, address: NetworkAddress, performance_index: Option<u8>, )
Add a discovered router
Sourcepub fn set_network_busy(&mut self, network: u16, busy: bool)
pub fn set_network_busy(&mut self, network: u16, busy: bool)
Set network busy status
Sourcepub fn get_performance_metrics(&self) -> &RouterPerformanceMetrics
pub fn get_performance_metrics(&self) -> &RouterPerformanceMetrics
Get router statistics
Sourcepub fn reset_performance_metrics(&mut self)
pub fn reset_performance_metrics(&mut self)
Reset performance metrics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RouterManager
impl RefUnwindSafe for RouterManager
impl Send for RouterManager
impl Sync for RouterManager
impl Unpin for RouterManager
impl UnsafeUnpin for RouterManager
impl UnwindSafe for RouterManager
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