Loading...
Searching...
No Matches
sixlowpan.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
134
135#include <stdbool.h>
136
137#include "sched.h"
138
143#include "net/sixlowpan.h"
144
145#ifdef __cplusplus
146extern "C" {
147#endif
148
159static inline bool sixlowpan_frag_is_snip(const gnrc_pktsnip_t *snip)
160{
161 if (snip->size < sizeof(sixlowpan_frag_t)) {
162 return false;
163 }
164
165 if (sixlowpan_frag_n_is(snip->data)) {
166 return snip->size >= sizeof(sixlowpan_frag_n_t);
167 }
168
169 return sixlowpan_frag_1_is(snip->data);
170}
171
184
185#ifdef __cplusplus
186}
187#endif
188
6LoWPAN Fragmentation definitions
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:134
struct gnrc_pktsnip gnrc_pktsnip_t
Type to represent parts (either headers or payload) of a packet, called snips.
static bool sixlowpan_frag_is_snip(const gnrc_pktsnip_t *snip)
Same as sixlowpan_frag_is but operates on a gnrc_pktsnip_t.
Definition sixlowpan.h:159
kernel_pid_t gnrc_sixlowpan_init(void)
Initialization of the 6LoWPAN thread.
static bool sixlowpan_frag_n_is(sixlowpan_frag_t *hdr)
Checks if a given header is a subsequent 6LoWPAN fragment header.
Definition sixlowpan.h:163
static bool sixlowpan_frag_1_is(sixlowpan_frag_t *hdr)
Checks if a given header is a 1st 6LoWPAN fragment header.
Definition sixlowpan.h:150
6LoWPAN IPHC definitions
6LoWPAN internal functions
6LoWPAN dispatch type and helper function definitions.
void * data
pointer to the data of the snip
Definition pkt.h:108
size_t size
the length of the snip in byte
Definition pkt.h:109
Subsequent 6LoWPAN fragmentation header.
Definition sixlowpan.h:130
General and 1st 6LoWPAN fragmentation header.
Definition sixlowpan.h:110
Configuration macros for 6LoWPAN.