2015-03-07 21:46:57 +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_ipv6_ext IPv6 extension headers.
|
|
|
|
* @ingroup net_ng_ipv6
|
|
|
|
* @brief Implementation of IPv6 extension headers
|
|
|
|
* @see <a href="https://tools.ietf.org/html/rfc2460#section-4">
|
|
|
|
* RFC 2460, section 4
|
|
|
|
* </a>
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Definititions for IPv6 extension headers
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NG_IPV6_EXT_H_
|
|
|
|
#define NG_IPV6_EXT_H_
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2015-08-09 23:53:40 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
2015-03-07 21:46:57 +01:00
|
|
|
|
|
|
|
#include "kernel_types.h"
|
|
|
|
#include "net/ng_pkt.h"
|
2015-08-09 23:53:40 +02:00
|
|
|
#include "net/ipv6/ext.h"
|
2015-04-30 21:16:38 +02:00
|
|
|
|
2015-03-07 21:46:57 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Demultiplex extension headers according to @p nh.
|
|
|
|
*
|
|
|
|
* @internal
|
|
|
|
*
|
|
|
|
* @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-07 21:46:57 +01:00
|
|
|
*
|
|
|
|
* @return true, on success.
|
|
|
|
* @return false, on failure.
|
|
|
|
*/
|
|
|
|
bool ng_ipv6_ext_demux(kernel_pid_t iface, ng_pktsnip_t *pkt,
|
|
|
|
uint8_t nh);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Builds an extension header for sending.
|
|
|
|
*
|
|
|
|
* @param[in] ipv6 The IPv6 header. Can be NULL.
|
|
|
|
* @param[in] next The next header. Must be a successor to @p ipv6 if it is
|
|
|
|
* not NULL.
|
2015-08-07 15:08:53 +02:00
|
|
|
* @param[in] nh @ref net_protnum of the next header.
|
2015-03-07 21:46:57 +01:00
|
|
|
* @param[in] size Size of the extension header.
|
|
|
|
*
|
|
|
|
* @return The extension header on success.
|
|
|
|
* @return NULL, on error.
|
|
|
|
*/
|
|
|
|
ng_pktsnip_t *ng_ipv6_ext_build(ng_pktsnip_t *ipv6, ng_pktsnip_t *next,
|
|
|
|
uint8_t nh, size_t size);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* NG_IPV6_EXT_H_ */
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|