2020#ifndef NET_GNRC_IPV6_EXT_FRAG_H
2121#define NET_GNRC_IPV6_EXT_FRAG_H
2222
23+ #include <stdbool.h>
2324#include <stdint.h>
2425
2526#include "clist.h"
@@ -34,7 +35,22 @@ extern "C" {
3435/**
3536 * @brief Message type to time reassembly buffer garbage collection
3637 */
37- #define GNRC_IPV6_EXT_FRAG_RBUF_GC (0xfe00U)
38+ #define GNRC_IPV6_EXT_FRAG_RBUF_GC (0xfe00U)
39+
40+ /**
41+ * @brief Message type to continue fragmenting a datagram from a given
42+ * fragmentation send buffer
43+ *
44+ * Expected type: @ref gnrc_ipv6_ext_frag_send_t
45+ */
46+ #define GNRC_IPV6_EXT_FRAG_CONTINUE (0xfe01U)
47+
48+ /**
49+ * @brief Message type to send a fragment of an IPv6 datagram.
50+ *
51+ * Expected type: @ref gnrc_pktsnip_t
52+ */
53+ #define GNRC_IPV6_EXT_FRAG_SEND (0xfe02U)
3854
3955/**
4056 * @brief Data type to describe limits of a single fragment in the reassembly
@@ -47,6 +63,18 @@ typedef struct gnrc_ipv6_ext_frag_limits {
4763 * fragment */
4864} gnrc_ipv6_ext_frag_limits_t ;
4965
66+ /**
67+ * @brief Fragmentation send buffer type
68+ */
69+ typedef struct {
70+ gnrc_pktsnip_t * pkt ; /**< the IPv6 packet to fragment */
71+ gnrc_pktsnip_t * per_frag ; /**< per fragment headers */
72+ uint32_t id ; /**< the identification for the fragment header */
73+ uint16_t path_mtu ; /**< path MTU to destination of
74+ * gnrc_ipv6_ext_frag_send_t::pkt */
75+ uint16_t offset ; /**< current fragmentation offset */
76+ } gnrc_ipv6_ext_frag_send_t ;
77+
5078/**
5179 * @brief A reassembly buffer entry
5280 */
@@ -71,6 +99,26 @@ typedef struct {
7199 */
72100void gnrc_ipv6_ext_frag_init (void );
73101
102+ /**
103+ * @brief Send an IPv6 packet fragmented
104+ *
105+ * @param[in] pkt The IPv6 packet. The packet must have an already
106+ * prepared @ref GNRC_NETTYPE_NETIF snip as its first
107+ * snip. The packet must contain at least an IPv6 header
108+ * and any number of IPv6 extension headers after that.
109+ * @param[in] path_mtu Path MTU to destination of IPv6 packet.
110+ */
111+ void gnrc_ipv6_ext_frag_send_pkt (gnrc_pktsnip_t * pkt , unsigned path_mtu );
112+
113+ /**
114+ * @brief (Continue to) fragment packet already in fragmentation send buffer
115+ *
116+ * @pre `snd_buf != NULL`
117+ *
118+ * @param[in,out] snd_buf A fragmentation send buffer entry. May not be NULL.
119+ */
120+ void gnrc_ipv6_ext_frag_send (gnrc_ipv6_ext_frag_send_t * snd_buf );
121+
74122/**
75123 * @brief Reassemble fragmented IPv6 packet
76124 *
0 commit comments