Module lp

Module lp 

Source
Expand description

NDNLPv2 Link Protocol Packet framing.

An LpPacket (TLV 0x64) wraps a network-layer packet (Interest or Data) with optional link-layer header fields:

  • Nack (0x0320): carries a NackReason; the fragment is the nacked Interest
  • CongestionMark (0x0340): hop-by-hop congestion signal
  • Sequence / FragIndex / FragCount: fragmentation (decode only)

Bare Interest/Data packets (not wrapped in LpPacket) are still valid on the wire — LpPacket framing is only required when link-layer fields are present.

Structs§

FragmentHeader
Result of lightweight fragment extraction.
LpHeaders
Optional LP header fields for encoding.
LpPacket
A decoded NDNLPv2 LpPacket.

Enums§

CachePolicyType
Cache policy type for NDNLPv2 CachePolicy header field.

Functions§

encode_lp_acks
Encode a bare Ack-only LpPacket (no fragment payload).
encode_lp_nack
Encode a Nack as an NDNLPv2 LpPacket.
encode_lp_packet
Wrap a bare Interest or Data in a minimal NDNLPv2 LpPacket.
encode_lp_reliable
Encode a reliability-enabled LpPacket with TxSequence, optional fragmentation, and piggybacked Acks.
encode_lp_with_headers
Encode an LpPacket with optional header fields.
extract_acks
Fast-path extraction of Sequence and Ack fields from a raw LpPacket.
extract_fragment
Lightweight fragment extraction from an LpPacket.
is_lp_packet
Check if raw bytes start with an LpPacket TLV type (0x64).