Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Versioned TLV serialization of ControllerState.

Layout (all members context-tagged):

root: Structure { C0: version(u8), C1: Array[fabric] }
fabric: Structure {
  C0: fabric_id(uint), C1: ipk(bytes16), C2: rcac_cert(bytes,TLV),
  C3: rcac_pkcs8(bytes), C4: commissioner(struct), C5: Array[device],
  C6: Array[group_key_set] (optional — absent in v1 snapshots written
      before group-key support; defaults to empty on read),
  C7: outbound_group_counter(uint, optional — same default rule)
}
commissioner: Structure { C0: node_id(uint), C1: op_pkcs8(bytes), C2: noc(bytes,TLV) }
device: Structure {
  C0: node_id(uint), C1: peer_noc_public_key(bytes65),
  C2: resumption_record(bytes, optional), C3: last_known_addr(utf8, optional)
}
group_key_set: Structure {
  C0: key_set_id(uint), C1: epoch_key(bytes16), C2: epoch_start_time(uint)
}

§Backward compatibility

C6 and C7 are optional tags: a v1 snapshot without them (written by an older binary) still deserializes cleanly — group_keys defaults to Vec::new() and outbound_group_counter to 0. No version bump is needed because the tag-keyed deserializer simply treats absent tags as defaults.

Constants§

SNAPSHOT_VERSION
Current snapshot schema version.

Functions§

deserialize
Deserialize a snapshot blob into ControllerState.
serialize
Serialize controller state into an opaque TLV blob.