1#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
2#![no_std]
3
4extern crate alloc;
5#[cfg(test)]
6extern crate std;
7
8mod allot;
9mod base_index;
10pub mod iptrie;
11mod lpm;
12mod node;
13pub mod table;
14#[cfg(test)]
15pub mod test_util;
16
17pub use allot::{fringe as allot_fringe, prefix as allot_prefix};
18pub use base_index::BaseIndex;
19#[doc(inline)]
20pub use iptrie::RouteModification;
21pub use lpm::lookup as lpm;
22pub use node::{
23 BoxStorage, Child, DefaultNode, DefaultStorage, InlineStorage, Node, PrefixOps, PrefixOpsExt,
24 PrefixReadOps, Stats, Storage, StrideBase, StrideOps, StrideOpsExt,
25};
26#[doc(inline)]
27pub use table::{RoutingTable, RoutingTableExt};
28
29#[cfg(feature = "lut")]
31pub const LUT_MEMORY: usize = allot::LUT_SIZE + ts_bitset::RANK_LUT_SIZE + lpm::LUT_SIZE;
32
33pub type Table<T> = table::SplitStackTable<DefaultNode<T>>;
39
40pub type SimpleTable<T> = table::SimpleTable<DefaultNode<T>>;
46
47#[cfg(test)]
48mod test {
49 #[cfg(feature = "lut")]
50 #[test]
51 fn lut_size() {
52 std::println!("LUT memory usage: {}B", super::LUT_MEMORY);
53
54 assert_eq!(
55 super::LUT_MEMORY,
56 32 * 1024,
57 "lut memory usage changed, please update the test if this was intentional",
58 );
59 }
60}