Module node_counters

Module node_counters 

Source
Expand description

The device node’s persisted frame counters.

A RAM image of the counter_map plus the journal handle behind it. store upserts the map; a dirty flush writes the whole map as one record in the counter journal.

This is what stops a power cycle from reusing MAC frame-counter space: the device identity’s TX reservation boundary and each peer’s RX replay boundary both survive here. The MAC batches its calls (one flush per persist block of secured frames), so each flush costs one journal record write.

Structs§

NodeCounterStore
The device node’s [umsh_hal::CounterStore].
NodeCounters
RAM image + journal handle behind NodeCounterStore.

Functions§

clear
Drop all persisted device-node counters (factory clear). The RAM map clears unconditionally; a failed tombstone write self-heals because the map is left dirty and the next flush rewrites the (now empty) state.
mount
Mount the counter journal at page0 and load the persisted map.
prune_stale_tx
Drop a previous identity’s persisted TX boundary (its context is the raw 32-byte public key; per-peer RX boundaries are keyed by the peer key and stay meaningful across identity replacement). The next dirty flush persists the pruned map.

Type Aliases§

NodeCountersMutex
The mutex a board wraps its NodeCounters in.