Skip to main content

Module wire

Module wire 

Source
Expand description

CSCP v1 TLV helpers. draft-webcivics-cscp-00 §4.

Enums§

CscpError
RejectReason

Constants§

MAGIC
MAX_BODY
MAX_FIELDS
MSG_CONNECT_ACCEPT
MSG_CONNECT_REJECT
MSG_CONNECT_REQUEST
MSG_CONTACT
MSG_CUSTODY_LEASE
MSG_PATH_EVIDENCE
MSG_RECEIPT
MSG_RELAY_LEASE
TAG_AUTHORITY
TAG_BUDGET
TAG_CRITICAL
TAG_DEADLINE
TAG_PEER
TAG_PROTECTION
TAG_PURPOSE
VERSION

Functions§

connect_from_wire
Decodes a connect message from wire bytes.
decode_accept
Decodes a path-accept into (PathClass, lease_id).
decode_connect_request
Decodes connect_request; fails closed on malformed input.
decode_contact
Decodes a ContactDescriptor; fails closed on missing/duplicate/malformed TLVs.
decode_custody
Decodes a CustodyLease with required-tag validation.
decode_evidence
Decode a report. Never locally validated. observer=2 && validated=1 is malformed.
decode_receipt
Decodes an OpReceipt with required-tag validation.
decode_reject
Decodes a RejectReason; fails closed on unknown reason byte.
decode_relay_lease
Decodes a RelayLease with required-tag validation.
disclosure_byte
Maps a Disclosure level to its wire byte.
disclosure_from
Decodes a Disclosure from its wire byte; CscpError on an unknown value — fails closed.
encode_accept
Encodes a path-accept message (class + lease id).
encode_connect_request
Encodes connect_request into the caller buffer.
encode_contact
Encodes a ContactDescriptor as CSCP TLVs into out; returns bytes written.
encode_custody
Encodes a CustodyLease into out.
encode_evidence
Encodes PathEvidence into out.
encode_receipt
Encodes an OpReceipt into out.
encode_reject
Encodes a RejectReason byte.
encode_relay_lease
Encodes a RelayLease into out.
locator_kind_byte
Maps a LocatorKind to its wire byte.
locator_kind_from
Decodes a LocatorKind from its wire byte; fails closed on unknown.
path_class_byte
Maps a PathClass to its wire byte.
path_class_from
Decodes a PathClass from its wire byte; fails closed on unknown.