Creates an empty routing table for a node.
The address of this node, which is what a routing decision recognises as a local delivery.
Optionalcapacity: number
How many routes to make room for, defaulting to DEFAULT_CAPACITY. A capacity of 0 floods every unknown destination.
The address this router answers for.
How many routes the table can hold.
Whether the table has learned nothing yet.
How many routes the table currently holds.
Returns what the known route to a node costs.
The node to reach.
The cost, or null when no route is known.
Forgets the route to a node, for example after it stops answering.
The node to forget.
Decides what to do with a packet bound for a node.
The node the packet is addressed to.
The decision, carrying a next hop only when it says to relay.
Returns the neighbour on the way to a node.
The node to reach.
The next hop, or null when no route is known.
Learns a route from a packet that arrived.
The node the packet came from.
The neighbour it arrived through.
What that path costs, usually a hop count.
Whether the table changed. It keeps the cheapest way it knows to each node, and when full gives up the most expensive route to make room.
Returns the whole route to a node.
The node to reach.
The route, or null when no route is known.
One node routing table, learned from the traffic the node hears.
The core table is generic over its size, which cannot cross the native boundary, so this one is sized when it is built.