From 5523d119b6fbd7048c5c5e07a2b1508cc3333c95 Mon Sep 17 00:00:00 2001 From: Akshai M Date: Mon, 11 May 2020 19:14:40 +0530 Subject: [PATCH] gnrc/pktbuf : Move 'GNRC_PKTBUF_SIZE' to 'CONFIG_' --- cpu/msp430_common/include/cpu_conf.h | 4 +-- cpu/native/include/cpu_conf.h | 6 ++-- cpu/nrf51/include/cpu_conf.h | 4 +-- examples/default/Makefile | 2 +- examples/gnrc_lorawan/Makefile | 2 +- examples/gnrc_minimal/Makefile | 2 +- examples/nanocoap_server/Makefile | 2 +- examples/suit_update/Makefile | 2 +- sys/include/net/gnrc/pktbuf.h | 12 +++---- .../gnrc/pktbuf_malloc/gnrc_pktbuf_malloc.c | 6 ++-- .../gnrc/pktbuf_static/gnrc_pktbuf_static.c | 32 ++++++++--------- tests/conn_can/Makefile | 2 +- tests/driver_encx24j600/Makefile | 2 +- tests/driver_netdev_common/Makefile | 4 +-- tests/driver_xbee/Makefile | 2 +- tests/gnrc_gomach/Makefile | 2 +- tests/gnrc_ipv6_fwd_w_sub/Makefile | 2 +- tests/gnrc_ipv6_nib/Makefile | 2 +- tests/gnrc_ipv6_nib_6ln/Makefile | 2 +- tests/gnrc_ipv6_nib_dns/Makefile | 2 +- tests/gnrc_lwmac/Makefile | 2 +- tests/gnrc_ndp/Makefile | 2 +- tests/gnrc_ndp/main.c | 34 +++++++++---------- tests/gnrc_sixlowpan_frag/Makefile | 2 +- tests/gnrc_sixlowpan_iphc_w_vrb/Makefile | 2 +- tests/gnrc_sock_async_event/Makefile | 2 +- tests/gnrc_sock_dns/Makefile | 2 +- tests/gnrc_sock_ip/Makefile | 2 +- tests/gnrc_sock_neterr/Makefile | 2 +- tests/gnrc_sock_udp/Makefile | 2 +- tests/gnrc_udp/Makefile | 2 +- tests/netdev_test/Makefile | 2 +- tests/pkg_microcoap/Makefile | 2 +- tests/riotboot_flashwrite/Makefile | 2 +- tests/unittests/tests-pktbuf/tests-pktbuf.c | 14 ++++---- 35 files changed, 84 insertions(+), 84 deletions(-) diff --git a/cpu/msp430_common/include/cpu_conf.h b/cpu/msp430_common/include/cpu_conf.h index eab506fe00..7f61ffd67b 100644 --- a/cpu/msp430_common/include/cpu_conf.h +++ b/cpu/msp430_common/include/cpu_conf.h @@ -74,9 +74,9 @@ extern "C" { # define ISR_STACKSIZE (256) #endif -#ifndef GNRC_PKTBUF_SIZE +#ifndef CONFIG_GNRC_PKTBUF_SIZE /* TODO: Make this value overall MTU dependent */ -# define GNRC_PKTBUF_SIZE (2560) +# define CONFIG_GNRC_PKTBUF_SIZE (2560) #endif #ifndef GNRC_IPV6_STACK_SIZE diff --git a/cpu/native/include/cpu_conf.h b/cpu/native/include/cpu_conf.h index c801eafb07..4fa31791fb 100644 --- a/cpu/native/include/cpu_conf.h +++ b/cpu/native/include/cpu_conf.h @@ -55,9 +55,9 @@ extern "C" { */ #define NATIVE_ETH_PROTO 0x1234 -#if (defined(GNRC_PKTBUF_SIZE)) && (GNRC_PKTBUF_SIZE < 2048) -# undef GNRC_PKTBUF_SIZE -# define GNRC_PKTBUF_SIZE (2048) +#if (defined(CONFIG_GNRC_PKTBUF_SIZE)) && (CONFIG_GNRC_PKTBUF_SIZE < 2048) +# undef CONFIG_GNRC_PKTBUF_SIZE +# define CONFIG_GNRC_PKTBUF_SIZE (2048) #endif #ifdef __cplusplus diff --git a/cpu/nrf51/include/cpu_conf.h b/cpu/nrf51/include/cpu_conf.h index eb7e4a2b29..69d7db95fa 100644 --- a/cpu/nrf51/include/cpu_conf.h +++ b/cpu/nrf51/include/cpu_conf.h @@ -62,8 +62,8 @@ extern "C" { * buffer size on these CPUs * @{ */ -#ifndef GNRC_PKTBUF_SIZE -#define GNRC_PKTBUF_SIZE (2048) +#ifndef CONFIG_GNRC_PKTBUF_SIZE +#define CONFIG_GNRC_PKTBUF_SIZE (2048) #endif /** @} */ diff --git a/examples/default/Makefile b/examples/default/Makefile index b54d85bdbc..786244dad6 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -57,7 +57,7 @@ ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF))) # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit - CFLAGS += -DGNRC_PKTBUF_SIZE=512 + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 endif FEATURES_OPTIONAL += periph_rtc diff --git a/examples/gnrc_lorawan/Makefile b/examples/gnrc_lorawan/Makefile index eb9befba57..95d7933b56 100644 --- a/examples/gnrc_lorawan/Makefile +++ b/examples/gnrc_lorawan/Makefile @@ -21,7 +21,7 @@ USEMODULE += $(DRIVER) # We can reduce the size of the packet buffer for LoRaWAN, since there's no IP # support. This will reduce RAM consumption. -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 ########################### COMPILE TIME CONFIGURATION ######################## diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index aae86ca5e8..26aa9cd721 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -24,7 +24,7 @@ USEMODULE += gnrc_icmpv6_echo USEMODULE += prng_minstd CFLAGS += -DLOG_LEVEL=LOG_NONE # disable log output -CFLAGS += -DGNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 # be able to configure at least one route diff --git a/examples/nanocoap_server/Makefile b/examples/nanocoap_server/Makefile index 4432829dff..4ceccaf119 100644 --- a/examples/nanocoap_server/Makefile +++ b/examples/nanocoap_server/Makefile @@ -42,7 +42,7 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) $(info Using low-memory configuration for microcoap_server.) ## low-memory tuning values # lower pktbuf buffer size - CFLAGS += -DGNRC_PKTBUF_SIZE=1000 + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 USEMODULE += prng_minstd endif diff --git a/examples/suit_update/Makefile b/examples/suit_update/Makefile index ae154785bd..1ece8fc910 100644 --- a/examples/suit_update/Makefile +++ b/examples/suit_update/Makefile @@ -8,7 +8,7 @@ BOARD ?= samr21-xpro RIOTBASE ?= $(CURDIR)/../.. # lower pktbuf size to something sufficient for this application -CFLAGS += -DGNRC_PKTBUF_SIZE=2000 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2000 # # Networking diff --git a/sys/include/net/gnrc/pktbuf.h b/sys/include/net/gnrc/pktbuf.h index 5a5fe81329..bca3af7299 100644 --- a/sys/include/net/gnrc/pktbuf.h +++ b/sys/include/net/gnrc/pktbuf.h @@ -14,7 +14,7 @@ * * @note **WARNING!!** Do not store data structures that are not packed * (defined with `__attribute__((packed))`) or enforce alignment in - * in any way in here if @ref GNRC_PKTBUF_SIZE > 0. On some RISC architectures + * in any way in here if @ref CONFIG_GNRC_PKTBUF_SIZE > 0. On some RISC architectures * this *will* lead to alignment problems and can potentially result * in segmentation/hard faults and other unexpected behaviour. * @@ -45,7 +45,7 @@ extern "C" { #endif /** - * @def GNRC_PKTBUF_SIZE + * @def CONFIG_GNRC_PKTBUF_SIZE * @defgroup net_gnrc_pktbuf_conf GNRC PKTBUF compile configurations * @ingroup net_gnrc_conf * @{ @@ -56,11 +56,11 @@ extern "C" { * @details The rational here is to have at least space for 4 full-MTU IPv6 * packages (2 incoming, 2 outgoing; 2 * 2 * 1280 B = 5 KiB) + * Meta-Data (roughly estimated to 1 KiB; might be smaller). If - * @ref GNRC_PKTBUF_SIZE is 0 the packet buffer will use dynamic memory + * @ref CONFIG_GNRC_PKTBUF_SIZE is 0 the packet buffer will use dynamic memory * management to allocate packets. */ -#ifndef GNRC_PKTBUF_SIZE -#define GNRC_PKTBUF_SIZE (6144) +#ifndef CONFIG_GNRC_PKTBUF_SIZE +#define CONFIG_GNRC_PKTBUF_SIZE (6144) #endif /** @} */ @@ -76,7 +76,7 @@ void gnrc_pktbuf_init(void); * function externally. This will most likely create memory leaks or * not allowed memory access. * - * @pre size < GNRC_PKTBUF_SIZE + * @pre size < CONFIG_GNRC_PKTBUF_SIZE * * @param[in] next Next gnrc_pktsnip_t in the packet. Leave NULL if you * want to create a new packet. diff --git a/sys/net/gnrc/pktbuf_malloc/gnrc_pktbuf_malloc.c b/sys/net/gnrc/pktbuf_malloc/gnrc_pktbuf_malloc.c index 9cf5cbbec9..776067dca5 100644 --- a/sys/net/gnrc/pktbuf_malloc/gnrc_pktbuf_malloc.c +++ b/sys/net/gnrc/pktbuf_malloc/gnrc_pktbuf_malloc.c @@ -101,9 +101,9 @@ gnrc_pktsnip_t *gnrc_pktbuf_add(gnrc_pktsnip_t *next, const void *data, size_t s { gnrc_pktsnip_t *pkt; - if (size > GNRC_PKTBUF_SIZE) { - DEBUG("pktbuf: size (%u) > GNRC_PKTBUF_SIZE (%u)\n", - (unsigned)size, GNRC_PKTBUF_SIZE); + if (size > CONFIG_GNRC_PKTBUF_SIZE) { + DEBUG("pktbuf: size (%u) > CONFIG_GNRC_PKTBUF_SIZE (%u)\n", + (unsigned)size, CONFIG_GNRC_PKTBUF_SIZE); return NULL; } mutex_lock(&_mutex); diff --git a/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c b/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c index 5c120470b7..bcbe197e49 100644 --- a/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c +++ b/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c @@ -41,7 +41,7 @@ typedef struct _unused { } _unused_t; static mutex_t _mutex = MUTEX_INIT; -static uint8_t _pktbuf[GNRC_PKTBUF_SIZE]; +static uint8_t _pktbuf[CONFIG_GNRC_PKTBUF_SIZE]; static _unused_t *_first_unused; #ifdef DEVELHELP @@ -57,7 +57,7 @@ static void _pktbuf_free(void *data, size_t size); static inline bool _pktbuf_contains(void *ptr) { - return (unsigned)((uint8_t *)ptr - _pktbuf) < GNRC_PKTBUF_SIZE; + return (unsigned)((uint8_t *)ptr - _pktbuf) < CONFIG_GNRC_PKTBUF_SIZE; } /* fits size to byte alignment */ @@ -93,9 +93,9 @@ gnrc_pktsnip_t *gnrc_pktbuf_add(gnrc_pktsnip_t *next, const void *data, size_t s { gnrc_pktsnip_t *pkt; - if (size > GNRC_PKTBUF_SIZE) { - DEBUG("pktbuf: size (%u) > GNRC_PKTBUF_SIZE (%u)\n", - (unsigned)size, GNRC_PKTBUF_SIZE); + if (size > CONFIG_GNRC_PKTBUF_SIZE) { + DEBUG("pktbuf: size (%u) > CONFIG_GNRC_PKTBUF_SIZE (%u)\n", + (unsigned)size, CONFIG_GNRC_PKTBUF_SIZE); return NULL; } mutex_lock(&_mutex); @@ -303,10 +303,10 @@ void gnrc_pktbuf_stats(void) int count = 0; printf("packet buffer: first byte: %p, last byte: %p (size: %u)\n", - (void *)&_pktbuf[0], (void *)&_pktbuf[GNRC_PKTBUF_SIZE], GNRC_PKTBUF_SIZE); + (void *)&_pktbuf[0], (void *)&_pktbuf[CONFIG_GNRC_PKTBUF_SIZE], CONFIG_GNRC_PKTBUF_SIZE); printf(" position of last byte used: %" PRIu16 "\n", max_byte_count); if (ptr == NULL) { /* packet buffer is completely full */ - _print_chunk(chunk, GNRC_PKTBUF_SIZE, count++); + _print_chunk(chunk, CONFIG_GNRC_PKTBUF_SIZE, count++); } if (((void *)ptr) == ((void *)chunk)) { /* _first_unused is at the beginning */ @@ -318,7 +318,7 @@ void gnrc_pktbuf_stats(void) while (ptr) { size_t size = ((uint8_t *)ptr) - chunk; if ((size == 0) && (!_pktbuf_contains(ptr)) && - (!_pktbuf_contains(chunk)) && (size > GNRC_PKTBUF_SIZE)) { + (!_pktbuf_contains(chunk)) && (size > CONFIG_GNRC_PKTBUF_SIZE)) { puts("ERROR"); return; } @@ -328,8 +328,8 @@ void gnrc_pktbuf_stats(void) ptr = ptr->next; } - if (chunk <= &_pktbuf[GNRC_PKTBUF_SIZE - 1]) { - _print_chunk(chunk, &_pktbuf[GNRC_PKTBUF_SIZE] - chunk, count); + if (chunk <= &_pktbuf[CONFIG_GNRC_PKTBUF_SIZE - 1]) { + _print_chunk(chunk, &_pktbuf[CONFIG_GNRC_PKTBUF_SIZE] - chunk, count); } #else DEBUG("pktbuf: needs od module\n"); @@ -351,14 +351,14 @@ bool gnrc_pktbuf_is_sane(void) /* Invariants of this implementation: * - the head of _unused_t list is _first_unused * - if _unused_t list is empty the packet buffer is full and _first_unused is NULL - * - forall ptr_in _unused_t list: &_pktbuf[0] < ptr < &_pktbuf[GNRC_PKTBUF_SIZE] + * - forall ptr_in _unused_t list: &_pktbuf[0] < ptr < &_pktbuf[CONFIG_GNRC_PKTBUF_SIZE] * - forall ptr in _unused_t list: ptr->next == NULL || ptr < ptr->next * - forall ptr in _unused_t list: (ptr->next != NULL && ptr->size <= (ptr->next - ptr)) || - * (ptr->next == NULL && ptr->size == (GNRC_PKTBUF_SIZE - (ptr - &_pktbuf[0]))) + * (ptr->next == NULL && ptr->size == (CONFIG_GNRC_PKTBUF_SIZE - (ptr - &_pktbuf[0]))) */ while (ptr) { - if (&_pktbuf[0] >= (uint8_t *)ptr && (uint8_t *)ptr >= &_pktbuf[GNRC_PKTBUF_SIZE]) { + if (&_pktbuf[0] >= (uint8_t *)ptr && (uint8_t *)ptr >= &_pktbuf[CONFIG_GNRC_PKTBUF_SIZE]) { return false; } if ((ptr->next != NULL) && (ptr >= ptr->next)) { @@ -366,7 +366,7 @@ bool gnrc_pktbuf_is_sane(void) } if (((ptr->next == NULL) || (ptr->size > (size_t)((uint8_t *)(ptr->next) - (uint8_t *)ptr))) && ((ptr->next != NULL) || - (ptr->size != (size_t)(GNRC_PKTBUF_SIZE - ((uint8_t *)ptr - &_pktbuf[0]))))) { + (ptr->size != (size_t)(CONFIG_GNRC_PKTBUF_SIZE - ((uint8_t *)ptr - &_pktbuf[0]))))) { return false; } ptr = ptr->next; @@ -426,7 +426,7 @@ static void *_pktbuf_alloc(size_t size) else { _unused_t *new = (_unused_t *)(((uint8_t *)ptr) + size); - if (((((uint8_t *)new) - &(_pktbuf[0])) + sizeof(_unused_t)) > GNRC_PKTBUF_SIZE) { + if (((((uint8_t *)new) - &(_pktbuf[0])) + sizeof(_unused_t)) > CONFIG_GNRC_PKTBUF_SIZE) { /* content of new would exceed packet buffer size so set to NULL */ _first_unused = NULL; } @@ -478,7 +478,7 @@ static void _pktbuf_free(void *data, size_t size) new->size = _align(size); /* calculate number of bytes between new _unused_t chunk and end of packet * buffer */ - bytes_at_end = ((&_pktbuf[0] + GNRC_PKTBUF_SIZE) - (((uint8_t *)new) + new->size)); + bytes_at_end = ((&_pktbuf[0] + CONFIG_GNRC_PKTBUF_SIZE) - (((uint8_t *)new) + new->size)); if (bytes_at_end < sizeof(_unused_t)) { /* new is very last segment and there is a little bit of memory left * that wouldn't fit _unused_t (cut of in _pktbuf_alloc()) => re-add it */ diff --git a/tests/conn_can/Makefile b/tests/conn_can/Makefile index 5f838bf477..ddf96e74f3 100644 --- a/tests/conn_can/Makefile +++ b/tests/conn_can/Makefile @@ -34,7 +34,7 @@ ifneq (,$(filter ncv7356,$(TRX_TO_BUILD))) CFLAGS += -DNCV7356_MODE1_PIN=$(NCV7356_MODE1_PIN) endif -CFLAGS += -DGNRC_PKTBUF_SIZE=4096 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=4096 CFLAGS += -DCAN_PKT_BUF_SIZE=64 CFLAGS += -DCAN_ROUTER_MAX_FILTER=32 diff --git a/tests/driver_encx24j600/Makefile b/tests/driver_encx24j600/Makefile index 5e6d9e52ea..061fd1860c 100644 --- a/tests/driver_encx24j600/Makefile +++ b/tests/driver_encx24j600/Makefile @@ -9,7 +9,7 @@ USEMODULE += shell_commands USEMODULE += ps # lower pktbuf size -CFLAGS += -DGNRC_PKTBUF_SIZE=2048 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048 # set board specific peripheral configurations ifneq (,$(filter nucleo-f334r8,$(BOARD))) diff --git a/tests/driver_netdev_common/Makefile b/tests/driver_netdev_common/Makefile index afc439312a..42e1f6510a 100644 --- a/tests/driver_netdev_common/Makefile +++ b/tests/driver_netdev_common/Makefile @@ -6,8 +6,8 @@ USEMODULE += shell_commands USEMODULE += ps # allow to use a smaller packet buffer in low-PDU drivers -ifdef GNRC_PKTBUF_SIZE - CFLAGS += -DGNRC_PKTBUF_SIZE=$(GNRC_PKTBUF_SIZE) +ifdef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=$(CONFIG_GNRC_PKTBUF_SIZE) endif # gnrc is a meta module including all required, basic gnrc networking modules diff --git a/tests/driver_xbee/Makefile b/tests/driver_xbee/Makefile index 73ee157281..54379d0828 100644 --- a/tests/driver_xbee/Makefile +++ b/tests/driver_xbee/Makefile @@ -1,6 +1,6 @@ USEMODULE += xbee # No need of big buffer for this test -GNRC_PKTBUF_SIZE=512 +CONFIG_GNRC_PKTBUF_SIZE=512 include ../driver_netdev_common/Makefile diff --git a/tests/gnrc_gomach/Makefile b/tests/gnrc_gomach/Makefile index 75685b6446..426c13f3d1 100644 --- a/tests/gnrc_gomach/Makefile +++ b/tests/gnrc_gomach/Makefile @@ -30,7 +30,7 @@ USEMODULE += gnrc_gomach # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit -CFLAGS += -DGNRC_PKTBUF_SIZE=1024 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1024 include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_fwd_w_sub/Makefile b/tests/gnrc_ipv6_fwd_w_sub/Makefile index 8c49d3f2cf..90b406e213 100644 --- a/tests/gnrc_ipv6_fwd_w_sub/Makefile +++ b/tests/gnrc_ipv6_fwd_w_sub/Makefile @@ -12,7 +12,7 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += xtimer -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib/Makefile b/tests/gnrc_ipv6_nib/Makefile index e8c5ce356a..2fcfba1424 100644 --- a/tests/gnrc_ipv6_nib/Makefile +++ b/tests/gnrc_ipv6_nib/Makefile @@ -8,7 +8,7 @@ USEMODULE += netdev_eth USEMODULE += netdev_test CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib_6ln/Makefile b/tests/gnrc_ipv6_nib_6ln/Makefile index 960e29cc0b..22bfe8e53d 100644 --- a/tests/gnrc_ipv6_nib_6ln/Makefile +++ b/tests/gnrc_ipv6_nib_6ln/Makefile @@ -12,7 +12,7 @@ USEMODULE += netdev_test # lower log-level to save memory of LOG_WARNING() in gnrc_netif CFLAGS += -DLOG_LEVEL=LOG_ERROR CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib_dns/Makefile b/tests/gnrc_ipv6_nib_dns/Makefile index 7814c222a3..9c75a1bd95 100644 --- a/tests/gnrc_ipv6_nib_dns/Makefile +++ b/tests/gnrc_ipv6_nib_dns/Makefile @@ -28,7 +28,7 @@ USEMODULE += posix_inet LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) - CFLAGS += -DGNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 endif diff --git a/tests/gnrc_lwmac/Makefile b/tests/gnrc_lwmac/Makefile index dfc17950e4..08e0ee0850 100644 --- a/tests/gnrc_lwmac/Makefile +++ b/tests/gnrc_lwmac/Makefile @@ -27,7 +27,7 @@ USEMODULE += gnrc_lwmac # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ndp/Makefile b/tests/gnrc_ndp/Makefile index 04e0e8c782..813ae62725 100644 --- a/tests/gnrc_ndp/Makefile +++ b/tests/gnrc_ndp/Makefile @@ -8,7 +8,7 @@ USEMODULE += netdev_ieee802154 USEMODULE += netdev_test CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ndp/main.c b/tests/gnrc_ndp/main.c index ba611c1e80..a3605d26cf 100644 --- a/tests/gnrc_ndp/main.c +++ b/tests/gnrc_ndp/main.c @@ -83,7 +83,7 @@ static void fill_pktbuf(void) gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, NULL, /* 24 = sizeof(gnrc_pktsnip_t) + * potential alignment */ - GNRC_PKTBUF_SIZE - 24U, + CONFIG_GNRC_PKTBUF_SIZE - 24U, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(pkt); TEST_ASSERT(gnrc_pktbuf_is_sane()); @@ -498,7 +498,7 @@ static void test_nbr_sol_send__pktbuf_full1(void) /* don't be able to fit any more data into packet buffer * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - 24, + CONFIG_GNRC_PKTBUF_SIZE - 24, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_nbr_sol_send(&test_tgt, test_netif, &test_src, &test_dst, NULL); @@ -513,7 +513,7 @@ static void test_nbr_sol_send__pktbuf_full2(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (2 * 24) - 16, + CONFIG_GNRC_PKTBUF_SIZE - (2 * 24) - 16, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_nbr_sol_send(&test_tgt, test_netif, &test_src, &test_dst, NULL); @@ -528,7 +528,7 @@ static void test_nbr_sol_send__pktbuf_full3(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (3 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (3 * 24) - 16 - sizeof(ndp_nbr_sol_t), GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); @@ -544,7 +544,7 @@ static void test_nbr_sol_send__pktbuf_full4(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (4 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (4 * 24) - 16 - sizeof(ndp_nbr_sol_t) - sizeof(ipv6_hdr_t), GNRC_NETTYPE_UNDEF); @@ -709,7 +709,7 @@ static void test_nbr_adv_send__pktbuf_full1(void) /* don't be able to fit any more data into packet buffer * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - 24, + CONFIG_GNRC_PKTBUF_SIZE - 24, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_nbr_adv_send(&test_src, test_netif, &test_dst, true, NULL); @@ -724,7 +724,7 @@ static void test_nbr_adv_send__pktbuf_full2(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of TLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (2 * 24) - 16, + CONFIG_GNRC_PKTBUF_SIZE - (2 * 24) - 16, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_nbr_adv_send(&test_src, test_netif, &test_dst, true, NULL); @@ -739,7 +739,7 @@ static void test_nbr_adv_send__pktbuf_full3(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of TLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (3 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (3 * 24) - 16 - sizeof(ndp_nbr_adv_t), GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); @@ -755,7 +755,7 @@ static void test_nbr_adv_send__pktbuf_full4(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of TLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (4 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (4 * 24) - 16 - sizeof(ndp_nbr_adv_t) - sizeof(ipv6_hdr_t), GNRC_NETTYPE_UNDEF); @@ -832,7 +832,7 @@ static void test_rtr_sol_send__pktbuf_full1(void) /* don't be able to fit any more data into packet buffer * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - 24, + CONFIG_GNRC_PKTBUF_SIZE - 24, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_rtr_sol_send(test_netif, &test_dst); @@ -847,7 +847,7 @@ static void test_rtr_sol_send__pktbuf_full2(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (2 * 24) - 16, + CONFIG_GNRC_PKTBUF_SIZE - (2 * 24) - 16, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_rtr_sol_send(test_netif, &test_dst); @@ -862,7 +862,7 @@ static void test_rtr_sol_send__pktbuf_full3(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (3 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (3 * 24) - 16 - sizeof(ndp_rtr_sol_t), GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); @@ -878,7 +878,7 @@ static void test_rtr_sol_send__pktbuf_full4(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (4 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (4 * 24) - 16 - sizeof(ndp_rtr_sol_t) - sizeof(ipv6_hdr_t), GNRC_NETTYPE_UNDEF); @@ -1031,7 +1031,7 @@ static void test_rtr_adv_send__pktbuf_full1(void) /* don't be able to fit any more data into packet buffer * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - 24, + CONFIG_GNRC_PKTBUF_SIZE - 24, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_rtr_adv_send(test_netif, &test_src, &test_dst, false, NULL); @@ -1046,7 +1046,7 @@ static void test_rtr_adv_send__pktbuf_full2(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (2 * 24) - 16, + CONFIG_GNRC_PKTBUF_SIZE - (2 * 24) - 16, GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); gnrc_ndp_rtr_adv_send(test_netif, &test_src, &test_dst, false, NULL); @@ -1061,7 +1061,7 @@ static void test_rtr_adv_send__pktbuf_full3(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (3 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (3 * 24) - 16 - sizeof(ndp_rtr_adv_t), GNRC_NETTYPE_UNDEF); TEST_ASSERT_NOT_NULL(tmp); @@ -1077,7 +1077,7 @@ static void test_rtr_adv_send__pktbuf_full4(void) * - 24 == sizeof(gnrc_pktsnip_t) + pktbuf internal padding * - 16 == size of SLLAO for IEEE 802.15.4 */ gnrc_pktsnip_t *tmp = gnrc_pktbuf_add(NULL, NULL, - GNRC_PKTBUF_SIZE - (4 * 24) - 16 - + CONFIG_GNRC_PKTBUF_SIZE - (4 * 24) - 16 - sizeof(ndp_rtr_adv_t) - sizeof(ipv6_hdr_t), GNRC_NETTYPE_UNDEF); diff --git a/tests/gnrc_sixlowpan_frag/Makefile b/tests/gnrc_sixlowpan_frag/Makefile index 9f0bd1b176..370ab4eaa1 100644 --- a/tests/gnrc_sixlowpan_frag/Makefile +++ b/tests/gnrc_sixlowpan_frag/Makefile @@ -7,6 +7,6 @@ USEMODULE += embunit DISABLE_MODULE += auto_init_gnrc_% # we don't need all this packet buffer space so reduce it a little -CFLAGS += -DTEST_SUITES -DGNRC_PKTBUF_SIZE=2048 +CFLAGS += -DTEST_SUITES -DCONFIG_GNRC_PKTBUF_SIZE=2048 include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile b/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile index c5468203b4..a7157e8114 100644 --- a/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile +++ b/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile @@ -10,6 +10,6 @@ USEMODULE += netdev_test USEMODULE += od # we don't need all this packet buffer space so reduce it a little -CFLAGS += -DTEST_SUITES -DGNRC_PKTBUF_SIZE=2048 +CFLAGS += -DTEST_SUITES -DCONFIG_GNRC_PKTBUF_SIZE=2048 include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_async_event/Makefile b/tests/gnrc_sock_async_event/Makefile index e978fe1cf5..41b43a3394 100644 --- a/tests/gnrc_sock_async_event/Makefile +++ b/tests/gnrc_sock_async_event/Makefile @@ -10,7 +10,7 @@ USEMODULE += sock_async_event USEMODULE += od USEMODULE += xtimer -CFLAGS += -DSOCK_HAS_IPV6 -DGNRC_PKTBUF_SIZE=200 +CFLAGS += -DSOCK_HAS_IPV6 -DCONFIG_GNRC_PKTBUF_SIZE=200 # mock IPv6 gnrc_nettype CFLAGS += -DTEST_SUITES -DGNRC_NETTYPE_IPV6=GNRC_NETTYPE_TEST diff --git a/tests/gnrc_sock_dns/Makefile b/tests/gnrc_sock_dns/Makefile index cfc529abe9..abec92b480 100644 --- a/tests/gnrc_sock_dns/Makefile +++ b/tests/gnrc_sock_dns/Makefile @@ -31,7 +31,7 @@ USEMODULE += posix_inet LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) - CFLAGS += -DGNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 endif diff --git a/tests/gnrc_sock_ip/Makefile b/tests/gnrc_sock_ip/Makefile index 5be2035a72..43f68cfaba 100644 --- a/tests/gnrc_sock_ip/Makefile +++ b/tests/gnrc_sock_ip/Makefile @@ -4,7 +4,7 @@ USEMODULE += gnrc_sock_ip USEMODULE += gnrc_ipv6 USEMODULE += ps -CFLAGS += -DGNRC_PKTBUF_SIZE=200 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_neterr/Makefile b/tests/gnrc_sock_neterr/Makefile index 6dcf5c07a0..8ef9b3ddd7 100644 --- a/tests/gnrc_sock_neterr/Makefile +++ b/tests/gnrc_sock_neterr/Makefile @@ -7,6 +7,6 @@ USEMODULE += gnrc_sock_udp USEMODULE += od USEMODULE += xtimer -CFLAGS += -DGNRC_PKTBUF_SIZE=200 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_udp/Makefile b/tests/gnrc_sock_udp/Makefile index 3645c77e22..e489ec743e 100644 --- a/tests/gnrc_sock_udp/Makefile +++ b/tests/gnrc_sock_udp/Makefile @@ -5,7 +5,7 @@ USEMODULE += gnrc_sock_udp USEMODULE += gnrc_ipv6 USEMODULE += ps -CFLAGS += -DGNRC_PKTBUF_SIZE=400 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=400 CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_udp/Makefile b/tests/gnrc_udp/Makefile index e53697ea33..af3e1ced54 100644 --- a/tests/gnrc_udp/Makefile +++ b/tests/gnrc_udp/Makefile @@ -16,7 +16,7 @@ USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 -CFLAGS += -DGNRC_PKTBUF_SIZE=8192 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=8192 include $(RIOTBASE)/Makefile.include diff --git a/tests/netdev_test/Makefile b/tests/netdev_test/Makefile index 7cf3152dfa..d7605caea0 100644 --- a/tests/netdev_test/Makefile +++ b/tests/netdev_test/Makefile @@ -13,6 +13,6 @@ USEMODULE += netdev_eth USEMODULE += netdev_test USEMODULE += od -CFLAGS += -DGNRC_PKTBUF_SIZE=200 +CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 include $(RIOTBASE)/Makefile.include diff --git a/tests/pkg_microcoap/Makefile b/tests/pkg_microcoap/Makefile index fd88a7db5a..251f8b501a 100644 --- a/tests/pkg_microcoap/Makefile +++ b/tests/pkg_microcoap/Makefile @@ -26,7 +26,7 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) $(info Using low-memory configuration for microcoap_server.) ## low-memory tuning values # lower pktbuf buffer size - CFLAGS += -DGNRC_PKTBUF_SIZE=1000 + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 USEMODULE += prng_minstd endif diff --git a/tests/riotboot_flashwrite/Makefile b/tests/riotboot_flashwrite/Makefile index ff7320d29f..b14003ed62 100644 --- a/tests/riotboot_flashwrite/Makefile +++ b/tests/riotboot_flashwrite/Makefile @@ -39,7 +39,7 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) $(info Using low-memory configuration for microcoap_server.) ## low-memory tuning values # lower pktbuf buffer size - CFLAGS += -DGNRC_PKTBUF_SIZE=1000 + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 USEMODULE += prng_minstd endif diff --git a/tests/unittests/tests-pktbuf/tests-pktbuf.c b/tests/unittests/tests-pktbuf/tests-pktbuf.c index fa9cb81adc..3994c0f7fe 100644 --- a/tests/unittests/tests-pktbuf/tests-pktbuf.c +++ b/tests/unittests/tests-pktbuf/tests-pktbuf.c @@ -207,12 +207,12 @@ static void test_pktbuf_add__success(void) gnrc_pktsnip_t *pkt, *pkt_prev = NULL; for (int i = 0; i < 9; i++) { - pkt = gnrc_pktbuf_add(NULL, NULL, (GNRC_PKTBUF_SIZE / 10) + 4, GNRC_NETTYPE_TEST); + pkt = gnrc_pktbuf_add(NULL, NULL, (CONFIG_GNRC_PKTBUF_SIZE / 10) + 4, GNRC_NETTYPE_TEST); TEST_ASSERT_NOT_NULL(pkt); TEST_ASSERT_NULL(pkt->next); TEST_ASSERT_NOT_NULL(pkt->data); - TEST_ASSERT_EQUAL_INT((GNRC_PKTBUF_SIZE / 10) + 4, pkt->size); + TEST_ASSERT_EQUAL_INT((CONFIG_GNRC_PKTBUF_SIZE / 10) + 4, pkt->size); TEST_ASSERT_EQUAL_INT(GNRC_NETTYPE_TEST, pkt->type); TEST_ASSERT_EQUAL_INT(1, pkt->users); @@ -509,12 +509,12 @@ static void test_pktbuf_realloc_data__size_0(void) TEST_ASSERT(gnrc_pktbuf_is_empty()); } -#ifndef MODULE_GNRC_PKTBUF_MALLOC /* GNRC_PKTBUF_SIZE does not apply for gnrc_pktbuf_malloc */ +#ifndef MODULE_GNRC_PKTBUF_MALLOC /* CONFIG_GNRC_PKTBUF_SIZE does not apply for gnrc_pktbuf_malloc */ static void test_pktbuf_realloc_data__memfull(void) { gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, NULL, sizeof(TEST_STRING8), GNRC_NETTYPE_TEST); - TEST_ASSERT_EQUAL_INT(ENOMEM, gnrc_pktbuf_realloc_data(pkt, GNRC_PKTBUF_SIZE + 1)); + TEST_ASSERT_EQUAL_INT(ENOMEM, gnrc_pktbuf_realloc_data(pkt, CONFIG_GNRC_PKTBUF_SIZE + 1)); gnrc_pktbuf_release(pkt); TEST_ASSERT(gnrc_pktbuf_is_empty()); } @@ -656,10 +656,10 @@ static void test_pktbuf_realloc_data__success3(void) #ifndef MODULE_GNRC_PKTBUF_MALLOC static void test_pktbuf_merge_data__memfull(void) { - gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, NULL, (GNRC_PKTBUF_SIZE / 4), + gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, NULL, (CONFIG_GNRC_PKTBUF_SIZE / 4), GNRC_NETTYPE_TEST); - pkt = gnrc_pktbuf_add(pkt, NULL, (GNRC_PKTBUF_SIZE / 4) + 1, + pkt = gnrc_pktbuf_add(pkt, NULL, (CONFIG_GNRC_PKTBUF_SIZE / 4) + 1, GNRC_NETTYPE_TEST); TEST_ASSERT_EQUAL_INT(ENOMEM, gnrc_pktbuf_merge(pkt)); gnrc_pktbuf_release(pkt); @@ -817,7 +817,7 @@ static void test_pktbuf_start_write__pkt_users_2(void) static void test_pktbuf_reverse_snips__too_full(void) { gnrc_pktsnip_t *pkt, *pkt_next, *pkt_huge; - const size_t pkt_huge_size = GNRC_PKTBUF_SIZE - (3 * 8) - + const size_t pkt_huge_size = CONFIG_GNRC_PKTBUF_SIZE - (3 * 8) - (3 * sizeof(gnrc_pktsnip_t)) - 4; pkt_next = gnrc_pktbuf_add(NULL, TEST_STRING8, 8, GNRC_NETTYPE_TEST);