Go to the documentation of this file.
20 #ifndef NET_SIXLOWPAN_H
21 #define NET_SIXLOWPAN_H
40 #define SIXLOWPAN_UNCOMP (0x41)
41 #define SIXLOWPAN_FRAG_DISP_MASK (0xf8)
43 #define SIXLOWPAN_FRAG_1_DISP (0xc0)
44 #define SIXLOWPAN_FRAG_N_DISP (0xe0)
46 #define SIXLOWPAN_FRAG_MAX_LEN (2047)
54 #define SIXLOWPAN_IPHC1_DISP_MASK (0xe0)
62 #define SIXLOWPAN_IPHC1_DISP (0x60)
69 #define SIXLOWPAN_SFR_DISP_MASK (0xfe)
76 #define SIXLOWPAN_SFR_RFRAG_DISP (0xe8)
83 #define SIXLOWPAN_SFR_ACK_DISP (0xea)
95 return ((disp & 0xc0) == 0);
103 #define SIXLOWPAN_FRAG_SIZE_MASK (0x07ff)
116 typedef struct __attribute__((packed)) {
136 typedef struct __attribute__((packed)) {
225 return (hdr->
offset * 8U);
240 #define SIXLOWPAN_IPHC1_TF (0x18)
249 #define SIXLOWPAN_IPHC1_NH (0x04)
257 #define SIXLOWPAN_IPHC1_HL (0x03)
266 #define SIXLOWPAN_IPHC2_CID_EXT (0x80)
275 #define SIXLOWPAN_IPHC2_SAC (0x40)
284 #define SIXLOWPAN_IPHC2_SAM (0x30)
293 #define SIXLOWPAN_IPHC2_DAC (0x04)
302 #define SIXLOWPAN_IPHC2_DAM (0x03)
311 #define SIXLOWPAN_IPHC2_M (0x08)
316 #define SIXLOWPAN_IPHC_HDR_LEN (2)
321 #define SIXLOWPAN_IPHC_CID_EXT_LEN (1)
static bool sixlowpan_frag_n_is(sixlowpan_frag_t *hdr)
Checks if a given header is a subsequent 6LoWPAN fragment header.
static bool sixlowpan_iphc_is(uint8_t *data)
Checks if datagram is an IPHC datagram.
Functions to work with different byte orders.
A 16 bit integer in big endian aka network byte order.
#define SIXLOWPAN_FRAG_N_DISP
dispatch for subsequent fragments
uint8_t u8[2]
8 bit representation
#define SIXLOWPAN_IPHC1_DISP_MASK
Dispatch mask for LOWPAN_IPHC.
static bool sixlowpan_nalp(uint8_t disp)
Checks if dispatch indicates that frame is not a 6LoWPAN (NALP) frame.
static uint16_t sixlowpan_frag_datagram_size(sixlowpan_frag_t *hdr)
Get datagram size from general 6LoWPAN fragment header.
#define SIXLOWPAN_IPHC1_DISP
Dispatch for LOWPAN_IPHC.
void sixlowpan_print(uint8_t *data, size_t size)
Prints 6LoWPAN dispatch to stdout.
network_uint16_t tag
datagram tag
static bool sixlowpan_frag_1_is(sixlowpan_frag_t *hdr)
Checks if a given header is a 1st 6LoWPAN fragment header.
General and 1st 6LoWPAN fragmentation header.
#define SIXLOWPAN_FRAG_SIZE_MASK
mask for datagram size
Subsequent 6LoWPAN fragmentation header.
network_uint16_t disp_size
Dispatch and datagram size.
network_uint16_t disp_size
Dispatch and datagram size.
static bool sixlowpan_frag_is(sixlowpan_frag_t *hdr)
Checks if a given header is a 6LoWPAN fragment header.
network_uint16_t tag
datagram tag
static uint16_t byteorder_ntohs(network_uint16_t v)
Convert from network byte order to host byte order, 16 bit.
#define SIXLOWPAN_FRAG_DISP_MASK
mask for fragmentation dispatch
static uint16_t sixlowpan_frag_datagram_tag(sixlowpan_frag_t *hdr)
Get datagram tag from general 6LoWPAN fragment header.
static uint16_t sixlowpan_frag_offset(sixlowpan_frag_n_t *hdr)
Get fragment offset from a subsequent 6LoWPAN fragment header.
#define SIXLOWPAN_FRAG_1_DISP
dispatch for 1st fragment