2015-04-13 12:48:53 +02: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_sixlowpan_iphc IPv6 header compression (IPHC)
|
|
|
|
* @ingroup net_gnrc_sixlowpan
|
2015-04-13 12:48:53 +02:00
|
|
|
* @brief IPv6 header compression for 6LoWPAN.
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief 6LoWPAN IPHC definitions
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef NET_GNRC_SIXLOWPAN_IPHC_H
|
|
|
|
#define NET_GNRC_SIXLOWPAN_IPHC_H
|
2015-04-13 12:48:53 +02:00
|
|
|
|
|
|
|
#include <stdbool.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-13 12:48:53 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Decompresses a received 6LoWPAN IPHC frame.
|
|
|
|
*
|
2018-06-28 19:26:43 +02:00
|
|
|
* @pre (pkt != NULL)
|
2015-08-11 23:24:01 +02:00
|
|
|
*
|
2018-06-28 19:26:43 +02:00
|
|
|
* @param[in] pkt A received 6LoWPAN IPHC frame. The first snip is to
|
|
|
|
* be expected to start with the IPHC dispatch.
|
|
|
|
* @param[in,out] ctx Context for the packet. May be NULL. If not NULL it
|
|
|
|
* is expected to be of type
|
2019-09-28 12:11:54 +02:00
|
|
|
* @ref gnrc_sixlowpan_frag_rb_t. This function might
|
2018-06-28 19:26:43 +02:00
|
|
|
* change the content of that.
|
|
|
|
* @param[in] page Current 6Lo dispatch parsing page.
|
2015-04-13 12:48:53 +02:00
|
|
|
*/
|
2018-06-28 19:26:43 +02:00
|
|
|
void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *pkt, void *ctx, unsigned page);
|
2015-04-13 12:48:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Compresses a 6LoWPAN for IPHC.
|
|
|
|
*
|
2018-07-03 16:15:17 +02:00
|
|
|
* @pre (pkt != NULL)
|
|
|
|
*
|
|
|
|
* @param[in] pkt A 6LoWPAN frame with an uncompressed IPv6 header to send.
|
|
|
|
* Will be translated to an 6LoWPAN IPHC frame.
|
|
|
|
* @param[in] ctx Context for the packet. May be NULL.
|
2019-02-26 14:09:36 +01:00
|
|
|
* If not NULL it is expected to be of type @ref
|
|
|
|
* gnrc_sixlowpan_frag_fb_t to provide initial information for
|
|
|
|
* possible fragmentation after compression (see
|
|
|
|
* net_gnrc_sixlowpan_frag_hint). This function might change
|
|
|
|
* the content of that. Depending on the compile configuration
|
|
|
|
* it might be ignored completely.
|
2018-07-03 16:15:17 +02:00
|
|
|
* @param[in] page Current 6Lo dispatch parsing page.
|
2015-04-13 12:48:53 +02:00
|
|
|
*
|
|
|
|
*/
|
2018-07-03 16:15:17 +02:00
|
|
|
void gnrc_sixlowpan_iphc_send(gnrc_pktsnip_t *pkt, void *ctx, unsigned page);
|
2015-04-13 12:48:53 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* NET_GNRC_SIXLOWPAN_IPHC_H */
|
2015-04-13 12:48:53 +02:00
|
|
|
/** @} */
|