2015-03-16 17:52:19 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup net_ng_sixlowpan 6LoWPAN
|
|
|
|
* @ingroup net
|
|
|
|
* @brief 6LoWPAN implementation
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Definitions for 6LoWPAN
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
|
|
|
#ifndef NG_SIXLOWPAN_H_
|
|
|
|
#define NG_SIXLOWPAN_H_
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "kernel_types.h"
|
|
|
|
|
2015-04-08 11:56:10 +02:00
|
|
|
#include "net/ng_sixlowpan/frag.h"
|
2015-04-13 12:48:53 +02:00
|
|
|
#include "net/ng_sixlowpan/iphc.h"
|
2015-04-08 11:56:10 +02:00
|
|
|
|
2015-03-16 17:52:19 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Default stack size to use for the 6LoWPAN thread
|
|
|
|
*/
|
|
|
|
#ifndef NG_SIXLOWPAN_STACK_SIZE
|
2015-04-28 20:02:05 +02:00
|
|
|
#define NG_SIXLOWPAN_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
|
2015-03-16 17:52:19 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Default priority for the 6LoWPAN thread
|
|
|
|
*/
|
|
|
|
#ifndef NG_SIXLOWPAN_PRIO
|
2015-04-28 20:02:05 +02:00
|
|
|
#define NG_SIXLOWPAN_PRIO (THREAD_PRIORITY_MAIN - 4)
|
2015-03-16 17:52:19 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Default message queue size to use for the 6LoWPAN thread.
|
|
|
|
*/
|
|
|
|
#ifndef NG_SIXLOWPAN_MSG_QUEUE_SIZE
|
|
|
|
#define NG_SIXLOWPAN_MSG_QUEUE_SIZE (8U)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Dispatch for uncompressed 6LoWPAN frame.
|
|
|
|
*/
|
|
|
|
#define NG_SIXLOWPAN_UNCOMPRESSED (0x41)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Checks if dispatch indicats that fram is not a 6LoWPAN (NALP) frame.
|
|
|
|
*
|
|
|
|
* @param[in] disp The first byte of a frame.
|
|
|
|
*
|
|
|
|
* @return true, if frame is a NALP.
|
|
|
|
* @return false, if frame is not a NALP.
|
|
|
|
*/
|
|
|
|
static inline bool ng_sixlowpan_nalp(uint8_t disp)
|
|
|
|
{
|
|
|
|
return (disp & 0x3f);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialization of the 6LoWPAN thread.
|
|
|
|
*
|
|
|
|
* @return The PID to the 6LoWPAN thread, on success.
|
|
|
|
* @return -EOVERFLOW, if there are too many threads running already
|
|
|
|
*/
|
|
|
|
kernel_pid_t ng_sixlowpan_init(void);
|
|
|
|
|
2015-04-14 00:18:36 +02:00
|
|
|
/**
|
|
|
|
* @brief Prints 6LoWPAN dispatch to stdout.
|
|
|
|
*
|
|
|
|
* @param[in] data A 6LoWPAN frame.
|
|
|
|
* @param[in] size Size of @p data.
|
|
|
|
*/
|
|
|
|
void ng_sixlowpan_print(uint8_t *data, size_t size);
|
|
|
|
|
2015-03-16 17:52:19 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* NG_SIXLOWPAN_H_ */
|
|
|
|
/** @} */
|