pub struct LpPacket {Show 14 fields
pub fragment: Option<Bytes>,
pub nack: Option<NackReason>,
pub congestion_mark: Option<u64>,
pub sequence: Option<u64>,
pub frag_index: Option<u64>,
pub frag_count: Option<u64>,
pub acks: Vec<u64>,
pub pit_token: Option<Bytes>,
pub incoming_face_id: Option<u64>,
pub next_hop_face_id: Option<u64>,
pub cache_policy: Option<CachePolicyType>,
pub tx_sequence: Option<u64>,
pub non_discovery: bool,
pub prefix_announcement: Option<Bytes>,
}Expand description
A decoded NDNLPv2 LpPacket.
Fields§
§fragment: Option<Bytes>The network-layer fragment (Interest or Data wire bytes).
None for bare Ack-only packets (no payload).
nack: Option<NackReason>Nack header — present when this LpPacket carries a Nack.
congestion_mark: Option<u64>Hop-by-hop congestion mark (0 = no congestion).
sequence: Option<u64>Fragment sequence number (for reassembly ordering).
frag_index: Option<u64>Zero-based index of this fragment within the original packet.
frag_count: Option<u64>Total number of fragments the original packet was split into.
acks: Vec<u64>Piggybacked Ack TxSequences (NDNLPv2 reliability).
pit_token: Option<Bytes>PIT token (opaque, 1-32 bytes).
incoming_face_id: Option<u64>Incoming face ID (local control header).
next_hop_face_id: Option<u64>Next-hop face ID (local control header).
cache_policy: Option<CachePolicyType>Cache policy.
tx_sequence: Option<u64>Reliability TxSequence (0x0348) — distinct from fragmentation Sequence (0x51).
non_discovery: boolNonDiscovery flag (presence = true).
prefix_announcement: Option<Bytes>Prefix announcement (raw Data bytes).
Implementations§
Source§impl LpPacket
impl LpPacket
Sourcepub fn decode(raw: Bytes) -> Result<Self, PacketError>
pub fn decode(raw: Bytes) -> Result<Self, PacketError>
Decode an LpPacket from raw wire bytes.
The input must start with TLV type 0x64 (LP_PACKET).
Source§impl LpPacket
impl LpPacket
Sourcepub fn is_fragmented(&self) -> bool
pub fn is_fragmented(&self) -> bool
Returns true if this LpPacket is a fragment of a larger packet.
Sourcepub fn is_ack_only(&self) -> bool
pub fn is_ack_only(&self) -> bool
Returns true if this LpPacket is a bare Ack (no payload fragment).