6LoWPAN reassembly buffer
More...
6LoWPAN reassembly buffer
|
file | rb.h |
| Reassembly buffer definitions.
|
|
◆ gnrc_sixlowpan_frag_rb_int_t
Fragment intervals to identify limits of fragments and duplicates.
- Note
- Fragments MUST NOT overlap and overlapping fragments are to be discarded
- See also
- RFC 4944, section 5.3
◆ gnrc_sixlowpan_frag_rb_add()
Adds a new fragment to the reassembly buffer.
If the packet is complete, dispatch the packet with the transmit information of the last fragment.
- Parameters
-
[in] | netif_hdr | The interface header of the fragment, with gnrc_netif_hdr_t::if_pid and its source and destination address set. |
[in] | frag | The fragment to add. Will be released by the function. |
[in] | offset | The fragment's offset. |
[in] | page | Current 6Lo dispatch parsing page. |
- Returns
- The reassembly buffer entry the fragment was added to on success.
-
NULL on error.
◆ gnrc_sixlowpan_frag_rb_array()
Returns a pointer to the array representing the reassembly buffer.
- Note
- Only available when TEST_SUITES is defined
- Returns
- The first element of the reassembly buffer.
const
, so that write access is immediately spotted at compile time of tests. The const
qualifier may however be discarded if required by the tests.
◆ gnrc_sixlowpan_frag_rb_base_rm()
Remove base entry.
- Parameters
-
[in,out] | entry | Entry to remove |
◆ gnrc_sixlowpan_frag_rb_dispatch_when_complete()
Checks if a reassembly buffer entry is complete and dispatches it to the next layer if that is the case.
- Precondition
rbuf != NULL
-
netif != NULL
- Parameters
-
[in] | rbuf | A reassembly buffer entry. Must not be NULL. |
[in] | netif | Original gnrc_netif_hdr_t of the last received frame. Used to construct the gnrc_netif_hdr_t of the completed datagram. Must not be NULL. |
- Returns
- >0, when the datagram in
rbuf
was complete and dispatched.
-
0, when the datagram in
rbuf
is not complete.
-
-1, if the the reassembled datagram was not dispatched.
rbuf
is destroyed either way.
◆ gnrc_sixlowpan_frag_rb_entry_empty()
Checks if a reassembly buffer entry is unset.
- Parameters
-
[in] | rbuf | A reassembly buffer entry |
- Returns
- true, if
rbuf
is empty (i.e. rbuf->super.pkt is NULL).
-
false, if
rbuf
is in use.
Definition at line 168 of file rb.h.
◆ gnrc_sixlowpan_frag_rb_exists()
bool gnrc_sixlowpan_frag_rb_exists |
( |
const gnrc_netif_hdr_t * |
netif_hdr, |
|
|
uint16_t |
tag |
|
) |
| |
Checks if a reassembly buffer entry with a given link-layer address pair and tag exists.
- Precondition
netif_hdr != NULL
- Parameters
-
[in] | netif_hdr | An interface header to provide the (source, destination) link-layer address pair. Must not be NULL. |
[in] | tag | Tag to search for. |
- Note
- datagram_size is not a search parameter as the primary use case for this function is Selective Fragment Recovery where this information only exists in the first fragment.
- Returns
- true, if an entry with the given tuple exist.
-
false, if no entry with the given tuple exist.
◆ gnrc_sixlowpan_frag_rb_remove()
Unsets a reassembly buffer entry (but does not free rbuf_t::super::pkt)
- Precondition
rbuf != NULL
This functions sets rbuf_t::super::pkt to NULL and removes all rbuf::ints.
- Note
- Does nothing if module
gnrc_sixlowpan_frag_rb
is not included.
- Parameters
-
[in] | rbuf | A reassembly buffer entry. Must not be NULL. |
Definition at line 238 of file rb.h.
◆ gnrc_sixlowpan_frag_rb_reset()
void gnrc_sixlowpan_frag_rb_reset |
( |
void |
| ) |
|
Resets the packet buffer to a clean state.
- Note
- Only available when TEST_SUITES is defined
◆ gnrc_sixlowpan_frag_rb_rm_by_datagram()
void gnrc_sixlowpan_frag_rb_rm_by_datagram |
( |
const gnrc_netif_hdr_t * |
netif_hdr, |
|
|
uint16_t |
tag |
|
) |
| |
Removes a reassembly buffer entry with a given link-layer address pair and tag.
- Precondition
netif_hdr != NULL
- Parameters
-
[in] | netif_hdr | An interface header to provide the (source, destination) link-layer address pair. Must not be NULL. |
[in] | tag | Tag to search for. |
- Note
- datagram_size is not a search parameter as the primary use case for this function is Selective Fragment Recovery where this information only exists in the first fragment.