ensure_nonce

Function ensure_nonce 

Source
pub fn ensure_nonce(interest_wire: &Bytes) -> Bytes
Expand description

Ensure an Interest has a Nonce field.

If the Interest wire bytes already contain a Nonce (TLV 0x0A), returns the bytes unchanged. Otherwise, re-encodes the Interest with a generated Nonce inserted after the Name.

Per RFC 8569 ยง4.2, a forwarder MUST add a Nonce before forwarding.