pkg: Remove OONF API package

The package has been flagged as deprecated in
07099d99d896cf98c9fa21818e7e6cd82e2d138c, due to lack of users, tests
and maintenance.
This commit is contained in:
Leandro Lanzieri 2020-02-18 10:30:41 +01:00
parent 196345928f
commit c829f820ee
17 changed files with 0 additions and 3250 deletions

View File

@ -599,15 +599,6 @@ ifneq (,$(filter fib,$(USEMODULE)))
USEMODULE += posix_headers
endif
ifneq (,$(filter oonf_rfc5444,$(USEMODULE)))
USEMODULE += oonf_common
endif
ifneq (,$(filter oonf_common,$(USEMODULE)))
USEPKG += oonf_api
USEMODULE += posix_sockets
endif
# if any log_* is used, also use LOG pseudomodule
ifneq (,$(filter log_%,$(USEMODULE)))
USEMODULE += log

View File

@ -1,42 +0,0 @@
PKG_NAME=oonf_api
PKG_URL=https://github.com/OLSR/OONF.git
PKG_VERSION=v0.3.0
PKG_LICENSE=BSD-3-Clause
include $(RIOTBASE)/pkg/pkg.mk
MODULE:=$(PKG_NAME)
# GCC 7.x fails on (intentional) fallthrough, thus disable implicit-fallthrough.
CFLAGS += -Wno-implicit-fallthrough
COMBINED_ARCHIVE = $(BINDIR)/$(MODULE).a
all:
"$(MAKE)" -C $(PKG_BUILDDIR)
"$(MAKE)" $(COMBINED_ARCHIVE)
PARTIAL_ARCHIVES = $(wildcard $(BINDIR)/oonf_*.a)
$(COMBINED_ARCHIVE): $(BINDIR)/$(MODULE).mri $(PARTIAL_ARCHIVES)
ar -M < $<
define ADDLIB_TEMPLATE
addlib $1
endef
define MRI_TEMPLATE
create $1
$(foreach a,$2,$(call ADDLIB_TEMPLATE,$a))
save
end
endef
$(BINDIR)/$(MODULE).mri:
$(file >$@,$(call MRI_TEMPLATE,$(COMBINED_ARCHIVE),$(PARTIAL_ARCHIVES)))
@true
ifneq (,$(filter -Wformat-nonliteral -Wformat=2, $(CFLAGS)))
CFLAGS += -Wno-format-nonliteral
endif

View File

@ -1,5 +0,0 @@
# avr-libc does not provide `strings.h`
FEATURES_BLACKLIST += arch_avr8
# msp430-libc does not provide `strftime`
FEATURES_BLACKLIST += arch_msp430

View File

@ -1,5 +0,0 @@
INCLUDES += -I$(PKGDIRBASE)/oonf_api/src-api
ifeq ($(TOOLCHAIN), llvm)
CFLAGS += -Wno-keyword-macro -Wno-parentheses-equality
endif

View File

@ -1,11 +0,0 @@
/**
* @defgroup pkg_oonf_api OLSR.org Network Framework
* @ingroup pkg
* @ingroup net
* @brief The OLSR.org Network Framework (OONF) is a collection of libraries
* that can be used as the building blocks for networking daemons
*
* @deprecated The package has not been updated in 6 years, tests were never integrated
* into CI and with NHDP the only user of this package is being deprecated too.
* Will be removed after the 2020.04 release.
*/

View File

@ -1,252 +0,0 @@
From 9e99bc8ed9f4e4d326a14589ad29607fef89e3a5 Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Wed, 5 Feb 2014 20:01:41 +0100
Subject: [PATCH 01/10] add RIOT support
---
Makefile | 29 ++++++++++++++++++++
external/regex/Makefile | 4 +++
src-api/common/Makefile | 3 +++
src-api/common/autobuf.c | 6 +++++
src-api/common/common_types.h | 5 ++++
src-api/common/daemonize.c | 2 +-
src-api/common/netaddr.c | 11 +++++++-
src-api/common/netaddr.h | 2 ++
src-api/rfc5444/Makefile | 3 +++
src-api/rfc5444/rfc5444_api_config.h | 51 ++++++++++++++++++++++++++++++++++++
10 files changed, 114 insertions(+), 2 deletions(-)
create mode 100644 Makefile
create mode 100644 external/regex/Makefile
create mode 100644 src-api/common/Makefile
create mode 100644 src-api/rfc5444/Makefile
create mode 100644 src-api/rfc5444/rfc5444_api_config.h
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1f1cd9c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+#
+# to use oonf_api in your RIOT project,
+# add the following to your Makefile:
+#
+# export OONFBASE = /path/to/this/directory
+# EXTERNAL_MODULES += $(OONFBASE)
+#
+# this provides the following modules:
+# oonf_common - avl tree, list, netaddr, regex, string functions
+# oonf_rfc5444 - packetBB implementation, requires oonf_common
+
+ifneq (,$(filter oonf_common,$(USEMODULE)))
+ DIRS += src-api/common
+endif
+ifneq (,$(filter oonf_rfc5444,$(USEMODULE)))
+ DIRS += src-api/rfc5444
+endif
+ifneq (,$(filter oonf_cunit,$(USEMODULE)))
+ DIRS += tests/cunit
+endif
+ifneq (,$(filter oonf_regex,$(USEMODULE)))
+ DIRS += external/regex
+endif
+
+all:
+ mkdir -p $(BINDIR)
+ @for i in $(DIRS) ; do $(MAKE) -C $$i || exit 1; done ;
+
+clean:
diff --git a/external/regex/Makefile b/external/regex/Makefile
new file mode 100644
index 0000000..3bc1ce1
--- /dev/null
+++ b/external/regex/Makefile
@@ -0,0 +1,4 @@
+MODULE:=oonf_$(shell basename $(CURDIR))
+INCLUDES += $(CURDIR)/..
+
+include $(RIOTBASE)/Makefile.base
diff --git a/src-api/common/Makefile b/src-api/common/Makefile
new file mode 100644
index 0000000..5e0046d
--- /dev/null
+++ b/src-api/common/Makefile
@@ -0,0 +1,3 @@
+MODULE:=oonf_$(shell basename $(CURDIR))
+
+include $(RIOTBASE)/Makefile.base
diff --git a/src-api/common/autobuf.c b/src-api/common/autobuf.c
index 77c519b..37e77ac 100644
--- a/src-api/common/autobuf.c
+++ b/src-api/common/autobuf.c
@@ -51,6 +51,12 @@
#include <winsock2.h>
#endif
+#ifdef RIOT_VERSION
+int getpagesize(void) {
+ return 512;
+}
+#endif
+
#include "common/autobuf.h"
/**
diff --git a/src-api/common/common_types.h b/src-api/common/common_types.h
index c90cf46..b5f170a 100644
--- a/src-api/common/common_types.h
+++ b/src-api/common/common_types.h
@@ -77,6 +77,11 @@
#define PRINTF_SIZE_T_HEX_SPECIFIER "Ix"
#define PRINTF_SSIZE_T_SPECIFIER "Id"
#define PRINTF_PTRDIFF_T_SPECIFIER "Id"
+#elif defined(RIOT_VERSION)
+ #define PRINTF_SIZE_T_SPECIFIER "d"
+ #define PRINTF_SIZE_T_HEX_SPECIFIER "x"
+ #define PRINTF_SSIZE_T_SPECIFIER "d"
+ #define PRINTF_PTRDIFF_T_SPECIFIER "d"
#elif defined(__GNUC__)
#define PRINTF_SIZE_T_SPECIFIER "zu"
#define PRINTF_SIZE_T_HEX_SPECIFIER "zx"
diff --git a/src-api/common/daemonize.c b/src-api/common/daemonize.c
index 103c88f..8a6cd2b 100644
--- a/src-api/common/daemonize.c
+++ b/src-api/common/daemonize.c
@@ -48,7 +48,7 @@
#include "common/common_types.h"
#include "common/daemonize.h"
-#ifndef WIN32
+#if (!defined(_WIN32)) && (!defined(RIOT_VERSION))
/**
* Prepare the start of a daemon. Fork into background,
* but keep stdin/out/err open and a pipe connected to
diff --git a/src-api/common/netaddr.c b/src-api/common/netaddr.c
index dedab2c..6b214ee 100644
--- a/src-api/common/netaddr.c
+++ b/src-api/common/netaddr.c
@@ -43,7 +43,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifndef RIOT_VERSION
#include <net/if.h>
+#else
+#define DONT_HAVE_SIN6_SCOPE_ID
+#endif
#include "common/common_types.h"
#include "common/string.h"
@@ -326,7 +330,9 @@ netaddr_socket_init(union netaddr_socket *combined, const struct netaddr *addr,
/* ipv6 */
memcpy(&combined->v6.sin6_addr, addr->_addr, 16);
combined->v6.sin6_port = htons(port);
+#ifndef DONT_HAVE_SIN6_SCOPE_ID
combined->v6.sin6_scope_id = if_index;
+#endif
break;
default:
/* unknown address type */
@@ -561,6 +567,7 @@ netaddr_socket_to_string(struct netaddr_str *dst, const union netaddr_socket *sr
ntohs(src->v4.sin_port));
}
else if (src->std.sa_family == AF_INET6) {
+#ifndef DONT_HAVE_SIN6_SCOPE_ID
if (src->v6.sin6_scope_id) {
char scope_buf[IF_NAMESIZE];
@@ -569,7 +576,9 @@ netaddr_socket_to_string(struct netaddr_str *dst, const union netaddr_socket *sr
ntohs(src->v6.sin6_port),
if_indextoname(src->v6.sin6_scope_id, scope_buf));
}
- else {
+ else
+#endif
+ {
snprintf(dst->buf, sizeof(*dst), "[%s]:%d",
inet_ntop(AF_INET6, &src->v6.sin6_addr, buf.buf, sizeof(buf)),
ntohs(src->v6.sin6_port));
diff --git a/src-api/common/netaddr.h b/src-api/common/netaddr.h
index 78fd5b4..cc8189c 100644
--- a/src-api/common/netaddr.h
+++ b/src-api/common/netaddr.h
@@ -45,9 +45,11 @@
#ifndef _WIN32
#include <arpa/inet.h>
+#ifndef RIOT_VERSION
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <net/if.h>
+#endif
#else
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/src-api/rfc5444/Makefile b/src-api/rfc5444/Makefile
new file mode 100644
index 0000000..5e0046d
--- /dev/null
+++ b/src-api/rfc5444/Makefile
@@ -0,0 +1,3 @@
+MODULE:=oonf_$(shell basename $(CURDIR))
+
+include $(RIOTBASE)/Makefile.base
diff --git a/src-api/rfc5444/rfc5444_api_config.h b/src-api/rfc5444/rfc5444_api_config.h
new file mode 100644
index 0000000..9bf6622
--- /dev/null
+++ b/src-api/rfc5444/rfc5444_api_config.h
@@ -0,0 +1,51 @@
+
+/*
+ * The olsr.org Optimized Link-State Routing daemon(olsrd)
+ * Copyright (c) 2004-2012, the olsr.org team - see HISTORY file
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of olsr.org, olsrd nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Visit http://www.olsr.org for more information.
+ *
+ * If you find this software useful feel free to make a donation
+ * to the project. For more information see the website or contact
+ * the copyright holders.
+ *
+ */
+
+#ifndef RFC5444_API_CONFIG_H_
+#define RFC5444_API_CONFIG_H_
+
+#define DISALLOW_CONSUMER_CONTEXT_DROP false
+#define WRITER_STATE_MACHINE true
+#define DEBUG_CLEANUP true
+#define DO_ADDR_COMPRESSION true
+#define CLEAR_ADDRESS_POSTFIX false
+
+#endif /* RFC5444_API_CONFIG_H_ */
--
1.9.1

View File

@ -1,180 +0,0 @@
From ccb37ece1a21325bbc1f3efba7d3f0ec0d6b26ac Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Tue, 23 Jul 2013 21:08:31 +0200
Subject: [PATCH 02/10] port tests to riot
---
tests/common/.Makefile.template | 39 +++++++++++++++++++++++++++++++++++++
tests/common/bin/.gitignore | 0
tests/common/generate_makefiles.sh | 9 ++++++++
tests/common/test_common_avl.c | 10 +++++-----
tests/cunit/Makefile | 3 +++
tests/rfc5444/.Makefile.template | 32 ++++++++++++++++++++++++++++++
tests/rfc5444/bin/.gitignore | 0
tests/rfc5444/generate_makefiles.sh | 9 ++++++++
8 files changed, 91 insertions(+), 5 deletions(-)
create mode 100644 tests/common/.Makefile.template
create mode 100644 tests/common/bin/.gitignore
create mode 100755 tests/common/generate_makefiles.sh
create mode 100644 tests/cunit/Makefile
create mode 100644 tests/rfc5444/.Makefile.template
create mode 100644 tests/rfc5444/bin/.gitignore
create mode 100755 tests/rfc5444/generate_makefiles.sh
diff --git a/tests/common/.Makefile.template b/tests/common/.Makefile.template
new file mode 100644
index 0000000..afbaf0f
--- /dev/null
+++ b/tests/common/.Makefile.template
@@ -0,0 +1,39 @@
+####
+#### Sample Makefile for building apps with the RIOT OS
+####
+#### The Sample Filesystem Layout is:
+#### /this makefile
+#### ../../RIOT
+#### ../../boards for board definitions (if you have one or more)
+####
+
+# name of your project
+export APPLICATION = %TESTNAME%
+
+# for easy switching of boards
+export BOARD ?= native
+
+# this has to be the absolute path of the RIOT-base dir
+export RIOTBASE =$(CURDIR)/../../../../../../../../..
+
+CFLAGS = -DOONF_LOG_INFO -DOONF_LOG_DEBUG_INFO
+WERROR = 0
+
+## Modules to include.
+
+USEMODULE += oonf_cunit
+ifneq (,$(findstring regex,$(APPLICATION)))
+ USEMODULE += oonf_regex
+endif
+USEMODULE += oonf_common
+USEMODULE += gnrc_sock
+
+ifneq (,$(findstring daemonize,$(APPLICATION)))
+ error daemonize is not supported on RIOT
+endif
+
+INCLUDES += -I$(CURDIR)/../..
+
+QUIET ?= 1
+
+include $(RIOTBASE)/Makefile.include
diff --git a/tests/common/bin/.gitignore b/tests/common/bin/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tests/common/generate_makefiles.sh b/tests/common/generate_makefiles.sh
new file mode 100755
index 0000000..8bf9faa
--- /dev/null
+++ b/tests/common/generate_makefiles.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+for file in *.c; do
+ test=$(basename $file .c)
+ mkdir -p $test
+ sed s/%TESTNAME%/$test/ .Makefile.template > $test/Makefile
+ cp $test\.c $test
+done
diff --git a/tests/common/test_common_avl.c b/tests/common/test_common_avl.c
index b5ee8c0..e4e5b26 100644
--- a/tests/common/test_common_avl.c
+++ b/tests/common/test_common_avl.c
@@ -816,17 +816,17 @@ static void random_delete(uint32_t *array, int count) {
/* insert/remove 1000's random numbers into tree and check if everything is okay */
static void test_random_insert(void) {
- uint32_t array[1000];
+ uint32_t array[100];
struct tree_element *e, *ptr;
srand(0);
START_TEST();
avl_init(&head, avl_comp_uint32, true);
- random_insert(array, 1000);
- random_delete(array, 500);
- random_insert(array, 400);
- random_delete(array, 600);
+ random_insert(array, 100);
+ random_delete(array, 50);
+ random_insert(array, 40);
+ random_delete(array, 60);
avl_remove_all_elements(&head, e, node, ptr) {
free(e);
diff --git a/tests/cunit/Makefile b/tests/cunit/Makefile
new file mode 100644
index 0000000..5e0046d
--- /dev/null
+++ b/tests/cunit/Makefile
@@ -0,0 +1,3 @@
+MODULE:=oonf_$(shell basename $(CURDIR))
+
+include $(RIOTBASE)/Makefile.base
diff --git a/tests/rfc5444/.Makefile.template b/tests/rfc5444/.Makefile.template
new file mode 100644
index 0000000..e472545
--- /dev/null
+++ b/tests/rfc5444/.Makefile.template
@@ -0,0 +1,32 @@
+####
+#### Sample Makefile for building apps with the RIOT OS
+####
+#### The Sample Filesystem Layout is:
+#### /this makefile
+#### ../../RIOT
+#### ../../boards for board definitions (if you have one or more)
+####
+
+# name of your project
+export APPLICATION = %TESTNAME%
+
+# for easy switching of boards
+export BOARD ?= native
+
+# this has to be the absolute path of the RIOT-base dir
+export RIOTBASE =$(CURDIR)/../../../../../../../../..
+
+CFLAGS = -DOONF_LOG_INFO -DOONF_LOG_DEBUG_INFO
+WERROR = 0
+
+## Modules to include.
+USEMODULE += oonf_cunit
+USEMODULE += oonf_common
+USEMODULE += oonf_rfc5444
+USEMODULE += gnrc_sock
+
+INCLUDES += -I$(CURDIR)/../..
+
+QUIET ?= 1
+
+include $(RIOTBASE)/Makefile.include
diff --git a/tests/rfc5444/bin/.gitignore b/tests/rfc5444/bin/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tests/rfc5444/generate_makefiles.sh b/tests/rfc5444/generate_makefiles.sh
new file mode 100755
index 0000000..8bf9faa
--- /dev/null
+++ b/tests/rfc5444/generate_makefiles.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+for file in *.c; do
+ test=$(basename $file .c)
+ mkdir -p $test
+ sed s/%TESTNAME%/$test/ .Makefile.template > $test/Makefile
+ cp $test\.c $test
+done
--
1.9.1

View File

@ -1,46 +0,0 @@
From 1eb568357ba8e0679ad8d9a4cc3be0ad54cfc955 Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Tue, 1 Oct 2013 17:39:03 +0200
Subject: [PATCH 03/10] port example to riot
---
examples/rfc5444_reader_writer/Makefile | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 examples/rfc5444_reader_writer/Makefile
diff --git a/examples/rfc5444_reader_writer/Makefile b/examples/rfc5444_reader_writer/Makefile
new file mode 100644
index 0000000..9d5653d
--- /dev/null
+++ b/examples/rfc5444_reader_writer/Makefile
@@ -0,0 +1,28 @@
+####
+#### Sample Makefile for building apps with the RIOT OS
+####
+#### The Sample Filesystem Layout is:
+#### /this makefile
+#### ../../RIOT
+####
+
+# name of your project
+export APPLICATION := $(shell basename $(CURDIR))
+
+# for easy switching of boards
+export BOARD ?= native
+
+# this has to be the absolute path of the RIOT-base dir
+export RIOTBASE =$(CURDIR)/../../../../..
+
+CFLAGS = -DOONF_LOG_INFO -DOONF_LOG_DEBUG_INFO
+
+## Modules to include.
+
+USEMODULE += oonf_rfc5444
+
+INCLUDES += -I$(CURDIR)/..
+
+QUIET ?= 1
+
+include $(RIOTBASE)/Makefile.include
--
1.9.1

View File

@ -1,50 +0,0 @@
From 228ac53093365c7c02feeb420fa6189e932e5a9f Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Sun, 18 May 2014 22:48:40 +0200
Subject: [PATCH 04/10] fix conflicting types
---
src-api/rfc5444/rfc5444_reader.c | 10 +++++-----
src-api/rfc5444/rfc5444_reader.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src-api/rfc5444/rfc5444_reader.c b/src-api/rfc5444/rfc5444_reader.c
index 290f558..1ad344a 100644
--- a/src-api/rfc5444/rfc5444_reader.c
+++ b/src-api/rfc5444/rfc5444_reader.c
@@ -62,15 +62,15 @@ static int _compare_tlvtypes(struct rfc5444_reader_tlvblock_entry *tlv,
static uint8_t _rfc5444_get_u8(uint8_t **ptr, uint8_t *end, enum rfc5444_result *result);
static uint16_t _rfc5444_get_u16(uint8_t **ptr, uint8_t *end, enum rfc5444_result *result);
static void _free_tlvblock(struct rfc5444_reader *parser, struct avl_tree *entries);
-static int _parse_tlv(struct rfc5444_reader_tlvblock_entry *entry, uint8_t **ptr,
+static enum rfc5444_result _parse_tlv(struct rfc5444_reader_tlvblock_entry *entry, uint8_t **ptr,
uint8_t *eob, uint8_t addr_count);
-static int _parse_tlvblock(struct rfc5444_reader *parser,
+static enum rfc5444_result _parse_tlvblock(struct rfc5444_reader *parser,
struct avl_tree *tlvblock, uint8_t **ptr, uint8_t *eob, uint8_t addr_count);
-static int _schedule_tlvblock(struct rfc5444_reader_tlvblock_consumer *consumer,
+static enum rfc5444_result _schedule_tlvblock(struct rfc5444_reader_tlvblock_consumer *consumer,
struct rfc5444_reader_tlvblock_context *context, struct avl_tree *entries, uint8_t idx);
-static int _parse_addrblock(struct rfc5444_reader_addrblock_entry *addr_entry,
+static enum rfc5444_result _parse_addrblock(struct rfc5444_reader_addrblock_entry *addr_entry,
struct rfc5444_reader_tlvblock_context *tlv_context, uint8_t **ptr, uint8_t *eob);
-static int _handle_message(struct rfc5444_reader *parser,
+static enum rfc5444_result _handle_message(struct rfc5444_reader *parser,
struct rfc5444_reader_tlvblock_context *tlv_context, uint8_t **ptr, uint8_t *eob);
static struct rfc5444_reader_tlvblock_consumer *_add_consumer(
struct rfc5444_reader_tlvblock_consumer *, struct avl_tree *consumer_tree,
diff --git a/src-api/rfc5444/rfc5444_reader.h b/src-api/rfc5444/rfc5444_reader.h
index 6962741..c1ca7f6 100644
--- a/src-api/rfc5444/rfc5444_reader.h
+++ b/src-api/rfc5444/rfc5444_reader.h
@@ -309,7 +309,7 @@ EXPORT void rfc5444_reader_remove_packet_consumer(
EXPORT void rfc5444_reader_remove_message_consumer(
struct rfc5444_reader *, struct rfc5444_reader_tlvblock_consumer *);
-EXPORT int rfc5444_reader_handle_packet(
+EXPORT enum rfc5444_result rfc5444_reader_handle_packet(
struct rfc5444_reader *parser, uint8_t *buffer, size_t length);
EXPORT uint8_t *rfc5444_reader_get_tlv_value(
--
1.9.1

View File

@ -1,28 +0,0 @@
From 4bcf115c22297af231b5d3d2873996a5a0695cf2 Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Fri, 10 Oct 2014 02:05:01 +0200
Subject: [PATCH 05/10] only define container_of when necessary
---
src-api/common/container_of.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src-api/common/container_of.h b/src-api/common/container_of.h
index 9fd1893..fcb38fe 100644
--- a/src-api/common/container_of.h
+++ b/src-api/common/container_of.h
@@ -58,10 +58,12 @@
* @param member name of node inside struct
* @return pointer to surrounding struct
*/
+#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof(((type *)0)->member ) *__tempptr = (ptr); \
(type *)((char *)__tempptr - offsetof(type,member)); \
})
+#endif
/**
* Helper function for NULL safe container_of macro
--
1.9.1

View File

@ -1,23 +0,0 @@
From 67549da2f1f5e22e7789443f23c6a8bb470bc3f9 Mon Sep 17 00:00:00 2001
From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Date: Fri, 10 Oct 2014 02:08:32 +0200
Subject: [PATCH 06/10] if_index is not used
---
src-api/common/netaddr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src-api/common/netaddr.c b/src-api/common/netaddr.c
index 6b214ee..0b8fc1d 100644
--- a/src-api/common/netaddr.c
+++ b/src-api/common/netaddr.c
@@ -317,6 +317,7 @@ netaddr_create_host_bin(struct netaddr *host, const struct netaddr *netmask,
int
netaddr_socket_init(union netaddr_socket *combined, const struct netaddr *addr,
uint16_t port, unsigned if_index) {
+ (void)if_index;
/* initialize memory block */
memset(combined, 0, sizeof(*combined));
--
1.9.1

View File

@ -1,44 +0,0 @@
From 8395cf4c5753569ed964794ab98ba2fcb8af250b Mon Sep 17 00:00:00 2001
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
Date: Wed, 29 Oct 2014 11:37:05 +0100
Subject: [PATCH 07/10] Use RIOT's container_of implementation
---
src-api/common/container_of.h | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/src-api/common/container_of.h b/src-api/common/container_of.h
index fcb38fe..b49d836 100644
--- a/src-api/common/container_of.h
+++ b/src-api/common/container_of.h
@@ -59,10 +59,24 @@
* @return pointer to surrounding struct
*/
#ifndef container_of
-#define container_of(ptr, type, member) ({ \
- const typeof(((type *)0)->member ) *__tempptr = (ptr); \
- (type *)((char *)__tempptr - offsetof(type,member)); \
- })
+#if __STDC_VERSION__ >= 201112L
+# define container_of(PTR, TYPE, MEMBER) \
+ (_Generic((PTR), \
+ const __typeof__ (((TYPE *) 0)->MEMBER) *: \
+ ((TYPE *) ((char *) (PTR) - offsetof(TYPE, MEMBER))), \
+ __typeof__ (((TYPE *) 0)->MEMBER) *: \
+ ((TYPE *) ((char *) (PTR) - offsetof(TYPE, MEMBER))) \
+ ))
+#elif defined __GNUC__
+# define container_of(PTR, TYPE, MEMBER) \
+ (__extension__ ({ \
+ __extension__ const __typeof__ (((TYPE *) 0)->MEMBER) *__m____ = (PTR); \
+ ((TYPE *) ((char *) __m____ - offsetof(TYPE, MEMBER))); \
+ }))
+#else
+# define container_of(PTR, TYPE, MEMBER) \
+ ((TYPE *) ((char *) (PTR) - offsetof(TYPE, MEMBER)))
+#endif
#endif
/**
--
1.9.1

View File

@ -1,53 +0,0 @@
From d02b58b3cdd26c92f01e812cc1f6cf25703b7431 Mon Sep 17 00:00:00 2001
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
Date: Wed, 29 Oct 2014 12:05:11 +0100
Subject: [PATCH 08/10] Dissolve enum into single defines
---
src-api/rfc5444/rfc5444.h | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/src-api/rfc5444/rfc5444.h b/src-api/rfc5444/rfc5444.h
index c5d6420..6b5576e 100644
--- a/src-api/rfc5444/rfc5444.h
+++ b/src-api/rfc5444/rfc5444.h
@@ -43,25 +43,23 @@
#include "common/common_types.h"
-enum {
- /* timetlv_max = 14 * 2^28 * 1000 / 1024 = 14000 << 18 = 3 670 016 000 ms */
- RFC5444_TIMETLV_MAX = 0xdac00000,
+/* timetlv_max = 14 * 2^28 * 1000 / 1024 = 14000 << 18 = 3 670 016 000 ms */
+#define RFC5444_TIMETLV_MAX 0xdac00000
- /* timetlv_min = 1000/1024 ms */
- RFC5444_TIMETLV_MIN = 0x00000001,
+/* timetlv_min = 1000/1024 ms */
+#define RFC5444_TIMETLV_MIN 0x00000001
- /* metric_max = 1<<24 - 256 */
- RFC5444_METRIC_MAX = 0xffff00,
+/* metric_max = 1<<24 - 256 */
+#define RFC5444_METRIC_MAX 0xffff00
- /* metric_min = 1 */
- RFC5444_METRIC_MIN = 0x000001,
+/* metric_min = 1 */
+#define RFC5444_METRIC_MIN 0x000001
- /* larger than possible metric value */
- RFC5444_METRIC_INFINITE = 0xffffff,
+/* larger than possible metric value */
+#define RFC5444_METRIC_INFINITE 0xffffff
- /* infinite path cost */
- RFC5444_METRIC_INFINITE_PATH = 0xffffffff,
-};
+/* infinite path cost */
+#define RFC5444_METRIC_INFINITE_PATH 0xffffffff
EXPORT uint8_t rfc5444_timetlv_get_from_vector(
uint8_t *vector, size_t vector_length, uint8_t hopcount);
--
1.9.1

View File

@ -1,23 +0,0 @@
From 998e5800bedae1d1fb3fddd369ae92ae915ec7fa Mon Sep 17 00:00:00 2001
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
Date: Wed, 29 Oct 2014 12:11:29 +0100
Subject: [PATCH 09/10] Add missing include
---
src-api/rfc5444/rfc5444_tlv_writer.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src-api/rfc5444/rfc5444_tlv_writer.h b/src-api/rfc5444/rfc5444_tlv_writer.h
index ace7313..8d0ce3a 100644
--- a/src-api/rfc5444/rfc5444_tlv_writer.h
+++ b/src-api/rfc5444/rfc5444_tlv_writer.h
@@ -43,6 +43,7 @@
#define RFC5444_TLV_WRITER_H_
#include "common/common_types.h"
+#include "rfc5444_context.h"
struct rfc5444_tlv_writer_data {
uint8_t *buffer;
--
1.9.1

View File

@ -1,24 +0,0 @@
From eef1038b2f96c6e83fad3a2b7beaa0439190d8a6 Mon Sep 17 00:00:00 2001
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
Date: Wed, 29 Oct 2014 12:13:27 +0100
Subject: [PATCH 10/10] Change index of array from 0 to 1
---
src-api/common/template.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src-api/common/template.h b/src-api/common/template.h
index d98fe77..7ca75a8 100644
--- a/src-api/common/template.h
+++ b/src-api/common/template.h
@@ -64,7 +64,7 @@ struct abuf_template_storage_entry {
struct abuf_template_storage {
size_t count;
- struct abuf_template_storage_entry indices[0];
+ struct abuf_template_storage_entry indices[1];
};
EXPORT struct abuf_template_storage *abuf_template_init (
--
1.9.1

View File

@ -1,110 +0,0 @@
From 7fc320bdc8d6e6d30cf4684889fb88acab9ab7b2 Mon Sep 17 00:00:00 2001
From: Cenk Gündoğan <cnkgndgn@gmail.com>
Date: Mon, 23 Nov 2015 16:21:37 +0100
Subject: [PATCH] remove error: array subscript has type 'char'
[-Werror=char-subscripts]
---
src-api/common/netaddr.c | 6 +++---
src-api/common/string.c | 18 +++++++++---------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src-api/common/netaddr.c b/src-api/common/netaddr.c
index 0b8fc1d..55868da 100644
--- a/src-api/common/netaddr.c
+++ b/src-api/common/netaddr.c
@@ -453,7 +453,7 @@ netaddr_from_string(struct netaddr *dst, const char *src) {
ptr1 = str_trim(ptr1);
ptr2 = ptr1;
- while (*ptr2 != 0 && !isspace(*ptr2) && *ptr2 != '/') {
+ while (*ptr2 != 0 && !isspace((unsigned char) *ptr2) && *ptr2 != '/') {
switch (*ptr2) {
case ':':
if (last_was_colon) {
@@ -478,11 +478,11 @@ netaddr_from_string(struct netaddr *dst, const char *src) {
if (*ptr2) {
/* split strings */
- while (isspace(*ptr2)) *ptr2++ = 0;
+ while (isspace((unsigned char) *ptr2)) *ptr2++ = 0;
if (*ptr2 == '/') {
*ptr2++ = 0;
}
- while (isspace(*ptr2)) *ptr2++ = 0;
+ while (isspace((unsigned char) *ptr2)) *ptr2++ = 0;
if (*ptr2 == 0) {
/* prefixlength is missing */
diff --git a/src-api/common/string.c b/src-api/common/string.c
index 422ec1c..f099ec6 100644
--- a/src-api/common/string.c
+++ b/src-api/common/string.c
@@ -125,7 +125,7 @@ str_trim (char *ptr) {
}
/* skip leading whitespaces */
- while (isspace(*ptr)) {
+ while (isspace((unsigned char) *ptr)) {
ptr++;
}
@@ -133,7 +133,7 @@ str_trim (char *ptr) {
end = ptr + strlen(ptr) - 1;
/* remove trailing whitespaces */
- while (end > ptr && isspace(*end)) {
+ while (end > ptr && isspace((unsigned char) *end)) {
*end-- = 0;
}
return ptr;
@@ -154,18 +154,18 @@ str_hasnextword (const char *buffer, const char *word) {
}
/* skip whitespace prefix */
- while (isblank(*buffer)) {
+ while (isblank((unsigned char) *buffer)) {
buffer++;
}
- while (*word != 0 && *buffer != 0 && !isblank(*buffer) && tolower(*word) == tolower(*buffer)) {
+ while (*word != 0 && *buffer != 0 && !isblank((unsigned char) *buffer) && tolower((unsigned char) *word) == tolower((unsigned char) *buffer)) {
word++;
buffer++;
}
/* complete match ? */
- if (*word == 0 && (*buffer == 0 || isblank(*buffer))) {
- while (isblank(*buffer)) {
+ if (*word == 0 && (*buffer == 0 || isblank((unsigned char) *buffer))) {
+ while (isblank((unsigned char) *buffer)) {
buffer++;
}
return buffer;
@@ -192,13 +192,13 @@ str_cpynextword (char *dst, const char *src, size_t len) {
}
/* skip whitespace prefix */
- while (isblank(*src)) {
+ while (isblank((unsigned char) *src)) {
src++;
}
/* copy next word */
i = 0;
- while (*src != 0 && !isblank(*src) && i < len-1) {
+ while (*src != 0 && !isblank((unsigned char) *src) && i < len-1) {
dst[i++] = *src++;
}
@@ -206,7 +206,7 @@ str_cpynextword (char *dst, const char *src, size_t len) {
dst[i] = 0;
/* skip ahead in src */
- while (isblank(*src)) {
+ while (isblank((unsigned char) *src)) {
src++;
}
--
2.6.2