updated router_id to be PublicKey type

This commit is contained in:
Maxime Van Hees
2023-05-22 16:19:50 +00:00
parent 179904b093
commit 0116c550a8
11 changed files with 126 additions and 34 deletions
+3 -2
View File
@@ -1,10 +1,12 @@
use std::{collections::HashMap, net::IpAddr};
use x25519_dalek::PublicKey;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
pub struct SourceKey {
pub prefix: IpAddr,
pub plen: u8,
pub router_id: u64, // We temporarily use 100 for all router IDs
pub router_id: PublicKey,
}
#[derive(Debug, Clone, Copy)]
@@ -20,7 +22,6 @@ impl FeasibilityDistance {
}
// Store (prefix, plen, router_id) -> feasibility distance mapping
#[derive(Debug)]
pub struct SourceTable {
pub table: HashMap<SourceKey, FeasibilityDistance>,