Skip to main content

Module routing

Module routing 

Source
Expand description

The C ABI for cost-aware mesh routing.

These functions wrap [pamoja_routing] for callers that reach the SDK through the flat C boundary: a table that learns the way to a node from the traffic it already hears, and the per-packet decision of whether to deliver, relay, or fall back to flooding.

A router holds state across calls, so it crosses as an opaque handle. Its table is sized when it is built rather than by the const generic the Rust crate uses, since a const generic cannot cross a C ABI at all; PAMOJA_ROUTING_DEFAULT_CAPACITY is what a caller with no reason to choose should pass.

Structs§

PamojaRoute
A learned way to reach one node.
PamojaRouter
An opaque handle to one node routing table.

Enums§

PamojaForward
What to do with a packet bound for a given node.

Constants§

PAMOJA_ROUTING_DEFAULT_CAPACITY
A reasonable routing table size for a caller with no reason to choose one.

Functions§

pamoja_router_address⚠
Returns the address a router answers for.
pamoja_router_capacity⚠
Returns how many routes a table can hold.
pamoja_router_cost⚠
Returns what the known route to a node costs.
pamoja_router_forget⚠
Forgets the route to a node, for example after it stops answering.
pamoja_router_forward⚠
Decides what to do with a packet bound for a node.
pamoja_router_free⚠
Releases a routing table handle.
pamoja_router_len⚠
Returns how many routes a table currently holds.
pamoja_router_new
Creates an empty routing table for a node.
pamoja_router_next_hop⚠
Returns the neighbor to send a packet to on the way to a node.
pamoja_router_observe⚠
Learns a route from a packet that arrived.
pamoja_router_route⚠
Returns the whole route to a node.
pamoja_router_route_at⚠
Returns one of the routes a table holds, by its position among them.