IPv6 header compression (IPHC)

IPv6 header compression for 6LoWPAN. More...

Detailed Description

Files

file  iphc.h
 6LoWPAN IPHC definitions
 

Functions

size_t gnrc_sixlowpan_iphc_decode (gnrc_pktsnip_t **dec_hdr, gnrc_pktsnip_t *pkt, size_t datagram_size, size_t offset, size_t *nh_len)
 Decompresses a received 6LoWPAN IPHC frame. More...
 
bool gnrc_sixlowpan_iphc_encode (gnrc_pktsnip_t *pkt)
 Compresses a 6LoWPAN for IPHC. More...
 

Function Documentation

size_t gnrc_sixlowpan_iphc_decode ( gnrc_pktsnip_t **  dec_hdr,
gnrc_pktsnip_t pkt,
size_t  datagram_size,
size_t  offset,
size_t *  nh_len 
)
Precondition
(dec_hdr != NULL) && (*dec_hdr != NULL) && ((*dec_hdr)->size >= sizeof(gnrc_ipv6_hdr_t))
Parameters
[out]dec_hdrA pre-allocated IPv6 header. Will not be inserted into pkt. May change due to next headers being added in NHC.
[in]pktA received 6LoWPAN IPHC frame. IPHC dispatch will not be marked.
[in]datagram_sizeSize of the full uncompressed IPv6 datagram. May be 0, if pkt contains the full (unfragmented) IPv6 datagram.
[in]offsetOffset of the IPHC dispatch in 6LoWPaN frame.
[in,out]nh_lenPointer to next header length
Returns
length of the HC dispatches + inline values on success.
0 on error.
bool gnrc_sixlowpan_iphc_encode ( gnrc_pktsnip_t pkt)
Parameters
[in,out]pktA 6LoWPAN frame with an uncompressed IPv6 header to send. Will be translated to an 6LoWPAN IPHC frame.
Returns
true, on success
false, on error.