Permalink
Browse files

Anjay 1.13.0

Breaking changes:
- anjay_configuration_t::max_icmp_failures field has been removed.
- Changed the way connection errors are handled. Connections are now NOT
  automatically retried in most of the cases. Please refer to the documentation
  (Advanced tutorial -> Network error handling) for a summary of the new
  semantics.

Improvements:
- Extensive refactor of the server connection handling subsystem.
- Added timeout for the documentation URL check.
- Prevented integration tests from running concurrently on Travis.

Bugfixes:
- Fixed behaviour when the attributes are set so that pmax < pmin.
- Fixed a bug that caused Discover operation on the Security object to
  erroneously work instead of causing 4.01 Unauthorized error as mandated by the
  spec.
- Fixed compilation warnings on various compilers.
- Upgraded avs_commons to version 3.8.2, which includes:
  - Fixes for proper propagation of avs_stream_close() errors.
  - Fixes for external library dependency checking.
  - Fixes for various compilation warnings.
  - Improved logs from the IP address stringification code.
  • Loading branch information...
kFYatek committed Oct 4, 2018
1 parent f647f66 commit 04bd19fe905d502b9df1f33df268ff3188698fbc
Showing with 2,292 additions and 2,055 deletions.
  1. +11 −11 .travis.yml
  2. +14 −9 CMakeLists.txt
  3. +1 −1 avs_commons/git
  4. +0 −1 demo/demo.c
  5. +2 −15 demo/demo_args.c
  6. +0 −1 demo/demo_args.h
  7. +9 −0 demo/demo_cmds.c
  8. +1 −0 devconfig
  9. +6 −3 doc/CMakeLists.txt
  10. +108 −10 doc/sphinx/source/AdvancedTutorial/AT6.rst
  11. +30 −0 doc/sphinx/source/AdvancedTutorial/AT7.rst
  12. +1 −1 doc/sphinx/source/Commercial_support.rst
  13. BIN doc/sphinx/source/{_static → }/avsystem_logo.png
  14. +1 −1 doc/sphinx/source/conf.py.in
  15. +3 −1 include_modules/anjay_modules/utils_core.h
  16. +6 −13 include_public/anjay/core.h
  17. +1 −1 modules/access_control/src/access_control_handlers.c
  18. +5 −0 modules/access_control/src/test/access_control.c
  19. +3 −4 modules/access_control/src/test/persistence.c
  20. +1 −1 modules/security/src/mod_security.c
  21. +1 −1 modules/server/src/mod_server.c
  22. +26 −14 src/{access_control_utils.c → access_utils.c}
  23. +16 −14 src/{access_control_utils.h → access_utils.h}
  24. +2 −4 src/anjay_core.c
  25. +0 −1 src/anjay_core.h
  26. +4 −3 src/coap/stream/server_internal.c
  27. +1 −1 src/coap/test/block_response.c
  28. +34 −27 src/coap/test/stream.c
  29. +20 −18 src/coap/test/utils.h
  30. +68 −64 src/dm_core.c
  31. +7 −6 src/dm_core.h
  32. +12 −3 src/downloader/coap.c
  33. +26 −35 src/downloader/test/downloader.c
  34. +3 −3 src/downloader/test/downloader_mock.h
  35. +62 −46 src/interface/bootstrap_core.c
  36. +4 −7 src/interface/bootstrap_core.h
  37. +20 −23 src/interface/register.c
  38. +0 −86 src/interface/test/bootstrap.c
  39. +1 −1 src/io/opaque.c
  40. +3 −3 src/io/test/dynamic.c
  41. +4 −4 src/io/test/text.c
  42. +5 −5 src/io/test/tlv_in.c
  43. +1 −1 src/io/text.c
  44. +1 −1 src/io/tlv_in.c
  45. +138 −163 src/observe/observe_core.c
  46. +2 −2 src/observe/observe_internal.h
  47. +24 −60 src/observe/test/observe.c
  48. +52 −55 src/servers.h
  49. +71 −170 src/servers/activate.c
  50. +24 −0 src/servers/activate.h
  51. +145 −34 src/servers/connection_udp.c
  52. +156 −220 src/servers/connections.c
  53. +72 −10 src/servers/connections.h
  54. +15 −9 src/servers/connections_internal.h
  55. +1 −1 src/servers/offline.c
  56. +31 −111 src/servers/register_internal.c
  57. +2 −18 src/servers/register_internal.h
  58. +19 −54 src/servers/reload.c
  59. +3 −1 src/servers/reload.h
  60. +110 −41 src/servers/server_connections.c
  61. +8 −6 src/servers/server_connections.h
  62. +2 −39 src/servers/servers_internal.c
  63. +7 −65 src/servers/servers_internal.h
  64. +9 −0 src/servers_utils.c
  65. +9 −3 src/test/anjay.c
  66. +20 −0 src/test/dm.c
  67. +49 −49 src/test/utils.c
  68. +13 −111 src/utils_core.c
  69. +0 −18 src/utils_core.h
  70. +1 −1 test/doc/runtest.py
  71. +14 −0 test/integration/framework/asserts.py
  72. +61 −33 test/integration/framework/test_suite.py
  73. +11 −4 test/integration/suites/default/access_control.py
  74. +3 −5 test/integration/suites/default/bootstrap_client.py
  75. +1 −7 test/integration/suites/default/bootstrap_factory.py
  76. +5 −0 test/integration/suites/default/bootstrap_server.py
  77. +13 −16 test/integration/suites/default/buffer_sizes.py
  78. +39 −15 test/integration/suites/default/client_block_request.py
  79. +0 −2 test/integration/suites/default/forbidden_on_register.py
  80. +2 −4 test/integration/suites/default/modify_servers.py
  81. +34 −0 test/integration/suites/default/observe_attributes.py
  82. +7 −2 test/integration/suites/default/port_rebind.py
  83. +524 −65 test/integration/suites/default/retransmissions.py
  84. +38 −0 test/integration/suites/default/security.py
  85. +28 −41 test/integration/suites/default/update.py
  86. +1 −7 test/integration/suites/default/uri_change_reregister.py
  87. +0 −15 test/integration/suites/long/__init__.py
  88. +0 −76 test/integration/suites/long/register.py
  89. +0 −76 test/integration/suites/long/update.py
  90. +4 −2 test/src/dm.c
View
@@ -32,78 +32,78 @@ matrix:
include:
- stage: test
os: osx
env: DEVCONFIG_FLAGS="--with-asan --without-analysis -DWITH_POISONING=OFF"
env: DEVCONFIG_FLAGS="--with-asan --without-analysis -DWITH_POISONING=OFF -DWITH_URL_CHECK=OFF -DNPROC=1"
- stage: test
os: linux
env: ANJAY_CC=gcc-4.7
ANJAY_CXX=g++
PYMBEDTLS_CC=gcc
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=gcc-4.8
ANJAY_CXX=g++
PYMBEDTLS_CC=gcc
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=gcc-4.9
ANJAY_CXX=g++
PYMBEDTLS_CC=gcc
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=gcc-5
ANJAY_CXX=g++-5
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=clang-3.5
ANJAY_CXX=clang++-3.5
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=clang-3.6
ANJAY_CXX=clang++-3.6
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=clang-3.7
ANJAY_CXX=clang++-3.7
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=clang-3.8
ANJAY_CXX=clang++-3.8
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=ubuntu-16.04
- stage: test
os: linux
env: ANJAY_CC=gcc
ANJAY_CXX=g++
DEVCONFIG_FLAGS="--with-valgrind --without-analysis"
DEVCONFIG_FLAGS="--with-valgrind --without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
DOCKER_IMAGE=centos7
- stage: coverity
os: linux
env: DOCKER_IMAGE=coverity
DEVCONFIG_FLAGS="--without-analysis"
DEVCONFIG_FLAGS="--without-analysis -DWITH_URL_CHECK=OFF -DNPROC=1"
before_script:
- source travis/prepare.sh
View
@@ -15,7 +15,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(anjay C)
set(ANJAY_VERSION "1.12.1" CACHE STRING "Anjay library version")
set(ANJAY_VERSION "1.13.0" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0)
set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -155,6 +155,7 @@ endmacro()
################# CODE #########################################################
set(CORE_SOURCES
src/access_utils.c
src/anjay_core.c
src/coap/id_source/auto.c
src/coap/id_source/static.c
@@ -164,21 +165,21 @@ set(CORE_SOURCES
src/coap/stream/out.c
src/coap/stream/server_internal.c
src/coap/stream/stream_internal.c
src/dm_core.c
src/dm/dm_attributes.c
src/dm/dm_execute.c
src/dm/dm_handlers.c
src/dm/modules.c
src/dm/query.c
src/dm_core.c
src/interface/register.c
src/io/base64_out.c
src/io_core.c
src/io/dynamic.c
src/io/opaque.c
src/io/output_buf.c
src/io/text.c
src/io/tlv_in.c
src/io/tlv_out.c
src/io_core.c
src/io_utils.c
src/notify.c
src/raw_buffer.c
@@ -193,9 +194,7 @@ set(CORE_SOURCES
src/servers/servers_internal.c
src/servers_utils.c
src/utils_core.c)
if(WITH_ACCESS_CONTROL)
set(CORE_SOURCES ${CORE_SOURCES} src/access_control_utils.c)
endif()
if(WITH_DOWNLOADER)
set(CORE_SOURCES ${CORE_SOURCES}
src/downloader/downloader.c)
@@ -230,7 +229,7 @@ if(WITH_JSON OR WITH_SENML_JSON)
src/io/json_out.c)
endif()
set(CORE_PRIVATE_HEADERS
src/access_control_utils.h
src/access_utils.h
src/anjay_core.h
src/coap/block/request.h
src/coap/block/response.h
@@ -577,9 +576,15 @@ if(WITH_TEST)
ANJAY_TEST
"ANJAY_BIN_DIR=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\"")
set(TEST_COMPILE_FLAGS "-Wno-pedantic -Wno-overlength-strings -Wno-vla")
set(TEST_COMPILE_FLAGS " -Wno-overlength-strings -Wno-vla -Wno-c++-compat")
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(TEST_COMPILE_FLAGS "${TEST_COMPILE_FLAGS} -Wno-jump-misses-init")
string(APPEND TEST_COMPILE_FLAGS " -Wno-jump-misses-init")
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
string(APPEND TEST_COMPILE_FLAGS " -Wno-missing-field-initializers -Wno-uninitialized -Wno-unused-value")
else()
# before GCC 4.8 there was no -Wpedantic, only -pedantic; and no way to disable it
string(APPEND TEST_COMPILE_FLAGS " -Wno-pedantic")
endif()
endif()
set_property(TARGET ${NAME}_test APPEND PROPERTY COMPILE_FLAGS
"${TEST_COMPILE_FLAGS}")
View
@@ -277,7 +277,6 @@ static int demo_init(anjay_demo_t *demo, cmdline_args_t *cmdline_args) {
},
#endif
.confirmable_notifications = cmdline_args->confirmable_notifications,
.max_icmp_failures = &cmdline_args->max_icmp_failures,
.disable_server_initiated_bootstrap =
cmdline_args->disable_server_initiated_bootstrap,
.udp_tx_params = &cmdline_args->tx_params,
View
@@ -49,7 +49,6 @@ static const cmdline_args_t DEFAULT_CMDLINE_ARGS = {
.outbuf_size = 4000,
.msg_cache_size = 0,
.fw_updated_marker_path = "/tmp/anjay-fw-updated",
.max_icmp_failures = 7,
.fw_security_info = {
.mode = (avs_net_security_mode_t) -1
},
@@ -149,8 +148,8 @@ static void print_option_help(const struct option *opt) {
{ 'c', "CSV_FILE", NULL, "file to load location CSV from" },
{ 'f', "SECONDS", "1", "location update frequency in seconds" },
{ 'p', "PORT", NULL, "bind all sockets to the specified UDP port." },
{ 'i', "PSK identity (psk mode) or Public Certificate (cert mode)", NULL,
"Both are specified as hexlified strings" },
{ 'i', "PSK identity (psk mode) or Public Certificate (cert mode)",
NULL, "Both are specified as hexlified strings" },
{ 'C', "CLIENT_CERT_FILE", "$(dirname $0)/../certs/client.crt.der",
"DER-formatted client certificate file to load. "
"Mutually exclusive with -i" },
@@ -181,8 +180,6 @@ static void print_option_help(const struct option *opt) {
"it to 0 disables caching mechanism." },
{ 'N', NULL, NULL,
"Send notifications as Confirmable messages by default" },
{ 'U', "COUNT", "7", "Sets maximum number of ICMP Port/Host unreachable "
"errors before the Server is considered unreachable" },
{ 1, "PATH", DEFAULT_CMDLINE_ARGS.fw_updated_marker_path,
"File path to use as a marker for persisting firmware update state" },
{ 2, "CERT_FILE", NULL, "Require certificate validation against "
@@ -427,7 +424,6 @@ int demo_parse_argv(cmdline_args_t *parsed_args, int argc, char *argv[]) {
{ "outbuf-size", required_argument, 0, 'O' },
{ "cache-size", required_argument, 0, '$' },
{ "confirmable-notifications", no_argument, 0, 'N' },
{ "max-icmp-failures", required_argument, 0, 'U' },
{ "fw-updated-marker-path", required_argument, 0, 1 },
{ "fw-cert-file", required_argument, 0, 2 },
{ "fw-cert-path", required_argument, 0, 3 },
@@ -662,15 +658,6 @@ int demo_parse_argv(cmdline_args_t *parsed_args, int argc, char *argv[]) {
case 'N':
parsed_args->confirmable_notifications = true;
break;
case 'U': {
int32_t max_icmp_failures;
if (parse_i32(optarg, &max_icmp_failures)
|| max_icmp_failures < 0) {
goto finish;
}
parsed_args->max_icmp_failures = (uint32_t) max_icmp_failures;
break;
}
case 1:
parsed_args->fw_updated_marker_path = optarg;
break;
View
@@ -40,7 +40,6 @@ typedef struct cmdline_args {
int32_t msg_cache_size;
bool confirmable_notifications;
const char *fw_updated_marker_path;
uint32_t max_icmp_failures;
avs_net_security_info_t fw_security_info;
const char *attr_storage_file;
bool disable_server_initiated_bootstrap;
View
@@ -429,6 +429,13 @@ static void cmd_enable_server(anjay_demo_t *demo, const char *args_string) {
}
}
static void cmd_all_connections_failed(anjay_demo_t *demo,
const char *unused_args) {
(void) unused_args;
printf("ALL_CONNECTIONS_FAILED==%d\n",
(int) anjay_all_connections_failed(demo->anjay));
}
static void cmd_help(anjay_demo_t *demo, const char *args_string);
struct cmd_handler_def {
@@ -483,6 +490,8 @@ static const struct cmd_handler_def COMMAND_HANDLERS[] = {
"/x/y pmin=3,pmax=4"),
CMD_HANDLER("enable-server", "ssid", cmd_enable_server,
"Enables a server with given SSID."),
CMD_HANDLER("get-all-connections-failed", "", cmd_all_connections_failed,
"Returns the result of anjay_all_connections_failed()"),
CMD_HANDLER("help", "", cmd_help, "Prints this message")
// clang-format on
};
View
@@ -133,6 +133,7 @@ ${CMAKE_COMMAND} \
-D WITH_VALGRIND=${WITH_VALGRIND} \
-D WITH_INTEGRATION_TESTS=ON \
-D WITH_DOC_CHECK=ON \
-D WITH_URL_CHECK=ON \
-D WITH_STATIC_ANALYSIS=${WITH_STATIC_ANALYSIS} \
-D DTLS_BACKEND="${DTLS_BACKEND}" \
-D AVS_LOG_WITH_TRACE=ON \
View
@@ -18,6 +18,7 @@ set(ANJAY_SPHINX_DOC_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sphinx/source")
set(ANJAY_SPHINX_DOC_CONF_DIR "${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx")
cmake_dependent_option(WITH_DOC_CHECK "Enables/disables sphinx documentation validation" OFF WITH_TEST OFF)
cmake_dependent_option(WITH_URL_CHECK "Enables/disables URL validation" OFF "WITH_TEST;WITH_DOC_CHECK" OFF)
if(EXISTS "${ANJAY_SPHINX_DOC_ROOT_DIR}/conf.py.in")
find_program(SPHINX_BUILD_EXECUTABLE sphinx-build
@@ -50,9 +51,11 @@ if(EXISTS "${ANJAY_SPHINX_DOC_ROOT_DIR}/conf.py.in")
${ANJAY_SPHINX_DOC_ROOT_DIR}
${ANJAY_SPHINX_DOC_CONF_DIR}/lint
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sphinx)
add_test(NAME test_doc_url
COMMAND ./runtest.py
WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/test/doc)
if(WITH_URL_CHECK)
add_test(NAME test_doc_url
COMMAND ./runtest.py
WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/test/doc)
endif()
set_property(TEST test_doc_snippet APPEND PROPERTY ENVIRONMENT
"ANJAY_SPHINX_DOC_CONF_DIR=${ANJAY_SPHINX_DOC_CONF_DIR}"
"ANJAY_SPHINX_DOC_ROOT_DIR=${ANJAY_SPHINX_DOC_ROOT_DIR}"
Oops, something went wrong.

0 comments on commit 04bd19f

Please sign in to comment.