pub fn fragment_packet(packet: &[u8], mtu: usize, base_seq: u64) -> Vec<Bytes>Expand description
Fragment a network-layer packet into NDNLPv2 LpPacket fragments.
Each fragment is an independently-decodable LpPacket containing:
Sequence=base_seq(same for all fragments of one packet)FragIndex= 0-based indexFragCount= total number of fragmentsFragment= the chunk of the original packet
If the packet fits in a single fragment, a single LpPacket is returned (still carrying the fragmentation fields, as required by NDNLPv2 when the sender uses fragmentation).
ยงPanics
Panics if mtu is too small to fit even the fragmentation overhead.