Expand description
CSCP v1 TLV helpers. draft-webcivics-cscp-00 §4.
Enums§
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
CustodyLeasewith required-tag validation. - decode_
evidence - Decode a report. Never locally validated.
observer=2 && validated=1is malformed. - decode_
receipt - Decodes an
OpReceiptwith required-tag validation. - decode_
reject - Decodes a
RejectReason; fails closed on unknown reason byte. - decode_
relay_ lease - Decodes a
RelayLeasewith required-tag validation. - disclosure_
byte - Maps a
Disclosurelevel to its wire byte. - disclosure_
from - Decodes a
Disclosurefrom its wire byte;CscpErroron an unknown value — fails closed. - encode_
accept - Encodes a path-accept message (class + lease id).
- encode_
connect_ request - Encodes
connect_requestinto the caller buffer. - encode_
contact - Encodes a
ContactDescriptoras CSCP TLVs intoout; returns bytes written. - encode_
custody - Encodes a
CustodyLeaseintoout. - encode_
evidence - Encodes
PathEvidenceintoout. - encode_
receipt - Encodes an
OpReceiptintoout. - encode_
reject - Encodes a
RejectReasonbyte. - encode_
relay_ lease - Encodes a
RelayLeaseintoout. - locator_
kind_ byte - Maps a
LocatorKindto its wire byte. - locator_
kind_ from - Decodes a
LocatorKindfrom its wire byte; fails closed on unknown. - path_
class_ byte - Maps a
PathClassto its wire byte. - path_
class_ from - Decodes a
PathClassfrom its wire byte; fails closed on unknown.