Support for IPv6 fragmentation extension

GNRC implementation of IPv6 fragmentation extension. More...

Detailed Description

GNRC implementation of IPv6 fragmentation extension.

Files

file  frag.h
 GNRC fragmentation extension definitions.
 

Data Structures

struct  gnrc_ipv6_ext_frag_limits
 Data type to describe limits of a single fragment in the reassembly buffer. More...
 
struct  gnrc_ipv6_ext_frag_send_t
 Fragmentation send buffer type. More...
 
struct  gnrc_ipv6_ext_frag_rbuf_t
 A reassembly buffer entry. More...
 
struct  gnrc_ipv6_ext_frag_stats_t
 Statistics on reassembly and reassembly. More...
 

Macros

#define GNRC_IPV6_EXT_FRAG_RBUF_GC   (0xfe00U)
 Message type to time reassembly buffer garbage collection.
 
#define GNRC_IPV6_EXT_FRAG_CONTINUE   (0xfe01U)
 Message type to continue fragmenting a datagram from a given fragmentation send buffer. More...
 
#define GNRC_IPV6_EXT_FRAG_SEND   (0xfe02U)
 Message type to send a fragment of an IPv6 datagram. More...
 

Typedefs

typedef struct gnrc_ipv6_ext_frag_limits gnrc_ipv6_ext_frag_limits_t
 Data type to describe limits of a single fragment in the reassembly buffer.
 

Functions

void gnrc_ipv6_ext_frag_init (void)
 Initializes IPv6 fragmentation and reassembly.
 
void gnrc_ipv6_ext_frag_send_pkt (gnrc_pktsnip_t *pkt, unsigned path_mtu)
 Send an IPv6 packet fragmented. More...
 
void gnrc_ipv6_ext_frag_send (gnrc_ipv6_ext_frag_send_t *snd_buf)
 (Continue to) fragment packet already in fragmentation send buffer More...
 
gnrc_pktsnip_tgnrc_ipv6_ext_frag_reass (gnrc_pktsnip_t *pkt)
 Reassemble fragmented IPv6 packet. More...
 
gnrc_ipv6_ext_frag_stats_tgnrc_ipv6_ext_frag_stats (void)
 Get the current statistics on reassembly and fragmentation. More...
 

Reassembly buffer operations

gnrc_ipv6_ext_frag_rbuf_tgnrc_ipv6_ext_frag_rbuf_get (ipv6_hdr_t *ipv6, uint32_t id)
 Get a reassembly buffer by the identifying parameters.
 
void gnrc_ipv6_ext_frag_rbuf_free (gnrc_ipv6_ext_frag_rbuf_t *rbuf)
 Frees a reassembly buffer entry (but does not release its gnrc_ipv6_ext_frag_rbuf_t::pkt) More...
 
static void gnrc_ipv6_ext_frag_rbuf_del (gnrc_ipv6_ext_frag_rbuf_t *rbuf)
 Delete a reassembly buffer entry (and release its gnrc_ipv6_ext_frag_rbuf_t::pkt) More...
 
void gnrc_ipv6_ext_frag_rbuf_gc (void)
 Garbage-collect reassembly buffer. More...
 

Macro Definition Documentation

◆ GNRC_IPV6_EXT_FRAG_CONTINUE

#define GNRC_IPV6_EXT_FRAG_CONTINUE   (0xfe01U)

Message type to continue fragmenting a datagram from a given fragmentation send buffer.

Expected type: gnrc_ipv6_ext_frag_send_t

Definition at line 46 of file frag.h.

◆ GNRC_IPV6_EXT_FRAG_SEND

#define GNRC_IPV6_EXT_FRAG_SEND   (0xfe02U)

Message type to send a fragment of an IPv6 datagram.

Expected type: gnrc_pktsnip_t

Definition at line 53 of file frag.h.

Function Documentation

◆ gnrc_ipv6_ext_frag_rbuf_del()

static void gnrc_ipv6_ext_frag_rbuf_del ( gnrc_ipv6_ext_frag_rbuf_t rbuf)
inlinestatic

Delete a reassembly buffer entry (and release its gnrc_ipv6_ext_frag_rbuf_t::pkt)

Note
May be used by the IPv6 thread to remove a timed out reassembly buffer entry.
Parameters
[in]rbufA reassembly buffer entry.

Definition at line 185 of file frag.h.

◆ gnrc_ipv6_ext_frag_rbuf_free()

void gnrc_ipv6_ext_frag_rbuf_free ( gnrc_ipv6_ext_frag_rbuf_t rbuf)

Frees a reassembly buffer entry (but does not release its gnrc_ipv6_ext_frag_rbuf_t::pkt)

Parameters
[in]rbufA reassembly buffer entry.

◆ gnrc_ipv6_ext_frag_rbuf_gc()

void gnrc_ipv6_ext_frag_rbuf_gc ( void  )

Garbage-collect reassembly buffer.

This calls gnrc_ipv6_ext_frag_rbuf_del() for all reassembly buffer entries for which * gnrc_ipv6_ext_frag_rbuf_t::arrival is CONFIG_GNRC_IPV6_EXT_FRAG_RBUF_TIMEOUT_US in the past.

◆ gnrc_ipv6_ext_frag_reass()

gnrc_pktsnip_t* gnrc_ipv6_ext_frag_reass ( gnrc_pktsnip_t pkt)

Reassemble fragmented IPv6 packet.

Parameters
[in]pktA fragment of the IPv6 packet to be reassembled containing the fragment header in the first snip.
Returns
The reassembled packet when pkt completed the reassembly
NULL, when there are still fragments missing or an error occurred during reassembly

◆ gnrc_ipv6_ext_frag_send()

void gnrc_ipv6_ext_frag_send ( gnrc_ipv6_ext_frag_send_t snd_buf)

(Continue to) fragment packet already in fragmentation send buffer

Precondition
snd_buf != NULL
Parameters
[in,out]snd_bufA fragmentation send buffer entry. May not be NULL.

◆ gnrc_ipv6_ext_frag_send_pkt()

void gnrc_ipv6_ext_frag_send_pkt ( gnrc_pktsnip_t pkt,
unsigned  path_mtu 
)

Send an IPv6 packet fragmented.

Parameters
[in]pktThe IPv6 packet. The packet must have an already prepared GNRC_NETTYPE_NETIF snip as its first snip. The packet must contain at least an IPv6 header and any number of IPv6 extension headers after that.
[in]path_mtuPath MTU to destination of IPv6 packet.

◆ gnrc_ipv6_ext_frag_stats()

gnrc_ipv6_ext_frag_stats_t* gnrc_ipv6_ext_frag_stats ( void  )

Get the current statistics on reassembly and fragmentation.

Returns
The current statistics on reassembly and fragmentation.
NULL, if module gnrc_ipv6_ext_frag_stats is not compiled in.