Skip to main content

Module mesh

Module mesh 

Source
Expand description

The C ABI for mesh packet framing.

These functions wrap [pamoja_mesh] for callers that reach the SDK through the flat C boundary: an addressed packet that hops node to node across a radio mesh, and the duplicate suppressor that stops a flood from circulating forever.

A frame carries a payload, so it crosses as an opaque handle like every other payload-bearing type here. The duplicate cache 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_MESH_SEEN_DEFAULT_CAPACITY is what a caller with no reason to choose should pass.

Structs§

PamojaMeshFrame
An opaque handle to a mesh frame.
PamojaSeenCache
An opaque handle to a cache of recently seen packets.

Constants§

PAMOJA_MESH_BROADCAST
The destination address that means every node.
PAMOJA_MESH_DEFAULT_HOP_LIMIT
The hop limit a frame starts with unless one is set.
PAMOJA_MESH_FRAME_MAX
The largest mesh frame, in bytes, including its header and checksum.
PAMOJA_MESH_HEADER_LEN
The length of a mesh frame header, in bytes.
PAMOJA_MESH_OVERHEAD
The bytes a frame spends on its header and checksum together.
PAMOJA_MESH_PAYLOAD_MAX
The largest payload a single mesh frame can carry, in bytes.
PAMOJA_MESH_SEEN_DEFAULT_CAPACITY
A reasonable duplicate-cache size for a caller with no reason to choose one.
PAMOJA_MESH_VERSION
The mesh protocol version this build speaks.

Functions§

pamoja_mesh_crc16
Computes the CRC-16 a mesh frame carries.
pamoja_mesh_frame_broadcast
Builds a mesh frame addressed to every node.
pamoja_mesh_frame_bytes
Returns a pointer to the whole frame as it goes on the air.
pamoja_mesh_frame_bytes_len
Returns the length in bytes of the whole frame.
pamoja_mesh_frame_dst
Returns the address a frame is addressed to.
pamoja_mesh_frame_free
Releases a mesh frame handle.
pamoja_mesh_frame_hop_limit
Returns how many further relays a frame may take.
pamoja_mesh_frame_id
Returns the sequence number that identifies a packet from its source.
pamoja_mesh_frame_is_broadcast
Reports whether a frame is addressed to every node.
pamoja_mesh_frame_new
Builds a mesh frame addressed to one node.
pamoja_mesh_frame_parse
Parses a frame received off a radio.
pamoja_mesh_frame_payload
Returns a pointer to the payload a frame carries.
pamoja_mesh_frame_payload_len
Returns the length in bytes of the payload a frame carries.
pamoja_mesh_frame_relayed
Returns the same frame with one hop spent, ready to forward.
pamoja_mesh_frame_set_hop_limit
Sets the number of relays a frame may still take.
pamoja_mesh_frame_src
Returns the address of the node a frame came from.
pamoja_mesh_frame_version
Returns the protocol version a frame declares.
pamoja_mesh_seen_capacity
Returns how many packets a duplicate cache remembers.
pamoja_mesh_seen_contains
Reports whether a packet is currently remembered, without recording it.
pamoja_mesh_seen_free
Releases a duplicate cache handle.
pamoja_mesh_seen_new
Creates an empty duplicate cache.
pamoja_mesh_seen_record
Records a packet and reports whether it was new.