1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/include/net/gnrc/ipv6/hdr.h

60 lines
1.7 KiB
C
Raw Normal View History

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.
*/
/**
* @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>
*/
#ifndef GNRC_IPV6_HDR_H_
#define GNRC_IPV6_HDR_H_
2015-03-28 14:05:17 +01:00
#include <stdint.h>
2015-03-28 14:05:17 +01:00
#include "net/ipv6/hdr.h"
#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] src_len Length of @p src. Can be 0 if not known or required or
2015-08-10 00:26:36 +02:00
* must be `sizeof(ipv6_addr_t)`.
2015-03-28 14:05:17 +01:00
* @param[in] dst Destination address for the header. Can be NULL if not
* known or required.
* @param[in] dst_len Length of @p dst. Can be 0 if not known or required or
2015-08-10 00:26:36 +02:00
* must be `sizeof(ipv6_addr_t)`.
2015-03-28 14:05:17 +01:00
*
* @return The an IPv6 header in packet buffer on success.
* @return NULL on error.
*/
gnrc_pktsnip_t *gnrc_ipv6_hdr_build(gnrc_pktsnip_t *payload,
uint8_t *src, uint8_t src_len,
uint8_t *dst, uint8_t dst_len);
2015-03-28 14:05:17 +01:00
#ifdef __cplusplus
}
#endif
#endif /* GNRC_IPV6_HDR_H_ */
2015-03-28 14:05:17 +01:00
/** @} */