Module capsules::net::sixlowpan_compression [] [src]

Reexports

use core::mem;
use core::result::Result;
use net::ieee802154::MacAddress;
use net::ip::IP6Header;
use net::ip::IPAddr;
use net::ip::ip6_nh;
use net::util;
use net::util::slice_to_u16;
use net::util::u16_to_slice;

Modules

iphc

Contains bit masks and constants related to the two-byte header of the LoWPAN_IPHC encoding format.

nhc

Contains bit masks and constants related to LoWPAN_NHC encoding, including some specific to UDP header encoding

Structs

Context

Traits

ContextStore

LoWPAN encoding requires being able to look up the existence of contexts, which are essentially IPv6 address prefixes. Any implementation must ensure that context 0 is always available and contains the mesh-local prefix.

OnesComplement

Functions

compress

Compresses an IPv6 header into a 6loWPAN header

compress_and_elide_padding
compress_cie
compress_dst
compress_hl
compress_iid
compress_multicast
compress_nh
compress_src
compress_tf
compress_udp_checksum
compress_udp_ports
compute_iid

Computes the LoWPAN Interface Identifier from either the 16-bit short MAC or the IEEE EUI-64 that is derived from the 48-bit MAC.

compute_udp_checksum

Computes the UDP checksum for a UDP packet sent over IPv6. Returns the checksum in host byte-order.

decompress

Decompresses a 6loWPAN header into a full IPv6 header

decompress_cie
decompress_dst
decompress_hl
decompress_iid_context
decompress_iid_link_local
decompress_multicast
decompress_nh
decompress_src
decompress_tf
decompress_udp_checksum
decompress_udp_ports
ip6_nh_to_nhc_eid

Maps values of a IPv6 next header field to a corresponding LoWPAN NHC-encoding extension ID, if that next header type is NHC-compressible

is_ip6_nh_compressible

Determines if the next header is LoWPAN_NHC compressible, which depends on both the next header type and the length of the IPv6 next header extensions. Returns Ok((false, 0)) if the next header is not compressible or Ok((true, nh_len)). nh_len is only meaningful when the next header type is an IPv6 next header extension, in which case it is the number of bytes after the first two bytes in the IPv6 next header extension. Returns Err(()) in the case of an invalid IPv6 packet.

is_lowpan
nhc_to_ip6_nh

Maps a LoWPAN_NHC header the corresponding IPv6 next header type, or an error if the NHC header is invalid