aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: f9dcc59f1937e4ead81cf8a0f5596c51f06405db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Routing Table

Efficient RIB for Elixir, implemented using a Rust NIF and [treebitmap](https://crates.io/crates/treebitmap).

The tables covers both IPv4 and IPv6, and values are any erlang term, stored in ets.

```elixir
table = RoutingTable.new()
RoutingTable.add(table, {10, 69, 0, 0}, 16, :vpn)
RoutingTable.add(table, {10, 69, 1, 0}, 24, :lan)
:vpn = RoutingTable.lookup(table, {10, 69, 2, 1})
:lan = RoutingTable.lookup(table, {10, 69, 1, 1})
nil = RoutingTable.lookup(table, {10, 68, 1, 1})
```