Function capsules::net::sixlowpan_compression::decompress [] [src]

pub fn decompress(
    ctx_store: &ContextStore,
    buf: &[u8],
    src_mac_addr: MacAddress,
    dst_mac_addr: MacAddress,
    out_buf: &mut [u8],
    dgram_size: u16,
    is_fragment: bool
) -> Result<(usize, usize), ()>

Decompresses a 6loWPAN header into a full IPv6 header

This function decompresses the header found in buf and writes it out_buf. It does not, though, copy payload bytes or a non-compressed next header. As a result, the caller should copy the buf.len - consumed remaining bytes from buf to out_buf.

Note that in the case of fragmentation, the total length of the IPv6 packet cannot be inferred from a single frame, and is instead provided by the dgram_size field in the fragmentation header. Thus, if we are decompressing a fragment, we rely on the dgram_size field; otherwise, we infer the length from the size of buf.

Arguments

Returns

Ok((consumed, written)) if decompression is successful.