diff --git a/CMakeLists.txt b/CMakeLists.txt index e50cdd01c76..cd0fd38dc57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,24 +301,6 @@ if(UA_ENABLE_EXPERIMENTAL_HISTORIZING) endif() endif() -if(UA_ENABLE_HISTORIZING) - set(historizing_exported_headers - ${PROJECT_SOURCE_DIR}/include/ua_plugin_historydatabase.h - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_plugin_history_data_backend.h - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_plugin_history_data_gathering.h - ) - set(historizing_default_plugin_headers - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabackend_memory.h - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatagathering_default.h - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabase_default.h - ) - set(historizing_default_plugin_sources - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabackend_memory.c - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatagathering_default.c - ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabase_default.c - ) -endif() - option(UA_BUILD_FUZZING_CORPUS "Build the fuzzing corpus" OFF) mark_as_advanced(UA_BUILD_FUZZING_CORPUS) if(UA_BUILD_FUZZING_CORPUS) @@ -411,12 +393,12 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID if (NOT MINGW) if(UA_ENABLE_HARDENING) check_cc_flag("-fstack-protector-strong") # more performant stack protector, available since gcc 4.9 - check_cc_flag("-fstack-clash-protection") # increased reliability of stack overflow detection, available since gcc 8 + check_cc_flag("-fstack-clash-protection") # increased reliability of stack overflow detection, available since gcc 8 check_cc_flag_untested("-mcet -fcf-protection") # future use (control flow integrity protection) endif() # IPO requires too much memory for unit tests - # GCC docu recommends to compile all files with the same options, therefore ignore it completely + # GCC docu recommends to compile all files with the same options, therefore ignore it completely if(NOT UA_BUILD_UNIT_TESTS) # needed to check if IPO is supported (check needs cmake > 3.9) if("${CMAKE_VERSION}" VERSION_GREATER 3.9) @@ -429,7 +411,7 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID endif() endif() endif() - + if(UA_ENABLE_AMALGAMATION) add_definitions(-Wno-unused-function) endif() @@ -454,7 +436,7 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID endif() if(UA_ENABLE_HARDENING AND (CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) - check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) + check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) endif() # Strip release builds @@ -514,8 +496,8 @@ endif() ######################### file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") -configure_file("include/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_config.h") -configure_file("include/open62541.pc.in" "${PROJECT_BINARY_DIR}/src_generated/open62541.pc" @ONLY) +configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) +configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) @@ -523,7 +505,7 @@ if(UA_ENABLE_DISCOVERY_MULTICAST) endif() set(exported_headers ${exported_headers} - ${PROJECT_BINARY_DIR}/src_generated/ua_config.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h ${PROJECT_SOURCE_DIR}/arch/ua_architecture_base.h ${ua_architecture_headers_beginning} ) @@ -539,29 +521,29 @@ endif() set(exported_headers ${exported_headers} ${PROJECT_SOURCE_DIR}/deps/ms_stdint.h ${PROJECT_SOURCE_DIR}/arch/ua_architecture_definitions.h - ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h - ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids.h - ${PROJECT_SOURCE_DIR}/include/ua_constants.h - ${PROJECT_SOURCE_DIR}/include/ua_types.h - ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h - ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_handling.h - ${PROJECT_SOURCE_DIR}/include/ua_util.h - ${PROJECT_SOURCE_DIR}/include/ua_server.h - ${historizing_exported_headers} - ${PROJECT_SOURCE_DIR}/include/ua_plugin_log.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_network.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_access_control.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_pki.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_securitypolicy.h - ${PROJECT_SOURCE_DIR}/include/ua_server_pubsub.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_pubsub.h - ${PROJECT_SOURCE_DIR}/include/ua_plugin_nodestore.h - ${PROJECT_SOURCE_DIR}/include/ua_server_config.h - ${PROJECT_SOURCE_DIR}/include/ua_client_config.h - ${PROJECT_SOURCE_DIR}/include/ua_client.h - ${PROJECT_SOURCE_DIR}/include/ua_client_highlevel.h - ${PROJECT_SOURCE_DIR}/include/ua_client_subscriptions.h - ${PROJECT_SOURCE_DIR}/include/ua_client_highlevel_async.h) + ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/nodeids.h + ${PROJECT_SOURCE_DIR}/include/open62541/constants.h + ${PROJECT_SOURCE_DIR}/include/open62541/types.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated_handling.h + ${PROJECT_SOURCE_DIR}/include/open62541/util.h + ${PROJECT_SOURCE_DIR}/include/open62541/server.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/historydatabase.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/log.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/network.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/accesscontrol.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/pki.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/securitypolicy.h + ${PROJECT_SOURCE_DIR}/include/open62541/server_pubsub.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/pubsub.h + ${PROJECT_SOURCE_DIR}/include/open62541/plugin/nodestore.h + ${PROJECT_SOURCE_DIR}/include/open62541/server_config.h + ${PROJECT_SOURCE_DIR}/include/open62541/client_config.h + ${PROJECT_SOURCE_DIR}/include/open62541/client.h + ${PROJECT_SOURCE_DIR}/include/open62541/client_highlevel.h + ${PROJECT_SOURCE_DIR}/include/open62541/client_subscriptions.h + ${PROJECT_SOURCE_DIR}/include/open62541/client_highlevel_async.h) set(internal_headers ${PROJECT_SOURCE_DIR}/deps/open62541_queue.h ${PROJECT_SOURCE_DIR}/deps/ziptree.h @@ -570,10 +552,10 @@ set(internal_headers ${PROJECT_SOURCE_DIR}/deps/open62541_queue.h ${PROJECT_SOURCE_DIR}/deps/base64.h ${PROJECT_SOURCE_DIR}/src/ua_util_internal.h ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.h - ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_encoding_binary.h - ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.h - ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated_handling.h - ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated_encoding_binary.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated_encoding_binary.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/transport_generated.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/transport_generated_handling.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/transport_generated_encoding_binary.h ${PROJECT_SOURCE_DIR}/src/ua_connection_internal.h ${PROJECT_SOURCE_DIR}/src/ua_securechannel.h ${PROJECT_SOURCE_DIR}/src/ua_workqueue.h @@ -593,9 +575,9 @@ set(internal_headers ${PROJECT_SOURCE_DIR}/deps/open62541_queue.h # TODO: make client optional set(lib_sources ${PROJECT_SOURCE_DIR}/src/ua_types.c ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.c - ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c - ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.c - ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/transport_generated.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.c ${PROJECT_SOURCE_DIR}/src/ua_util.c ${PROJECT_SOURCE_DIR}/src/ua_workqueue.c ${PROJECT_SOURCE_DIR}/src/ua_timer.c @@ -638,36 +620,47 @@ set(lib_sources ${PROJECT_SOURCE_DIR}/src/ua_types.c ${PROJECT_SOURCE_DIR}/deps/pcg_basic.c ${PROJECT_SOURCE_DIR}/deps/base64.c) -set(default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.h - ${historizing_default_plugin_headers} - ${PROJECT_SOURCE_DIR}/plugins/ua_pki_certificate.h - ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.h - ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.h - ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.h - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicies.h +set(default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/accesscontrol_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/historydatabase_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/pki_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/log_stdout.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/nodestore_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/server_config_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/client_config_default.h + ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/securitypolicy_default.h ) set(default_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c - ${historizing_default_plugin_sources} - ${PROJECT_SOURCE_DIR}/plugins/ua_pki_certificate.c + ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c ) if(UA_GENERATED_NAMESPACE_ZERO) - list(APPEND internal_headers ${PROJECT_BINARY_DIR}/src_generated/ua_namespace0.h) - list(APPEND lib_sources ${PROJECT_BINARY_DIR}/src_generated/ua_namespace0.c) + list(APPEND internal_headers ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace0.h) + list(APPEND lib_sources ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace0.c) endif() list(APPEND default_plugin_headers - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_mbedtls_common.h) + ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_mbedtls_common.h) list(APPEND default_plugin_sources - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_mbedtls_common.c - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic256.c - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c) + ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_mbedtls_common.c + ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c + ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic256.c + ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c) + +if(UA_ENABLE_HISTORIZING) + list(APPEND default_plugin_sources + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabackend_memory.h + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatagathering_default.h + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_plugin_history_data_backend.h + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_plugin_history_data_gathering.h + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabackend_memory.c + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatagathering_default.c + ${PROJECT_SOURCE_DIR}/plugins/historydata/ua_historydatabase_default.c) +endif() if(UA_ENABLE_DISCOVERY) list(INSERT internal_headers 13 ${PROJECT_SOURCE_DIR}/src/server/ua_discovery_manager.h) @@ -675,11 +668,11 @@ if(UA_ENABLE_DISCOVERY) endif() if(UA_ENABLE_PUBSUB) - list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/networking/ua_network_pubsub_udp.h) - list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/networking/ua_network_pubsub_udp.c) + list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/ua_pubsub_udp.h) + list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/ua_pubsub_udp.c) if(UA_ENABLE_PUBSUB_ETH_UADP) - list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/networking/ua_network_pubsub_ethernet.h) - list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/networking/ua_network_pubsub_ethernet.c) + list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/plugins/networking/ua_pubsub_ethernet.h) + list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/networking/ua_pubsub_ethernet.c) endif() endif() @@ -798,7 +791,7 @@ endif() # standard-defined data types ua_generate_datatypes( BUILTIN - NAME "ua_types" + NAME "types" TARGET_SUFFIX "types" NAMESPACE_IDX 0 FILE_CSV "${UA_FILE_NODEIDS}" @@ -809,7 +802,7 @@ ua_generate_datatypes( # transport data types ua_generate_datatypes( INTERNAL - NAME "ua_transport" + NAME "transport" TARGET_SUFFIX "transport" NAMESPACE_IDX 1 FILE_CSV "${UA_FILE_NODEIDS}" @@ -818,17 +811,17 @@ ua_generate_datatypes( ) # statuscode explanation -add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h - ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.c +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.c PRE_BUILD COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_statuscode_descriptions.py - ${UA_FILE_STATUSCODES} ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes + ${UA_FILE_STATUSCODES} ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_statuscode_descriptions.py ${UA_FILE_STATUSCODES}) # Header containing defines for all NodeIds ua_generate_nodeid_header( - NAME "ua_nodeids" + NAME "nodeids" ID_PREFIX "NS0" TARGET_SUFFIX "ids-ns0" FILE_CSV "${UA_FILE_NODEIDS}" @@ -837,9 +830,9 @@ ua_generate_nodeid_header( # we need a custom target to avoid that the generator is called concurrently and # thus overwriting files while the other thread is compiling add_custom_target(open62541-generator-statuscode DEPENDS - ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids.h - ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h - ${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.c) + ${PROJECT_BINARY_DIR}/src_generated/open62541/nodeids.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h + ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.c) if (UA_ENABLE_AMALGAMATION) # single-file release @@ -970,11 +963,11 @@ else() # Public includes include_directories_public(${ua_architecture_directories_to_include} - "${PROJECT_BINARY_DIR}/src_generated" - "${PROJECT_SOURCE_DIR}/deps" "${PROJECT_SOURCE_DIR}/include" - "${PROJECT_SOURCE_DIR}/plugins" - "${PROJECT_SOURCE_DIR}/plugins/securityPolicies") + "${PROJECT_SOURCE_DIR}/plugins/include" + "${PROJECT_SOURCE_DIR}/deps" + "${PROJECT_SOURCE_DIR}/src/pubsub" + "${PROJECT_BINARY_DIR}/src_generated") # Private includes include_directories_private("${PROJECT_BINARY_DIR}" @@ -1210,7 +1203,6 @@ if(NOT UA_ENABLE_AMALGAMATION) install(FILES ${internal_headers} ${exported_headers} ${default_plugin_headers} - ${historizing_default_plugin_headers} ${ua_architecture_headers} DESTINATION ${open62541_install_include_dir}) else() diff --git a/README.md b/README.md index a7e41e0d0ff..d3bab926be6 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,8 @@ Using the GCC compiler, just run ```gcc -std=c99 -DUA_ARCHITECTURE_POSIX -#include "open62541.h" +#include +#include UA_Boolean running = true; void signalHandler(int sig) { @@ -171,7 +172,8 @@ int main(int argc, char** argv) ### Example Client Implementation ```c #include -#include "open62541.h" +#include +#include int main(int argc, char *argv[]) { diff --git a/arch/posix/ua_architecture_functions.c b/arch/posix/ua_architecture_functions.c index 8bbb2f35260..4cda647a439 100644 --- a/arch/posix/ua_architecture_functions.c +++ b/arch/posix/ua_architecture_functions.c @@ -6,7 +6,7 @@ #ifdef UA_ARCHITECTURE_POSIX -#include "ua_types.h" +#include unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){ int opts = fcntl(sockfd, F_GETFL); diff --git a/arch/posix/ua_clock.c b/arch/posix/ua_clock.c index 3fbcbf9c006..7fdfe31d43a 100644 --- a/arch/posix/ua_clock.c +++ b/arch/posix/ua_clock.c @@ -8,7 +8,7 @@ #ifdef UA_ARCHITECTURE_POSIX -#include "ua_types.h" +#include #include #include diff --git a/arch/ua_architecture_functions.h b/arch/ua_architecture_functions.h index 89b788773f3..d0d02b5bd65 100644 --- a/arch/ua_architecture_functions.h +++ b/arch/ua_architecture_functions.h @@ -12,11 +12,9 @@ #ifndef PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_ #define PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_ -#include "ua_config.h" +#include -#ifdef __cplusplus -extern "C" { -#endif +_UA_BEGIN_DECLS /* * Allocation functions @@ -204,11 +202,6 @@ int UA_access(const char *pathname, int mode); //equivalent implementation of ht #include "ua_architecture_definitions.h" -#ifdef __cplusplus -} -#endif - - - +_UA_END_DECLS #endif /* PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_ */ diff --git a/arch/ua_network_tcp.c b/arch/ua_network_tcp.c index 641d192059a..23c2f17d32e 100644 --- a/arch/ua_network_tcp.c +++ b/arch/ua_network_tcp.c @@ -9,10 +9,10 @@ */ #define UA_INTERNAL +#include +#include #include "ua_network_tcp.h" -#include "ua_log_stdout.h" #include "open62541_queue.h" -#include "ua_util.h" #include // memset diff --git a/arch/ua_network_tcp.h b/arch/ua_network_tcp.h index d1791935d2e..ea76c4e477e 100644 --- a/arch/ua_network_tcp.h +++ b/arch/ua_network_tcp.h @@ -7,9 +7,9 @@ #ifndef UA_NETWORK_TCP_H_ #define UA_NETWORK_TCP_H_ -#include "ua_server.h" -#include "ua_client.h" -#include "ua_plugin_log.h" +#include +#include +#include _UA_BEGIN_DECLS diff --git a/arch/win32/ua_architecture_functions.c b/arch/win32/ua_architecture_functions.c index 1803ed0b25d..cf54e9e9e0e 100644 --- a/arch/win32/ua_architecture_functions.c +++ b/arch/win32/ua_architecture_functions.c @@ -6,7 +6,7 @@ #ifdef UA_ARCHITECTURE_WIN32 -#include "ua_types.h" +#include unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){ u_long iMode = 0; diff --git a/arch/win32/ua_clock.c b/arch/win32/ua_clock.c index 085720f2656..7202f31a426 100644 --- a/arch/win32/ua_clock.c +++ b/arch/win32/ua_clock.c @@ -12,7 +12,7 @@ # define _BSD_SOURCE #endif -#include "ua_types.h" +#include #include /* Backup definition of SLIST_ENTRY on mingw winnt.h */ # ifdef SLIST_ENTRY diff --git a/deps/atoi.h b/deps/atoi.h index 003b7a51e5e..e624ecd9e69 100644 --- a/deps/atoi.h +++ b/deps/atoi.h @@ -5,7 +5,8 @@ extern "C" { #endif -#include "ua_types.h" +#include + UA_StatusCode atoiUnsigned(const char *s, size_t size, UA_UInt64 *result); UA_StatusCode atoiSigned(const char *s, size_t size, UA_Int64 *result); diff --git a/deps/itoa.h b/deps/itoa.h index ac276a39000..90425b0aed9 100644 --- a/deps/itoa.h +++ b/deps/itoa.h @@ -18,7 +18,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - #ifndef ITOA_H #define ITOA_H @@ -26,8 +25,8 @@ extern "C" { #endif -#include "ua_types.h" - +#include + UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base); UA_UInt16 itoaSigned(UA_Int64 value, char* buffer); diff --git a/deps/pcg_basic.h b/deps/pcg_basic.h index 86d53be55fd..4f7bcc262eb 100644 --- a/deps/pcg_basic.h +++ b/deps/pcg_basic.h @@ -24,12 +24,12 @@ #ifndef PCG_BASIC_H_ #define PCG_BASIC_H_ +#include + #ifdef __cplusplus extern "C" { #endif -#include "ua_config.h" - typedef struct pcg_state_setseq_64 { uint64_t state; /* RNG state. All values are possible. */ uint64_t inc; /* Controls which RNG sequence (stream) is selected. Must diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 16ba6ce505b..f15f5292834 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -17,23 +17,23 @@ function(generate_rst in out) endfunction() # Doc from headers -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_types.h ${DOC_SRC_DIR}/types.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_constants.h ${DOC_SRC_DIR}/constants.rst) -generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h ${DOC_SRC_DIR}/statuscodes.rst) -generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h ${DOC_SRC_DIR}/types_generated.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server_config.h ${DOC_SRC_DIR}/server_config.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server.h ${DOC_SRC_DIR}/server.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_config.h ${DOC_SRC_DIR}/client_config.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_subscriptions.h ${DOC_SRC_DIR}/client_subscriptions.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client.h ${DOC_SRC_DIR}/client.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_highlevel.h ${DOC_SRC_DIR}/client_highlevel.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_log.h ${DOC_SRC_DIR}/plugin_log.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_network.h ${DOC_SRC_DIR}/plugin_network.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_access_control.h ${DOC_SRC_DIR}/plugin_access_control.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/types.h ${DOC_SRC_DIR}/types.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/constants.h ${DOC_SRC_DIR}/constants.rst) +generate_rst(${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h ${DOC_SRC_DIR}/statuscodes.rst) +generate_rst(${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.h ${DOC_SRC_DIR}/types_generated.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server_config.h ${DOC_SRC_DIR}/server_config.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server.h ${DOC_SRC_DIR}/server.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_config.h ${DOC_SRC_DIR}/client_config.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_subscriptions.h ${DOC_SRC_DIR}/client_subscriptions.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client.h ${DOC_SRC_DIR}/client.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_highlevel.h ${DOC_SRC_DIR}/client_highlevel.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/log.h ${DOC_SRC_DIR}/plugin_log.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/network.h ${DOC_SRC_DIR}/plugin_network.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/accesscontrol.h ${DOC_SRC_DIR}/plugin_accesscontrol.rst) generate_rst(${PROJECT_SOURCE_DIR}/src/server/ua_services.h ${DOC_SRC_DIR}/services.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_nodestore.h ${DOC_SRC_DIR}/nodestore.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_pubsub.h ${DOC_SRC_DIR}/plugin_pubsub_connection.rst) -generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server_pubsub.h ${DOC_SRC_DIR}/pubsub.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/nodestore.h ${DOC_SRC_DIR}/nodestore.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/pubsub.h ${DOC_SRC_DIR}/plugin_pubsub_connection.rst) +generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server_pubsub.h ${DOC_SRC_DIR}/pubsub.rst) # Doc from tutorial code generate_rst(${PROJECT_SOURCE_DIR}/examples/tutorial_datatypes.c ${DOC_SRC_DIR}/tutorial_datatypes.rst) @@ -56,7 +56,7 @@ add_custom_target(doc_latex ${SPHINX_EXECUTABLE} ${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_subscriptions.rst ${DOC_SRC_DIR}/client_highlevel.rst ${DOC_SRC_DIR}/client_config.rst ${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst - ${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst + ${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_accesscontrol.rst ${DOC_SRC_DIR}/nodestore.rst ${DOC_SRC_DIR}/tutorials.rst ${DOC_SRC_DIR}/tutorial_datatypes.rst @@ -91,7 +91,7 @@ add_custom_target(doc ${SPHINX_EXECUTABLE} ${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_subscriptions.rst ${DOC_SRC_DIR}/client_highlevel.rst ${DOC_SRC_DIR}/client_config.rst ${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst - ${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst + ${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_accesscontrol.rst ${DOC_SRC_DIR}/nodestore.rst ${DOC_SRC_DIR}/tutorials.rst ${DOC_SRC_DIR}/tutorial_datatypes.rst diff --git a/doc/internal.rst b/doc/internal.rst index 38eee56176e..80ba052e5eb 100644 --- a/doc/internal.rst +++ b/doc/internal.rst @@ -5,7 +5,7 @@ Internals statuscodes plugin_network - plugin_access_control + plugin_accesscontrol plugin_log plugin_pubsub_connection pubsub diff --git a/examples/access_control/client_access_control.c b/examples/access_control/client_access_control.c index a70568b2712..2672fa7f45b 100644 --- a/examples/access_control/client_access_control.c +++ b/examples/access_control/client_access_control.c @@ -5,9 +5,8 @@ * Using access_control_server */ -#include -#include -#include +#include +#include #include diff --git a/examples/access_control/server_access_control.c b/examples/access_control/server_access_control.c index 790e2602a5a..2de1f0c46b3 100644 --- a/examples/access_control/server_access_control.c +++ b/examples/access_control/server_access_control.c @@ -1,11 +1,10 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/client.c b/examples/client.c index f04bed99220..df304e9c52a 100644 --- a/examples/client.c +++ b/examples/client.c @@ -1,10 +1,10 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/examples/client_async.c b/examples/client_async.c index cc36188c8f9..76e6cd2f43c 100644 --- a/examples/client_async.c +++ b/examples/client_async.c @@ -1,10 +1,11 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/examples/client_connect_loop.c b/examples/client_connect_loop.c index 6d9dd5ef472..d966a21aa0c 100644 --- a/examples/client_connect_loop.c +++ b/examples/client_connect_loop.c @@ -10,11 +10,9 @@ * * This example is very similar to the tutorial_client_firststeps.c. */ - -#include -#include -#include - +#include +#include +#include #include #include diff --git a/examples/client_connectivitycheck_loop.c b/examples/client_connectivitycheck_loop.c index fa47cc09af3..676b4584a0a 100644 --- a/examples/client_connectivitycheck_loop.c +++ b/examples/client_connectivitycheck_loop.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/client_historical.c b/examples/client_historical.c index a65ab57da88..63ae65965cc 100644 --- a/examples/client_historical.c +++ b/examples/client_historical.c @@ -1,9 +1,8 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include #include #include diff --git a/examples/client_subscription_loop.c b/examples/client_subscription_loop.c index 76518adb899..9d25e5ed64d 100644 --- a/examples/client_subscription_loop.c +++ b/examples/client_subscription_loop.c @@ -10,9 +10,9 @@ * * This example is very similar to the tutorial_client_firststeps.c. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/common.h b/examples/common.h index 8b67e0fc0d9..a0d3b829405 100644 --- a/examples/common.h +++ b/examples/common.h @@ -1,13 +1,8 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ - -#ifdef UA_ENABLE_AMALGAMATION -# include -#else -# include "ua_types.h" -# include "ua_types_generated_handling.h" -#endif +# include +# include /* loadFile parses the certificate file. * diff --git a/examples/custom_datatype/client_types_custom.c b/examples/custom_datatype/client_types_custom.c index dc4e446b84e..08d54c800f4 100644 --- a/examples/custom_datatype/client_types_custom.c +++ b/examples/custom_datatype/client_types_custom.c @@ -1,8 +1,8 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include +#include +#include #include "custom_datatype.h" #include diff --git a/examples/custom_datatype/server_types_custom.c b/examples/custom_datatype/server_types_custom.c index 3c6cccc9b08..6723b210980 100644 --- a/examples/custom_datatype/server_types_custom.c +++ b/examples/custom_datatype/server_types_custom.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include "custom_datatype.h" #include diff --git a/examples/discovery/client_find_servers.c b/examples/discovery/client_find_servers.c index 538ba944eac..e3a9556ad43 100644 --- a/examples/discovery/client_find_servers.c +++ b/examples/discovery/client_find_servers.c @@ -5,9 +5,9 @@ * and then calls GetEndpoints on the returned list of servers. */ -#include -#include -#include +#include +#include +#include #include diff --git a/examples/discovery/server_lds.c b/examples/discovery/server_lds.c index ad21cd2d23f..d912b01300b 100644 --- a/examples/discovery/server_lds.c +++ b/examples/discovery/server_lds.c @@ -6,8 +6,8 @@ * find servers service to get all registered servers (see client_find_servers.c). */ -#include -#include +#include +#include #include #include diff --git a/examples/discovery/server_multicast.c b/examples/discovery/server_multicast.c index 36e142b1361..2e54b79ec99 100644 --- a/examples/discovery/server_multicast.c +++ b/examples/discovery/server_multicast.c @@ -8,11 +8,11 @@ * (i.e., LDS-ME). */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/discovery/server_register.c b/examples/discovery/server_register.c index d1dfb440eda..8df66b43c22 100644 --- a/examples/discovery/server_register.c +++ b/examples/discovery/server_register.c @@ -5,9 +5,11 @@ * Before shutdown it has to unregister itself. */ -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/encryption/client_encryption.c b/examples/encryption/client_encryption.c index 4cfe37d5500..89116961368 100644 --- a/examples/encryption/client_encryption.c +++ b/examples/encryption/client_encryption.c @@ -1,11 +1,12 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "common.h" #include diff --git a/examples/encryption/server_basic128rsa15.c b/examples/encryption/server_basic128rsa15.c index 99fcec3250e..eb871eb32c2 100644 --- a/examples/encryption/server_basic128rsa15.c +++ b/examples/encryption/server_basic128rsa15.c @@ -1,11 +1,11 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "common.h" #include diff --git a/examples/encryption/server_basic256sha256.c b/examples/encryption/server_basic256sha256.c index 8fe13d4c022..95b443e3445 100644 --- a/examples/encryption/server_basic256sha256.c +++ b/examples/encryption/server_basic256sha256.c @@ -1,11 +1,11 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "common.h" #include diff --git a/examples/nodeset/CMakeLists.txt b/examples/nodeset/CMakeLists.txt index 3eb417fc4f5..d3557717ffe 100644 --- a/examples/nodeset/CMakeLists.txt +++ b/examples/nodeset/CMakeLists.txt @@ -38,9 +38,11 @@ ua_generate_nodeid_header( FILE_CSV "${FILE_CSV_DIRPREFIX}/server_nodeset.csv" ) -add_example(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_example.c ${PROJECT_BINARY_DIR}/src_generated/example_nodeids.h) +add_example(server_nodeset server_nodeset.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_example.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/example_nodeids.h) if(UA_COMPILE_AS_CXX) - set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_namespace_example.c PROPERTIES LANGUAGE CXX) + set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/open62541/namespace_example.c PROPERTIES LANGUAGE CXX) endif() if(UA_NAMESPACE_ZERO STREQUAL "FULL") @@ -53,8 +55,8 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL") INTERNAL ) add_example(server_testnodeset server_testnodeset.c - ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_testnodeset.c - ${PROJECT_BINARY_DIR}/src_generated/ua_types_testnodeset_generated.c) + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_testnodeset.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/types_testnodeset_generated.c) add_dependencies(server_testnodeset open62541-generator-ns-testnodeset) endif() @@ -99,9 +101,9 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL") ) add_example(server_nodeset_plcopen server_nodeset_plcopen.c - ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c - ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c - ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c) + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_types_di_generated.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_di.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_plc.c) add_dependencies(server_nodeset_plcopen open62541-generator-ns-plc) @@ -124,10 +126,11 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL") ) add_example(server_nodeset_powerlink server_nodeset_powerlink.c - ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c - ${PROJECT_BINARY_DIR}/src_generated/ua_types_powerlink_generated.c - ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c - ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_powerlink.c) + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_types_di_generated.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_types_powerlink_generated.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_di.c + ${PROJECT_BINARY_DIR}/src_generated/open62541/ua_namespace_powerlink.c) add_dependencies(server_nodeset_powerlink open62541-generator-ns-powerlink) + endif() diff --git a/examples/nodeset/server_nodeset.c b/examples/nodeset/server_nodeset.c index ca179f31915..caafc68f858 100644 --- a/examples/nodeset/server_nodeset.c +++ b/examples/nodeset/server_nodeset.c @@ -1,17 +1,17 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include /* Files example_namespace.h and example_namespace.c are created from server_nodeset.xml in the * /src_generated directory by CMake */ -#include "ua_namespace_example.h" -#include "example_nodeids.h" +#include "open62541/ua_namespace_example.h" +#include "open62541/example_nodeids.h" UA_Boolean running = true; diff --git a/examples/nodeset/server_testnodeset.c b/examples/nodeset/server_testnodeset.c index a68d336161c..8eae575257c 100644 --- a/examples/nodeset/server_testnodeset.c +++ b/examples/nodeset/server_testnodeset.c @@ -2,22 +2,22 @@ * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include "ua_namespace_testnodeset.h" +#include "open62541/ua_namespace_testnodeset.h" UA_Boolean running = true; UA_DataTypeArray customTypesArray = { NULL, UA_TYPES_TESTNODESET_COUNT, UA_TYPES_TESTNODESET}; -static void stopHandler(int sign) -{ +static void stopHandler(int sign) { UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c"); running = false; } @@ -32,15 +32,12 @@ int main(int argc, char **argv) UA_StatusCode retval; /* create nodes from nodeset */ - if (ua_namespace_testnodeset(server) != UA_STATUSCODE_GOOD) - { + if(ua_namespace_testnodeset(server) != UA_STATUSCODE_GOOD) { UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Could not add the example nodeset. " "Check previous output for any error."); retval = UA_STATUSCODE_BADUNEXPECTEDERROR; - } - else - { + } else { UA_Variant out; UA_Variant_init(&out); UA_Server_readValue(server, UA_NODEID_NUMERIC(2, 10002), &out); diff --git a/examples/pubsub/tutorial_pubsub_connection.c b/examples/pubsub/tutorial_pubsub_connection.c index b05ef742343..7fecb217235 100644 --- a/examples/pubsub/tutorial_pubsub_connection.c +++ b/examples/pubsub/tutorial_pubsub_connection.c @@ -2,10 +2,10 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/pubsub/tutorial_pubsub_publish.c b/examples/pubsub/tutorial_pubsub_publish.c index 9e332ee4e75..acd81472cdf 100644 --- a/examples/pubsub/tutorial_pubsub_publish.c +++ b/examples/pubsub/tutorial_pubsub_publish.c @@ -24,11 +24,11 @@ * ``tutorial_pubsub_connection.c``. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/examples/pubsub/tutorial_pubsub_subscribe.c b/examples/pubsub/tutorial_pubsub_subscribe.c index f282885234e..5d660322070 100644 --- a/examples/pubsub/tutorial_pubsub_subscribe.c +++ b/examples/pubsub/tutorial_pubsub_subscribe.c @@ -7,18 +7,20 @@ * The PubSub subscriber API is currently not finished. This examples can be used to receive * and print the values, which are published by the tutorial_pubsub_publish example. * The following code uses internal API which will be later replaced by the higher-level - * PubSub subscriber API. -*/ + * PubSub subscriber API. */ + +#include +#include +#include +#include + +#include "src_generated/open62541/types_generated.h" #include "ua_pubsub_networkmessage.h" -#include "ua_log_stdout.h" -#include "ua_server.h" -#include "ua_config_default.h" #include "ua_pubsub.h" -#include "ua_network_pubsub_udp.h" + #ifdef UA_ENABLE_PUBSUB_ETH_UADP -#include "ua_network_pubsub_ethernet.h" +#include #endif -#include "src_generated/ua_types_generated.h" #include #include diff --git a/examples/server_ctt.c b/examples/server_ctt.c index a5e9c2f983e..c255f84c726 100644 --- a/examples/server_ctt.c +++ b/examples/server_ctt.c @@ -5,15 +5,11 @@ #define _CRT_SECURE_NO_WARNINGS /* disable fopen deprication warning in msvs */ #endif -#ifdef UA_ENABLE_AMALGAMATION -# include -#else -# include -# include -# include -#endif +#include +#include +#include -# include "common.h" +#include "common.h" #include #include diff --git a/examples/server_inheritance.c b/examples/server_inheritance.c index 0e4ced0f13e..e2865c86400 100644 --- a/examples/server_inheritance.c +++ b/examples/server_inheritance.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/server_instantiation.c b/examples/server_instantiation.c index 474a801ae4d..27fc16e53cc 100644 --- a/examples/server_instantiation.c +++ b/examples/server_instantiation.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/server_mainloop.c b/examples/server_mainloop.c index d25c4b3ad6e..dbcfe79e01e 100644 --- a/examples/server_mainloop.c +++ b/examples/server_mainloop.c @@ -3,9 +3,9 @@ * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/server_repeated_job.c b/examples/server_repeated_job.c index ef974cd174b..118951835e1 100644 --- a/examples/server_repeated_job.c +++ b/examples/server_repeated_job.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/tutorial_client_events.c b/examples/tutorial_client_events.c index c7ab14bdd3f..ac91f07d2b9 100644 --- a/examples/tutorial_client_events.c +++ b/examples/tutorial_client_events.c @@ -1,10 +1,13 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/examples/tutorial_client_firststeps.c b/examples/tutorial_client_firststeps.c index 22eb0c87169..65fb7859cc2 100644 --- a/examples/tutorial_client_firststeps.c +++ b/examples/tutorial_client_firststeps.c @@ -8,9 +8,9 @@ * provides both a server- and clientside API, so creating a client is as easy as * creating a server. Copy the following into a file `myClient.c`: */ -#include -#include -#include +#include +#include +#include #include diff --git a/examples/tutorial_datatypes.c b/examples/tutorial_datatypes.c index 6e3bb4abe82..5b9b3a8cca6 100644 --- a/examples/tutorial_datatypes.c +++ b/examples/tutorial_datatypes.c @@ -16,9 +16,9 @@ * This section shows the basic interaction patterns for data types. Make * sure to compare with the type definitions in ``ua_types.h``. */ -#include -#include -#include +#include +#include +#include #include diff --git a/examples/tutorial_server_datasource.c b/examples/tutorial_server_datasource.c index a756073af4a..2cfe5055653 100644 --- a/examples/tutorial_server_datasource.c +++ b/examples/tutorial_server_datasource.c @@ -25,9 +25,9 @@ * new value arrives from the underlying process, we can just write into the * variable. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_events.c b/examples/tutorial_server_events.c index 3108e20477a..4509b5fc7cf 100644 --- a/examples/tutorial_server_events.c +++ b/examples/tutorial_server_events.c @@ -1,9 +1,9 @@ /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_firststeps.c b/examples/tutorial_server_firststeps.c index 0ac36025b39..d51805b5f15 100644 --- a/examples/tutorial_server_firststeps.c +++ b/examples/tutorial_server_firststeps.c @@ -20,9 +20,9 @@ * you have the ``open62541.c/.h`` files in the current folder. Now create a new * C source-file called ``myServer.c`` with the following content: */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_historicaldata.c b/examples/tutorial_server_historicaldata.c index e4b81236093..30c56ff8353 100644 --- a/examples/tutorial_server_historicaldata.c +++ b/examples/tutorial_server_historicaldata.c @@ -4,14 +4,14 @@ * Copyright 2019 (c) basysKom GmbH (Author: Peter Rustler) */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include "historydata/ua_historydatagathering_default.h" +#include "historydata/ua_historydatabackend_memory.h" #include #include diff --git a/examples/tutorial_server_method.c b/examples/tutorial_server_method.c index bed7bd52897..4fc4cb6de04 100644 --- a/examples/tutorial_server_method.c +++ b/examples/tutorial_server_method.c @@ -30,9 +30,10 @@ * prepended. The type and length of the input arguments is checked internally * by the SDK, so that we don't have to verify the arguments in the callback. */ -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_monitoreditems.c b/examples/tutorial_server_monitoreditems.c index 9eff97969fe..869af274d9c 100644 --- a/examples/tutorial_server_monitoreditems.c +++ b/examples/tutorial_server_monitoreditems.c @@ -19,10 +19,10 @@ * context pointer. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_object.c b/examples/tutorial_server_object.c index aac3485e604..b9ecba5656e 100644 --- a/examples/tutorial_server_object.c +++ b/examples/tutorial_server_object.c @@ -55,9 +55,9 @@ * setting constraints on the variable values as this is not the focus of this * tutorial and was already covered. */ -#include -#include -#include +#include +#include +#include #include diff --git a/examples/tutorial_server_variable.c b/examples/tutorial_server_variable.c index 297442cfbd6..ae4b02997c1 100644 --- a/examples/tutorial_server_variable.c +++ b/examples/tutorial_server_variable.c @@ -14,9 +14,9 @@ * read only. See below for making the variable writable. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/tutorial_server_variabletype.c b/examples/tutorial_server_variabletype.c index 062a7e73175..daf622e483b 100644 --- a/examples/tutorial_server_variabletype.c +++ b/examples/tutorial_server_variabletype.c @@ -18,9 +18,9 @@ * VariableTypeNode to the hierarchy of variable types. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/include/ua_client.h b/include/open62541/client.h similarity index 98% rename from include/ua_client.h rename to include/open62541/client.h index a245556cdaf..74fa3b390ff 100644 --- a/include/ua_client.h +++ b/include/open62541/client.h @@ -17,14 +17,11 @@ #ifndef UA_CLIENT_H_ #define UA_CLIENT_H_ -#include "ua_types.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_plugin_securitypolicy.h" -#include "ua_plugin_network.h" -#include "ua_plugin_log.h" -#include "ua_client_config.h" -#include "ua_nodeids.h" +#include +#include +#include +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_client_config.h b/include/open62541/client_config.h similarity index 97% rename from include/ua_client_config.h rename to include/open62541/client_config.h index ac538ec2741..0ba72ca5c6d 100644 --- a/include/ua_client_config.h +++ b/include/open62541/client_config.h @@ -9,9 +9,10 @@ #ifndef UA_CLIENT_CONFIG_H #define UA_CLIENT_CONFIG_H -#include "ua_config.h" -#include "ua_plugin_securitypolicy.h" -#include "ua_plugin_network.h" +#include +#include +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_client_highlevel.h b/include/open62541/client_highlevel.h similarity index 99% rename from include/ua_client_highlevel.h rename to include/open62541/client_highlevel.h index 1b9c2601ea1..90ae754fac1 100644 --- a/include/ua_client_highlevel.h +++ b/include/open62541/client_highlevel.h @@ -15,7 +15,7 @@ #ifndef UA_CLIENT_HIGHLEVEL_H_ #define UA_CLIENT_HIGHLEVEL_H_ -#include "ua_client.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_client_highlevel_async.h b/include/open62541/client_highlevel_async.h similarity index 99% rename from include/ua_client_highlevel_async.h rename to include/open62541/client_highlevel_async.h index ab01d91b226..6f456243290 100644 --- a/include/ua_client_highlevel_async.h +++ b/include/open62541/client_highlevel_async.h @@ -9,13 +9,14 @@ #ifndef UA_CLIENT_HIGHLEVEL_ASYNC_H_ #define UA_CLIENT_HIGHLEVEL_ASYNC_H_ -#include "ua_client.h" +#include _UA_BEGIN_DECLS /** * Raw Services * ^^^^^^^^^^^^ */ + typedef void (*UA_ClientAsyncReadCallback)(UA_Client *client, void *userdata, UA_UInt32 requestId, UA_ReadResponse *rr); static UA_INLINE UA_StatusCode diff --git a/include/ua_client_subscriptions.h b/include/open62541/client_subscriptions.h similarity index 99% rename from include/ua_client_subscriptions.h rename to include/open62541/client_subscriptions.h index 0d172401b54..49d50a6544f 100644 --- a/include/ua_client_subscriptions.h +++ b/include/open62541/client_subscriptions.h @@ -5,7 +5,7 @@ #ifndef UA_CLIENT_SUBSCRIPTIONS_H_ #define UA_CLIENT_SUBSCRIPTIONS_H_ -#include "ua_client.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_config.h.in b/include/open62541/config.h.in similarity index 100% rename from include/ua_config.h.in rename to include/open62541/config.h.in diff --git a/include/ua_constants.h b/include/open62541/constants.h similarity index 99% rename from include/ua_constants.h rename to include/open62541/constants.h index 3553fe10b56..f2acbd517f6 100644 --- a/include/ua_constants.h +++ b/include/open62541/constants.h @@ -11,7 +11,7 @@ #ifndef UA_CONSTANTS_H_ #define UA_CONSTANTS_H_ -#include "ua_config.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_access_control.h b/include/open62541/plugin/accesscontrol.h similarity index 99% rename from include/ua_plugin_access_control.h rename to include/open62541/plugin/accesscontrol.h index c0c92c71e5e..ccc6758eb39 100644 --- a/include/ua_plugin_access_control.h +++ b/include/open62541/plugin/accesscontrol.h @@ -9,8 +9,7 @@ #ifndef UA_PLUGIN_ACCESS_CONTROL_H_ #define UA_PLUGIN_ACCESS_CONTROL_H_ -#include "ua_types.h" -#include "ua_server.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_historydatabase.h b/include/open62541/plugin/historydatabase.h similarity index 80% rename from include/ua_plugin_historydatabase.h rename to include/open62541/plugin/historydatabase.h index 597bb37d82c..e50e8921fc7 100644 --- a/include/ua_plugin_historydatabase.h +++ b/include/open62541/plugin/historydatabase.h @@ -8,8 +8,7 @@ #ifndef UA_PLUGIN_HISTORYDATABASE_H_ #define UA_PLUGIN_HISTORYDATABASE_H_ -#include "ua_types.h" -#include "ua_server.h" +#include _UA_BEGIN_DECLS @@ -49,16 +48,20 @@ struct UA_HistoryDatabase { * hdbContext is the context of the UA_HistoryDatabase. * sessionId and sessionContext identify the session which set this value. * requestHeader, historyReadDetails, timestampsToReturn, releaseContinuationPoints - * nodesToReadSize and nodesToRead is the requested data from the client. It is from the request object. - * response the response to fill for the client. If the request is ok, there is no need to use it. - * Use this to set status codes other than "Good" or other data. - * You find an already allocated UA_HistoryReadResult array with an UA_HistoryData object - * in the extension object in the size of nodesToReadSize. If you are not willing to return data, - * you have to delete the results array, set it to NULL and set the resultsSize to 0. - * Do not access historyData after that. - * historyData is a proper typed pointer array pointing in the UA_HistoryReadResult extension object. - * use this to provide result data to the client. - * Index in the array is the same as in nodesToRead and the UA_HistoryReadResult array. */ + * nodesToReadSize and nodesToRead is the requested data from the client. It + * is from the request object. + * response the response to fill for the client. If the request is ok, there + * is no need to use it. Use this to set status codes other than + * "Good" or other data. You find an already allocated + * UA_HistoryReadResult array with an UA_HistoryData object in the + * extension object in the size of nodesToReadSize. If you are not + * willing to return data, you have to delete the results array, + * set it to NULL and set the resultsSize to 0. Do not access + * historyData after that. + * historyData is a proper typed pointer array pointing in the + * UA_HistoryReadResult extension object. use this to provide + * result data to the client. Index in the array is the same as + * in nodesToRead and the UA_HistoryReadResult array. */ void (*readRaw)(UA_Server *server, void *hdbContext, diff --git a/include/ua_plugin_log.h b/include/open62541/plugin/log.h similarity index 99% rename from include/ua_plugin_log.h rename to include/open62541/plugin/log.h index 4c69872e57f..81c3e010e39 100644 --- a/include/ua_plugin_log.h +++ b/include/open62541/plugin/log.h @@ -10,7 +10,7 @@ #define UA_PLUGIN_LOG_H_ #include -#include "ua_config.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_network.h b/include/open62541/plugin/network.h similarity index 99% rename from include/ua_plugin_network.h rename to include/open62541/plugin/network.h index f0b117c21a5..be7a53b5702 100644 --- a/include/ua_plugin_network.h +++ b/include/open62541/plugin/network.h @@ -9,8 +9,8 @@ #ifndef UA_PLUGIN_NETWORK_H_ #define UA_PLUGIN_NETWORK_H_ -#include "ua_server.h" -#include "ua_plugin_log.h" +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_nodestore.h b/include/open62541/plugin/nodestore.h similarity index 99% rename from include/ua_plugin_nodestore.h rename to include/open62541/plugin/nodestore.h index 75b1d41bd0a..136fc6f5829 100644 --- a/include/ua_plugin_nodestore.h +++ b/include/open62541/plugin/nodestore.h @@ -17,8 +17,7 @@ * not meant to be used directly by end users. Please use the public server API * / OPC UA services to interact with the information model. */ -#include "ua_types.h" -#include "ua_server.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_pki.h b/include/open62541/plugin/pki.h similarity index 96% rename from include/ua_plugin_pki.h rename to include/open62541/plugin/pki.h index a4b9f676791..b84d71dc7a6 100644 --- a/include/ua_plugin_pki.h +++ b/include/open62541/plugin/pki.h @@ -8,8 +8,8 @@ #ifndef UA_PLUGIN_PKI_H_ #define UA_PLUGIN_PKI_H_ -#include "ua_types.h" -#include "ua_server.h" +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_plugin_pubsub.h b/include/open62541/plugin/pubsub.h similarity index 74% rename from include/ua_plugin_pubsub.h rename to include/open62541/plugin/pubsub.h index 0ea51c68be4..0319c81d6a7 100644 --- a/include/ua_plugin_pubsub.h +++ b/include/open62541/plugin/pubsub.h @@ -8,7 +8,7 @@ #ifndef UA_PLUGIN_PUBSUB_H_ #define UA_PLUGIN_PUBSUB_H_ -#include "ua_server_pubsub.h" +#include _UA_BEGIN_DECLS @@ -20,15 +20,14 @@ _UA_BEGIN_DECLS * PubSub Connection Plugin API * ============================ * - * The PubSub Connection API is the interface between concrete network implementations and the internal pubsub - * code. + * The PubSub Connection API is the interface between concrete network + * implementations and the internal pubsub code. * - * The PubSub specification enables the creation of new connections on runtime. Wording: - * 'Connection' -> OPC UA standard 'highlevel' perspective, - * 'Channel' -> open62541 implementation 'lowlevel' perspective. A channel can be assigned with different - * network implementations like UDP, MQTT, AMQP. The channel provides basis services - * like send, regist, unregist, receive, close. - */ + * The PubSub specification enables the creation of new connections on runtime. + * Wording: 'Connection' -> OPC UA standard 'highlevel' perspective, 'Channel' + * -> open62541 implementation 'lowlevel' perspective. A channel can be assigned + * with different network implementations like UDP, MQTT, AMQP. The channel + * provides basis services like send, regist, unregist, receive, close. */ typedef enum { UA_PUBSUB_CHANNEL_RDY, @@ -76,13 +75,14 @@ struct UA_PubSubChannel { }; /** - * The UA_PubSubTransportLayer is used for the creation of new connections. Whenever on runtime a new - * connection is request, the internal PubSub implementation call * the 'createPubSubChannel' function. - * The 'transportProfileUri' contains the standard defined transport profile information - * and is used to identify the type of connections which can be created by the - * TransportLayer. The server config contains a list of UA_PubSubTransportLayer. - * Take a look in the tutorial_pubsub_connection to get informations about the TransportLayer handling. - */ + * The UA_PubSubTransportLayer is used for the creation of new connections. + * Whenever on runtime a new connection is request, the internal PubSub + * implementation call * the 'createPubSubChannel' function. The + * 'transportProfileUri' contains the standard defined transport profile + * information and is used to identify the type of connections which can be + * created by the TransportLayer. The server config contains a list of + * UA_PubSubTransportLayer. Take a look in the tutorial_pubsub_connection to get + * informations about the TransportLayer handling. */ typedef struct { UA_String transportProfileUri; @@ -90,18 +90,17 @@ typedef struct { } UA_PubSubTransportLayer; /** - * The UA_ServerConfig_addPubSubTransportLayer is used to add a transport - * layer to the server configuration. The list memory is allocated and will be freed with - * UA_PubSubManager_delete. + * The UA_ServerConfig_addPubSubTransportLayer is used to add a transport layer + * to the server configuration. The list memory is allocated and will be freed + * with UA_PubSubManager_delete. * * .. note:: If the UA_String transportProfileUri was dynamically allocated * the memory has to be freed when no longer required. * - * .. note:: This has to be done before the server is started with UA_Server_run. - */ + * .. note:: This has to be done before the server is started with UA_Server_run. */ UA_StatusCode UA_EXPORT UA_ServerConfig_addPubSubTransportLayer(UA_ServerConfig *config, - UA_PubSubTransportLayer *pubsubTransportLayer); + UA_PubSubTransportLayer *pubsubTransportLayer); #endif /* UA_ENABLE_PUBSUB */ diff --git a/include/ua_plugin_securitypolicy.h b/include/open62541/plugin/securitypolicy.h similarity index 99% rename from include/ua_plugin_securitypolicy.h rename to include/open62541/plugin/securitypolicy.h index 39440a6c8a6..a3210e835f5 100644 --- a/include/ua_plugin_securitypolicy.h +++ b/include/open62541/plugin/securitypolicy.h @@ -10,10 +10,9 @@ #ifndef UA_PLUGIN_SECURITYPOLICY_H_ #define UA_PLUGIN_SECURITYPOLICY_H_ -#include "ua_types.h" -#include "ua_types_generated.h" -#include "ua_plugin_log.h" -#include "ua_plugin_pki.h" +#include +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_server.h b/include/open62541/server.h similarity index 99% rename from include/ua_server.h rename to include/open62541/server.h index 38ae4bbcbc2..3bd9b8cd0dc 100644 --- a/include/ua_server.h +++ b/include/open62541/server.h @@ -13,10 +13,10 @@ #ifndef UA_SERVER_H_ #define UA_SERVER_H_ -#include "ua_types.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_nodeids.h" +#include +#include +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_server_config.h b/include/open62541/server_config.h similarity index 95% rename from include/ua_server_config.h rename to include/open62541/server_config.h index ab3e0ca75ef..930b2ed75e6 100644 --- a/include/ua_server_config.h +++ b/include/open62541/server_config.h @@ -11,20 +11,20 @@ #ifndef UA_SERVER_CONFIG_H_ #define UA_SERVER_CONFIG_H_ -#include "ua_server.h" -#include "ua_plugin_log.h" -#include "ua_plugin_network.h" -#include "ua_plugin_access_control.h" -#include "ua_plugin_pki.h" -#include "ua_plugin_securitypolicy.h" -#include "ua_plugin_nodestore.h" +#include +#include +#include +#include +#include +#include +#include #ifdef UA_ENABLE_PUBSUB -#include "ua_plugin_pubsub.h" +#include #endif #ifdef UA_ENABLE_HISTORIZING -#include "ua_plugin_historydatabase.h" +#include #endif _UA_BEGIN_DECLS diff --git a/include/ua_server_pubsub.h b/include/open62541/server_pubsub.h similarity index 99% rename from include/ua_server_pubsub.h rename to include/open62541/server_pubsub.h index cabb7d58491..4140ab74758 100644 --- a/include/ua_server_pubsub.h +++ b/include/open62541/server_pubsub.h @@ -8,7 +8,7 @@ #ifndef UA_SERVER_PUBSUB_H #define UA_SERVER_PUBSUB_H -#include "ua_server.h" +#include _UA_BEGIN_DECLS diff --git a/include/ua_types.h b/include/open62541/types.h similarity index 99% rename from include/ua_types.h rename to include/open62541/types.h index 128946ef19f..34cb12c0949 100644 --- a/include/ua_types.h +++ b/include/open62541/types.h @@ -16,9 +16,9 @@ #ifndef UA_TYPES_H_ #define UA_TYPES_H_ -#include "ua_config.h" -#include "ua_constants.h" -#include "ua_statuscodes.h" +#include +#include +#include _UA_BEGIN_DECLS diff --git a/include/ua_util.h b/include/open62541/util.h similarity index 96% rename from include/ua_util.h rename to include/open62541/util.h index 2c4f2569cad..7da4779f9fc 100644 --- a/include/ua_util.h +++ b/include/open62541/util.h @@ -5,20 +5,18 @@ * Copyright 2018 (c) Stefan Profanter, fortiss GmbH */ - #ifndef UA_HELPER_H_ #define UA_HELPER_H_ -#include "ua_config.h" -#include "ua_types.h" +#include _UA_BEGIN_DECLS /** -* Endpoint URL Parser -* ------------------- -* The endpoint URL parser is generally useful for the implementation of network -* layer plugins. */ + * Endpoint URL Parser + * ------------------- + * The endpoint URL parser is generally useful for the implementation of network + * layer plugins. */ /* Split the given endpoint url into hostname, port and path. All arguments must * be non-NULL. EndpointUrls have the form "opc.tcp://hostname:port/path", port diff --git a/include/open62541.pc.in b/open62541.pc.in similarity index 100% rename from include/open62541.pc.in rename to open62541.pc.in diff --git a/plugins/historydata/ua_historydatabase_default.c b/plugins/historydata/ua_historydatabase_default.c index 4c5252086c2..b3da4f1ce06 100644 --- a/plugins/historydata/ua_historydatabase_default.c +++ b/plugins/historydata/ua_historydatabase_default.c @@ -5,8 +5,9 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_historydatabase_default.h" #include +#include +#include "ua_historydatagathering_default.h" typedef struct { UA_HistoryDataGathering gathering; diff --git a/plugins/historydata/ua_historydatagathering_default.c b/plugins/historydata/ua_historydatagathering_default.c index aba1da2f46c..e05de5d067e 100644 --- a/plugins/historydata/ua_historydatagathering_default.c +++ b/plugins/historydata/ua_historydatagathering_default.c @@ -5,10 +5,9 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_historydatagathering_default.h" -#include "ua_server.h" -#include "ua_client_subscriptions.h" #include +#include +#include "ua_historydatagathering_default.h" typedef struct { UA_NodeId nodeId; diff --git a/plugins/historydata/ua_plugin_history_data_backend.h b/plugins/historydata/ua_plugin_history_data_backend.h index 2398dd47198..e7722f3a70f 100644 --- a/plugins/historydata/ua_plugin_history_data_backend.h +++ b/plugins/historydata/ua_plugin_history_data_backend.h @@ -8,8 +8,7 @@ #ifndef UA_PLUGIN_HISTORY_DATA_BACKEND_H_ #define UA_PLUGIN_HISTORY_DATA_BACKEND_H_ -#include "ua_types.h" -#include "ua_server.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/historydata/ua_plugin_history_data_gathering.h b/plugins/historydata/ua_plugin_history_data_gathering.h index 1bbed26ffb4..0ea6b854801 100644 --- a/plugins/historydata/ua_plugin_history_data_gathering.h +++ b/plugins/historydata/ua_plugin_history_data_gathering.h @@ -8,8 +8,6 @@ #ifndef UA_PLUGIN_HISTORY_DATA_GATHERING_H_ #define UA_PLUGIN_HISTORY_DATA_GATHERING_H_ -#include "ua_types.h" -#include "ua_server.h" #include "ua_plugin_history_data_backend.h" _UA_BEGIN_DECLS diff --git a/plugins/include/open62541/client_config_default.h b/plugins/include/open62541/client_config_default.h new file mode 100644 index 00000000000..b7ce9740400 --- /dev/null +++ b/plugins/include/open62541/client_config_default.h @@ -0,0 +1,29 @@ +/* This work is licensed under a Creative Commons CCZero 1.0 Universal License. + * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB + */ + +#ifndef UA_CLIENT_CONFIG_DEFAULT_H_ +#define UA_CLIENT_CONFIG_DEFAULT_H_ + +#include + +_UA_BEGIN_DECLS + +UA_StatusCode UA_EXPORT +UA_ClientConfig_setDefault(UA_ClientConfig *config); + +#ifdef UA_ENABLE_ENCRYPTION +UA_StatusCode UA_EXPORT +UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, + UA_ByteString localCertificate, UA_ByteString privateKey, + const UA_ByteString *trustList, size_t trustListSize, + const UA_ByteString *revocationList, size_t revocationListSize); +#endif + +_UA_END_DECLS + +#endif /* UA_CLIENT_CONFIG_DEFAULT_H_ */ diff --git a/plugins/ua_accesscontrol_default.h b/plugins/include/open62541/plugin/accesscontrol_default.h similarity index 92% rename from plugins/ua_accesscontrol_default.h rename to plugins/include/open62541/plugin/accesscontrol_default.h index c9bb7b1a03c..b604f40e0f8 100644 --- a/plugins/ua_accesscontrol_default.h +++ b/plugins/include/open62541/plugin/accesscontrol_default.h @@ -8,8 +8,8 @@ #ifndef UA_ACCESSCONTROL_DEFAULT_H_ #define UA_ACCESSCONTROL_DEFAULT_H_ -#include "ua_server.h" -#include "ua_plugin_access_control.h" +#include +#include _UA_BEGIN_DECLS diff --git a/plugins/historydata/ua_historydatabase_default.h b/plugins/include/open62541/plugin/historydatabase_default.h similarity index 83% rename from plugins/historydata/ua_historydatabase_default.h rename to plugins/include/open62541/plugin/historydatabase_default.h index 01d83f87941..1a29ff2c17c 100644 --- a/plugins/historydata/ua_historydatabase_default.h +++ b/plugins/include/open62541/plugin/historydatabase_default.h @@ -8,9 +8,8 @@ #ifndef UA_HISTORYDATASERVICE_DEFAULT_H_ #define UA_HISTORYDATASERVICE_DEFAULT_H_ -#include "ua_server.h" -#include "ua_plugin_historydatabase.h" -#include "ua_plugin_history_data_gathering.h" +#include +#include "historydata/ua_plugin_history_data_gathering.h" _UA_BEGIN_DECLS diff --git a/plugins/ua_log_stdout.h b/plugins/include/open62541/plugin/log_stdout.h similarity index 96% rename from plugins/ua_log_stdout.h rename to plugins/include/open62541/plugin/log_stdout.h index f5fca0b349a..57ecf89f014 100644 --- a/plugins/ua_log_stdout.h +++ b/plugins/include/open62541/plugin/log_stdout.h @@ -7,7 +7,7 @@ #ifndef UA_LOG_STDOUT_H_ #define UA_LOG_STDOUT_H_ -#include "ua_plugin_log.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/ua_nodestore_default.h b/plugins/include/open62541/plugin/nodestore_default.h similarity index 93% rename from plugins/ua_nodestore_default.h rename to plugins/include/open62541/plugin/nodestore_default.h index f9c5900d281..e0a0b372239 100644 --- a/plugins/ua_nodestore_default.h +++ b/plugins/include/open62541/plugin/nodestore_default.h @@ -9,7 +9,7 @@ #ifndef UA_NODESTORE_DEFAULT_H_ #define UA_NODESTORE_DEFAULT_H_ -#include "ua_plugin_nodestore.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/ua_pki_certificate.h b/plugins/include/open62541/plugin/pki_default.h similarity index 96% rename from plugins/ua_pki_certificate.h rename to plugins/include/open62541/plugin/pki_default.h index 9ee3a49dca5..0192599268d 100644 --- a/plugins/ua_pki_certificate.h +++ b/plugins/include/open62541/plugin/pki_default.h @@ -7,7 +7,7 @@ #ifndef UA_PKI_CERTIFICATE_H_ #define UA_PKI_CERTIFICATE_H_ -#include "ua_plugin_pki.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/networking/ua_network_pubsub_ethernet.h b/plugins/include/open62541/plugin/pubsub_ethernet.h similarity index 92% rename from plugins/networking/ua_network_pubsub_ethernet.h rename to plugins/include/open62541/plugin/pubsub_ethernet.h index 5b00d0b3ebf..cbf6268343f 100644 --- a/plugins/networking/ua_network_pubsub_ethernet.h +++ b/plugins/include/open62541/plugin/pubsub_ethernet.h @@ -7,7 +7,7 @@ #ifndef UA_NETWORK_PUBSUB_ETHERNET_H_ #define UA_NETWORK_PUBSUB_ETHERNET_H_ -#include "ua_plugin_pubsub.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/networking/ua_network_pubsub_udp.h b/plugins/include/open62541/plugin/pubsub_udp.h similarity index 92% rename from plugins/networking/ua_network_pubsub_udp.h rename to plugins/include/open62541/plugin/pubsub_udp.h index 1e0a75dfa90..7c590d19492 100644 --- a/plugins/networking/ua_network_pubsub_udp.h +++ b/plugins/include/open62541/plugin/pubsub_udp.h @@ -7,7 +7,7 @@ #ifndef UA_NETWORK_UDPMC_H_ #define UA_NETWORK_UDPMC_H_ -#include "ua_plugin_pubsub.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/securityPolicies/ua_securitypolicies.h b/plugins/include/open62541/plugin/securitypolicy_default.h similarity index 97% rename from plugins/securityPolicies/ua_securitypolicies.h rename to plugins/include/open62541/plugin/securitypolicy_default.h index 196e27d0f7c..879e51764e5 100644 --- a/plugins/securityPolicies/ua_securitypolicies.h +++ b/plugins/include/open62541/plugin/securitypolicy_default.h @@ -9,7 +9,7 @@ #ifndef UA_SECURITYPOLICIES_H_ #define UA_SECURITYPOLICIES_H_ -#include "ua_plugin_securitypolicy.h" +#include _UA_BEGIN_DECLS diff --git a/plugins/ua_config_default.h b/plugins/include/open62541/server_config_default.h similarity index 85% rename from plugins/ua_config_default.h rename to plugins/include/open62541/server_config_default.h index 95c4a124194..22108e757dd 100644 --- a/plugins/ua_config_default.h +++ b/plugins/include/open62541/server_config_default.h @@ -6,12 +6,10 @@ * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB */ -#ifndef UA_CONFIG_DEFAULT_H_ -#define UA_CONFIG_DEFAULT_H_ +#ifndef UA_SERVER_CONFIG_DEFAULT_H_ +#define UA_SERVER_CONFIG_DEFAULT_H_ -#include "ua_server.h" -#include "ua_server_config.h" -#include "ua_client.h" +#include _UA_BEGIN_DECLS @@ -108,21 +106,6 @@ UA_ServerConfig_set_customHostname(UA_ServerConfig *config, UA_EXPORT void UA_ServerConfig_delete(UA_ServerConfig *config); -/*************************/ -/* Default Client Config */ -/*************************/ - -UA_StatusCode UA_EXPORT -UA_ClientConfig_setDefault(UA_ClientConfig *config); - -#ifdef UA_ENABLE_ENCRYPTION -UA_StatusCode UA_EXPORT -UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, - UA_ByteString localCertificate, UA_ByteString privateKey, - const UA_ByteString *trustList, size_t trustListSize, - const UA_ByteString *revocationList, size_t revocationListSize); -#endif - _UA_END_DECLS -#endif /* UA_CONFIG_DEFAULT_H_ */ +#endif /* UA_SERVER_CONFIG_DEFAULT_H_ */ diff --git a/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c b/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c index 8309b205fa0..f23ce77166b 100644 --- a/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c +++ b/plugins/securityPolicies/ua_securitypolicy_basic128rsa15.c @@ -5,12 +5,15 @@ * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB */ -#include "ua_types.h" -#include "ua_plugin_pki.h" -#include "ua_securitypolicies.h" -#include "ua_securitypolicy_mbedtls_common.h" -#include "ua_types_generated_handling.h" -#include "ua_util.h" + +#include + +//#include "ua_types.h" +//#include "ua_plugin_pki.h" +//#include "ua_securitypolicies.h" +//#include "ua_securitypolicy_mbedtls_common.h" +//#include "ua_types_generated_handling.h" +//#include "ua_util.h" #ifdef UA_ENABLE_ENCRYPTION diff --git a/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c b/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c index 81dd8145de5..0d99a15c087 100644 --- a/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c +++ b/plugins/securityPolicies/ua_securitypolicy_basic256sha256.c @@ -6,12 +6,15 @@ * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG */ -#include "ua_types.h" -#include "ua_plugin_pki.h" -#include "ua_securitypolicies.h" -#include "ua_securitypolicy_mbedtls_common.h" -#include "ua_types_generated_handling.h" -#include "ua_util.h" + +#include + +//#include "ua_types.h" +//#include "ua_plugin_pki.h" +//#include "ua_securitypolicies.h" +//#include "ua_securitypolicy_mbedtls_common.h" +//#include "ua_types_generated_handling.h" +//#include "ua_util.h" #ifdef UA_ENABLE_ENCRYPTION @@ -251,7 +254,7 @@ sym_verify_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, Basic256Sha256_PolicyContext *pc = (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; - + unsigned char mac[UA_SHA256_LENGTH]; mbedtls_hmac(&pc->sha256MdContext, &cc->remoteSymSigningKey, message, mac); diff --git a/plugins/securityPolicies/ua_securitypolicy_none.c b/plugins/securityPolicies/ua_securitypolicy_none.c index ae4d3a238bb..3484c62b284 100644 --- a/plugins/securityPolicies/ua_securitypolicy_none.c +++ b/plugins/securityPolicies/ua_securitypolicy_none.c @@ -5,9 +5,7 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ -#include "ua_types.h" -#include "ua_securitypolicies.h" -#include "ua_types_generated_handling.h" +#include static UA_StatusCode verify_none(const UA_SecurityPolicy *securityPolicy, diff --git a/plugins/ua_accesscontrol_default.c b/plugins/ua_accesscontrol_default.c index 9a6b080df68..583aae09849 100644 --- a/plugins/ua_accesscontrol_default.c +++ b/plugins/ua_accesscontrol_default.c @@ -5,7 +5,7 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ -#include "ua_accesscontrol_default.h" +#include /* Example access control management. Anonymous and username / password login. * The access rights are maximally permissive. */ diff --git a/plugins/ua_config_default.c b/plugins/ua_config_default.c index 40e4f00d4a3..83f07491d42 100644 --- a/plugins/ua_config_default.c +++ b/plugins/ua_config_default.c @@ -10,15 +10,14 @@ * Copyright 2018 (c) Fabian Arndt, Root-Core */ -#include "ua_config_default.h" -#include "ua_client_config.h" -#include "ua_log_stdout.h" +#include +#include +#include +#include +#include +#include +#include #include "ua_network_tcp.h" -#include "ua_accesscontrol_default.h" -#include "ua_pki_certificate.h" -#include "ua_nodestore_default.h" -#include "ua_securitypolicies.h" -#include "ua_plugin_securitypolicy.h" /* Struct initialization works across ANSI C/C99/C++ if it is done when the * variable is first declared. Assigning values to existing structs is diff --git a/plugins/ua_log_stdout.c b/plugins/ua_log_stdout.c index 4a924611792..660572d2789 100644 --- a/plugins/ua_log_stdout.c +++ b/plugins/ua_log_stdout.c @@ -6,8 +6,8 @@ */ #include -#include "ua_log_stdout.h" -#include "ua_types.h" +#include +#include #ifdef UA_ENABLE_MULTITHREADING #include diff --git a/plugins/ua_nodestore_default.c b/plugins/ua_nodestore_default.c index 43bbc80fa27..9338a4f759e 100644 --- a/plugins/ua_nodestore_default.c +++ b/plugins/ua_nodestore_default.c @@ -6,7 +6,7 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ -#include "ua_nodestore_default.h" +#include #include "ziptree.h" #ifdef UA_ENABLE_MULTITHREADING diff --git a/plugins/ua_pki_certificate.c b/plugins/ua_pki_default.c similarity index 99% rename from plugins/ua_pki_certificate.c rename to plugins/ua_pki_default.c index 750e2fa8f23..46a096523d6 100644 --- a/plugins/ua_pki_certificate.c +++ b/plugins/ua_pki_default.c @@ -4,7 +4,7 @@ * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB */ -#include "ua_pki_certificate.h" +#include #ifdef UA_ENABLE_ENCRYPTION #include diff --git a/plugins/networking/ua_network_pubsub_ethernet.c b/plugins/ua_pubsub_ethernet.c similarity index 100% rename from plugins/networking/ua_network_pubsub_ethernet.c rename to plugins/ua_pubsub_ethernet.c diff --git a/plugins/networking/ua_network_pubsub_udp.c b/plugins/ua_pubsub_udp.c similarity index 99% rename from plugins/networking/ua_network_pubsub_udp.c rename to plugins/ua_pubsub_udp.c index fb9410a0125..50c08724cf5 100644 --- a/plugins/networking/ua_network_pubsub_udp.c +++ b/plugins/ua_pubsub_udp.c @@ -6,10 +6,9 @@ * Copyright 2018 (c) Jose Cabral, fortiss GmbH */ -#include "ua_plugin_network.h" -#include "ua_network_pubsub_udp.h" -#include "ua_util.h" -#include "ua_log_stdout.h" +#include +#include +#include //UDP multicast network layer specific internal data typedef struct { diff --git a/src/client/ua_client.c b/src/client/ua_client.c index eeeaa8128e6..9115a0a48a0 100644 --- a/src/client/ua_client.c +++ b/src/client/ua_client.c @@ -20,10 +20,7 @@ #include "ua_client_internal.h" #include "ua_connection_internal.h" #include "ua_types_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_util.h" -#include "ua_securitypolicies.h" -#include "ua_pki_certificate.h" +#include #define STATUS_CODE_BAD_POINTER 0x01 diff --git a/src/client/ua_client_connect.c b/src/client/ua_client_connect.c index 943d64c7f87..7b45972a283 100644 --- a/src/client/ua_client_connect.c +++ b/src/client/ua_client_connect.c @@ -10,11 +10,10 @@ */ #include "ua_client_internal.h" -#include "ua_transport_generated.h" -#include "ua_transport_generated_handling.h" -#include "ua_transport_generated_encoding_binary.h" -#include "ua_types_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" +#include +#include +#include +#include /* Size are refered in bytes */ #define UA_MINMESSAGESIZE 8192 diff --git a/src/client/ua_client_connect_async.c b/src/client/ua_client_connect_async.c index 7f398e320c7..862e505054b 100644 --- a/src/client/ua_client_connect_async.c +++ b/src/client/ua_client_connect_async.c @@ -3,11 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ua_client_internal.h" -#include "ua_transport_generated.h" -#include "ua_transport_generated_handling.h" -#include "ua_transport_generated_encoding_binary.h" -#include "ua_types_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" +#include +#include +#include +#include #define UA_MINMESSAGESIZE 8192 #define UA_SESSION_LOCALNONCELENGTH 32 diff --git a/src/client/ua_client_highlevel.c b/src/client/ua_client_highlevel.c index 0fd2c47a200..320deb74a08 100644 --- a/src/client/ua_client_highlevel.c +++ b/src/client/ua_client_highlevel.c @@ -11,11 +11,9 @@ * Copyright 2018 (c) Peter Rustler, basyskom GmbH */ -#include "ua_client.h" #include "ua_client_internal.h" -#include "ua_client_highlevel.h" -#include "ua_client_highlevel_async.h" -#include "ua_util.h" +#include +#include UA_StatusCode UA_Client_NamespaceGetIndex(UA_Client *client, UA_String *namespaceUri, @@ -499,8 +497,8 @@ __UA_Client_HistoryRead_service(UA_Client *client, const UA_NodeId *nodeId, void *callbackContext) { UA_ByteString continuationPoint = UA_BYTESTRING_NULL; - UA_Boolean continuationAvail = UA_FALSE; - UA_Boolean fetchMore = UA_FALSE; + UA_Boolean continuationAvail = false; + UA_Boolean fetchMore = false; UA_StatusCode retval = UA_STATUSCODE_GOOD; do { @@ -608,7 +606,7 @@ UA_Client_HistoryRead_raw(UA_Client *client, const UA_NodeId *nodeId, UA_TimestampsToReturn timestampsToReturn, void *callbackContext) { return __UA_Client_HistoryRead_service_rawMod(client, nodeId, callback, startTime, endTime, indexRange, returnBounds, - numValuesPerNode, UA_FALSE, timestampsToReturn, callbackContext); + numValuesPerNode, false, timestampsToReturn, callbackContext); } #ifdef UA_ENABLE_EXPERIMENTAL_HISTORIZING @@ -620,7 +618,7 @@ UA_Client_HistoryRead_modified(UA_Client *client, const UA_NodeId *nodeId, UA_TimestampsToReturn timestampsToReturn, void *callbackContext) { return __UA_Client_HistoryRead_service_rawMod(client, nodeId, callback, startTime, endTime, indexRange, returnBounds, - maxItems, UA_TRUE, timestampsToReturn, callbackContext); + maxItems, true, timestampsToReturn, callbackContext); } #endif // UA_ENABLE_EXPERIMENTAL_HISTORIZING diff --git a/src/client/ua_client_internal.h b/src/client/ua_client_internal.h index b7d357c0018..bbb35614cd8 100644 --- a/src/client/ua_client_internal.h +++ b/src/client/ua_client_internal.h @@ -14,11 +14,12 @@ #define UA_CLIENT_INTERNAL_H_ #define UA_INTERNAL +#include +#include +#include + #include "ua_securechannel.h" #include "ua_workqueue.h" -#include "ua_client.h" -#include "ua_client_highlevel.h" -#include "ua_client_subscriptions.h" #include "ua_timer.h" #include "open62541_queue.h" diff --git a/src/client/ua_client_subscriptions.c b/src/client/ua_client_subscriptions.c index 91cd938bdc6..0f1c93b603e 100644 --- a/src/client/ua_client_subscriptions.c +++ b/src/client/ua_client_subscriptions.c @@ -11,9 +11,9 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ -#include "ua_client_highlevel.h" #include "ua_client_internal.h" -#include "ua_util.h" +#include +#include #ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ diff --git a/src/client/ua_client_worker.c b/src/client/ua_client_worker.c index e6ccf53c5da..dfae2be01e4 100644 --- a/src/client/ua_client_worker.c +++ b/src/client/ua_client_worker.c @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_util.h" -#include "ua_client.h" #include "ua_client_internal.h" static void diff --git a/src/pubsub/ua_pubsub.c b/src/pubsub/ua_pubsub.c index 958e1d9454d..c02c189e6ec 100644 --- a/src/pubsub/ua_pubsub.c +++ b/src/pubsub/ua_pubsub.c @@ -7,14 +7,10 @@ */ #include "server/ua_server_internal.h" -#include "ua_types_encoding_binary.h" #ifdef UA_ENABLE_PUBSUB /* conditional compilation */ -#include "ua_server_pubsub.h" #include "ua_pubsub.h" -#include "ua_pubsub_manager.h" -#include "ua_pubsub_networkmessage.h" #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL #include "ua_pubsub_ns0.h" diff --git a/src/pubsub/ua_pubsub.h b/src/pubsub/ua_pubsub.h index 8f90dd9d5fd..11881f839bf 100644 --- a/src/pubsub/ua_pubsub.h +++ b/src/pubsub/ua_pubsub.h @@ -8,10 +8,10 @@ #ifndef UA_PUBSUB_H_ #define UA_PUBSUB_H_ -#include "ua_plugin_pubsub.h" +#include +#include +#include #include "ua_pubsub_networkmessage.h" -#include "ua_server.h" -#include "ua_server_pubsub.h" #include "open62541_queue.h" _UA_BEGIN_DECLS diff --git a/src/pubsub/ua_pubsub_manager.h b/src/pubsub/ua_pubsub_manager.h index 2aa7b9f4baa..449aa835b92 100644 --- a/src/pubsub/ua_pubsub_manager.h +++ b/src/pubsub/ua_pubsub_manager.h @@ -8,8 +8,8 @@ #ifndef UA_PUBSUB_MANAGER_H_ #define UA_PUBSUB_MANAGER_H_ +#include #include "ua_pubsub.h" -#include "ua_server_pubsub.h" _UA_BEGIN_DECLS diff --git a/src/pubsub/ua_pubsub_networkmessage.c b/src/pubsub/ua_pubsub_networkmessage.c index e1a2e07408a..9002291d5c7 100644 --- a/src/pubsub/ua_pubsub_networkmessage.c +++ b/src/pubsub/ua_pubsub_networkmessage.c @@ -5,11 +5,8 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Tino Bischoff) */ -#include "ua_types.h" -#include "ua_types_encoding_binary.h" -#include "ua_types_generated.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_types_generated_handling.h" +#include +#include #ifdef UA_ENABLE_PUBSUB /* conditional compilation */ diff --git a/src/pubsub/ua_pubsub_networkmessage.h b/src/pubsub/ua_pubsub_networkmessage.h index 36f07b11eca..892fe8dbcff 100644 --- a/src/pubsub/ua_pubsub_networkmessage.h +++ b/src/pubsub/ua_pubsub_networkmessage.h @@ -8,8 +8,8 @@ #ifndef UA_PUBSUB_NETWORKMESSAGE_H_ #define UA_PUBSUB_NETWORKMESSAGE_H_ -#include "ua_types.h" -#include "ua_types_generated.h" +#include +#include _UA_BEGIN_DECLS diff --git a/src/pubsub/ua_pubsub_networkmessage_json.c b/src/pubsub/ua_pubsub_networkmessage_json.c index 81845b1fb22..64b69c2c135 100644 --- a/src/pubsub/ua_pubsub_networkmessage_json.c +++ b/src/pubsub/ua_pubsub_networkmessage_json.c @@ -5,8 +5,8 @@ * Copyright (c) 2019 Fraunhofer IOSB (Author: Lukas Meling) */ -#include "ua_types.h" -#include "ua_types_generated_handling.h" +#include +#include #include "ua_types_encoding_json.h" #include "ua_pubsub_networkmessage.h" diff --git a/src/pubsub/ua_pubsub_ns0.c b/src/pubsub/ua_pubsub_ns0.c index 20aee31c92f..13f5686a35d 100644 --- a/src/pubsub/ua_pubsub_ns0.c +++ b/src/pubsub/ua_pubsub_ns0.c @@ -5,14 +5,7 @@ * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated.h" -#include "ua_server_pubsub.h" -#include "ua_types.h" -#include "ua_types.h" #include "ua_pubsub_ns0.h" -#include "ua_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL /* conditional compilation */ diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h index 047d2d2841f..18aeca2ea07 100644 --- a/src/server/ua_discovery_manager.h +++ b/src/server/ua_discovery_manager.h @@ -14,7 +14,7 @@ #ifndef UA_DISCOVERY_MANAGER_H_ #define UA_DISCOVERY_MANAGER_H_ -#include "ua_server.h" +#include #include "open62541_queue.h" _UA_BEGIN_DECLS diff --git a/src/server/ua_securechannel_manager.c b/src/server/ua_securechannel_manager.c index fddcbaa4a37..2bb9454fa2c 100644 --- a/src/server/ua_securechannel_manager.c +++ b/src/server/ua_securechannel_manager.c @@ -10,10 +10,10 @@ * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB */ +#include #include "ua_securechannel_manager.h" #include "ua_session.h" #include "ua_server_internal.h" -#include "ua_transport_generated_handling.h" #define STARTCHANNELID 1 #define STARTTOKENID 1 diff --git a/src/server/ua_securechannel_manager.h b/src/server/ua_securechannel_manager.h index a9fc7b1fb52..a9c797fd390 100644 --- a/src/server/ua_securechannel_manager.h +++ b/src/server/ua_securechannel_manager.h @@ -11,8 +11,8 @@ #ifndef UA_CHANNEL_MANAGER_H_ #define UA_CHANNEL_MANAGER_H_ +#include #include "ua_util_internal.h" -#include "ua_server.h" #include "ua_workqueue.h" #include "ua_securechannel.h" #include "open62541_queue.h" diff --git a/src/server/ua_server_binary.c b/src/server/ua_server_binary.c index 939f35a8247..0bef320626a 100644 --- a/src/server/ua_server_binary.c +++ b/src/server/ua_server_binary.c @@ -15,15 +15,15 @@ * Copyright 2019 (c) Kalycito Infotech Private Limited */ +#include +#include +#include +#include +#include #include "ua_server_internal.h" #include "ua_services.h" #include "ua_securechannel_manager.h" #include "ua_session_manager.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_transport_generated.h" -#include "ua_transport_generated_handling.h" -#include "ua_transport_generated_encoding_binary.h" -#include "ua_types_generated_handling.h" #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION // store the authentication token and session ID so we can help fuzzing by setting diff --git a/src/server/ua_server_discovery.c b/src/server/ua_server_discovery.c index c8637839062..372f30e765e 100644 --- a/src/server/ua_server_discovery.c +++ b/src/server/ua_server_discovery.c @@ -6,8 +6,8 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ +#include #include "ua_server_internal.h" -#include "ua_client.h" #ifdef UA_ENABLE_DISCOVERY diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c index 947d502b071..fec97b0492b 100644 --- a/src/server/ua_server_discovery_mdns.c +++ b/src/server/ua_server_discovery_mdns.c @@ -7,7 +7,6 @@ */ #include "ua_server_internal.h" -#include "ua_util.h" #ifdef UA_ENABLE_DISCOVERY_MULTICAST diff --git a/src/server/ua_server_internal.h b/src/server/ua_server_internal.h index 3b0c02907ef..8fbb87488a4 100644 --- a/src/server/ua_server_internal.h +++ b/src/server/ua_server_internal.h @@ -14,9 +14,9 @@ #ifndef UA_SERVER_INTERNAL_H_ #define UA_SERVER_INTERNAL_H_ +#include +#include #include "ua_util_internal.h" -#include "ua_server.h" -#include "ua_server_config.h" #include "ua_timer.h" #include "ua_connection_internal.h" #include "ua_session_manager.h" diff --git a/src/server/ua_server_ns0.c b/src/server/ua_server_ns0.c index d98c1c2e992..fe24fbcd86c 100644 --- a/src/server/ua_server_ns0.c +++ b/src/server/ua_server_ns0.c @@ -11,7 +11,7 @@ */ #include "ua_server_internal.h" -#include "ua_namespace0.h" +#include "open62541/ua_namespace0.h" #include "ua_subscription.h" #include "ua_session.h" diff --git a/src/server/ua_services.h b/src/server/ua_services.h index 7a2446db49f..f98ab8d568b 100644 --- a/src/server/ua_services.h +++ b/src/server/ua_services.h @@ -15,7 +15,7 @@ #ifndef UA_SERVICES_H_ #define UA_SERVICES_H_ -#include "ua_server.h" +#include #include "ua_session.h" _UA_BEGIN_DECLS diff --git a/src/server/ua_services_attribute.c b/src/server/ua_services_attribute.c index f5010e54ae5..f01305d220a 100644 --- a/src/server/ua_services_attribute.c +++ b/src/server/ua_services_attribute.c @@ -23,7 +23,7 @@ #include "ua_services.h" #ifdef UA_ENABLE_HISTORIZING -#include "ua_plugin_historydatabase.h" +#include #endif /******************/ diff --git a/src/server/ua_services_session.c b/src/server/ua_services_session.c index 52b18877c5f..6756bee70ca 100644 --- a/src/server/ua_services_session.c +++ b/src/server/ua_services_session.c @@ -15,7 +15,6 @@ #include "ua_services.h" #include "ua_server_internal.h" #include "ua_session_manager.h" -#include "ua_types_generated_handling.h" static UA_StatusCode signCreateSessionResponse(UA_Server *server, UA_SecureChannel *channel, diff --git a/src/server/ua_session.h b/src/server/ua_session.h index cd6c4fd5c96..a8bf551a05d 100644 --- a/src/server/ua_session.h +++ b/src/server/ua_session.h @@ -8,8 +8,8 @@ #ifndef UA_SESSION_H_ #define UA_SESSION_H_ +#include #include "ua_securechannel.h" -#include "ua_util.h" _UA_BEGIN_DECLS diff --git a/src/server/ua_session_manager.h b/src/server/ua_session_manager.h index a76226fa5a6..ee22e4f344e 100644 --- a/src/server/ua_session_manager.h +++ b/src/server/ua_session_manager.h @@ -12,7 +12,7 @@ #ifndef UA_SESSION_MANAGER_H_ #define UA_SESSION_MANAGER_H_ -#include "ua_server.h" +#include #include "ua_workqueue.h" #include "ua_util_internal.h" #include "ua_session.h" diff --git a/src/server/ua_subscription.h b/src/server/ua_subscription.h index 310c6210a0a..be591674133 100644 --- a/src/server/ua_subscription.h +++ b/src/server/ua_subscription.h @@ -14,9 +14,9 @@ #ifndef UA_SUBSCRIPTION_H_ #define UA_SUBSCRIPTION_H_ +#include +#include #include "ua_util_internal.h" -#include "ua_types.h" -#include "ua_types_generated.h" #include "ua_session.h" #include "ua_workqueue.h" #include "ua_plugin_nodestore.h" diff --git a/src/ua_connection.c b/src/ua_connection.c index 05d2ad9f198..e97531c843b 100644 --- a/src/ua_connection.c +++ b/src/ua_connection.c @@ -10,12 +10,12 @@ * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB */ +#include +#include +#include #include "ua_util_internal.h" #include "ua_connection_internal.h" #include "ua_types_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_types_generated_handling.h" -#include "ua_transport_generated_encoding_binary.h" #include "ua_securechannel.h" void UA_Connection_deleteMembers(UA_Connection *connection) { diff --git a/src/ua_connection_internal.h b/src/ua_connection_internal.h index 85f25405fe3..3cef03575df 100644 --- a/src/ua_connection_internal.h +++ b/src/ua_connection_internal.h @@ -11,8 +11,8 @@ #ifndef UA_CONNECTION_INTERNAL_H_ #define UA_CONNECTION_INTERNAL_H_ -#include "ua_plugin_network.h" -#include "ua_transport_generated.h" +#include +#include _UA_BEGIN_DECLS diff --git a/src/ua_securechannel.c b/src/ua_securechannel.c index 2c6d355afc5..43c60c37f2d 100644 --- a/src/ua_securechannel.c +++ b/src/ua_securechannel.c @@ -11,14 +11,14 @@ * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB */ +#include +#include +#include +#include +#include #include "ua_util_internal.h" #include "ua_securechannel.h" #include "ua_types_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_transport_generated_encoding_binary.h" -#include "ua_types_generated_handling.h" -#include "ua_transport_generated_handling.h" -#include "ua_plugin_securitypolicy.h" #define UA_BITMASK_MESSAGETYPE 0x00ffffff #define UA_BITMASK_CHUNKTYPE 0xff000000 diff --git a/src/ua_securechannel.h b/src/ua_securechannel.h index 9560562f80c..54781f3c629 100644 --- a/src/ua_securechannel.h +++ b/src/ua_securechannel.h @@ -11,11 +11,11 @@ #ifndef UA_SECURECHANNEL_H_ #define UA_SECURECHANNEL_H_ -#include "ua_types.h" -#include "ua_transport_generated.h" +#include +#include +#include +#include #include "ua_connection_internal.h" -#include "ua_plugin_securitypolicy.h" -#include "ua_plugin_log.h" #include "open62541_queue.h" _UA_BEGIN_DECLS diff --git a/src/ua_types.c b/src/ua_types.c index 5f376ddac3e..b29e5f4ab1a 100644 --- a/src/ua_types.c +++ b/src/ua_types.c @@ -15,9 +15,9 @@ */ #include "ua_util_internal.h" -#include "ua_types.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" +#include +#include +#include #include "pcg_basic.h" #include "libc_time.h" diff --git a/src/ua_types_encoding_binary.c b/src/ua_types_encoding_binary.c index c9a5ece6b26..dcda36ad890 100644 --- a/src/ua_types_encoding_binary.c +++ b/src/ua_types_encoding_binary.c @@ -15,10 +15,10 @@ * Copyright 2017 (c) Henrik Norrman */ +#include +#include #include "ua_util_internal.h" #include "ua_types_encoding_binary.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" /** * Type Encoding and Decoding diff --git a/src/ua_types_encoding_binary.h b/src/ua_types_encoding_binary.h index d2e79078c40..0270acfee0f 100644 --- a/src/ua_types_encoding_binary.h +++ b/src/ua_types_encoding_binary.h @@ -12,7 +12,7 @@ #ifndef UA_TYPES_ENCODING_BINARY_H_ #define UA_TYPES_ENCODING_BINARY_H_ -#include "ua_types.h" +#include _UA_BEGIN_DECLS diff --git a/src/ua_types_encoding_json.c b/src/ua_types_encoding_json.c index e542a7a58f2..8b0d41c4661 100644 --- a/src/ua_types_encoding_json.c +++ b/src/ua_types_encoding_json.c @@ -8,9 +8,8 @@ #include "ua_types_encoding_json.h" #include "ua_types_encoding_binary.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_plugin_log.h" +#include +#include #include #include diff --git a/src/ua_types_encoding_json.h b/src/ua_types_encoding_json.h index 288091ddafe..9bbc48ce12d 100644 --- a/src/ua_types_encoding_json.h +++ b/src/ua_types_encoding_json.h @@ -9,15 +9,13 @@ #ifndef UA_TYPES_ENCODING_JSON_H_ #define UA_TYPES_ENCODING_JSON_H_ -#ifdef __cplusplus -extern "C" { -#endif - +#include #include "ua_util_internal.h" #include "ua_types_encoding_binary.h" #include "ua_types_encoding_json.h" -#include "ua_types.h" #include "../deps/jsmn/jsmn.h" + +_UA_BEGIN_DECLS #define TOKENCOUNT 1000 @@ -162,8 +160,6 @@ jsmntype_t getJsmnType(const ParseCtx *parseCtx); UA_StatusCode tokenize(ParseCtx *parseCtx, CtxJson *ctx, const UA_ByteString *src); UA_Boolean isJsonNull(const CtxJson *ctx, const ParseCtx *parseCtx); -#ifdef __cplusplus -} -#endif +_UA_END_DECLS #endif /* UA_TYPES_ENCODING_JSON_H_ */ diff --git a/src/ua_util.c b/src/ua_util.c index 81f17995462..43b6121cdc1 100644 --- a/src/ua_util.c +++ b/src/ua_util.c @@ -7,8 +7,8 @@ * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ -#include "ua_types_generated_handling.h" -#include "ua_util.h" +#include +#include #include "ua_util_internal.h" #include "base64.h" diff --git a/src/ua_util_internal.h b/src/ua_util_internal.h index ba89b14324d..13777748f8f 100644 --- a/src/ua_util_internal.h +++ b/src/ua_util_internal.h @@ -15,8 +15,8 @@ #define UA_UTIL_H_ #define UA_INTERNAL -#include "ua_util.h" -#include "ua_types.h" +#include +#include _UA_BEGIN_DECLS diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 89be01c9b44..e515143cd26 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,9 +47,9 @@ set(test_plugin_sources ${PROJECT_SOURCE_DIR}/arch/ua_network_tcp.c ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c - ${PROJECT_SOURCE_DIR}/plugins/ua_pki_certificate.c + ${PROJECT_SOURCE_DIR}/plugins/ua_pki_default.c ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c - ${PROJECT_SOURCE_DIR}/plugins/securityPolicies/ua_securitypolicy_none.c + ${PROJECT_SOURCE_DIR}/plugins/ua_securitypolicy_none.c ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_policy.c ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c ) diff --git a/tests/check_chunking.c b/tests/check_chunking.c index f00aaaa0d5b..a1c31a0db12 100644 --- a/tests/check_chunking.c +++ b/tests/check_chunking.c @@ -2,14 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_types.h" -#include "ua_types_encoding_binary.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_types_generated_encoding_binary.h" +#include +#include + #include "ua_securechannel.h" -#include "ua_util.h" -#include "check.h" +#include "ua_types_encoding_binary.h" UA_ByteString *buffers; size_t bufIndex; diff --git a/tests/check_securechannel.c b/tests/check_securechannel.c index ec553c01316..529c749b3c7 100644 --- a/tests/check_securechannel.c +++ b/tests/check_securechannel.c @@ -2,18 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include +#include "ua_securechannel.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "testing_networklayers.h" #include "testing_policy.h" -#include "ua_securechannel.h" #include "check.h" diff --git a/tests/check_types_builtin.c b/tests/check_types_builtin.c index 04a07303dce..9d8609b5a58 100644 --- a/tests/check_types_builtin.c +++ b/tests/check_types_builtin.c @@ -2,17 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include -#include "ua_types.h" +#include +#include +#include +#include +#include #include "ua_types_encoding_binary.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_util.h" -#include "check.h" /* copied here from encoding_binary.c */ enum UA_VARIANT_ENCODINGMASKTYPE_enum { diff --git a/tests/check_types_builtin_json.c b/tests/check_types_builtin_json.c index 7543a461f55..db82e52b016 100644 --- a/tests/check_types_builtin_json.c +++ b/tests/check_types_builtin_json.c @@ -2,18 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include #include #include #include #include -#include "ua_types.h" +#include +#include +#include +#include +#include #include "ua_types_encoding_binary.h" #include "ua_types_encoding_json.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" -#include "ua_types_generated_encoding_binary.h" -#include "ua_util.h" -#include "check.h" #if defined(_MSC_VER) # pragma warning(disable: 4146) diff --git a/tests/check_types_custom.c b/tests/check_types_custom.c index 9364c82d324..407689be471 100644 --- a/tests/check_types_custom.c +++ b/tests/check_types_custom.c @@ -2,10 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_types.h" -#include "ua_types_generated_handling.h" +#include +#include #include "ua_types_encoding_binary.h" -#include "ua_util.h" #include "check.h" #ifdef __clang__ diff --git a/tests/check_types_memory.c b/tests/check_types_memory.c index 1b30fafb60e..6418135d0f3 100644 --- a/tests/check_types_memory.c +++ b/tests/check_types_memory.c @@ -6,12 +6,11 @@ #include #include -#include "ua_types.h" -#include "ua_server.h" -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" +#include +#include +#include +#include #include "ua_types_encoding_binary.h" -#include "ua_util.h" #include "check.h" /* Define types to a dummy value if they are not available (e.g. not built with diff --git a/tests/check_types_range.c b/tests/check_types_range.c index e10b986751f..a6c3e20a514 100644 --- a/tests/check_types_range.c +++ b/tests/check_types_range.c @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_types.h" -#include "ua_types_generated_handling.h" +#include +#include #include "ua_server_internal.h" #include "check.h" diff --git a/tests/check_utils.c b/tests/check_utils.c index 5b517def346..ea5131ce5fc 100644 --- a/tests/check_utils.c +++ b/tests/check_utils.c @@ -4,9 +4,7 @@ #include -#include "ua_types.h" -#include "ua_client.h" -#include "ua_util.h" +#include #include "ua_util_internal.h" #include "check.h" diff --git a/tests/client/check_client.c b/tests/client/check_client.c index 1452f9b9e2f..a7c54f5a812 100644 --- a/tests/client/check_client.c +++ b/tests/client/check_client.c @@ -2,20 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include +#include -#include "ua_types.h" -#include "ua_server.h" +#include +#include #include "ua_server_internal.h" -#include "ua_client.h" #include "client/ua_client_internal.h" -#include "ua_config_default.h" -#include "ua_client_highlevel.h" #include "ua_network_tcp.h" #include "testing_clock.h" #include "testing_networklayers.h" -#include "check.h" #include "thread_wrapper.h" UA_Server *server; diff --git a/tests/client/check_client_async.c b/tests/client/check_client_async.c index 931af32760d..59c42b95444 100644 --- a/tests/client/check_client_async.c +++ b/tests/client/check_client_async.c @@ -4,14 +4,14 @@ #include #include +#include +#include +#include +#include +#include +#include -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" -#include "ua_client_highlevel_async.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" -#include "check.h" #include "testing_clock.h" #include "testing_networklayers.h" #include "client/ua_client_internal.h" diff --git a/tests/client/check_client_async_connect.c b/tests/client/check_client_async_connect.c index b1d1c0bd599..e87c354e845 100644 --- a/tests/client/check_client_async_connect.c +++ b/tests/client/check_client_async_connect.c @@ -2,17 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include +#include +#include +#include +#include +#include +#include -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" #include "client/ua_client_internal.h" -#include "ua_client_highlevel_async.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" -#include "check.h" #include "testing_clock.h" #include "testing_networklayers.h" #include "thread_wrapper.h" diff --git a/tests/client/check_client_highlevel.c b/tests/client/check_client_highlevel.c index 3cbccaff86b..c0ada45ba1f 100644 --- a/tests/client/check_client_highlevel.c +++ b/tests/client/check_client_highlevel.c @@ -2,12 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_server.h" -#include "ua_client.h" -#include "ua_config_default.h" -#include "ua_client_highlevel.h" +#include +#include +#include +#include +#include +#include + #include "ua_network_tcp.h" -#include "check.h" #include "thread_wrapper.h" UA_Server *server; diff --git a/tests/client/check_client_historical_data.c b/tests/client/check_client_historical_data.c index 5edabb005f9..3102184d7b5 100644 --- a/tests/client/check_client_historical_data.c +++ b/tests/client/check_client_historical_data.c @@ -5,22 +5,20 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_types.h" -#include "ua_server.h" -#include "server/ua_server_internal.h" -#include "ua_client.h" +#include +#include +#include +#include +#include +#include +#include + #include "client/ua_client_internal.h" -#include "ua_client_highlevel.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" - -#include "check.h" #include "testing_clock.h" #include "testing_networklayers.h" #include "thread_wrapper.h" -#include "ua_plugin_historydatabase.h" -#include "ua_historydatabase_default.h" -#include "ua_plugin_history_data_gathering.h" +#include "ua_plugin_history_data_backend.h" #include "ua_historydatabackend_memory.h" #include "ua_historydatagathering_default.h" #ifdef UA_ENABLE_HISTORIZING @@ -28,7 +26,6 @@ #endif #include - static UA_Server *server; static UA_ServerConfig *config; #ifdef UA_ENABLE_HISTORIZING diff --git a/tests/client/check_client_securechannel.c b/tests/client/check_client_securechannel.c index 50d47511b4d..2ce183ed4d9 100644 --- a/tests/client/check_client_securechannel.c +++ b/tests/client/check_client_securechannel.c @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" +#include +#include +#include +#include +#include #include "client/ua_client_internal.h" -#include "ua_config_default.h" -#include "ua_client_highlevel.h" #include "ua_network_tcp.h" #include "testing_clock.h" #include "testing_networklayers.h" diff --git a/tests/client/check_client_subscriptions.c b/tests/client/check_client_subscriptions.c index 4031509ceb5..f66a75c983c 100644 --- a/tests/client/check_client_subscriptions.c +++ b/tests/client/check_client_subscriptions.c @@ -4,12 +4,11 @@ #include #include -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" +#include +#include +#include +#include #include "client/ua_client_internal.h" -#include "ua_client_highlevel.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" #include "check.h" diff --git a/tests/client/historical_read_test_data.h b/tests/client/historical_read_test_data.h index 012d9a9c181..4454cd19073 100644 --- a/tests/client/historical_read_test_data.h +++ b/tests/client/historical_read_test_data.h @@ -11,7 +11,7 @@ #ifndef UA_HISTORICAL_READ_TEST_DATA_H_ #define UA_HISTORICAL_READ_TEST_DATA_H_ -#include "ua_types.h" +#include #include #define TESTDATA_START_TIME 1 diff --git a/tests/encryption/certificates.h b/tests/encryption/certificates.h index 022864ba47a..11d226c7ed4 100644 --- a/tests/encryption/certificates.h +++ b/tests/encryption/certificates.h @@ -1,11 +1,9 @@ #ifndef CERTIFICATES_H_ #define CERTIFICATES_H_ -#ifdef __cplusplus -extern "C" { -#endif +#include -#include "ua_types.h" +_UA_BEGIN_DECLS #define KEY_DER_LENGTH 1193 UA_Byte KEY_DER_DATA[1193] = { @@ -151,8 +149,6 @@ UA_Byte CERT_DER_DATA[968] = { 0xda, 0x31, 0x3e, 0xd2, 0x8c, 0xfe, 0xd7, 0x51 }; -#ifdef __cplusplus -} // extern "C" -#endif +_UA_END_DECLS #endif /* CERTIFICATES_H_ */ diff --git a/tests/encryption/check_encryption_basic128rsa15.c b/tests/encryption/check_encryption_basic128rsa15.c index 604b28b7980..816cf679475 100644 --- a/tests/encryption/check_encryption_basic128rsa15.c +++ b/tests/encryption/check_encryption_basic128rsa15.c @@ -4,16 +4,13 @@ #include #include -#include "check.h" +#include -#include "ua_types.h" -#include "ua_server.h" #include "ua_server_internal.h" -#include "ua_client.h" #include "client/ua_client_internal.h" -#include "ua_securitypolicies.h" -#include "ua_config_default.h" -#include "ua_client_highlevel.h" +#include +#include +#include #include "ua_network_tcp.h" #include "testing_clock.h" #include "testing_networklayers.h" diff --git a/tests/encryption/check_encryption_basic256sha256.c b/tests/encryption/check_encryption_basic256sha256.c index 6bd8553e077..19962a28580 100644 --- a/tests/encryption/check_encryption_basic256sha256.c +++ b/tests/encryption/check_encryption_basic256sha256.c @@ -6,14 +6,15 @@ #include #include "check.h" -#include "ua_types.h" -#include "ua_server.h" +#include +#include +#include +#include +#include +#include + #include "ua_server_internal.h" -#include "ua_client.h" #include "client/ua_client_internal.h" -#include "ua_securitypolicies.h" -#include "ua_config_default.h" -#include "ua_client_highlevel.h" #include "ua_network_tcp.h" #include "testing_clock.h" #include "testing_networklayers.h" diff --git a/tests/fuzz/corpus_generator.c b/tests/fuzz/corpus_generator.c index 32757052105..c100e1cf741 100644 --- a/tests/fuzz/corpus_generator.c +++ b/tests/fuzz/corpus_generator.c @@ -17,17 +17,17 @@ #include #include #include -#include #include #include #include #include #include -#include -#include -#include - -#include "ua_config_default.h" +#include +#include +#include +#include +#include +#include "client/ua_client_internal.h" UA_Server *server; UA_ServerConfig *config; diff --git a/tests/fuzz/custom_memory_manager.h b/tests/fuzz/custom_memory_manager.h index 78364a59681..89c03473145 100644 --- a/tests/fuzz/custom_memory_manager.h +++ b/tests/fuzz/custom_memory_manager.h @@ -8,8 +8,7 @@ #ifndef OPEN62541_CUSTOM_MEMORY_MANAGER_H #define OPEN62541_CUSTOM_MEMORY_MANAGER_H - -#include "ua_types.h" +#include _UA_BEGIN_DECLS @@ -34,4 +33,4 @@ int UA_EXPORT UA_memoryManager_setLimitFromLast4Bytes(const uint8_t *data, size_ _UA_END_DECLS -#endif //OPEN62541_CUSTOM_MEMORY_MANAGER_H +#endif /* OPEN62541_CUSTOM_MEMORY_MANAGER_H */ diff --git a/tests/fuzz/ua_debug_dump_pkgs_file.c b/tests/fuzz/ua_debug_dump_pkgs_file.c index 33342171720..4a8820aad69 100644 --- a/tests/fuzz/ua_debug_dump_pkgs_file.c +++ b/tests/fuzz/ua_debug_dump_pkgs_file.c @@ -14,12 +14,12 @@ #include #include -#include -#include #include +#include +#include "server/ua_server_internal.h" -#include "ua_transport_generated_encoding_binary.h" -#include "ua_types_generated_encoding_binary.h" +#include +#include // This number is added to the end of every corpus data as 4 bytes. // It allows to generate valid corpus and then the fuzzer will use diff --git a/tests/pubsub/check_pubsub_connection_udp.c b/tests/pubsub/check_pubsub_connection_udp.c index 01f99a56775..2dcfe52f870 100644 --- a/tests/pubsub/check_pubsub_connection_udp.c +++ b/tests/pubsub/check_pubsub_connection_udp.c @@ -5,12 +5,12 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" +#include +#include +#include +#include +#include #include "ua_server_internal.h" -#include "check.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/pubsub/check_pubsub_encoding.c b/tests/pubsub/check_pubsub_encoding.c index 2631800ecf8..10273ef4ffc 100644 --- a/tests/pubsub/check_pubsub_encoding.c +++ b/tests/pubsub/check_pubsub_encoding.c @@ -5,9 +5,8 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Tino Bischoff) */ -#include "ua_types.h" -#include "ua_client.h" -#include "ua_util.h" +#include +#include #include "ua_pubsub_networkmessage.h" #include "check.h" diff --git a/tests/pubsub/check_pubsub_encoding_json.c b/tests/pubsub/check_pubsub_encoding_json.c index 19adc9a3fb7..0f5881bc80a 100644 --- a/tests/pubsub/check_pubsub_encoding_json.c +++ b/tests/pubsub/check_pubsub_encoding_json.c @@ -5,11 +5,11 @@ * Copyright (c) 2018 Fraunhofer IOSB (Author: Lukas Meling) */ -#include "ua_types.h" -#include "ua_client.h" -#include "ua_util.h" +#include +#include +#include +#include #include "ua_pubsub_networkmessage.h" -#include "check.h" START_TEST(UA_PubSub_EncodeAllOptionalFields) { UA_NetworkMessage m; diff --git a/tests/pubsub/check_pubsub_multiple_layer.c b/tests/pubsub/check_pubsub_multiple_layer.c index 1dd2f00002f..e3152c8394b 100644 --- a/tests/pubsub/check_pubsub_multiple_layer.c +++ b/tests/pubsub/check_pubsub_multiple_layer.c @@ -5,15 +5,12 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_types.h" -#include "ua_pubsub.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" +#include +#include +#include +#include "open62541/types_generated_encoding_binary.h" +#include #include "ua_server_internal.h" -#include "check.h" -#include "stdio.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/pubsub/check_pubsub_pds.c b/tests/pubsub/check_pubsub_pds.c index 39514a8a440..c49fa8778fa 100644 --- a/tests/pubsub/check_pubsub_pds.c +++ b/tests/pubsub/check_pubsub_pds.c @@ -5,13 +5,12 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_types.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" +#include +#include +#include +#include +#include "open62541/types_generated_encoding_binary.h" #include "ua_server_internal.h" -#include "check.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/pubsub/check_pubsub_publish.c b/tests/pubsub/check_pubsub_publish.c index dc3abbb8847..eda6f9a5b39 100644 --- a/tests/pubsub/check_pubsub_publish.c +++ b/tests/pubsub/check_pubsub_publish.c @@ -5,15 +5,14 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_types.h" +#include +#include +#include +#include + +#include "open62541/types_generated_encoding_binary.h" #include "ua_pubsub.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" #include "ua_server_internal.h" -#include "check.h" -#include "stdio.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/pubsub/check_pubsub_publish_json.c b/tests/pubsub/check_pubsub_publish_json.c index 61af2cd091e..0bc11dddc3b 100644 --- a/tests/pubsub/check_pubsub_publish_json.c +++ b/tests/pubsub/check_pubsub_publish_json.c @@ -5,15 +5,14 @@ * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Andreas Ebner) */ -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_types.h" +#include +#include +#include +#include +#include +#include #include "ua_pubsub.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" #include "ua_server_internal.h" -#include "check.h" -#include "stdio.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/pubsub/check_pubsub_publishspeed.c b/tests/pubsub/check_pubsub_publishspeed.c index b2dc97169d9..56dcd6e6531 100644 --- a/tests/pubsub/check_pubsub_publishspeed.c +++ b/tests/pubsub/check_pubsub_publishspeed.c @@ -9,12 +9,10 @@ #include #include -#include "ua_server_pubsub.h" -#include "src_generated/ua_types_generated_encoding_binary.h" -#include "ua_types.h" -#include "ua_pubsub.h" -#include "ua_config_default.h" -#include "ua_network_pubsub_udp.h" +#include +#include +#include +#include #include "ua_server_internal.h" UA_Server *server = NULL; diff --git a/tests/server/check_accesscontrol.c b/tests/server/check_accesscontrol.c index 10b4f1feb23..880edea4f73 100644 --- a/tests/server/check_accesscontrol.c +++ b/tests/server/check_accesscontrol.c @@ -2,13 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include - -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" -#include "ua_config_default.h" -#include "check.h" +#include +#include +#include +#include +#include +#include #include "thread_wrapper.h" diff --git a/tests/server/check_discovery.c b/tests/server/check_discovery.c index 926c73c6f4d..e4761185959 100644 --- a/tests/server/check_discovery.c +++ b/tests/server/check_discovery.c @@ -2,9 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include +#include #include "server/ua_server_internal.h" -#include "ua_client.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" #include "testing_clock.h" #include "thread_wrapper.h" diff --git a/tests/server/check_local_monitored_item.c b/tests/server/check_local_monitored_item.c index e04427ec921..10cee3d1f16 100644 --- a/tests/server/check_local_monitored_item.c +++ b/tests/server/check_local_monitored_item.c @@ -5,10 +5,10 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client_subscriptions.h" -#include "ua_config_default.h" +#include +#include +#include +#include #include "ua_network_tcp.h" #include "check.h" diff --git a/tests/server/check_monitoreditem_filter.c b/tests/server/check_monitoreditem_filter.c index b52394512ae..57605fd016c 100644 --- a/tests/server/check_monitoreditem_filter.c +++ b/tests/server/check_monitoreditem_filter.c @@ -5,15 +5,16 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_types.h" -#include "ua_server.h" -#include "ua_client.h" +#include +#include +#include +#include +#include +#include + #include "client/ua_client_internal.h" -#include "ua_client_highlevel.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" -#include "check.h" #include "testing_clock.h" #include "testing_networklayers.h" #include "thread_wrapper.h" diff --git a/tests/server/check_node_inheritance.c b/tests/server/check_node_inheritance.c index dfa2d2b9832..93a7d0611b2 100644 --- a/tests/server/check_node_inheritance.c +++ b/tests/server/check_node_inheritance.c @@ -2,11 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_server.h" +#include +#include #include "server/ua_server_internal.h" -#include "ua_config_default.h" - -#include "check.h" UA_Server *server = NULL; UA_ServerConfig *config = NULL; diff --git a/tests/server/check_nodestore.c b/tests/server/check_nodestore.c index 76b1095921e..9d7cd61ac02 100644 --- a/tests/server/check_nodestore.c +++ b/tests/server/check_nodestore.c @@ -6,10 +6,9 @@ #include #include -#include "ua_types.h" -#include "ua_plugin_nodestore.h" -#include "ua_nodestore_default.h" -#include "ua_util.h" +#include +#include +#include #include "ziptree.h" #include "check.h" diff --git a/tests/server/check_server_historical_data.c b/tests/server/check_server_historical_data.c index 8f160896137..433927e0289 100644 --- a/tests/server/check_server_historical_data.c +++ b/tests/server/check_server_historical_data.c @@ -5,21 +5,21 @@ * Copyright 2018 (c) basysKom GmbH (Author: Peter Rustler) */ -#include "ua_types.h" -#include "ua_server.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "server/ua_server_internal.h" -#include "ua_client.h" #include "client/ua_client_internal.h" -#include "ua_client_highlevel.h" -#include "ua_config_default.h" #include "ua_network_tcp.h" - -#include "check.h" #include "testing_clock.h" #include "testing_networklayers.h" #include "thread_wrapper.h" -#include "ua_plugin_historydatabase.h" -#include "ua_historydatabase_default.h" #include "ua_plugin_history_data_gathering.h" #include "ua_historydatabackend_memory.h" #include "ua_historydatagathering_default.h" diff --git a/tests/server/check_server_jobs.c b/tests/server/check_server_jobs.c index bfd9009b59f..fcd741a363f 100644 --- a/tests/server/check_server_jobs.c +++ b/tests/server/check_server_jobs.c @@ -2,11 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_server.h" -#include "server/ua_server_internal.h" -#include "ua_config_default.h" +#include +#include -#include "check.h" +#include "server/ua_server_internal.h" #include "testing_clock.h" UA_Server *server = NULL; diff --git a/tests/server/check_server_monitoringspeed.c b/tests/server/check_server_monitoringspeed.c index ef4ddb3162d..6918646a1a3 100644 --- a/tests/server/check_server_monitoringspeed.c +++ b/tests/server/check_server_monitoringspeed.c @@ -8,9 +8,8 @@ #include #include -#include "ua_server.h" +#include #include "ua_server_internal.h" -#include "ua_config_default.h" #include "server/ua_subscription.h" #include "testing_networklayers.h" diff --git a/tests/server/check_server_readspeed.c b/tests/server/check_server_readspeed.c index 1357dbf2ed5..ccb3119b695 100644 --- a/tests/server/check_server_readspeed.c +++ b/tests/server/check_server_readspeed.c @@ -5,12 +5,10 @@ not open a TCP port. */ #include -#include #include -#include "ua_server.h" +#include #include "ua_server_internal.h" -#include "ua_config_default.h" #include "server/ua_services.h" #include "ua_types_encoding_binary.h" diff --git a/tests/server/check_server_userspace.c b/tests/server/check_server_userspace.c index f17fa4c9a71..b4c61a2104f 100644 --- a/tests/server/check_server_userspace.c +++ b/tests/server/check_server_userspace.c @@ -2,12 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include - -#include "ua_types.h" -#include "ua_config_default.h" -#include "check.h" +#include +#include +#include #ifdef __clang__ //required for ck_assert_ptr_eq and const casting diff --git a/tests/server/check_services_attributes.c b/tests/server/check_services_attributes.c index d7b3c62abf9..e37d522167d 100644 --- a/tests/server/check_services_attributes.c +++ b/tests/server/check_services_attributes.c @@ -5,12 +5,10 @@ #include #include #include +#include +#include -#include "check.h" #include "server/ua_services.h" -#include "ua_client.h" -#include "ua_types.h" -#include "ua_config_default.h" #include "server/ua_server_internal.h" #ifdef __clang__ diff --git a/tests/server/check_services_nodemanagement.c b/tests/server/check_services_nodemanagement.c index d654e245850..5b8544fe765 100644 --- a/tests/server/check_services_nodemanagement.c +++ b/tests/server/check_services_nodemanagement.c @@ -5,13 +5,11 @@ #include #include #include +#include -#include "check.h" -#include "server/ua_services.h" -#include "ua_client.h" -#include "ua_types.h" -#include "ua_config_default.h" #include "server/ua_server_internal.h" +#include +#include "server/ua_services.h" static UA_Server *server = NULL; static UA_ServerConfig *config = NULL; diff --git a/tests/server/check_services_subscriptions.c b/tests/server/check_services_subscriptions.c index 63fe4320f07..f80eef9d21f 100644 --- a/tests/server/check_services_subscriptions.c +++ b/tests/server/check_services_subscriptions.c @@ -2,13 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_server.h" +#include +#include +#include #include "server/ua_services.h" #include "server/ua_server_internal.h" #include "server/ua_subscription.h" -#include "ua_config_default.h" -#include "check.h" #include "testing_clock.h" static UA_Server *server = NULL; diff --git a/tests/server/check_services_view.c b/tests/server/check_services_view.c index d03a132399c..56b6f2ace14 100644 --- a/tests/server/check_services_view.c +++ b/tests/server/check_services_view.c @@ -4,11 +4,12 @@ #include #include -#include +#include +#include +#include +#include -#include "check.h" -#include "ua_server.h" -#include "ua_config_default.h" +#include "server/ua_server_internal.h" #include "ua_network_tcp.h" #include "thread_wrapper.h" diff --git a/tests/server/check_session.c b/tests/server/check_session.c index 849d9f77e69..bb5177a76fa 100644 --- a/tests/server/check_session.c +++ b/tests/server/check_session.c @@ -5,7 +5,7 @@ #include #include -#include "ua_types.h" +#include #include "server/ua_services.h" #include "check.h" diff --git a/tests/server/check_subscription_events.c b/tests/server/check_subscription_events.c index b068b9217dc..4fea07b5989 100644 --- a/tests/server/check_subscription_events.c +++ b/tests/server/check_subscription_events.c @@ -2,15 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "ua_client_subscriptions.h" -#include "ua_server.h" +#include +#include +#include +#include + #include "server/ua_services.h" #include "server/ua_server_internal.h" #include "server/ua_subscription.h" -#include "ua_config_default.h" #include "thread_wrapper.h" -#include "check.h" #include "testing_clock.h" #ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS diff --git a/tests/server/historical_read_test_data.h b/tests/server/historical_read_test_data.h index 53d2c9d007f..35f696730a8 100644 --- a/tests/server/historical_read_test_data.h +++ b/tests/server/historical_read_test_data.h @@ -11,7 +11,7 @@ #ifndef UA_HISTORICAL_READ_TEST_DATA_H_ #define UA_HISTORICAL_READ_TEST_DATA_H_ -#include "ua_types.h" +#include #include typedef struct { diff --git a/tests/testing-plugins/testing_clock.h b/tests/testing-plugins/testing_clock.h index e0e5fad1637..e0c542481b6 100644 --- a/tests/testing-plugins/testing_clock.h +++ b/tests/testing-plugins/testing_clock.h @@ -5,11 +5,7 @@ #ifndef TESTING_CLOCK_H_ #define TESTING_CLOCK_H_ -#include "ua_types.h" - -/** - * Simulate the system clock - * ------------------------- */ +#include /* The testing clock is used for reproducible unit tests that require precise * timings. It implements the following functions from ua_types.h. They return a diff --git a/tests/testing-plugins/testing_networklayers.c b/tests/testing-plugins/testing_networklayers.c index b8289aec9c6..e116cbd74e2 100644 --- a/tests/testing-plugins/testing_networklayers.c +++ b/tests/testing-plugins/testing_networklayers.c @@ -6,7 +6,7 @@ #include #include "testing_networklayers.h" #include "testing_clock.h" -#include "ua_config_default.h" +#include static UA_ByteString *vBuffer; static UA_ByteString sendBuffer; diff --git a/tests/testing-plugins/testing_networklayers.h b/tests/testing-plugins/testing_networklayers.h index 13dd4076f4c..8746550a877 100644 --- a/tests/testing-plugins/testing_networklayers.h +++ b/tests/testing-plugins/testing_networklayers.h @@ -5,11 +5,9 @@ #ifndef TESTING_NETWORKLAYERS_H_ #define TESTING_NETWORKLAYERS_H_ -#include "ua_server_config.h" +#include -#ifdef __cplusplus -extern "C" { -#endif +_UA_BEGIN_DECLS /** * Create the TCP networklayer and listen to the specified port @@ -21,10 +19,6 @@ extern "C" { UA_Connection createDummyConnection(size_t sendBufferSize, UA_ByteString *verificationBuffer); -/** - * Simulate network timing conditions - * ---------------------------------- */ - extern UA_UInt32 UA_Client_recvSleepDuration; extern UA_StatusCode (*UA_Client_recv)(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout); @@ -38,8 +32,6 @@ UA_StatusCode UA_Client_recvTesting(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout); -#ifdef __cplusplus -} -#endif +_UA_END_DECLS #endif /* TESTING_NETWORKLAYERS_H_ */ diff --git a/tests/testing-plugins/testing_policy.c b/tests/testing-plugins/testing_policy.c index b12bf226fa7..e1fbaf95ae0 100644 --- a/tests/testing-plugins/testing_policy.c +++ b/tests/testing-plugins/testing_policy.c @@ -4,13 +4,9 @@ #ifndef __clang_analyzer__ -#include -#include "ua_types.h" -#include "ua_plugin_securitypolicy.h" -#include "ua_log_stdout.h" -#include "ua_types_generated_handling.h" +#include +#include #include "testing_policy.h" -#include "check.h" #define SET_CALLED(func) funcsCalled->func = true diff --git a/tests/testing-plugins/testing_policy.h b/tests/testing-plugins/testing_policy.h index 805daa3c594..31ff8bf6f4c 100644 --- a/tests/testing-plugins/testing_policy.h +++ b/tests/testing-plugins/testing_policy.h @@ -5,12 +5,10 @@ #ifndef OPEN62541_TESTING_POLICY_H #define OPEN62541_TESTING_POLICY_H -#ifdef __cplusplus -extern "C" { -#endif +#include +#include -#include "ua_plugin_securitypolicy.h" -#include "ua_plugin_log.h" +_UA_BEGIN_DECLS typedef struct funcs_called { UA_Boolean asym_enc; @@ -58,8 +56,6 @@ UA_StatusCode UA_EXPORT TestingPolicy(UA_SecurityPolicy *policy, UA_ByteString localCertificate, funcs_called *fCalled, const key_sizes *kSizes); -#ifdef __cplusplus -} -#endif +_UA_END_DECLS #endif //OPEN62541_TESTING_POLICY_H diff --git a/tools/cmake/macros_public.cmake b/tools/cmake/macros_public.cmake index b73acc649da..c68f90020dd 100644 --- a/tools/cmake/macros_public.cmake +++ b/tools/cmake/macros_public.cmake @@ -32,7 +32,7 @@ function(ua_generate_nodeid_header) # Set default value for output dir if(NOT UA_GEN_ID_OUTPUT_DIR OR "${UA_GEN_ID_OUTPUT_DIR}" STREQUAL "") - set(UA_GEN_ID_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated) + set(UA_GEN_ID_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated/open62541) endif() # Set default target prefix if(NOT UA_GEN_ID_TARGET_PREFIX OR "${UA_GEN_ID_TARGET_PREFIX}" STREQUAL "") @@ -43,8 +43,8 @@ function(ua_generate_nodeid_header) add_custom_target(${UA_GEN_ID_TARGET_PREFIX}-${UA_GEN_ID_TARGET_SUFFIX} DEPENDS ${UA_GEN_ID_OUTPUT_DIR}/${UA_GEN_ID_NAME}.h ) - - # Make sure that the output directory exists + + # Make sure that the output directory exists if(NOT EXISTS ${UA_GEN_ID_OUTPUT_DIR}) file(MAKE_DIRECTORY ${UA_GEN_ID_OUTPUT_DIR}) endif() @@ -129,14 +129,13 @@ function(ua_generate_datatypes) # Set default value for output dir if(NOT UA_GEN_DT_OUTPUT_DIR OR "${UA_GEN_DT_OUTPUT_DIR}" STREQUAL "") - set(UA_GEN_DT_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated) + set(UA_GEN_DT_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated/open62541) endif() # Set default target prefix if(NOT UA_GEN_DT_TARGET_PREFIX OR "${UA_GEN_DT_TARGET_PREFIX}" STREQUAL "") set(UA_GEN_DT_TARGET_PREFIX "open62541-generator") endif() - # ------ Add custom command and target ----- set(UA_GEN_DT_NO_BUILTIN "--no-builtin") @@ -149,7 +148,6 @@ function(ua_generate_datatypes) set(UA_GEN_DT_INTERNAL_ARG "--internal") endif() - set(SELECTED_TYPES_TMP "") foreach(f ${UA_GEN_DT_FILES_SELECTED}) set(SELECTED_TYPES_TMP ${SELECTED_TYPES_TMP} "--selected-types=${f}") @@ -159,8 +157,8 @@ function(ua_generate_datatypes) foreach(f ${UA_GEN_DT_FILES_BSD}) set(BSD_FILES_TMP ${BSD_FILES_TMP} "--type-bsd=${f}") endforeach() - - # Make sure that the output directory exists + + # Make sure that the output directory exists if(NOT EXISTS ${UA_GEN_DT_OUTPUT_DIR}) file(MAKE_DIRECTORY ${UA_GEN_DT_OUTPUT_DIR}) endif() @@ -257,7 +255,7 @@ function(ua_generate_nodeset) # Set default value for output dir if(NOT UA_GEN_NS_OUTPUT_DIR OR "${UA_GEN_NS_OUTPUT_DIR}" STREQUAL "") - set(UA_GEN_NS_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated) + set(UA_GEN_NS_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated/open62541) endif() # Set default target prefix @@ -310,8 +308,8 @@ function(ua_generate_nodeset) foreach(f ${UA_GEN_NS_FILE}) set(FILE_LIST ${FILE_LIST} "--xml=${f}") endforeach() - - # Make sure that the output directory exists + + # Make sure that the output directory exists if(NOT EXISTS ${UA_GEN_NS_OUTPUT_DIR}) file(MAKE_DIRECTORY ${UA_GEN_NS_OUTPUT_DIR}) endif() @@ -450,7 +448,7 @@ function(ua_generate_nodeset_and_datatypes) # Set default value for output dir if(NOT UA_GEN_OUTPUT_DIR OR "${UA_GEN_OUTPUT_DIR}" STREQUAL "") - set(UA_GEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated) + set(UA_GEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/src_generated/open62541) endif() # Set default target prefix if(NOT UA_GEN_TARGET_PREFIX OR "${UA_GEN_TARGET_PREFIX}" STREQUAL "") diff --git a/tools/generate_datatypes.py b/tools/generate_datatypes.py index 3c8a2e6bbc8..b75362721b9 100755 --- a/tools/generate_datatypes.py +++ b/tools/generate_datatypes.py @@ -107,7 +107,7 @@ def __init__(self, outname, xml, namespace): self.name = None if xml is not None: self.name = xml.get("Name") - self.typeIndex = makeCIdentifier(outname.upper() + "_" + self.name.upper()) + self.typeIndex = "UA_" + makeCIdentifier(outname.upper() + "_" + self.name.upper()) else: self.typeIndex = makeCIdentifier(outname.upper()) self.ns0 = ("true" if namespace == 0 else "false") @@ -161,7 +161,7 @@ def members_c(self): if len(memberName) > 0: memberNameCapital = memberName[0].upper() + memberName[1:] m = "\n{\n UA_TYPENAME(\"%s\") /* .memberName */\n" % memberNameCapital - m += " %s_%s, /* .memberTypeIndex */\n" % (member.memberType.outname.upper(), makeCIdentifier(member.memberType.name.upper())) + m += " UA_%s_%s, /* .memberTypeIndex */\n" % (member.memberType.outname.upper(), makeCIdentifier(member.memberType.name.upper())) m += " " if not before: m += "0," @@ -185,7 +185,7 @@ def members_c(self): return members + "};" def datatype_ptr(self): - return "&" + self.outname.upper() + "[" + makeCIdentifier(self.outname.upper() + "_" + self.name.upper()) + "]" + return "&UA_" + self.outname.upper() + "[UA_" + makeCIdentifier(self.outname.upper() + "_" + self.name.upper()) + "]" def functions_c(self): idName = makeCIdentifier(self.name) @@ -220,7 +220,7 @@ def __init__(self, name): self.name = name self.ns0 = "true" self.typeIndex = makeCIdentifier("UA_TYPES_" + self.name.upper()) - self.outname = "ua_types" + self.outname = "types" self.kind = "UA_DATATYPEKIND_" + self.name.upper() self.description = "" self.pointerfree = "false" @@ -570,8 +570,8 @@ def iter_types(v): #ifdef UA_ENABLE_AMALGAMATION #include "open62541.h" #else -#include "ua_types.h" -''' + ('#include "ua_types_generated.h"\n' if outname != "ua_types" else '') + ''' +#include +''' + ('#include \n' if outname != "types" else '') + ''' #endif _UA_BEGIN_DECLS @@ -584,8 +584,8 @@ def iter_types(v): * Every type is assigned an index in an array containing the type descriptions. * These descriptions are used during type handling (copying, deletion, * binary encoding, ...). */''') -printh("#define " + outname.upper() + "_COUNT %s" % (str(len(filtered_types)))) -printh("extern UA_EXPORT const UA_DataType " + outname.upper() + "[" + outname.upper() + "_COUNT];") +printh("#define UA_" + outname.upper() + "_COUNT %s" % (str(len(filtered_types)))) +printh("extern UA_EXPORT const UA_DataType UA_" + outname.upper() + "[UA_" + outname.upper() + "_COUNT];") for i, t in enumerate(filtered_types): printh("\n/**\n * " + t.name) @@ -596,7 +596,7 @@ def iter_types(v): printh(" * " + t.description + " */") if type(t) != BuiltinType: printh(t.typedef_h() + "\n") - printh("#define " + makeCIdentifier(outname.upper() + "_" + t.name.upper()) + " " + str(i)) + printh("#define UA_" + makeCIdentifier(outname.upper() + "_" + t.name.upper()) + " " + str(i)) printh(''' @@ -615,7 +615,7 @@ def iter_types(v): #ifndef ''' + outname.upper() + '''_GENERATED_HANDLING_H_ #define ''' + outname.upper() + '''_GENERATED_HANDLING_H_ -#include "''' + outname + '''_generated.h" +#include "''' + args.outfile + '''_generated.h" _UA_BEGIN_DECLS @@ -647,14 +647,14 @@ def iter_types(v): * on host ''' + platform.uname()[1] + ''' by user ''' + getpass.getuser() + \ ''' at ''' + time.strftime("%Y-%m-%d %I:%M:%S") + ''' */ -#include "''' + outname + '''_generated.h"''') +#include "''' + args.outfile + '''_generated.h"''') for t in filtered_types: printc("") printc("/* " + t.name + " */") printc(t.members_c()) -printc("const UA_DataType %s[%s_COUNT] = {" % (outname.upper(), outname.upper())) +printc("const UA_DataType UA_%s[UA_%s_COUNT] = {" % (outname.upper(), outname.upper())) for t in filtered_types: printc("/* " + t.name + " */") printc(t.datatype_c() + ",") @@ -672,7 +672,7 @@ def iter_types(v): # include "open62541.h" #else # include "ua_types_encoding_binary.h" -# include "''' + outname + '''_generated.h" +# include "''' + args.outfile + '''_generated.h" #endif ''') diff --git a/tools/generate_statuscode_descriptions.py b/tools/generate_statuscode_descriptions.py index 0adefeb7c09..8a566e4863e 100755 --- a/tools/generate_statuscode_descriptions.py +++ b/tools/generate_statuscode_descriptions.py @@ -64,7 +64,7 @@ def printc(string): * Generated from %s with script %s *********************************************************/ -#include "ua_types.h"''' % (args.statuscodes, sys.argv[0])) +#include ''' % (args.statuscodes, sys.argv[0])) count = 2 + len(rows) diff --git a/tools/nodeset_compiler/backend_open62541.py b/tools/nodeset_compiler/backend_open62541.py index 04e1567d7b2..7fd30bbdf5a 100644 --- a/tools/nodeset_compiler/backend_open62541.py +++ b/tools/nodeset_compiler/backend_open62541.py @@ -188,7 +188,7 @@ def writec(line): # endif // UA_Nodestore_remove #else // UA_ENABLE_AMALGAMATION -# include "ua_server.h" +# include #endif %s @@ -198,7 +198,7 @@ def writec(line): #ifdef UA_ENABLE_AMALGAMATION # include "open62541.h" #else -# include "ua_server.h" +# include #endif %s """ % (additionalHeaders)) diff --git a/tools/ua2json/ua2json.c b/tools/ua2json/ua2json.c index 59559a2c549..def81e548c0 100644 --- a/tools/ua2json/ua2json.c +++ b/tools/ua2json/ua2json.c @@ -19,11 +19,11 @@ #endif #include -#include +#include /* Internal headers */ -#include "ua_types_generated.h" -#include "ua_types_generated_handling.h" +#include +#include #include "ua_types_encoding_binary.h" #include "ua_types_encoding_json.h" #include "ua_pubsub_networkmessage.h"