mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 15:31:17 +01:00
Merge pull request #12560 from miri64/gnrc_sixlowpan/cleanup/rb-remainders
gnrc_sixlowpan: move remaining reassembly buffer components to gnrc_sixlowpan_frag_rb
This commit is contained in:
commit
e990b26d5b
@ -65,7 +65,7 @@ extern "C" {
|
||||
* @brief Size of the reassembly buffer
|
||||
*
|
||||
* @note Only applicable with
|
||||
* [gnrc_sixlowpan_frag](@ref net_gnrc_sixlowpan_frag) module
|
||||
* [gnrc_sixlowpan_frag_rb](@ref net_gnrc_sixlowpan_frag_rb) module
|
||||
*/
|
||||
#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_SIZE
|
||||
#define GNRC_SIXLOWPAN_FRAG_RBUF_SIZE (4U)
|
||||
@ -75,7 +75,7 @@ extern "C" {
|
||||
* @brief Timeout for reassembly buffer entries in microseconds
|
||||
*
|
||||
* @note Only applicable with
|
||||
* [gnrc_sixlowpan_frag](@ref net_gnrc_sixlowpan_frag) module
|
||||
* [gnrc_sixlowpan_frag_rb](@ref net_gnrc_sixlowpan_frag_rb) module
|
||||
*/
|
||||
#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US
|
||||
#define GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US (3U * US_PER_SEC)
|
||||
@ -85,7 +85,7 @@ extern "C" {
|
||||
* @brief Aggressively override reassembly buffer when full
|
||||
*
|
||||
* @note Only applicable with
|
||||
* [gnrc_sixlowpan_frag](@ref net_gnrc_sixlowpan_frag) module
|
||||
* [gnrc_sixlowpan_frag_rb](@ref net_gnrc_sixlowpan_frag_rb) module
|
||||
*
|
||||
* When set to a non-zero value this will cause the reassembly buffer to
|
||||
* override the oldest entry no matter what. When set to zero only the oldest
|
||||
|
||||
@ -51,11 +51,6 @@ extern "C" {
|
||||
* @brief Message type for passing one 6LoWPAN fragment down the network stack
|
||||
*/
|
||||
#define GNRC_SIXLOWPAN_MSG_FRAG_SND (0x0225)
|
||||
|
||||
/**
|
||||
* @brief Message type for triggering garbage collection reassembly buffer
|
||||
*/
|
||||
#define GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF (0x0226)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
||||
@ -31,6 +31,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* @brief Message type for triggering garbage collection reassembly buffer
|
||||
*/
|
||||
#define GNRC_SIXLOWPAN_FRAG_RB_GC_MSG (0x0226)
|
||||
|
||||
/**
|
||||
* @brief Fragment intervals to identify limits of fragments and duplicates.
|
||||
|
||||
@ -55,7 +55,7 @@ static gnrc_sixlowpan_frag_rb_t rbuf[GNRC_SIXLOWPAN_FRAG_RBUF_SIZE];
|
||||
static char l2addr_str[3 * IEEE802154_LONG_ADDRESS_LEN];
|
||||
|
||||
static xtimer_t _gc_timer;
|
||||
static msg_t _gc_timer_msg = { .type = GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF };
|
||||
static msg_t _gc_timer_msg = { .type = GNRC_SIXLOWPAN_FRAG_RB_GC_MSG };
|
||||
|
||||
/* ------------------------------------
|
||||
* internal function definitions
|
||||
|
||||
@ -348,7 +348,9 @@ static void *_event_loop(void *args)
|
||||
DEBUG("6lo: send fragmented event received\n");
|
||||
gnrc_sixlowpan_frag_send(NULL, msg.content.ptr, 0);
|
||||
break;
|
||||
case GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF:
|
||||
#endif
|
||||
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_RB
|
||||
case GNRC_SIXLOWPAN_FRAG_RB_GC_MSG:
|
||||
DEBUG("6lo: garbage collect reassembly buffer event received\n");
|
||||
gnrc_sixlowpan_frag_rb_gc();
|
||||
break;
|
||||
|
||||
@ -594,7 +594,7 @@ static void test_rbuf_gc__timed(void)
|
||||
xtimer_msg_receive_timeout(&msg, TEST_GC_TIMEOUT) >= 0,
|
||||
"Waiting for GC timer timed out"
|
||||
);
|
||||
TEST_ASSERT_EQUAL_INT(GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF, msg.type);
|
||||
TEST_ASSERT_EQUAL_INT(GNRC_SIXLOWPAN_FRAG_RB_GC_MSG, msg.type);
|
||||
gnrc_sixlowpan_frag_rb_gc();
|
||||
/* reassembly buffer is now empty */
|
||||
TEST_ASSERT_NULL(_first_non_empty_rbuf());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user