sixlowpan.h File Reference

6LoWPAN dispatch type and helper function definitions. More...

Detailed Description

6LoWPAN dispatch type and helper function definitions.

Author
Martine Lenders mlend.nosp@m.ers@.nosp@m.inf.f.nosp@m.u-be.nosp@m.rlin..nosp@m.de

Definition in file sixlowpan.h.

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "byteorder.h"
+ Include dependency graph for sixlowpan.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sixlowpan_frag_t
 General and 1st 6LoWPAN fragmentation header. More...
 
struct  sixlowpan_frag_n_t
 Subsequent 6LoWPAN fragmentation header. More...
 

Functions

void sixlowpan_print (uint8_t *data, size_t size)
 Prints 6LoWPAN dispatch to stdout. More...
 

6LoWPAN dispatch definition

See also
RFC 4944, section 5.1
#define SIXLOWPAN_UNCOMP   (0x41)
 uncompressed 6LoWPAN frame dispatch.
 
#define SIXLOWPAN_FRAG_DISP_MASK   (0xf8)
 mask for fragmentation dispatch
 
#define SIXLOWPAN_FRAG_1_DISP   (0xc0)
 dispatch for 1st fragment
 
#define SIXLOWPAN_FRAG_N_DISP   (0xe0)
 dispatch for subsequent fragments
 
#define SIXLOWPAN_FRAG_MAX_LEN   (2047)
 Maximum datagram size $ (2^{11} - 1) $.
 
#define SIXLOWPAN_IPHC1_DISP_MASK   (0xe0)
 Dispatch mask for LOWPAN_IPHC. More...
 
#define SIXLOWPAN_IPHC1_DISP   (0x60)
 Dispatch for LOWPAN_IPHC. More...
 
#define SIXLOWPAN_SFR_DISP_MASK   (0xfe)
 Dispatch mask for 6LoWPAN selective fragment recovery. More...
 
#define SIXLOWPAN_SFR_RFRAG_DISP   (0xe8)
 Dispatch for 6LoWPAN recoverable fragment. More...
 
#define SIXLOWPAN_SFR_ACK_DISP   (0xea)
 Dispatch for 6LoWPAN recoverable fragment acknowledgment. More...
 
static bool sixlowpan_nalp (uint8_t disp)
 Checks if dispatch indicates that frame is not a 6LoWPAN (NALP) frame. More...
 

6LoWPAN fragmentation header definitions

#define SIXLOWPAN_FRAG_SIZE_MASK   (0x07ff)
 mask for datagram size
 
static bool sixlowpan_frag_1_is (sixlowpan_frag_t *hdr)
 Checks if a given header is a 1st 6LoWPAN fragment header. More...
 
static bool sixlowpan_frag_n_is (sixlowpan_frag_t *hdr)
 Checks if a given header is a subsequent 6LoWPAN fragment header. More...
 
static bool sixlowpan_frag_is (sixlowpan_frag_t *hdr)
 Checks if a given header is a 6LoWPAN fragment header. More...
 
static uint16_t sixlowpan_frag_datagram_size (sixlowpan_frag_t *hdr)
 Get datagram size from general 6LoWPAN fragment header. More...
 
static uint16_t sixlowpan_frag_datagram_tag (sixlowpan_frag_t *hdr)
 Get datagram tag from general 6LoWPAN fragment header. More...
 
static uint16_t sixlowpan_frag_offset (sixlowpan_frag_n_t *hdr)
 Get fragment offset from a subsequent 6LoWPAN fragment header. More...
 

6LoWPAN IPHC dispatch definitions

#define SIXLOWPAN_IPHC1_TF   (0x18)
 Flag for Traffic Class & Flow Label elision (part of first byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC1_NH   (0x04)
 Flag for Next Header Compression (part of first byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC1_HL   (0x03)
 Flag for Hop Limit elision (part of first byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_CID_EXT   (0x80)
 Flag for Context Identifier Extension (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_SAC   (0x40)
 Flag for Source Address Compression (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_SAM   (0x30)
 Bits for Source Address Mode (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_DAC   (0x04)
 Flag for Destination Address Compression (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_DAM   (0x03)
 Bits for Destination Address Mode (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC2_M   (0x08)
 Flag for Multicast Compression (part of second byte of LOWPAN_IPHC). More...
 
#define SIXLOWPAN_IPHC_HDR_LEN   (2)
 6LoWPAN IPHC header length
 
#define SIXLOWPAN_IPHC_CID_EXT_LEN   (1)
 6LoWPAN context identifier extension header length
 
static bool sixlowpan_iphc_is (uint8_t *data)
 Checks if datagram is an IPHC datagram. More...