2015-04-08 11:56:10 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
|
2015-12-02 10:57:22 +01:00
|
|
|
* Copyright (C) 2015 Hamburg University of Applied Sciences
|
2015-04-08 11:56:10 +02:00
|
|
|
*
|
|
|
|
* 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_sixlowpan_frag 6LoWPAN Fragmentation
|
|
|
|
* @ingroup net_gnrc_sixlowpan
|
2015-04-08 11:56:10 +02:00
|
|
|
* @brief 6LoWPAN Fragmentation headers and functionality
|
|
|
|
* @see <a href="https://tools.ietf.org/html/rfc4944#section-5.3">
|
|
|
|
* RFC 4944, section 5.3
|
|
|
|
* </a>
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief 6LoWPAN Fragmentation definitions
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
2015-12-02 10:57:22 +01:00
|
|
|
* @author Peter Kietzmann <peter.kietzmann@haw-hamburg.de>
|
2015-04-08 11:56:10 +02:00
|
|
|
*/
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef NET_GNRC_SIXLOWPAN_FRAG_H
|
|
|
|
#define NET_GNRC_SIXLOWPAN_FRAG_H
|
2015-04-08 11:56:10 +02:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "byteorder.h"
|
|
|
|
#include "kernel_types.h"
|
2015-08-17 15:41:29 +02:00
|
|
|
#include "net/gnrc/pkt.h"
|
2015-08-17 15:06:44 +02:00
|
|
|
#include "net/sixlowpan.h"
|
2015-04-08 11:56:10 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-12-02 10:57:22 +01:00
|
|
|
/**
|
|
|
|
* @brief Message type for passing one 6LoWPAN fragment down the network stack
|
|
|
|
*/
|
|
|
|
#define GNRC_SIXLOWPAN_MSG_FRAG_SND (0x0225)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Definition of 6LoWPAN fragmentation type.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
kernel_pid_t pid; /**< PID of the interface */
|
|
|
|
gnrc_pktsnip_t *pkt; /**< Pointer to the IPv6 packet to be fragmented */
|
|
|
|
size_t datagram_size; /**< Length of just the IPv6 packet to be fragmented */
|
|
|
|
uint16_t offset; /**< Offset of the Nth fragment from the beginning of the
|
|
|
|
* payload datagram */
|
|
|
|
} gnrc_sixlowpan_msg_frag_t;
|
|
|
|
|
2015-04-08 11:56:10 +02:00
|
|
|
/**
|
|
|
|
* @brief Sends a packet fragmented.
|
|
|
|
*
|
2015-12-02 10:57:22 +01:00
|
|
|
* @param[in] fragment_msg Message containing status of the 6LoWPAN
|
|
|
|
* fragmentation progress
|
2015-04-08 11:56:10 +02:00
|
|
|
*/
|
2015-12-02 10:57:22 +01:00
|
|
|
void gnrc_sixlowpan_frag_send(gnrc_sixlowpan_msg_frag_t *fragment_msg);
|
2015-04-08 11:56:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Handles a packet containing a fragment header.
|
|
|
|
*
|
|
|
|
* @param[in] pkt The packet to handle.
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
void gnrc_sixlowpan_frag_handle_pkt(gnrc_pktsnip_t *pkt);
|
2015-04-08 11:56:10 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* NET_GNRC_SIXLOWPAN_FRAG_H */
|
2015-04-08 11:56:10 +02:00
|
|
|
/** @} */
|