2015-02-11 11:46:48 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-08-17 15:41:29 +02:00
|
|
|
* @defgroup net_gnrc_ipv6 IPv6
|
2015-08-20 16:17:37 +02:00
|
|
|
* @ingroup net_gnrc
|
|
|
|
* @brief GNRC's IPv6 implementation
|
2015-03-03 22:20:21 +01:00
|
|
|
*
|
|
|
|
* The IPv6 control thread understands messages of type
|
|
|
|
*
|
2015-08-17 15:41:29 +02:00
|
|
|
* * @ref GNRC_NETAPI_MSG_TYPE_RCV, and
|
|
|
|
* * @ref GNRC_NETAPI_MSG_TYPE_SND,
|
2015-03-03 22:20:21 +01:00
|
|
|
*
|
2015-02-11 11:46:48 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2015-08-20 16:17:37 +02:00
|
|
|
* @brief Definitions for GNRC's IPv6 implementation
|
2015-02-11 11:46:48 +01:00
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
2015-08-25 15:22:01 +02:00
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
2015-02-11 11:46:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifndef GNRC_IPV6_H_
|
|
|
|
#define GNRC_IPV6_H_
|
2015-02-11 11:46:48 +01:00
|
|
|
|
2015-03-03 22:20:21 +01:00
|
|
|
#include "kernel_types.h"
|
2015-08-10 02:41:08 +02:00
|
|
|
#include "net/gnrc.h"
|
2015-03-03 22:20:21 +01:00
|
|
|
#include "thread.h"
|
|
|
|
|
2015-08-10 00:26:36 +02:00
|
|
|
#include "net/ipv6.h"
|
2015-08-17 15:41:29 +02:00
|
|
|
#include "net/gnrc/ipv6/ext.h"
|
|
|
|
#include "net/gnrc/ipv6/hdr.h"
|
|
|
|
#include "net/gnrc/ipv6/nc.h"
|
|
|
|
#include "net/gnrc/ipv6/netif.h"
|
2015-02-11 11:46:48 +01:00
|
|
|
|
2015-08-12 19:04:43 +02:00
|
|
|
#ifdef MODULE_FIB
|
|
|
|
#include "net/fib.h"
|
|
|
|
#endif
|
|
|
|
|
2015-02-11 11:46:48 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-03-03 22:20:21 +01:00
|
|
|
/**
|
|
|
|
* @brief Default stack size to use for the IPv6 thread
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifndef GNRC_IPV6_STACK_SIZE
|
|
|
|
#define GNRC_IPV6_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
|
2015-03-03 22:20:21 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2015-03-16 17:52:19 +01:00
|
|
|
* @brief Default priority for the IPv6 thread
|
2015-03-03 22:20:21 +01:00
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifndef GNRC_IPV6_PRIO
|
|
|
|
#define GNRC_IPV6_PRIO (THREAD_PRIORITY_MAIN - 3)
|
2015-03-03 22:20:21 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Default message queue size to use for the IPv6 thread.
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifndef GNRC_IPV6_MSG_QUEUE_SIZE
|
|
|
|
#define GNRC_IPV6_MSG_QUEUE_SIZE (8U)
|
2015-03-03 22:20:21 +01:00
|
|
|
#endif
|
|
|
|
|
2015-05-03 15:20:25 +02:00
|
|
|
/**
|
|
|
|
* @brief The PID to the IPv6 thread.
|
|
|
|
*
|
2015-08-17 15:41:29 +02:00
|
|
|
* @note Use @ref gnrc_ipv6_init() to initialize. **Do not set by hand**.
|
2015-05-03 15:20:25 +02:00
|
|
|
*
|
|
|
|
* @details This variable is preferred for IPv6 internal communication *only*.
|
2015-08-17 15:41:29 +02:00
|
|
|
* Please use @ref net_gnrc_netreg for external communication.
|
2015-05-03 15:20:25 +02:00
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
extern kernel_pid_t gnrc_ipv6_pid;
|
2015-05-03 15:20:25 +02:00
|
|
|
|
2015-08-12 19:04:43 +02:00
|
|
|
#ifdef MODULE_FIB
|
2015-08-25 15:22:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Maximum number of entries in the IPv6 FIB table.
|
|
|
|
*/
|
2015-11-17 11:55:23 +01:00
|
|
|
#ifndef GNRC_IPV6_FIB_TABLE_SIZE
|
|
|
|
# ifdef MODULE_GNRC_RPL
|
|
|
|
# define GNRC_IPV6_FIB_TABLE_SIZE (20)
|
|
|
|
# else
|
|
|
|
# define GNRC_IPV6_FIB_TABLE_SIZE (5)
|
|
|
|
# endif
|
|
|
|
#endif
|
2015-08-25 15:22:01 +02:00
|
|
|
|
2015-08-12 19:04:43 +02:00
|
|
|
/**
|
|
|
|
* @brief The forwarding information base (FIB) for the IPv6 stack.
|
|
|
|
*
|
|
|
|
* @see @ref net_fib
|
|
|
|
*/
|
2015-08-25 15:22:01 +02:00
|
|
|
extern fib_table_t gnrc_ipv6_fib_table;
|
2015-08-12 19:04:43 +02:00
|
|
|
#endif
|
|
|
|
|
2015-03-03 22:20:21 +01:00
|
|
|
/**
|
|
|
|
* @brief Initialization of the IPv6 thread.
|
|
|
|
*
|
|
|
|
* @return The PID to the IPv6 thread, on success.
|
|
|
|
* @return a negative errno on error.
|
|
|
|
* @return -EOVERFLOW, if there are too many threads running already
|
|
|
|
* @return -EEXIST, if IPv6 was already initialized.
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
kernel_pid_t gnrc_ipv6_init(void);
|
2015-03-03 22:20:21 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Demultiplexes a packet according to @p nh.
|
|
|
|
*
|
|
|
|
* @internal
|
|
|
|
*
|
|
|
|
* **Do not use outside this module or its submodules!!!**
|
|
|
|
* Public access needed for Extension Headers.
|
|
|
|
*
|
|
|
|
* @param[in] iface The receiving interface.
|
|
|
|
* @param[in] pkt A packet.
|
2015-08-07 15:08:53 +02:00
|
|
|
* @param[in] nh A protocol number (see @ref net_protnum).
|
2015-03-03 22:20:21 +01:00
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
void gnrc_ipv6_demux(kernel_pid_t iface, gnrc_pktsnip_t *pkt, uint8_t nh);
|
2015-03-03 22:20:21 +01:00
|
|
|
|
2015-02-11 11:46:48 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#endif /* GNRC_IPV6_H_ */
|
2015-02-11 11:46:48 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|