Skip to main content

pamoja_router_new

Function pamoja_router_new 

Source
#[unsafe(no_mangle)]
pub extern "C" fn pamoja_router_new( address: u32, capacity: usize, ) -> *mut PamojaRouter
Expand description

Creates an empty routing table for a node.

§Arguments

  • address - the address of this node, which is what pamoja_router_forward recognises as a local delivery.
  • capacity - how many routes to make room for; pass PAMOJA_ROUTING_DEFAULT_CAPACITY when there is no reason to choose. A capacity of zero is allowed and makes every unknown destination flood.

§Returns

A handle the caller must release with pamoja_router_free.