2015-03-28 14:05:17 +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_hdr IPv6 header defintions
|
|
|
|
* @ingroup net_gnrc_ipv6
|
2015-03-28 14:05:17 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief IPv6 header
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifndef GNRC_IPV6_HDR_H_
|
|
|
|
#define GNRC_IPV6_HDR_H_
|
2015-03-28 14:05:17 +01:00
|
|
|
|
2015-08-09 23:53:40 +02:00
|
|
|
#include <stdint.h>
|
2015-03-28 14:05:17 +01:00
|
|
|
|
2015-08-10 02:04:35 +02:00
|
|
|
#include "net/ipv6/hdr.h"
|
2015-08-17 15:41:29 +02:00
|
|
|
#include "net/gnrc/pkt.h"
|
2015-03-28 14:05:17 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Builds an IPv6 header for sending and adds it to the packet buffer.
|
|
|
|
*
|
|
|
|
* @details Initializes version field with 6, traffic class, flow label, and
|
2015-08-07 15:08:53 +02:00
|
|
|
* hop limit with 0, and next header with @ref PROTNUM_RESERVED.
|
2015-03-28 14:05:17 +01:00
|
|
|
*
|
|
|
|
* @param[in] payload Payload for the packet.
|
|
|
|
* @param[in] src Source address for the header. Can be NULL if not
|
|
|
|
* known or required.
|
|
|
|
* @param[in] dst Destination address for the header. Can be NULL if not
|
|
|
|
* known or required.
|
|
|
|
*
|
|
|
|
* @return The an IPv6 header in packet buffer on success.
|
|
|
|
* @return NULL on error.
|
|
|
|
*/
|
2016-03-21 18:46:52 +01:00
|
|
|
gnrc_pktsnip_t *gnrc_ipv6_hdr_build(gnrc_pktsnip_t *payload, const ipv6_addr_t *src,
|
|
|
|
const ipv6_addr_t *dst);
|
2015-03-28 14:05:17 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#endif /* GNRC_IPV6_HDR_H_ */
|
2015-03-28 14:05:17 +01:00
|
|
|
/** @} */
|