diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6e4c3eab7d7535a881784596ed10fe0a0996b409 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +*~ +*-dev +modules.order +Module.symvers +Mkfile.old +core.* +#* +.#* +\#* +*.local +\#* +.cvsignore +*_old/ +*PVs.list +*-loc/*.Makefile +dtlskid/*.Makefile +.vscode +cellMods/ +testMods*/ +test/__pycache__ +test/server/xml/*.c +test/server/xml/*.h +test/server/opcuaTestServer diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..6e4e072f746a17d09db86c5bf09a665e89315261 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,70 @@ +include: + - 'https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/E3ModuleBuild.gitlab-ci.yml' + - 'https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/PreCommit.gitlab-ci.yml' + +default: + image: registry.esss.lu.se/ics-docker/centos-e3:0.2.0 + +stages: + - check + - build + - test + - deploy + +build-test-server: + stage: build + image: registry.esss.lu.se/ics-docker/centos-dev + script: + - cd test/server + - make + artifacts: + paths: + - test/server/opcuaTestServer + expire_in: 24 hour + +build-opcua-module: + stage: build + tags: + - e3-opcua + before_script: + # TODO: Remove hard-coded path for epics base and require version + - echo "EPICS_BASE:=/epics-dev/base-7.0.4" > configure/RELEASE.local + - echo "E3_REQUIRE_VERSION:=3.3.0-e4eb27d" >> configure/RELEASE.local + - echo "E3_MODULE_VERSION:=0.8.0-test" > configure/CONFIG_MODULE.local + script: + - make init + - make patch + - make build + cache: + paths: + - configure/*.local + artifacts: + paths: + - opcua/ + expire_in: 24 hour + +test-ioc: + stage: test + tags: + - e3-opcua + dependencies: + - build-test-server + cache: + paths: + - configure/*.local + before_script: + - pip3 install --user pytest pyepics opcua + - pip3 install --user run-iocsh -i https://artifactory.esss.lu.se/artifactory/api/pypi/pypi-virtual/simple + - export PATH=$PATH:$(python3 -m site --user-base)/bin + # Extract EPICS environment information from RELEASE file + # TODO: Set RELESE_FILE to "RELEASE" when new version of require is released... + - RELEASE_FILE="RELEASE.local" + - BASE_DIR=$(grep -E EPICS_BASE.?= configure/$RELEASE_FILE | cut -f 2 -d "=") + - REQUIRE_VER=$(grep -E E3_REQUIRE_VERSION.?= configure/$RELEASE_FILE | cut -f 2 -d "=") + - export E3_MODULE_VERSION=$(grep -E E3_MODULE_VERSION.?= configure/CONFIG_MODULE.local | cut -f 2 -d "=") + - source $BASE_DIR/require/$REQUIRE_VER/bin/setE3Env.bash + - make init + - make vars + - make cellinstall + script: + - pytest -vrpPx test/opcua_test_cases.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..81f3e0b6f67c3ef5bf024a442dd4beac7939159b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.2.0 + hooks: + - id: flake8 diff --git a/README.md b/README.md index c82bb63a47567ac9180be27c7847616477d23d41..f454766edfccf50c25e3070987b7e3f2f4e1e8c2 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,10 @@ The second step can be run by anyone, and uses this repository. This installs th library as a vendor library which is then loaded by the e3 module `opcua`. For more information, please see the [build instructions](docs/build.md). + +## Automatic testing + +[![pipeline status](https://gitlab.esss.lu.se/e3/common/e3-opcua/badges/master/pipeline.svg)](https://gitlab.esss.lu.se/e3/common/e3-opcua/-/commits/master) + +GitLab CI is used for automatic regression testing of this module. For more information, see [test setup](test/README.md). + diff --git a/configure/RELEASE b/configure/RELEASE index 18f7992c6e9c644c6ea7558a17fe56d3f0eac4b1..9beb6815c072973a2d7d0478b233f08242cb3bbd 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -1,8 +1,8 @@ # -EPICS_BASE=/epics/base-7.0.4 +EPICS_BASE=/epics/base-7.0.5 E3_REQUIRE_NAME:=require -E3_REQUIRE_VERSION:=3.3.0 +E3_REQUIRE_VERSION:=3.4.0 # The definitions shown below can also be placed in an untracked RELEASE.local -include $(TOP)/../../RELEASE.local diff --git a/configure/RELEASE_DEV b/configure/RELEASE_DEV index 3433b54775a0e9dcffee758bf231fc99575bd8eb..feb99b80564d3f7476813ae12e98693148df8a0f 100644 --- a/configure/RELEASE_DEV +++ b/configure/RELEASE_DEV @@ -1,8 +1,8 @@ # -EPICS_BASE=/epics/base-7.0.3 +EPICS_BASE=/epics/base-7.0.5 E3_REQUIRE_NAME:=require -E3_REQUIRE_VERSION:=3.1.1 +E3_REQUIRE_VERSION:=3.4.0 # The definitions shown below can also be placed in an untracked RELEASE_DEV.local -include $(TOP)/../../RELEASE_DEV.local diff --git a/opcua.Makefile b/opcua.Makefile index 9ef9b67e7f25ebaecbcefbf3a051e59fcf51f308..84ad55484550abb62b2ed8c578158c440d609f23 100644 --- a/opcua.Makefile +++ b/opcua.Makefile @@ -25,6 +25,7 @@ # Date : Thursday, October 1 # Version : 0.5.3 + ## The following lines are mandatory, please don't change them. where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) include $(E3_REQUIRE_TOOLS)/driver.makefile @@ -52,9 +53,6 @@ EXAMPLETOPDB=$(EXAMPLETOP)/TemplateDbSup/AnyServerDb ifeq ($(T_A),linux-x86_64) USR_LDFLAGS += -Wl,--enable-new-dtags USR_LDFLAGS += -u opcua_registerRecordDeviceDriver -USR_LDFLAGS += -L$(E3_MODULES_VENDOR_LIBS_LOCATION) -USR_LDFLAGS += -L$(where_am_I)/$(SUPPORT)/os/linux-x86_64 -USR_LDFLAGS += -Wl,-rpath,"\$$ORIGIN/../../../../../siteLibs/vendor/$(E3_MODULE_NAME)/$(E3_MODULE_VERSION)" LIB_SYS_LIBS += opcuabuild endif @@ -62,49 +60,24 @@ endif # This library is build in a first stage by the developer who has a license to the UA SDK. # The output of that should be a library, libopcuabuild.so, and a .dbd file, opcua.dbd which # need to be added to the epics-modules/opcua repository. +# +# The CORELIB line is still necessary here, as this is what tells driver.Makefile where to look +# for certain undefined symbols. TODO: Find a better way to do this??? MODULE_LIBS += $(SUPPORT)/os/linux-x86_64/libopcuabuild.so CORELIB_Linux += $(addprefix ../,$(MODULE_LIBS)) DBDS += $(SUPPORTDBD)/opcuabuild.dbd # These are the vendor libraries from the UA SDK. These also need to be added to the epics-modules/opcua # reopsitory. -VENDOR_LIBS += $(SUPPORT)/os/linux-x86_64/libuabasecpp.so -VENDOR_LIBS += $(SUPPORT)/os/linux-x86_64/libuaclientcpp.so -VENDOR_LIBS += $(SUPPORT)/os/linux-x86_64/libuapkicpp.so -VENDOR_LIBS += $(SUPPORT)/os/linux-x86_64/libuastack.so -VENDOR_LIBS += $(SUPPORT)/os/linux-x86_64/libxmlparsercpp.so - -#DBDS += $(OPCUASRC)/opcuaItemRecord.dbd - - -## Need to define the absolute path, because driver.Makefile -## doesn't know where these files are. -## - -#devOpcua.dbd_SNIPPETS += $(where_am_I)$(OPCUASRC)/20_devOpcuaAll.dbd - - -#opcuaItemRecord$(DEP): $(COMMON_DIR)/devOpcuaVersionNum.h $(COMMON_DIR)/opcuaItemRecord.h $(COMMON_DIR)/devOpcua.dbd - -# Module versioning -#EXPANDVARS += EPICS_OPCUA_MAJOR_VERSION -#EXPANDVARS += EPICS_OPCUA_MINOR_VERSION -#EXPANDVARS += EPICS_OPCUA_MAINTENANCE_VERSION -#EXPANDVARS += EPICS_OPCUA_DEVELOPMENT_FLAG -#EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))") +VENDOR_LIBS += libuabasecpp.so +VENDOR_LIBS += libuaclientcpp.so +VENDOR_LIBS += libuapkicpp.so +VENDOR_LIBS += libuastack.so +VENDOR_LIBS += libxmlparsercpp.so +VENDOR_LIBS += $(notdir $(MODULE_LIBS)) -#$(COMMON_DIR)/devOpcuaVersionNum.h: $(where_am_I)$(OPCUASRC)/devOpcuaVersionNum.h@ - #$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@ - -#$(COMMON_DIR)/opcuaItemRecord.h: $(where_am_I)$(OPCUASRC)/opcuaItemRecord.dbd - #$(DBTORECORDTYPEH) $(USR_DBDFLAGS) -o $@ $< - -#$(COMMON_DIR)/devOpcua.dbd: $(devOpcua.dbd_SNIPPETS) - #$(ASSEMBLE_TOOL) -o $@ $^ - -# END : $(OPCUASRC)/Makefile - +VENDOR_LIBS := $(addprefix $(SUPPORT)/os/linux-x86_64/,$(VENDOR_LIBS)) SCRIPTS += $(wildcard ../iocsh/*.iocsh) @@ -138,22 +111,6 @@ $(TMPS): .PHONY: db $(SUBS) $(TMPS) -vlibs: $(VENDOR_LIBS) $(MODULE_LIBS) - -# We have to update the RUNPATH in the libopcuabuild.so so that it can find the UA libraries -$(MODULE_LIBS): - @echo "Installing $(notdir $@)" - $(QUIET)$(SUDO) install -m 755 $@ $(E3_MODULES_VENDOR_LIBS_LOCATION)/ - @echo "Fixing RUNPATH for $(notdir $@)" - $(QUIET) patchelf --remove-rpath $(E3_MODULES_VENDOR_LIBS_LOCATION)/$(notdir $@) - $(QUIET) patchelf --set-rpath "$(E3_MODULES_VENDOR_LIBS_LOCATION):\$$ORIGIN" $(E3_MODULES_VENDOR_LIBS_LOCATION)/$(notdir $@) - -$(VENDOR_LIBS): - $(QUIET)$(SUDO) install -m 755 -d $(E3_MODULES_VENDOR_LIBS_LOCATION)/ - $(QUIET)$(SUDO) install -m 755 $@ $(E3_MODULES_VENDOR_LIBS_LOCATION)/ - #$(QUIET)$(SUDO) ln -sf $(E3_MODULES_VENDOR_LIBS_LOCATION)/$(notdir $@) $(E3_SITELIBS_PATH)/linux-x86_64/$(notdir $@) - -.PHONY: $(VENDOR_LIBS) $(MODULE_LIBS) vlibs - - +prebuild: $(MODULE_LIBS) + $(QUIET) patchelf --set-rpath "\$$ORIGIN" $^ diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4c6aec623e189da64a5dc5db1214c98bce6d4c21 --- /dev/null +++ b/test/README.md @@ -0,0 +1,119 @@ +# Test Setup - opcua +This directory contains the sources for the automatic testing of the e3-opcua module. + +## Prerequisites +In order to run the test suite, you must install the following: + + * python3 + * libfaketime + +On CentOS 7, run the following: + +``` +sudo yum install -y python3 libfaketime +``` + +And the following python modules: + + * pytest + * pyepics + * opcua + * run-iocsh + +You can use the following pip3 commands: + +``` +pip3 install pytest opcua pyepics +pip3 install run-iocsh -i https://artifactory.esss.lu.se/artifactory/api/pypi/pypi-virtual/simple +``` + +You must configure the EPICS environment before running the test suite. +For the E3 environment, this requires you to ``source setE3Env.bash``. + +Finally, compile the test server for use by the test suite: +``` +cd test/server +make +``` + + +## Test Suite Components + +The test setup consists of three main components: + +### OPC-UA Server - open62541 +A simple test opcua server, created using open62541 [1]. The server configuration currently +consists of a number of variables provided for testing purposes. + +The server listens for connections on ``opc.tcp://localhost:4840`` and the simulated +signals are available in OPC UA namespace 2. + +For further information on the server configuration, see [simulation server](test/server/README.md). + +### IOC +A test IOC is provided that translates the OPC UA variables from the test server. The following PVs are defined: + + * TstRamp + * VarCheckBool + * VarCheckSByte + * VarCheckByte + * VarCheckUInt16 + * VarCheckInt16 + * VarCheckUInt32 + * VarCheckInt32 + * VarCheckUInt64 + * VarCheckInt64 + * VarCheckString + * VarCheckFloat + * VarCheckDouble + +A startup script and database file are provided in the +cmd/ and db/ subdirectories. + +## Python Test Files +The pytest framework [2] is used to implement the test cases. Individual test cases are provided +as python functions (defs) in [\(opcua_test_cases.py\)](test/opcua_test_cases.py). Under the hood, run_iocsh [3] and pyepics [4] are +used for communication with the test IOC. + +To add a new test case, simply add a new funtion (def) to [\(opcua_test_cases.py\)](test/opcua_test_cases.py), ensuring that the function name begins with the prefix ``test_`` + +The test cases provided are: + + 1. **_test_connect_disconnect_**: start and stop the test IOC 5 times. Parse the IOC output, and check it + connects and disconnects to the OPC-UA server successfully. + + 2. **_test_connect_reconnect_**: Start the server, start the IOC. Stop the server, check for appropriate messaging. + Start the server, check that the IOC reconnects. + + 3. **_test_no_connection_**: Start an IOC with no server running. Check the module reports appropriately. + + 4. **_test_server_status_**: Check the informational values provided by the server are being translated via the module. + + + 5. **_test_variable_pvget_**: Start the test IOC and use pvget to read the ``TstRamp`` PV value multiple times (every second). + Check that it is incrementing as a ramp. + +### Running the test suite +You can run the test suite from the root of the repository wuth the following command: +``` +pytest -v test/opcua_test_cases.py +``` + +To view the stdout output from the tests in real-time, you can provide the ``-s`` flag: +``` +pytest -v -s test/opcua_test_cases.py +``` + +To run an individual test point: +``` +pytest -v test/opcua_test_cases.py::TestConnectionTests::test_connect_disconnect +``` + +## References +[1] https://open62541.org/ + +[2] https://docs.pytest.org/en/stable/ + +[3] https://gitlab.esss.lu.se/ics-infrastructure/run-iocsh + +[4] http://pyepics.github.io/pyepics/ diff --git a/test/cmds/test_pv.cmd b/test/cmds/test_pv.cmd new file mode 100644 index 0000000000000000000000000000000000000000..1ec7447a623f5f8d2f785bfaea2eafe3b5d62c8b --- /dev/null +++ b/test/cmds/test_pv.cmd @@ -0,0 +1,16 @@ +# OPC simulation server +epicsEnvSet("OPCSERVER", "127.0.0.1") +epicsEnvSet("OPCPORT", "4840") +epicsEnvSet("OPCNAMESPACE", "2") + +# OPCUA environment variables +epicsEnvSet("SESSION", "OPC1") +epicsEnvSet("SUBSCRIPT", "SUB1") + +# Load OPCUA module startup script +iocshLoad("$(opcua_DIR)/opcua.iocsh", "P=OPC:,SESS=$(SESSION),SUBS=$(SUBSCRIPT),INET=$(OPCSERVER),PORT=$(OPCPORT)") + +dbLoadRecords("test/db/test_pv.db", "OPCSUB=$(SUBSCRIPT), NS=$(OPCNAMESPACE)") + +iocInit() + diff --git a/test/cmds/test_pv_neg.cmd b/test/cmds/test_pv_neg.cmd new file mode 100644 index 0000000000000000000000000000000000000000..9ed8221ac982341d1e2476e5bd172c25b3afa875 --- /dev/null +++ b/test/cmds/test_pv_neg.cmd @@ -0,0 +1,16 @@ +# OPC simulation server +epicsEnvSet("OPCSERVER", "127.0.0.1") +epicsEnvSet("OPCPORT", "4840") +epicsEnvSet("OPCNAMESPACE", "2") + +# OPCUA environment variables +epicsEnvSet("SESSION", "OPC1") +epicsEnvSet("SUBSCRIPT", "SUB1") + +# Load OPCUA module startup script +iocshLoad("$(opcua_DIR)/opcua.iocsh", "P=OPC:,SESS=$(SESSION),SUBS=$(SUBSCRIPT),INET=$(OPCSERVER),PORT=$(OPCPORT)") + +dbLoadRecords("test/db/test_pv_neg.db", "OPCSUB=$(SUBSCRIPT), NS=$(OPCNAMESPACE)") + +iocInit() + diff --git a/test/db/test_pv.db b/test/db/test_pv.db new file mode 100644 index 0000000000000000000000000000000000000000..73302a854f94686c06512bed2dd134ec2e7bf116 --- /dev/null +++ b/test/db/test_pv.db @@ -0,0 +1,150 @@ +record(ai, "TstRamp") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestRamp") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(bi, "VarCheckBool") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarBool") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(bo, "VarCheckBoolOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarBool") +} + +record(ai, "VarCheckSByte") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarSByte") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckSByteOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarSByte") +} + +record(ai, "VarCheckByte") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarByte") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckByteOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarByte") +} + +record(ai, "VarCheckUInt16") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt16") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckUInt16Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt16") +} + +record(ai, "VarCheckInt16") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt16") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckInt16Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt16") +} + +record(ai, "VarCheckUInt32") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt32") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckUInt32Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt32") +} + +record(ai, "VarCheckInt32") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt32") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckInt32Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt32") +} + +record(ai, "VarCheckUInt64") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt64") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckUInt64Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarUInt64") +} + +record(ai, "VarCheckInt64") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt64") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckInt64Out") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarInt64") +} + +record(stringin, "VarCheckString") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarString") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(stringout, "VarCheckStringOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarString") +} + +record(ai, "VarCheckFloat") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarFloat") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckFloatOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarFloat") +} + +record(ai, "VarCheckDouble") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarDouble") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(ao, "VarCheckDoubleOut") { + field(DTYP, "OPCUA") + field( OUT, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarDouble") +} diff --git a/test/db/test_pv_neg.db b/test/db/test_pv_neg.db new file mode 100644 index 0000000000000000000000000000000000000000..1f16db342893f21ea41abf3d0c987686165bd207 --- /dev/null +++ b/test/db/test_pv_neg.db @@ -0,0 +1,13 @@ +record(ai, "BadVarName") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.BadVarName") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} + +record(bi, "VarNotBoolean") { + field(DTYP, "OPCUA") + field( INP, "@$(OPCSUB) ns=$(NS);s=Sim.TestVarFloat") + field(SCAN, "I/O Intr") + field( TSE, "-2") +} diff --git a/test/opcua_test_cases.py b/test/opcua_test_cases.py new file mode 100644 index 0000000000000000000000000000000000000000..6f3fd59553ca92523ea7f8fe22ed0c424156b958 --- /dev/null +++ b/test/opcua_test_cases.py @@ -0,0 +1,807 @@ +from epics import PV +from time import sleep +from run_iocsh import IOC +from os import environ +from datetime import datetime +import os +import pytest +import subprocess +import resource +import time +import signal + + +class opcuaTestHarness: + def __init__(self): + + # Get values from the environment + self.EPICS_BASE = environ.get("EPICS_BASE") + self.REQUIRE_VERSION = environ.get("E3_REQUIRE_VERSION") + self.MOD_VERSION = environ.get("E3_MODULE_VERSION") + if self.MOD_VERSION is None: + self.MOD_VERSION = "0.8.0" + self.TEMP_CELL_PATH = environ.get("TEMP_CELL_PATH") + if self.TEMP_CELL_PATH is None: + self.TEMP_CELL_PATH = "cellMods" + + # run-iocsh parameters + self.IOCSH_PATH = ( + f"{self.EPICS_BASE}/require/{self.REQUIRE_VERSION}/bin/iocsh.bash" + ) + + self.TestArgs = [ + "-l", + self.TEMP_CELL_PATH, + "-r", + f"opcua,{self.MOD_VERSION}", + ] + + self.cmd = "test/cmds/test_pv.cmd" + + # Default IOC + self.IOC = self.get_ioc() + + # timeout value in seconds for pvput/pvget calls + self.timeout = 5 + self.putTimeout = self.timeout + self.getTimeout = self.timeout + + # test sleep time ins seconds + self.sleepTime = 3 + + # Test server + self.testServer = "test/server/opcuaTestServer" + self.isServerRunning = False + self.serverURI = "opc.tcp://localhost.localdomain:4840" + self.serverFakeTime = "2019-05-02 09:22:52" + + # Message catalog + self.connectMsg = ( + "OPC UA session OPC1: connection status changed" + + " from Connected to Disconnected" + ) + self.reconnectMsg = ( + "OPC UA session OPC1: connection status changed" + + " from ConnectionErrorApiReconnect to NewSessionCreated" + ) + self.reconnectMsg1 = ( + "OPC UA session OPC1: connection status changed" + + " from NewSessionCreated to Connected" + ) + self.noConnectMsg = ( + "OPC UA session OPC1: connection status changed" + + " from Disconnected to ConnectionErrorApiReconnect" + ) + + self.badNodeIdMsg = "item ns=2;s=Sim.BadVarName : BadNodeIdUnknown" + + # Server variables + self.serverVars = [ + "open62541", + "open62541 OPC UA Server", + "1.2.0-29-g875d33a9", + ] + + def get_ioc(self): + return IOC( + *self.TestArgs, + self.cmd, + ioc_executable=self.IOCSH_PATH, + ) + + def start_server(self, withPIPE=False): + if withPIPE: + self.serverProc = subprocess.Popen( + self.testServer, + shell=False, + stdout=subprocess.PIPE, + ) + else: + self.serverProc = subprocess.Popen( + self.testServer, + shell=False, + ) + + print("\nOpening server with pid = %s" % self.serverProc.pid) + retryCount = 0 + while (not self.isServerRunning) and retryCount < 5: + # Poll server to see if it is running + self.is_server_running() + retryCount = retryCount + 1 + sleep(1) + + assert retryCount < 5, "Unable to start server" + + def start_server_with_faketime(self): + self.serverProc = subprocess.Popen( + "faketime -f '%s' %s" % (self.serverFakeTime, self.testServer), + shell=True, + preexec_fn=os.setsid, + ) + + print("\nOpening server with pid = %s" % self.serverProc.pid) + retryCount = 0 + while (not self.isServerRunning) and retryCount < 5: + # Poll server to see if it is running + self.is_server_running() + retryCount = retryCount + 1 + sleep(1) + + assert retryCount < 5, "Unable to start server" + + def stop_server_group(self): + # Get the process group ID for the spawned shell, + # and send terminate signal + print("\nClosing server group with pgid = %s" % self.serverProc.pid) + os.killpg(os.getpgid(self.serverProc.pid), signal.SIGTERM) + # Update if server is running + self.is_server_running() + + def stop_server(self): + print("\nClosing server with pid = %s" % self.serverProc.pid) + # Send terminate signal + self.serverProc.terminate() + # Wait for processes to terminate. + self.serverProc.wait(timeout=5) + # Update if server is running + self.is_server_running() + + def is_server_running(self): + from opcua import Client + + c = Client(self.serverURI) + try: + # Connect to server + c.connect() + # NS0|2259 is the server state variable + # 0 -- Running + var = c.get_node("ns=0;i=2259") + val = var.get_data_value() + self.isServerRunning = val.StatusCode.is_good() + # Disconnect from server + c.disconnect() + + except Exception: + self.isServerRunning = False + + +# Standard test fixture +@pytest.fixture(scope="function") +def test_inst(): + """ + Instantiate test harness, start the server, + yield the harness handle to the test, + close the server on test end / failure + """ + # Create handle to Test Harness + test_inst = opcuaTestHarness() + # Poll to see if the server is running + test_inst.is_server_running() + assert not ( + test_inst.isServerRunning + ), "An instance of the OPC-UA test server is already running" + # Start server + test_inst.start_server() + # Drop to test + yield test_inst + # Shutdown server by sending terminate signal + test_inst.stop_server() + # Check server is stopped + assert not test_inst.isServerRunning + + +# test fixture for use with timezone server +@pytest.fixture(scope="function") +def test_inst_TZ(): + """ + Instantiate test harness, start the server, + yield the harness handle to the test, + close the server on test end / failure + """ + # Create handle to Test Harness + test_inst_TZ = opcuaTestHarness() + # Poll to see if the server is running + test_inst_TZ.is_server_running() + assert not ( + test_inst_TZ.isServerRunning + ), "An instance of the OPC-UA test server is already running" + # Start server + test_inst_TZ.start_server_with_faketime() + # Drop to test + yield test_inst_TZ + # Shutdown server by sending terminate signal + test_inst_TZ.stop_server_group() + # Check server is stopped + assert not test_inst_TZ.isServerRunning + + +class TestConnectionTests: + + # Positive Test Cases + def test_connect_disconnect(self, test_inst): + """ + Connect and disconnect to the OPC-UA test server, and + check that there are no errors + """ + + ioc = test_inst.IOC + nRuns = 5 + + for i in range(0, nRuns): + # Start IOC, and check it is running + ioc.start() + assert ioc.is_running() + + ioc.exit() + assert not ioc.is_running() + + # Grab ioc output + ioc.check_output() + output = ioc.outs + + # Parse for OPC-UA connection message + assert ( + output.find(test_inst.connectMsg) >= 0 + ), "%d: Failed to find disconnect message\n%s" % (i, output) + + print(output) + + def test_connect_reconnect(self, test_inst): + """ + Start the server, start the IOC. Stop the server, check + for appropriate messaging. Start the server, check that + the IOC reconnects. + """ + ioc = test_inst.IOC + + nRuns = 5 + + for i in range(0, nRuns): + ioc.start() + assert ioc.is_running() + + test_inst.stop_server() + assert ioc.is_running() + + sleep(test_inst.sleepTime) + + test_inst.start_server() + assert ioc.is_running() + + sleep(test_inst.sleepTime) + + ioc.exit() + assert not ioc.is_running() + + # Grab ioc output + ioc.check_output() + output = ioc.outs + print(output) + + # Parse for OPC-UA connection message + assert ( + output.find(test_inst.reconnectMsg) >= 0 + ), "%d: Failed to find reconnect message\n%s" % (i, output) + assert ( + output.find(test_inst.reconnectMsg1) >= 0 + ), "%d: Failed to find reconnect message 1\n%s" % (i, output) + + def test_no_connection(self, test_inst): + """ + Start an IOC with no server running. Check the module + reports this. + """ + + ioc = test_inst.IOC + + # We don't want the server running + test_inst.stop_server() + + # Start the IOC + ioc.start() + assert ioc.is_running() + + sleep(test_inst.sleepTime) + + test_inst.start_server() + + sleep(test_inst.sleepTime) + + ioc.exit() + assert not ioc.is_running() + + # Grab ioc output + ioc.check_output() + output = ioc.outs + print(output) + + i = 1 + # Parse for OPC-UA connection message + assert ( + output.find(test_inst.noConnectMsg) >= 0 + ), "%d: Failed to find no connection message\n%s" % (i, output) + assert ( + output.find(test_inst.reconnectMsg) >= 0 + ), "%d: Failed to find reconnect message in output\n%s" % (i, output) + assert ( + output.find(test_inst.reconnectMsg1) >= 0 + ), "%d: Failed to find reconnect message 1 in output\n%s" % (i, output) + + def test_shutdown_on_ioc_reboot(self, test_inst): + """ + Start the server. Start an IOC and ensure connection + is made to the server. Shutdown the IOC and endure + that the subscriptions and sessions are cleanly + disconnected. + """ + # Close connection to server, and open new connection + # with stdout PIPE + test_inst.stop_server() + test_inst.start_server(withPIPE=True) + + ioc = test_inst.IOC + # Start the IOC + ioc.start() + assert ioc.is_running() + # Wait a second to allow it to get up and running + sleep(1) + # Stop the IOC + ioc.exit() + assert not ioc.is_running() + # Wait for it to close down + sleep(1) + + # Shutdown the server to allow us to get the stdout messages + test_inst.stop_server() + + # Read all lines from the stdout buffer + log = "" + for line in iter(test_inst.serverProc.stdout.readline, b""): + log = log + line.decode("utf-8") + + print(log) + + # Check the Session was activated + assert log.find("ActivateSession: Session activated") >= 0, ( + "Failed to find ActivateSession message: %s" % log + ) + # Check Subscription was created + assert log.find("Subscription 1 | Created the Subscription") >= 0, ( + "Failed to find Subscription message: %s" % log + ) + + # Find the position in the log where the terminate signal + # is received + termPos = log.find("received ctrl-c") + + # Check that the session and subscription close messages + # occur before the terminate signal is received. + # This means they were closed when the IOC was shutdown + closePos = log.find("Closing the Session") + deletePos = log.find("Subscription 1 | Subscription deleted") + assert 0 <= closePos <= termPos, ( + "Session closed by terminate, not by IOC shutdown: %s" % log + ) + assert 0 <= deletePos <= termPos, ( + "Subscription closed by terminate, not by IOC shutdown: %s" % log + ) + + # Grab ioc output + ioc.check_output() + output = ioc.outs + print(output) + + +class TestVariableTests: + def test_server_status(self, test_inst): + """ + Check the informational values provided by the server + are being translated via the module + """ + ioc = test_inst.IOC + + serverVars = [ + "OPC:ServerManufacturerName", + "OPC:ServerProductName", + "OPC:ServerSoftwareVersion", + ] + i = 0 + with ioc: + for pvName in serverVars: + pv = PV(pvName) + res = pv.get(timeout=test_inst.getTimeout) + assert res == test_inst.serverVars[i] + i = i + 1 + + def test_variable_pvget(self, test_inst): + """ + Variable on the OPCUA server increments by 1 each second + Sample the value using pvget once a second and check the + value is incrmenting. + """ + + with IOC( + *test_inst.TestArgs, + test_inst.cmd, + ioc_executable=test_inst.IOCSH_PATH, + ): + # PV name + pvName = "TstRamp" + pv = PV(pvName) + + # Test parameters + minVal = 0 # Ramp min, as defined by server + maxVal = 1000 # Ramp max, as defined by server + captureLen = 5 # Number of samples to capture + captureIncr = 5 # Time increment in seconds + + res = [int(0)] * captureLen + resCheck = [int(0)] * captureLen + + for i in range(0, captureLen): + res[i] = int(pv.get(timeout=test_inst.getTimeout)) + sleep(captureIncr) + + wrapOffset = 0 + resCheck[0] = res[0] + # Check ramp is incrementing correctly + for i in range(1, captureLen): + # Handle possible wraparound from 1000 -> 0 + if res[i] == minVal: + wrapOffset = maxVal + 1 + resCheck[i] = res[i] + wrapOffset + expected = resCheck[i - 1] + captureIncr + print( + "Captured value (%d) is %d. Expected %d +/-1" + % ( + i, + res[i], + expected, + ) + ) + assert ( + expected - 1 <= resCheck[i] <= expected + 1 + ), "Captured value (%d) is %d. Expected %d +/-1" % ( + i, + res[i], + expected, + ) + + @pytest.mark.parametrize( + "pvName,expectedVal", + [ + ("VarCheckBool", True), + ("VarCheckSByte", -128), + ("VarCheckByte", 255), + ("VarCheckInt16", -32768), + ("VarCheckUInt16", 65535), + ("VarCheckInt32", -2147483648), + ("VarCheckUInt32", 4294967295), + ("VarCheckInt64", -1294967296), + ("VarCheckUInt64", "{:.16e}".format(18446744073709551615)), + ("VarCheckFloat", -0.0625), + ("VarCheckDouble", 0.002), + ("VarCheckString", "TestString01"), + ], + ) + def test_read_variable(self, test_inst, pvName, expectedVal): + """ + Read the deafult value of a variable from the opcua + server and check it matches the expected value. + Parametrised for all supported datatypes. + """ + ioc = test_inst.IOC + + with ioc: + pv = PV(pvName) + res = pv.get(timeout=test_inst.getTimeout) + # Check UInt64 with correct scientific notation + if pvName == "VarCheckUInt64": + res = "%.16e" % res + # Compare + assert res == expectedVal + + @pytest.mark.parametrize( + "pvName,writeVal", + [ + ("VarCheckBool", False), + ("VarCheckSByte", 127), + ("VarCheckByte", 128), + ("VarCheckInt16", 32767), + ("VarCheckUInt16", 32768), + ("VarCheckInt32", 2147483647), + ("VarCheckUInt32", 2147483648), + ("VarCheckInt64", 0), + ("VarCheckUInt64", 0), + ("VarCheckFloat", -0.03125), + ("VarCheckDouble", -0.004), + ("VarCheckString", "ModifiedTestString"), + ], + ) + def test_write_variable(self, test_inst, pvName, writeVal): + """ + Write a known value to the opcua server via the + output PV linked to the variable. Read back via + the input PV and check the values match. + Parametrised for all supported datatypes. + """ + ioc = test_inst.IOC + + with ioc: + # Output PV name is the same as the input PV + # name, with the addition of the "Out" suffix + pvOutName = pvName + "Out" + pvWrite = PV(pvOutName) + assert ioc.is_running() + assert ( + pvWrite.put(writeVal, wait=True, timeout=test_inst.putTimeout) + is not None + ), ("Failed to write to PV %s\n" % pvOutName) + + # Wait 1s to ensure write has time to pass through + # asynchronous layers + sleep(1) + + # Read back via input PV + pvRead = PV(pvName) + assert ioc.is_running() + res = pvRead.get(use_monitor=False, timeout=test_inst.getTimeout) + retryCnt = 0 + while res is None: + print("%d: Read timeout. Try again...\n" % retryCnt) + ioc.exit() + ioc.start() + res = pvRead.get( + use_monitor=False, timeout=test_inst.getTimeout + ) # NoQA: E501 + if retryCnt > 3: + break + + # Compare + assert res == writeVal + + def test_timestamps(self, test_inst_TZ): + """ + Start the test server in a shell session with + with a fake time in the past. Check that the + timestamp for the PV read matches the known + fake time given to the server. + If they match, the OPCUA EPICS module is + correctly pulling the timestamps from the + OPCUA server (and not using a local TS) + """ + + ioc = test_inst_TZ.IOC + + # Get PV timestamp: + + with ioc: + pvName = PV("TstRamp", form="time") + pvName.get(timeout=test_inst_TZ.getTimeout) + epicsTs = pvName.timestamp + + form = "%Y-%m-%d %H:%M:%S" + pyTs = datetime.strptime(test_inst_TZ.serverFakeTime, form).timestamp() + + assert epicsTs == pyTs, "Timestamp returned does not match" + + +class TestPerformanceTests: + def test_write_performance(self, test_inst): + """ + Write 5000 variable values and measure + time and memory consumption before + and after. Repeat 10 times + """ + ioc = test_inst.IOC + + with ioc: + # Get PV + pvWrite = PV("VarCheckInt16Out") + + # Check that IOC is running + assert ioc.is_running() + + maxt = 0 + mint = float("inf") + tott = 0 + totr = 0 + testruns = 10 + writeperrun = 5000 + + # Run test 10 times + for j in range(1, testruns): + + # Get time and memory conspumtion before test + r0 = resource.getrusage(resource.RUSAGE_THREAD) + t0 = time.perf_counter() + + # Write 5000 PVs + for i in range(1, writeperrun): + pvWrite.put(i, wait=True, timeout=test_inst.putTimeout) + + # Get delta time and delta memory + dt = time.perf_counter() - t0 + r1 = resource.getrusage(resource.RUSAGE_THREAD) + dr = ( + resource.getrusage(resource.RUSAGE_THREAD).ru_maxrss + - r0.ru_maxrss # NoQA: E501 + ) + + # Collect data for statistics + if dt > maxt: + maxt = dt + if dt < mint: + mint = dt + tott += dt + totr += dr + print("Time: ", dt) + print("Memory: ", dr) + print("Memory: ", r0.ru_maxrss) + print("Memory: ", r1.ru_maxrss) + avgt = tott / testruns + + print("Max time: ", maxt) + print("Min time: ", mint) + print("Average time: ", avgt) + print("Total memory: ", totr) + + assert maxt < 15 + assert mint > 1 + assert avgt < 7.5 + assert totr < 1000 + + def test_read_performance(self, test_inst): + """ + Read 5000 variable values and measure time and + memory consumption before and after. + Repeat 10 times + """ + ioc = test_inst.IOC + + with ioc: + # Get PV + pvRead = PV("VarCheckInt16") + + # Check that IOC is running + assert ioc.is_running() + + maxt = 0 + mint = float("inf") + tott = 0 + totr = 0 + testruns = 10 + writeperrun = 5000 + + # Run test 10 times + for j in range(1, testruns): + + # Get time and memory conspumtion before test + r0 = resource.getrusage(resource.RUSAGE_SELF) + t0 = time.perf_counter() + + # Read 5000 PVs + for i in range(1, writeperrun): + pvRead.get(timeout=test_inst.putTimeout) + + # Get delta time and delta memory + dt = time.perf_counter() - t0 + r1 = resource.getrusage(resource.RUSAGE_SELF) + dr = ( + resource.getrusage(resource.RUSAGE_SELF).ru_maxrss + - r0.ru_maxrss # NoQA: E501 + ) + + # Collect data for statistics + if dt > maxt: + maxt = dt + if dt < mint: + mint = dt + tott += dt + totr += dr + print("Time: ", dt) + print("Memory: ", dr) + print("Memory: ", r0.ru_maxrss) + print("Memory: ", r1.ru_maxrss) + avgt = tott / testruns + + print("Max time: ", maxt) + print("Min time: ", mint) + print("Average time: ", avgt) + print("Total memory: ", totr) + + assert maxt < 10 + assert mint > 0.01 + assert avgt < 5 + assert totr < 1000 + + +class TestNegativeTests: + def test_no_server(self, test_inst): + """ + Start an OPC-UA IOC with no server running. + Check the module reports this correctly. + """ + + ioc = test_inst.IOC + + # Stop the running server + test_inst.stop_server() + + # Start the IOC + ioc.start() + assert ioc.is_running() + + # Wait some time + sleep(1) + + # Stop IOC, and check output + ioc.exit() + assert not ioc.is_running() + + ioc.check_output() + output = ioc.outs + print(output) + + assert output.find(test_inst.noConnectMsg) >= 0, ( + "%d: Failed to find no connection message\n%s" % output + ) + + def test_bad_var_name(self, test_inst): + """ + Specify an incorrect variable name in a db record. + Start the IOC and verify a sensible error is + displayed. + """ + + # Use startup script for negative tests + test_inst.cmd = "test/cmds/test_pv_neg.cmd" + ioc = test_inst.get_ioc() + + # Start the IOC + ioc.start() + assert ioc.is_running() + + # Wait some time + sleep(1) + + # Stop IOC, and check output + ioc.exit() + assert not ioc.is_running() + + ioc.check_output() + output = ioc.outs + print(output) + + assert output.find(test_inst.badNodeIdMsg) >= 0, ( + "Failed to find BadNodeIdUnknown message\n%s" % output + ) + + def test_wrong_datatype(self, test_inst): + """ + Specify an incorrect record type for an OPC-UA variable. + Binary input record for a float datatype. + """ + import re + + # Use startup script for negative tests + test_inst.cmd = "test/cmds/test_pv_neg.cmd" + ioc = test_inst.get_ioc() + + # Start the IOC + ioc.start() + assert ioc.is_running() + + # Wait some time + sleep(1) + + # Stop IOC, and check output + ioc.exit() + assert not ioc.is_running() + + ioc.check_output() + output = ioc.outs + print(output) + + regx = "VarNotBoolean : incoming data (.*) out-of-bounds" + assert re.search(regx, output) diff --git a/test/server/Makefile b/test/server/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..424fbfd6d27eff3112cfd10be412b7033f7a5042 --- /dev/null +++ b/test/server/Makefile @@ -0,0 +1,28 @@ +src := . + +CFLAGS := -std=c99 -I$(src) -D _BSD_SOURCE -D UA_ENABLE_AMALGAMATION +LDFLAGS := -lpthread + +C_SRCS := open62541.c opcuaTestNodeSet.c opcuaTestServer.c +C_OBJS := $(addsuffix .o,$(basename $(C_SRCS))) + +PYTHON := python3 +XML_SRCS := xml/opcuaTestServer.NodeSet2.xml +OPEN62541_DIR ?= /opt/open62541 +NS_COMP_DIR := $(OPEN62541_DIR)/tools/nodeset_compiler +SCHEMA_DIR := $(OPEN62541_DIR)/deps/ua-nodeset/Schema +NS_COMP := $(NS_COMP_DIR)/nodeset_compiler.py +SCHEMA := $(SCHEMA_DIR)/Opc.Ua.NodeSet2.xml + +all: opcuaTestServer + +opcuaTestServer: $(C_SRCS) + $(CC) $(CFLAGS) $(LDFLAGS) $(C_SRCS) -o $@ + +nodeset: $(XML_SRCS) + $(PYTHON) $(NS_COMP) --types-array=UA_TYPES --existing $(SCHEMA) --xml $(XML_SRCS) xml/opcuaTestNodeSet + +clean: + $(RM) -f *.o .depend opcuaTestServer xml/*.c xml/*.h + +.PHONY: clean all diff --git a/test/server/README.md b/test/server/README.md new file mode 100644 index 0000000000000000000000000000000000000000..341704fad0656b4df9b17fe76d0dcdbd63fcdbf8 --- /dev/null +++ b/test/server/README.md @@ -0,0 +1,43 @@ +Simulation server - open62541 +====== +This directory contains the sources for compiling an OPC UA server based on open62541 [1]. + +The server configuration currently consists a number of variables. The variables are defined in the XML file source file +[\(opcuaTestServer.NodeSet2.xml\)](test/server/xml/opcuaTestServer.NodeSet2.xml) and compiled into the C-source file [\(opcuaTestNodeSet.c\)](test/server/opcuaTestNodeSet.c). + +The amalgamated source files for the server (open62541.c/.h) are provided in this directory. See [2] +for more information on building the open62541 sources with amalgamation. + +## Build the server +``` +make +``` + +## Run the server +``` +./opcuaTestServer +``` + +## Connecting to the server +By default, the server listens for connections on ``opc.tcp://localhost:4840`` and the simulated +signals are available in OPC UA namespace 2. + +## Compiling the NodeSet +A default, pre-compiled NodeSet is provided with the test suite in the source file [\(opcuaTestNodeSet.c\)](test/server/opcuaTestNodeSet.c). +If, however, you wish to modify the nodeset, you can recompile it using XML Nodeset Compiler [3] - a python utility for compiling NodeSet2.xml +files into C-sources for use with an open62541 server. +A target (nodeset) is provided in the Makefile to simpilify this process. + +**NOTE**: You must have the open62541 source repository available on your system. By default, the Makefile expects the sources at +/opt/open62541. You can override this path, by setting the variable OPEN62541_DIR: + +``` +OPEN62541_DIR=/path/to/open62541 make nodeset +``` + +## References +[1] https://open62541.org/ + +[2] https://open62541.org/doc/current/building.html#detailed-sdk-features + +[3] https://open62541.org/doc/current/nodeset_compiler.html diff --git a/test/server/opcuaTestNodeSet.c b/test/server/opcuaTestNodeSet.c new file mode 100644 index 0000000000000000000000000000000000000000..04beea39accd97a990462de2b73078caf3c9badd --- /dev/null +++ b/test/server/opcuaTestNodeSet.c @@ -0,0 +1,510 @@ +/* WARNING: This is a generated file. + * Any manual changes will be overwritten. */ + +#include "opcuaTestNodeSet.h" + + +/* Simulation - ns=1;s=Sim */ + +static UA_StatusCode function_opcuaTestNodeSet_0_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Simulation"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 85LU), +UA_NODEID_NUMERIC(ns[0], 35LU), +UA_QUALIFIEDNAME(ns[1], "Simulation"), +UA_NODEID_NUMERIC(ns[0], 61LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_0_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim") +); +} + +/* TestVarInt64 - ns=1;s=Sim.TestVarInt64 */ + +static UA_StatusCode function_opcuaTestNodeSet_1_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 8LU); +UA_Int64 *variablenode_ns_1_s_sim_testvarint64_variant_DataContents = UA_Int64_new(); +if (!variablenode_ns_1_s_sim_testvarint64_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int64_init(variablenode_ns_1_s_sim_testvarint64_variant_DataContents); +*variablenode_ns_1_s_sim_testvarint64_variant_DataContents = (UA_Int64) -1294967296; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarint64_variant_DataContents, &UA_TYPES[UA_TYPES_INT64]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarInt64"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt64"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarInt64"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int64_delete(variablenode_ns_1_s_sim_testvarint64_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_1_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt64") +); +} + +/* TestVarInt16 - ns=1;s=Sim.TestVarInt16 */ + +static UA_StatusCode function_opcuaTestNodeSet_2_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 4LU); +UA_Int16 *variablenode_ns_1_s_sim_testvarint16_variant_DataContents = UA_Int16_new(); +if (!variablenode_ns_1_s_sim_testvarint16_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int16_init(variablenode_ns_1_s_sim_testvarint16_variant_DataContents); +*variablenode_ns_1_s_sim_testvarint16_variant_DataContents = (UA_Int16) -32768; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarint16_variant_DataContents, &UA_TYPES[UA_TYPES_INT16]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarInt16"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt16"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarInt16"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int16_delete(variablenode_ns_1_s_sim_testvarint16_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_2_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt16") +); +} + +/* TestVarUInt16 - ns=1;s=Sim.TestVarUInt16 */ + +static UA_StatusCode function_opcuaTestNodeSet_3_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 5LU); +UA_UInt16 *variablenode_ns_1_s_sim_testvariuint16_variant_DataContents = UA_UInt16_new(); +if (!variablenode_ns_1_s_sim_testvariuint16_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_UInt16_init(variablenode_ns_1_s_sim_testvariuint16_variant_DataContents); +*variablenode_ns_1_s_sim_testvariuint16_variant_DataContents = (UA_UInt16) 65535; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvariuint16_variant_DataContents, &UA_TYPES[UA_TYPES_UINT16]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarUInt16"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt16"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarUInt16"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_UInt16_delete(variablenode_ns_1_s_sim_testvariuint16_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_3_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt16") +); +} + +/* TestVarString - ns=1;s=Sim.TestVarString */ + +static UA_StatusCode function_opcuaTestNodeSet_4_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +UA_String *variablenode_ns_1_s_sim_testvarstring_variant_DataContents = UA_String_new(); +if (!variablenode_ns_1_s_sim_testvarstring_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_String_init(variablenode_ns_1_s_sim_testvarstring_variant_DataContents); +*variablenode_ns_1_s_sim_testvarstring_variant_DataContents = UA_STRING_ALLOC("TestString01"); +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarstring_variant_DataContents, &UA_TYPES[UA_TYPES_STRING]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarString"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarString"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarString"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_String_delete(variablenode_ns_1_s_sim_testvarstring_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_4_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarString") +); +} + +/* TestVarByte - ns=1;s=Sim.TestVarByte */ + +static UA_StatusCode function_opcuaTestNodeSet_5_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 3LU); +UA_Byte *variablenode_ns_1_s_sim_testvarbyte_variant_DataContents = UA_Byte_new(); +if (!variablenode_ns_1_s_sim_testvarbyte_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Byte_init(variablenode_ns_1_s_sim_testvarbyte_variant_DataContents); +*variablenode_ns_1_s_sim_testvarbyte_variant_DataContents = (UA_Byte) 255; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarbyte_variant_DataContents, &UA_TYPES[UA_TYPES_BYTE]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarByte"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarByte"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarByte"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Byte_delete(variablenode_ns_1_s_sim_testvarbyte_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_5_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarByte") +); +} + +/* TestVarDouble - ns=1;s=Sim.TestVarDouble */ + +static UA_StatusCode function_opcuaTestNodeSet_6_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 11LU); +UA_Double *variablenode_ns_1_s_sim_testvardouble_variant_DataContents = UA_Double_new(); +if (!variablenode_ns_1_s_sim_testvardouble_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Double_init(variablenode_ns_1_s_sim_testvardouble_variant_DataContents); +*variablenode_ns_1_s_sim_testvardouble_variant_DataContents = (UA_Double) 0.002; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvardouble_variant_DataContents, &UA_TYPES[UA_TYPES_DOUBLE]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarDouble"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarDouble"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarDouble"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Double_delete(variablenode_ns_1_s_sim_testvardouble_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_6_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarDouble") +); +} + +/* TestVarUInt64 - ns=1;s=Sim.TestVarUInt64 */ + +static UA_StatusCode function_opcuaTestNodeSet_7_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 9LU); +UA_UInt64 *variablenode_ns_1_s_sim_testvaruint64_variant_DataContents = UA_UInt64_new(); +if (!variablenode_ns_1_s_sim_testvaruint64_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_UInt64_init(variablenode_ns_1_s_sim_testvaruint64_variant_DataContents); +*variablenode_ns_1_s_sim_testvaruint64_variant_DataContents = (UA_UInt64) 18446744073709551615; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvaruint64_variant_DataContents, &UA_TYPES[UA_TYPES_UINT64]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarUInt64"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt64"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarUInt64"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_UInt64_delete(variablenode_ns_1_s_sim_testvaruint64_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_7_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt64") +); +} + +/* TestRamp - ns=1;s=Sim.TestRamp */ + +static UA_StatusCode function_opcuaTestNodeSet_8_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 11LU); +UA_Double *variablenode_ns_1_s_sim_testramp_variant_DataContents = UA_Double_new(); +if (!variablenode_ns_1_s_sim_testramp_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Double_init(variablenode_ns_1_s_sim_testramp_variant_DataContents); +*variablenode_ns_1_s_sim_testramp_variant_DataContents = (UA_Double) 0; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testramp_variant_DataContents, &UA_TYPES[UA_TYPES_DOUBLE]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestRamp"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestRamp"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestRamp"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Double_delete(variablenode_ns_1_s_sim_testramp_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_8_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestRamp") +); +} + +/* TestVarBool - ns=1;s=Sim.TestVarBool */ + +static UA_StatusCode function_opcuaTestNodeSet_9_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 1LU); +UA_Boolean *variablenode_ns_1_s_sim_testvarbool_variant_DataContents = UA_Boolean_new(); +if (!variablenode_ns_1_s_sim_testvarbool_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Boolean_init(variablenode_ns_1_s_sim_testvarbool_variant_DataContents); +*variablenode_ns_1_s_sim_testvarbool_variant_DataContents = (UA_Boolean) true; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarbool_variant_DataContents, &UA_TYPES[UA_TYPES_BOOLEAN]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarBool"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarBool"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarBool"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Boolean_delete(variablenode_ns_1_s_sim_testvarbool_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_9_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarBool") +); +} + +/* TestVarFloat - ns=1;s=Sim.TestVarFloat */ + +static UA_StatusCode function_opcuaTestNodeSet_10_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 10LU); +UA_Float *variablenode_ns_1_s_sim_testvarfloat_variant_DataContents = UA_Float_new(); +if (!variablenode_ns_1_s_sim_testvarfloat_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Float_init(variablenode_ns_1_s_sim_testvarfloat_variant_DataContents); +*variablenode_ns_1_s_sim_testvarfloat_variant_DataContents = (UA_Float) -0.0625; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarfloat_variant_DataContents, &UA_TYPES[UA_TYPES_FLOAT]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarFloat"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarFloat"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarFloat"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Float_delete(variablenode_ns_1_s_sim_testvarfloat_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_10_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarFloat") +); +} + +/* TestVarUInt32 - ns=1;s=Sim.TestVarUInt32 */ + +static UA_StatusCode function_opcuaTestNodeSet_11_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +UA_UInt32 *variablenode_ns_1_s_sim_testvaruint32_variant_DataContents = UA_UInt32_new(); +if (!variablenode_ns_1_s_sim_testvaruint32_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_UInt32_init(variablenode_ns_1_s_sim_testvaruint32_variant_DataContents); +*variablenode_ns_1_s_sim_testvaruint32_variant_DataContents = (UA_UInt32) 4294967295; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvaruint32_variant_DataContents, &UA_TYPES[UA_TYPES_UINT32]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarUInt32"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt32"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarUInt32"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_UInt32_delete(variablenode_ns_1_s_sim_testvaruint32_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_11_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarUInt32") +); +} + +/* TestVarSByte - ns=1;s=Sim.TestVarSByte */ + +static UA_StatusCode function_opcuaTestNodeSet_12_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 2LU); +UA_SByte *variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents = UA_SByte_new(); +if (!variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_SByte_init(variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents); +*variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents = (UA_SByte) -128; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents, &UA_TYPES[UA_TYPES_SBYTE]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarSByte"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarSByte"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarSByte"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_SByte_delete(variablenode_ns_1_s_sim_testvarsbyte_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_12_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarSByte") +); +} + +/* TestVarInt32 - ns=1;s=Sim.TestVarInt32 */ + +static UA_StatusCode function_opcuaTestNodeSet_13_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 6LU); +UA_Int32 *variablenode_ns_1_s_sim_testvarint32_variant_DataContents = UA_Int32_new(); +if (!variablenode_ns_1_s_sim_testvarint32_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int32_init(variablenode_ns_1_s_sim_testvarint32_variant_DataContents); +*variablenode_ns_1_s_sim_testvarint32_variant_DataContents = (UA_Int32) -2147483648; +UA_Variant_setScalar(&attr.value, variablenode_ns_1_s_sim_testvarint32_variant_DataContents, &UA_TYPES[UA_TYPES_INT32]); +attr.displayName = UA_LOCALIZEDTEXT("", "TestVarInt32"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt32"), +UA_NODEID_STRING(ns[1], "Sim"), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[1], "TestVarInt32"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int32_delete(variablenode_ns_1_s_sim_testvarint32_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_opcuaTestNodeSet_13_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_STRING(ns[1], "Sim.TestVarInt32") +); +} + +UA_StatusCode opcuaTestNodeSet(UA_Server *server) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +/* Use namespace ids generated by the server */ +UA_UInt16 ns[2]; +ns[0] = UA_Server_addNamespace(server, "http://opcfoundation.org/UA/"); +ns[1] = UA_Server_addNamespace(server, "http://ess.eu/OpcUa"); + +/* Load custom datatype definitions into the server */ +bool dummy = ( +!(retVal = function_opcuaTestNodeSet_0_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_1_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_2_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_3_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_4_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_5_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_6_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_7_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_8_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_9_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_10_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_11_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_12_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_13_begin(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_13_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_12_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_11_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_10_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_9_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_8_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_7_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_6_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_5_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_4_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_3_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_2_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_1_finish(server, ns)) +&& !(retVal = function_opcuaTestNodeSet_0_finish(server, ns)) +); (void)(dummy); +return retVal; +} diff --git a/test/server/opcuaTestNodeSet.h b/test/server/opcuaTestNodeSet.h new file mode 100644 index 0000000000000000000000000000000000000000..5f51c96ed998d2de91dd518a16fcbea4173e5b18 --- /dev/null +++ b/test/server/opcuaTestNodeSet.h @@ -0,0 +1,22 @@ +/* WARNING: This is a generated file. + * Any manual changes will be overwritten. */ + +#ifndef OPCUATESTNODESET_H_ +#define OPCUATESTNODESET_H_ + + +#ifdef UA_ENABLE_AMALGAMATION +# include "open62541.h" +#else +# include <open62541/server.h> +#endif + + + +_UA_BEGIN_DECLS + +extern UA_StatusCode opcuaTestNodeSet(UA_Server *server); + +_UA_END_DECLS + +#endif /* OPCUATESTNODESET_H_ */ diff --git a/test/server/opcuaTestServer.c b/test/server/opcuaTestServer.c new file mode 100644 index 0000000000000000000000000000000000000000..9d5fe7a20c0e1659d28526a306298585b2b7cd11 --- /dev/null +++ b/test/server/opcuaTestServer.c @@ -0,0 +1,113 @@ +#include <signal.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <pthread.h> +#include "open62541.h" +#include "opcuaTestNodeSet.h" + +/* Local definitions */ +#define SLEEP_TIME_MS 1000 +#define MAX_COUNT 1000 + +/* Structure definition for passing to the + * thread simulation routine. + * Server and namespace variables + */ +struct simThreadParams { + UA_UInt16 *ns; + UA_Server *server; +}; + +/* Global variable to enable / disbable the server */ +static volatile UA_Boolean running = true; + +/* Handler to trigger server stop. + * Triggered by Ctrl+c. + */ +static void stopHandler(int sig) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "received ctrl-c"); + running = false; +} +/* Simulation routine. To be launched as a parallel thread */ +void *simVariable(void *ptr) { + + struct simThreadParams *threadParams = ptr; + int utime = SLEEP_TIME_MS * 1000; + int count = 0; + UA_Variant value; + UA_Double cntDouble; + UA_Server *server = *(&threadParams->server); + + /* While the server is running */ + while(running) { + + /* Increment count */ + if (count >= MAX_COUNT) { + count = 0; + } else { + count++; + } + + /* Cast value, assign variant, and write to server */ + cntDouble = (UA_Double)count; + UA_Variant_setScalarCopy(&value, &cntDouble, &UA_TYPES[UA_TYPES_DOUBLE]); + UA_Server_writeValue(server, UA_NODEID_STRING((*(&threadParams->ns))[1], "Sim.TestRamp"), value); + + /* Sleep the thread */ + usleep(utime); + } + + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Exiting thread"); +} + +int main(void) { + signal(SIGINT, stopHandler); + signal(SIGTERM, stopHandler); + + /* Create new server using default configuration */ + UA_Server *server = UA_Server_new(); + UA_ServerConfig_setDefault(UA_Server_getConfig(server)); + + /* Use namespace ids generated by the server */ + UA_UInt16 ns[2]; + ns[0] = UA_Server_addNamespace(server, "http://opcfoundation.org/UA/"); + ns[1] = UA_Server_addNamespace(server, "http://ess.eu/OpcUa"); + + /* Add simulation NodeSet */ + UA_StatusCode retval = opcuaTestNodeSet(server); + + pthread_t threadSim; + int ret = 0; + + /* Create struct to pass to threaded simulation routine + * Contains server and namespace variables + */ + struct simThreadParams threadParams; + threadParams.server = server; + threadParams.ns = ns; + + /* Create nodes from nodeset */ + if(retval != 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 { + ret = pthread_create( &threadSim, NULL, simVariable, &threadParams); + if(ret) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Error - pthread_create(): %d", ret); + exit(EXIT_FAILURE); + } + /* Main server loop. Will remain in this function + * while running = true + */ + retval = UA_Server_run(server, &running); + } + + /* Give thread enough time to exit */ + usleep(SLEEP_TIME_MS * 1000); + + /* Cleanup and return */ + UA_Server_delete(server); + return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/test/server/open62541.c b/test/server/open62541.c new file mode 100644 index 0000000000000000000000000000000000000000..3541d176756b04a9dd5b8230c3d6b9717ec6a8b1 --- /dev/null +++ b/test/server/open62541.c @@ -0,0 +1,70670 @@ +/* THIS IS A SINGLE-FILE DISTRIBUTION CONCATENATED FROM THE OPEN62541 SOURCES + * visit http://open62541.org/ for information about this software + * Git-Revision: v1.2-29-g875d33a9 + */ + +/* + * Copyright (C) 2014-2018 the contributors as stated in the AUTHORS file + * + * This file is part of open62541. open62541 is free software: you can + * redistribute it and/or modify it under the terms of the Mozilla Public + * License v2.0 as stated in the LICENSE file provided with open62541. + * + * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. + */ + +#ifndef UA_DYNAMIC_LINKING_EXPORT +# define UA_DYNAMIC_LINKING_EXPORT +# define MDNSD_DYNAMIC_LINKING +#endif + +/* Disable security warnings for BSD sockets on MSVC */ +#ifdef _MSC_VER +# define _CRT_SECURE_NO_WARNINGS +#endif + +#include "open62541.h" + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/open62541_queue.h" ***********************************/ + +/* $OpenBSD: queue.h,v 1.38 2013/07/03 15:05:21 fgsch Exp $ */ +/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * + * A singly-linked list is headed by a single forward pointer. The elements + * are singly linked for minimum space and pointer manipulation overhead at + * the expense of O(n) removal for arbitrary elements. New elements can be + * added to the list after an existing element or at the head of the list. + * Elements being removed from the head of the list should use the explicit + * macro for this purpose for optimum efficiency. A singly-linked list may + * only be traversed in the forward direction. Singly-linked lists are ideal + * for applications with large datasets and few or no removals or for + * implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +#if defined(QUEUE_MACRO_DEBUG) || (defined(_KERNEL) && defined(DIAGNOSTIC)) +#define _Q_INVALIDATE(a) (a) = ((void *)-1) +#else +#define _Q_INVALIDATE(a) +#endif + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List access methods. + */ +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_END(head) NULL +#define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = SLIST_FIRST(head); \ + (var) != SLIST_END(head); \ + (var) = SLIST_NEXT(var, field)) + +#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = SLIST_FIRST(head); \ + (var) && ((tvar) = SLIST_NEXT(var, field), 1); \ + (var) = (tvar)) + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) { \ + SLIST_FIRST(head) = SLIST_END(head); \ +} + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (0) + +#define SLIST_REMOVE_AFTER(elm, field) do { \ + (elm)->field.sle_next = (elm)->field.sle_next->field.sle_next; \ +} while (0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->slh_first; \ + \ + while (curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + _Q_INVALIDATE((elm)->field.sle_next); \ + } \ +} while (0) + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List access methods + */ +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_END(head) NULL +#define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + +#define LIST_FOREACH(var, head, field) \ + for((var) = LIST_FIRST(head); \ + (var)!= LIST_END(head); \ + (var) = LIST_NEXT(var, field)) + +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST(head); \ + (var) && ((tvar) = LIST_NEXT(var, field), 1); \ + (var) = (tvar)) + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + LIST_FIRST(head) = LIST_END(head); \ +} while (0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ + _Q_INVALIDATE((elm)->field.le_prev); \ + _Q_INVALIDATE((elm)->field.le_next); \ +} while (0) + +#define LIST_REPLACE(elm, elm2, field) do { \ + if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \ + (elm2)->field.le_next->field.le_prev = \ + &(elm2)->field.le_next; \ + (elm2)->field.le_prev = (elm)->field.le_prev; \ + *(elm2)->field.le_prev = (elm2); \ + _Q_INVALIDATE((elm)->field.le_prev); \ + _Q_INVALIDATE((elm)->field.le_next); \ +} while (0) + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_END(head) NULL +#define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for((var) = SIMPLEQ_FIRST(head); \ + (var) != SIMPLEQ_END(head); \ + (var) = SIMPLEQ_NEXT(var, field)) + +#define SIMPLEQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = SIMPLEQ_FIRST(head); \ + (var) && ((tvar) = SIMPLEQ_NEXT(var, field), 1); \ + (var) = (tvar)) + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (0) + +#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ + if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \ + == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (0) + +/* + * XOR Simple queue definitions. + */ +#define XSIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqx_first; /* first element */ \ + struct type **sqx_last; /* addr of last next element */ \ + unsigned long sqx_cookie; \ +} + +#define XSIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqx_next; /* next element */ \ +} + +/* + * XOR Simple queue access methods. + */ +#define XSIMPLEQ_XOR(head, ptr) ((__typeof(ptr))((head)->sqx_cookie ^ \ + (unsigned long)(ptr))) +#define XSIMPLEQ_FIRST(head) XSIMPLEQ_XOR(head, ((head)->sqx_first)) +#define XSIMPLEQ_END(head) NULL +#define XSIMPLEQ_EMPTY(head) (XSIMPLEQ_FIRST(head) == XSIMPLEQ_END(head)) +#define XSIMPLEQ_NEXT(head, elm, field) XSIMPLEQ_XOR(head, ((elm)->field.sqx_next)) + + +#define XSIMPLEQ_FOREACH(var, head, field) \ + for ((var) = XSIMPLEQ_FIRST(head); \ + (var) != XSIMPLEQ_END(head); \ + (var) = XSIMPLEQ_NEXT(head, var, field)) + +#define XSIMPLEQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = XSIMPLEQ_FIRST(head); \ + (var) && ((tvar) = XSIMPLEQ_NEXT(head, var, field), 1); \ + (var) = (tvar)) + +/* + * XOR Simple queue functions. + */ +#define XSIMPLEQ_INIT(head) do { \ + arc4random_buf(&(head)->sqx_cookie, sizeof((head)->sqx_cookie)); \ + (head)->sqx_first = XSIMPLEQ_XOR(head, NULL); \ + (head)->sqx_last = XSIMPLEQ_XOR(head, &(head)->sqx_first); \ +} while (0) + +#define XSIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqx_next = (head)->sqx_first) == \ + XSIMPLEQ_XOR(head, NULL)) \ + (head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \ + (head)->sqx_first = XSIMPLEQ_XOR(head, (elm)); \ +} while (0) + +#define XSIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqx_next = XSIMPLEQ_XOR(head, NULL); \ + *(XSIMPLEQ_XOR(head, (head)->sqx_last)) = XSIMPLEQ_XOR(head, (elm)); \ + (head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \ +} while (0) + +#define XSIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqx_next = (listelm)->field.sqx_next) == \ + XSIMPLEQ_XOR(head, NULL)) \ + (head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \ + (listelm)->field.sqx_next = XSIMPLEQ_XOR(head, (elm)); \ +} while (0) + +#define XSIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqx_first = XSIMPLEQ_XOR(head, \ + (head)->sqx_first)->field.sqx_next) == XSIMPLEQ_XOR(head, NULL)) \ + (head)->sqx_last = XSIMPLEQ_XOR(head, &(head)->sqx_first); \ +} while (0) + +#define XSIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ + if (((elm)->field.sqx_next = XSIMPLEQ_XOR(head, \ + (elm)->field.sqx_next)->field.sqx_next) \ + == XSIMPLEQ_XOR(head, NULL)) \ + (head)->sqx_last = \ + XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \ +} while (0) + + +/* + * Tail queue definitions. + */ +#define TAILQ_HEAD(name, type) \ +struct name { \ + struct type *tqh_first; /* first element */ \ + struct type **tqh_last; /* addr of last next element */ \ +} + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define TAILQ_ENTRY(type) \ +struct { \ + struct type *tqe_next; /* next element */ \ + struct type **tqe_prev; /* address of previous next element */ \ +} + +/* + * tail queue access methods + */ +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_END(head) NULL +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +/* XXX */ +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) +#define TAILQ_EMPTY(head) \ + (TAILQ_FIRST(head) == TAILQ_END(head)) + +#define TAILQ_FOREACH(var, head, field) \ + for((var) = TAILQ_FIRST(head); \ + (var) != TAILQ_END(head); \ + (var) = TAILQ_NEXT(var, field)) + +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST(head); \ + (var) != TAILQ_END(head) && \ + ((tvar) = TAILQ_NEXT(var, field), 1); \ + (var) = (tvar)) + + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for((var) = TAILQ_LAST(head, headname); \ + (var) != TAILQ_END(head); \ + (var) = TAILQ_PREV(var, headname, field)) + +#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ + for ((var) = TAILQ_LAST(head, headname); \ + (var) != TAILQ_END(head) && \ + ((tvar) = TAILQ_PREV(var, headname, field), 1); \ + (var) = (tvar)) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ + _Q_INVALIDATE((elm)->field.tqe_prev); \ + _Q_INVALIDATE((elm)->field.tqe_next); \ +} while (0) + +#define TAILQ_REPLACE(head, elm, elm2, field) do { \ + if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \ + (elm2)->field.tqe_next->field.tqe_prev = \ + &(elm2)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm2)->field.tqe_next; \ + (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ + *(elm2)->field.tqe_prev = (elm2); \ + _Q_INVALIDATE((elm)->field.tqe_prev); \ + _Q_INVALIDATE((elm)->field.tqe_next); \ +} while (0) + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { CIRCLEQ_END(&head), CIRCLEQ_END(&head) } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue access methods + */ +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_END(head) ((void *)(head)) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) +#define CIRCLEQ_EMPTY(head) \ + (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head)) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for((var) = CIRCLEQ_FIRST(head); \ + (var) != CIRCLEQ_END(head); \ + (var) = CIRCLEQ_NEXT(var, field)) + +#define CIRCLEQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = CIRCLEQ_FIRST(head); \ + (var) != CIRCLEQ_END(head) && \ + ((tvar) = CIRCLEQ_NEXT(var, field), 1); \ + (var) = (tvar)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for((var) = CIRCLEQ_LAST(head); \ + (var) != CIRCLEQ_END(head); \ + (var) = CIRCLEQ_PREV(var, field)) + +#define CIRCLEQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ + for ((var) = CIRCLEQ_LAST(head, headname); \ + (var) != CIRCLEQ_END(head) && \ + ((tvar) = CIRCLEQ_PREV(var, headname, field), 1); \ + (var) = (tvar)) + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = CIRCLEQ_END(head); \ + (head)->cqh_last = CIRCLEQ_END(head); \ +} while (0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = CIRCLEQ_END(head); \ + if ((head)->cqh_last == CIRCLEQ_END(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = CIRCLEQ_END(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == CIRCLEQ_END(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ + _Q_INVALIDATE((elm)->field.cqe_prev); \ + _Q_INVALIDATE((elm)->field.cqe_next); \ +} while (0) + +#define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ + if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \ + CIRCLEQ_END(head)) \ + (head)->cqh_last = (elm2); \ + else \ + (elm2)->field.cqe_next->field.cqe_prev = (elm2); \ + if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \ + CIRCLEQ_END(head)) \ + (head)->cqh_first = (elm2); \ + else \ + (elm2)->field.cqe_prev->field.cqe_next = (elm2); \ + _Q_INVALIDATE((elm)->field.cqe_prev); \ + _Q_INVALIDATE((elm)->field.cqe_next); \ +} while (0) + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/pcg_basic.h" ***********************************/ + +/* + * PCG Random Number Generation for C. + * + * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For additional information about the PCG random number generation scheme, + * including its license and other licensing options, visit + * + * http://www.pcg-random.org + */ + + + +#ifdef __cplusplus +extern "C" { +#endif + +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 + * *always* be odd. */ +} pcg32_random_t; + +#define PCG32_INITIALIZER { 0x853c49e6748fea9bULL, 0xda3e39cb94b95bdbULL } + +void pcg32_srandom_r(pcg32_random_t* rng, uint64_t initial_state, uint64_t initseq); +uint32_t pcg32_random_r(pcg32_random_t* rng); + +#ifdef __cplusplus +} +#endif + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/libc_time.h" ***********************************/ + + +struct mytm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; +}; + +int __secs_to_tm(long long t, struct mytm *tm); +long long __tm_to_secs(const struct mytm *tm); + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/base64.h" ***********************************/ + +#ifndef UA_BASE64_H_ +#define UA_BASE64_H_ + + +_UA_BEGIN_DECLS + +#include <stddef.h> + +/** + * base64_encode - Base64 encode + * @src: Data to be encoded + * @len: Length of the data to be encoded + * @out_len: Pointer to output length variable + * Returns: Allocated buffer of out_len bytes of encoded data, + * or %NULL on failure. The output is NOT Null-terminated. */ +unsigned char * +UA_base64(const unsigned char *src, size_t len, size_t *out_len); + +/** + * base64_decode - Base64 decode + * @src: Data to be decoded + * @len: Length of the data to be decoded + * @out_len: Pointer to output length variable + * Returns: Allocated buffer of out_len bytes of decoded data, + * or %NULL on failure. */ +unsigned char * +UA_unbase64(const unsigned char *src, size_t len, size_t *out_len); + +_UA_END_DECLS + +#endif /* UA_BASE64_H_ */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_util_internal.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2015 (c) LEvertz + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +#define UA_INTERNAL + +_UA_BEGIN_DECLS + +/* Macro-Expand for MSVC workarounds */ +#define UA_MACRO_EXPAND(x) x + +/* Print a NodeId in logs */ +#define UA_LOG_NODEID_INTERNAL(NODEID, LOG) \ + do { \ + UA_String nodeIdStr = UA_STRING_NULL; \ + UA_NodeId_print(NODEID, &nodeIdStr); \ + LOG; \ + UA_String_clear(&nodeIdStr); \ + } while(0); + +#if UA_LOGLEVEL <= 100 +# define UA_LOG_NODEID_TRACE(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_TRACE(NODEID, LOG) +#endif + +#if UA_LOGLEVEL <= 200 +# define UA_LOG_NODEID_DEBUG(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_DEBUG(NODEID, LOG) +#endif + +#if UA_LOGLEVEL <= 300 +# define UA_LOG_NODEID_INFO(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_INFO(NODEID, LOG) +#endif + +#if UA_LOGLEVEL <= 400 +# define UA_LOG_NODEID_WARNING(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_WARNING(NODEID, LOG) +#endif + +#if UA_LOGLEVEL <= 500 +# define UA_LOG_NODEID_ERROR(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_ERROR(NODEID, LOG) +#endif + +#if UA_LOGLEVEL <= 600 +# define UA_LOG_NODEID_FATAL(NODEID, LOG) \ + UA_LOG_NODEID_INTERNAL(NODEID, LOG) +#else +# define UA_LOG_NODEID_FATAL(NODEID, LOG) +#endif + +/* Short names for integer. These are not exposed on the public API, since many + * user-applications make the same definitions in their headers. */ +typedef UA_Byte u8; +typedef UA_SByte i8; +typedef UA_UInt16 u16; +typedef UA_Int16 i16; +typedef UA_UInt32 u32; +typedef UA_Int32 i32; +typedef UA_UInt64 u64; +typedef UA_Int64 i64; +typedef UA_StatusCode status; + +/** + * Utility Functions + * ----------------- */ + +const UA_DataType * +UA_findDataTypeWithCustom(const UA_NodeId *typeId, + const UA_DataTypeArray *customTypes); + +/* Get the number of optional fields contained in an structure type */ +size_t UA_EXPORT +getCountOfOptionalFields(const UA_DataType *type); + +/* Dump packet for debugging / fuzzing */ +#ifdef UA_DEBUG_DUMP_PKGS +void UA_EXPORT +UA_dump_hex_pkg(UA_Byte* buffer, size_t bufferLen); +#endif + +/* Unions that represent any of the supported request or response message */ +typedef union { + UA_RequestHeader requestHeader; + UA_FindServersRequest findServersRequest; + UA_GetEndpointsRequest getEndpointsRequest; +#ifdef UA_ENABLE_DISCOVERY +# ifdef UA_ENABLE_DISCOVERY_MULTICAST + UA_FindServersOnNetworkRequest findServersOnNetworkRequest; +# endif + UA_RegisterServerRequest registerServerRequest; + UA_RegisterServer2Request registerServer2Request; +#endif + UA_OpenSecureChannelRequest openSecureChannelRequest; + UA_CreateSessionRequest createSessionRequest; + UA_ActivateSessionRequest activateSessionRequest; + UA_CloseSessionRequest closeSessionRequest; + UA_AddNodesRequest addNodesRequest; + UA_AddReferencesRequest addReferencesRequest; + UA_DeleteNodesRequest deleteNodesRequest; + UA_DeleteReferencesRequest deleteReferencesRequest; + UA_BrowseRequest browseRequest; + UA_BrowseNextRequest browseNextRequest; + UA_TranslateBrowsePathsToNodeIdsRequest translateBrowsePathsToNodeIdsRequest; + UA_RegisterNodesRequest registerNodesRequest; + UA_UnregisterNodesRequest unregisterNodesRequest; + UA_ReadRequest readRequest; + UA_WriteRequest writeRequest; +#ifdef UA_ENABLE_HISTORIZING + UA_HistoryReadRequest historyReadRequest; + UA_HistoryUpdateRequest historyUpdateRequest; +#endif +#ifdef UA_ENABLE_METHODCALLS + UA_CallRequest callRequest; +#endif +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_CreateMonitoredItemsRequest createMonitoredItemsRequest; + UA_DeleteMonitoredItemsRequest deleteMonitoredItemsRequest; + UA_ModifyMonitoredItemsRequest modifyMonitoredItemsRequest; + UA_SetMonitoringModeRequest setMonitoringModeRequest; + UA_CreateSubscriptionRequest createSubscriptionRequest; + UA_ModifySubscriptionRequest modifySubscriptionRequest; + UA_SetPublishingModeRequest setPublishingModeRequest; + UA_PublishRequest publishRequest; + UA_RepublishRequest republishRequest; + UA_DeleteSubscriptionsRequest deleteSubscriptionsRequest; +#endif +} UA_Request; + +typedef union { + UA_ResponseHeader responseHeader; + UA_FindServersResponse findServersResponse; + UA_GetEndpointsResponse getEndpointsResponse; +#ifdef UA_ENABLE_DISCOVERY +# ifdef UA_ENABLE_DISCOVERY_MULTICAST + UA_FindServersOnNetworkResponse findServersOnNetworkResponse; +# endif + UA_RegisterServerResponse registerServerResponse; + UA_RegisterServer2Response registerServer2Response; +#endif + UA_OpenSecureChannelResponse openSecureChannelResponse; + UA_CreateSessionResponse createSessionResponse; + UA_ActivateSessionResponse activateSessionResponse; + UA_CloseSessionResponse closeSessionResponse; + UA_AddNodesResponse addNodesResponse; + UA_AddReferencesResponse addReferencesResponse; + UA_DeleteNodesResponse deleteNodesResponse; + UA_DeleteReferencesResponse deleteReferencesResponse; + UA_BrowseResponse browseResponse; + UA_BrowseNextResponse browseNextResponse; + UA_TranslateBrowsePathsToNodeIdsResponse translateBrowsePathsToNodeIdsResponse; + UA_RegisterNodesResponse registerNodesResponse; + UA_UnregisterNodesResponse unregisterNodesResponse; + UA_ReadResponse readResponse; + UA_WriteResponse writeResponse; +#ifdef UA_ENABLE_HISTORIZING + UA_HistoryReadResponse historyReadResponse; + UA_HistoryUpdateResponse historyUpdateResponse; +#endif +#ifdef UA_ENABLE_METHODCALLS + UA_CallResponse callResponse; +#endif +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_CreateMonitoredItemsResponse createMonitoredItemsResponse; + UA_DeleteMonitoredItemsResponse deleteMonitoredItemsResponse; + UA_ModifyMonitoredItemsResponse modifyMonitoredItemsResponse; + UA_SetMonitoringModeResponse setMonitoringModeResponse; + UA_CreateSubscriptionResponse createSubscriptionResponse; + UA_ModifySubscriptionResponse modifySubscriptionResponse; + UA_SetPublishingModeResponse setPublishingModeResponse; + UA_PublishResponse publishResponse; + UA_RepublishResponse republishResponse; + UA_DeleteSubscriptionsResponse deleteSubscriptionsResponse; +#endif +} UA_Response; + +/* Do not expose UA_String_equal_ignorecase to public API as it currently only handles + * ASCII strings, and not UTF8! */ +UA_Boolean UA_EXPORT +UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_types_encoding_binary.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Sten Grüner + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + + +_UA_BEGIN_DECLS + +typedef UA_StatusCode (*UA_exchangeEncodeBuffer)(void *handle, UA_Byte **bufPos, + const UA_Byte **bufEnd); + +/* Encodes the scalar value described by type in the binary encoding. Encoding + * is thread-safe if thread-local variables are enabled. Encoding is also + * reentrant and can be safely called from signal handlers or interrupts. + * + * @param src The value. Must not be NULL. + * @param type The value type. Must not be NULL. + * @param bufPos Points to a pointer to the current position in the encoding + * buffer. Must not be NULL. The pointer is advanced by the number of + * encoded bytes, or, if the buffer is exchanged, to the position in the + * new buffer. + * @param bufEnd Points to a pointer to the end of the encoding buffer (encoding + * always stops before *buf_end). Must not be NULL. The pointer is + * changed when the buffer is exchanged. + * @param exchangeCallback Called when the end of the buffer is reached. This is + used to send out a message chunk before continuing with the encoding. + Is ignored if NULL. + * @param exchangeHandle Custom data passed into the exchangeCallback. + * @return Returns a statuscode whether encoding succeeded. */ +UA_StatusCode +UA_encodeBinary(const void *src, const UA_DataType *type, + UA_Byte **bufPos, const UA_Byte **bufEnd, + UA_exchangeEncodeBuffer exchangeCallback, + void *exchangeHandle) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +/* Decodes a scalar value described by type from binary encoding. Decoding + * is thread-safe if thread-local variables are enabled. Decoding is also + * reentrant and can be safely called from signal handlers or interrupts. + * + * @param src The buffer with the binary encoded value. Must not be NULL. + * @param offset The current position in the buffer. Must not be NULL. The value + * is advanced as decoding progresses. + * @param dst The target value. Must not be NULL. The target is assumed to have + * size type->memSize. The value is reset to zero before decoding. If + * decoding fails, members are deleted and the value is reset (zeroed) + * again. + * @param type The value type. Must not be NULL. + * @param customTypesSize The number of non-standard datatypes contained in the + * customTypes array. + * @param customTypes An array of non-standard datatypes (not included in + * UA_TYPES). Can be NULL if customTypesSize is zero. + * @return Returns a statuscode whether decoding succeeded. */ +UA_StatusCode +UA_decodeBinary(const UA_ByteString *src, size_t *offset, void *dst, + const UA_DataType *type, const UA_DataTypeArray *customTypes) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +/* Returns the number of bytes the value p takes in binary encoding. Returns + * zero if an error occurs. UA_calcSizeBinary is thread-safe and reentrant since + * it does not access global (thread-local) variables. */ +size_t +UA_calcSizeBinary(const void *p, const UA_DataType *type); + +const UA_DataType * +UA_findDataTypeByBinary(const UA_NodeId *typeId); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/types_generated_encoding_binary.h" ***********************************/ + +/* Generated from Opc.Ua.Types.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:02 */ + + +#ifdef UA_ENABLE_AMALGAMATION +#else +#endif + + + +/* Boolean */ +static UA_INLINE size_t +UA_Boolean_calcSizeBinary(const UA_Boolean *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BOOLEAN]); +} +static UA_INLINE UA_StatusCode +UA_Boolean_encodeBinary(const UA_Boolean *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BOOLEAN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Boolean_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Boolean *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BOOLEAN], NULL); +} + +/* SByte */ +static UA_INLINE size_t +UA_SByte_calcSizeBinary(const UA_SByte *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SBYTE]); +} +static UA_INLINE UA_StatusCode +UA_SByte_encodeBinary(const UA_SByte *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SBYTE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SByte_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SByte *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SBYTE], NULL); +} + +/* Byte */ +static UA_INLINE size_t +UA_Byte_calcSizeBinary(const UA_Byte *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BYTE]); +} +static UA_INLINE UA_StatusCode +UA_Byte_encodeBinary(const UA_Byte *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BYTE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Byte_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Byte *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BYTE], NULL); +} + +/* Int16 */ +static UA_INLINE size_t +UA_Int16_calcSizeBinary(const UA_Int16 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_INT16]); +} +static UA_INLINE UA_StatusCode +UA_Int16_encodeBinary(const UA_Int16 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_INT16], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Int16_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Int16 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_INT16], NULL); +} + +/* UInt16 */ +static UA_INLINE size_t +UA_UInt16_calcSizeBinary(const UA_UInt16 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UINT16]); +} +static UA_INLINE UA_StatusCode +UA_UInt16_encodeBinary(const UA_UInt16 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UINT16], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UInt16_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UInt16 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UINT16], NULL); +} + +/* Int32 */ +static UA_INLINE size_t +UA_Int32_calcSizeBinary(const UA_Int32 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_INT32]); +} +static UA_INLINE UA_StatusCode +UA_Int32_encodeBinary(const UA_Int32 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_INT32], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Int32_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Int32 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_INT32], NULL); +} + +/* UInt32 */ +static UA_INLINE size_t +UA_UInt32_calcSizeBinary(const UA_UInt32 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UINT32]); +} +static UA_INLINE UA_StatusCode +UA_UInt32_encodeBinary(const UA_UInt32 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UINT32], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UInt32_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UInt32 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UINT32], NULL); +} + +/* Int64 */ +static UA_INLINE size_t +UA_Int64_calcSizeBinary(const UA_Int64 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_INT64]); +} +static UA_INLINE UA_StatusCode +UA_Int64_encodeBinary(const UA_Int64 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_INT64], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Int64_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Int64 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_INT64], NULL); +} + +/* UInt64 */ +static UA_INLINE size_t +UA_UInt64_calcSizeBinary(const UA_UInt64 *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UINT64]); +} +static UA_INLINE UA_StatusCode +UA_UInt64_encodeBinary(const UA_UInt64 *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UINT64], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UInt64_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UInt64 *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UINT64], NULL); +} + +/* Float */ +static UA_INLINE size_t +UA_Float_calcSizeBinary(const UA_Float *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_FLOAT]); +} +static UA_INLINE UA_StatusCode +UA_Float_encodeBinary(const UA_Float *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_FLOAT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Float_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Float *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_FLOAT], NULL); +} + +/* Double */ +static UA_INLINE size_t +UA_Double_calcSizeBinary(const UA_Double *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DOUBLE]); +} +static UA_INLINE UA_StatusCode +UA_Double_encodeBinary(const UA_Double *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DOUBLE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Double_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Double *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DOUBLE], NULL); +} + +/* String */ +static UA_INLINE size_t +UA_String_calcSizeBinary(const UA_String *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STRING]); +} +static UA_INLINE UA_StatusCode +UA_String_encodeBinary(const UA_String *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STRING], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_String_decodeBinary(const UA_ByteString *src, size_t *offset, UA_String *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STRING], NULL); +} + +/* DateTime */ +static UA_INLINE size_t +UA_DateTime_calcSizeBinary(const UA_DateTime *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATETIME]); +} +static UA_INLINE UA_StatusCode +UA_DateTime_encodeBinary(const UA_DateTime *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATETIME], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DateTime_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DateTime *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATETIME], NULL); +} + +/* Guid */ +static UA_INLINE size_t +UA_Guid_calcSizeBinary(const UA_Guid *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_GUID]); +} +static UA_INLINE UA_StatusCode +UA_Guid_encodeBinary(const UA_Guid *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_GUID], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Guid_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Guid *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_GUID], NULL); +} + +/* ByteString */ +static UA_INLINE size_t +UA_ByteString_calcSizeBinary(const UA_ByteString *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BYTESTRING]); +} +static UA_INLINE UA_StatusCode +UA_ByteString_encodeBinary(const UA_ByteString *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BYTESTRING], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ByteString_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ByteString *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BYTESTRING], NULL); +} + +/* XmlElement */ +static UA_INLINE size_t +UA_XmlElement_calcSizeBinary(const UA_XmlElement *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_XMLELEMENT]); +} +static UA_INLINE UA_StatusCode +UA_XmlElement_encodeBinary(const UA_XmlElement *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_XMLELEMENT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_XmlElement_decodeBinary(const UA_ByteString *src, size_t *offset, UA_XmlElement *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_XMLELEMENT], NULL); +} + +/* NodeId */ +static UA_INLINE size_t +UA_NodeId_calcSizeBinary(const UA_NodeId *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_NODEID]); +} +static UA_INLINE UA_StatusCode +UA_NodeId_encodeBinary(const UA_NodeId *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_NODEID], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_NodeId_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NodeId *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_NODEID], NULL); +} + +/* ExpandedNodeId */ +static UA_INLINE size_t +UA_ExpandedNodeId_calcSizeBinary(const UA_ExpandedNodeId *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} +static UA_INLINE UA_StatusCode +UA_ExpandedNodeId_encodeBinary(const UA_ExpandedNodeId *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EXPANDEDNODEID], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ExpandedNodeId_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ExpandedNodeId *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EXPANDEDNODEID], NULL); +} + +/* StatusCode */ +static UA_INLINE size_t +UA_StatusCode_calcSizeBinary(const UA_StatusCode *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STATUSCODE]); +} +static UA_INLINE UA_StatusCode +UA_StatusCode_encodeBinary(const UA_StatusCode *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STATUSCODE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_StatusCode_decodeBinary(const UA_ByteString *src, size_t *offset, UA_StatusCode *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STATUSCODE], NULL); +} + +/* QualifiedName */ +static UA_INLINE size_t +UA_QualifiedName_calcSizeBinary(const UA_QualifiedName *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} +static UA_INLINE UA_StatusCode +UA_QualifiedName_encodeBinary(const UA_QualifiedName *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_QUALIFIEDNAME], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_QualifiedName_decodeBinary(const UA_ByteString *src, size_t *offset, UA_QualifiedName *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_QUALIFIEDNAME], NULL); +} + +/* LocalizedText */ +static UA_INLINE size_t +UA_LocalizedText_calcSizeBinary(const UA_LocalizedText *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} +static UA_INLINE UA_StatusCode +UA_LocalizedText_encodeBinary(const UA_LocalizedText *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_LocalizedText_decodeBinary(const UA_ByteString *src, size_t *offset, UA_LocalizedText *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], NULL); +} + +/* ExtensionObject */ +static UA_INLINE size_t +UA_ExtensionObject_calcSizeBinary(const UA_ExtensionObject *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} +static UA_INLINE UA_StatusCode +UA_ExtensionObject_encodeBinary(const UA_ExtensionObject *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ExtensionObject_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ExtensionObject *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT], NULL); +} + +/* DataValue */ +static UA_INLINE size_t +UA_DataValue_calcSizeBinary(const UA_DataValue *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATAVALUE]); +} +static UA_INLINE UA_StatusCode +UA_DataValue_encodeBinary(const UA_DataValue *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATAVALUE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DataValue_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataValue *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATAVALUE], NULL); +} + +/* Variant */ +static UA_INLINE size_t +UA_Variant_calcSizeBinary(const UA_Variant *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_VARIANT]); +} +static UA_INLINE UA_StatusCode +UA_Variant_encodeBinary(const UA_Variant *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_VARIANT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Variant_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Variant *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_VARIANT], NULL); +} + +/* DiagnosticInfo */ +static UA_INLINE size_t +UA_DiagnosticInfo_calcSizeBinary(const UA_DiagnosticInfo *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} +static UA_INLINE UA_StatusCode +UA_DiagnosticInfo_encodeBinary(const UA_DiagnosticInfo *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DiagnosticInfo_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DiagnosticInfo *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO], NULL); +} + +/* ViewAttributes */ +static UA_INLINE size_t +UA_ViewAttributes_calcSizeBinary(const UA_ViewAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_ViewAttributes_encodeBinary(const UA_ViewAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ViewAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ViewAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], NULL); +} + +/* XVType */ +static UA_INLINE size_t +UA_XVType_calcSizeBinary(const UA_XVType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_XVTYPE]); +} +static UA_INLINE UA_StatusCode +UA_XVType_encodeBinary(const UA_XVType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_XVTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_XVType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_XVType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_XVTYPE], NULL); +} + +/* ElementOperand */ +static UA_INLINE size_t +UA_ElementOperand_calcSizeBinary(const UA_ElementOperand *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} +static UA_INLINE UA_StatusCode +UA_ElementOperand_encodeBinary(const UA_ElementOperand *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ELEMENTOPERAND], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ElementOperand_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ElementOperand *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ELEMENTOPERAND], NULL); +} + +/* VariableAttributes */ +static UA_INLINE size_t +UA_VariableAttributes_calcSizeBinary(const UA_VariableAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_VariableAttributes_encodeBinary(const UA_VariableAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_VariableAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_VariableAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], NULL); +} + +/* EnumValueType */ +static UA_INLINE size_t +UA_EnumValueType_calcSizeBinary(const UA_EnumValueType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} +static UA_INLINE UA_StatusCode +UA_EnumValueType_encodeBinary(const UA_EnumValueType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ENUMVALUETYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EnumValueType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EnumValueType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ENUMVALUETYPE], NULL); +} + +/* EventFieldList */ +static UA_INLINE size_t +UA_EventFieldList_calcSizeBinary(const UA_EventFieldList *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} +static UA_INLINE UA_StatusCode +UA_EventFieldList_encodeBinary(const UA_EventFieldList *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EVENTFIELDLIST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EventFieldList_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EventFieldList *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EVENTFIELDLIST], NULL); +} + +/* MonitoredItemCreateResult */ +static UA_INLINE size_t +UA_MonitoredItemCreateResult_calcSizeBinary(const UA_MonitoredItemCreateResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateResult_encodeBinary(const UA_MonitoredItemCreateResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoredItemCreateResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT], NULL); +} + +/* EUInformation */ +static UA_INLINE size_t +UA_EUInformation_calcSizeBinary(const UA_EUInformation *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EUINFORMATION]); +} +static UA_INLINE UA_StatusCode +UA_EUInformation_encodeBinary(const UA_EUInformation *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EUINFORMATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EUInformation_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EUInformation *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EUINFORMATION], NULL); +} + +/* ServerDiagnosticsSummaryDataType */ +static UA_INLINE size_t +UA_ServerDiagnosticsSummaryDataType_calcSizeBinary(const UA_ServerDiagnosticsSummaryDataType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} +static UA_INLINE UA_StatusCode +UA_ServerDiagnosticsSummaryDataType_encodeBinary(const UA_ServerDiagnosticsSummaryDataType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ServerDiagnosticsSummaryDataType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ServerDiagnosticsSummaryDataType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE], NULL); +} + +/* ContentFilterElementResult */ +static UA_INLINE size_t +UA_ContentFilterElementResult_calcSizeBinary(const UA_ContentFilterElementResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterElementResult_encodeBinary(const UA_ContentFilterElementResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterElementResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ContentFilterElementResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT], NULL); +} + +/* LiteralOperand */ +static UA_INLINE size_t +UA_LiteralOperand_calcSizeBinary(const UA_LiteralOperand *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_LITERALOPERAND]); +} +static UA_INLINE UA_StatusCode +UA_LiteralOperand_encodeBinary(const UA_LiteralOperand *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_LITERALOPERAND], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_LiteralOperand_decodeBinary(const UA_ByteString *src, size_t *offset, UA_LiteralOperand *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_LITERALOPERAND], NULL); +} + +/* MessageSecurityMode */ +static UA_INLINE size_t +UA_MessageSecurityMode_calcSizeBinary(const UA_MessageSecurityMode *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} +static UA_INLINE UA_StatusCode +UA_MessageSecurityMode_encodeBinary(const UA_MessageSecurityMode *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MessageSecurityMode_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MessageSecurityMode *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE], NULL); +} + +/* UtcTime */ +static UA_INLINE size_t +UA_UtcTime_calcSizeBinary(const UA_UtcTime *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UTCTIME]); +} +static UA_INLINE UA_StatusCode +UA_UtcTime_encodeBinary(const UA_UtcTime *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UTCTIME], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UtcTime_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UtcTime *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UTCTIME], NULL); +} + +/* UserIdentityToken */ +static UA_INLINE size_t +UA_UserIdentityToken_calcSizeBinary(const UA_UserIdentityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_UserIdentityToken_encodeBinary(const UA_UserIdentityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UserIdentityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UserIdentityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN], NULL); +} + +/* X509IdentityToken */ +static UA_INLINE size_t +UA_X509IdentityToken_calcSizeBinary(const UA_X509IdentityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_X509IdentityToken_encodeBinary(const UA_X509IdentityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_X509IdentityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_X509IdentityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN], NULL); +} + +/* MonitoredItemNotification */ +static UA_INLINE size_t +UA_MonitoredItemNotification_calcSizeBinary(const UA_MonitoredItemNotification *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemNotification_encodeBinary(const UA_MonitoredItemNotification *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemNotification_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoredItemNotification *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION], NULL); +} + +/* StructureType */ +static UA_INLINE size_t +UA_StructureType_calcSizeBinary(const UA_StructureType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} +static UA_INLINE UA_StatusCode +UA_StructureType_encodeBinary(const UA_StructureType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STRUCTURETYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_StructureType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_StructureType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STRUCTURETYPE], NULL); +} + +/* ResponseHeader */ +static UA_INLINE size_t +UA_ResponseHeader_calcSizeBinary(const UA_ResponseHeader *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} +static UA_INLINE UA_StatusCode +UA_ResponseHeader_encodeBinary(const UA_ResponseHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_RESPONSEHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ResponseHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ResponseHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_RESPONSEHEADER], NULL); +} + +/* SignatureData */ +static UA_INLINE size_t +UA_SignatureData_calcSizeBinary(const UA_SignatureData *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} +static UA_INLINE UA_StatusCode +UA_SignatureData_encodeBinary(const UA_SignatureData *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SIGNATUREDATA], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SignatureData_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SignatureData *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SIGNATUREDATA], NULL); +} + +/* ModifySubscriptionResponse */ +static UA_INLINE size_t +UA_ModifySubscriptionResponse_calcSizeBinary(const UA_ModifySubscriptionResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionResponse_encodeBinary(const UA_ModifySubscriptionResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ModifySubscriptionResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE], NULL); +} + +/* NodeAttributes */ +static UA_INLINE size_t +UA_NodeAttributes_calcSizeBinary(const UA_NodeAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_NodeAttributes_encodeBinary(const UA_NodeAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_NODEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_NodeAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NodeAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_NODEATTRIBUTES], NULL); +} + +/* ActivateSessionResponse */ +static UA_INLINE size_t +UA_ActivateSessionResponse_calcSizeBinary(const UA_ActivateSessionResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_ActivateSessionResponse_encodeBinary(const UA_ActivateSessionResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ActivateSessionResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ActivateSessionResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE], NULL); +} + +/* EnumField */ +static UA_INLINE size_t +UA_EnumField_calcSizeBinary(const UA_EnumField *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ENUMFIELD]); +} +static UA_INLINE UA_StatusCode +UA_EnumField_encodeBinary(const UA_EnumField *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ENUMFIELD], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EnumField_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EnumField *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ENUMFIELD], NULL); +} + +/* VariableTypeAttributes */ +static UA_INLINE size_t +UA_VariableTypeAttributes_calcSizeBinary(const UA_VariableTypeAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_VariableTypeAttributes_encodeBinary(const UA_VariableTypeAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_VariableTypeAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_VariableTypeAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], NULL); +} + +/* CallMethodResult */ +static UA_INLINE size_t +UA_CallMethodResult_calcSizeBinary(const UA_CallMethodResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} +static UA_INLINE UA_StatusCode +UA_CallMethodResult_encodeBinary(const UA_CallMethodResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CALLMETHODRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CallMethodResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CallMethodResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CALLMETHODRESULT], NULL); +} + +/* MonitoringMode */ +static UA_INLINE size_t +UA_MonitoringMode_calcSizeBinary(const UA_MonitoringMode *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITORINGMODE]); +} +static UA_INLINE UA_StatusCode +UA_MonitoringMode_encodeBinary(const UA_MonitoringMode *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITORINGMODE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoringMode_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoringMode *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITORINGMODE], NULL); +} + +/* SetMonitoringModeResponse */ +static UA_INLINE size_t +UA_SetMonitoringModeResponse_calcSizeBinary(const UA_SetMonitoringModeResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeResponse_encodeBinary(const UA_SetMonitoringModeResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetMonitoringModeResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE], NULL); +} + +/* BrowseResultMask */ +static UA_INLINE size_t +UA_BrowseResultMask_calcSizeBinary(const UA_BrowseResultMask *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} +static UA_INLINE UA_StatusCode +UA_BrowseResultMask_encodeBinary(const UA_BrowseResultMask *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESULTMASK], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseResultMask_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseResultMask *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSERESULTMASK], NULL); +} + +/* RequestHeader */ +static UA_INLINE size_t +UA_RequestHeader_calcSizeBinary(const UA_RequestHeader *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REQUESTHEADER]); +} +static UA_INLINE UA_StatusCode +UA_RequestHeader_encodeBinary(const UA_RequestHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REQUESTHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RequestHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RequestHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REQUESTHEADER], NULL); +} + +/* MonitoredItemModifyResult */ +static UA_INLINE size_t +UA_MonitoredItemModifyResult_calcSizeBinary(const UA_MonitoredItemModifyResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyResult_encodeBinary(const UA_MonitoredItemModifyResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoredItemModifyResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT], NULL); +} + +/* CloseSecureChannelRequest */ +static UA_INLINE size_t +UA_CloseSecureChannelRequest_calcSizeBinary(const UA_CloseSecureChannelRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelRequest_encodeBinary(const UA_CloseSecureChannelRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CloseSecureChannelRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST], NULL); +} + +/* NotificationMessage */ +static UA_INLINE size_t +UA_NotificationMessage_calcSizeBinary(const UA_NotificationMessage *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} +static UA_INLINE UA_StatusCode +UA_NotificationMessage_encodeBinary(const UA_NotificationMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_NotificationMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NotificationMessage *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE], NULL); +} + +/* CreateSubscriptionResponse */ +static UA_INLINE size_t +UA_CreateSubscriptionResponse_calcSizeBinary(const UA_CreateSubscriptionResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionResponse_encodeBinary(const UA_CreateSubscriptionResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateSubscriptionResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE], NULL); +} + +/* EnumDefinition */ +static UA_INLINE size_t +UA_EnumDefinition_calcSizeBinary(const UA_EnumDefinition *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} +static UA_INLINE UA_StatusCode +UA_EnumDefinition_encodeBinary(const UA_EnumDefinition *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ENUMDEFINITION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EnumDefinition_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EnumDefinition *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ENUMDEFINITION], NULL); +} + +/* AxisScaleEnumeration */ +static UA_INLINE size_t +UA_AxisScaleEnumeration_calcSizeBinary(const UA_AxisScaleEnumeration *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} +static UA_INLINE UA_StatusCode +UA_AxisScaleEnumeration_encodeBinary(const UA_AxisScaleEnumeration *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AxisScaleEnumeration_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AxisScaleEnumeration *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION], NULL); +} + +/* BrowseDirection */ +static UA_INLINE size_t +UA_BrowseDirection_calcSizeBinary(const UA_BrowseDirection *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} +static UA_INLINE UA_StatusCode +UA_BrowseDirection_encodeBinary(const UA_BrowseDirection *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEDIRECTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseDirection_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseDirection *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEDIRECTION], NULL); +} + +/* CallMethodRequest */ +static UA_INLINE size_t +UA_CallMethodRequest_calcSizeBinary(const UA_CallMethodRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CallMethodRequest_encodeBinary(const UA_CallMethodRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CallMethodRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CallMethodRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST], NULL); +} + +/* ReadResponse */ +static UA_INLINE size_t +UA_ReadResponse_calcSizeBinary(const UA_ReadResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_READRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_ReadResponse_encodeBinary(const UA_ReadResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_READRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ReadResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ReadResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_READRESPONSE], NULL); +} + +/* TimestampsToReturn */ +static UA_INLINE size_t +UA_TimestampsToReturn_calcSizeBinary(const UA_TimestampsToReturn *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} +static UA_INLINE UA_StatusCode +UA_TimestampsToReturn_encodeBinary(const UA_TimestampsToReturn *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TimestampsToReturn_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TimestampsToReturn *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN], NULL); +} + +/* NodeClass */ +static UA_INLINE size_t +UA_NodeClass_calcSizeBinary(const UA_NodeClass *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_NODECLASS]); +} +static UA_INLINE UA_StatusCode +UA_NodeClass_encodeBinary(const UA_NodeClass *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_NODECLASS], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_NodeClass_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NodeClass *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_NODECLASS], NULL); +} + +/* ObjectTypeAttributes */ +static UA_INLINE size_t +UA_ObjectTypeAttributes_calcSizeBinary(const UA_ObjectTypeAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_ObjectTypeAttributes_encodeBinary(const UA_ObjectTypeAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ObjectTypeAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ObjectTypeAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], NULL); +} + +/* SecurityTokenRequestType */ +static UA_INLINE size_t +UA_SecurityTokenRequestType_calcSizeBinary(const UA_SecurityTokenRequestType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} +static UA_INLINE UA_StatusCode +UA_SecurityTokenRequestType_encodeBinary(const UA_SecurityTokenRequestType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SecurityTokenRequestType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SecurityTokenRequestType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE], NULL); +} + +/* CloseSessionResponse */ +static UA_INLINE size_t +UA_CloseSessionResponse_calcSizeBinary(const UA_CloseSessionResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CloseSessionResponse_encodeBinary(const UA_CloseSessionResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CloseSessionResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CloseSessionResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE], NULL); +} + +/* SetPublishingModeRequest */ +static UA_INLINE size_t +UA_SetPublishingModeRequest_calcSizeBinary(const UA_SetPublishingModeRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_SetPublishingModeRequest_encodeBinary(const UA_SetPublishingModeRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetPublishingModeRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetPublishingModeRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST], NULL); +} + +/* IssuedIdentityToken */ +static UA_INLINE size_t +UA_IssuedIdentityToken_calcSizeBinary(const UA_IssuedIdentityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_IssuedIdentityToken_encodeBinary(const UA_IssuedIdentityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_IssuedIdentityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_IssuedIdentityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN], NULL); +} + +/* DeleteMonitoredItemsResponse */ +static UA_INLINE size_t +UA_DeleteMonitoredItemsResponse_calcSizeBinary(const UA_DeleteMonitoredItemsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsResponse_encodeBinary(const UA_DeleteMonitoredItemsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteMonitoredItemsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE], NULL); +} + +/* ApplicationType */ +static UA_INLINE size_t +UA_ApplicationType_calcSizeBinary(const UA_ApplicationType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} +static UA_INLINE UA_StatusCode +UA_ApplicationType_encodeBinary(const UA_ApplicationType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_APPLICATIONTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ApplicationType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ApplicationType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_APPLICATIONTYPE], NULL); +} + +/* BrowseNextRequest */ +static UA_INLINE size_t +UA_BrowseNextRequest_calcSizeBinary(const UA_BrowseNextRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_BrowseNextRequest_encodeBinary(const UA_BrowseNextRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseNextRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseNextRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST], NULL); +} + +/* ModifySubscriptionRequest */ +static UA_INLINE size_t +UA_ModifySubscriptionRequest_calcSizeBinary(const UA_ModifySubscriptionRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionRequest_encodeBinary(const UA_ModifySubscriptionRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ModifySubscriptionRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST], NULL); +} + +/* BrowseDescription */ +static UA_INLINE size_t +UA_BrowseDescription_calcSizeBinary(const UA_BrowseDescription *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} +static UA_INLINE UA_StatusCode +UA_BrowseDescription_encodeBinary(const UA_BrowseDescription *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseDescription_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseDescription *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION], NULL); +} + +/* SignedSoftwareCertificate */ +static UA_INLINE size_t +UA_SignedSoftwareCertificate_calcSizeBinary(const UA_SignedSoftwareCertificate *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} +static UA_INLINE UA_StatusCode +UA_SignedSoftwareCertificate_encodeBinary(const UA_SignedSoftwareCertificate *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SignedSoftwareCertificate_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SignedSoftwareCertificate *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE], NULL); +} + +/* BrowsePathTarget */ +static UA_INLINE size_t +UA_BrowsePathTarget_calcSizeBinary(const UA_BrowsePathTarget *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} +static UA_INLINE UA_StatusCode +UA_BrowsePathTarget_encodeBinary(const UA_BrowsePathTarget *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowsePathTarget_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowsePathTarget *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET], NULL); +} + +/* WriteResponse */ +static UA_INLINE size_t +UA_WriteResponse_calcSizeBinary(const UA_WriteResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_WRITERESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_WriteResponse_encodeBinary(const UA_WriteResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_WRITERESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_WriteResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_WriteResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_WRITERESPONSE], NULL); +} + +/* AddNodesResult */ +static UA_INLINE size_t +UA_AddNodesResult_calcSizeBinary(const UA_AddNodesResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} +static UA_INLINE UA_StatusCode +UA_AddNodesResult_encodeBinary(const UA_AddNodesResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddNodesResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddNodesResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDNODESRESULT], NULL); +} + +/* AddReferencesItem */ +static UA_INLINE size_t +UA_AddReferencesItem_calcSizeBinary(const UA_AddReferencesItem *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesItem_encodeBinary(const UA_AddReferencesItem *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesItem_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddReferencesItem *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM], NULL); +} + +/* DeleteReferencesResponse */ +static UA_INLINE size_t +UA_DeleteReferencesResponse_calcSizeBinary(const UA_DeleteReferencesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesResponse_encodeBinary(const UA_DeleteReferencesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteReferencesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE], NULL); +} + +/* RelativePathElement */ +static UA_INLINE size_t +UA_RelativePathElement_calcSizeBinary(const UA_RelativePathElement *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} +static UA_INLINE UA_StatusCode +UA_RelativePathElement_encodeBinary(const UA_RelativePathElement *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RelativePathElement_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RelativePathElement *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT], NULL); +} + +/* SubscriptionAcknowledgement */ +static UA_INLINE size_t +UA_SubscriptionAcknowledgement_calcSizeBinary(const UA_SubscriptionAcknowledgement *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} +static UA_INLINE UA_StatusCode +UA_SubscriptionAcknowledgement_encodeBinary(const UA_SubscriptionAcknowledgement *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SubscriptionAcknowledgement_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SubscriptionAcknowledgement *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT], NULL); +} + +/* TransferResult */ +static UA_INLINE size_t +UA_TransferResult_calcSizeBinary(const UA_TransferResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} +static UA_INLINE UA_StatusCode +UA_TransferResult_encodeBinary(const UA_TransferResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TransferResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TransferResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TRANSFERRESULT], NULL); +} + +/* CreateMonitoredItemsResponse */ +static UA_INLINE size_t +UA_CreateMonitoredItemsResponse_calcSizeBinary(const UA_CreateMonitoredItemsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsResponse_encodeBinary(const UA_CreateMonitoredItemsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateMonitoredItemsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE], NULL); +} + +/* DeleteReferencesItem */ +static UA_INLINE size_t +UA_DeleteReferencesItem_calcSizeBinary(const UA_DeleteReferencesItem *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesItem_encodeBinary(const UA_DeleteReferencesItem *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesItem_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteReferencesItem *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM], NULL); +} + +/* WriteValue */ +static UA_INLINE size_t +UA_WriteValue_calcSizeBinary(const UA_WriteValue *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_WRITEVALUE]); +} +static UA_INLINE UA_StatusCode +UA_WriteValue_encodeBinary(const UA_WriteValue *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_WRITEVALUE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_WriteValue_decodeBinary(const UA_ByteString *src, size_t *offset, UA_WriteValue *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_WRITEVALUE], NULL); +} + +/* DataTypeAttributes */ +static UA_INLINE size_t +UA_DataTypeAttributes_calcSizeBinary(const UA_DataTypeAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_DataTypeAttributes_encodeBinary(const UA_DataTypeAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DataTypeAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataTypeAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], NULL); +} + +/* TransferSubscriptionsResponse */ +static UA_INLINE size_t +UA_TransferSubscriptionsResponse_calcSizeBinary(const UA_TransferSubscriptionsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsResponse_encodeBinary(const UA_TransferSubscriptionsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TransferSubscriptionsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE], NULL); +} + +/* AddReferencesResponse */ +static UA_INLINE size_t +UA_AddReferencesResponse_calcSizeBinary(const UA_AddReferencesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesResponse_encodeBinary(const UA_AddReferencesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddReferencesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE], NULL); +} + +/* DeadbandType */ +static UA_INLINE size_t +UA_DeadbandType_calcSizeBinary(const UA_DeadbandType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} +static UA_INLINE UA_StatusCode +UA_DeadbandType_encodeBinary(const UA_DeadbandType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DEADBANDTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeadbandType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeadbandType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DEADBANDTYPE], NULL); +} + +/* DataChangeTrigger */ +static UA_INLINE size_t +UA_DataChangeTrigger_calcSizeBinary(const UA_DataChangeTrigger *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} +static UA_INLINE UA_StatusCode +UA_DataChangeTrigger_encodeBinary(const UA_DataChangeTrigger *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DataChangeTrigger_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataChangeTrigger *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER], NULL); +} + +/* BuildInfo */ +static UA_INLINE size_t +UA_BuildInfo_calcSizeBinary(const UA_BuildInfo *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BUILDINFO]); +} +static UA_INLINE UA_StatusCode +UA_BuildInfo_encodeBinary(const UA_BuildInfo *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BUILDINFO], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BuildInfo_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BuildInfo *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BUILDINFO], NULL); +} + +/* FilterOperand */ +static UA_INLINE size_t +UA_FilterOperand_calcSizeBinary(const UA_FilterOperand *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_FILTEROPERAND]); +} +static UA_INLINE UA_StatusCode +UA_FilterOperand_encodeBinary(const UA_FilterOperand *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_FILTEROPERAND], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_FilterOperand_decodeBinary(const UA_ByteString *src, size_t *offset, UA_FilterOperand *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_FILTEROPERAND], NULL); +} + +/* MonitoringParameters */ +static UA_INLINE size_t +UA_MonitoringParameters_calcSizeBinary(const UA_MonitoringParameters *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} +static UA_INLINE UA_StatusCode +UA_MonitoringParameters_encodeBinary(const UA_MonitoringParameters *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoringParameters_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoringParameters *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS], NULL); +} + +/* DoubleComplexNumberType */ +static UA_INLINE size_t +UA_DoubleComplexNumberType_calcSizeBinary(const UA_DoubleComplexNumberType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} +static UA_INLINE UA_StatusCode +UA_DoubleComplexNumberType_encodeBinary(const UA_DoubleComplexNumberType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DoubleComplexNumberType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DoubleComplexNumberType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE], NULL); +} + +/* DeleteNodesItem */ +static UA_INLINE size_t +UA_DeleteNodesItem_calcSizeBinary(const UA_DeleteNodesItem *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESITEM]); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesItem_encodeBinary(const UA_DeleteNodesItem *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESITEM], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesItem_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteNodesItem *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETENODESITEM], NULL); +} + +/* ReadValueId */ +static UA_INLINE size_t +UA_ReadValueId_calcSizeBinary(const UA_ReadValueId *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_READVALUEID]); +} +static UA_INLINE UA_StatusCode +UA_ReadValueId_encodeBinary(const UA_ReadValueId *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_READVALUEID], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ReadValueId_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ReadValueId *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_READVALUEID], NULL); +} + +/* CallRequest */ +static UA_INLINE size_t +UA_CallRequest_calcSizeBinary(const UA_CallRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CALLREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CallRequest_encodeBinary(const UA_CallRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CALLREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CallRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CallRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CALLREQUEST], NULL); +} + +/* RelativePath */ +static UA_INLINE size_t +UA_RelativePath_calcSizeBinary(const UA_RelativePath *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_RELATIVEPATH]); +} +static UA_INLINE UA_StatusCode +UA_RelativePath_encodeBinary(const UA_RelativePath *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_RELATIVEPATH], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RelativePath_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RelativePath *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_RELATIVEPATH], NULL); +} + +/* DeleteNodesRequest */ +static UA_INLINE size_t +UA_DeleteNodesRequest_calcSizeBinary(const UA_DeleteNodesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesRequest_encodeBinary(const UA_DeleteNodesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteNodesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETENODESREQUEST], NULL); +} + +/* MonitoredItemModifyRequest */ +static UA_INLINE size_t +UA_MonitoredItemModifyRequest_calcSizeBinary(const UA_MonitoredItemModifyRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyRequest_encodeBinary(const UA_MonitoredItemModifyRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoredItemModifyRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST], NULL); +} + +/* UserTokenType */ +static UA_INLINE size_t +UA_UserTokenType_calcSizeBinary(const UA_UserTokenType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} +static UA_INLINE UA_StatusCode +UA_UserTokenType_encodeBinary(const UA_UserTokenType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_USERTOKENTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UserTokenType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UserTokenType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_USERTOKENTYPE], NULL); +} + +/* AggregateConfiguration */ +static UA_INLINE size_t +UA_AggregateConfiguration_calcSizeBinary(const UA_AggregateConfiguration *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} +static UA_INLINE UA_StatusCode +UA_AggregateConfiguration_encodeBinary(const UA_AggregateConfiguration *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AggregateConfiguration_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AggregateConfiguration *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION], NULL); +} + +/* LocaleId */ +static UA_INLINE size_t +UA_LocaleId_calcSizeBinary(const UA_LocaleId *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_LOCALEID]); +} +static UA_INLINE UA_StatusCode +UA_LocaleId_encodeBinary(const UA_LocaleId *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_LOCALEID], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_LocaleId_decodeBinary(const UA_ByteString *src, size_t *offset, UA_LocaleId *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_LOCALEID], NULL); +} + +/* UnregisterNodesResponse */ +static UA_INLINE size_t +UA_UnregisterNodesResponse_calcSizeBinary(const UA_UnregisterNodesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_UnregisterNodesResponse_encodeBinary(const UA_UnregisterNodesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UnregisterNodesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UnregisterNodesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE], NULL); +} + +/* ContentFilterResult */ +static UA_INLINE size_t +UA_ContentFilterResult_calcSizeBinary(const UA_ContentFilterResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterResult_encodeBinary(const UA_ContentFilterResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ContentFilterResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT], NULL); +} + +/* UserTokenPolicy */ +static UA_INLINE size_t +UA_UserTokenPolicy_calcSizeBinary(const UA_UserTokenPolicy *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} +static UA_INLINE UA_StatusCode +UA_UserTokenPolicy_encodeBinary(const UA_UserTokenPolicy *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_USERTOKENPOLICY], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UserTokenPolicy_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UserTokenPolicy *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_USERTOKENPOLICY], NULL); +} + +/* DeleteMonitoredItemsRequest */ +static UA_INLINE size_t +UA_DeleteMonitoredItemsRequest_calcSizeBinary(const UA_DeleteMonitoredItemsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsRequest_encodeBinary(const UA_DeleteMonitoredItemsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteMonitoredItemsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST], NULL); +} + +/* SetMonitoringModeRequest */ +static UA_INLINE size_t +UA_SetMonitoringModeRequest_calcSizeBinary(const UA_SetMonitoringModeRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeRequest_encodeBinary(const UA_SetMonitoringModeRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetMonitoringModeRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST], NULL); +} + +/* Duration */ +static UA_INLINE size_t +UA_Duration_calcSizeBinary(const UA_Duration *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DURATION]); +} +static UA_INLINE UA_StatusCode +UA_Duration_encodeBinary(const UA_Duration *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DURATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Duration_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Duration *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DURATION], NULL); +} + +/* ReferenceTypeAttributes */ +static UA_INLINE size_t +UA_ReferenceTypeAttributes_calcSizeBinary(const UA_ReferenceTypeAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_ReferenceTypeAttributes_encodeBinary(const UA_ReferenceTypeAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ReferenceTypeAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ReferenceTypeAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], NULL); +} + +/* GetEndpointsRequest */ +static UA_INLINE size_t +UA_GetEndpointsRequest_calcSizeBinary(const UA_GetEndpointsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_GetEndpointsRequest_encodeBinary(const UA_GetEndpointsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_GetEndpointsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_GetEndpointsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST], NULL); +} + +/* CloseSecureChannelResponse */ +static UA_INLINE size_t +UA_CloseSecureChannelResponse_calcSizeBinary(const UA_CloseSecureChannelResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelResponse_encodeBinary(const UA_CloseSecureChannelResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CloseSecureChannelResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE], NULL); +} + +/* ViewDescription */ +static UA_INLINE size_t +UA_ViewDescription_calcSizeBinary(const UA_ViewDescription *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} +static UA_INLINE UA_StatusCode +UA_ViewDescription_encodeBinary(const UA_ViewDescription *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ViewDescription_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ViewDescription *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION], NULL); +} + +/* SetPublishingModeResponse */ +static UA_INLINE size_t +UA_SetPublishingModeResponse_calcSizeBinary(const UA_SetPublishingModeResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_SetPublishingModeResponse_encodeBinary(const UA_SetPublishingModeResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetPublishingModeResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetPublishingModeResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE], NULL); +} + +/* StatusChangeNotification */ +static UA_INLINE size_t +UA_StatusChangeNotification_calcSizeBinary(const UA_StatusChangeNotification *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} +static UA_INLINE UA_StatusCode +UA_StatusChangeNotification_encodeBinary(const UA_StatusChangeNotification *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_StatusChangeNotification_decodeBinary(const UA_ByteString *src, size_t *offset, UA_StatusChangeNotification *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION], NULL); +} + +/* StructureField */ +static UA_INLINE size_t +UA_StructureField_calcSizeBinary(const UA_StructureField *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} +static UA_INLINE UA_StatusCode +UA_StructureField_encodeBinary(const UA_StructureField *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STRUCTUREFIELD], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_StructureField_decodeBinary(const UA_ByteString *src, size_t *offset, UA_StructureField *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STRUCTUREFIELD], NULL); +} + +/* NodeAttributesMask */ +static UA_INLINE size_t +UA_NodeAttributesMask_calcSizeBinary(const UA_NodeAttributesMask *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} +static UA_INLINE UA_StatusCode +UA_NodeAttributesMask_encodeBinary(const UA_NodeAttributesMask *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_NodeAttributesMask_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NodeAttributesMask *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK], NULL); +} + +/* EventFilterResult */ +static UA_INLINE size_t +UA_EventFilterResult_calcSizeBinary(const UA_EventFilterResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} +static UA_INLINE UA_StatusCode +UA_EventFilterResult_encodeBinary(const UA_EventFilterResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EventFilterResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EventFilterResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT], NULL); +} + +/* MonitoredItemCreateRequest */ +static UA_INLINE size_t +UA_MonitoredItemCreateRequest_calcSizeBinary(const UA_MonitoredItemCreateRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateRequest_encodeBinary(const UA_MonitoredItemCreateRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MonitoredItemCreateRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST], NULL); +} + +/* ComplexNumberType */ +static UA_INLINE size_t +UA_ComplexNumberType_calcSizeBinary(const UA_ComplexNumberType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} +static UA_INLINE UA_StatusCode +UA_ComplexNumberType_encodeBinary(const UA_ComplexNumberType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ComplexNumberType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ComplexNumberType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE], NULL); +} + +/* Range */ +static UA_INLINE size_t +UA_Range_calcSizeBinary(const UA_Range *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_RANGE]); +} +static UA_INLINE UA_StatusCode +UA_Range_encodeBinary(const UA_Range *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_RANGE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Range_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Range *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_RANGE], NULL); +} + +/* DataChangeNotification */ +static UA_INLINE size_t +UA_DataChangeNotification_calcSizeBinary(const UA_DataChangeNotification *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} +static UA_INLINE UA_StatusCode +UA_DataChangeNotification_encodeBinary(const UA_DataChangeNotification *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DataChangeNotification_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataChangeNotification *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION], NULL); +} + +/* Argument */ +static UA_INLINE size_t +UA_Argument_calcSizeBinary(const UA_Argument *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ARGUMENT]); +} +static UA_INLINE UA_StatusCode +UA_Argument_encodeBinary(const UA_Argument *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ARGUMENT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_Argument_decodeBinary(const UA_ByteString *src, size_t *offset, UA_Argument *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ARGUMENT], NULL); +} + +/* TransferSubscriptionsRequest */ +static UA_INLINE size_t +UA_TransferSubscriptionsRequest_calcSizeBinary(const UA_TransferSubscriptionsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsRequest_encodeBinary(const UA_TransferSubscriptionsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TransferSubscriptionsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST], NULL); +} + +/* ChannelSecurityToken */ +static UA_INLINE size_t +UA_ChannelSecurityToken_calcSizeBinary(const UA_ChannelSecurityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_ChannelSecurityToken_encodeBinary(const UA_ChannelSecurityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ChannelSecurityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ChannelSecurityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN], NULL); +} + +/* ServerState */ +static UA_INLINE size_t +UA_ServerState_calcSizeBinary(const UA_ServerState *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SERVERSTATE]); +} +static UA_INLINE UA_StatusCode +UA_ServerState_encodeBinary(const UA_ServerState *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SERVERSTATE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ServerState_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ServerState *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SERVERSTATE], NULL); +} + +/* EventNotificationList */ +static UA_INLINE size_t +UA_EventNotificationList_calcSizeBinary(const UA_EventNotificationList *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} +static UA_INLINE UA_StatusCode +UA_EventNotificationList_encodeBinary(const UA_EventNotificationList *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EventNotificationList_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EventNotificationList *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST], NULL); +} + +/* AnonymousIdentityToken */ +static UA_INLINE size_t +UA_AnonymousIdentityToken_calcSizeBinary(const UA_AnonymousIdentityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_AnonymousIdentityToken_encodeBinary(const UA_AnonymousIdentityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AnonymousIdentityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AnonymousIdentityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN], NULL); +} + +/* FilterOperator */ +static UA_INLINE size_t +UA_FilterOperator_calcSizeBinary(const UA_FilterOperator *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} +static UA_INLINE UA_StatusCode +UA_FilterOperator_encodeBinary(const UA_FilterOperator *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_FILTEROPERATOR], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_FilterOperator_decodeBinary(const UA_ByteString *src, size_t *offset, UA_FilterOperator *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_FILTEROPERATOR], NULL); +} + +/* AggregateFilter */ +static UA_INLINE size_t +UA_AggregateFilter_calcSizeBinary(const UA_AggregateFilter *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} +static UA_INLINE UA_StatusCode +UA_AggregateFilter_encodeBinary(const UA_AggregateFilter *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_AGGREGATEFILTER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AggregateFilter_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AggregateFilter *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_AGGREGATEFILTER], NULL); +} + +/* RepublishResponse */ +static UA_INLINE size_t +UA_RepublishResponse_calcSizeBinary(const UA_RepublishResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_RepublishResponse_encodeBinary(const UA_RepublishResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RepublishResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RepublishResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE], NULL); +} + +/* DeleteSubscriptionsResponse */ +static UA_INLINE size_t +UA_DeleteSubscriptionsResponse_calcSizeBinary(const UA_DeleteSubscriptionsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsResponse_encodeBinary(const UA_DeleteSubscriptionsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteSubscriptionsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE], NULL); +} + +/* RegisterNodesRequest */ +static UA_INLINE size_t +UA_RegisterNodesRequest_calcSizeBinary(const UA_RegisterNodesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_RegisterNodesRequest_encodeBinary(const UA_RegisterNodesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RegisterNodesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RegisterNodesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST], NULL); +} + +/* StructureDefinition */ +static UA_INLINE size_t +UA_StructureDefinition_calcSizeBinary(const UA_StructureDefinition *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} +static UA_INLINE UA_StatusCode +UA_StructureDefinition_encodeBinary(const UA_StructureDefinition *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_StructureDefinition_decodeBinary(const UA_ByteString *src, size_t *offset, UA_StructureDefinition *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION], NULL); +} + +/* MethodAttributes */ +static UA_INLINE size_t +UA_MethodAttributes_calcSizeBinary(const UA_MethodAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_MethodAttributes_encodeBinary(const UA_MethodAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_METHODATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MethodAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MethodAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_METHODATTRIBUTES], NULL); +} + +/* UserNameIdentityToken */ +static UA_INLINE size_t +UA_UserNameIdentityToken_calcSizeBinary(const UA_UserNameIdentityToken *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} +static UA_INLINE UA_StatusCode +UA_UserNameIdentityToken_encodeBinary(const UA_UserNameIdentityToken *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UserNameIdentityToken_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UserNameIdentityToken *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN], NULL); +} + +/* UnregisterNodesRequest */ +static UA_INLINE size_t +UA_UnregisterNodesRequest_calcSizeBinary(const UA_UnregisterNodesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_UnregisterNodesRequest_encodeBinary(const UA_UnregisterNodesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_UnregisterNodesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_UnregisterNodesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST], NULL); +} + +/* OpenSecureChannelResponse */ +static UA_INLINE size_t +UA_OpenSecureChannelResponse_calcSizeBinary(const UA_OpenSecureChannelResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelResponse_encodeBinary(const UA_OpenSecureChannelResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_OpenSecureChannelResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE], NULL); +} + +/* SetTriggeringResponse */ +static UA_INLINE size_t +UA_SetTriggeringResponse_calcSizeBinary(const UA_SetTriggeringResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_SetTriggeringResponse_encodeBinary(const UA_SetTriggeringResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetTriggeringResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetTriggeringResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE], NULL); +} + +/* SimpleAttributeOperand */ +static UA_INLINE size_t +UA_SimpleAttributeOperand_calcSizeBinary(const UA_SimpleAttributeOperand *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} +static UA_INLINE UA_StatusCode +UA_SimpleAttributeOperand_encodeBinary(const UA_SimpleAttributeOperand *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SimpleAttributeOperand_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SimpleAttributeOperand *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND], NULL); +} + +/* RepublishRequest */ +static UA_INLINE size_t +UA_RepublishRequest_calcSizeBinary(const UA_RepublishRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_RepublishRequest_encodeBinary(const UA_RepublishRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RepublishRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RepublishRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST], NULL); +} + +/* RegisterNodesResponse */ +static UA_INLINE size_t +UA_RegisterNodesResponse_calcSizeBinary(const UA_RegisterNodesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_RegisterNodesResponse_encodeBinary(const UA_RegisterNodesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RegisterNodesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RegisterNodesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE], NULL); +} + +/* ModifyMonitoredItemsResponse */ +static UA_INLINE size_t +UA_ModifyMonitoredItemsResponse_calcSizeBinary(const UA_ModifyMonitoredItemsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsResponse_encodeBinary(const UA_ModifyMonitoredItemsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ModifyMonitoredItemsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE], NULL); +} + +/* DeleteSubscriptionsRequest */ +static UA_INLINE size_t +UA_DeleteSubscriptionsRequest_calcSizeBinary(const UA_DeleteSubscriptionsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsRequest_encodeBinary(const UA_DeleteSubscriptionsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteSubscriptionsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST], NULL); +} + +/* RedundancySupport */ +static UA_INLINE size_t +UA_RedundancySupport_calcSizeBinary(const UA_RedundancySupport *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} +static UA_INLINE UA_StatusCode +UA_RedundancySupport_encodeBinary(const UA_RedundancySupport *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_RedundancySupport_decodeBinary(const UA_ByteString *src, size_t *offset, UA_RedundancySupport *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT], NULL); +} + +/* BrowsePath */ +static UA_INLINE size_t +UA_BrowsePath_calcSizeBinary(const UA_BrowsePath *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATH]); +} +static UA_INLINE UA_StatusCode +UA_BrowsePath_encodeBinary(const UA_BrowsePath *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATH], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowsePath_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowsePath *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEPATH], NULL); +} + +/* ObjectAttributes */ +static UA_INLINE size_t +UA_ObjectAttributes_calcSizeBinary(const UA_ObjectAttributes *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} +static UA_INLINE UA_StatusCode +UA_ObjectAttributes_encodeBinary(const UA_ObjectAttributes *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ObjectAttributes_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ObjectAttributes *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], NULL); +} + +/* PublishRequest */ +static UA_INLINE size_t +UA_PublishRequest_calcSizeBinary(const UA_PublishRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_PublishRequest_encodeBinary(const UA_PublishRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_PUBLISHREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_PublishRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_PublishRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_PUBLISHREQUEST], NULL); +} + +/* FindServersRequest */ +static UA_INLINE size_t +UA_FindServersRequest_calcSizeBinary(const UA_FindServersRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_FindServersRequest_encodeBinary(const UA_FindServersRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_FindServersRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_FindServersRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST], NULL); +} + +/* ReferenceDescription */ +static UA_INLINE size_t +UA_ReferenceDescription_calcSizeBinary(const UA_ReferenceDescription *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} +static UA_INLINE UA_StatusCode +UA_ReferenceDescription_encodeBinary(const UA_ReferenceDescription *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ReferenceDescription_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ReferenceDescription *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION], NULL); +} + +/* CreateSubscriptionRequest */ +static UA_INLINE size_t +UA_CreateSubscriptionRequest_calcSizeBinary(const UA_CreateSubscriptionRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionRequest_encodeBinary(const UA_CreateSubscriptionRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateSubscriptionRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST], NULL); +} + +/* CallResponse */ +static UA_INLINE size_t +UA_CallResponse_calcSizeBinary(const UA_CallResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CALLRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CallResponse_encodeBinary(const UA_CallResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CALLRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CallResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CallResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CALLRESPONSE], NULL); +} + +/* DeleteNodesResponse */ +static UA_INLINE size_t +UA_DeleteNodesResponse_calcSizeBinary(const UA_DeleteNodesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesResponse_encodeBinary(const UA_DeleteNodesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteNodesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteNodesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE], NULL); +} + +/* ModifyMonitoredItemsRequest */ +static UA_INLINE size_t +UA_ModifyMonitoredItemsRequest_calcSizeBinary(const UA_ModifyMonitoredItemsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsRequest_encodeBinary(const UA_ModifyMonitoredItemsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ModifyMonitoredItemsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST], NULL); +} + +/* ServiceFault */ +static UA_INLINE size_t +UA_ServiceFault_calcSizeBinary(const UA_ServiceFault *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SERVICEFAULT]); +} +static UA_INLINE UA_StatusCode +UA_ServiceFault_encodeBinary(const UA_ServiceFault *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SERVICEFAULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ServiceFault_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ServiceFault *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SERVICEFAULT], NULL); +} + +/* PublishResponse */ +static UA_INLINE size_t +UA_PublishResponse_calcSizeBinary(const UA_PublishResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_PublishResponse_encodeBinary(const UA_PublishResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_PublishResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_PublishResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], NULL); +} + +/* CreateMonitoredItemsRequest */ +static UA_INLINE size_t +UA_CreateMonitoredItemsRequest_calcSizeBinary(const UA_CreateMonitoredItemsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsRequest_encodeBinary(const UA_CreateMonitoredItemsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateMonitoredItemsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST], NULL); +} + +/* OpenSecureChannelRequest */ +static UA_INLINE size_t +UA_OpenSecureChannelRequest_calcSizeBinary(const UA_OpenSecureChannelRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelRequest_encodeBinary(const UA_OpenSecureChannelRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_OpenSecureChannelRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST], NULL); +} + +/* CloseSessionRequest */ +static UA_INLINE size_t +UA_CloseSessionRequest_calcSizeBinary(const UA_CloseSessionRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CloseSessionRequest_encodeBinary(const UA_CloseSessionRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CloseSessionRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CloseSessionRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST], NULL); +} + +/* SetTriggeringRequest */ +static UA_INLINE size_t +UA_SetTriggeringRequest_calcSizeBinary(const UA_SetTriggeringRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_SetTriggeringRequest_encodeBinary(const UA_SetTriggeringRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SetTriggeringRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SetTriggeringRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST], NULL); +} + +/* BrowseResult */ +static UA_INLINE size_t +UA_BrowseResult_calcSizeBinary(const UA_BrowseResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} +static UA_INLINE UA_StatusCode +UA_BrowseResult_encodeBinary(const UA_BrowseResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSERESULT], NULL); +} + +/* AddReferencesRequest */ +static UA_INLINE size_t +UA_AddReferencesRequest_calcSizeBinary(const UA_AddReferencesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesRequest_encodeBinary(const UA_AddReferencesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddReferencesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddReferencesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST], NULL); +} + +/* AddNodesItem */ +static UA_INLINE size_t +UA_AddNodesItem_calcSizeBinary(const UA_AddNodesItem *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESITEM]); +} +static UA_INLINE UA_StatusCode +UA_AddNodesItem_encodeBinary(const UA_AddNodesItem *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESITEM], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddNodesItem_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddNodesItem *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDNODESITEM], NULL); +} + +/* ServerStatusDataType */ +static UA_INLINE size_t +UA_ServerStatusDataType_calcSizeBinary(const UA_ServerStatusDataType *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} +static UA_INLINE UA_StatusCode +UA_ServerStatusDataType_encodeBinary(const UA_ServerStatusDataType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ServerStatusDataType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ServerStatusDataType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE], NULL); +} + +/* BrowseNextResponse */ +static UA_INLINE size_t +UA_BrowseNextResponse_calcSizeBinary(const UA_BrowseNextResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_BrowseNextResponse_encodeBinary(const UA_BrowseNextResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseNextResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseNextResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE], NULL); +} + +/* AxisInformation */ +static UA_INLINE size_t +UA_AxisInformation_calcSizeBinary(const UA_AxisInformation *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_AXISINFORMATION]); +} +static UA_INLINE UA_StatusCode +UA_AxisInformation_encodeBinary(const UA_AxisInformation *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_AXISINFORMATION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AxisInformation_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AxisInformation *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_AXISINFORMATION], NULL); +} + +/* ApplicationDescription */ +static UA_INLINE size_t +UA_ApplicationDescription_calcSizeBinary(const UA_ApplicationDescription *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} +static UA_INLINE UA_StatusCode +UA_ApplicationDescription_encodeBinary(const UA_ApplicationDescription *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ApplicationDescription_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ApplicationDescription *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION], NULL); +} + +/* ReadRequest */ +static UA_INLINE size_t +UA_ReadRequest_calcSizeBinary(const UA_ReadRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_READREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_ReadRequest_encodeBinary(const UA_ReadRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_READREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ReadRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ReadRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_READREQUEST], NULL); +} + +/* ActivateSessionRequest */ +static UA_INLINE size_t +UA_ActivateSessionRequest_calcSizeBinary(const UA_ActivateSessionRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_ActivateSessionRequest_encodeBinary(const UA_ActivateSessionRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ActivateSessionRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ActivateSessionRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST], NULL); +} + +/* BrowsePathResult */ +static UA_INLINE size_t +UA_BrowsePathResult_calcSizeBinary(const UA_BrowsePathResult *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} +static UA_INLINE UA_StatusCode +UA_BrowsePathResult_encodeBinary(const UA_BrowsePathResult *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowsePathResult_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowsePathResult *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT], NULL); +} + +/* AddNodesRequest */ +static UA_INLINE size_t +UA_AddNodesRequest_calcSizeBinary(const UA_AddNodesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_AddNodesRequest_encodeBinary(const UA_AddNodesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddNodesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddNodesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDNODESREQUEST], NULL); +} + +/* BrowseRequest */ +static UA_INLINE size_t +UA_BrowseRequest_calcSizeBinary(const UA_BrowseRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_BrowseRequest_encodeBinary(const UA_BrowseRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSEREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSEREQUEST], NULL); +} + +/* WriteRequest */ +static UA_INLINE size_t +UA_WriteRequest_calcSizeBinary(const UA_WriteRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_WRITEREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_WriteRequest_encodeBinary(const UA_WriteRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_WRITEREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_WriteRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_WriteRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_WRITEREQUEST], NULL); +} + +/* AddNodesResponse */ +static UA_INLINE size_t +UA_AddNodesResponse_calcSizeBinary(const UA_AddNodesResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_AddNodesResponse_encodeBinary(const UA_AddNodesResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AddNodesResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AddNodesResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE], NULL); +} + +/* AttributeOperand */ +static UA_INLINE size_t +UA_AttributeOperand_calcSizeBinary(const UA_AttributeOperand *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} +static UA_INLINE UA_StatusCode +UA_AttributeOperand_encodeBinary(const UA_AttributeOperand *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AttributeOperand_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AttributeOperand *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND], NULL); +} + +/* DataChangeFilter */ +static UA_INLINE size_t +UA_DataChangeFilter_calcSizeBinary(const UA_DataChangeFilter *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} +static UA_INLINE UA_StatusCode +UA_DataChangeFilter_encodeBinary(const UA_DataChangeFilter *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DATACHANGEFILTER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DataChangeFilter_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataChangeFilter *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DATACHANGEFILTER], NULL); +} + +/* EndpointDescription */ +static UA_INLINE size_t +UA_EndpointDescription_calcSizeBinary(const UA_EndpointDescription *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} +static UA_INLINE UA_StatusCode +UA_EndpointDescription_encodeBinary(const UA_EndpointDescription *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EndpointDescription_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EndpointDescription *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION], NULL); +} + +/* DeleteReferencesRequest */ +static UA_INLINE size_t +UA_DeleteReferencesRequest_calcSizeBinary(const UA_DeleteReferencesRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesRequest_encodeBinary(const UA_DeleteReferencesRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_DeleteReferencesRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DeleteReferencesRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST], NULL); +} + +/* TranslateBrowsePathsToNodeIdsRequest */ +static UA_INLINE size_t +UA_TranslateBrowsePathsToNodeIdsRequest_calcSizeBinary(const UA_TranslateBrowsePathsToNodeIdsRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsRequest_encodeBinary(const UA_TranslateBrowsePathsToNodeIdsRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TranslateBrowsePathsToNodeIdsRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST], NULL); +} + +/* FindServersResponse */ +static UA_INLINE size_t +UA_FindServersResponse_calcSizeBinary(const UA_FindServersResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_FindServersResponse_encodeBinary(const UA_FindServersResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_FindServersResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_FindServersResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE], NULL); +} + +/* CreateSessionRequest */ +static UA_INLINE size_t +UA_CreateSessionRequest_calcSizeBinary(const UA_CreateSessionRequest *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} +static UA_INLINE UA_StatusCode +UA_CreateSessionRequest_encodeBinary(const UA_CreateSessionRequest *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateSessionRequest_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateSessionRequest *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST], NULL); +} + +/* ContentFilterElement */ +static UA_INLINE size_t +UA_ContentFilterElement_calcSizeBinary(const UA_ContentFilterElement *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterElement_encodeBinary(const UA_ContentFilterElement *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ContentFilterElement_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ContentFilterElement *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT], NULL); +} + +/* TranslateBrowsePathsToNodeIdsResponse */ +static UA_INLINE size_t +UA_TranslateBrowsePathsToNodeIdsResponse_calcSizeBinary(const UA_TranslateBrowsePathsToNodeIdsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsResponse_encodeBinary(const UA_TranslateBrowsePathsToNodeIdsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TranslateBrowsePathsToNodeIdsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE], NULL); +} + +/* BrowseResponse */ +static UA_INLINE size_t +UA_BrowseResponse_calcSizeBinary(const UA_BrowseResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_BrowseResponse_encodeBinary(const UA_BrowseResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_BROWSERESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_BrowseResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_BrowseResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_BROWSERESPONSE], NULL); +} + +/* CreateSessionResponse */ +static UA_INLINE size_t +UA_CreateSessionResponse_calcSizeBinary(const UA_CreateSessionResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_CreateSessionResponse_encodeBinary(const UA_CreateSessionResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_CreateSessionResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_CreateSessionResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE], NULL); +} + +/* ContentFilter */ +static UA_INLINE size_t +UA_ContentFilter_calcSizeBinary(const UA_ContentFilter *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTER]); +} +static UA_INLINE UA_StatusCode +UA_ContentFilter_encodeBinary(const UA_ContentFilter *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_CONTENTFILTER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ContentFilter_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ContentFilter *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_CONTENTFILTER], NULL); +} + +/* GetEndpointsResponse */ +static UA_INLINE size_t +UA_GetEndpointsResponse_calcSizeBinary(const UA_GetEndpointsResponse *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} +static UA_INLINE UA_StatusCode +UA_GetEndpointsResponse_encodeBinary(const UA_GetEndpointsResponse *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_GetEndpointsResponse_decodeBinary(const UA_ByteString *src, size_t *offset, UA_GetEndpointsResponse *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE], NULL); +} + +/* EventFilter */ +static UA_INLINE size_t +UA_EventFilter_calcSizeBinary(const UA_EventFilter *src) { + return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_EVENTFILTER]); +} +static UA_INLINE UA_StatusCode +UA_EventFilter_encodeBinary(const UA_EventFilter *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TYPES[UA_TYPES_EVENTFILTER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_EventFilter_decodeBinary(const UA_ByteString *src, size_t *offset, UA_EventFilter *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TYPES[UA_TYPES_EVENTFILTER], NULL); +} + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/transport_generated.h" ***********************************/ + +/* Generated from Custom.Opc.Ua.Transport.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py * on host ci0011853 by user rosselliot at 2021-03-15 09:02:03 */ + + +#ifdef UA_ENABLE_AMALGAMATION +#else + +#endif + +_UA_BEGIN_DECLS + + +/** + * Every type is assigned an index in an array containing the type descriptions. + * These descriptions are used during type handling (copying, deletion, + * binary encoding, ...). */ +#define UA_TRANSPORT_COUNT 9 +extern UA_EXPORT const UA_DataType UA_TRANSPORT[UA_TRANSPORT_COUNT]; + +/** + * TcpHelloMessage + * ^^^^^^^^^^^^^^^ + * Hello Message */ +typedef struct { + UA_UInt32 protocolVersion; + UA_UInt32 receiveBufferSize; + UA_UInt32 sendBufferSize; + UA_UInt32 maxMessageSize; + UA_UInt32 maxChunkCount; + UA_String endpointUrl; +} UA_TcpHelloMessage; + +#define UA_TRANSPORT_TCPHELLOMESSAGE 0 + +/** + * TcpErrorMessage + * ^^^^^^^^^^^^^^^ + * Error Message */ +typedef struct { + UA_UInt32 error; + UA_String reason; +} UA_TcpErrorMessage; + +#define UA_TRANSPORT_TCPERRORMESSAGE 1 + +/** + * MessageType + * ^^^^^^^^^^^ + * Message Type and whether the message contains an intermediate chunk */ +typedef enum { + UA_MESSAGETYPE_ACK = 0x4B4341, + UA_MESSAGETYPE_HEL = 0x4C4548, + UA_MESSAGETYPE_MSG = 0x47534D, + UA_MESSAGETYPE_OPN = 0x4E504F, + UA_MESSAGETYPE_CLO = 0x4F4C43, + UA_MESSAGETYPE_ERR = 0x525245, + UA_MESSAGETYPE_INVALID = 0x0, + __UA_MESSAGETYPE_FORCE32BIT = 0x7fffffff +} UA_MessageType; +UA_STATIC_ASSERT(sizeof(UA_MessageType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TRANSPORT_MESSAGETYPE 2 + +/** + * AsymmetricAlgorithmSecurityHeader + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Asymmetric Security Header */ +typedef struct { + UA_ByteString securityPolicyUri; + UA_ByteString senderCertificate; + UA_ByteString receiverCertificateThumbprint; +} UA_AsymmetricAlgorithmSecurityHeader; + +#define UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER 3 + +/** + * TcpAcknowledgeMessage + * ^^^^^^^^^^^^^^^^^^^^^ + * Acknowledge Message */ +typedef struct { + UA_UInt32 protocolVersion; + UA_UInt32 receiveBufferSize; + UA_UInt32 sendBufferSize; + UA_UInt32 maxMessageSize; + UA_UInt32 maxChunkCount; +} UA_TcpAcknowledgeMessage; + +#define UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE 4 + +/** + * SequenceHeader + * ^^^^^^^^^^^^^^ + * Secure Layer Sequence Header */ +typedef struct { + UA_UInt32 sequenceNumber; + UA_UInt32 requestId; +} UA_SequenceHeader; + +#define UA_TRANSPORT_SEQUENCEHEADER 5 + +/** + * TcpMessageHeader + * ^^^^^^^^^^^^^^^^ + * TCP Header */ +typedef struct { + UA_UInt32 messageTypeAndChunkType; + UA_UInt32 messageSize; +} UA_TcpMessageHeader; + +#define UA_TRANSPORT_TCPMESSAGEHEADER 6 + +/** + * ChunkType + * ^^^^^^^^^ + * Type of the chunk */ +typedef enum { + UA_CHUNKTYPE_FINAL = 0x46000000, + UA_CHUNKTYPE_INTERMEDIATE = 0x43000000, + UA_CHUNKTYPE_ABORT = 0x41000000, + __UA_CHUNKTYPE_FORCE32BIT = 0x7fffffff +} UA_ChunkType; +UA_STATIC_ASSERT(sizeof(UA_ChunkType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TRANSPORT_CHUNKTYPE 7 + +/** + * SymmetricAlgorithmSecurityHeader + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Symmetric Security Header */ +typedef struct { + UA_UInt32 tokenId; +} UA_SymmetricAlgorithmSecurityHeader; + +#define UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER 8 + + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/transport_generated_handling.h" ***********************************/ + +/* Generated from Custom.Opc.Ua.Transport.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:03 */ + + + +_UA_BEGIN_DECLS + +#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + + +/* TcpHelloMessage */ +static UA_INLINE void +UA_TcpHelloMessage_init(UA_TcpHelloMessage *p) { + memset(p, 0, sizeof(UA_TcpHelloMessage)); +} + +static UA_INLINE UA_TcpHelloMessage * +UA_TcpHelloMessage_new(void) { + return (UA_TcpHelloMessage*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} + +static UA_INLINE UA_StatusCode +UA_TcpHelloMessage_copy(const UA_TcpHelloMessage *src, UA_TcpHelloMessage *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TcpHelloMessage_deleteMembers(UA_TcpHelloMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} + +static UA_INLINE void +UA_TcpHelloMessage_clear(UA_TcpHelloMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} + +static UA_INLINE void +UA_TcpHelloMessage_delete(UA_TcpHelloMessage *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} + +/* TcpErrorMessage */ +static UA_INLINE void +UA_TcpErrorMessage_init(UA_TcpErrorMessage *p) { + memset(p, 0, sizeof(UA_TcpErrorMessage)); +} + +static UA_INLINE UA_TcpErrorMessage * +UA_TcpErrorMessage_new(void) { + return (UA_TcpErrorMessage*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} + +static UA_INLINE UA_StatusCode +UA_TcpErrorMessage_copy(const UA_TcpErrorMessage *src, UA_TcpErrorMessage *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TcpErrorMessage_deleteMembers(UA_TcpErrorMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} + +static UA_INLINE void +UA_TcpErrorMessage_clear(UA_TcpErrorMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} + +static UA_INLINE void +UA_TcpErrorMessage_delete(UA_TcpErrorMessage *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} + +/* MessageType */ +static UA_INLINE void +UA_MessageType_init(UA_MessageType *p) { + memset(p, 0, sizeof(UA_MessageType)); +} + +static UA_INLINE UA_MessageType * +UA_MessageType_new(void) { + return (UA_MessageType*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} + +static UA_INLINE UA_StatusCode +UA_MessageType_copy(const UA_MessageType *src, UA_MessageType *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MessageType_deleteMembers(UA_MessageType *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} + +static UA_INLINE void +UA_MessageType_clear(UA_MessageType *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} + +static UA_INLINE void +UA_MessageType_delete(UA_MessageType *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} + +/* AsymmetricAlgorithmSecurityHeader */ +static UA_INLINE void +UA_AsymmetricAlgorithmSecurityHeader_init(UA_AsymmetricAlgorithmSecurityHeader *p) { + memset(p, 0, sizeof(UA_AsymmetricAlgorithmSecurityHeader)); +} + +static UA_INLINE UA_AsymmetricAlgorithmSecurityHeader * +UA_AsymmetricAlgorithmSecurityHeader_new(void) { + return (UA_AsymmetricAlgorithmSecurityHeader*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_AsymmetricAlgorithmSecurityHeader_copy(const UA_AsymmetricAlgorithmSecurityHeader *src, UA_AsymmetricAlgorithmSecurityHeader *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AsymmetricAlgorithmSecurityHeader_deleteMembers(UA_AsymmetricAlgorithmSecurityHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE void +UA_AsymmetricAlgorithmSecurityHeader_clear(UA_AsymmetricAlgorithmSecurityHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE void +UA_AsymmetricAlgorithmSecurityHeader_delete(UA_AsymmetricAlgorithmSecurityHeader *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} + +/* TcpAcknowledgeMessage */ +static UA_INLINE void +UA_TcpAcknowledgeMessage_init(UA_TcpAcknowledgeMessage *p) { + memset(p, 0, sizeof(UA_TcpAcknowledgeMessage)); +} + +static UA_INLINE UA_TcpAcknowledgeMessage * +UA_TcpAcknowledgeMessage_new(void) { + return (UA_TcpAcknowledgeMessage*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} + +static UA_INLINE UA_StatusCode +UA_TcpAcknowledgeMessage_copy(const UA_TcpAcknowledgeMessage *src, UA_TcpAcknowledgeMessage *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TcpAcknowledgeMessage_deleteMembers(UA_TcpAcknowledgeMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} + +static UA_INLINE void +UA_TcpAcknowledgeMessage_clear(UA_TcpAcknowledgeMessage *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} + +static UA_INLINE void +UA_TcpAcknowledgeMessage_delete(UA_TcpAcknowledgeMessage *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} + +/* SequenceHeader */ +static UA_INLINE void +UA_SequenceHeader_init(UA_SequenceHeader *p) { + memset(p, 0, sizeof(UA_SequenceHeader)); +} + +static UA_INLINE UA_SequenceHeader * +UA_SequenceHeader_new(void) { + return (UA_SequenceHeader*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_SequenceHeader_copy(const UA_SequenceHeader *src, UA_SequenceHeader *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SequenceHeader_deleteMembers(UA_SequenceHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} + +static UA_INLINE void +UA_SequenceHeader_clear(UA_SequenceHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} + +static UA_INLINE void +UA_SequenceHeader_delete(UA_SequenceHeader *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} + +/* TcpMessageHeader */ +static UA_INLINE void +UA_TcpMessageHeader_init(UA_TcpMessageHeader *p) { + memset(p, 0, sizeof(UA_TcpMessageHeader)); +} + +static UA_INLINE UA_TcpMessageHeader * +UA_TcpMessageHeader_new(void) { + return (UA_TcpMessageHeader*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_TcpMessageHeader_copy(const UA_TcpMessageHeader *src, UA_TcpMessageHeader *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TcpMessageHeader_deleteMembers(UA_TcpMessageHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} + +static UA_INLINE void +UA_TcpMessageHeader_clear(UA_TcpMessageHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} + +static UA_INLINE void +UA_TcpMessageHeader_delete(UA_TcpMessageHeader *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} + +/* ChunkType */ +static UA_INLINE void +UA_ChunkType_init(UA_ChunkType *p) { + memset(p, 0, sizeof(UA_ChunkType)); +} + +static UA_INLINE UA_ChunkType * +UA_ChunkType_new(void) { + return (UA_ChunkType*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_ChunkType_copy(const UA_ChunkType *src, UA_ChunkType *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ChunkType_deleteMembers(UA_ChunkType *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} + +static UA_INLINE void +UA_ChunkType_clear(UA_ChunkType *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} + +static UA_INLINE void +UA_ChunkType_delete(UA_ChunkType *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} + +/* SymmetricAlgorithmSecurityHeader */ +static UA_INLINE void +UA_SymmetricAlgorithmSecurityHeader_init(UA_SymmetricAlgorithmSecurityHeader *p) { + memset(p, 0, sizeof(UA_SymmetricAlgorithmSecurityHeader)); +} + +static UA_INLINE UA_SymmetricAlgorithmSecurityHeader * +UA_SymmetricAlgorithmSecurityHeader_new(void) { + return (UA_SymmetricAlgorithmSecurityHeader*)UA_new(&UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_SymmetricAlgorithmSecurityHeader_copy(const UA_SymmetricAlgorithmSecurityHeader *src, UA_SymmetricAlgorithmSecurityHeader *dst) { + return UA_copy(src, dst, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SymmetricAlgorithmSecurityHeader_deleteMembers(UA_SymmetricAlgorithmSecurityHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE void +UA_SymmetricAlgorithmSecurityHeader_clear(UA_SymmetricAlgorithmSecurityHeader *p) { + UA_clear(p, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} + +static UA_INLINE void +UA_SymmetricAlgorithmSecurityHeader_delete(UA_SymmetricAlgorithmSecurityHeader *p) { + UA_delete(p, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} + +#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 +# pragma GCC diagnostic pop +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/transport_generated_encoding_binary.h" ***********************************/ + +/* Generated from Custom.Opc.Ua.Transport.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:03 */ + + +#ifdef UA_ENABLE_AMALGAMATION +#else +#endif + + + +/* TcpHelloMessage */ +static UA_INLINE size_t +UA_TcpHelloMessage_calcSizeBinary(const UA_TcpHelloMessage *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE]); +} +static UA_INLINE UA_StatusCode +UA_TcpHelloMessage_encodeBinary(const UA_TcpHelloMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TcpHelloMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TcpHelloMessage *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPHELLOMESSAGE], NULL); +} + +/* TcpErrorMessage */ +static UA_INLINE size_t +UA_TcpErrorMessage_calcSizeBinary(const UA_TcpErrorMessage *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE]); +} +static UA_INLINE UA_StatusCode +UA_TcpErrorMessage_encodeBinary(const UA_TcpErrorMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TcpErrorMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TcpErrorMessage *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPERRORMESSAGE], NULL); +} + +/* MessageType */ +static UA_INLINE size_t +UA_MessageType_calcSizeBinary(const UA_MessageType *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE]); +} +static UA_INLINE UA_StatusCode +UA_MessageType_encodeBinary(const UA_MessageType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_MessageType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_MessageType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_MESSAGETYPE], NULL); +} + +/* AsymmetricAlgorithmSecurityHeader */ +static UA_INLINE size_t +UA_AsymmetricAlgorithmSecurityHeader_calcSizeBinary(const UA_AsymmetricAlgorithmSecurityHeader *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER]); +} +static UA_INLINE UA_StatusCode +UA_AsymmetricAlgorithmSecurityHeader_encodeBinary(const UA_AsymmetricAlgorithmSecurityHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_AsymmetricAlgorithmSecurityHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_AsymmetricAlgorithmSecurityHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER], NULL); +} + +/* TcpAcknowledgeMessage */ +static UA_INLINE size_t +UA_TcpAcknowledgeMessage_calcSizeBinary(const UA_TcpAcknowledgeMessage *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE]); +} +static UA_INLINE UA_StatusCode +UA_TcpAcknowledgeMessage_encodeBinary(const UA_TcpAcknowledgeMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TcpAcknowledgeMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TcpAcknowledgeMessage *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE], NULL); +} + +/* SequenceHeader */ +static UA_INLINE size_t +UA_SequenceHeader_calcSizeBinary(const UA_SequenceHeader *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER]); +} +static UA_INLINE UA_StatusCode +UA_SequenceHeader_encodeBinary(const UA_SequenceHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SequenceHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SequenceHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER], NULL); +} + +/* TcpMessageHeader */ +static UA_INLINE size_t +UA_TcpMessageHeader_calcSizeBinary(const UA_TcpMessageHeader *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER]); +} +static UA_INLINE UA_StatusCode +UA_TcpMessageHeader_encodeBinary(const UA_TcpMessageHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_TcpMessageHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_TcpMessageHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER], NULL); +} + +/* ChunkType */ +static UA_INLINE size_t +UA_ChunkType_calcSizeBinary(const UA_ChunkType *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE]); +} +static UA_INLINE UA_StatusCode +UA_ChunkType_encodeBinary(const UA_ChunkType *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_ChunkType_decodeBinary(const UA_ByteString *src, size_t *offset, UA_ChunkType *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_CHUNKTYPE], NULL); +} + +/* SymmetricAlgorithmSecurityHeader */ +static UA_INLINE size_t +UA_SymmetricAlgorithmSecurityHeader_calcSizeBinary(const UA_SymmetricAlgorithmSecurityHeader *src) { + return UA_calcSizeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER]); +} +static UA_INLINE UA_StatusCode +UA_SymmetricAlgorithmSecurityHeader_encodeBinary(const UA_SymmetricAlgorithmSecurityHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { + return UA_encodeBinary(src, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER], bufPos, &bufEnd, NULL, NULL); +} +static UA_INLINE UA_StatusCode +UA_SymmetricAlgorithmSecurityHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_SymmetricAlgorithmSecurityHeader *dst) { + return UA_decodeBinary(src, offset, dst, &UA_TRANSPORT[UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER], NULL); +} + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_connection_internal.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Florian Palm + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + + +_UA_BEGIN_DECLS + +/* When a fatal error occurs the Server shall send an Error Message to the + * Client and close the socket. When a Client encounters one of these errors, it + * shall also close the socket but does not send an Error Message. After the + * socket is closed a Client shall try to reconnect automatically using the + * mechanisms described in [...]. */ +void +UA_Connection_sendError(UA_Connection *connection, + UA_TcpErrorMessage *error); + +void UA_Connection_detachSecureChannel(UA_Connection *connection); +void UA_Connection_attachSecureChannel(UA_Connection *connection, + UA_SecureChannel *channel); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_securechannel.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Florian Palm + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + + + +_UA_BEGIN_DECLS + +#define UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH 12 +#define UA_SECURE_MESSAGE_HEADER_LENGTH 24 + +/* Thread-local variables to force failure modes during testing */ +#ifdef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS +extern UA_StatusCode decrypt_verifySignatureFailure; +extern UA_StatusCode sendAsym_sendFailure; +extern UA_StatusCode processSym_seqNumberFailure; +#endif + +/* The Session implementation differs between client and server. Still, it is + * expected that the Session structure begins with the SessionHeader. This is + * the interface that will be used by the SecureChannel. The lifecycle of + * Sessions is independent of the underlying SecureChannel. But every Session + * can be attached to only one SecureChannel. */ +typedef struct UA_SessionHeader { + SLIST_ENTRY(UA_SessionHeader) next; + UA_NodeId authenticationToken; + UA_SecureChannel *channel; /* The pointer back to the SecureChannel in the session. */ +} UA_SessionHeader; + +/* For chunked requests */ +typedef struct UA_Chunk { + SIMPLEQ_ENTRY(UA_Chunk) pointers; + UA_ByteString bytes; + UA_MessageType messageType; + UA_ChunkType chunkType; + UA_UInt32 requestId; + UA_Boolean copied; /* Do the bytes point to a buffer from the network or was + * memory allocated for the chunk separately */ +} UA_Chunk; + +typedef SIMPLEQ_HEAD(UA_ChunkQueue, UA_Chunk) UA_ChunkQueue; + +typedef enum { + UA_SECURECHANNELRENEWSTATE_NORMAL, + + /* Client has sent an OPN, but not received a response so far. */ + UA_SECURECHANNELRENEWSTATE_SENT, + + /* The server waits for the first request with the new token for the rollover. + * The new token is stored in the altSecurityToken. The configured local and + * remote symmetric encryption keys are the old ones. */ + UA_SECURECHANNELRENEWSTATE_NEWTOKEN_SERVER, + + /* The client already uses the new token. But he waits for the server to respond + * with the new token to complete the rollover. The old token is stored in + * altSecurityToken. The local symmetric encryption key is new. The remote + * encryption key is the old one. */ + UA_SECURECHANNELRENEWSTATE_NEWTOKEN_CLIENT +} UA_SecureChannelRenewState; + +struct UA_SecureChannel { + UA_SecureChannelState state; + UA_SecureChannelRenewState renewState; + UA_MessageSecurityMode securityMode; + UA_ConnectionConfig config; + + /* Rules for revolving the token with a renew OPN request: The client is + * allowed to accept messages with the old token until the OPN response has + * arrived. The server accepts the old token until one message secured with + * the new token has arrived. + * + * We recognize whether nextSecurityToken contains a valid next token if the + * ChannelId is not 0. */ + UA_ChannelSecurityToken securityToken; /* Also contains the channelId */ + UA_ChannelSecurityToken altSecurityToken; /* Alternative token for the rollover. + * See the renewState. */ + + /* The endpoint and context of the channel */ + const UA_SecurityPolicy *securityPolicy; + void *channelContext; /* For interaction with the security policy */ + UA_Connection *connection; + + /* Asymmetric encryption info */ + UA_ByteString remoteCertificate; + UA_Byte remoteCertificateThumbprint[20]; /* The thumbprint of the remote certificate */ + + /* Symmetric encryption nonces. These are used to generate the key material + * and must not be reused once the keys are in place. + * + * Nonces are also used during the CreateSession / ActivateSession + * handshake. These are not handled here, as the Session handling can + * overlap with a RenewSecureChannel. */ + UA_ByteString remoteNonce; + UA_ByteString localNonce; + + UA_UInt32 receiveSequenceNumber; + UA_UInt32 sendSequenceNumber; + + /* Sessions that are bound to the SecureChannel */ + SLIST_HEAD(, UA_SessionHeader) sessions; + + /* If a buffer is received, first all chunks are put into the completeChunks + * queue. Then they are processed in order. This ensures that processing + * buffers is reentrant with the correct processing order. (This has lead to + * problems in the client in the past.) */ + UA_ChunkQueue completeChunks; /* Received full chunks that have not been + * decrypted so far */ + UA_ChunkQueue decryptedChunks; /* Received chunks that were decrypted but + * not processed */ + size_t decryptedChunksCount; + size_t decryptedChunksLength; + UA_ByteString incompleteChunk; /* A half-received chunk (TCP is a + * streaming protocol) is stored here */ + + UA_CertificateVerification *certificateVerification; + UA_StatusCode (*processOPNHeader)(void *application, UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader); +}; + +void UA_SecureChannel_init(UA_SecureChannel *channel, + const UA_ConnectionConfig *config); + +void UA_SecureChannel_close(UA_SecureChannel *channel); + +/* Process the remote configuration in the HEL/ACK handshake. The connection + * config is initialized with the local settings. */ +UA_StatusCode +UA_SecureChannel_processHELACK(UA_SecureChannel *channel, + const UA_TcpAcknowledgeMessage *remoteConfig); + +UA_StatusCode +UA_SecureChannel_setSecurityPolicy(UA_SecureChannel *channel, + const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate); + +/* Remove (partially) received unprocessed chunks */ +void +UA_SecureChannel_deleteBuffered(UA_SecureChannel *channel); + +/* Wrapper function for generating a local nonce for the supplied channel. Uses + * the random generator of the channels security policy to allocate and generate + * a nonce with the specified length. */ +UA_StatusCode +UA_SecureChannel_generateLocalNonce(UA_SecureChannel *channel); + +UA_StatusCode +UA_SecureChannel_generateLocalKeys(const UA_SecureChannel *channel); + +UA_StatusCode +generateRemoteKeys(const UA_SecureChannel *channel); + +/** + * Sending Messages + * ---------------- */ + +UA_StatusCode +UA_SecureChannel_sendAsymmetricOPNMessage(UA_SecureChannel *channel, UA_UInt32 requestId, + const void *content, const UA_DataType *contentType); + +UA_StatusCode +UA_SecureChannel_sendSymmetricMessage(UA_SecureChannel *channel, UA_UInt32 requestId, + UA_MessageType messageType, void *payload, + const UA_DataType *payloadType); + +/* The MessageContext is forwarded into the encoding layer so that we can send + * chunks before continuing to encode. This lets us reuse a fixed chunk-sized + * messages buffer. */ +typedef struct { + UA_SecureChannel *channel; + UA_UInt32 requestId; + UA_UInt32 messageType; + + UA_UInt16 chunksSoFar; + size_t messageSizeSoFar; + + UA_ByteString messageBuffer; + UA_Byte *buf_pos; + const UA_Byte *buf_end; + + UA_Boolean final; +} UA_MessageContext; + +/* Start the context of a new symmetric message. */ +UA_StatusCode +UA_MessageContext_begin(UA_MessageContext *mc, UA_SecureChannel *channel, + UA_UInt32 requestId, UA_MessageType messageType); + +/* Encode the content and send out full chunks. If the return code is good, then + * the ChunkInfo contains encoded content that has not been sent. If the return + * code is bad, then the ChunkInfo has been cleaned up internally. */ +UA_StatusCode +UA_MessageContext_encode(UA_MessageContext *mc, const void *content, + const UA_DataType *contentType); + +/* Sends a symmetric message already encoded in the context. The context is + * cleaned up, also in case of errors. */ +UA_StatusCode +UA_MessageContext_finish(UA_MessageContext *mc); + +/* To be used when a failure occures when a MessageContext is open. Note that + * the _encode and _finish methods will clean up internally. _abort can be run + * on a MessageContext that has already been cleaned up before. */ +void +UA_MessageContext_abort(UA_MessageContext *mc); + +/** + * Receive Message + * --------------- */ + +typedef UA_StatusCode +(UA_ProcessMessageCallback)(void *application, UA_SecureChannel *channel, + UA_MessageType messageType, UA_UInt32 requestId, + UA_ByteString *message); + +/* Process a received buffer. The callback function is called with the message + * body if the message is complete. The message is removed afterwards. Returns + * if an irrecoverable error occured. + * + * Note that only MSG and CLO messages are decrypted. HEL/ACK/OPN/... are + * forwarded verbatim to the application. */ +UA_StatusCode +UA_SecureChannel_processBuffer(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback, + const UA_ByteString *buffer); + +/* Try to receive at least one complete chunk on the connection. This blocks the + * current thread up to the given timeout. It will return once the first buffer + * has been received (and possibly processed when the message is complete). + * + * @param channel The SecureChannel + * @param application The client or server application + * @param callback The function pointer for processing complete messages + * @param timeout The timeout (in milliseconds) the method will block at most. + * @return Returns UA_STATUSCODE_GOOD or an error code. A timeout does not + * create an error. */ +UA_StatusCode +UA_SecureChannel_receive(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback, UA_UInt32 timeout); + +/* Internal methods in ua_securechannel_crypto.h */ + +void +hideBytesAsym(const UA_SecureChannel *channel, UA_Byte **buf_start, + const UA_Byte **buf_end); + +/* Decrypt and verify via the signature. The chunk buffer is reused to hold the + * decrypted data after the MessageHeader and SecurityHeader. The chunk length + * is reduced by the signature, padding and encryption overhead. + * + * The offset argument points to the start of the encrypted content (beginning + * with the SequenceHeader).*/ +UA_StatusCode +decryptAndVerifyChunk(const UA_SecureChannel *channel, + const UA_SecurityPolicyCryptoModule *cryptoModule, + UA_MessageType messageType, UA_ByteString *chunk, + size_t offset); + +size_t +calculateAsymAlgSecurityHeaderLength(const UA_SecureChannel *channel); + +UA_StatusCode +prependHeadersAsym(UA_SecureChannel *const channel, UA_Byte *header_pos, + const UA_Byte *buf_end, size_t totalLength, + size_t securityHeaderLength, UA_UInt32 requestId, + size_t *const finalLength); + +void +setBufPos(UA_MessageContext *mc); + +UA_StatusCode +checkSymHeader(UA_SecureChannel *channel, const UA_SymmetricAlgorithmSecurityHeader *symHeader); + +UA_StatusCode +processSequenceNumberAsym(UA_SecureChannel *channel, UA_UInt32 sequenceNumber); + +UA_StatusCode +checkAsymHeader(UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader); + +void +padChunkAsym(UA_SecureChannel *channel, const UA_ByteString *buf, + size_t securityHeaderLength, UA_Byte **buf_pos); + +UA_StatusCode +signAndEncryptAsym(UA_SecureChannel *channel, size_t preSignLength, + UA_ByteString *buf, size_t securityHeaderLength, + size_t totalLength); + +void +padChunkSym(UA_MessageContext *messageContext, size_t bodyLength); + +UA_StatusCode +signChunkSym(UA_MessageContext *const messageContext, size_t preSigLength); + +UA_StatusCode +encryptChunkSym(UA_MessageContext *const messageContext, size_t totalLength); + +/** + * Log Helper + * ---------- + * C99 requires at least one element for the variadic argument. If the log + * statement has no variable arguments, supply an additional NULL. It will be + * ignored by printf. + * + * We have to jump through some hoops to enable the use of format strings + * without arguments since (pedantic) C99 does not allow variadic macros with + * zero arguments. So we add a dummy argument that is not printed (%.0s is + * string of length zero). */ + +#define UA_LOG_TRACE_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_TRACE(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (int)((CHANNEL)->connection->sockfd) : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_TRACE_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_TRACE_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +#define UA_LOG_DEBUG_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_DEBUG(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (int)((CHANNEL)->connection->sockfd) : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_DEBUG_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_DEBUG_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +#define UA_LOG_INFO_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_INFO(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (int)((CHANNEL)->connection->sockfd) : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_INFO_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_INFO_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +#define UA_LOG_WARNING_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_WARNING(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (int)((CHANNEL)->connection->sockfd) : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_WARNING_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_WARNING_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +#define UA_LOG_ERROR_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_ERROR(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (int)((CHANNEL)->connection->sockfd) : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_ERROR_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_ERROR_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +#define UA_LOG_FATAL_CHANNEL_INTERNAL(LOGGER, CHANNEL, MSG, ...) \ + UA_LOG_FATAL(LOGGER, UA_LOGCATEGORY_SECURECHANNEL, \ + "Connection %i | SecureChannel %" PRIu32 " | " MSG "%.0s", \ + ((CHANNEL)->connection ? (CHANNEL)->connection->sockfd : 0), \ + (CHANNEL)->securityToken.channelId, __VA_ARGS__) + +#define UA_LOG_FATAL_CHANNEL(LOGGER, CHANNEL, ...) \ + UA_MACRO_EXPAND(UA_LOG_FATAL_CHANNEL_INTERNAL(LOGGER, CHANNEL, __VA_ARGS__, "")) + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_timer.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017, 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +/* The timer is protected by its own mutex. The mutex is released before calling + * into the callbacks. So the timer can be modified from the callbacks it is + * executing. Also, the timer mutex can never lead to locking. Because the timer + * mutex will be left without acquiring another mutex. + * + * Obviously, the timer must not be deleted from within one of its + * callbacks. */ + +/* Callback where the application is either a client or a server */ +typedef void (*UA_ApplicationCallback)(void *application, void *data); + +typedef struct UA_TimerEntry { + ZIP_ENTRY(UA_TimerEntry) zipfields; + UA_DateTime nextTime; /* The next time when the callback + * is to be executed */ + UA_UInt64 interval; /* Interval in 100ns resolution. If + the interval is zero, the + callback is not repeated and + removed after execution. */ + UA_ApplicationCallback callback; + void *application; + void *data; + + ZIP_ENTRY(UA_TimerEntry) idZipfields; + UA_UInt64 id; /* Id of the entry */ +} UA_TimerEntry; + +ZIP_HEAD(UA_TimerZip, UA_TimerEntry); +typedef struct UA_TimerZip UA_TimerZip; + +ZIP_HEAD(UA_TimerIdZip, UA_TimerEntry); +typedef struct UA_TimerIdZip UA_TimerIdZip; + +typedef struct { + UA_TimerZip root; /* The root of the time-sorted zip tree */ + UA_TimerIdZip idRoot; /* The root of the id-sorted zip tree */ + UA_UInt64 idCounter; /* Generate unique identifiers. Identifiers are always + * above zero. */ +#if UA_MULTITHREADING >= 100 + UA_LOCK_TYPE(timerMutex) +#endif +} UA_Timer; + +void +UA_Timer_init(UA_Timer *t); + +UA_StatusCode +UA_Timer_addTimedCallback(UA_Timer *t, UA_ApplicationCallback callback, + void *application, void *data, UA_DateTime date, + UA_UInt64 *callbackId); + +/* Add a pre-allocated and pre-filled UA_TimerEntry. This cannot fail. It is + * used, for example, for delayed memory reclamation where the data structure + * begins with a UA_TimerEntry. */ +void +UA_Timer_addTimerEntry(UA_Timer *t, UA_TimerEntry *te, UA_UInt64 *callbackId); + +UA_StatusCode +UA_Timer_addRepeatedCallback(UA_Timer *t, UA_ApplicationCallback callback, + void *application, void *data, UA_Double interval_ms, + UA_UInt64 *callbackId); + +UA_StatusCode +UA_Timer_changeRepeatedCallbackInterval(UA_Timer *t, UA_UInt64 callbackId, + UA_Double interval_ms); + +void +UA_Timer_removeCallback(UA_Timer *t, UA_UInt64 callbackId); + +/* Process (dispatch) the repeated callbacks that have timed out. Returns the + * timestamp of the next scheduled repeated callback. Not thread-safe. + * Application is a pointer to the client / server environment for the callback. + * Dispatched is set to true when at least one callback was run / dispatched. */ +typedef void +(*UA_TimerExecutionCallback)(void *executionApplication, UA_ApplicationCallback cb, + void *callbackApplication, void *data); + +UA_DateTime +UA_Timer_process(UA_Timer *t, UA_DateTime nowMonotonic, + UA_TimerExecutionCallback executionCallback, + void *executionApplication); + +void +UA_Timer_clear(UA_Timer *t); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_session.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + + +_UA_BEGIN_DECLS + +#define UA_MAXCONTINUATIONPOINTS 5 + +struct ContinuationPoint; +typedef struct ContinuationPoint ContinuationPoint; + +/* Returns the next entry in the linked list */ +ContinuationPoint * +ContinuationPoint_clear(ContinuationPoint *cp); + +struct UA_Subscription; +typedef struct UA_Subscription UA_Subscription; + +#ifdef UA_ENABLE_SUBSCRIPTIONS +typedef struct UA_PublishResponseEntry { + SIMPLEQ_ENTRY(UA_PublishResponseEntry) listEntry; + UA_UInt32 requestId; + UA_PublishResponse response; +} UA_PublishResponseEntry; +#endif + +typedef struct { + UA_SessionHeader header; + UA_ApplicationDescription clientDescription; + UA_String sessionName; + UA_Boolean activated; + void *sessionHandle; /* pointer assigned in userland-callback */ + UA_NodeId sessionId; + UA_UInt32 maxRequestMessageSize; + UA_UInt32 maxResponseMessageSize; + UA_Double timeout; /* in ms */ + UA_DateTime validTill; + UA_ByteString serverNonce; + UA_UInt16 availableContinuationPoints; + ContinuationPoint *continuationPoints; +#ifdef UA_ENABLE_SUBSCRIPTIONS + size_t subscriptionsSize; + TAILQ_HEAD(, UA_Subscription) subscriptions; /* Late subscriptions that do eventually + * publish are moved to the tail. So that + * other late subscriptions are not + * starved. */ + SIMPLEQ_HEAD(, UA_PublishResponseEntry) responseQueue; + UA_UInt32 numPublishReq; + size_t totalRetransmissionQueueSize; /* Retransmissions of all subscriptions */ +#endif +} UA_Session; + +/** + * Session Lifecycle + * ----------------- */ + +void UA_Session_init(UA_Session *session); +void UA_Session_clear(UA_Session *session, UA_Server *server); +void UA_Session_attachToSecureChannel(UA_Session *session, UA_SecureChannel *channel); +void UA_Session_detachFromSecureChannel(UA_Session *session); +UA_StatusCode UA_Session_generateNonce(UA_Session *session); + +/* If any activity on a session happens, the timeout is extended */ +void UA_Session_updateLifetime(UA_Session *session); + +/** + * Subscription handling + * --------------------- */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +void +UA_Session_attachSubscription(UA_Session *session, UA_Subscription *sub); + +void +UA_Session_detachSubscription(UA_Server *server, UA_Session *session, + UA_Subscription *sub); + +UA_Subscription * +UA_Session_getSubscriptionById(UA_Session *session, + UA_UInt32 subscriptionId); + + +void +UA_Session_queuePublishReq(UA_Session *session, + UA_PublishResponseEntry* entry, + UA_Boolean head); + +UA_PublishResponseEntry * +UA_Session_dequeuePublishReq(UA_Session *session); + +#endif + +/** + * Log Helper + * ---------- + * We have to jump through some hoops to enable the use of format strings + * without arguments since (pedantic) C99 does not allow variadic macros with + * zero arguments. So we add a dummy argument that is not printed (%.0s is + * string of length zero). */ + +#define UA_LOG_SESSION_INTERNAL(LOGGER, LEVEL, SESSION, MSG, ...) \ + do { \ + UA_String idString = UA_STRING_NULL; \ + UA_UInt32 channelId = 0; \ + if(SESSION) { \ + UA_NodeId_print(&(SESSION)->sessionId, &idString); \ + channelId = (SESSION)->header.channel ? \ + (SESSION)->header.channel->securityToken.channelId : 0; \ + } \ + UA_LOG_##LEVEL(LOGGER, UA_LOGCATEGORY_SESSION, \ + "SecureChannel %i | Session %.*s | " MSG "%.0s", \ + channelId, (int)idString.length, idString.data, __VA_ARGS__); \ + UA_String_clear(&idString); \ + } while(0) + +#if UA_LOGLEVEL <= 100 +# define UA_LOG_TRACE_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, TRACE, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_TRACE_SESSION(LOGGER, SESSION, ...) +#endif + +#if UA_LOGLEVEL <= 200 +# define UA_LOG_DEBUG_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, DEBUG, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_DEBUG_SESSION(LOGGER, SESSION, ...) +#endif + +#if UA_LOGLEVEL <= 300 +# define UA_LOG_INFO_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, INFO, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_INFO_SESSION(LOGGER, SESSION, ...) +#endif + +#if UA_LOGLEVEL <= 400 +# define UA_LOG_WARNING_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, WARNING, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_WARNING_SESSION(LOGGER, SESSION, ...) +#endif + +#if UA_LOGLEVEL <= 500 +# define UA_LOG_ERROR_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, ERROR, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_ERROR_SESSION(LOGGER, SESSION, ...) +#endif + +#if UA_LOGLEVEL <= 600 +# define UA_LOG_FATAL_SESSION(LOGGER, SESSION, ...) \ + UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, FATAL, SESSION, __VA_ARGS__, "")) +#else +# define UA_LOG_FATAL_SESSION(LOGGER, SESSION, ...) +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_subscription.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Florian Palm + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mattias Bornhager + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart (for VDW and umati) + */ + + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +#define UA_BOUNDEDVALUE_SETWBOUNDS(BOUNDS, SRC, DST) { \ + if(SRC > BOUNDS.max) DST = BOUNDS.max; \ + else if(SRC < BOUNDS.min) DST = BOUNDS.min; \ + else DST = SRC; \ + } + +/* Set to the TAILQ_NEXT pointer of a notification, the sentinel that the + * notification was not added to the global queue */ +#define UA_SUBSCRIPTION_QUEUE_SENTINEL ((UA_Notification*)0x01) + +/** + * MonitoredItems create Notifications. Subscriptions collect Notifications from + * (several) MonitoredItems and publish them to the client. + * + * Notifications are put into two queues at the same time. One for the + * MonitoredItem that generated the notification. Here we can remove it if the + * space reserved for the MonitoredItem runs full. The second queue is the + * "global" queue for all Notifications generated in a Subscription. For + * publication, the notifications are taken out of the "global" queue in the + * order of their creation. + */ + +/*****************/ +/* MonitoredItem */ +/*****************/ + +struct UA_MonitoredItem; +typedef struct UA_MonitoredItem UA_MonitoredItem; + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS +#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS + +typedef enum { + UA_INACTIVE, + UA_ACTIVE, + UA_ACTIVE_HIGHHIGH, + UA_ACTIVE_HIGH, + UA_ACTIVE_LOW, + UA_ACTIVE_LOWLOW +} UA_ActiveState; + +typedef struct { + UA_TwoStateVariableChangeCallback enableStateCallback; + UA_TwoStateVariableChangeCallback ackStateCallback; + UA_Boolean ackedRemoveBranch; + UA_TwoStateVariableChangeCallback confirmStateCallback; + UA_Boolean confirmedRemoveBranch; + UA_TwoStateVariableChangeCallback activeStateCallback; +} UA_ConditionCallbacks; + +/* In Alarms and Conditions first implementation, conditionBranchId is always + * equal to NULL NodeId (UA_NODEID_NULL). That ConditionBranch represents the + * current state Condition. The current state is determined by the last Event + * triggered (lastEventId). See Part 9, 5.5.2, BranchId. */ +typedef struct UA_ConditionBranch { + LIST_ENTRY(UA_ConditionBranch) listEntry; + UA_NodeId conditionBranchId; + UA_ByteString lastEventId; + UA_Boolean isCallerAC; +} UA_ConditionBranch; + +/* In Alarms and Conditions first implementation, A Condition + * have only one ConditionBranch entry. */ +typedef struct UA_Condition { + LIST_ENTRY(UA_Condition) listEntry; + LIST_HEAD(, UA_ConditionBranch) conditionBranchHead; + UA_NodeId conditionId; + UA_UInt16 lastSeverity; + UA_DateTime lastSeveritySourceTimeStamp; + UA_ConditionCallbacks callbacks; + UA_ActiveState lastActiveState; + UA_ActiveState currentActiveState; + UA_Boolean isLimitAlarm; +} UA_Condition; + +/* A ConditionSource can have multiple Conditions. */ +typedef struct UA_ConditionSource { + LIST_ENTRY(UA_ConditionSource) listEntry; + LIST_HEAD(, UA_Condition) conditionHead; + UA_NodeId conditionSourceId; +} UA_ConditionSource; + +#endif /* UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */ +#endif /* UA_ENABLE_SUBSCRIPTIONS_EVENTS */ + +typedef struct UA_Notification { + TAILQ_ENTRY(UA_Notification) listEntry; /* Notification list for the MonitoredItem */ + TAILQ_ENTRY(UA_Notification) globalEntry; /* Notification list for the Subscription */ + + UA_MonitoredItem *mon; /* Always set */ + /* The event field is used if mon->attributeId is the EventNotifier */ + union { + UA_MonitoredItemNotification dataChange; +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_EventFieldList event; +#endif + } data; +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_Boolean isOverflowEvent; /* Counted manually */ +#endif +} UA_Notification; + +/* Notifications are always added to the queue of the MonitoredItem. That queue + * can overflow. If Notifications are reported, they are also added to the + * global queue of the Subscription. There they are picked up by the publishing + * callback. + * + * There are two ways Notifications can be put into the global queue of the + * Subscription: They are added because the MonitoringMode of the MonitoredItem + * is "reporting". Or the MonitoringMode is "sampling" and a link is trigered + * that puts the last Notification into the global queue. */ + +UA_Notification * UA_Notification_new(void); +/* Dequeue and Delete the notification */ +void UA_Notification_delete(UA_Server *server, UA_Notification *n); +/* If reporting, enqueue into the Subscription first and then into the + * MonitoredItem. Otherwise the reinsertion in UA_MonitoredItem_ensureQueueSpace + * might not work. */ +void UA_Notification_enqueueSub(UA_Notification *n); +void UA_Notification_enqueueMon(UA_Server *server, UA_Notification *n); +void UA_Notification_enqueueAndTrigger(UA_Server *server, UA_Notification *n); +void UA_Notification_dequeueSub(UA_Notification *n); +void UA_Notification_dequeueMon(UA_Server *server, UA_Notification *n); + +typedef TAILQ_HEAD(NotificationQueue, UA_Notification) NotificationQueue; + +struct UA_MonitoredItem { + UA_TimerEntry delayedFreePointers; + LIST_ENTRY(UA_MonitoredItem) listEntry; +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_MonitoredItem *next; /* Linked list of MonitoredItems directly attached + * to a Node */ +#endif + UA_Subscription *subscription; /* Local MonitoredItem if the subscription is NULL */ + UA_UInt32 monitoredItemId; + + /* Status and Settings */ + UA_ReadValueId itemToMonitor; + UA_MonitoringMode monitoringMode; + UA_TimestampsToReturn timestampsToReturn; + UA_Boolean sampleCallbackIsRegistered; + UA_Boolean registered; /* Registered in the server / Subscription */ + + /* If the filter is a UA_DataChangeFilter: The DataChangeFilter always + * contains an absolute deadband definition. Part 8, §6.2 gives the + * following formula to test for percentage deadbands: + * + * DataChange if (absolute value of (last cached value - current value) + * > (deadbandValue/100.0) * ((high–low) of EURange))) + * + * So we can convert from a percentage to an absolute deadband and keep + * the hot code path simple. + * + * TODO: Store the percentage deadband to recompute when the UARange is + * changed at runtime of the MonitoredItem */ + UA_MonitoringParameters parameters; + + /* Sampling Callback */ + UA_UInt64 sampleCallbackId; + UA_ByteString lastSampledValue; + UA_DataValue lastValue; + + /* Triggering Links */ + size_t triggeringLinksSize; + UA_UInt32 *triggeringLinks; + + /* Notification Queue */ + NotificationQueue queue; + size_t queueSize; /* This is the current size. See also the configured + * (maximum) queueSize in the parameters. */ + size_t eventOverflows; /* Separate counter for the queue. Can at most double + * the queue size */ +}; + +void UA_MonitoredItem_init(UA_MonitoredItem *mon); +UA_StatusCode UA_Server_registerMonitoredItem(UA_Server *server, UA_MonitoredItem *mon); +void UA_MonitoredItem_delete(UA_Server *server, UA_MonitoredItem *monitoredItem); + +void UA_MonitoredItem_sampleCallback(UA_Server *server, UA_MonitoredItem *monitoredItem); +UA_StatusCode UA_MonitoredItem_registerSampleCallback(UA_Server *server, UA_MonitoredItem *mon); +void UA_MonitoredItem_unregisterSampleCallback(UA_Server *server, UA_MonitoredItem *mon); + +UA_StatusCode UA_MonitoredItem_removeLink(UA_Subscription *sub, UA_MonitoredItem *mon, + UA_UInt32 linkId); +UA_StatusCode UA_MonitoredItem_addLink(UA_Subscription *sub, UA_MonitoredItem *mon, UA_UInt32 linkId); + +UA_StatusCode +UA_MonitoredItem_createDataChangeNotification(UA_Server *server, UA_Subscription *sub, + UA_MonitoredItem *mon, const UA_DataValue *value); + +UA_StatusCode UA_Event_addEventToMonitoredItem(UA_Server *server, const UA_NodeId *event, UA_MonitoredItem *mon); +UA_StatusCode UA_Event_generateEventId(UA_ByteString *generatedId); + +/* Remove entries until mon->maxQueueSize is reached. Sets infobits for lost + * data if required. */ +void UA_MonitoredItem_ensureQueueSpace(UA_Server *server, UA_MonitoredItem *mon); + +/****************/ +/* Subscription */ +/****************/ + +typedef struct UA_NotificationMessageEntry { + TAILQ_ENTRY(UA_NotificationMessageEntry) listEntry; + UA_NotificationMessage message; +} UA_NotificationMessageEntry; + +/* We use only a subset of the states defined in the standard */ +typedef enum { + /* UA_SUBSCRIPTIONSTATE_CLOSED */ + /* UA_SUBSCRIPTIONSTATE_CREATING */ + UA_SUBSCRIPTIONSTATE_NORMAL, + UA_SUBSCRIPTIONSTATE_LATE, + UA_SUBSCRIPTIONSTATE_KEEPALIVE +} UA_SubscriptionState; + +typedef TAILQ_HEAD(ListOfNotificationMessages, UA_NotificationMessageEntry) ListOfNotificationMessages; + +/* Subscriptions are managed in a server-wide linked list. If they are attached + * to a Session, then they are additionaly in the per-Session linked-list. A + * subscription is always generated for a Session. But the CloseSession Service + * may keep Subscriptions intact beyond the Session lifetime. They can then be + * re-bound to a new Session with the TransferSubscription Service. */ +struct UA_Subscription { + UA_TimerEntry delayedFreePointers; + LIST_ENTRY(UA_Subscription) serverListEntry; + TAILQ_ENTRY(UA_Subscription) sessionListEntry; /* Only set if session != NULL */ + UA_Session *session; /* May be NULL if no session is attached. */ + UA_UInt32 subscriptionId; + + /* Settings */ + UA_UInt32 lifeTimeCount; + UA_UInt32 maxKeepAliveCount; + UA_Double publishingInterval; /* in ms */ + UA_UInt32 notificationsPerPublish; + UA_Boolean publishingEnabled; + UA_UInt32 priority; + + /* Runtime information */ + UA_SubscriptionState state; + UA_StatusCode statusChange; /* If set, a notification is generated and the + * Subscription is deleted within + * UA_Subscription_publish. */ + UA_UInt32 nextSequenceNumber; + UA_UInt32 currentKeepAliveCount; + UA_UInt32 currentLifetimeCount; + + /* Publish Callback. Registered if id > 0. */ + UA_UInt64 publishCallbackId; + + /* MonitoredItems */ + UA_UInt32 lastMonitoredItemId; /* increase the identifiers */ + LIST_HEAD(, UA_MonitoredItem) monitoredItems; + UA_UInt32 monitoredItemsSize; + + /* Global list of notifications from the MonitoredItems */ + NotificationQueue notificationQueue; + UA_UInt32 notificationQueueSize; /* Total queue size */ + UA_UInt32 dataChangeNotifications; + UA_UInt32 eventNotifications; + + /* Notifications to be sent out now (already late). In a regular publish + * callback, all queued notifications are sent out. In a late publish + * response, only the notifications left from the last regular publish + * callback are sent. */ + UA_UInt32 readyNotifications; + + /* Retransmission Queue */ + ListOfNotificationMessages retransmissionQueue; + size_t retransmissionQueueSize; +}; + +UA_Subscription * UA_Subscription_new(void); +void UA_Subscription_delete(UA_Server *server, UA_Subscription *sub); +UA_StatusCode Subscription_registerPublishCallback(UA_Server *server, UA_Subscription *sub); +void Subscription_unregisterPublishCallback(UA_Server *server, UA_Subscription *sub); +UA_MonitoredItem * UA_Subscription_getMonitoredItem(UA_Subscription *sub, UA_UInt32 monitoredItemId); + +void UA_Subscription_publish(UA_Server *server, UA_Subscription *sub); +UA_StatusCode UA_Subscription_removeRetransmissionMessage(UA_Subscription *sub, + UA_UInt32 sequenceNumber); +UA_Boolean UA_Session_reachedPublishReqLimit(UA_Server *server, UA_Session *session); + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + +/* Only for unit testing */ +UA_StatusCode +UA_Server_evaluateWhereClauseContentFilter( + UA_Server *server, + const UA_NodeId *eventNode, + const UA_ContentFilter *contentFilter); +#endif /* UA_ENABLE_SUBSCRIPTIONS_EVENTS */ + +/** + * Log Helper + * ---------- + * See a description of the tricks used in ua_session.h */ + +#define UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, LEVEL, SUB, MSG, ...) do { \ + UA_String idString = UA_STRING_NULL; \ + if((SUB) && (SUB)->session) { \ + UA_NodeId_print(&(SUB)->session->sessionId, &idString); \ + UA_LOG_##LEVEL(LOGGER, UA_LOGCATEGORY_SESSION, \ + "SecureChannel %i | Session %.*s | Subscription %" PRIu32 " | " MSG "%.0s", \ + ((SUB)->session->header.channel ? \ + (SUB)->session->header.channel->securityToken.channelId : 0), \ + (int)idString.length, idString.data, (SUB)->subscriptionId, __VA_ARGS__); \ + UA_String_clear(&idString); \ + } else { \ + UA_LOG_##LEVEL(LOGGER, UA_LOGCATEGORY_SERVER, \ + "Subscription %" PRIu32 " | " MSG "%.0s", \ + (SUB) ? (SUB)->subscriptionId : 0, __VA_ARGS__); \ + } \ +} while(0) + +#if UA_LOGLEVEL <= 100 +# define UA_LOG_TRACE_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, TRACE, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_TRACE_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#if UA_LOGLEVEL <= 200 +# define UA_LOG_DEBUG_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, DEBUG, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_DEBUG_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#if UA_LOGLEVEL <= 300 +# define UA_LOG_INFO_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, INFO, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_INFO_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#if UA_LOGLEVEL <= 400 +# define UA_LOG_WARNING_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, WARNING, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_WARNING_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#if UA_LOGLEVEL <= 500 +# define UA_LOG_ERROR_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, ERROR, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_ERROR_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#if UA_LOGLEVEL <= 600 +# define UA_LOG_FATAL_SUBSCRIPTION(LOGGER, SUB, ...) \ + UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, FATAL, SUB, __VA_ARGS__, "")) +#else +# define UA_LOG_FATAL_SUBSCRIPTION(LOGGER, SUB, ...) do {} while(0) +#endif + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_networkmessage.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Tino Bischoff) + * Copyright (c) 2017-2019 Fraunhofer IOSB (Author: Andreas Ebner) + */ + + + +_UA_BEGIN_DECLS + +/* DataSet Payload Header */ +typedef struct { + UA_Byte count; + UA_UInt16* dataSetWriterIds; +} UA_DataSetPayloadHeader; + +/* FieldEncoding Enum */ +typedef enum { + UA_FIELDENCODING_VARIANT = 0, + UA_FIELDENCODING_RAWDATA = 1, + UA_FIELDENCODING_DATAVALUE = 2 +} UA_FieldEncoding; + +/* DataSetMessage Type */ +typedef enum { + UA_DATASETMESSAGE_DATAKEYFRAME = 0, + UA_DATASETMESSAGE_DATADELTAFRAME = 1, + UA_DATASETMESSAGE_EVENT = 2, + UA_DATASETMESSAGE_KEEPALIVE = 3 +} UA_DataSetMessageType; + +/* DataSetMessage Header */ +typedef struct { + UA_Boolean dataSetMessageValid; + UA_FieldEncoding fieldEncoding; + UA_Boolean dataSetMessageSequenceNrEnabled; + UA_Boolean timestampEnabled; + UA_Boolean statusEnabled; + UA_Boolean configVersionMajorVersionEnabled; + UA_Boolean configVersionMinorVersionEnabled; + UA_DataSetMessageType dataSetMessageType; + UA_Boolean picoSecondsIncluded; + UA_UInt16 dataSetMessageSequenceNr; + UA_UtcTime timestamp; + UA_UInt16 picoSeconds; + UA_UInt16 status; + UA_UInt32 configVersionMajorVersion; + UA_UInt32 configVersionMinorVersion; +} UA_DataSetMessageHeader; + +/** + * DataSetMessage + * ^^^^^^^^^^^^^^ */ + +typedef struct { + UA_UInt16 fieldCount; + UA_DataValue* dataSetFields; + /* Json keys for the dataSetFields: TODO: own dataSetMessageType for json? */ + UA_String* fieldNames; +} UA_DataSetMessage_DataKeyFrameData; + +typedef struct { + UA_UInt16 fieldIndex; + UA_DataValue fieldValue; +} UA_DataSetMessage_DeltaFrameField; + +typedef struct { + UA_UInt16 fieldCount; + UA_DataSetMessage_DeltaFrameField* deltaFrameFields; +} UA_DataSetMessage_DataDeltaFrameData; + +typedef struct { + UA_DataSetMessageHeader header; + union { + UA_DataSetMessage_DataKeyFrameData keyFrameData; + UA_DataSetMessage_DataDeltaFrameData deltaFrameData; + } data; +} UA_DataSetMessage; + +typedef struct { + UA_UInt16* sizes; + UA_DataSetMessage* dataSetMessages; +} UA_DataSetPayload; + +typedef enum { + UA_PUBLISHERDATATYPE_BYTE = 0, + UA_PUBLISHERDATATYPE_UINT16 = 1, + UA_PUBLISHERDATATYPE_UINT32 = 2, + UA_PUBLISHERDATATYPE_UINT64 = 3, + UA_PUBLISHERDATATYPE_STRING = 4 +} UA_PublisherIdDatatype; + +typedef enum { + UA_NETWORKMESSAGE_DATASET = 0, + UA_NETWORKMESSAGE_DISCOVERY_REQUEST = 1, + UA_NETWORKMESSAGE_DISCOVERY_RESPONSE = 2 +} UA_NetworkMessageType; + +/** + * UA_NetworkMessageGroupHeader + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ +typedef struct { + UA_Boolean writerGroupIdEnabled; + UA_Boolean groupVersionEnabled; + UA_Boolean networkMessageNumberEnabled; + UA_Boolean sequenceNumberEnabled; + UA_UInt16 writerGroupId; + UA_UInt32 groupVersion; // spec: type "VersionTime" + UA_UInt16 networkMessageNumber; + UA_UInt16 sequenceNumber; +} UA_NetworkMessageGroupHeader; + +/** + * UA_NetworkMessageSecurityHeader + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ +typedef struct { + UA_Boolean networkMessageSigned; + UA_Boolean networkMessageEncrypted; + UA_Boolean securityFooterEnabled; + UA_Boolean forceKeyReset; + UA_UInt32 securityTokenId; // spec: IntegerId + UA_Byte nonceLength; + UA_ByteString messageNonce; + UA_UInt16 securityFooterSize; +} UA_NetworkMessageSecurityHeader; + +/** + * UA_NetworkMessage + * ^^^^^^^^^^^^^^^^^ */ +typedef struct { + UA_Byte version; + UA_Boolean messageIdEnabled; + UA_String messageId; /* For Json NetworkMessage */ + UA_Boolean publisherIdEnabled; + UA_Boolean groupHeaderEnabled; + UA_Boolean payloadHeaderEnabled; + UA_PublisherIdDatatype publisherIdType; + UA_Boolean dataSetClassIdEnabled; + UA_Boolean securityEnabled; + UA_Boolean timestampEnabled; + UA_Boolean picosecondsEnabled; + UA_Boolean chunkMessage; + UA_Boolean promotedFieldsEnabled; + UA_NetworkMessageType networkMessageType; + union { + UA_Byte publisherIdByte; + UA_UInt16 publisherIdUInt16; + UA_UInt32 publisherIdUInt32; + UA_UInt64 publisherIdUInt64; + UA_Guid publisherIdGuid; + UA_String publisherIdString; + } publisherId; + UA_Guid dataSetClassId; + + UA_NetworkMessageGroupHeader groupHeader; + + union { + UA_DataSetPayloadHeader dataSetPayloadHeader; + } payloadHeader; + + UA_DateTime timestamp; + UA_UInt16 picoseconds; + UA_UInt16 promotedFieldsSize; + UA_Variant* promotedFields; /* BaseDataType */ + + UA_NetworkMessageSecurityHeader securityHeader; + + union { + UA_DataSetPayload dataSetPayload; + } payload; + + UA_ByteString securityFooter; + UA_ByteString signature; +} UA_NetworkMessage; + +/**********************************************/ +/* Network Message Offsets */ +/**********************************************/ + +/* Offsets for buffered messages in the PubSub fast path. */ +typedef enum { + UA_PUBSUB_OFFSETTYPE_DATASETMESSAGE_SEQUENCENUMBER, + UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_SEQUENCENUMBER, + UA_PUBSUB_OFFSETTYPE_TIMESTAMP_PICOSECONDS, + UA_PUBSUB_OFFSETTYPE_TIMESTAMP, /* source pointer */ + UA_PUBSUB_OFFSETTYPE_TIMESTAMP_NOW, /* no source */ + UA_PUBSUB_OFFSETTYPE_PAYLOAD_DATAVALUE, + UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT, + UA_PUBSUB_OFFSETTYPE_PAYLOAD_RAW, + /* For subscriber RT */ + UA_PUBSUB_OFFSETTYPE_PUBLISHERID, + UA_PUBSUB_OFFSETTYPE_WRITERGROUPID, + UA_PUBSUB_OFFSETTYPE_DATASETWRITERID + /* Add more offset types as needed */ +} UA_NetworkMessageOffsetType; + +typedef struct { + UA_NetworkMessageOffsetType contentType; + union { + struct { + UA_DataValue *value; + size_t valueBinarySize; + } value; + UA_DateTime *timestamp; + } offsetData; + size_t offset; +} UA_NetworkMessageOffset; + +typedef struct { + UA_ByteString buffer; /* The precomputed message buffer */ + UA_NetworkMessageOffset *offsets; /* Offsets for changes in the message buffer */ + size_t offsetsSize; + UA_Boolean RTsubscriberEnabled; /* Addtional offsets computation like publisherId, WGId if this bool enabled */ + UA_NetworkMessage *nm; /* The precomputed NetworkMessage for subscriber */ +} UA_NetworkMessageOffsetBuffer; + +/** + * DataSetMessage + * ^^^^^^^^^^^^^^ */ + +UA_StatusCode +UA_DataSetMessageHeader_encodeBinary(const UA_DataSetMessageHeader* src, + UA_Byte **bufPos, const UA_Byte *bufEnd); + +UA_StatusCode +UA_DataSetMessageHeader_decodeBinary(const UA_ByteString *src, size_t *offset, + UA_DataSetMessageHeader* dst); + +size_t +UA_DataSetMessageHeader_calcSizeBinary(const UA_DataSetMessageHeader* p); + +UA_StatusCode +UA_DataSetMessage_encodeBinary(const UA_DataSetMessage* src, UA_Byte **bufPos, + const UA_Byte *bufEnd); + +UA_StatusCode +UA_DataSetMessage_decodeBinary(const UA_ByteString *src, size_t *offset, + UA_DataSetMessage* dst); + +size_t +UA_DataSetMessage_calcSizeBinary(UA_DataSetMessage *p, UA_NetworkMessageOffsetBuffer *offsetBuffer, + size_t currentOffset); + +void UA_DataSetMessage_clear(const UA_DataSetMessage* p); + +/** + * NetworkMessage + * ^^^^^^^^^^^^^^ */ + +UA_StatusCode +UA_NetworkMessage_updateBufferedMessage(UA_NetworkMessageOffsetBuffer *buffer); + +UA_StatusCode +UA_NetworkMessage_updateBufferedNwMessage(UA_NetworkMessageOffsetBuffer *buffer, + const UA_ByteString *src, size_t *bufferPosition); + +UA_StatusCode +UA_NetworkMessage_encodeBinary(const UA_NetworkMessage* src, + UA_Byte **bufPos, const UA_Byte *bufEnd); + +UA_StatusCode +UA_NetworkMessage_decodeBinary(const UA_ByteString *src, size_t *offset, + UA_NetworkMessage* dst); + +size_t +UA_NetworkMessage_calcSizeBinary(UA_NetworkMessage *p, UA_NetworkMessageOffsetBuffer *offsetBuffer); + +void +UA_NetworkMessage_clear(UA_NetworkMessage* p); + +void +UA_NetworkMessage_delete(UA_NetworkMessage* p); + + +#ifdef UA_ENABLE_JSON_ENCODING +UA_StatusCode +UA_NetworkMessage_encodeJson(const UA_NetworkMessage *src, + UA_Byte **bufPos, const UA_Byte **bufEnd, UA_String *namespaces, + size_t namespaceSize, UA_String *serverUris, + size_t serverUriSize, UA_Boolean useReversible); + +size_t +UA_NetworkMessage_calcSizeJson(const UA_NetworkMessage *src, + UA_String *namespaces, size_t namespaceSize, + UA_String *serverUris, size_t serverUriSize, + UA_Boolean useReversible); + +UA_StatusCode UA_NetworkMessage_decodeJson(UA_NetworkMessage *dst, const UA_ByteString *src); +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Kalycito Infotech Private Limited + * Copyright (c) 2020 Yannick Wallerer, Siemens AG + * Copyright (c) 2020 Thomas Fischer, Siemens AG + */ + + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + +/* forward declarations */ +struct UA_WriterGroup; +typedef struct UA_WriterGroup UA_WriterGroup; + +/* Declaration for ReaderGroup */ +struct UA_ReaderGroup; +typedef struct UA_ReaderGroup UA_ReaderGroup; + +/* The configuration structs (public part of PubSub entities) are defined in include/ua_plugin_pubsub.h */ + +/**********************************************/ +/* PublishedDataSet */ +/**********************************************/ +typedef struct UA_PublishedDataSet{ + UA_PublishedDataSetConfig config; + UA_DataSetMetaDataType dataSetMetaData; + TAILQ_HEAD(UA_ListOfDataSetField, UA_DataSetField) fields; + UA_NodeId identifier; + UA_UInt16 fieldSize; + UA_UInt16 promotedFieldsCount; + UA_UInt16 configurationFreezeCounter; + TAILQ_ENTRY(UA_PublishedDataSet) listEntry; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +} UA_PublishedDataSet; + +UA_StatusCode +UA_PublishedDataSetConfig_copy(const UA_PublishedDataSetConfig *src, UA_PublishedDataSetConfig *dst); +UA_PublishedDataSet * +UA_PublishedDataSet_findPDSbyId(UA_Server *server, UA_NodeId identifier); +void +UA_PublishedDataSet_clear(UA_Server *server, UA_PublishedDataSet *publishedDataSet); + +/**********************************************/ +/* Connection */ +/**********************************************/ +//the connection config (public part of connection) object is defined in include/ua_plugin_pubsub.h +typedef struct UA_PubSubConnection{ + UA_PubSubComponentEnumType componentType; + UA_PubSubConnectionConfig *config; + //internal fields + UA_PubSubChannel *channel; + UA_NodeId identifier; + LIST_HEAD(UA_ListOfWriterGroup, UA_WriterGroup) writerGroups; + size_t writerGroupsSize; + LIST_HEAD(UA_ListOfPubSubReaderGroup, UA_ReaderGroup) readerGroups; + size_t readerGroupsSize; + TAILQ_ENTRY(UA_PubSubConnection) listEntry; + UA_UInt16 configurationFreezeCounter; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +} UA_PubSubConnection; + +UA_StatusCode +UA_PubSubConnectionConfig_copy(const UA_PubSubConnectionConfig *src, UA_PubSubConnectionConfig *dst); +UA_PubSubConnection * +UA_PubSubConnection_findConnectionbyId(UA_Server *server, UA_NodeId connectionIdentifier); +void +UA_PubSubConnectionConfig_clear(UA_PubSubConnectionConfig *connectionConfig); +void +UA_PubSubConnection_clear(UA_Server *server, UA_PubSubConnection *connection); +/* Register channel for given connectionIdentifier */ +UA_StatusCode +UA_PubSubConnection_regist(UA_Server *server, UA_NodeId *connectionIdentifier); + +/**********************************************/ +/* DataSetWriter */ +/**********************************************/ + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES +typedef struct UA_DataSetWriterSample{ + UA_Boolean valueChanged; + UA_DataValue value; +} UA_DataSetWriterSample; +#endif + +typedef struct UA_DataSetWriter{ + UA_PubSubComponentEnumType componentType; + UA_DataSetWriterConfig config; + //internal fields + LIST_ENTRY(UA_DataSetWriter) listEntry; + UA_NodeId identifier; + UA_NodeId linkedWriterGroup; + UA_NodeId connectedDataSet; + UA_ConfigurationVersionDataType connectedDataSetVersion; + UA_PubSubState state; +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES + UA_UInt16 deltaFrameCounter; //actual count of sent deltaFrames + size_t lastSamplesCount; + UA_DataSetWriterSample *lastSamples; +#endif + UA_UInt16 actualDataSetMessageSequenceCount; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +} UA_DataSetWriter; + +UA_StatusCode +UA_DataSetWriterConfig_copy(const UA_DataSetWriterConfig *src, UA_DataSetWriterConfig *dst); +UA_DataSetWriter * +UA_DataSetWriter_findDSWbyId(UA_Server *server, UA_NodeId identifier); +UA_StatusCode +UA_DataSetWriter_setPubSubState(UA_Server *server, UA_PubSubState state, UA_DataSetWriter *dataSetWriter); + +/**********************************************/ +/* WriterGroup */ +/**********************************************/ + +struct UA_WriterGroup{ + UA_PubSubComponentEnumType componentType; + UA_WriterGroupConfig config; + //internal fields + LIST_ENTRY(UA_WriterGroup) listEntry; + UA_NodeId identifier; + UA_PubSubConnection *linkedConnection; + LIST_HEAD(UA_ListOfDataSetWriter, UA_DataSetWriter) writers; + UA_UInt32 writersCount; + UA_UInt64 publishCallbackId; + UA_Boolean publishCallbackIsRegistered; + UA_PubSubState state; + UA_NetworkMessageOffsetBuffer bufferedMessage; + UA_UInt16 sequenceNumber; /* Increased after every succressuly sent message */ + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +}; + +UA_StatusCode +UA_WriterGroupConfig_copy(const UA_WriterGroupConfig *src, UA_WriterGroupConfig *dst); +UA_WriterGroup * +UA_WriterGroup_findWGbyId(UA_Server *server, UA_NodeId identifier); +UA_StatusCode +UA_WriterGroup_setPubSubState(UA_Server *server, UA_PubSubState state, UA_WriterGroup *writerGroup); + +/**********************************************/ +/* DataSetField */ +/**********************************************/ + +typedef struct UA_DataSetField{ + UA_DataSetFieldConfig config; + //internal fields + TAILQ_ENTRY(UA_DataSetField) listEntry; + UA_NodeId identifier; + UA_NodeId publishedDataSet; //ref to parent pds + UA_FieldMetaData fieldMetaData; + UA_UInt64 sampleCallbackId; + UA_Boolean sampleCallbackIsRegistered; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +} UA_DataSetField; + +UA_StatusCode +UA_DataSetFieldConfig_copy(const UA_DataSetFieldConfig *src, UA_DataSetFieldConfig *dst); +UA_DataSetField * +UA_DataSetField_findDSFbyId(UA_Server *server, UA_NodeId identifier); + +/**********************************************/ +/* DataSetReader */ +/**********************************************/ + +/* DataSetReader Type definition */ +typedef struct UA_DataSetReader { + UA_PubSubComponentEnumType componentType; + UA_DataSetReaderConfig config; + /* implementation defined fields */ + UA_NodeId identifier; + UA_NodeId linkedReaderGroup; + LIST_ENTRY(UA_DataSetReader) listEntry; + + /* non std */ + UA_PubSubState state; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; + UA_NetworkMessageOffsetBuffer bufferedMessage; +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* MessageReceiveTimeout handling */ + UA_ServerCallback msgRcvTimeoutTimerCallback; + UA_UInt64 msgRcvTimeoutTimerId; + UA_Boolean msgRcvTimeoutTimerRunning; +#endif /* UA_ENABLE_PUBSUB_MONITORING */ +}UA_DataSetReader; + +/* Process Network Message using DataSetReader */ +void UA_Server_DataSetReader_process(UA_Server *server, UA_DataSetReader *dataSetReader, UA_DataSetMessage* dataSetMsg); + +/* Copy the configuration of DataSetReader */ +UA_StatusCode UA_DataSetReaderConfig_copy(const UA_DataSetReaderConfig *src, UA_DataSetReaderConfig *dst); + +/* Clear the configuration of a DataSetReader */ +void UA_DataSetReaderConfig_clear(UA_DataSetReaderConfig *cfg); + +/* Copy the configuration of Target Variables */ +UA_StatusCode UA_TargetVariables_copy(const UA_TargetVariables *src, UA_TargetVariables *dst); + +/* Clear the Target Variables configuration */ +void UA_TargetVariables_clear(UA_TargetVariables *subscribedDataSetTarget); + +/* Copy the configuration of Field Target Variables */ +UA_StatusCode UA_FieldTargetVariable_copy(const UA_FieldTargetVariable *src, + UA_FieldTargetVariable *dst); + +UA_StatusCode +UA_DataSetReader_setPubSubState(UA_Server *server, UA_PubSubState state, UA_DataSetReader *dataSetReader); + +#ifdef UA_ENABLE_PUBSUB_MONITORING +/* DataSetReader MessageReceiveTimeout callback for generic PubSub component timeout handling */ +void +UA_DataSetReader_handleMessageReceiveTimeout(UA_Server *server, void *dataSetReader); +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +/**********************************************/ +/* ReaderGroup */ +/**********************************************/ +/* ReaderGroup Type Definition*/ + +struct UA_ReaderGroup { + UA_PubSubComponentEnumType componentType; + UA_ReaderGroupConfig config; + UA_NodeId identifier; + UA_NodeId linkedConnection; + LIST_ENTRY(UA_ReaderGroup) listEntry; + LIST_HEAD(UA_ListOfPubSubDataSetReader, UA_DataSetReader) readers; + /* for simplified information access */ + UA_UInt32 readersCount; + UA_UInt64 subscribeCallbackId; + UA_Boolean subscribeCallbackIsRegistered; + UA_PubSubState state; + /* This flag is 'read only' and is set internally based on the PubSub state. */ + UA_Boolean configurationFrozen; +}; + +/* Copy configuration of ReaderGroup */ +UA_StatusCode +UA_ReaderGroupConfig_copy(const UA_ReaderGroupConfig *src, UA_ReaderGroupConfig *dst); + +/* Process Network Message */ +UA_StatusCode +UA_Server_processNetworkMessage(UA_Server *server, UA_NetworkMessage* pMsg, UA_PubSubConnection *pConnection); + +/* Prototypes for internal util functions - some functions maybe removed later + *(currently moved from public to internal)*/ +UA_ReaderGroup *UA_ReaderGroup_findRGbyId(UA_Server *server, UA_NodeId identifier); +UA_DataSetReader *UA_ReaderGroup_findDSRbyId(UA_Server *server, UA_NodeId identifier); +UA_StatusCode +UA_ReaderGroup_setPubSubState(UA_Server *server, UA_PubSubState state, UA_ReaderGroup *readerGroup); + +/*********************************************************/ +/* PublishValues handling */ +/*********************************************************/ + +UA_StatusCode +UA_WriterGroup_addPublishCallback(UA_Server *server, UA_WriterGroup *writerGroup); +void +UA_WriterGroup_publishCallback(UA_Server *server, UA_WriterGroup *writerGroup); + +/*********************************************************/ +/* SubscribeValues handling */ +/*********************************************************/ + +UA_StatusCode +UA_ReaderGroup_addSubscribeCallback(UA_Server *server, UA_ReaderGroup *readerGroup); +void +UA_ReaderGroup_subscribeCallback(UA_Server *server, UA_ReaderGroup *readerGroup); + +#endif /* UA_ENABLE_PUBSUB */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_manager.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2019 Fraunhofer IOSB (Author: Andreas Ebner) + */ + + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + +typedef struct UA_PubSubManager{ + //Connections and PublishedDataSets can exist alone (own lifecycle) -> top level components + size_t connectionsSize; + TAILQ_HEAD(UA_ListOfPubSubConnection, UA_PubSubConnection) connections; + size_t publishedDataSetsSize; + TAILQ_HEAD(UA_ListOfPublishedDataSet, UA_PublishedDataSet) publishedDataSets; +} UA_PubSubManager; + +void +UA_PubSubManager_delete(UA_Server *server, UA_PubSubManager *pubSubManager); + +void +UA_PubSubManager_generateUniqueNodeId(UA_Server *server, UA_NodeId *nodeId); + +UA_UInt32 +UA_PubSubConfigurationVersionTimeDifference(void); + +/***********************************/ +/* PubSub Jobs abstraction */ +/***********************************/ +UA_StatusCode +UA_PubSubManager_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId); +UA_StatusCode +UA_PubSubManager_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, + UA_Double interval_ms); +void +UA_PubSubManager_removeRepeatedPubSubCallback(UA_Server *server, UA_UInt64 callbackId); + +/*************************************************/ +/* PubSub component monitoring */ +/*************************************************/ + +#ifdef UA_ENABLE_PUBSUB_MONITORING + +UA_StatusCode +UA_PubSubManager_setDefaultMonitoringCallbacks(UA_PubSubMonitoringInterface *monitoringInterface); + +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +#endif /* UA_ENABLE_PUBSUB */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_ns0.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Kalycito Infotech Private Limited + */ + +#ifndef UA_PUBSUB_NS0_H_ +#define UA_PUBSUB_NS0_H_ + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL /* conditional compilation */ + +UA_StatusCode +UA_Server_initPubSubNS0(UA_Server *server); + +UA_StatusCode +addPubSubConnectionRepresentation(UA_Server *server, UA_PubSubConnection *connection); + +UA_StatusCode +removePubSubConnectionRepresentation(UA_Server *server, UA_PubSubConnection *connection); + +UA_StatusCode +addWriterGroupRepresentation(UA_Server *server, UA_WriterGroup *writerGroup); + +UA_StatusCode +addReaderGroupRepresentation(UA_Server *server, UA_ReaderGroup *readerGroup); + +UA_StatusCode +removeGroupRepresentation(UA_Server *server, UA_WriterGroup *writerGroup); + +UA_StatusCode +addDataSetWriterRepresentation(UA_Server *server, UA_DataSetWriter *dataSetWriter); + +UA_StatusCode +removeDataSetWriterRepresentation(UA_Server *server, UA_DataSetWriter *dataSetWriter); + +UA_StatusCode +addPublishedDataItemsRepresentation(UA_Server *server, UA_PublishedDataSet *publishedDataSet); + +UA_StatusCode +removePublishedDataSetRepresentation(UA_Server *server, UA_PublishedDataSet *publishedDataSet); + +UA_StatusCode +addDataSetReaderRepresentation(UA_Server *server, UA_DataSetReader *dataSetReader); + +UA_StatusCode +removeDataSetReaderRepresentation(UA_Server *server, UA_DataSetReader *dataSetReader); + +UA_StatusCode +removeReaderGroupRepresentation(UA_Server *server, UA_ReaderGroup *readerGroup); + +#endif /* UA_ENABLE_PUBSUB_INFORMATIONMODEL */ + +_UA_END_DECLS + +#endif /* UA_PUBSUB_NS0_H_ */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_async.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2019 (c) Fraunhofer IOSB (Author: Klaus Schick) + * based on + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2015 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + + +_UA_BEGIN_DECLS + +#if UA_MULTITHREADING >= 100 + +struct UA_AsyncResponse; +typedef struct UA_AsyncResponse UA_AsyncResponse; + +/* A single operation (of a larger request) */ +typedef struct UA_AsyncOperation { + TAILQ_ENTRY(UA_AsyncOperation) pointers; + UA_CallMethodRequest request; + UA_CallMethodResult response; + size_t index; /* Index of the operation in the array of ops in + * request/response */ + UA_AsyncResponse *parent; /* Always non-NULL. The parent is only removed + * when its operations are removed */ +} UA_AsyncOperation; + +struct UA_AsyncResponse { + TAILQ_ENTRY(UA_AsyncResponse) pointers; /* Insert new at the end */ + UA_UInt32 requestId; + UA_NodeId sessionId; + UA_UInt32 requestHandle; + UA_DateTime timeout; + UA_AsyncOperationType operationType; + union { + UA_CallResponse callResponse; + UA_ReadResponse readResponse; + UA_WriteResponse writeResponse; + } response; + UA_UInt32 opCountdown; /* Counter for outstanding operations. The AR can + * only be deleted when all have returned. */ +}; + +typedef TAILQ_HEAD(UA_AsyncOperationQueue, UA_AsyncOperation) UA_AsyncOperationQueue; + +typedef struct { + /* Requests / Responses */ + TAILQ_HEAD(, UA_AsyncResponse) asyncResponses; + size_t asyncResponsesCount; + + /* Operations for the workers. The queues are all FIFO: Put in at the tail, + * take out at the head.*/ + UA_LOCK_TYPE(queueLock) + UA_AsyncOperationQueue newQueue; /* New operations for the workers */ + UA_AsyncOperationQueue dispatchedQueue; /* Operations taken by a worker. When a result is + * returned, we search for the op here to see if it + * is still "alive" (not timed out). */ + UA_AsyncOperationQueue resultQueue; /* Results to be integrated */ + size_t opsCount; /* How many operations are transient (in one of the three queues)? */ + + UA_UInt64 checkTimeoutCallbackId; /* Registered repeated callbacks */ +} UA_AsyncManager; + +void UA_AsyncManager_init(UA_AsyncManager *am, UA_Server *server); +void UA_AsyncManager_clear(UA_AsyncManager *am, UA_Server *server); + +UA_StatusCode +UA_AsyncManager_createAsyncResponse(UA_AsyncManager *am, UA_Server *server, + const UA_NodeId *sessionId, + const UA_UInt32 requestId, + const UA_UInt32 requestHandle, + const UA_AsyncOperationType operationType, + UA_AsyncResponse **outAr); + +/* Only remove the AsyncResponse when the operation count is zero */ +void +UA_AsyncManager_removeAsyncResponse(UA_AsyncManager *am, UA_AsyncResponse *ar); + +UA_StatusCode +UA_AsyncManager_createAsyncOp(UA_AsyncManager *am, UA_Server *server, + UA_AsyncResponse *ar, size_t opIndex, + const UA_CallMethodRequest *opRequest); + +typedef void (*UA_AsyncServiceOperation)(UA_Server *server, UA_Session *session, + UA_UInt32 requestId, UA_UInt32 requestHandle, + size_t opIndex, const void *requestOperation, + void *responseOperation, UA_AsyncResponse **ar); + +/* Creates an AsyncResponse in-situ when an async operation is encountered. If + * that is the case, the sync responses are moved to the AsyncResponse. */ +UA_StatusCode +UA_Server_processServiceOperationsAsync(UA_Server *server, UA_Session *session, + UA_UInt32 requestId, UA_UInt32 requestHandle, + UA_AsyncServiceOperation operationCallback, + const size_t *requestOperations, + const UA_DataType *requestOperationsType, + size_t *responseOperations, + const UA_DataType *responseOperationsType, + UA_AsyncResponse **ar) +UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +#endif /* UA_MULTITHREADING >= 100 */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_internal.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2019 (c) Fraunhofer IOSB (Author: Klaus Schick) + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Julian Grothoff + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + + +_UA_BEGIN_DECLS + +#if UA_MULTITHREADING >= 100 +#undef UA_THREADSAFE +#define UA_THREADSAFE UA_DEPRECATED +#endif + +#ifdef UA_ENABLE_PUBSUB +#endif + +#ifdef UA_ENABLE_DISCOVERY +#endif + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +typedef struct { + UA_MonitoredItem monitoredItem; + void *context; + union { + UA_Server_DataChangeNotificationCallback dataChangeCallback; + /* UA_Server_EventNotificationCallback eventCallback; */ + } callback; +} UA_LocalMonitoredItem; + +#endif + +typedef enum { + UA_DIAGNOSTICEVENT_CLOSE, + UA_DIAGNOSTICEVENT_REJECT, + UA_DIAGNOSTICEVENT_SECURITYREJECT, + UA_DIAGNOSTICEVENT_TIMEOUT, + UA_DIAGNOSTICEVENT_ABORT, + UA_DIAGNOSTICEVENT_PURGE +} UA_DiagnosticEvent; + +typedef struct channel_entry { + UA_TimerEntry cleanupCallback; + TAILQ_ENTRY(channel_entry) pointers; + UA_SecureChannel channel; +} channel_entry; + +typedef struct session_list_entry { + UA_TimerEntry cleanupCallback; + LIST_ENTRY(session_list_entry) pointers; + UA_Session session; +} session_list_entry; + +typedef enum { + UA_SERVERLIFECYCLE_FRESH, + UA_SERVERLIFECYLE_RUNNING +} UA_ServerLifecycle; + +struct UA_Server { + /* Config */ + UA_ServerConfig config; + UA_DateTime startTime; + UA_DateTime endTime; /* Zeroed out. If a time is set, then the server shuts + * down once the time has been reached */ + + UA_ServerLifecycle state; + + /* SecureChannels */ + TAILQ_HEAD(, channel_entry) channels; + UA_UInt32 lastChannelId; + UA_UInt32 lastTokenId; + +#if UA_MULTITHREADING >= 100 + UA_AsyncManager asyncManager; +#endif + + /* Session Management */ + LIST_HEAD(session_list, session_list_entry) sessions; + UA_UInt32 sessionCount; + UA_Session adminSession; /* Local access to the services (for startup and + * maintenance) uses this Session with all possible + * access rights (Session Id: 1) */ + + /* Namespaces */ + size_t namespacesSize; + UA_String *namespaces; + + /* Callbacks with a repetition interval */ + UA_Timer timer; + + /* For bootstrapping, omit some consistency checks, creating a reference to + * the parent and member instantiation */ + UA_Boolean bootstrapNS0; + + /* Discovery */ +#ifdef UA_ENABLE_DISCOVERY + UA_DiscoveryManager discoveryManager; +#endif + + /* Subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + size_t subscriptionsSize; /* Number of active subscriptions */ + size_t monitoredItemsSize; /* Number of active monitored items */ + LIST_HEAD(, UA_Subscription) subscriptions; /* All subscriptions in the + * server. They may be detached + * from a session. */ + UA_UInt32 lastSubscriptionId; /* To generate unique SubscriptionIds */ + + /* To be cast to UA_LocalMonitoredItem to get the callback and context */ + LIST_HEAD(, UA_MonitoredItem) localMonitoredItems; + UA_UInt32 lastLocalMonitoredItemId; + +# ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS + LIST_HEAD(, UA_ConditionSource) headConditionSource; +# endif + +#endif + + /* Publish/Subscribe */ +#ifdef UA_ENABLE_PUBSUB + UA_PubSubManager pubSubManager; +#endif + +#if UA_MULTITHREADING >= 100 + UA_LOCK_TYPE(networkMutex) + UA_LOCK_TYPE(serviceMutex) +#endif + + /* Statistics */ + UA_ServerStatistics serverStats; +}; + + +extern const struct aa_head nameTreeHead; + +/**************************/ +/* SecureChannel Handling */ +/**************************/ + +/* Remove a all securechannels */ +void +UA_Server_deleteSecureChannels(UA_Server *server); + +/* Remove timed out securechannels with a delayed callback. So all currently + * scheduled jobs with a pointer to a securechannel can finish first. */ +void +UA_Server_cleanupTimedOutSecureChannels(UA_Server *server, UA_DateTime nowMonotonic); + +UA_StatusCode +UA_Server_createSecureChannel(UA_Server *server, UA_Connection *connection); + +UA_StatusCode +UA_Server_configSecureChannel(void *application, UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader); + +UA_StatusCode +sendServiceFault(UA_SecureChannel *channel, UA_UInt32 requestId, UA_UInt32 requestHandle, + const UA_DataType *responseType, UA_StatusCode statusCode); + +void +UA_Server_closeSecureChannel(UA_Server *server, UA_SecureChannel *channel, + UA_DiagnosticEvent event); + +/********************/ +/* Session Handling */ +/********************/ + +UA_StatusCode +getNamespaceByName(UA_Server *server, const UA_String namespaceUri, + size_t *foundIndex); + +UA_StatusCode +getBoundSession(UA_Server *server, const UA_SecureChannel *channel, + const UA_NodeId *token, UA_Session **session); + +UA_StatusCode +UA_Server_createSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CreateSessionRequest *request, UA_Session **session); + +void +UA_Server_removeSession(UA_Server *server, session_list_entry *sentry, + UA_DiagnosticEvent event); + +UA_StatusCode +UA_Server_removeSessionByToken(UA_Server *server, const UA_NodeId *token, + UA_DiagnosticEvent event); + +void +UA_Server_cleanupSessions(UA_Server *server, UA_DateTime nowMonotonic); + +UA_Session * +getSessionByToken(UA_Server *server, const UA_NodeId *token); + +UA_Session * +UA_Server_getSessionById(UA_Server *server, const UA_NodeId *sessionId); + +/*****************/ +/* Node Handling */ +/*****************/ + +/* Calls the callback with the node retrieved from the nodestore on top of the + * stack. Either a copy or the original node for in-situ editing. Depends on + * multithreading and the nodestore.*/ +typedef UA_StatusCode (*UA_EditNodeCallback)(UA_Server*, UA_Session*, + UA_Node *node, void*); +UA_StatusCode UA_Server_editNode(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId, + UA_EditNodeCallback callback, + void *data); + +/*********************/ +/* Utility Functions */ +/*********************/ + +void setupNs1Uri(UA_Server *server); +UA_UInt16 addNamespace(UA_Server *server, const UA_String name); + +UA_Boolean +UA_Node_hasSubTypeOrInstances(const UA_NodeHead *head); + +/* Recursively searches "upwards" in the tree following specific reference types */ +UA_Boolean +isNodeInTree(UA_Server *server, const UA_NodeId *leafNode, + const UA_NodeId *nodeToFind, const UA_ReferenceTypeSet *relevantRefs); + +/* Convenience function with just a single ReferenceTypeIndex */ +UA_Boolean +isNodeInTree_singleRef(UA_Server *server, const UA_NodeId *leafNode, + const UA_NodeId *nodeToFind, const UA_Byte relevantRefTypeIndex); + +/* Returns an array with the hierarchy of nodes. The start nodes can be returned + * as well. The returned array starts at the leaf and continues "upwards" or + * "downwards". Duplicate entries are removed. */ +UA_StatusCode +browseRecursive(UA_Server *server, size_t startNodesSize, const UA_NodeId *startNodes, + UA_BrowseDirection browseDirection, const UA_ReferenceTypeSet *refTypes, + UA_UInt32 nodeClassMask, UA_Boolean includeStartNodes, + size_t *resultsSize, UA_ExpandedNodeId **results); + +/* Get the bitfield indices of a ReferenceType and possibly its subtypes. + * refType must point to a ReferenceTypeNode. */ +UA_StatusCode +referenceTypeIndices(UA_Server *server, const UA_NodeId *refType, + UA_ReferenceTypeSet *indices, UA_Boolean includeSubtypes); + +/* Returns the recursive type and interface hierarchy of the node */ +UA_StatusCode +getParentTypeAndInterfaceHierarchy(UA_Server *server, const UA_NodeId *typeNode, + UA_NodeId **typeHierarchy, size_t *typeHierarchySize); + +/* Returns the recursive interface hierarchy of the node */ +UA_StatusCode +getInterfaceHierarchy(UA_Server *server, const UA_NodeId *objectNode, + UA_NodeId **typeHierarchy, size_t *typeHierarchySize); + +#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS + +UA_StatusCode +UA_getConditionId(UA_Server *server, const UA_NodeId *conditionNodeId, + UA_NodeId *outConditionId); + +void +UA_ConditionList_delete(UA_Server *server); + +UA_Boolean +isConditionOrBranch(UA_Server *server, + const UA_NodeId *condition, + const UA_NodeId *conditionSource, + UA_Boolean *isCallerAC); + +#endif /* UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */ + +/* Returns the type node from the node on the stack top. The type node is pushed + * on the stack and returned. */ +const UA_Node * +getNodeType(UA_Server *server, const UA_NodeHead *nodeHead); + +UA_StatusCode +sendResponse(UA_Server *server, UA_Session *session, UA_SecureChannel *channel, + UA_UInt32 requestId, UA_Response *response, const UA_DataType *responseType); + +/* Many services come as an array of operations. This function generalizes the + * processing of the operations. */ +typedef void (*UA_ServiceOperation)(UA_Server *server, UA_Session *session, + const void *context, + const void *requestOperation, + void *responseOperation); + +UA_StatusCode +UA_Server_processServiceOperations(UA_Server *server, UA_Session *session, + UA_ServiceOperation operationCallback, + const void *context, + const size_t *requestOperations, + const UA_DataType *requestOperationsType, + size_t *responseOperations, + const UA_DataType *responseOperationsType) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +/******************************************/ +/* Internal function calls, without locks */ +/******************************************/ +UA_StatusCode +deleteNode(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean deleteReferences); + +UA_StatusCode +addNode(UA_Server *server, const UA_NodeClass nodeClass, const UA_NodeId *requestedNewNodeId, + const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, + const UA_QualifiedName browseName, const UA_NodeId *typeDefinition, + const UA_NodeAttributes *attr, const UA_DataType *attributeType, + void *nodeContext, UA_NodeId *outNewNodeId); + +UA_StatusCode +setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId, + const UA_DataSource dataSource); + +UA_StatusCode +setMethodNode_callback(UA_Server *server, + const UA_NodeId methodNodeId, + UA_MethodCallback methodCallback); + +UA_StatusCode +writeAttribute(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId, const UA_AttributeId attributeId, + const void *attr, const UA_DataType *attr_type); + +static UA_INLINE UA_StatusCode +writeValueAttribute(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId, const UA_Variant *value) { + return writeAttribute(server, session, nodeId, UA_ATTRIBUTEID_VALUE, + value, &UA_TYPES[UA_TYPES_VARIANT]); +} + +UA_DataValue +readAttribute(UA_Server *server, const UA_ReadValueId *item, + UA_TimestampsToReturn timestamps); + +UA_StatusCode +readWithReadValue(UA_Server *server, const UA_NodeId *nodeId, + const UA_AttributeId attributeId, void *v); + +UA_StatusCode +readObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + UA_Variant *value); + +UA_BrowsePathResult +translateBrowsePathToNodeIds(UA_Server *server, const UA_BrowsePath *browsePath); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +void monitoredItem_sampleCallback(UA_Server *server, UA_MonitoredItem *monitoredItem); + +UA_Subscription * +UA_Server_getSubscriptionById(UA_Server *server, UA_UInt32 subscriptionId); + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +UA_BrowsePathResult +browseSimplifiedBrowsePath(UA_Server *server, const UA_NodeId origin, + size_t browsePathSize, const UA_QualifiedName *browsePath); + +UA_StatusCode +writeObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, const UA_Variant value); + +UA_StatusCode +getNodeContext(UA_Server *server, UA_NodeId nodeId, void **nodeContext); + +void +removeCallback(UA_Server *server, UA_UInt64 callbackId); + +UA_StatusCode +changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, UA_Double interval_ms); + +UA_StatusCode +addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId); + +#ifdef UA_ENABLE_DISCOVERY +UA_StatusCode +register_server_with_discovery_server(UA_Server *server, + void *client, + const UA_Boolean isUnregister, + const char* semaphoreFilePath); +#endif + +/***********/ +/* RefTree */ +/***********/ + +/* A RefTree is a sorted set of NodeIds that ensures we consider each node just + * once. It holds a single array for both the ExpandedNodeIds and the entries of + * a tree-structure for fast lookup. A single realloc operation (with some + * pointer repairing) can be used to increase the capacity of the RefTree. + * + * When the RefTree is complete, the tree-part at the end of the targets array + * can be ignored / cut away to use it as a simple ExpandedNodeId array. + * + * The layout of the targets array is as follows: + * + * | Targets [ExpandedNodeId, n times] | Tree [RefEntry, n times] | */ + +#define UA_REFTREE_INITIAL_SIZE 16 + +typedef struct RefEntry { + ZIP_ENTRY(RefEntry) zipfields; + const UA_ExpandedNodeId *target; + UA_UInt32 targetHash; /* Hash of the target nodeid */ +} RefEntry; + +ZIP_HEAD(RefHead, RefEntry); +typedef struct RefHead RefHead; + +typedef struct { + UA_ExpandedNodeId *targets; + RefHead head; + size_t capacity; /* available space */ + size_t size; /* used space */ +} RefTree; + +UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefTree_init(RefTree *rt); + +void RefTree_clear(RefTree *rt); + +UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefTree_add(RefTree *rt, const UA_ExpandedNodeId *target, UA_Boolean *duplicate); + +UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefTree_addNodeId(RefTree *rt, const UA_NodeId *target, UA_Boolean *duplicate); + +UA_Boolean +RefTree_contains(RefTree *rt, const UA_ExpandedNodeId *target); + +UA_Boolean +RefTree_containsNodeId(RefTree *rt, const UA_NodeId *target); + +/***************************************/ +/* Check Information Model Consistency */ +/***************************************/ + +/* Read a node attribute in the context of a "checked-out" node. So the + * attribute will not be copied when possible. The variant then points into the + * node and has UA_VARIANT_DATA_NODELETE set. */ +void +ReadWithNode(const UA_Node *node, UA_Server *server, UA_Session *session, + UA_TimestampsToReturn timestampsToReturn, + const UA_ReadValueId *id, UA_DataValue *v); + +UA_StatusCode +readValueAttribute(UA_Server *server, UA_Session *session, + const UA_VariableNode *vn, UA_DataValue *v); + +/* Test whether the value matches a variable definition given by + * - datatype + * - valueranke + * - array dimensions. + * Sometimes it can be necessary to transform the content of the value, e.g. + * byte array to bytestring or uint32 to some enum. If editableValue is non-NULL, + * we try to create a matching variant that points to the original data. */ +UA_Boolean +compatibleValue(UA_Server *server, UA_Session *session, const UA_NodeId *targetDataTypeId, + UA_Int32 targetValueRank, size_t targetArrayDimensionsSize, + const UA_UInt32 *targetArrayDimensions, const UA_Variant *value, + const UA_NumericRange *range); + +/* Is the DataType compatible */ +UA_Boolean +compatibleDataTypes(UA_Server *server, const UA_NodeId *dataType, + const UA_NodeId *constraintDataType); + +/* Is the Value compatible with the DataType? Can perform additional checks + * compared to compatibleDataTypes. */ +UA_Boolean +compatibleValueDataType(UA_Server *server, const UA_DataType *dataType, + const UA_NodeId *constraintDataType); + + +UA_Boolean +compatibleArrayDimensions(size_t constraintArrayDimensionsSize, + const UA_UInt32 *constraintArrayDimensions, + size_t testArrayDimensionsSize, + const UA_UInt32 *testArrayDimensions); + +UA_Boolean +compatibleValueArrayDimensions(const UA_Variant *value, size_t targetArrayDimensionsSize, + const UA_UInt32 *targetArrayDimensions); + +UA_Boolean +compatibleValueRankArrayDimensions(UA_Server *server, UA_Session *session, + UA_Int32 valueRank, size_t arrayDimensionsSize); + +UA_Boolean +compatibleValueRanks(UA_Int32 valueRank, UA_Int32 constraintValueRank); + +struct BrowseOpts { + UA_UInt32 maxReferences; + UA_Boolean recursive; +}; + +void +Operation_Browse(UA_Server *server, UA_Session *session, const UA_UInt32 *maxrefs, + const UA_BrowseDescription *descr, UA_BrowseResult *result); + +UA_DataValue +UA_Server_readWithSession(UA_Server *server, UA_Session *session, + const UA_ReadValueId *item, + UA_TimestampsToReturn timestampsToReturn); + +/*****************************/ +/* AddNodes Begin and Finish */ +/*****************************/ + +/* Creates a new node in the nodestore. */ +UA_StatusCode +AddNode_raw(UA_Server *server, UA_Session *session, void *nodeContext, + const UA_AddNodesItem *item, UA_NodeId *outNewNodeId); + +/* Check the reference to the parent node; Add references. */ +UA_StatusCode +AddNode_addRefs(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, + const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, + const UA_NodeId *typeDefinitionId); + +/* Type-check type-definition; Run the constructors */ +UA_StatusCode +AddNode_finish(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId); + +/**********************/ +/* Create Namespace 0 */ +/**********************/ + +UA_StatusCode UA_Server_initNS0(UA_Server *server); + +UA_StatusCode writeNs0VariableArray(UA_Server *server, UA_UInt32 id, void *v, + size_t length, const UA_DataType *type); + +/***************************/ +/* Nodestore Access Macros */ +/***************************/ + +#define UA_NODESTORE_NEW(server, nodeClass) \ + server->config.nodestore.newNode(server->config.nodestore.context, nodeClass) + +#define UA_NODESTORE_DELETE(server, node) \ + server->config.nodestore.deleteNode(server->config.nodestore.context, node) + +#define UA_NODESTORE_GET(server, nodeid) \ + server->config.nodestore.getNode(server->config.nodestore.context, nodeid) + +#define UA_NODESTORE_RELEASE(server, node) \ + server->config.nodestore.releaseNode(server->config.nodestore.context, node) + +#define UA_NODESTORE_GETCOPY(server, nodeid, outnode) \ + server->config.nodestore.getNodeCopy(server->config.nodestore.context, \ + nodeid, outnode) + +#define UA_NODESTORE_INSERT(server, node, addedNodeId) \ + server->config.nodestore.insertNode(server->config.nodestore.context, \ + node, addedNodeId) + +#define UA_NODESTORE_REPLACE(server, node) \ + server->config.nodestore.replaceNode(server->config.nodestore.context, node) + +#define UA_NODESTORE_REMOVE(server, nodeId) \ + server->config.nodestore.removeNode(server->config.nodestore.context, nodeId) + +#define UA_NODESTORE_GETREFERENCETYPEID(server, index) \ + server->config.nodestore.getReferenceTypeId(server->config.nodestore.context, \ + index) + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2015 (c) Sten Grüner + * Copyright 2014 (c) LEvertz + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015 (c) Christian Fimmers + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + + +_UA_BEGIN_DECLS + +/** + * .. _services: + * + * Services + * ======== + * + * In OPC UA, all communication is based on service calls, each consisting of a + * request and a response message. These messages are defined as data structures + * with a binary encoding and listed in :ref:`generated-types`. Since all + * Services are pre-defined in the standard, they cannot be modified by the + * user. But you can use the :ref:`Call <method-services>` service to invoke + * user-defined methods on the server. + * + * The following service signatures are internal and *not visible to users*. + * Still, we present them here for an overview of the capabilities of OPC UA. + * Please refer to the :ref:`client` and :ref:`server` API where the services + * are exposed to end users. Please see part 4 of the OPC UA standard for the + * authoritative definition of the service and their behaviour. + * + * Most services take as input the server, the current session and pointers to + * the request and response structures. Possible error codes are returned as + * part of the response. */ + +typedef void (*UA_Service)(UA_Server*, UA_Session*, + const void *request, void *response); + +typedef void (*UA_ChannelService)(UA_Server*, UA_SecureChannel*, + const void *request, void *response); + +/** + * Discovery Service Set + * --------------------- + * This Service Set defines Services used to discover the Endpoints implemented + * by a Server and to read the security configuration for those Endpoints. + * + * FindServers Service + * ^^^^^^^^^^^^^^^^^^^ + * Returns the Servers known to a Server or Discovery Server. The Client may + * reduce the number of results returned by specifying filter criteria */ +void Service_FindServers(UA_Server *server, UA_Session *session, + const UA_FindServersRequest *request, + UA_FindServersResponse *response); + +/** + * GetEndpoints Service + * ^^^^^^^^^^^^^^^^^^^^ + * Returns the Endpoints supported by a Server and all of the configuration + * information required to establish a SecureChannel and a Session. */ +void Service_GetEndpoints(UA_Server *server, UA_Session *session, + const UA_GetEndpointsRequest *request, + UA_GetEndpointsResponse *response); + +#ifdef UA_ENABLE_DISCOVERY + +# ifdef UA_ENABLE_DISCOVERY_MULTICAST + +/** + * FindServersOnNetwork Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Returns the Servers known to a Discovery Server. Unlike FindServer, + * this Service is only implemented by Discovery Servers. It additionally + * returns servers which may have been detected through Multicast. */ +void Service_FindServersOnNetwork(UA_Server *server, UA_Session *session, + const UA_FindServersOnNetworkRequest *request, + UA_FindServersOnNetworkResponse *response); + +# endif /* UA_ENABLE_DISCOVERY_MULTICAST */ + +/** + * RegisterServer + * ^^^^^^^^^^^^^^ + * Registers a remote server in the local discovery service. */ +void Service_RegisterServer(UA_Server *server, UA_Session *session, + const UA_RegisterServerRequest *request, + UA_RegisterServerResponse *response); + +/** + * RegisterServer2 + * ^^^^^^^^^^^^^^^ + * This Service allows a Server to register its DiscoveryUrls and capabilities + * with a Discovery Server. It extends the registration information from + * RegisterServer with information necessary for FindServersOnNetwork. */ +void Service_RegisterServer2(UA_Server *server, UA_Session *session, + const UA_RegisterServer2Request *request, + UA_RegisterServer2Response *response); + +#endif /* UA_ENABLE_DISCOVERY */ + +/** + * SecureChannel Service Set + * ------------------------- + * This Service Set defines Services used to open a communication channel that + * ensures the confidentiality and Integrity of all Messages exchanged with the + * Server. + * + * OpenSecureChannel Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * Open or renew a SecureChannel that can be used to ensure Confidentiality and + * Integrity for Message exchange during a Session. */ +void Service_OpenSecureChannel(UA_Server *server, UA_SecureChannel* channel, + const UA_OpenSecureChannelRequest *request, + UA_OpenSecureChannelResponse *response); + +/** + * CloseSecureChannel Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to terminate a SecureChannel. */ +void Service_CloseSecureChannel(UA_Server *server, UA_SecureChannel *channel); + +/** + * Session Service Set + * ------------------- + * This Service Set defines Services for an application layer connection + * establishment in the context of a Session. + * + * CreateSession Service + * ^^^^^^^^^^^^^^^^^^^^^ + * Used by an OPC UA Client to create a Session and the Server returns two + * values which uniquely identify the Session. The first value is the sessionId + * which is used to identify the Session in the audit logs and in the Server's + * address space. The second is the authenticationToken which is used to + * associate an incoming request with a Session. */ +void Service_CreateSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CreateSessionRequest *request, + UA_CreateSessionResponse *response); + +/** + * ActivateSession + * ^^^^^^^^^^^^^^^ + * Used by the Client to submit its SoftwareCertificates to the Server for + * validation and to specify the identity of the user associated with the + * Session. This Service request shall be issued by the Client before it issues + * any other Service request after CreateSession. Failure to do so shall cause + * the Server to close the Session. */ +void Service_ActivateSession(UA_Server *server, UA_SecureChannel *channel, + const UA_ActivateSessionRequest *request, + UA_ActivateSessionResponse *response); + +/** + * CloseSession + * ^^^^^^^^^^^^ + * Used to terminate a Session. */ +void Service_CloseSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CloseSessionRequest *request, + UA_CloseSessionResponse *response); + +/** + * Cancel Service + * ^^^^^^^^^^^^^^ + * Used to cancel outstanding Service requests. Successfully cancelled service + * requests shall respond with Bad_RequestCancelledByClient. */ +/* Not Implemented */ + +/** + * NodeManagement Service Set + * -------------------------- + * This Service Set defines Services to add and delete AddressSpace Nodes and + * References between them. All added Nodes continue to exist in the + * AddressSpace even if the Client that created them disconnects from the + * Server. + * + * AddNodes Service + * ^^^^^^^^^^^^^^^^ + * Used to add one or more Nodes into the AddressSpace hierarchy. */ +void Service_AddNodes(UA_Server *server, UA_Session *session, + const UA_AddNodesRequest *request, + UA_AddNodesResponse *response); + +/** + * AddReferences Service + * ^^^^^^^^^^^^^^^^^^^^^ + * Used to add one or more References to one or more Nodes. */ +void Service_AddReferences(UA_Server *server, UA_Session *session, + const UA_AddReferencesRequest *request, + UA_AddReferencesResponse *response); + +/** + * DeleteNodes Service + * ^^^^^^^^^^^^^^^^^^^ + * Used to delete one or more Nodes from the AddressSpace. */ +void Service_DeleteNodes(UA_Server *server, UA_Session *session, + const UA_DeleteNodesRequest *request, + UA_DeleteNodesResponse *response); + +/** + * DeleteReferences + * ^^^^^^^^^^^^^^^^ + * Used to delete one or more References of a Node. */ +void Service_DeleteReferences(UA_Server *server, UA_Session *session, + const UA_DeleteReferencesRequest *request, + UA_DeleteReferencesResponse *response); + +/** + * .. _view-services: + * + * View Service Set + * ---------------- + * Clients use the browse Services of the View Service Set to navigate through + * the AddressSpace or through a View which is a subset of the AddressSpace. + * + * Browse Service + * ^^^^^^^^^^^^^^ + * Used to discover the References of a specified Node. The browse can be + * further limited by the use of a View. This Browse Service also supports a + * primitive filtering capability. */ +void Service_Browse(UA_Server *server, UA_Session *session, + const UA_BrowseRequest *request, + UA_BrowseResponse *response); + +/** + * BrowseNext Service + * ^^^^^^^^^^^^^^^^^^ + * Used to request the next set of Browse or BrowseNext response information + * that is too large to be sent in a single response. "Too large" in this + * context means that the Server is not able to return a larger response or that + * the number of results to return exceeds the maximum number of results to + * return that was specified by the Client in the original Browse request. */ +void Service_BrowseNext(UA_Server *server, UA_Session *session, + const UA_BrowseNextRequest *request, + UA_BrowseNextResponse *response); + +/** + * TranslateBrowsePathsToNodeIds Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to translate textual node paths to their respective ids. */ +void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *session, + const UA_TranslateBrowsePathsToNodeIdsRequest *request, + UA_TranslateBrowsePathsToNodeIdsResponse *response); + +/** + * RegisterNodes Service + * ^^^^^^^^^^^^^^^^^^^^^ + * Used by Clients to register the Nodes that they know they will access + * repeatedly (e.g. Write, Call). It allows Servers to set up anything needed so + * that the access operations will be more efficient. */ +void Service_RegisterNodes(UA_Server *server, UA_Session *session, + const UA_RegisterNodesRequest *request, + UA_RegisterNodesResponse *response); + +/** + * UnregisterNodes Service + * ^^^^^^^^^^^^^^^^^^^^^^^ + * This Service is used to unregister NodeIds that have been obtained via the + * RegisterNodes service. */ +void Service_UnregisterNodes(UA_Server *server, UA_Session *session, + const UA_UnregisterNodesRequest *request, + UA_UnregisterNodesResponse *response); + +/** + * Query Service Set + * ----------------- + * This Service Set is used to issue a Query to a Server. OPC UA Query is + * generic in that it provides an underlying storage mechanism independent Query + * capability that can be used to access a wide variety of OPC UA data stores + * and information management systems. OPC UA Query permits a Client to access + * data maintained by a Server without any knowledge of the logical schema used + * for internal storage of the data. Knowledge of the AddressSpace is + * sufficient. + * + * QueryFirst Service + * ^^^^^^^^^^^^^^^^^^ + * This Service is used to issue a Query request to the Server. */ +/* Not Implemented */ + +/** + * QueryNext Service + * ^^^^^^^^^^^^^^^^^ + * This Service is used to request the next set of QueryFirst or QueryNext + * response information that is too large to be sent in a single response. */ +/* Not Impelemented */ + +/** + * Attribute Service Set + * --------------------- + * This Service Set provides Services to access Attributes that are part of + * Nodes. + * + * Read Service + * ^^^^^^^^^^^^ + * Used to read attributes of nodes. For constructed attribute values whose + * elements are indexed, such as an array, this Service allows Clients to read + * the entire set of indexed values as a composite, to read individual elements + * or to read ranges of elements of the composite. */ +void Service_Read(UA_Server *server, UA_Session *session, + const UA_ReadRequest *request, + UA_ReadResponse *response); + +/** + * Write Service + * ^^^^^^^^^^^^^ + * Used to write attributes of nodes. For constructed attribute values whose + * elements are indexed, such as an array, this Service allows Clients to write + * the entire set of indexed values as a composite, to write individual elements + * or to write ranges of elements of the composite. */ +void Service_Write(UA_Server *server, UA_Session *session, + const UA_WriteRequest *request, + UA_WriteResponse *response); + +/** + * HistoryRead Service + * ^^^^^^^^^^^^^^^^^^^ + * Used to read historical values or Events of one or more Nodes. Servers may + * make historical values available to Clients using this Service, although the + * historical values themselves are not visible in the AddressSpace. */ +#ifdef UA_ENABLE_HISTORIZING +void Service_HistoryRead(UA_Server *server, UA_Session *session, + const UA_HistoryReadRequest *request, + UA_HistoryReadResponse *response); + +/** + * HistoryUpdate Service + * ^^^^^^^^^^^^^^^^^^^^^ + * Used to update historical values or Events of one or more Nodes. Several + * request parameters indicate how the Server is to update the historical value + * or Event. Valid actions are Insert, Replace or Delete. */ +void +Service_HistoryUpdate(UA_Server *server, UA_Session *session, + const UA_HistoryUpdateRequest *request, + UA_HistoryUpdateResponse *response); +#endif + +/** + * .. _method-services: + * + * Method Service Set + * ------------------ + * The Method Service Set defines the means to invoke methods. A method shall be + * a component of an Object. See the section on :ref:`MethodNodes <methodnode>` + * for more information. + * + * Call Service + * ^^^^^^^^^^^^ + * Used to call (invoke) a methods. Each method call is invoked within the + * context of an existing Session. If the Session is terminated, the results of + * the method's execution cannot be returned to the Client and are discarded. */ +#ifdef UA_ENABLE_METHODCALLS +void Service_Call(UA_Server *server, UA_Session *session, + const UA_CallRequest *request, + UA_CallResponse *response); + +# if UA_MULTITHREADING >= 100 +void Service_CallAsync(UA_Server *server, UA_Session *session, UA_UInt32 requestId, + const UA_CallRequest *request, UA_CallResponse *response, + UA_Boolean *finished); +#endif +#endif + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +/** + * MonitoredItem Service Set + * ------------------------- + * Clients define MonitoredItems to subscribe to data and Events. Each + * MonitoredItem identifies the item to be monitored and the Subscription to use + * to send Notifications. The item to be monitored may be any Node Attribute. + * + * CreateMonitoredItems Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to create and add one or more MonitoredItems to a Subscription. A + * MonitoredItem is deleted automatically by the Server when the Subscription is + * deleted. Deleting a MonitoredItem causes its entire set of triggered item + * links to be deleted, but has no effect on the MonitoredItems referenced by + * the triggered items. */ +void Service_CreateMonitoredItems(UA_Server *server, UA_Session *session, + const UA_CreateMonitoredItemsRequest *request, + UA_CreateMonitoredItemsResponse *response); + +/** + * DeleteMonitoredItems Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to remove one or more MonitoredItems of a Subscription. When a + * MonitoredItem is deleted, its triggered item links are also deleted. */ +void Service_DeleteMonitoredItems(UA_Server *server, UA_Session *session, + const UA_DeleteMonitoredItemsRequest *request, + UA_DeleteMonitoredItemsResponse *response); + +/** + * ModifyMonitoredItems Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to modify MonitoredItems of a Subscription. Changes to the MonitoredItem + * settings shall be applied immediately by the Server. They take effect as soon + * as practical but not later than twice the new revisedSamplingInterval. + * + * Illegal request values for parameters that can be revised do not generate + * errors. Instead the server will choose default values and indicate them in + * the corresponding revised parameter. */ +void Service_ModifyMonitoredItems(UA_Server *server, UA_Session *session, + const UA_ModifyMonitoredItemsRequest *request, + UA_ModifyMonitoredItemsResponse *response); + +/** + * SetMonitoringMode Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to set the monitoring mode for one or more MonitoredItems of a + * Subscription. */ +void Service_SetMonitoringMode(UA_Server *server, UA_Session *session, + const UA_SetMonitoringModeRequest *request, + UA_SetMonitoringModeResponse *response); + +/** + * SetTriggering Service + * ^^^^^^^^^^^^^^^^^^^^^ + * Used to create and delete triggering links for a triggering item. */ +void Service_SetTriggering(UA_Server *server, UA_Session *session, + const UA_SetTriggeringRequest *request, + UA_SetTriggeringResponse *response); + +/** + * Subscription Service Set + * ------------------------ + * Subscriptions are used to report Notifications to the Client. + * + * CreateSubscription Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to create a Subscription. Subscriptions monitor a set of MonitoredItems + * for Notifications and return them to the Client in response to Publish + * requests. */ +void Service_CreateSubscription(UA_Server *server, UA_Session *session, + const UA_CreateSubscriptionRequest *request, + UA_CreateSubscriptionResponse *response); + +/** + * ModifySubscription Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to modify a Subscription. */ +void Service_ModifySubscription(UA_Server *server, UA_Session *session, + const UA_ModifySubscriptionRequest *request, + UA_ModifySubscriptionResponse *response); + +/** + * SetPublishingMode Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to enable sending of Notifications on one or more Subscriptions. */ +void Service_SetPublishingMode(UA_Server *server, UA_Session *session, + const UA_SetPublishingModeRequest *request, + UA_SetPublishingModeResponse *response); + +/** + * Publish Service + * ^^^^^^^^^^^^^^^ + * Used for two purposes. First, it is used to acknowledge the receipt of + * NotificationMessages for one or more Subscriptions. Second, it is used to + * request the Server to return a NotificationMessage or a keep-alive + * Message. + * + * Note that the service signature is an exception and does not contain a + * pointer to a PublishResponse. That is because the service queues up publish + * requests internally and sends responses asynchronously based on timeouts. */ +void Service_Publish(UA_Server *server, UA_Session *session, + const UA_PublishRequest *request, UA_UInt32 requestId); + +/** + * Republish Service + * ^^^^^^^^^^^^^^^^^ + * Requests the Subscription to republish a NotificationMessage from its + * retransmission queue. */ +void Service_Republish(UA_Server *server, UA_Session *session, + const UA_RepublishRequest *request, + UA_RepublishResponse *response); + +/** + * DeleteSubscriptions Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Invoked to delete one or more Subscriptions that belong to the Client's + * Session. */ +void Service_DeleteSubscriptions(UA_Server *server, UA_Session *session, + const UA_DeleteSubscriptionsRequest *request, + UA_DeleteSubscriptionsResponse *response); + +/** + * TransferSubscription Service + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Used to transfer a Subscription and its MonitoredItems from one Session to + * another. For example, a Client may need to reopen a Session and then transfer + * its Subscriptions to that Session. It may also be used by one Client to take + * over a Subscription from another Client by transferring the Subscription to + * its Session. */ +void Service_TransferSubscriptions(UA_Server *server, UA_Session *session, + const UA_TransferSubscriptionsRequest *request, + UA_TransferSubscriptionsResponse *response); + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client_internal.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Florian Palm + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + +#define UA_INTERNAL + + +_UA_BEGIN_DECLS + +/**************************/ +/* Subscriptions Handling */ +/**************************/ + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +typedef struct UA_Client_NotificationsAckNumber { + LIST_ENTRY(UA_Client_NotificationsAckNumber) listEntry; + UA_SubscriptionAcknowledgement subAck; +} UA_Client_NotificationsAckNumber; + +typedef struct UA_Client_MonitoredItem { + LIST_ENTRY(UA_Client_MonitoredItem) listEntry; + UA_UInt32 monitoredItemId; + UA_UInt32 clientHandle; + void *context; + UA_Client_DeleteMonitoredItemCallback deleteCallback; + union { + UA_Client_DataChangeNotificationCallback dataChangeCallback; + UA_Client_EventNotificationCallback eventCallback; + } handler; + UA_Boolean isEventMonitoredItem; /* Otherwise a DataChange MoniitoredItem */ +} UA_Client_MonitoredItem; + +typedef struct UA_Client_Subscription { + LIST_ENTRY(UA_Client_Subscription) listEntry; + UA_UInt32 subscriptionId; + void *context; + UA_Double publishingInterval; + UA_UInt32 maxKeepAliveCount; + UA_Client_StatusChangeNotificationCallback statusChangeCallback; + UA_Client_DeleteSubscriptionCallback deleteCallback; + UA_UInt32 sequenceNumber; + UA_DateTime lastActivity; + LIST_HEAD(, UA_Client_MonitoredItem) monitoredItems; +} UA_Client_Subscription; + +void +UA_Client_Subscriptions_clean(UA_Client *client); + +/* Exposed for fuzzing */ +UA_StatusCode +UA_Client_preparePublishRequest(UA_Client *client, UA_PublishRequest *request); + +void +UA_Client_Subscriptions_backgroundPublish(UA_Client *client); + +void +UA_Client_Subscriptions_backgroundPublishInactivityCheck(UA_Client *client); + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/**********/ +/* Client */ +/**********/ + +typedef struct AsyncServiceCall { + LIST_ENTRY(AsyncServiceCall) pointers; + UA_UInt32 requestId; + UA_ClientAsyncServiceCallback callback; + const UA_DataType *responseType; + void *userdata; + UA_DateTime start; + UA_UInt32 timeout; + void *responsedata; +} AsyncServiceCall; + +void +UA_Client_AsyncService_cancel(UA_Client *client, AsyncServiceCall *ac, + UA_StatusCode statusCode); + +void +UA_Client_AsyncService_removeAll(UA_Client *client, UA_StatusCode statusCode); + +typedef struct CustomCallback { + LIST_ENTRY(CustomCallback) pointers; + UA_UInt32 callbackId; + + UA_ClientAsyncServiceCallback userCallback; + void *userData; + + bool isAsync; + void *clientData; +} CustomCallback; + +struct UA_Client { + UA_ClientConfig config; + UA_Timer timer; + + /* Overall connection status */ + UA_StatusCode connectStatus; + + /* Old status to notify only changes */ + UA_SecureChannelState oldChannelState; + UA_SessionState oldSessionState; + UA_StatusCode oldConnectStatus; + + UA_Boolean endpointsHandshake; /* Ongoing GetEndpoints */ + UA_Boolean noSession; /* Don't open a session */ + + /* Connection */ + UA_Connection connection; + UA_String endpointUrl; /* Only for the async connect */ + + /* SecureChannel */ + UA_SecureChannel channel; + UA_UInt32 requestId; + UA_DateTime nextChannelRenewal; + + /* Session */ + UA_SessionState sessionState; + UA_NodeId authenticationToken; + UA_UInt32 requestHandle; + UA_ByteString remoteNonce; + UA_ByteString localNonce; + + /* Connectivity check */ + UA_DateTime lastConnectivityCheck; + UA_Boolean pendingConnectivityCheck; + + /* Async Service */ + LIST_HEAD(, AsyncServiceCall) asyncServiceCalls; + LIST_HEAD(, CustomCallback) customCallbacks; + + /* Subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + LIST_HEAD(, UA_Client_NotificationsAckNumber) pendingNotificationsAcks; + LIST_HEAD(, UA_Client_Subscription) subscriptions; + UA_UInt32 monitoredItemHandles; + UA_UInt16 currentlyOutStandingPublishRequests; +#endif +}; + +void notifyClientState(UA_Client *client); +void processERRResponse(UA_Client *client, const UA_ByteString *chunk); +void processACKResponse(UA_Client *client, const UA_ByteString *chunk); +void processOPNResponse(UA_Client *client, const UA_ByteString *message); +void closeSecureChannel(UA_Client *client); + +UA_StatusCode +connectIterate(UA_Client *client, UA_UInt32 timeout); + +UA_StatusCode +receiveResponseAsync(UA_Client *client, UA_UInt32 timeout); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_config.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2020 Yannick Wallerer, Siemens AG + * Copyright (c) 2020 Thomas Fischer, Siemens AG + */ + +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG + + + +/* UA_PubSubManager_loadPubSubConfigFromByteString() */ +/** + * @brief Decodes the information from the ByteString. If the decoded content is a PubSubConfiguration in a UABinaryFileDataType-object + * it will overwrite the current PubSub configuration from the server. + * + * @param server [bi] Pointer to Server object that shall be configured + * @param buffer [in] Relative path and name of the file that contains the PubSub configuration + * + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode +UA_PubSubManager_loadPubSubConfigFromByteString +( + /*[bi]*/ UA_Server *server, + /*[in]*/ const UA_ByteString buffer +); + +/* UA_PubSubManager_getEncodedPubSubConfiguration() */ +/** + * @brief Saves the current PubSub configuration of a server in a byteString. + * + * @param server [in] Pointer to server object, that contains the PubSubConfiguration + * @param buffer [out] Pointer to a byteString object + * + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode +UA_PubSubManager_getEncodedPubSubConfiguration +( + /*[bi]*/ UA_Server *server, + /*[out]*/ UA_ByteString *buffer +); + + +#endif /* UA_ENABLE_PUBSUB_FILE_CONFIG */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/namespace0_generated.h" ***********************************/ + +/* WARNING: This is a generated file. + * Any manual changes will be overwritten. */ + +#ifndef NAMESPACE0_GENERATED_H_ +#define NAMESPACE0_GENERATED_H_ + + +#ifdef UA_ENABLE_AMALGAMATION + +/* The following declarations are in the open62541.c file so here's needed when compiling nodesets externally */ + +# ifndef UA_INTERNAL //this definition is needed to hide this code in the amalgamated .c file + +typedef UA_StatusCode (*UA_exchangeEncodeBuffer)(void *handle, UA_Byte **bufPos, + const UA_Byte **bufEnd); + +UA_StatusCode +UA_encodeBinary(const void *src, const UA_DataType *type, + UA_Byte **bufPos, const UA_Byte **bufEnd, + UA_exchangeEncodeBuffer exchangeCallback, + void *exchangeHandle) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +UA_StatusCode +UA_decodeBinary(const UA_ByteString *src, size_t *offset, void *dst, + const UA_DataType *type, size_t customTypesSize, + const UA_DataType *customTypes) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +size_t +UA_calcSizeBinary(void *p, const UA_DataType *type); + +const UA_DataType * +UA_findDataTypeByBinary(const UA_NodeId *typeId); + +# endif // UA_INTERNAL + +#else // UA_ENABLE_AMALGAMATION +#endif + + + + +_UA_BEGIN_DECLS + +extern UA_StatusCode namespace0_generated(UA_Server *server); + +_UA_END_DECLS + +#endif /* NAMESPACE0_GENERATED_H_ */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_types.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2016-2017 (c) Florian Palm + * Copyright 2014-2016 (c) Sten Grüner + * Copyright 2014 (c) Leon Urbas + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015 (c) Markus Graube + * Copyright 2015 (c) Reza Ebrahimi + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lorenz Haas + */ + + + +#define UA_MAX_ARRAY_DIMS 100 /* Max dimensions of an array */ + +/* Datatype Handling + * ----------------- + * This file contains handling functions for the builtin types and functions + * handling of structured types and arrays. These need type descriptions in a + * UA_DataType structure. The UA_DataType structures as well as all non-builtin + * datatypes are autogenerated. */ + +/* Global definition of NULL type instances. These are always zeroed out, as + * mandated by the C/C++ standard for global values with no initializer. */ +const UA_String UA_STRING_NULL = {0, NULL}; +const UA_ByteString UA_BYTESTRING_NULL = {0, NULL}; +const UA_Guid UA_GUID_NULL = {0, 0, 0, {0,0,0,0,0,0,0,0}}; +const UA_NodeId UA_NODEID_NULL = {0, UA_NODEIDTYPE_NUMERIC, {0}}; +const UA_ExpandedNodeId UA_EXPANDEDNODEID_NULL = {{0, UA_NODEIDTYPE_NUMERIC, {0}}, {0, NULL}, 0}; + +typedef UA_StatusCode (*UA_copySignature)(const void *src, void *dst, + const UA_DataType *type); +typedef void (*UA_clearSignature)(void *p, const UA_DataType *type); + +extern const UA_copySignature copyJumpTable[UA_DATATYPEKINDS]; +extern const UA_clearSignature clearJumpTable[UA_DATATYPEKINDS]; + +const UA_DataType * +UA_findDataTypeWithCustom(const UA_NodeId *typeId, + const UA_DataTypeArray *customTypes) { + /* Always look in built-in types first (may contain data types from all + * namespaces). + * + * TODO: The standard-defined types are ordered. See if binary search is + * more efficient. */ + for(size_t i = 0; i < UA_TYPES_COUNT; ++i) { + if(UA_NodeId_equal(&UA_TYPES[i].typeId, typeId)) + return &UA_TYPES[i]; + } + + /* Search in the customTypes */ + while(customTypes) { + for(size_t i = 0; i < customTypes->typesSize; ++i) { + if(UA_NodeId_equal(&customTypes->types[i].typeId, typeId)) + return &customTypes->types[i]; + } + customTypes = customTypes->next; + } + + return NULL; +} + +const UA_DataType * +UA_findDataType(const UA_NodeId *typeId) { + return UA_findDataTypeWithCustom(typeId, NULL); +} + +/***************************/ +/* Random Number Generator */ +/***************************/ + +//TODO is this safe for multithreading? +static pcg32_random_t UA_rng = PCG32_INITIALIZER; + +void +UA_random_seed(u64 seed) { + pcg32_srandom_r(&UA_rng, seed, (u64)UA_DateTime_now()); +} + +u32 +UA_UInt32_random(void) { + return (u32)pcg32_random_r(&UA_rng); +} + +/*****************/ +/* Builtin Types */ +/*****************/ + +UA_String +UA_String_fromChars(const char *src) { + UA_String s; s.length = 0; s.data = NULL; + if(!src) + return s; + s.length = strlen(src); + if(s.length > 0) { + s.data = (u8*)UA_malloc(s.length); + if(!s.data) { + s.length = 0; + return s; + } + memcpy(s.data, src, s.length); + } else { + s.data = (u8*)UA_EMPTY_ARRAY_SENTINEL; + } + return s; +} + +UA_Boolean +UA_String_equal(const UA_String *s1, const UA_String *s2) { + if(s1->length != s2->length) + return false; + if(s1->length == 0) + return true; + if(s2->data == NULL) + return false; + i32 is = memcmp((char const*)s1->data, + (char const*)s2->data, s1->length); + return (is == 0) ? true : false; +} + + +/* Do not expose UA_String_equal_ignorecase to public API as it currently only handles + * ASCII strings, and not UTF8! */ +UA_Boolean +UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2) { + if(s1->length != s2->length) + return false; + if(s1->length == 0) + return true; + if(s2->data == NULL) + return false; + + //FIXME this currently does not handle UTF8 + return UA_strncasecmp((const char*)s1->data, (const char*)s2->data, s1->length) == 0; +} + +static UA_StatusCode +String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) { + UA_StatusCode retval = UA_Array_copy(src->data, src->length, (void**)&dst->data, + &UA_TYPES[UA_TYPES_BYTE]); + if(retval == UA_STATUSCODE_GOOD) + dst->length = src->length; + return retval; +} + +static void +String_clear(UA_String *s, const UA_DataType *_) { + UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]); +} + +/* QualifiedName */ +static UA_StatusCode +QualifiedName_copy(const UA_QualifiedName *src, UA_QualifiedName *dst, const UA_DataType *_) { + dst->namespaceIndex = src->namespaceIndex; + return String_copy(&src->name, &dst->name, NULL); +} + +static void +QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) { + String_clear(&p->name, NULL); +} + +u32 +UA_QualifiedName_hash(const UA_QualifiedName *q) { + return UA_ByteString_hash(q->namespaceIndex, + q->name.data, q->name.length); +} + +UA_Boolean +UA_QualifiedName_equal(const UA_QualifiedName *qn1, + const UA_QualifiedName *qn2) { + if(qn1 == NULL || qn2 == NULL) + return false; + if(qn1->namespaceIndex != qn2->namespaceIndex) + return false; + if(qn1->name.length != qn2->name.length) + return false; + return (memcmp((char const*)qn1->name.data, + (char const*)qn2->name.data, qn1->name.length) == 0); +} + +/* DateTime */ +UA_DateTimeStruct +UA_DateTime_toStruct(UA_DateTime t) { + /* Calculating the the milli-, micro- and nanoseconds */ + UA_DateTimeStruct dateTimeStruct; + if(t >= 0) { + dateTimeStruct.nanoSec = (u16)((t % 10) * 100); + dateTimeStruct.microSec = (u16)((t % 10000) / 10); + dateTimeStruct.milliSec = (u16)((t % 10000000) / 10000); + } else { + dateTimeStruct.nanoSec = (u16)(((t % 10 + t) % 10) * 100); + dateTimeStruct.microSec = (u16)(((t % 10000 + t) % 10000) / 10); + dateTimeStruct.milliSec = (u16)(((t % 10000000 + t) % 10000000) / 10000); + } + + /* Calculating the unix time with #include <time.h> */ + long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC) + - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC); + struct mytm ts; + memset(&ts, 0, sizeof(struct mytm)); + __secs_to_tm(secSinceUnixEpoch, &ts); + dateTimeStruct.sec = (u16)ts.tm_sec; + dateTimeStruct.min = (u16)ts.tm_min; + dateTimeStruct.hour = (u16)ts.tm_hour; + dateTimeStruct.day = (u16)ts.tm_mday; + dateTimeStruct.month = (u16)(ts.tm_mon + 1); + dateTimeStruct.year = (u16)(ts.tm_year + 1900); + return dateTimeStruct; +} + +UA_DateTime +UA_DateTime_fromStruct(UA_DateTimeStruct ts) { + /* Seconds since the Unix epoch */ + struct mytm tm; + memset(&tm, 0, sizeof(struct mytm)); + tm.tm_year = ts.year - 1900; + tm.tm_mon = ts.month - 1; + tm.tm_mday = ts.day; + tm.tm_hour = ts.hour; + tm.tm_min = ts.min; + tm.tm_sec = ts.sec; + long long sec_epoch = __tm_to_secs(&tm); + + UA_DateTime t = UA_DATETIME_UNIX_EPOCH; + t += sec_epoch * UA_DATETIME_SEC; + t += ts.milliSec * UA_DATETIME_MSEC; + t += ts.microSec * UA_DATETIME_USEC; + t += ts.nanoSec / 100; + return t; +} + +/* Guid */ +UA_Boolean +UA_Guid_equal(const UA_Guid *g1, const UA_Guid *g2) { + if(memcmp(g1, g2, sizeof(UA_Guid)) == 0) + return true; + return false; +} + +UA_Guid +UA_Guid_random(void) { + UA_Guid result; + result.data1 = (u32)pcg32_random_r(&UA_rng); + u32 r = (u32)pcg32_random_r(&UA_rng); + result.data2 = (u16) r; + result.data3 = (u16) (r >> 16); + r = (u32)pcg32_random_r(&UA_rng); + result.data4[0] = (u8)r; + result.data4[1] = (u8)(r >> 4); + result.data4[2] = (u8)(r >> 8); + result.data4[3] = (u8)(r >> 12); + r = (u32)pcg32_random_r(&UA_rng); + result.data4[4] = (u8)r; + result.data4[5] = (u8)(r >> 4); + result.data4[6] = (u8)(r >> 8); + result.data4[7] = (u8)(r >> 12); + return result; +} + +/* ByteString */ +UA_StatusCode +UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) { + UA_ByteString_init(bs); + if(length == 0) + return UA_STATUSCODE_GOOD; + bs->data = (u8*)UA_malloc(length); + if(!bs->data) + return UA_STATUSCODE_BADOUTOFMEMORY; + bs->length = length; + return UA_STATUSCODE_GOOD; +} + +/* NodeId */ +static void +NodeId_clear(UA_NodeId *p, const UA_DataType *_) { + switch(p->identifierType) { + case UA_NODEIDTYPE_STRING: + case UA_NODEIDTYPE_BYTESTRING: + String_clear(&p->identifier.string, NULL); + break; + default: break; + } +} + +static UA_StatusCode +NodeId_copy(UA_NodeId const *src, UA_NodeId *dst, const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + switch(src->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + *dst = *src; + return UA_STATUSCODE_GOOD; + case UA_NODEIDTYPE_STRING: + retval |= UA_String_copy(&src->identifier.string, + &dst->identifier.string); + break; + case UA_NODEIDTYPE_GUID: + retval |= UA_Guid_copy(&src->identifier.guid, &dst->identifier.guid); + break; + case UA_NODEIDTYPE_BYTESTRING: + retval |= UA_ByteString_copy(&src->identifier.byteString, + &dst->identifier.byteString); + break; + default: + return UA_STATUSCODE_BADINTERNALERROR; + } + dst->namespaceIndex = src->namespaceIndex; + dst->identifierType = src->identifierType; + return retval; +} + +UA_Boolean +UA_NodeId_isNull(const UA_NodeId *p) { + if(p->namespaceIndex != 0) + return false; + switch (p->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + return (p->identifier.numeric == 0); + case UA_NODEIDTYPE_STRING: + return UA_String_equal(&p->identifier.string, &UA_STRING_NULL); + case UA_NODEIDTYPE_GUID: + return UA_Guid_equal(&p->identifier.guid, &UA_GUID_NULL); + case UA_NODEIDTYPE_BYTESTRING: + return UA_ByteString_equal(&p->identifier.byteString, &UA_BYTESTRING_NULL); + } + return false; +} + +/* Absolute ordering for NodeIds */ +UA_Order +UA_NodeId_order(const UA_NodeId *n1, const UA_NodeId *n2) { + /* Compare namespaceIndex */ + if(n1->namespaceIndex < n2->namespaceIndex) + return UA_ORDER_LESS; + if(n1->namespaceIndex > n2->namespaceIndex) + return UA_ORDER_MORE; + + /* Compare identifierType */ + if(n1->identifierType < n2->identifierType) + return UA_ORDER_LESS; + if(n1->identifierType > n2->identifierType) + return UA_ORDER_MORE; + + /* Compare the identifier */ + switch(n1->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + if(n1->identifier.numeric < n2->identifier.numeric) + return UA_ORDER_LESS; + if(n1->identifier.numeric > n2->identifier.numeric) + return UA_ORDER_MORE; + break; + case UA_NODEIDTYPE_GUID: + if(n1->identifier.guid.data1 < n2->identifier.guid.data1) { + return UA_ORDER_LESS; + } else if(n1->identifier.guid.data1 > n2->identifier.guid.data1) { + return UA_ORDER_MORE; + } else if(n1->identifier.guid.data2 < n2->identifier.guid.data2) { + return UA_ORDER_LESS; + } else if(n1->identifier.guid.data2 > n2->identifier.guid.data2) { + return UA_ORDER_MORE; + } else if(n1->identifier.guid.data3 < n2->identifier.guid.data3) { + return UA_ORDER_LESS; + } else if(n1->identifier.guid.data3 > n2->identifier.guid.data3) { + return UA_ORDER_MORE; + } else { + int cmp = memcmp(n1->identifier.guid.data4, n2->identifier.guid.data4, 8); + + if(cmp < 0) return UA_ORDER_LESS; + if(cmp > 0) return UA_ORDER_MORE; + + } + + break; + case UA_NODEIDTYPE_STRING: + case UA_NODEIDTYPE_BYTESTRING: { + size_t minLength = UA_MIN(n1->identifier.string.length, n2->identifier.string.length); + int cmp = strncmp((const char*)n1->identifier.string.data, + (const char*)n2->identifier.string.data, + minLength); + if(cmp < 0) + return UA_ORDER_LESS; + if(cmp > 0) + return UA_ORDER_MORE; + + if(n1->identifier.string.length < n2->identifier.string.length) + return UA_ORDER_LESS; + if(n1->identifier.string.length > n2->identifier.string.length) + return UA_ORDER_MORE; + break; + } + default: + break; + } + + return UA_ORDER_EQ; +} + +/* FNV non-cryptographic hash function. See + * https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function */ +#define FNV_PRIME_32 16777619 +u32 +UA_ByteString_hash(u32 fnv, const u8 *buf, size_t size) { + for(size_t i = 0; i < size; ++i) { + fnv = fnv ^ (buf[i]); + fnv = fnv * FNV_PRIME_32; + } + return fnv; +} + +u32 +UA_NodeId_hash(const UA_NodeId *n) { + switch(n->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + default: + return UA_ByteString_hash(n->namespaceIndex, (const u8*)&n->identifier.numeric, + sizeof(UA_UInt32)); + case UA_NODEIDTYPE_STRING: + case UA_NODEIDTYPE_BYTESTRING: + return UA_ByteString_hash(n->namespaceIndex, n->identifier.string.data, + n->identifier.string.length); + case UA_NODEIDTYPE_GUID: + return UA_ByteString_hash(n->namespaceIndex, (const u8*)&n->identifier.guid, + sizeof(UA_Guid)); + } +} + +/* ExpandedNodeId */ +static void +ExpandedNodeId_clear(UA_ExpandedNodeId *p, const UA_DataType *_) { + NodeId_clear(&p->nodeId, _); + String_clear(&p->namespaceUri, NULL); +} + +static UA_StatusCode +ExpandedNodeId_copy(UA_ExpandedNodeId const *src, UA_ExpandedNodeId *dst, + const UA_DataType *_) { + UA_StatusCode retval = NodeId_copy(&src->nodeId, &dst->nodeId, NULL); + retval |= UA_String_copy(&src->namespaceUri, &dst->namespaceUri); + dst->serverIndex = src->serverIndex; + return retval; +} + +UA_Boolean +UA_ExpandedNodeId_isLocal(const UA_ExpandedNodeId *n) { + return (n->namespaceUri.length == 0 && n->serverIndex == 0); +} + +UA_Order +UA_ExpandedNodeId_order(const UA_ExpandedNodeId *n1, + const UA_ExpandedNodeId *n2) { + if(n1->serverIndex > n2->serverIndex) + return UA_ORDER_MORE; + if(n1->serverIndex < n2->serverIndex) + return UA_ORDER_LESS; + if(n1->namespaceUri.length > 0) { + if(n1->namespaceUri.length > n2->namespaceUri.length) + return UA_ORDER_MORE; + if(n1->namespaceUri.length < n2->namespaceUri.length) + return UA_ORDER_LESS; + int cmp = strncmp((const char*)n1->namespaceUri.data, + (const char*)n2->namespaceUri.data, + n1->namespaceUri.length); + if(cmp < 0) + return UA_ORDER_LESS; + if(cmp > 0) + return UA_ORDER_MORE; + } + return UA_NodeId_order(&n1->nodeId, &n2->nodeId); +} + +u32 +UA_ExpandedNodeId_hash(const UA_ExpandedNodeId *n) { + u32 h = UA_NodeId_hash(&n->nodeId); + if(n->serverIndex != 0) + h = UA_ByteString_hash(h, (const UA_Byte*)&n->serverIndex, 4); + if(n->namespaceUri.length != 0) + h = UA_ByteString_hash(h, n->namespaceUri.data, n->namespaceUri.length); + return h; +} + +/* ExtensionObject */ +static void +ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) { + switch(p->encoding) { + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + case UA_EXTENSIONOBJECT_ENCODED_XML: + NodeId_clear(&p->content.encoded.typeId, NULL); + String_clear(&p->content.encoded.body, NULL); + break; + case UA_EXTENSIONOBJECT_DECODED: + if(p->content.decoded.data) + UA_delete(p->content.decoded.data, p->content.decoded.type); + break; + default: + break; + } +} + +static UA_StatusCode +ExtensionObject_copy(UA_ExtensionObject const *src, UA_ExtensionObject *dst, + const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + switch(src->encoding) { + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + case UA_EXTENSIONOBJECT_ENCODED_XML: + dst->encoding = src->encoding; + retval = NodeId_copy(&src->content.encoded.typeId, + &dst->content.encoded.typeId, NULL); + retval |= UA_ByteString_copy(&src->content.encoded.body, + &dst->content.encoded.body); + break; + case UA_EXTENSIONOBJECT_DECODED: + case UA_EXTENSIONOBJECT_DECODED_NODELETE: + if(!src->content.decoded.type || !src->content.decoded.data) + return UA_STATUSCODE_BADINTERNALERROR; + dst->encoding = UA_EXTENSIONOBJECT_DECODED; + dst->content.decoded.type = src->content.decoded.type; + retval = UA_Array_copy(src->content.decoded.data, 1, + &dst->content.decoded.data, src->content.decoded.type); + break; + default: + break; + } + return retval; +} + +void +UA_ExtensionObject_setValue(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type) { + UA_ExtensionObject_init(eo); + eo->content.decoded.data = p; + eo->content.decoded.type = type; + eo->encoding = UA_EXTENSIONOBJECT_DECODED; +} + +void +UA_ExtensionObject_setValueNoDelete(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type) { + UA_ExtensionObject_init(eo); + eo->content.decoded.data = p; + eo->content.decoded.type = type; + eo->encoding = UA_EXTENSIONOBJECT_DECODED_NODELETE; +} + +UA_StatusCode +UA_ExtensionObject_setValueCopy(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type) { + UA_ExtensionObject_init(eo); + + /* Make a copy of the value */ + void *val = UA_malloc(type->memSize); + if(!val) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode res = UA_copy(p, val, type); + if(res != UA_STATUSCODE_GOOD) { + UA_free(val); + return res; + } + + /* Set the ExtensionObject */ + eo->content.decoded.data = val; + eo->content.decoded.type = type; + eo->encoding = UA_EXTENSIONOBJECT_DECODED; + return UA_STATUSCODE_GOOD; +} + +/* Variant */ +static void +Variant_clear(UA_Variant *p, const UA_DataType *_) { + if(p->storageType != UA_VARIANT_DATA) + return; + if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) { + if(p->arrayLength == 0) + p->arrayLength = 1; + UA_Array_delete(p->data, p->arrayLength, p->type); + p->data = NULL; + } + if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL) + UA_free(p->arrayDimensions); +} + +static UA_StatusCode +Variant_copy(UA_Variant const *src, UA_Variant *dst, const UA_DataType *_) { + size_t length = src->arrayLength; + if(UA_Variant_isScalar(src)) + length = 1; + UA_StatusCode retval = UA_Array_copy(src->data, length, + &dst->data, src->type); + if(retval != UA_STATUSCODE_GOOD) + return retval; + dst->arrayLength = src->arrayLength; + dst->type = src->type; + if(src->arrayDimensions) { + retval = UA_Array_copy(src->arrayDimensions, src->arrayDimensionsSize, + (void**)&dst->arrayDimensions, &UA_TYPES[UA_TYPES_INT32]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + dst->arrayDimensionsSize = src->arrayDimensionsSize; + } + return UA_STATUSCODE_GOOD; +} + +void +UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, + const UA_DataType *type) { + UA_Variant_init(v); + v->type = type; + v->arrayLength = 0; + v->data = p; +} + +UA_StatusCode +UA_Variant_setScalarCopy(UA_Variant *v, const void * UA_RESTRICT p, + const UA_DataType *type) { + void *n = UA_malloc(type->memSize); + if(!n) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode retval = UA_copy(p, n, type); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(n); + //cppcheck-suppress memleak + return retval; + } + UA_Variant_setScalar(v, n, type); + //cppcheck-suppress memleak + return UA_STATUSCODE_GOOD; +} + +void UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array, + size_t arraySize, const UA_DataType *type) { + UA_Variant_init(v); + v->data = array; + v->arrayLength = arraySize; + v->type = type; +} + +UA_StatusCode +UA_Variant_setArrayCopy(UA_Variant *v, const void * UA_RESTRICT array, + size_t arraySize, const UA_DataType *type) { + UA_Variant_init(v); + UA_StatusCode retval = UA_Array_copy(array, arraySize, &v->data, type); + if(retval != UA_STATUSCODE_GOOD) + return retval; + v->arrayLength = arraySize; + v->type = type; + return UA_STATUSCODE_GOOD; +} + +/* Test if a range is compatible with a variant. If yes, the following values + * are set: + * - total: how many elements are in the range + * - block: how big is each contiguous block of elements in the variant that + * maps into the range + * - stride: how many elements are between the blocks (beginning to beginning) + * - first: where does the first block begin */ +static UA_StatusCode +computeStrides(const UA_Variant *v, const UA_NumericRange range, + size_t *total, size_t *block, size_t *stride, size_t *first) { + /* Test for max array size (64bit only) */ +#if (SIZE_MAX > 0xffffffff) + if(v->arrayLength > UA_UINT32_MAX) + return UA_STATUSCODE_BADINTERNALERROR; +#endif + + /* Test the integrity of the source variant dimensions, make dimensions + * vector of one dimension if none defined */ + u32 arrayLength = (u32)v->arrayLength; + const u32 *dims = &arrayLength; + size_t dims_count = 1; + if(v->arrayDimensionsSize > 0) { + size_t elements = 1; + dims_count = v->arrayDimensionsSize; + dims = (u32*)v->arrayDimensions; + for(size_t i = 0; i < dims_count; ++i) + elements *= dims[i]; + if(elements != v->arrayLength) + return UA_STATUSCODE_BADINTERNALERROR; + } + UA_assert(dims_count > 0); + + /* Upper bound of the dimensions for stack-allocation */ + if(dims_count > UA_MAX_ARRAY_DIMS) + return UA_STATUSCODE_BADINTERNALERROR; + UA_UInt32 realmax[UA_MAX_ARRAY_DIMS]; + + /* Test the integrity of the range and compute the max index used for every + * dimension. The standard says in Part 4, Section 7.22: + * + * When reading a value, the indexes may not specify a range that is within + * the bounds of the array. The Server shall return a partial result if some + * elements exist within the range. */ + size_t count = 1; + if(range.dimensionsSize != dims_count) + return UA_STATUSCODE_BADINDEXRANGENODATA; + for(size_t i = 0; i < dims_count; ++i) { + if(range.dimensions[i].min > range.dimensions[i].max) + return UA_STATUSCODE_BADINDEXRANGEINVALID; + if(range.dimensions[i].min >= dims[i]) + return UA_STATUSCODE_BADINDEXRANGENODATA; + + if(range.dimensions[i].max < dims[i]) + realmax[i] = range.dimensions[i].max; + else + realmax[i] = dims[i] - 1; + + count *= (realmax[i] - range.dimensions[i].min) + 1; + } + + *total = count; + + /* Compute the stride length and the position of the first element */ + *block = count; /* Assume the range describes the entire array. */ + *stride = v->arrayLength; /* So it can be copied as a contiguous block. */ + *first = 0; + size_t running_dimssize = 1; + UA_Boolean found_contiguous = false; + for(size_t k = dims_count; k > 0;) { + --k; + size_t dimrange = 1 + realmax[k] - range.dimensions[k].min; + if(!found_contiguous && dimrange != dims[k]) { + /* Found the maximum block that can be copied contiguously */ + found_contiguous = true; + *block = running_dimssize * dimrange; + *stride = running_dimssize * dims[k]; + } + *first += running_dimssize * range.dimensions[k].min; + running_dimssize *= dims[k]; + } + return UA_STATUSCODE_GOOD; +} + +/* Is the type string-like? */ +static UA_Boolean +isStringLike(const UA_DataType *type) { + if(type == &UA_TYPES[UA_TYPES_STRING] || + type == &UA_TYPES[UA_TYPES_BYTESTRING] || + type == &UA_TYPES[UA_TYPES_XMLELEMENT]) + return true; + return false; +} + +/* Returns the part of the string that lies within the rangedimension */ +static UA_StatusCode +copySubString(const UA_String *src, UA_String *dst, + const UA_NumericRangeDimension *dim) { + if(dim->min > dim->max) + return UA_STATUSCODE_BADINDEXRANGEINVALID; + if(dim->min >= src->length) + return UA_STATUSCODE_BADINDEXRANGENODATA; + + size_t length; + if(dim->max < src->length) + length = dim->max - dim->min + 1; + else + length = src->length - dim->min; + + UA_StatusCode retval = UA_ByteString_allocBuffer(dst, length); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + memcpy(dst->data, &src->data[dim->min], length); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Variant_copyRange(const UA_Variant *src, UA_Variant * UA_RESTRICT dst, + const UA_NumericRange range) { + if(!src->type) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_Boolean isScalar = UA_Variant_isScalar(src); + UA_Boolean stringLike = isStringLike(src->type); + UA_Variant arraySrc; + + /* Extract the range for copying at this level. The remaining range is dealt + * with in the "scalar" type that may define an array by itself (string, + * variant, ...). */ + UA_NumericRange thisrange, nextrange; + UA_NumericRangeDimension scalarThisDimension = {0,0}; /* a single entry */ + if(isScalar) { + /* Replace scalar src with array of length 1 */ + arraySrc = *src; + arraySrc.arrayLength = 1; + src = &arraySrc; + /* Deal with all range dimensions within the scalar */ + thisrange.dimensions = &scalarThisDimension; + thisrange.dimensionsSize = 1; + nextrange = range; + } else { + /* Deal with as many range dimensions as possible right now */ + size_t dims = src->arrayDimensionsSize; + if(dims == 0) + dims = 1; + if(dims > range.dimensionsSize) + return UA_STATUSCODE_BADINDEXRANGEINVALID; + thisrange = range; + thisrange.dimensionsSize = dims; + nextrange.dimensions = &range.dimensions[dims]; + nextrange.dimensionsSize = range.dimensionsSize - dims; + } + + /* Compute the strides */ + size_t count, block, stride, first; + UA_StatusCode retval = computeStrides(src, thisrange, &count, + &block, &stride, &first); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Allocate the array */ + UA_Variant_init(dst); + dst->data = UA_Array_new(count, src->type); + if(!dst->data) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Copy the range */ + size_t block_count = count / block; + size_t elem_size = src->type->memSize; + uintptr_t nextdst = (uintptr_t)dst->data; + uintptr_t nextsrc = (uintptr_t)src->data + (elem_size * first); + if(nextrange.dimensionsSize == 0) { + /* no nextrange */ + if(src->type->pointerFree) { + for(size_t i = 0; i < block_count; ++i) { + memcpy((void*)nextdst, (void*)nextsrc, elem_size * block); + nextdst += block * elem_size; + nextsrc += stride * elem_size; + } + } else { + for(size_t i = 0; i < block_count; ++i) { + for(size_t j = 0; j < block; ++j) { + retval = UA_copy((const void*)nextsrc, + (void*)nextdst, src->type); + nextdst += elem_size; + nextsrc += elem_size; + } + nextsrc += (stride - block) * elem_size; + } + } + } else { + /* nextrange can only be used for variants and stringlike with remaining + * range of dimension 1 */ + if(src->type != &UA_TYPES[UA_TYPES_VARIANT]) { + if(!stringLike) + retval = UA_STATUSCODE_BADINDEXRANGENODATA; + if(nextrange.dimensionsSize != 1) + retval = UA_STATUSCODE_BADINDEXRANGENODATA; + } + + /* Copy the content */ + for(size_t i = 0; i < block_count; ++i) { + for(size_t j = 0; j < block && retval == UA_STATUSCODE_GOOD; ++j) { + if(stringLike) + retval = copySubString((const UA_String*)nextsrc, + (UA_String*)nextdst, + nextrange.dimensions); + else + retval = UA_Variant_copyRange((const UA_Variant*)nextsrc, + (UA_Variant*)nextdst, + nextrange); + nextdst += elem_size; + nextsrc += elem_size; + } + nextsrc += (stride - block) * elem_size; + } + } + + /* Clean up if copying failed */ + if(retval != UA_STATUSCODE_GOOD) { + UA_Array_delete(dst->data, count, src->type); + dst->data = NULL; + return retval; + } + + /* Done if scalar */ + dst->type = src->type; + if(isScalar) + return retval; + + /* Copy array dimensions */ + dst->arrayLength = count; + if(src->arrayDimensionsSize > 0) { + dst->arrayDimensions = + (u32*)UA_Array_new(thisrange.dimensionsSize, &UA_TYPES[UA_TYPES_UINT32]); + if(!dst->arrayDimensions) { + Variant_clear(dst, NULL); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + dst->arrayDimensionsSize = thisrange.dimensionsSize; + for(size_t k = 0; k < thisrange.dimensionsSize; ++k) + dst->arrayDimensions[k] = + thisrange.dimensions[k].max - thisrange.dimensions[k].min + 1; + } + return UA_STATUSCODE_GOOD; +} + +/* TODO: Allow ranges to reach inside a scalars that are array-like, e.g. + * variant and strings. This is already possible for reading... */ +static UA_StatusCode +Variant_setRange(UA_Variant *v, void *array, size_t arraySize, + const UA_NumericRange range, UA_Boolean copy) { + /* Compute the strides */ + size_t count, block, stride, first; + UA_StatusCode retval = computeStrides(v, range, &count, + &block, &stride, &first); + if(retval != UA_STATUSCODE_GOOD) + return retval; + if(count != arraySize) + return UA_STATUSCODE_BADINDEXRANGEINVALID; + + /* Move/copy the elements */ + size_t block_count = count / block; + size_t elem_size = v->type->memSize; + uintptr_t nextdst = (uintptr_t)v->data + (first * elem_size); + uintptr_t nextsrc = (uintptr_t)array; + if(v->type->pointerFree || !copy) { + for(size_t i = 0; i < block_count; ++i) { + memcpy((void*)nextdst, (void*)nextsrc, elem_size * block); + nextsrc += block * elem_size; + nextdst += stride * elem_size; + } + } else { + for(size_t i = 0; i < block_count; ++i) { + for(size_t j = 0; j < block; ++j) { + clearJumpTable[v->type->typeKind]((void*)nextdst, v->type); + retval |= UA_copy((void*)nextsrc, (void*)nextdst, v->type); + nextdst += elem_size; + nextsrc += elem_size; + } + nextdst += (stride - block) * elem_size; + } + } + + /* If members were moved, initialize original array to prevent reuse */ + if(!copy && !v->type->pointerFree) + memset(array, 0, sizeof(elem_size)*arraySize); + + return retval; +} + +UA_StatusCode +UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array, + size_t arraySize, const UA_NumericRange range) { + return Variant_setRange(v, array, arraySize, range, false); +} + +UA_StatusCode +UA_Variant_setRangeCopy(UA_Variant *v, const void * UA_RESTRICT array, + size_t arraySize, const UA_NumericRange range) { + return Variant_setRange(v, (void*)(uintptr_t)array, + arraySize, range, true); +} + +/* LocalizedText */ +static void +LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) { + String_clear(&p->locale, NULL); + String_clear(&p->text, NULL); +} + +static UA_StatusCode +LocalizedText_copy(UA_LocalizedText const *src, UA_LocalizedText *dst, + const UA_DataType *_) { + UA_StatusCode retval = UA_String_copy(&src->locale, &dst->locale); + retval |= UA_String_copy(&src->text, &dst->text); + return retval; +} + +/* DataValue */ +static void +DataValue_clear(UA_DataValue *p, const UA_DataType *_) { + Variant_clear(&p->value, NULL); +} + +static UA_StatusCode +DataValue_copy(UA_DataValue const *src, UA_DataValue *dst, + const UA_DataType *_) { + memcpy(dst, src, sizeof(UA_DataValue)); + UA_Variant_init(&dst->value); + UA_StatusCode retval = Variant_copy(&src->value, &dst->value, NULL); + if(retval != UA_STATUSCODE_GOOD) + DataValue_clear(dst, NULL); + return retval; +} + +/* DiagnosticInfo */ +static void +DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) { + String_clear(&p->additionalInfo, NULL); + if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) { + DiagnosticInfo_clear(p->innerDiagnosticInfo, NULL); + UA_free(p->innerDiagnosticInfo); + } +} + +static UA_StatusCode +DiagnosticInfo_copy(UA_DiagnosticInfo const *src, UA_DiagnosticInfo *dst, + const UA_DataType *_) { + memcpy(dst, src, sizeof(UA_DiagnosticInfo)); + UA_String_init(&dst->additionalInfo); + dst->innerDiagnosticInfo = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(src->hasAdditionalInfo) + retval = UA_String_copy(&src->additionalInfo, &dst->additionalInfo); + if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo) { + dst->innerDiagnosticInfo = (UA_DiagnosticInfo*)UA_malloc(sizeof(UA_DiagnosticInfo)); + if(dst->innerDiagnosticInfo) { + retval |= DiagnosticInfo_copy(src->innerDiagnosticInfo, + dst->innerDiagnosticInfo, NULL); + dst->hasInnerDiagnosticInfo = true; + } else { + dst->hasInnerDiagnosticInfo = false; + retval |= UA_STATUSCODE_BADOUTOFMEMORY; + } + } + return retval; +} + +/* StatusCode */ +UA_Boolean +UA_StatusCode_isBad(const UA_StatusCode code) { + if ((code & 0x80000000) != 0) { + return UA_TRUE; + } + return UA_FALSE; +} + +/********************/ +/* Structured Types */ +/********************/ + +void * +UA_new(const UA_DataType *type) { + void *p = UA_calloc(1, type->memSize); + return p; +} + +static UA_StatusCode +copyByte(const u8 *src, u8 *dst, const UA_DataType *_) { + *dst = *src; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copy2Byte(const u16 *src, u16 *dst, const UA_DataType *_) { + *dst = *src; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copy4Byte(const u32 *src, u32 *dst, const UA_DataType *_) { + *dst = *src; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copy8Byte(const u64 *src, u64 *dst, const UA_DataType *_) { + *dst = *src; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyGuid(const UA_Guid *src, UA_Guid *dst, const UA_DataType *_) { + *dst = *src; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyStructure(const void *src, void *dst, const UA_DataType *type) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + uintptr_t ptrs = (uintptr_t)src; + uintptr_t ptrd = (uintptr_t)dst; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + for(size_t i = 0; i < type->membersSize; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptrs += m->padding; + ptrd += m->padding; + if(!m->isOptional) { + if(!m->isArray) { + retval |= copyJumpTable[mt->typeKind]((const void *)ptrs, (void *)ptrd, mt); + ptrs += mt->memSize; + ptrd += mt->memSize; + } else { + size_t *dst_size = (size_t*)ptrd; + const size_t size = *((const size_t*)ptrs); + ptrs += sizeof(size_t); + ptrd += sizeof(size_t); + retval |= UA_Array_copy(*(void* const*)ptrs, size, (void**)ptrd, mt); + if(retval == UA_STATUSCODE_GOOD) + *dst_size = size; + else + *dst_size = 0; + ptrs += sizeof(void*); + ptrd += sizeof(void*); + } + } else { + if(!m->isArray) { + if(*(void* const*)ptrs != NULL) + retval |= UA_Array_copy(*(void* const*)ptrs, 1, (void**)ptrd, mt); + } else { + if(*(void* const*)(ptrs+sizeof(size_t)) != NULL) { + size_t *dst_size = (size_t*)ptrd; + const size_t size = *((const size_t*)ptrs); + ptrs += sizeof(size_t); + ptrd += sizeof(size_t); + retval |= UA_Array_copy(*(void* const*)ptrs, size, (void**)ptrd, mt); + if(retval == UA_STATUSCODE_GOOD) + *dst_size = size; + else + *dst_size = 0; + } else { + ptrs += sizeof(size_t); + ptrd += sizeof(size_t); + } + } + ptrs += sizeof(void*); + ptrd += sizeof(void*); + } + } + return retval; +} + +static UA_StatusCode +copyUnion(const void *src, void *dst, const UA_DataType *type) { + uintptr_t ptrs = (uintptr_t) src; + uintptr_t ptrd = (uintptr_t) dst; + UA_UInt32 selection = *(UA_UInt32 *)ptrs; + UA_copy((const UA_UInt32 *) ptrs, (UA_UInt32 *) ptrd, &UA_TYPES[UA_TYPES_UINT32]); + if(selection == 0) + return UA_STATUSCODE_GOOD; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + const UA_DataTypeMember *m = &type->members[selection-1]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptrs += m->padding; + ptrd += m->padding; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + + if (m->isArray) { + size_t *dst_size = (size_t*)ptrd; + const size_t size = *((const size_t*)ptrs); + ptrs += sizeof(size_t); + ptrd += sizeof(size_t); + retval = UA_Array_copy(*(void* const*)ptrs, size, (void**)ptrd, mt); + if(retval == UA_STATUSCODE_GOOD) + *dst_size = size; + else + *dst_size = 0; + } else { + retval = copyJumpTable[mt->typeKind]((const void *)ptrs, (void *)ptrd, mt); + } + + return retval; +} + +static UA_StatusCode +copyNotImplemented(const void *src, void *dst, const UA_DataType *type) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +const UA_copySignature copyJumpTable[UA_DATATYPEKINDS] = { + (UA_copySignature)copyByte, /* Boolean */ + (UA_copySignature)copyByte, /* SByte */ + (UA_copySignature)copyByte, /* Byte */ + (UA_copySignature)copy2Byte, /* Int16 */ + (UA_copySignature)copy2Byte, /* UInt16 */ + (UA_copySignature)copy4Byte, /* Int32 */ + (UA_copySignature)copy4Byte, /* UInt32 */ + (UA_copySignature)copy8Byte, /* Int64 */ + (UA_copySignature)copy8Byte, /* UInt64 */ + (UA_copySignature)copy4Byte, /* Float */ + (UA_copySignature)copy8Byte, /* Double */ + (UA_copySignature)String_copy, + (UA_copySignature)copy8Byte, /* DateTime */ + (UA_copySignature)copyGuid, /* Guid */ + (UA_copySignature)String_copy, /* ByteString */ + (UA_copySignature)String_copy, /* XmlElement */ + (UA_copySignature)NodeId_copy, + (UA_copySignature)ExpandedNodeId_copy, + (UA_copySignature)copy4Byte, /* StatusCode */ + (UA_copySignature)QualifiedName_copy, + (UA_copySignature)LocalizedText_copy, + (UA_copySignature)ExtensionObject_copy, + (UA_copySignature)DataValue_copy, + (UA_copySignature)Variant_copy, + (UA_copySignature)DiagnosticInfo_copy, + (UA_copySignature)copyNotImplemented, /* Decimal */ + (UA_copySignature)copy4Byte, /* Enumeration */ + (UA_copySignature)copyStructure, + (UA_copySignature)copyStructure, /* Structure with Optional Fields */ + (UA_copySignature)copyUnion, /* Union */ + (UA_copySignature)copyNotImplemented /* BitfieldCluster*/ +}; + +UA_StatusCode +UA_copy(const void *src, void *dst, const UA_DataType *type) { + memset(dst, 0, type->memSize); /* init */ + UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type); + if(retval != UA_STATUSCODE_GOOD) + UA_clear(dst, type); + return retval; +} + +static void +clearStructure(void *p, const UA_DataType *type) { + uintptr_t ptr = (uintptr_t)p; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + for(size_t i = 0; i < type->membersSize; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + if(!m->isOptional) { + if(!m->isArray) { + clearJumpTable[mt->typeKind]((void*)ptr, mt); + ptr += mt->memSize; + } else { + size_t length = *(size_t*)ptr; + ptr += sizeof(size_t); + UA_Array_delete(*(void**)ptr, length, mt); + ptr += sizeof(void*); + } + } else { /* field is optional */ + if(!m->isArray) { + /* optional scalar field is contained */ + if((*(void *const *)ptr != NULL)) + UA_Array_delete(*(void **)ptr, 1, mt); + ptr += sizeof(void *); + } else { + /* optional array field is contained */ + if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) { + size_t length = *(size_t *)ptr; + ptr += sizeof(size_t); + UA_Array_delete(*(void **)ptr, length, mt); + ptr += sizeof(void *); + } else { /* optional array field not contained */ + ptr += sizeof(size_t); + ptr += sizeof(void *); + } + } + } + } +} + +static void +clearUnion(void *p, const UA_DataType *type) { + uintptr_t ptr = (uintptr_t) p; + UA_UInt32 selection = *(UA_UInt32 *)ptr; + if(selection == 0) + return; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + const UA_DataTypeMember *m = &type->members[selection-1]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + if (m->isArray) { + size_t length = *(size_t *)ptr; + ptr += sizeof(size_t); + UA_Array_delete(*(void **)ptr, length, mt); + } else { + UA_clear((void *) ptr, mt); + } +} + +static void nopClear(void *p, const UA_DataType *type) { } + +const +UA_clearSignature clearJumpTable[UA_DATATYPEKINDS] = { + (UA_clearSignature)nopClear, /* Boolean */ + (UA_clearSignature)nopClear, /* SByte */ + (UA_clearSignature)nopClear, /* Byte */ + (UA_clearSignature)nopClear, /* Int16 */ + (UA_clearSignature)nopClear, /* UInt16 */ + (UA_clearSignature)nopClear, /* Int32 */ + (UA_clearSignature)nopClear, /* UInt32 */ + (UA_clearSignature)nopClear, /* Int64 */ + (UA_clearSignature)nopClear, /* UInt64 */ + (UA_clearSignature)nopClear, /* Float */ + (UA_clearSignature)nopClear, /* Double */ + (UA_clearSignature)String_clear, /* String */ + (UA_clearSignature)nopClear, /* DateTime */ + (UA_clearSignature)nopClear, /* Guid */ + (UA_clearSignature)String_clear, /* ByteString */ + (UA_clearSignature)String_clear, /* XmlElement */ + (UA_clearSignature)NodeId_clear, + (UA_clearSignature)ExpandedNodeId_clear, + (UA_clearSignature)nopClear, /* StatusCode */ + (UA_clearSignature)QualifiedName_clear, + (UA_clearSignature)LocalizedText_clear, + (UA_clearSignature)ExtensionObject_clear, + (UA_clearSignature)DataValue_clear, + (UA_clearSignature)Variant_clear, + (UA_clearSignature)DiagnosticInfo_clear, + (UA_clearSignature)nopClear, /* Decimal, not implemented */ + (UA_clearSignature)nopClear, /* Enumeration */ + (UA_clearSignature)clearStructure, + (UA_clearSignature)clearStructure, /* Struct with Optional Fields*/ + (UA_clearSignature)clearUnion, /* Union*/ + (UA_clearSignature)nopClear /* BitfieldCluster, not implemented*/ +}; + +void +UA_clear(void *p, const UA_DataType *type) { + clearJumpTable[type->typeKind](p, type); + memset(p, 0, type->memSize); /* init */ +} + +void +UA_delete(void *p, const UA_DataType *type) { + clearJumpTable[type->typeKind](p, type); + UA_free(p); +} + +/******************/ +/* Array Handling */ +/******************/ + +void * +UA_Array_new(size_t size, const UA_DataType *type) { + if(size > UA_INT32_MAX) + return NULL; + if(size == 0) + return UA_EMPTY_ARRAY_SENTINEL; + return UA_calloc(size, type->memSize); +} + +UA_StatusCode +UA_Array_copy(const void *src, size_t size, + void **dst, const UA_DataType *type) { + if(size == 0) { + if(src == NULL) + *dst = NULL; + else + *dst= UA_EMPTY_ARRAY_SENTINEL; + return UA_STATUSCODE_GOOD; + } + + if(!type) + return UA_STATUSCODE_BADINTERNALERROR; + + /* calloc, so we don't have to check retval in every iteration of copying */ + *dst = UA_calloc(size, type->memSize); + if(!*dst) + return UA_STATUSCODE_BADOUTOFMEMORY; + + if(type->pointerFree) { + memcpy(*dst, src, type->memSize * size); + return UA_STATUSCODE_GOOD; + } + + uintptr_t ptrs = (uintptr_t)src; + uintptr_t ptrd = (uintptr_t)*dst; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t i = 0; i < size; ++i) { + retval |= UA_copy((void*)ptrs, (void*)ptrd, type); + ptrs += type->memSize; + ptrd += type->memSize; + } + if(retval != UA_STATUSCODE_GOOD) { + UA_Array_delete(*dst, size, type); + *dst = NULL; + } + return retval; +} + +void +UA_Array_delete(void *p, size_t size, const UA_DataType *type) { + if(!type->pointerFree) { + uintptr_t ptr = (uintptr_t)p; + for(size_t i = 0; i < size; ++i) { + UA_clear((void*)ptr, type); + ptr += type->memSize; + } + } + UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL)); +} + +UA_Boolean +UA_DataType_isNumeric(const UA_DataType *type) { + /* All data types between UA_TYPES_BOOLEAN and UA_TYPES_DOUBLE are numeric */ + for(size_t i = UA_TYPES_BOOLEAN; i <= UA_TYPES_DOUBLE; ++i) + if(&UA_TYPES[i] == type) + return true; + return false; +} + +/**********************/ +/* Parse NumericRange */ +/**********************/ + +static size_t +readDimension(UA_Byte *buf, size_t buflen, UA_NumericRangeDimension *dim) { + size_t progress = UA_readNumber(buf, buflen, &dim->min); + if(progress == 0) + return 0; + if(buflen <= progress + 1 || buf[progress] != ':') { + dim->max = dim->min; + return progress; + } + + ++progress; + size_t progress2 = UA_readNumber(&buf[progress], buflen - progress, &dim->max); + if(progress2 == 0) + return 0; + + /* invalid range */ + if(dim->min >= dim->max) + return 0; + + return progress + progress2; +} + +UA_StatusCode +UA_NumericRange_parse(UA_NumericRange *range, const UA_String str) { + size_t idx = 0; + size_t dimensionsMax = 0; + UA_NumericRangeDimension *dimensions = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + size_t offset = 0; + while(true) { + /* alloc dimensions */ + if(idx >= dimensionsMax) { + UA_NumericRangeDimension *newds; + size_t newdssize = sizeof(UA_NumericRangeDimension) * (dimensionsMax + 2); + newds = (UA_NumericRangeDimension*)UA_realloc(dimensions, newdssize); + if(!newds) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + break; + } + dimensions = newds; + dimensionsMax = dimensionsMax + 2; + } + + /* read the dimension */ + size_t progress = readDimension(&str.data[offset], str.length - offset, + &dimensions[idx]); + if(progress == 0) { + retval = UA_STATUSCODE_BADINDEXRANGEINVALID; + break; + } + offset += progress; + ++idx; + + /* loop into the next dimension */ + if(offset >= str.length) + break; + + if(str.data[offset] != ',') { + retval = UA_STATUSCODE_BADINDEXRANGEINVALID; + break; + } + ++offset; + } + + if(retval == UA_STATUSCODE_GOOD && idx > 0) { + range->dimensions = dimensions; + range->dimensionsSize = idx; + } else + UA_free(dimensions); + + return retval; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_types_encoding_binary.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright 2020 (c) Grigory Friedman + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2014-2016 (c) Sten Grüner + * Copyright 2014 (c) Leon Urbas + * Copyright 2015 (c) LEvertz + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Henrik Norrman + */ + + + +/** + * Type Encoding and Decoding + * -------------------------- + * The following methods contain encoding and decoding functions for the builtin + * data types and generic functions that operate on all types and arrays. This + * requires the type description from a UA_DataType structure. + * + * Breaking a message up into chunks is integrated with the encoding. When the + * end of a buffer is reached, a callback is executed that sends the current + * buffer as a chunk and exchanges the encoding buffer "underneath" the ongoing + * encoding. This reduces the RAM requirements and unnecessary copying. */ + +/* Part 6 §5.1.5: Decoders shall support at least 100 nesting levels */ +#define UA_ENCODING_MAX_RECURSION 100 + +typedef struct { + /* Pointers to the current and last buffer position */ + u8 *pos; + const u8 *end; + + /* How often did we en-/decoding recurse? */ + u16 depth; + + const UA_DataTypeArray *customTypes; + UA_exchangeEncodeBuffer exchangeBufferCallback; + void *exchangeBufferCallbackHandle; +} Ctx; + +typedef status +(*encodeBinarySignature)(const void *UA_RESTRICT src, const UA_DataType *type, + Ctx *UA_RESTRICT ctx); +typedef status +(*decodeBinarySignature)(void *UA_RESTRICT dst, const UA_DataType *type, + Ctx *UA_RESTRICT ctx); +typedef size_t +(*calcSizeBinarySignature)(const void *UA_RESTRICT p, const UA_DataType *type); + +#define ENCODE_BINARY(TYPE) static status \ + TYPE##_encodeBinary(const UA_##TYPE *UA_RESTRICT src, \ + const UA_DataType *type, Ctx *UA_RESTRICT ctx) +#define DECODE_BINARY(TYPE) static status \ + TYPE##_decodeBinary(UA_##TYPE *UA_RESTRICT dst, \ + const UA_DataType *type, Ctx *UA_RESTRICT ctx) +#define CALCSIZE_BINARY(TYPE) static size_t \ + TYPE##_calcSizeBinary(const UA_##TYPE *UA_RESTRICT src, const UA_DataType *_) +#define ENCODE_DIRECT(SRC, TYPE) TYPE##_encodeBinary((const UA_##TYPE*)SRC, NULL, ctx) +#define DECODE_DIRECT(DST, TYPE) TYPE##_decodeBinary((UA_##TYPE*)DST, NULL, ctx) + +/* Jumptables for de-/encoding and computing the buffer length. The methods in + * the decoding jumptable do not all clean up their allocated memory when an + * error occurs. So a final _clear needs to be called before returning to the + * user. */ +extern const encodeBinarySignature encodeBinaryJumpTable[UA_DATATYPEKINDS]; +extern const decodeBinarySignature decodeBinaryJumpTable[UA_DATATYPEKINDS]; +extern const calcSizeBinarySignature calcSizeBinaryJumpTable[UA_DATATYPEKINDS]; + +/* Send the current chunk and replace the buffer */ +static status exchangeBuffer(Ctx *ctx) { + if(!ctx->exchangeBufferCallback) + return UA_STATUSCODE_BADENCODINGERROR; + return ctx->exchangeBufferCallback(ctx->exchangeBufferCallbackHandle, + &ctx->pos, &ctx->end); +} + +/* If encoding fails, exchange the buffer and try again. */ +static status +encodeWithExchangeBuffer(const void *ptr, const UA_DataType *type, Ctx *ctx) { + u8 *oldpos = ctx->pos; /* Last known good position */ +#ifndef NDEBUG + /* We have to ensure that the buffer was not exchanged AND + * BADENCODINGLIMITSEXCEEDED was returned. If that were the case, oldpos + * would be invalid. That means, a type encoding must never return + * BADENCODINGLIMITSEXCEEDED once the buffer could have been exchanged. This + * is achieved by the use of encodeWithExchangeBuffer. */ + const u8 *oldend = ctx->end; + (void)oldend; /* For compilers who don't understand NDEBUG... */ +#endif + status ret = encodeBinaryJumpTable[type->typeKind](ptr, type, ctx); + if(ret == UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED) { + UA_assert(ctx->end == oldend); + ctx->pos = oldpos; /* Set to the last known good position and exchange */ + ret = exchangeBuffer(ctx); + if(ret != UA_STATUSCODE_GOOD) + return ret; + ret = encodeBinaryJumpTable[type->typeKind](ptr, type, ctx); + } + return ret; +} + +/*****************/ +/* Integer Types */ +/*****************/ + +#if !UA_BINARY_OVERLAYABLE_INTEGER + +#pragma message "Integer endianness could not be detected to be little endian. Use slow generic encoding." + +/* These en/decoding functions are only used when the architecture isn't little-endian. */ +static void +UA_encode16(const u16 v, u8 buf[2]) { + buf[0] = (u8)v; + buf[1] = (u8)(v >> 8); +} + +static void +UA_decode16(const u8 buf[2], u16 *v) { + *v = (u16)((u16)buf[0] + (((u16)buf[1]) << 8)); +} + +static void +UA_encode32(const u32 v, u8 buf[4]) { + buf[0] = (u8)v; + buf[1] = (u8)(v >> 8); + buf[2] = (u8)(v >> 16); + buf[3] = (u8)(v >> 24); +} + +static void +UA_decode32(const u8 buf[4], u32 *v) { + *v = (u32)((u32)buf[0] + (((u32)buf[1]) << 8) + + (((u32)buf[2]) << 16) + (((u32)buf[3]) << 24)); +} + +static void +UA_encode64(const u64 v, u8 buf[8]) { + buf[0] = (u8)v; + buf[1] = (u8)(v >> 8); + buf[2] = (u8)(v >> 16); + buf[3] = (u8)(v >> 24); + buf[4] = (u8)(v >> 32); + buf[5] = (u8)(v >> 40); + buf[6] = (u8)(v >> 48); + buf[7] = (u8)(v >> 56); +} + +static void +UA_decode64(const u8 buf[8], u64 *v) { + *v = (u64)((u64)buf[0] + (((u64)buf[1]) << 8) + + (((u64)buf[2]) << 16) + (((u64)buf[3]) << 24) + + (((u64)buf[4]) << 32) + (((u64)buf[5]) << 40) + + (((u64)buf[6]) << 48) + (((u64)buf[7]) << 56)); +} + +#endif /* !UA_BINARY_OVERLAYABLE_INTEGER */ + +/* Boolean */ +/* Note that sizeof(bool) != 1 on some platforms. Overlayable integer encoding + * is disabled in those cases. */ +ENCODE_BINARY(Boolean) { + if(ctx->pos + 1 > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; + *ctx->pos = *(const u8*)src; + ++ctx->pos; + return UA_STATUSCODE_GOOD; +} + +DECODE_BINARY(Boolean) { + if(ctx->pos + 1 > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; + *dst = (*ctx->pos > 0) ? true : false; + ++ctx->pos; + return UA_STATUSCODE_GOOD; +} + +/* Byte */ +ENCODE_BINARY(Byte) { + if(ctx->pos + sizeof(u8) > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; + *ctx->pos = *(const u8*)src; + ++ctx->pos; + return UA_STATUSCODE_GOOD; +} + +DECODE_BINARY(Byte) { + if(ctx->pos + sizeof(u8) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; + *dst = *ctx->pos; + ++ctx->pos; + return UA_STATUSCODE_GOOD; +} + +/* UInt16 */ +ENCODE_BINARY(UInt16) { + if(ctx->pos + sizeof(u16) > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(ctx->pos, src, sizeof(u16)); +#else + UA_encode16(*src, ctx->pos); +#endif + ctx->pos += 2; + return UA_STATUSCODE_GOOD; +} + +DECODE_BINARY(UInt16) { + if(ctx->pos + sizeof(u16) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(dst, ctx->pos, sizeof(u16)); +#else + UA_decode16(ctx->pos, dst); +#endif + ctx->pos += 2; + return UA_STATUSCODE_GOOD; +} + +/* UInt32 */ +ENCODE_BINARY(UInt32) { + if(ctx->pos + sizeof(u32) > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(ctx->pos, src, sizeof(u32)); +#else + UA_encode32(*src, ctx->pos); +#endif + ctx->pos += 4; + return UA_STATUSCODE_GOOD; +} + +DECODE_BINARY(UInt32) { + if(ctx->pos + sizeof(u32) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(dst, ctx->pos, sizeof(u32)); +#else + UA_decode32(ctx->pos, dst); +#endif + ctx->pos += 4; + return UA_STATUSCODE_GOOD; +} + +/* UInt64 */ +ENCODE_BINARY(UInt64) { + if(ctx->pos + sizeof(u64) > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(ctx->pos, src, sizeof(u64)); +#else + UA_encode64(*src, ctx->pos); +#endif + ctx->pos += 8; + return UA_STATUSCODE_GOOD; +} + +DECODE_BINARY(UInt64) { + if(ctx->pos + sizeof(u64) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; +#if UA_BINARY_OVERLAYABLE_INTEGER + memcpy(dst, ctx->pos, sizeof(u64)); +#else + UA_decode64(ctx->pos, dst); +#endif + ctx->pos += 8; + return UA_STATUSCODE_GOOD; +} + +/************************/ +/* Floating Point Types */ +/************************/ + +/* Can we reuse the integer encoding mechanism by casting floating point + * values? */ +#if (UA_FLOAT_IEEE754 == 1) && (UA_LITTLE_ENDIAN == UA_FLOAT_LITTLE_ENDIAN) +# define Float_encodeBinary UInt32_encodeBinary +# define Float_decodeBinary UInt32_decodeBinary +# define Double_encodeBinary UInt64_encodeBinary +# define Double_decodeBinary UInt64_decodeBinary +#else + +#include <math.h> + +#pragma message "No native IEEE 754 format detected. Use slow generic encoding." + +/* Handling of IEEE754 floating point values was taken from Beej's Guide to + * Network Programming (http://beej.us/guide/bgnet/) and enhanced to cover the + * edge cases +/-0, +/-inf and nan. */ +static uint64_t +pack754(long double f, unsigned bits, unsigned expbits) { + unsigned significandbits = bits - expbits - 1; + long double fnorm; + long long sign; + if(f < 0) { sign = 1; fnorm = -f; } + else { sign = 0; fnorm = f; } + int shift = 0; + while(fnorm >= 2.0) { fnorm /= 2.0; ++shift; } + while(fnorm < 1.0) { fnorm *= 2.0; --shift; } + fnorm = fnorm - 1.0; + long long significand = (long long)(fnorm * ((float)(1LL<<significandbits) + 0.5f)); + long long exponent = shift + ((1<<(expbits-1)) - 1); + return (uint64_t)((sign<<(bits-1)) | (exponent<<(bits-expbits-1)) | significand); +} + +static long double +unpack754(uint64_t i, unsigned bits, unsigned expbits) { + unsigned significandbits = bits - expbits - 1; + long double result = (long double)(i&(uint64_t)((1LL<<significandbits)-1)); + result /= (1LL<<significandbits); + result += 1.0f; + unsigned bias = (unsigned)(1<<(expbits-1)) - 1; + long long shift = (long long)((i>>significandbits) & (uint64_t)((1LL<<expbits)-1)) - bias; + while(shift > 0) { result *= 2.0; --shift; } + while(shift < 0) { result /= 2.0; ++shift; } + result *= ((i>>(bits-1))&1)? -1.0: 1.0; + return result; +} + +/* Float */ +#define FLOAT_NAN 0xffc00000 +#define FLOAT_INF 0x7f800000 +#define FLOAT_NEG_INF 0xff800000 +#define FLOAT_NEG_ZERO 0x80000000 + +ENCODE_BINARY(Float) { + UA_Float f = *src; + u32 encoded; + /* cppcheck-suppress duplicateExpression */ + if(f != f) encoded = FLOAT_NAN; + else if(f == 0.0f) encoded = signbit(f) ? FLOAT_NEG_ZERO : 0; + else if(f/f != f/f) encoded = f > 0 ? FLOAT_INF : FLOAT_NEG_INF; + else encoded = (u32)pack754(f, 32, 8); + return ENCODE_DIRECT(&encoded, UInt32); +} + +DECODE_BINARY(Float) { + u32 decoded; + status ret = DECODE_DIRECT(&decoded, UInt32); + if(ret != UA_STATUSCODE_GOOD) + return ret; + if(decoded == 0) *dst = 0.0f; + else if(decoded == FLOAT_NEG_ZERO) *dst = -0.0f; + else if(decoded == FLOAT_INF) *dst = INFINITY; + else if(decoded == FLOAT_NEG_INF) *dst = -INFINITY; + else if((decoded >= 0x7f800001 && decoded <= 0x7fffffff) || + (decoded >= 0xff800001)) *dst = NAN; + else *dst = (UA_Float)unpack754(decoded, 32, 8); + return UA_STATUSCODE_GOOD; +} + +/* Double */ +#define DOUBLE_NAN 0xfff8000000000000L +#define DOUBLE_INF 0x7ff0000000000000L +#define DOUBLE_NEG_INF 0xfff0000000000000L +#define DOUBLE_NEG_ZERO 0x8000000000000000L + +ENCODE_BINARY(Double) { + UA_Double d = *src; + u64 encoded; + /* cppcheck-suppress duplicateExpression */ + if(d != d) encoded = DOUBLE_NAN; + else if(d == 0.0) encoded = signbit(d) ? DOUBLE_NEG_ZERO : 0; + else if(d/d != d/d) encoded = d > 0 ? DOUBLE_INF : DOUBLE_NEG_INF; + else encoded = pack754(d, 64, 11); + return ENCODE_DIRECT(&encoded, UInt64); +} + +DECODE_BINARY(Double) { + u64 decoded; + status ret = DECODE_DIRECT(&decoded, UInt64); + if(ret != UA_STATUSCODE_GOOD) + return ret; + if(decoded == 0) *dst = 0.0; + else if(decoded == DOUBLE_NEG_ZERO) *dst = -0.0; + else if(decoded == DOUBLE_INF) *dst = INFINITY; + else if(decoded == DOUBLE_NEG_INF) *dst = -INFINITY; + else if((decoded >= 0x7ff0000000000001L && decoded <= 0x7fffffffffffffffL) || + (decoded >= 0xfff0000000000001L)) *dst = NAN; + else *dst = (UA_Double)unpack754(decoded, 64, 11); + return UA_STATUSCODE_GOOD; +} + +#endif + +/******************/ +/* Array Handling */ +/******************/ + +static status +Array_encodeBinaryOverlayable(uintptr_t ptr, size_t memSize, Ctx *ctx) { + /* Loop as long as more elements remain than fit into the chunk */ + while(ctx->end < ctx->pos + memSize) { + size_t possible = ((uintptr_t)ctx->end - (uintptr_t)ctx->pos); + memcpy(ctx->pos, (void*)ptr, possible); + ctx->pos += possible; + ptr += possible; + status ret = exchangeBuffer(ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + memSize -= possible; + } + + /* Encode the remaining elements */ + memcpy(ctx->pos, (void*)ptr, memSize); + ctx->pos += memSize; + return UA_STATUSCODE_GOOD; +} + +static status +Array_encodeBinaryComplex(uintptr_t ptr, size_t length, + const UA_DataType *type, Ctx *ctx) { + /* Encode every element */ + for(size_t i = 0; i < length; ++i) { + status ret = encodeWithExchangeBuffer((const void*)ptr, type, ctx); + ptr += type->memSize; + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; /* Unrecoverable fail */ + } + + return UA_STATUSCODE_GOOD; +} + +static status +Array_encodeBinary(const void *src, size_t length, const UA_DataType *type, Ctx *ctx) { + /* Check and convert the array length to int32 */ + i32 signed_length = -1; + if(length > UA_INT32_MAX) + return UA_STATUSCODE_BADINTERNALERROR; + if(length > 0) + signed_length = (i32)length; + else if(src == UA_EMPTY_ARRAY_SENTINEL) + signed_length = 0; + + /* Encode the array length */ + status ret = encodeWithExchangeBuffer(&signed_length, &UA_TYPES[UA_TYPES_INT32], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD || length == 0) + return ret; + + /* Encode the content */ + if(type->overlayable) + ret = Array_encodeBinaryOverlayable((uintptr_t)src, length * type->memSize, ctx); + else + ret = Array_encodeBinaryComplex((uintptr_t)src, length, type, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +static status +Array_decodeBinary(void *UA_RESTRICT *UA_RESTRICT dst, size_t *out_length, + const UA_DataType *type, Ctx *ctx) { + /* Decode the length */ + i32 signed_length; + status ret = DECODE_DIRECT(&signed_length, UInt32); /* Int32 */ + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Return early for empty arrays */ + if(signed_length <= 0) { + *out_length = 0; + if(signed_length < 0) + *dst = NULL; + else + *dst = UA_EMPTY_ARRAY_SENTINEL; + return UA_STATUSCODE_GOOD; + } + + /* Filter out arrays that can obviously not be decoded, because the message + * is too small for the array length. This prevents the allocation of very + * long arrays for bogus messages.*/ + size_t length = (size_t)signed_length; + if(ctx->pos + ((type->memSize * length) / 32) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; + + /* Allocate memory */ + *dst = UA_calloc(length, type->memSize); + if(!*dst) + return UA_STATUSCODE_BADOUTOFMEMORY; + + if(type->overlayable) { + /* memcpy overlayable array */ + if(ctx->end < ctx->pos + (type->memSize * length)) { + UA_free(*dst); + *dst = NULL; + return UA_STATUSCODE_BADDECODINGERROR; + } + memcpy(*dst, ctx->pos, type->memSize * length); + ctx->pos += type->memSize * length; + } else { + /* Decode array members */ + uintptr_t ptr = (uintptr_t)*dst; + for(size_t i = 0; i < length; ++i) { + ret = decodeBinaryJumpTable[type->typeKind]((void*)ptr, type, ctx); + if(ret != UA_STATUSCODE_GOOD) { + /* +1 because last element is also already initialized */ + UA_Array_delete(*dst, i+1, type); + *dst = NULL; + return ret; + } + ptr += type->memSize; + } + } + *out_length = length; + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* Builtin Types */ +/*****************/ + +ENCODE_BINARY(String) { + return Array_encodeBinary(src->data, src->length, &UA_TYPES[UA_TYPES_BYTE], ctx); +} + +DECODE_BINARY(String) { + return Array_decodeBinary((void**)&dst->data, &dst->length, &UA_TYPES[UA_TYPES_BYTE], ctx); +} + +/* Guid */ +ENCODE_BINARY(Guid) { + status ret = UA_STATUSCODE_GOOD; + ret |= ENCODE_DIRECT(&src->data1, UInt32); + ret |= ENCODE_DIRECT(&src->data2, UInt16); + ret |= ENCODE_DIRECT(&src->data3, UInt16); + if(ctx->pos + (8*sizeof(u8)) > ctx->end) + return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; + memcpy(ctx->pos, src->data4, 8*sizeof(u8)); + ctx->pos += 8; + return ret; +} + +DECODE_BINARY(Guid) { + status ret = UA_STATUSCODE_GOOD; + ret |= DECODE_DIRECT(&dst->data1, UInt32); + ret |= DECODE_DIRECT(&dst->data2, UInt16); + ret |= DECODE_DIRECT(&dst->data3, UInt16); + if(ctx->pos + (8*sizeof(u8)) > ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; + memcpy(dst->data4, ctx->pos, 8*sizeof(u8)); + ctx->pos += 8; + return ret; +} + +/* NodeId */ +#define UA_NODEIDTYPE_NUMERIC_TWOBYTE 0u +#define UA_NODEIDTYPE_NUMERIC_FOURBYTE 1u +#define UA_NODEIDTYPE_NUMERIC_COMPLETE 2u + +#define UA_EXPANDEDNODEID_SERVERINDEX_FLAG 0x40u +#define UA_EXPANDEDNODEID_NAMESPACEURI_FLAG 0x80u + +/* For ExpandedNodeId, we prefill the encoding mask. */ +static status +NodeId_encodeBinaryWithEncodingMask(UA_NodeId const *src, u8 encoding, Ctx *ctx) { + status ret = UA_STATUSCODE_GOOD; + switch(src->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + if(src->identifier.numeric > UA_UINT16_MAX || src->namespaceIndex > UA_BYTE_MAX) { + encoding |= UA_NODEIDTYPE_NUMERIC_COMPLETE; + ret |= ENCODE_DIRECT(&encoding, Byte); + ret |= ENCODE_DIRECT(&src->namespaceIndex, UInt16); + ret |= ENCODE_DIRECT(&src->identifier.numeric, UInt32); + } else if(src->identifier.numeric > UA_BYTE_MAX || src->namespaceIndex > 0) { + encoding |= UA_NODEIDTYPE_NUMERIC_FOURBYTE; + ret |= ENCODE_DIRECT(&encoding, Byte); + u8 nsindex = (u8)src->namespaceIndex; + ret |= ENCODE_DIRECT(&nsindex, Byte); + u16 identifier16 = (u16)src->identifier.numeric; + ret |= ENCODE_DIRECT(&identifier16, UInt16); + } else { + encoding |= UA_NODEIDTYPE_NUMERIC_TWOBYTE; + ret |= ENCODE_DIRECT(&encoding, Byte); + u8 identifier8 = (u8)src->identifier.numeric; + ret |= ENCODE_DIRECT(&identifier8, Byte); + } + break; + case UA_NODEIDTYPE_STRING: + encoding |= (u8)UA_NODEIDTYPE_STRING; + ret |= ENCODE_DIRECT(&encoding, Byte); + ret |= ENCODE_DIRECT(&src->namespaceIndex, UInt16); + if(ret != UA_STATUSCODE_GOOD) + return ret; + /* Can exchange the buffer */ + ret = ENCODE_DIRECT(&src->identifier.string, String); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + break; + case UA_NODEIDTYPE_GUID: + encoding |= (u8)UA_NODEIDTYPE_GUID; + ret |= ENCODE_DIRECT(&encoding, Byte); + ret |= ENCODE_DIRECT(&src->namespaceIndex, UInt16); + ret |= ENCODE_DIRECT(&src->identifier.guid, Guid); + break; + case UA_NODEIDTYPE_BYTESTRING: + encoding |= (u8)UA_NODEIDTYPE_BYTESTRING; + ret |= ENCODE_DIRECT(&encoding, Byte); + ret |= ENCODE_DIRECT(&src->namespaceIndex, UInt16); + if(ret != UA_STATUSCODE_GOOD) + return ret; + /* Can exchange the buffer */ + ret = ENCODE_DIRECT(&src->identifier.byteString, String); /* ByteString */ + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + break; + default: + return UA_STATUSCODE_BADINTERNALERROR; + } + return ret; +} + +ENCODE_BINARY(NodeId) { + return NodeId_encodeBinaryWithEncodingMask(src, 0, ctx); +} + +DECODE_BINARY(NodeId) { + u8 dstByte = 0, encodingByte = 0; + u16 dstUInt16 = 0; + + /* Decode the encoding bitfield */ + status ret = DECODE_DIRECT(&encodingByte, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Filter out the bits used only for ExpandedNodeIds */ + encodingByte &= (u8)~(u8)(UA_EXPANDEDNODEID_SERVERINDEX_FLAG | + UA_EXPANDEDNODEID_NAMESPACEURI_FLAG); + + /* Decode the namespace and identifier */ + switch(encodingByte) { + case UA_NODEIDTYPE_NUMERIC_TWOBYTE: + dst->identifierType = UA_NODEIDTYPE_NUMERIC; + ret = DECODE_DIRECT(&dstByte, Byte); + dst->identifier.numeric = dstByte; + dst->namespaceIndex = 0; + break; + case UA_NODEIDTYPE_NUMERIC_FOURBYTE: + dst->identifierType = UA_NODEIDTYPE_NUMERIC; + ret |= DECODE_DIRECT(&dstByte, Byte); + dst->namespaceIndex = dstByte; + ret |= DECODE_DIRECT(&dstUInt16, UInt16); + dst->identifier.numeric = dstUInt16; + break; + case UA_NODEIDTYPE_NUMERIC_COMPLETE: + dst->identifierType = UA_NODEIDTYPE_NUMERIC; + ret |= DECODE_DIRECT(&dst->namespaceIndex, UInt16); + ret |= DECODE_DIRECT(&dst->identifier.numeric, UInt32); + break; + case UA_NODEIDTYPE_STRING: + dst->identifierType = UA_NODEIDTYPE_STRING; + ret |= DECODE_DIRECT(&dst->namespaceIndex, UInt16); + ret |= DECODE_DIRECT(&dst->identifier.string, String); + break; + case UA_NODEIDTYPE_GUID: + dst->identifierType = UA_NODEIDTYPE_GUID; + ret |= DECODE_DIRECT(&dst->namespaceIndex, UInt16); + ret |= DECODE_DIRECT(&dst->identifier.guid, Guid); + break; + case UA_NODEIDTYPE_BYTESTRING: + dst->identifierType = UA_NODEIDTYPE_BYTESTRING; + ret |= DECODE_DIRECT(&dst->namespaceIndex, UInt16); + ret |= DECODE_DIRECT(&dst->identifier.byteString, String); /* ByteString */ + break; + default: + ret |= UA_STATUSCODE_BADINTERNALERROR; + break; + } + return ret; +} + +/* ExpandedNodeId */ +ENCODE_BINARY(ExpandedNodeId) { + /* Set up the encoding mask */ + u8 encoding = 0; + if((void*)src->namespaceUri.data > UA_EMPTY_ARRAY_SENTINEL) + encoding |= UA_EXPANDEDNODEID_NAMESPACEURI_FLAG; + if(src->serverIndex > 0) + encoding |= UA_EXPANDEDNODEID_SERVERINDEX_FLAG; + + /* Encode the NodeId. Can exchange the buffer. */ + status ret = NodeId_encodeBinaryWithEncodingMask(&src->nodeId, encoding, ctx); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the namespace. Internally uses encodeWithExchangeBuffer + * everywhere. So it will never return + * UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED. */ + if((void*)src->namespaceUri.data > UA_EMPTY_ARRAY_SENTINEL) { + ret = ENCODE_DIRECT(&src->namespaceUri, String); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + } + + /* Encode the serverIndex */ + if(src->serverIndex > 0) + ret = encodeWithExchangeBuffer(&src->serverIndex, &UA_TYPES[UA_TYPES_UINT32], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +DECODE_BINARY(ExpandedNodeId) { + /* Decode the encoding mask */ + if(ctx->pos >= ctx->end) + return UA_STATUSCODE_BADDECODINGERROR; + u8 encoding = *ctx->pos; + + /* Decode the NodeId */ + status ret = DECODE_DIRECT(&dst->nodeId, NodeId); + + /* Decode the NamespaceUri */ + if(encoding & UA_EXPANDEDNODEID_NAMESPACEURI_FLAG) { + dst->nodeId.namespaceIndex = 0; + ret |= DECODE_DIRECT(&dst->namespaceUri, String); + } + + /* Decode the ServerIndex */ + if(encoding & UA_EXPANDEDNODEID_SERVERINDEX_FLAG) + ret |= DECODE_DIRECT(&dst->serverIndex, UInt32); + return ret; +} + +/* QualifiedName */ +ENCODE_BINARY(QualifiedName) { + status ret = ENCODE_DIRECT(&src->namespaceIndex, UInt16); + if(ret != UA_STATUSCODE_GOOD) + return ret; + ret |= ENCODE_DIRECT(&src->name, String); + return ret; +} + +DECODE_BINARY(QualifiedName) { + status ret = DECODE_DIRECT(&dst->namespaceIndex, UInt16); + ret |= DECODE_DIRECT(&dst->name, String); + return ret; +} + +/* LocalizedText */ +#define UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE 0x01u +#define UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_TEXT 0x02u + +ENCODE_BINARY(LocalizedText) { + /* Set up the encoding mask */ + u8 encoding = 0; + if(src->locale.data) + encoding |= UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE; + if(src->text.data) + encoding |= UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_TEXT; + + /* Encode the encoding byte */ + status ret = ENCODE_DIRECT(&encoding, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the strings */ + if(encoding & UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE) + ret |= ENCODE_DIRECT(&src->locale, String); + if(encoding & UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_TEXT) + ret |= ENCODE_DIRECT(&src->text, String); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +DECODE_BINARY(LocalizedText) { + /* Decode the encoding mask */ + u8 encoding = 0; + status ret = DECODE_DIRECT(&encoding, Byte); + + /* Decode the content */ + if(encoding & UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE) + ret |= DECODE_DIRECT(&dst->locale, String); + if(encoding & UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_TEXT) + ret |= DECODE_DIRECT(&dst->text, String); + return ret; +} + +/* The binary encoding has a different nodeid from the data type. So it is not + * possible to reuse UA_findDataType */ +static const UA_DataType * +UA_findDataTypeByBinaryInternal(const UA_NodeId *typeId, Ctx *ctx) { + /* Always look in the built-in types first. Assume that only numeric + * identifiers are used for the builtin types. (They may contain data types + * from all namespaces though.) */ + if(typeId->identifierType == UA_NODEIDTYPE_NUMERIC) { + for(size_t i = 0; i < UA_TYPES_COUNT; ++i) { + if(UA_TYPES[i].binaryEncodingId.identifier.numeric == typeId->identifier.numeric && + UA_TYPES[i].binaryEncodingId.namespaceIndex == typeId->namespaceIndex) + return &UA_TYPES[i]; + } + } + + const UA_DataTypeArray *customTypes = ctx->customTypes; + while(customTypes) { + for(size_t i = 0; i < customTypes->typesSize; ++i) { + if(UA_NodeId_equal(typeId, &customTypes->types[i].binaryEncodingId)) + return &customTypes->types[i]; + } + customTypes = customTypes->next; + } + + return NULL; +} + +const UA_DataType * +UA_findDataTypeByBinary(const UA_NodeId *typeId) { + Ctx ctx; + ctx.customTypes = NULL; + return UA_findDataTypeByBinaryInternal(typeId, &ctx); +} + +/* ExtensionObject */ +ENCODE_BINARY(ExtensionObject) { + u8 encoding = (u8)src->encoding; + + /* No content or already encoded content. */ + if(encoding <= UA_EXTENSIONOBJECT_ENCODED_XML) { + /* Can exchange the buffer */ + status ret = ENCODE_DIRECT(&src->content.encoded.typeId, NodeId); + if(ret != UA_STATUSCODE_GOOD) + return ret; + ret = encodeWithExchangeBuffer(&encoding, &UA_TYPES[UA_TYPES_BYTE], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + switch(src->encoding) { + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + break; + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + case UA_EXTENSIONOBJECT_ENCODED_XML: + /* ByteString in disguise. Array encoding can exchange the buffer */ + ret = ENCODE_DIRECT(&src->content.encoded.body, String); + break; + default: + ret = UA_STATUSCODE_BADINTERNALERROR; + } + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; + } + + /* Cannot encode with no data or no type description */ + if(!src->content.decoded.type || !src->content.decoded.data) + return UA_STATUSCODE_BADENCODINGERROR; + + /* Write the NodeId for the binary encoded type. This could perform a buffer + * exchange, but can also return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED. */ + status ret = ENCODE_DIRECT(&src->content.decoded.type->binaryEncodingId, NodeId); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the encoding byte */ + encoding = UA_EXTENSIONOBJECT_ENCODED_BYTESTRING; + ret = encodeWithExchangeBuffer(&encoding, &UA_TYPES[UA_TYPES_BYTE], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the content length */ + const UA_DataType *contentType = src->content.decoded.type; + size_t len = UA_calcSizeBinary(src->content.decoded.data, contentType); + if(len > UA_INT32_MAX) + return UA_STATUSCODE_BADENCODINGERROR; + i32 signed_len = (i32)len; + ret = encodeWithExchangeBuffer(&signed_len, &UA_TYPES[UA_TYPES_INT32], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the content */ + ret = encodeWithExchangeBuffer(src->content.decoded.data, contentType, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +static status +ExtensionObject_decodeBinaryContent(UA_ExtensionObject *dst, const UA_NodeId *typeId, + Ctx *ctx) { + /* Lookup the datatype */ + const UA_DataType *type = UA_findDataTypeByBinaryInternal(typeId, ctx); + + /* Unknown type, just take the binary content */ + if(!type) { + dst->encoding = UA_EXTENSIONOBJECT_ENCODED_BYTESTRING; + UA_NodeId_copy(typeId, &dst->content.encoded.typeId); + return DECODE_DIRECT(&dst->content.encoded.body, String); /* ByteString */ + } + + /* Allocate memory */ + dst->content.decoded.data = UA_new(type); + if(!dst->content.decoded.data) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Jump over the length field (TODO: check if the decoded length matches) */ + ctx->pos += 4; + + /* Decode */ + dst->encoding = UA_EXTENSIONOBJECT_DECODED; + dst->content.decoded.type = type; + return decodeBinaryJumpTable[type->typeKind](dst->content.decoded.data, type, ctx); +} + +DECODE_BINARY(ExtensionObject) { + u8 encoding = 0; + UA_NodeId binTypeId; + UA_NodeId_init(&binTypeId); + + status ret = UA_STATUSCODE_GOOD; + ret |= DECODE_DIRECT(&binTypeId, NodeId); + ret |= DECODE_DIRECT(&encoding, Byte); + if(ret != UA_STATUSCODE_GOOD) { + UA_NodeId_clear(&binTypeId); + return ret; + } + + switch(encoding) { + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + ret = ExtensionObject_decodeBinaryContent(dst, &binTypeId, ctx); + UA_NodeId_clear(&binTypeId); + break; + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + dst->encoding = (UA_ExtensionObjectEncoding)encoding; + dst->content.encoded.typeId = binTypeId; /* move to dst */ + dst->content.encoded.body = UA_BYTESTRING_NULL; + break; + case UA_EXTENSIONOBJECT_ENCODED_XML: + dst->encoding = (UA_ExtensionObjectEncoding)encoding; + dst->content.encoded.typeId = binTypeId; /* move to dst */ + ret = DECODE_DIRECT(&dst->content.encoded.body, String); /* ByteString */ + if(ret != UA_STATUSCODE_GOOD) + UA_NodeId_clear(&dst->content.encoded.typeId); + break; + default: + UA_NodeId_clear(&binTypeId); + ret = UA_STATUSCODE_BADDECODINGERROR; + break; + } + + return ret; +} + +/* Variant */ + +static status +Variant_encodeBinaryWrapExtensionObject(const UA_Variant *src, + const UA_Boolean isArray, Ctx *ctx) { + size_t length = 1; /* Default to 1 for a scalar. */ + + /* Encode the array length if required */ + status ret = UA_STATUSCODE_GOOD; + if(isArray) { + if(src->arrayLength > UA_INT32_MAX) + return UA_STATUSCODE_BADENCODINGERROR; + length = src->arrayLength; + i32 encodedLength = (i32)src->arrayLength; + ret = ENCODE_DIRECT(&encodedLength, UInt32); /* Int32 */ + if(ret != UA_STATUSCODE_GOOD) + return ret; + } + + /* Set up the ExtensionObject */ + UA_ExtensionObject eo; + UA_ExtensionObject_init(&eo); + eo.encoding = UA_EXTENSIONOBJECT_DECODED; + eo.content.decoded.type = src->type; + const u16 memSize = src->type->memSize; + uintptr_t ptr = (uintptr_t)src->data; + + /* Iterate over the array */ + for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) { + eo.content.decoded.data = (void*)ptr; + ret = encodeWithExchangeBuffer(&eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + ptr += memSize; + } + return ret; +} + +enum UA_VARIANT_ENCODINGMASKTYPE { + UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK = 0x3Fu, /* bits 0:5 */ + UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS = (u8)(0x01u << 6u), /* bit 6 */ + UA_VARIANT_ENCODINGMASKTYPE_ARRAY = (u8)(0x01u << 7u) /* bit 7 */ +}; + +ENCODE_BINARY(Variant) { + /* Quit early for the empty variant */ + u8 encoding = 0; + if(!src->type) + return ENCODE_DIRECT(&encoding, Byte); + + /* Set the content type in the encoding mask */ + const UA_Boolean isBuiltin = (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO); + const UA_Boolean isEnum = (src->type->typeKind == UA_DATATYPEKIND_ENUM); + if(isBuiltin) + encoding = (u8)(encoding | (u8)((u8)UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK & (u8)(src->type->typeKind + 1u))); + else if(isEnum) + encoding = (u8)(encoding | (u8)((u8)UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK & (u8)(UA_TYPES_INT32 + 1u))); + else + encoding = (u8)(encoding | (u8)((u8)UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK & (u8)(UA_TYPES_EXTENSIONOBJECT + 1u))); + + /* Set the array type in the encoding mask */ + const UA_Boolean isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL; + const UA_Boolean hasDimensions = isArray && src->arrayDimensionsSize > 0; + if(isArray) { + encoding |= (u8)UA_VARIANT_ENCODINGMASKTYPE_ARRAY; + if(hasDimensions) + encoding |= (u8)UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS; + } + + /* Encode the encoding byte */ + status ret = ENCODE_DIRECT(&encoding, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the content. This can exchange the buffer. */ + if(!isBuiltin && !isEnum) { + /* This could return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED. But we + * have not exchanged the buffer so far. */ + ret = Variant_encodeBinaryWrapExtensionObject(src, isArray, ctx); + } else if(!isArray) { + ret = encodeWithExchangeBuffer(src->data, src->type, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + } else { + ret = Array_encodeBinary(src->data, src->arrayLength, src->type, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + } + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the array dimensions */ + if(hasDimensions && ret == UA_STATUSCODE_GOOD) + ret = Array_encodeBinary(src->arrayDimensions, src->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_INT32], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +static status +Variant_decodeBinaryUnwrapExtensionObject(UA_Variant *dst, Ctx *ctx) { + /* Save the position in the ByteString. If unwrapping is not possible, start + * from here to decode a normal ExtensionObject. */ + u8 *old_pos = ctx->pos; + + /* Decode the DataType */ + UA_NodeId typeId; + UA_NodeId_init(&typeId); + status ret = DECODE_DIRECT(&typeId, NodeId); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Decode the EncodingByte */ + u8 encoding; + ret = DECODE_DIRECT(&encoding, Byte); + if(ret != UA_STATUSCODE_GOOD) { + UA_NodeId_clear(&typeId); + return ret; + } + + /* Search for the datatype. Default to ExtensionObject. */ + if(encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING && + (dst->type = UA_findDataTypeByBinaryInternal(&typeId, ctx)) != NULL) { + /* Jump over the length field (TODO: check if length matches) */ + ctx->pos += 4; + } else { + /* Reset and decode as ExtensionObject */ + dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]; + ctx->pos = old_pos; + UA_NodeId_clear(&typeId); + } + + /* Allocate memory */ + dst->data = UA_new(dst->type); + if(!dst->data) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Decode the content */ + return decodeBinaryJumpTable[dst->type->typeKind](dst->data, dst->type, ctx); +} + +/* The resulting variant always has the storagetype UA_VARIANT_DATA. */ +DECODE_BINARY(Variant) { + /* Decode the encoding byte */ + u8 encodingByte; + status ret = DECODE_DIRECT(&encodingByte, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Return early for an empty variant (was already _inited) */ + if(encodingByte == 0) + return UA_STATUSCODE_GOOD; + + /* Does the variant contain an array? */ + const UA_Boolean isArray = (encodingByte & (u8)UA_VARIANT_ENCODINGMASKTYPE_ARRAY) > 0; + + /* Get the datatype of the content. The type must be a builtin data type. + * All not-builtin types are wrapped in an ExtensionObject. The "type kind" + * for types up to DiagnsticInfo equals to the index in the encoding + * byte. */ + size_t typeKind = (size_t)((encodingByte & (u8)UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK) - 1); + if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO) + return UA_STATUSCODE_BADDECODINGERROR; + + /* A variant cannot contain a variant. But it can contain an array of + * variants */ + if(typeKind == UA_DATATYPEKIND_VARIANT && !isArray) + return UA_STATUSCODE_BADDECODINGERROR; + + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + /* Decode the content */ + dst->type = &UA_TYPES[typeKind]; + if(isArray) { + ret = Array_decodeBinary(&dst->data, &dst->arrayLength, dst->type, ctx); + } else if(typeKind != UA_DATATYPEKIND_EXTENSIONOBJECT) { + dst->data = UA_new(dst->type); + if(!dst->data) { + ctx->depth--; + return UA_STATUSCODE_BADOUTOFMEMORY; + } + ret = decodeBinaryJumpTable[typeKind](dst->data, dst->type, ctx); + } else { + ret = Variant_decodeBinaryUnwrapExtensionObject(dst, ctx); + } + + /* Decode array dimensions */ + if(isArray && (encodingByte & (u8)UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS) > 0) + ret |= Array_decodeBinary((void**)&dst->arrayDimensions, &dst->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_INT32], ctx); + + ctx->depth--; + return ret; +} + +/* DataValue */ +ENCODE_BINARY(DataValue) { + /* Set up the encoding mask */ + u8 encodingMask = src->hasValue; + encodingMask |= (u8)(src->hasStatus << 1u); + encodingMask |= (u8)(src->hasSourceTimestamp << 2u); + encodingMask |= (u8)(src->hasServerTimestamp << 3u); + encodingMask |= (u8)(src->hasSourcePicoseconds << 4u); + encodingMask |= (u8)(src->hasServerPicoseconds << 5u); + + /* Encode the encoding byte */ + status ret = ENCODE_DIRECT(&encodingMask, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the variant. */ + if(src->hasValue) { + ret = ENCODE_DIRECT(&src->value, Variant); + if(ret != UA_STATUSCODE_GOOD) + return ret; + } + + if(src->hasStatus) + ret |= encodeWithExchangeBuffer(&src->status, &UA_TYPES[UA_TYPES_STATUSCODE], ctx); + if(src->hasSourceTimestamp) + ret |= encodeWithExchangeBuffer(&src->sourceTimestamp, &UA_TYPES[UA_TYPES_DATETIME], ctx); + if(src->hasSourcePicoseconds) + ret |= encodeWithExchangeBuffer(&src->sourcePicoseconds, &UA_TYPES[UA_TYPES_UINT16], ctx); + if(src->hasServerTimestamp) + ret |= encodeWithExchangeBuffer(&src->serverTimestamp, &UA_TYPES[UA_TYPES_DATETIME], ctx); + if(src->hasServerPicoseconds) + ret |= encodeWithExchangeBuffer(&src->serverPicoseconds, &UA_TYPES[UA_TYPES_UINT16], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + return ret; +} + +#define MAX_PICO_SECONDS 9999 + +DECODE_BINARY(DataValue) { + /* Decode the encoding mask */ + u8 encodingMask; + status ret = DECODE_DIRECT(&encodingMask, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + /* Decode the content */ + if(encodingMask & 0x01u) { + dst->hasValue = true; + ret |= DECODE_DIRECT(&dst->value, Variant); + } + if(encodingMask & 0x02u) { + dst->hasStatus = true; + ret |= DECODE_DIRECT(&dst->status, UInt32); /* StatusCode */ + } + if(encodingMask & 0x04u) { + dst->hasSourceTimestamp = true; + ret |= DECODE_DIRECT(&dst->sourceTimestamp, UInt64); /* DateTime */ + } + if(encodingMask & 0x10u) { + dst->hasSourcePicoseconds = true; + ret |= DECODE_DIRECT(&dst->sourcePicoseconds, UInt16); + if(dst->sourcePicoseconds > MAX_PICO_SECONDS) + dst->sourcePicoseconds = MAX_PICO_SECONDS; + } + if(encodingMask & 0x08u) { + dst->hasServerTimestamp = true; + ret |= DECODE_DIRECT(&dst->serverTimestamp, UInt64); /* DateTime */ + } + if(encodingMask & 0x20u) { + dst->hasServerPicoseconds = true; + ret |= DECODE_DIRECT(&dst->serverPicoseconds, UInt16); + if(dst->serverPicoseconds > MAX_PICO_SECONDS) + dst->serverPicoseconds = MAX_PICO_SECONDS; + } + + ctx->depth--; + + return ret; +} + +/* DiagnosticInfo */ +ENCODE_BINARY(DiagnosticInfo) { + /* Set up the encoding mask */ + u8 encodingMask = src->hasSymbolicId; + encodingMask |= (u8)(src->hasNamespaceUri << 1u); + encodingMask |= (u8)(src->hasLocalizedText << 2u); + encodingMask |= (u8)(src->hasLocale << 3u); + encodingMask |= (u8)(src->hasAdditionalInfo << 4u); + encodingMask |= (u8)(src->hasInnerStatusCode << 5u); + encodingMask |= (u8)(src->hasInnerDiagnosticInfo << 6u); + + /* Encode the numeric content */ + status ret = ENCODE_DIRECT(&encodingMask, Byte); + if(src->hasSymbolicId) + ret |= ENCODE_DIRECT(&src->symbolicId, UInt32); /* Int32 */ + if(src->hasNamespaceUri) + ret |= ENCODE_DIRECT(&src->namespaceUri, UInt32); /* Int32 */ + if(src->hasLocalizedText) + ret |= ENCODE_DIRECT(&src->localizedText, UInt32); /* Int32 */ + if(src->hasLocale) + ret |= ENCODE_DIRECT(&src->locale, UInt32); /* Int32 */ + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Encode the additional info. Can exchange the buffer. */ + if(src->hasAdditionalInfo) { + ret = ENCODE_DIRECT(&src->additionalInfo, String); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + } + + /* Encode the inner status code */ + if(src->hasInnerStatusCode) { + ret = encodeWithExchangeBuffer(&src->innerStatusCode, &UA_TYPES[UA_TYPES_UINT32], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + if(ret != UA_STATUSCODE_GOOD) + return ret; + } + + /* Encode the inner diagnostic info */ + if(src->hasInnerDiagnosticInfo) { + ret = encodeWithExchangeBuffer(src->innerDiagnosticInfo, + &UA_TYPES[UA_TYPES_DIAGNOSTICINFO], ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + } + + return ret; +} + +DECODE_BINARY(DiagnosticInfo) { + /* Decode the encoding mask */ + u8 encodingMask; + status ret = DECODE_DIRECT(&encodingMask, Byte); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* Decode the content */ + if(encodingMask & 0x01u) { + dst->hasSymbolicId = true; + ret |= DECODE_DIRECT(&dst->symbolicId, UInt32); /* Int32 */ + } + if(encodingMask & 0x02u) { + dst->hasNamespaceUri = true; + ret |= DECODE_DIRECT(&dst->namespaceUri, UInt32); /* Int32 */ + } + if(encodingMask & 0x04u) { + dst->hasLocalizedText = true; + ret |= DECODE_DIRECT(&dst->localizedText, UInt32); /* Int32 */ + } + if(encodingMask & 0x08u) { + dst->hasLocale = true; + ret |= DECODE_DIRECT(&dst->locale, UInt32); /* Int32 */ + } + if(encodingMask & 0x10u) { + dst->hasAdditionalInfo = true; + ret |= DECODE_DIRECT(&dst->additionalInfo, String); + } + if(encodingMask & 0x20u) { + dst->hasInnerStatusCode = true; + ret |= DECODE_DIRECT(&dst->innerStatusCode, UInt32); /* StatusCode */ + } + if(encodingMask & 0x40u) { + /* innerDiagnosticInfo is allocated on the heap */ + dst->innerDiagnosticInfo = (UA_DiagnosticInfo*) + UA_calloc(1, sizeof(UA_DiagnosticInfo)); + if(!dst->innerDiagnosticInfo) + return UA_STATUSCODE_BADOUTOFMEMORY; + dst->hasInnerDiagnosticInfo = true; + + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + + ctx->depth++; + ret |= DECODE_DIRECT(dst->innerDiagnosticInfo, DiagnosticInfo); + ctx->depth--; + } + return ret; +} + +/********************/ +/* Structured Types */ +/********************/ + +static status +encodeBinaryStruct(const void *src, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + /* Loop over members */ + uintptr_t ptr = (uintptr_t)src; + status ret = UA_STATUSCODE_GOOD; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + for(size_t i = 0; i < type->membersSize && ret == UA_STATUSCODE_GOOD; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + + /* Array. Buffer-exchange is done inside Array_encodeBinary if required. */ + if(m->isArray) { + const size_t length = *((const size_t*)ptr); + ptr += sizeof(size_t); + ret = Array_encodeBinary(*(void *UA_RESTRICT const *)ptr, length, mt, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + ptr += sizeof(void*); + continue; + } + + /* Scalar */ + ret = encodeWithExchangeBuffer((const void*)ptr, mt, ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + ptr += mt->memSize; + } + + ctx->depth--; + return ret; +} + +static status +encodeBinaryStructWithOptFields(const void *src, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + + /* Creating the encoding mask, marking the available optional fields */ + uintptr_t ptr = (uintptr_t)src; + size_t optFieldCounter = 0; + UA_UInt32 encodingMask = 0; + for(size_t j = 0; j < type->membersSize; ++j) { + const UA_DataTypeMember *m = &type->members[j]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + if(m->isOptional) { + if(m->isArray) + ptr += sizeof(size_t); + if(*(void* const*)ptr != NULL) + encodingMask |= (UA_UInt32) 1 << optFieldCounter; + ptr += sizeof(void *); + optFieldCounter++; + } else { + if(m->isArray) + ptr += sizeof(size_t); + ptr += mt->memSize; + } + } + + /* Encode the mask */ + status ret = ENCODE_DIRECT(&encodingMask, UInt32); + if(ret != UA_STATUSCODE_GOOD) { + ctx->depth--; + return ret; + } + + /* Loop over members */ + ptr = (uintptr_t)src; + for(size_t i = 0, o = 0; i < type->membersSize && ret == UA_STATUSCODE_GOOD; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + + if(m->isOptional) { + if(!(encodingMask & (UA_UInt32) ( (UA_UInt32) 1<<(o++)))) { + /* Optional and not contained */ + if(m->isArray) + ptr += sizeof(size_t); + } else if(m->isArray) { + /* Optional Array */ + const size_t length = *((const size_t *) ptr); + ptr += sizeof(size_t); + ret = Array_encodeBinary(*(void *UA_RESTRICT const *) ptr, length, mt, ctx); + } else { + /* Optional Scalar */ + ret = encodeWithExchangeBuffer(*(void* const*) ptr, mt, ctx); + } + ptr += sizeof(void *); + continue; + } + + /* Mandatory Array */ + if(m->isArray) { + const size_t length = *((const size_t *) ptr); + ptr += sizeof(size_t); + ret = Array_encodeBinary(*(void *UA_RESTRICT const *) ptr, length, mt, ctx); + ptr += sizeof(void *); + continue; + } + + /* Mandatory Scalar */ + ret = encodeWithExchangeBuffer((const void*)ptr, mt, ctx); + ptr += mt->memSize; + } + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + + ctx->depth--; + return ret; +} + +static status +encodeBinaryUnion(const void *src, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + /* Encode the selection */ + const UA_UInt32 selection = *(const UA_UInt32*)src; + status ret = ENCODE_DIRECT(&selection, UInt32); + if(ret != UA_STATUSCODE_GOOD || selection == 0) { + ctx->depth--; + return ret; + } + + /* Select the member */ + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + const UA_DataTypeMember *m = &type->members[selection-1]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + + /* Encode the member */ + uintptr_t ptr = ((uintptr_t)src) + m->padding; /* includes the switchfield length */ + if(!m->isArray) { + ret = encodeWithExchangeBuffer((const void*)ptr, mt, ctx); + } else { + const size_t length = *((const size_t*)ptr); + ptr += sizeof(size_t); + ret = Array_encodeBinary(*(void *UA_RESTRICT const *)ptr, length, mt, ctx); + } + + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + + ctx->depth--; + return ret; +} + +static status +encodeBinaryNotImplemented(const void *src, const UA_DataType *type, Ctx *ctx) { + (void)src, (void)type, (void)ctx; + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +const encodeBinarySignature encodeBinaryJumpTable[UA_DATATYPEKINDS] = { + (encodeBinarySignature)Boolean_encodeBinary, + (encodeBinarySignature)Byte_encodeBinary, /* SByte */ + (encodeBinarySignature)Byte_encodeBinary, + (encodeBinarySignature)UInt16_encodeBinary, /* Int16 */ + (encodeBinarySignature)UInt16_encodeBinary, + (encodeBinarySignature)UInt32_encodeBinary, /* Int32 */ + (encodeBinarySignature)UInt32_encodeBinary, + (encodeBinarySignature)UInt64_encodeBinary, /* Int64 */ + (encodeBinarySignature)UInt64_encodeBinary, + (encodeBinarySignature)Float_encodeBinary, + (encodeBinarySignature)Double_encodeBinary, + (encodeBinarySignature)String_encodeBinary, + (encodeBinarySignature)UInt64_encodeBinary, /* DateTime */ + (encodeBinarySignature)Guid_encodeBinary, + (encodeBinarySignature)String_encodeBinary, /* ByteString */ + (encodeBinarySignature)String_encodeBinary, /* XmlElement */ + (encodeBinarySignature)NodeId_encodeBinary, + (encodeBinarySignature)ExpandedNodeId_encodeBinary, + (encodeBinarySignature)UInt32_encodeBinary, /* StatusCode */ + (encodeBinarySignature)QualifiedName_encodeBinary, + (encodeBinarySignature)LocalizedText_encodeBinary, + (encodeBinarySignature)ExtensionObject_encodeBinary, + (encodeBinarySignature)DataValue_encodeBinary, + (encodeBinarySignature)Variant_encodeBinary, + (encodeBinarySignature)DiagnosticInfo_encodeBinary, + (encodeBinarySignature)encodeBinaryNotImplemented, /* Decimal */ + (encodeBinarySignature)UInt32_encodeBinary, /* Enumeration */ + (encodeBinarySignature)encodeBinaryStruct, + (encodeBinarySignature)encodeBinaryStructWithOptFields, /* Structure with Optional Fields */ + (encodeBinarySignature)encodeBinaryUnion, /* Union */ + (encodeBinarySignature)encodeBinaryStruct /* BitfieldCluster */ +}; + +status +UA_encodeBinary(const void *src, const UA_DataType *type, + u8 **bufPos, const u8 **bufEnd, + UA_exchangeEncodeBuffer exchangeCallback, void *exchangeHandle) { + /* Set up the context */ + Ctx ctx; + ctx.pos = *bufPos; + ctx.end = *bufEnd; + ctx.depth = 0; + ctx.exchangeBufferCallback = exchangeCallback; + ctx.exchangeBufferCallbackHandle = exchangeHandle; + + if(!ctx.pos) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Encode */ + status ret = encodeWithExchangeBuffer(src, type, &ctx); + UA_assert(ret != UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED); + + /* Set the new buffer position for the output. Beware that the buffer might + * have been exchanged internally. */ + *bufPos = ctx.pos; + *bufEnd = ctx.end; + return ret; +} + +static status +decodeBinaryNotImplemented(void *dst, const UA_DataType *type, Ctx *ctx) { + (void)dst, (void)type, (void)ctx; + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +static status +decodeBinaryStructure(void *dst, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + uintptr_t ptr = (uintptr_t)dst; + status ret = UA_STATUSCODE_GOOD; + u8 membersSize = type->membersSize; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + + /* Loop over members */ + for(size_t i = 0; i < membersSize && ret == UA_STATUSCODE_GOOD; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + + /* Array */ + if(m->isArray) { + size_t *length = (size_t*)ptr; + ptr += sizeof(size_t); + ret = Array_decodeBinary((void *UA_RESTRICT *UA_RESTRICT)ptr, length, mt , ctx); + ptr += sizeof(void*); + continue; + } + + /* Scalar */ + ret = decodeBinaryJumpTable[mt->typeKind]((void *UA_RESTRICT)ptr, mt, ctx); + ptr += mt->memSize; + } + + ctx->depth--; + return ret; +} + +static status +decodeBinaryStructureWithOptFields(void *dst, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx == NULL || ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + ctx->depth++; + + uintptr_t ptr = (uintptr_t)dst; + UA_UInt32 encodingMask = 0; + status ret = UInt32_decodeBinary(&encodingMask, &UA_TYPES[UA_TYPES_UINT32], ctx); + if(ret != UA_STATUSCODE_GOOD) { + ctx->depth--; + return ret; + } + + /* Loop over members */ + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + for(size_t i = 0, o = 0; i < type->membersSize && ret == UA_STATUSCODE_GOOD; ++i) { + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptr += m->padding; + if(m->isOptional) { + if(!(encodingMask & (UA_UInt32) ( (UA_UInt32) 1<<(o++)))) { + /* Optional field is not contained */ + if(m->isArray) + ptr += sizeof(size_t); + } else if(m->isArray) { + /* Optional Array */ + size_t *length = (size_t*)ptr; + ptr += sizeof(size_t); + ret = Array_decodeBinary((void *UA_RESTRICT *UA_RESTRICT)ptr, length, mt , ctx); + } else { + /* Optional Scalar */ + *(void *UA_RESTRICT *UA_RESTRICT) ptr = UA_calloc(1, mt->memSize); + if(!*(void *UA_RESTRICT *UA_RESTRICT) ptr) + return UA_STATUSCODE_BADOUTOFMEMORY; + ret = decodeBinaryJumpTable[mt->typeKind](*(void *UA_RESTRICT *UA_RESTRICT) ptr, mt, ctx); + } + ptr += sizeof(void *); + continue; + } + + /* Array */ + if(m->isArray) { + size_t *length = (size_t *)ptr; + ptr += sizeof(size_t); + ret = Array_decodeBinary((void *UA_RESTRICT *UA_RESTRICT)ptr, length, mt, ctx); + ptr += sizeof(void *); + continue; + } + + /* Scalar */ + ret = decodeBinaryJumpTable[mt->typeKind]((void *UA_RESTRICT)ptr, mt, ctx); + ptr += mt->memSize; + } + ctx->depth--; + return ret; +} + +static status +decodeBinaryUnion(void *UA_RESTRICT dst, const UA_DataType *type, Ctx *ctx) { + /* Check the recursion limit */ + if(ctx->depth > UA_ENCODING_MAX_RECURSION) + return UA_STATUSCODE_BADENCODINGERROR; + + /* Decode the selection directly into the switchfield */ + status ret = DECODE_DIRECT(dst, UInt32); + if(ret != UA_STATUSCODE_GOOD) + return ret; + + /* No content? */ + UA_UInt32 selection = *(UA_UInt32*)dst; + if(selection == 0) + return UA_STATUSCODE_GOOD; + + /* Sanity check the selection */ + if(selection-1 >= type->membersSize) + return UA_STATUSCODE_BADDECODINGERROR; + + /* Select the member */ + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + const UA_DataTypeMember *m = &type->members[selection-1]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + + /* Decode */ + ctx->depth++; + uintptr_t ptr = ((uintptr_t)dst) + m->padding; /* includes the switchfield */ + if(!m->isArray) { + ret = decodeBinaryJumpTable[mt->typeKind]((void *UA_RESTRICT)ptr, mt, ctx); + } else { + size_t *length = (size_t *)ptr; + ptr += sizeof(size_t); + ret = Array_decodeBinary((void *UA_RESTRICT *UA_RESTRICT)ptr, length, mt, ctx); + } + ctx->depth--; + return ret; +} + +const decodeBinarySignature decodeBinaryJumpTable[UA_DATATYPEKINDS] = { + (decodeBinarySignature)Boolean_decodeBinary, + (decodeBinarySignature)Byte_decodeBinary, /* SByte */ + (decodeBinarySignature)Byte_decodeBinary, + (decodeBinarySignature)UInt16_decodeBinary, /* Int16 */ + (decodeBinarySignature)UInt16_decodeBinary, + (decodeBinarySignature)UInt32_decodeBinary, /* Int32 */ + (decodeBinarySignature)UInt32_decodeBinary, + (decodeBinarySignature)UInt64_decodeBinary, /* Int64 */ + (decodeBinarySignature)UInt64_decodeBinary, + (decodeBinarySignature)Float_decodeBinary, + (decodeBinarySignature)Double_decodeBinary, + (decodeBinarySignature)String_decodeBinary, + (decodeBinarySignature)UInt64_decodeBinary, /* DateTime */ + (decodeBinarySignature)Guid_decodeBinary, + (decodeBinarySignature)String_decodeBinary, /* ByteString */ + (decodeBinarySignature)String_decodeBinary, /* XmlElement */ + (decodeBinarySignature)NodeId_decodeBinary, + (decodeBinarySignature)ExpandedNodeId_decodeBinary, + (decodeBinarySignature)UInt32_decodeBinary, /* StatusCode */ + (decodeBinarySignature)QualifiedName_decodeBinary, + (decodeBinarySignature)LocalizedText_decodeBinary, + (decodeBinarySignature)ExtensionObject_decodeBinary, + (decodeBinarySignature)DataValue_decodeBinary, + (decodeBinarySignature)Variant_decodeBinary, + (decodeBinarySignature)DiagnosticInfo_decodeBinary, + (decodeBinarySignature)decodeBinaryNotImplemented, /* Decimal */ + (decodeBinarySignature)UInt32_decodeBinary, /* Enumeration */ + (decodeBinarySignature)decodeBinaryStructure, + (decodeBinarySignature)decodeBinaryStructureWithOptFields, /* Structure with optional fields */ + (decodeBinarySignature)decodeBinaryUnion, /* Union */ + (decodeBinarySignature)decodeBinaryNotImplemented /* BitfieldCluster */ +}; + +status +UA_decodeBinary(const UA_ByteString *src, size_t *offset, void *dst, + const UA_DataType *type, const UA_DataTypeArray *customTypes) { + /* Set up the context */ + Ctx ctx; + ctx.pos = &src->data[*offset]; + ctx.end = &src->data[src->length]; + ctx.depth = 0; + ctx.customTypes = customTypes; + + /* Decode */ + memset(dst, 0, type->memSize); /* Initialize the value */ + status ret = decodeBinaryJumpTable[type->typeKind](dst, type, &ctx); + + if(ret == UA_STATUSCODE_GOOD) { + /* Set the new offset */ + *offset = (size_t)(ctx.pos - src->data) / sizeof(u8); + } else { + /* Clean up */ + UA_clear(dst, type); + memset(dst, 0, type->memSize); + } + return ret; +} + +/** + * Compute the Message Size + * ------------------------ + * The following methods are used to compute the length of a datum in binary + * encoding. */ + +static size_t +Array_calcSizeBinary(const void *src, size_t length, const UA_DataType *type) { + size_t s = 4; /* length */ + if(type->overlayable) { + s += type->memSize * length; + return s; + } + uintptr_t ptr = (uintptr_t)src; + for(size_t i = 0; i < length; ++i) { + s += calcSizeBinaryJumpTable[type->typeKind]((const void*)ptr, type); + ptr += type->memSize; + } + return s; +} + +static size_t calcSizeBinary1(const void *_, const UA_DataType *__) { (void)_, (void)__; return 1; } +static size_t calcSizeBinary2(const void *_, const UA_DataType *__) { (void)_, (void)__; return 2; } +static size_t calcSizeBinary4(const void *_, const UA_DataType *__) { (void)_, (void)__; return 4; } +static size_t calcSizeBinary8(const void *_, const UA_DataType *__) { (void)_, (void)__; return 8; } + +CALCSIZE_BINARY(String) { return 4 + src->length; } + +CALCSIZE_BINARY(Guid) { return 16; } + +CALCSIZE_BINARY(NodeId) { + size_t s = 1; /* Encoding byte */ + switch(src->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + if(src->identifier.numeric > UA_UINT16_MAX || src->namespaceIndex > UA_BYTE_MAX) { + s += 6; + } else if(src->identifier.numeric > UA_BYTE_MAX || src->namespaceIndex > 0) { + s += 3; + } else { + s += 1; + } + break; + case UA_NODEIDTYPE_BYTESTRING: + case UA_NODEIDTYPE_STRING: + s += 2; + s += String_calcSizeBinary(&src->identifier.string, NULL); + break; + case UA_NODEIDTYPE_GUID: + s += 18; + break; + default: + return 0; + } + return s; +} + +CALCSIZE_BINARY(ExpandedNodeId) { + size_t s = NodeId_calcSizeBinary(&src->nodeId, NULL); + if(src->namespaceUri.length > 0) + s += String_calcSizeBinary(&src->namespaceUri, NULL); + if(src->serverIndex > 0) + s += 4; + return s; +} + +CALCSIZE_BINARY(QualifiedName) { + return 2 + String_calcSizeBinary(&src->name, NULL); +} + +CALCSIZE_BINARY(LocalizedText) { + size_t s = 1; /* Encoding byte */ + if(src->locale.data) + s += String_calcSizeBinary(&src->locale, NULL); + if(src->text.data) + s += String_calcSizeBinary(&src->text, NULL); + return s; +} + +CALCSIZE_BINARY(ExtensionObject) { + size_t s = 1; /* Encoding byte */ + + /* Encoded content */ + if(src->encoding <= UA_EXTENSIONOBJECT_ENCODED_XML) { + s += NodeId_calcSizeBinary(&src->content.encoded.typeId, NULL); + switch(src->encoding) { + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + break; + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + case UA_EXTENSIONOBJECT_ENCODED_XML: + s += String_calcSizeBinary(&src->content.encoded.body, NULL); + break; + default: + return 0; + } + return s; + } + + /* Decoded content */ + if(!src->content.decoded.type || !src->content.decoded.data) + return 0; + if(src->content.decoded.type->typeId.identifierType != UA_NODEIDTYPE_NUMERIC) + return 0; + + s += NodeId_calcSizeBinary(&src->content.decoded.type->binaryEncodingId, NULL); /* Type encoding length */ + s += 4; /* Encoding length field */ + const UA_DataType *type = src->content.decoded.type; + s += calcSizeBinaryJumpTable[type->typeKind](src->content.decoded.data, type); /* Encoding length */ + return s; +} + +CALCSIZE_BINARY(Variant) { + size_t s = 1; /* Encoding byte */ + if(!src->type) + return s; + + const UA_Boolean isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL; + if(isArray) + s += Array_calcSizeBinary(src->data, src->arrayLength, src->type); + else + s += calcSizeBinaryJumpTable[src->type->typeKind](src->data, src->type); + + const UA_Boolean isBuiltin = (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO); + const UA_Boolean isEnum = (src->type->typeKind == UA_DATATYPEKIND_ENUM); + if(!isBuiltin && !isEnum) { + /* The type is wrapped inside an extensionobject */ + /* (NodeId + encoding byte + extension object length) * array length */ + size_t length = isArray ? src->arrayLength : 1; + s += (NodeId_calcSizeBinary(&src->type->binaryEncodingId, NULL) + 1 + 4) * length; + } + + const UA_Boolean hasDimensions = isArray && src->arrayDimensionsSize > 0; + if(hasDimensions) + s += Array_calcSizeBinary(src->arrayDimensions, src->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_INT32]); + return s; +} + +CALCSIZE_BINARY(DataValue) { + size_t s = 1; /* Encoding byte */ + if(src->hasValue) + s += Variant_calcSizeBinary(&src->value, NULL); + if(src->hasStatus) + s += 4; + if(src->hasSourceTimestamp) + s += 8; + if(src->hasSourcePicoseconds) + s += 2; + if(src->hasServerTimestamp) + s += 8; + if(src->hasServerPicoseconds) + s += 2; + return s; +} + +CALCSIZE_BINARY(DiagnosticInfo) { + size_t s = 1; /* Encoding byte */ + if(src->hasSymbolicId) + s += 4; + if(src->hasNamespaceUri) + s += 4; + if(src->hasLocalizedText) + s += 4; + if(src->hasLocale) + s += 4; + if(src->hasAdditionalInfo) + s += String_calcSizeBinary(&src->additionalInfo, NULL); + if(src->hasInnerStatusCode) + s += 4; + if(src->hasInnerDiagnosticInfo) + s += DiagnosticInfo_calcSizeBinary(src->innerDiagnosticInfo, NULL); + return s; +} + +static size_t +calcSizeBinaryStructure(const void *p, const UA_DataType *type) { + size_t s = 0; + uintptr_t ptr = (uintptr_t)p; + u8 membersSize = type->membersSize; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + + /* Loop over members */ + for(size_t i = 0; i < membersSize; ++i) { + const UA_DataTypeMember *member = &type->members[i]; + const UA_DataType *membertype = &typelists[!member->namespaceZero][member->memberTypeIndex]; + ptr += member->padding; + + /* Array */ + if(member->isArray) { + const size_t length = *((const size_t*)ptr); + ptr += sizeof(size_t); + s += Array_calcSizeBinary(*(void *UA_RESTRICT const *)ptr, length, membertype); + ptr += sizeof(void*); + continue; + } + + /* Scalar */ + s += calcSizeBinaryJumpTable[membertype->typeKind]((const void*)ptr, membertype); + ptr += membertype->memSize; + } + + return s; +} + +static size_t +calcSizeBinaryStructureWithOptFields(const void *p, const UA_DataType *type) { + /* Start with the size of the encoding mask */ + size_t s = sizeof(UA_UInt32); + + /* Loop over members */ + uintptr_t ptr = (uintptr_t)p; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + for(size_t i = 0; i < type->membersSize; ++i) { + const UA_DataTypeMember *member = &type->members[i]; + const UA_DataType *membertype = &typelists[!member->namespaceZero][member->memberTypeIndex]; + ptr += member->padding; + if(member->isOptional) { + if((member->isArray && ((*(void* const*)(ptr+sizeof(size_t))) == NULL)) || + (!member->isArray && (*(void* const*)ptr == NULL))) { + /* Optional member not contained */ + if(member->isArray) + ptr += sizeof(size_t); + ptr += sizeof(void *); + continue; + } + /* Fallthrough to take the size into account */ + } + /* Array */ + if(member->isArray) { + const size_t length = *((const size_t*)ptr); + ptr += sizeof(size_t); + s += Array_calcSizeBinary(*(void *UA_RESTRICT const *)ptr, length, membertype); + ptr += sizeof(void*); + continue; + } + /* Scalar */ + s += calcSizeBinaryJumpTable[membertype->typeKind]((const void*)ptr, membertype); + member->isOptional ? (ptr += sizeof(void *)) : (ptr += membertype->memSize); + } + return s; +} + +static size_t +calcSizeBinaryUnion(const void *p, const UA_DataType *type) { + size_t s = 4; /* UA_TYPES[UA_TYPES_UINT32].memSize; */ + const UA_UInt32 selection = *(const UA_UInt32 *)p; + if(selection == 0) + return s; + + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + const UA_DataTypeMember *m = &type->members[selection-1]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + + uintptr_t ptr = ((uintptr_t)p) + m->padding; /* includes switchfield length */ + if(!m->isArray) { + s += UA_calcSizeBinary((const void*)ptr, mt); + } else { + const size_t length = *((const size_t*)ptr); + ptr += sizeof(size_t); + s += Array_calcSizeBinary(*(void *UA_RESTRICT const *)ptr, length, mt); + } + return s; +} + +static size_t +calcSizeBinaryNotImplemented(const void *p, const UA_DataType *type) { + (void)p, (void)type; + return 0; +} + +const calcSizeBinarySignature calcSizeBinaryJumpTable[UA_DATATYPEKINDS] = { + (calcSizeBinarySignature)calcSizeBinary1, /* Boolean */ + (calcSizeBinarySignature)calcSizeBinary1, /* SByte */ + (calcSizeBinarySignature)calcSizeBinary1, /* Byte */ + (calcSizeBinarySignature)calcSizeBinary2, /* Int16 */ + (calcSizeBinarySignature)calcSizeBinary2, /* UInt16 */ + (calcSizeBinarySignature)calcSizeBinary4, /* Int32 */ + (calcSizeBinarySignature)calcSizeBinary4, /* UInt32 */ + (calcSizeBinarySignature)calcSizeBinary8, /* Int64 */ + (calcSizeBinarySignature)calcSizeBinary8, /* UInt64 */ + (calcSizeBinarySignature)calcSizeBinary4, /* Float */ + (calcSizeBinarySignature)calcSizeBinary8, /* Double */ + (calcSizeBinarySignature)String_calcSizeBinary, + (calcSizeBinarySignature)calcSizeBinary8, /* DateTime */ + (calcSizeBinarySignature)Guid_calcSizeBinary, + (calcSizeBinarySignature)String_calcSizeBinary, /* ByteString */ + (calcSizeBinarySignature)String_calcSizeBinary, /* XmlElement */ + (calcSizeBinarySignature)NodeId_calcSizeBinary, + (calcSizeBinarySignature)ExpandedNodeId_calcSizeBinary, + (calcSizeBinarySignature)calcSizeBinary4, /* StatusCode */ + (calcSizeBinarySignature)QualifiedName_calcSizeBinary, + (calcSizeBinarySignature)LocalizedText_calcSizeBinary, + (calcSizeBinarySignature)ExtensionObject_calcSizeBinary, + (calcSizeBinarySignature)DataValue_calcSizeBinary, + (calcSizeBinarySignature)Variant_calcSizeBinary, + (calcSizeBinarySignature)DiagnosticInfo_calcSizeBinary, + (calcSizeBinarySignature)calcSizeBinaryNotImplemented, /* Decimal */ + (calcSizeBinarySignature)calcSizeBinary4, /* Enumeration */ + (calcSizeBinarySignature)calcSizeBinaryStructure, + (calcSizeBinarySignature)calcSizeBinaryStructureWithOptFields, /* Structure with Optional Fields */ + (calcSizeBinarySignature)calcSizeBinaryUnion, /* Union */ + (calcSizeBinarySignature)calcSizeBinaryNotImplemented /* BitfieldCluster */ +}; + +size_t +UA_calcSizeBinary(const void *p, const UA_DataType *type) { + return calcSizeBinaryJumpTable[type->typeKind](p, type); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_types_print.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + + +/* Printing of NodeIds is always enabled. We need it for logging. */ + +UA_StatusCode +UA_NodeId_print(const UA_NodeId *id, UA_String *output) { + UA_String_clear(output); + if(!id) + return UA_STATUSCODE_GOOD; + + char *nsStr = NULL; + long snprintfLen = 0; + size_t nsLen = 0; + if(id->namespaceIndex != 0) { + nsStr = (char*)UA_malloc(9+1); // strlen("ns=XXXXX;") = 9 + Nullbyte + if(!nsStr) + return UA_STATUSCODE_BADOUTOFMEMORY; + snprintfLen = UA_snprintf(nsStr, 10, "ns=%d;", id->namespaceIndex); + if(snprintfLen < 0 || snprintfLen >= 10) { + UA_free(nsStr); + return UA_STATUSCODE_BADINTERNALERROR; + } + nsLen = (size_t)(snprintfLen); + } + + UA_ByteString byteStr = UA_BYTESTRING_NULL; + switch (id->identifierType) { + case UA_NODEIDTYPE_NUMERIC: + /* ns (2 byte, 65535) = 5 chars, numeric (4 byte, 4294967295) = 10 + * chars, delim = 1 , nullbyte = 1-> 17 chars */ + output->length = nsLen + 2 + 10 + 1; + output->data = (UA_Byte*)UA_malloc(output->length); + if(output->data == NULL) { + output->length = 0; + UA_free(nsStr); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + snprintfLen = UA_snprintf((char*)output->data, output->length, "%si=%lu", + nsLen > 0 ? nsStr : "", + (unsigned long )id->identifier.numeric); + break; + case UA_NODEIDTYPE_STRING: + /* ns (16bit) = 5 chars, strlen + nullbyte */ + output->length = nsLen + 2 + id->identifier.string.length + 1; + output->data = (UA_Byte*)UA_malloc(output->length); + if(output->data == NULL) { + output->length = 0; + UA_free(nsStr); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + snprintfLen = UA_snprintf((char*)output->data, output->length, "%ss=%.*s", + nsLen > 0 ? nsStr : "", (int)id->identifier.string.length, + id->identifier.string.data); + break; + case UA_NODEIDTYPE_GUID: + /* ns (16bit) = 5 chars + strlen(A123456C-0ABC-1A2B-815F-687212AAEE1B)=36 + nullbyte */ + output->length = nsLen + 2 + 36 + 1; + output->data = (UA_Byte*)UA_malloc(output->length); + if(output->data == NULL) { + output->length = 0; + UA_free(nsStr); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + snprintfLen = UA_snprintf((char*)output->data, output->length, + "%sg=" UA_PRINTF_GUID_FORMAT, nsLen > 0 ? nsStr : "", + UA_PRINTF_GUID_DATA(id->identifier.guid)); + break; + case UA_NODEIDTYPE_BYTESTRING: + UA_ByteString_toBase64(&id->identifier.byteString, &byteStr); + /* ns (16bit) = 5 chars + LEN + nullbyte */ + output->length = nsLen + 2 + byteStr.length + 1; + output->data = (UA_Byte*)UA_malloc(output->length); + if(output->data == NULL) { + output->length = 0; + UA_String_clear(&byteStr); + UA_free(nsStr); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + snprintfLen = UA_snprintf((char*)output->data, output->length, "%sb=%.*s", + nsLen > 0 ? nsStr : "", + (int)byteStr.length, byteStr.data); + UA_String_clear(&byteStr); + break; + } + UA_free(nsStr); + + if(snprintfLen < 0 || snprintfLen >= (long) output->length) { + UA_free(output->data); + output->data = NULL; + output->length = 0; + return UA_STATUSCODE_BADINTERNALERROR; + } + output->length = (size_t)snprintfLen; + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_ExpandedNodeId_print(const UA_ExpandedNodeId *id, UA_String *output) { + /* Don't print the namespace-index if a NamespaceUri is set */ + UA_NodeId nid = id->nodeId; + if(id->namespaceUri.data != NULL) + nid.namespaceIndex = 0; + + /* Encode the NodeId */ + UA_String outNid = UA_STRING_NULL; + UA_StatusCode res = UA_NodeId_print(&nid, &outNid); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Encode the ServerIndex */ + char svr[100]; + if(id->serverIndex == 0) + svr[0] = 0; + else + UA_snprintf(svr, 100, "svr=%"PRIu32";", id->serverIndex); + size_t svrlen = strlen(svr); + + /* Encode the NamespaceUri */ + char nsu[100]; + if(id->namespaceUri.data == NULL) + nsu[0] = 0; + else + UA_snprintf(nsu, 100, "nsu=%.*s;", (int)id->namespaceUri.length, id->namespaceUri.data); + size_t nsulen = strlen(nsu); + + /* Combine everything */ + res = UA_ByteString_allocBuffer((UA_String*)output, outNid.length + svrlen + nsulen); + if(res == UA_STATUSCODE_GOOD) { + memcpy(output->data, svr, svrlen); + memcpy(&output->data[svrlen], nsu, nsulen); + memcpy(&output->data[svrlen+nsulen], outNid.data, outNid.length); + } + + UA_String_clear(&outNid); + return res; +} + +#ifdef UA_ENABLE_TYPEDESCRIPTION + +/***********************/ +/* Jumptable Signature */ +/***********************/ + +typedef struct UA_PrintElement { + TAILQ_ENTRY(UA_PrintElement) next; + size_t length; + UA_Byte data[]; +} UA_PrintOutput; + +typedef struct { + size_t depth; + TAILQ_HEAD(, UA_PrintElement) outputs; +} UA_PrintContext; + +typedef UA_StatusCode +(*UA_printSignature)(UA_PrintContext *ctx, const void *p, + const UA_DataType *type); + +extern const UA_printSignature printJumpTable[UA_DATATYPEKINDS]; + +/********************/ +/* Helper Functions */ +/********************/ + +static UA_PrintOutput * +UA_PrintContext_addOutput(UA_PrintContext *ctx, size_t length) { + /* Protect against overlong output in pretty-printing */ + if(length > 2<<16) + return NULL; + UA_PrintOutput *output = (UA_PrintOutput*)UA_malloc(sizeof(UA_PrintOutput) + length + 1); + if(!output) + return NULL; + output->length = length; + TAILQ_INSERT_TAIL(&ctx->outputs, output, next); + return output; +} + +static UA_StatusCode +UA_PrintContext_addNewlineTabs(UA_PrintContext *ctx, size_t tabs) { + UA_PrintOutput *out = UA_PrintContext_addOutput(ctx, tabs+1); + if(!out) + return UA_STATUSCODE_BADOUTOFMEMORY; + out->data[0] = '\n'; + for(size_t i = 1; i <= tabs; i++) + out->data[i] = '\t'; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_PrintContext_addName(UA_PrintContext *ctx, const char *name) { + size_t nameLen = strlen(name); + UA_PrintOutput *out = UA_PrintContext_addOutput(ctx, nameLen+2); + if(!out) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(&out->data, name, nameLen); + out->data[nameLen] = ':'; + out->data[nameLen+1] = ' '; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_PrintContext_addString(UA_PrintContext *ctx, const char *str) { + size_t len = strlen(str); + UA_PrintOutput *out = UA_PrintContext_addOutput(ctx, len); + if(!out) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(&out->data, str, len); + return UA_STATUSCODE_GOOD; +} + +/*********************/ +/* Printing Routines */ +/*********************/ + +static UA_StatusCode +printArray(UA_PrintContext *ctx, const void *p, const size_t length, + const UA_DataType *type); + +static UA_StatusCode +printBoolean(UA_PrintContext *ctx, const UA_Boolean *p, const UA_DataType *_) { + if(*p) + return UA_PrintContext_addString(ctx, "true"); + return UA_PrintContext_addString(ctx, "false"); +} + +static UA_StatusCode +printSByte(UA_PrintContext *ctx, const UA_SByte *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIi8, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printByte(UA_PrintContext *ctx, const UA_Byte *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIu8, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printInt16(UA_PrintContext *ctx, const UA_Int16 *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIi16, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printUInt16(UA_PrintContext *ctx, const UA_UInt16 *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIu16, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printInt32(UA_PrintContext *ctx, const UA_Int32 *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIi32, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printUInt32(UA_PrintContext *ctx, const UA_UInt32 *p, const UA_DataType *_) { + char out[32]; + UA_snprintf(out, 32, "%"PRIu32, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printInt64(UA_PrintContext *ctx, const UA_Int64 *p, const UA_DataType *_) { + char out[64]; + UA_snprintf(out, 64, "%"PRIi64, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printUInt64(UA_PrintContext *ctx, const UA_UInt64 *p, const UA_DataType *_) { + char out[64]; + UA_snprintf(out, 64, "%"PRIu64, *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printFloat(UA_PrintContext *ctx, const UA_Float *p, const UA_DataType *_) { + char out[64]; + UA_snprintf(out, 32, "%f", *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printDouble(UA_PrintContext *ctx, const UA_Double *p, const UA_DataType *_) { + char out[64]; + UA_snprintf(out, 64, "%lf", *p); + return UA_PrintContext_addString(ctx, out); +} + +static UA_StatusCode +printStatusCode(UA_PrintContext *ctx, const UA_StatusCode *p, const UA_DataType *_) { + return UA_PrintContext_addString(ctx, UA_StatusCode_name(*p)); +} + +static UA_StatusCode +printNodeId(UA_PrintContext *ctx, const UA_NodeId *p, const UA_DataType *_) { + UA_String out; + UA_String_init(&out); + UA_StatusCode res = UA_NodeId_print(p, &out); + if(res != UA_STATUSCODE_GOOD) + return res; + UA_PrintOutput *po = UA_PrintContext_addOutput(ctx, out.length); + if(po) + memcpy(po->data, out.data, out.length); + else + res = UA_STATUSCODE_BADOUTOFMEMORY; + UA_String_clear(&out); + return res; +} + +static UA_StatusCode +printExpandedNodeId(UA_PrintContext *ctx, const UA_ExpandedNodeId *p, const UA_DataType *_) { + UA_String out; + UA_String_init(&out); + UA_StatusCode res = UA_ExpandedNodeId_print(p, &out); + if(res != UA_STATUSCODE_GOOD) + return res; + UA_PrintOutput *po = UA_PrintContext_addOutput(ctx, out.length); + if(!po) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(po->data, out.data, out.length); + UA_String_clear(&out); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +printDateTime(UA_PrintContext *ctx, const UA_DateTime *p, const UA_DataType *_) { + UA_Int64 tOffset = UA_DateTime_localTimeUtcOffset(); + UA_DateTimeStruct dts = UA_DateTime_toStruct(*p); + char dateString[100]; + UA_snprintf((char*)dateString, 100, + "%04u-%02u-%02u %02u:%02u:%02u.%03u (UTC%+05d)", + dts.year, dts.month, dts.day, dts.hour, dts.min, + dts.sec, dts.milliSec, + (int)(tOffset / UA_DATETIME_SEC / 36)); + return UA_PrintContext_addString(ctx, dateString); +} + +static UA_StatusCode +printGuid(UA_PrintContext *ctx, const UA_Guid *p, const UA_DataType *_) { + char tmp[100]; + UA_snprintf(tmp, 100, UA_PRINTF_GUID_FORMAT, UA_PRINTF_GUID_DATA(*p)); + return UA_PrintContext_addString(ctx, tmp); +} + +static UA_StatusCode +printString(UA_PrintContext *ctx, const UA_String *p, const UA_DataType *_) { + if(!p->data) + return UA_PrintContext_addString(ctx, "NullString"); + UA_PrintOutput *out = UA_PrintContext_addOutput(ctx, p->length+2); + if(!out) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_snprintf((char*)out->data, p->length+3, "\"%.*s\"", (int)p->length, p->data); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +printByteString(UA_PrintContext *ctx, const UA_ByteString *p, const UA_DataType *_) { + if(!p->data) + return UA_PrintContext_addString(ctx, "NullByteString"); + UA_String str = UA_BYTESTRING_NULL; + UA_StatusCode res = UA_ByteString_toBase64(p, &str); + if(res != UA_STATUSCODE_GOOD) + return res; + res = printString(ctx, &str, NULL); + UA_String_clear(&str); + return res; +} + +static UA_StatusCode +printQualifiedName(UA_PrintContext *ctx, const UA_QualifiedName *p, const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "NamespaceIndex"); + retval |= printUInt16(ctx, &p->namespaceIndex, NULL); + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Name"); + retval |= printString(ctx, &p->name, NULL); + ctx->depth--; + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + return retval; +} + +static UA_StatusCode +printLocalizedText(UA_PrintContext *ctx, const UA_LocalizedText *p, const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Locale"); + retval |= printString(ctx, &p->locale, NULL); + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Text"); + retval |= printString(ctx, &p->text, NULL); + ctx->depth--; + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + return retval; +} + +static UA_StatusCode +printVariant(UA_PrintContext *ctx, const UA_Variant *p, const UA_DataType *_) { + if(!p->type) + return UA_PrintContext_addString(ctx, "NullVariant"); + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "DataType"); + retval |= UA_PrintContext_addString(ctx, p->type->typeName); + retval |= UA_PrintContext_addString(ctx, ","); + + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Value"); + if(UA_Variant_isScalar(p)) + retval |= printJumpTable[p->type->typeKind](ctx, p->data, p->type); + else + retval |= printArray(ctx, p->data, p->arrayLength, p->type); + + if(p->arrayDimensionsSize > 0) { + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "ArrayDimensions"); + retval |= printArray(ctx, p->arrayDimensions, p->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_UINT32]); + } + + ctx->depth--; + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + return retval; +} + +static UA_StatusCode +printExtensionObject(UA_PrintContext *ctx, const UA_ExtensionObject*p, + const UA_DataType *_) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + switch(p->encoding) { + case UA_EXTENSIONOBJECT_ENCODED_NOBODY: + return UA_PrintContext_addString(ctx, "ExtensionObject(No Body)"); + case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING: + res |= UA_PrintContext_addString(ctx, "ExtensionObject(Binary Encoded) {"); + ctx->depth++; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "DataType"); + res |= printNodeId(ctx, &p->content.encoded.typeId, NULL); + res |= UA_PrintContext_addString(ctx, ","); + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "Body"); + res |= printByteString(ctx, &p->content.encoded.body, NULL); + ctx->depth--; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "}"); + break; + case UA_EXTENSIONOBJECT_ENCODED_XML: + res |= UA_PrintContext_addString(ctx, "ExtensionObject(XML Encoded) {"); + ctx->depth++; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "DataType"); + res |= printNodeId(ctx, &p->content.encoded.typeId, NULL); + res |= UA_PrintContext_addString(ctx, ","); + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "Body"); + res |= printString(ctx, (const UA_String*)&p->content.encoded.body, NULL); + ctx->depth--; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "}"); + break; + case UA_EXTENSIONOBJECT_DECODED: + case UA_EXTENSIONOBJECT_DECODED_NODELETE: + res |= UA_PrintContext_addString(ctx, "ExtensionObject {"); + ctx->depth++; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "DataType"); + res |= UA_PrintContext_addString(ctx, p->content.decoded.type->typeName); + res |= UA_PrintContext_addString(ctx, ","); + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "Body"); + res |= printJumpTable[p->content.decoded.type->typeKind](ctx, + p->content.decoded.data, + p->content.decoded.type); + ctx->depth--; + res |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + res |= UA_PrintContext_addName(ctx, "}"); + break; + default: + res = UA_STATUSCODE_BADINTERNALERROR; + break; + } + return res; +} + +static UA_StatusCode +printDataValue(UA_PrintContext *ctx, const UA_DataValue *p, const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + UA_Boolean comma = false; + + if(p->hasValue) { + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Value"); + retval |= printVariant(ctx, &p->value, NULL); + comma = true; + } + + if(p->hasStatus) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Status"); + retval |= printStatusCode(ctx, &p->status, NULL); + comma = true; + } + + if(p->hasSourceTimestamp) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "SourceTimestamp"); + retval |= printDateTime(ctx, &p->sourceTimestamp, NULL); + comma = true; + } + + if(p->hasSourcePicoseconds) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "SourcePicoseconds"); + retval |= printUInt16(ctx, &p->sourcePicoseconds, NULL); + comma = true; + } + + if(p->hasServerTimestamp) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "ServerTimestamp"); + retval |= printDateTime(ctx, &p->serverTimestamp, NULL); + comma = true; + } + + if(p->hasServerPicoseconds) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "ServerPicoseconds"); + retval |= printUInt16(ctx, &p->serverPicoseconds, NULL); + comma = true; + } + + ctx->depth--; + if(comma) { + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + } else { + retval |= UA_PrintContext_addString(ctx, " }"); + } + return retval; +} + +static UA_StatusCode +printDiagnosticInfo(UA_PrintContext *ctx, const UA_DiagnosticInfo *p, const UA_DataType *_) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + UA_Boolean comma = false; + + if(p->hasSymbolicId) { + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "SymbolicId"); + retval |= printInt32(ctx, &p->symbolicId, NULL); + comma = true; + } + + if(p->hasNamespaceUri) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "NamespaceUri"); + retval |= printInt32(ctx, &p->namespaceUri, NULL); + comma = true; + } + + if(p->hasLocalizedText) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "LocalizedText"); + retval |= printInt32(ctx, &p->localizedText, NULL); + comma = true; + } + + if(p->hasLocale) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "Locale"); + retval |= printInt32(ctx, &p->locale, NULL); + comma = true; + } + + if(p->hasAdditionalInfo) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "AdditionalInfo"); + retval |= printString(ctx, &p->additionalInfo, NULL); + comma = true; + } + + if(p->hasInnerStatusCode) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "InnerStatusCode"); + retval |= printStatusCode(ctx, &p->innerStatusCode, NULL); + comma = true; + } + + if(p->hasInnerDiagnosticInfo) { + if(comma) + retval |= UA_PrintContext_addString(ctx, ","); + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addName(ctx, "InnerDiagnosticInfo"); + retval |= printDiagnosticInfo(ctx, p->innerDiagnosticInfo, NULL); + comma = true; + } + + ctx->depth--; + if(comma) { + retval |= UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + } else { + retval |= UA_PrintContext_addString(ctx, " }"); + } + return retval; +} + +static UA_StatusCode +printArray(UA_PrintContext *ctx, const void *p, const size_t length, + const UA_DataType *type) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(!p) { + retval |= UA_PrintContext_addString(ctx, "Array(-1, "); + retval |= UA_PrintContext_addString(ctx, type->typeName); + retval |= UA_PrintContext_addString(ctx, ")"); + return retval; + } + + UA_UInt32 length32 = (UA_UInt32)length; + retval |= UA_PrintContext_addString(ctx, "Array("); + retval |= printUInt32(ctx, &length32, NULL); + retval |= UA_PrintContext_addString(ctx, ", "); + retval |= UA_PrintContext_addString(ctx, type->typeName); + retval |= UA_PrintContext_addString(ctx, ") {"); + ctx->depth++; + uintptr_t target = (uintptr_t)p; + for(UA_UInt32 i = 0; i < length; i++) { + UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + printUInt32(ctx, &i, NULL); + retval |= UA_PrintContext_addString(ctx, ": "); + printJumpTable[type->typeKind](ctx, (const void*)target, type); + if(i < length - 1) + retval |= UA_PrintContext_addString(ctx, ","); + target += type->memSize; + } + ctx->depth--; + UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + return retval; +} + +static UA_StatusCode +printStructure(UA_PrintContext *ctx, const void *p, const UA_DataType *type) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + uintptr_t ptrs = (uintptr_t)p; + const UA_DataType *typelists[2] = { UA_TYPES, &type[-type->typeIndex] }; + retval |= UA_PrintContext_addString(ctx, "{"); + ctx->depth++; + for(size_t i = 0; i < type->membersSize; ++i) { + UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + const UA_DataTypeMember *m = &type->members[i]; + const UA_DataType *mt = &typelists[!m->namespaceZero][m->memberTypeIndex]; + ptrs += m->padding; + retval |= UA_PrintContext_addName(ctx, m->memberName); + if(!m->isArray) { + retval |= printJumpTable[mt->typeKind](ctx, (const void *)ptrs, mt); + ptrs += mt->memSize; + } else { + const size_t size = *((const size_t*)ptrs); + ptrs += sizeof(size_t); + retval |= printArray(ctx, *(void* const*)ptrs, size, mt); + ptrs += sizeof(void*); + } + if(i < (size_t)(type->membersSize - 1)) + retval |= UA_PrintContext_addString(ctx, ","); + } + ctx->depth--; + UA_PrintContext_addNewlineTabs(ctx, ctx->depth); + retval |= UA_PrintContext_addString(ctx, "}"); + return retval; +} + +static UA_StatusCode +printNotImplemented(UA_PrintContext *ctx, const void *p, const UA_DataType *type) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + res |= UA_PrintContext_addString(ctx, type->typeName); + res |= UA_PrintContext_addString(ctx, " (Printing Not Implemented)"); + return res; +} + +const UA_printSignature printJumpTable[UA_DATATYPEKINDS] = { + (UA_printSignature)printBoolean, + (UA_printSignature)printSByte, + (UA_printSignature)printByte, + (UA_printSignature)printInt16, + (UA_printSignature)printUInt16, + (UA_printSignature)printInt32, + (UA_printSignature)printUInt32, + (UA_printSignature)printInt64, + (UA_printSignature)printUInt64, + (UA_printSignature)printFloat, + (UA_printSignature)printDouble, + (UA_printSignature)printString, + (UA_printSignature)printDateTime, + (UA_printSignature)printGuid, + (UA_printSignature)printByteString, + (UA_printSignature)printString, /* XmlElement */ + (UA_printSignature)printNodeId, + (UA_printSignature)printExpandedNodeId, + (UA_printSignature)printStatusCode, + (UA_printSignature)printQualifiedName, + (UA_printSignature)printLocalizedText, + (UA_printSignature)printExtensionObject, + (UA_printSignature)printDataValue, + (UA_printSignature)printVariant, + (UA_printSignature)printDiagnosticInfo, + (UA_printSignature)printNotImplemented, /* Decimal */ + (UA_printSignature)printUInt32, /* Enumeration */ + (UA_printSignature)printStructure, + (UA_printSignature)printNotImplemented, /* Structure with Optional Fields */ + (UA_printSignature)printNotImplemented, /* Union */ + (UA_printSignature)printNotImplemented /* BitfieldCluster*/ +}; + +UA_StatusCode +UA_print(const void *p, const UA_DataType *type, UA_String *output) { + UA_PrintContext ctx; + ctx.depth = 0; + TAILQ_INIT(&ctx.outputs); + + /* Encode */ + UA_StatusCode retval = printJumpTable[type->typeKind](&ctx, p, type); + + /* Allocate memory for the output */ + if(retval == UA_STATUSCODE_GOOD) { + size_t total = 0; + UA_PrintOutput *out; + TAILQ_FOREACH(out, &ctx.outputs, next) + total += out->length; + retval = UA_ByteString_allocBuffer((UA_String*)output, total); + } + + /* Write the output */ + if(retval == UA_STATUSCODE_GOOD) { + size_t pos = 0; + UA_PrintOutput *out; + TAILQ_FOREACH(out, &ctx.outputs, next) { + memcpy(&output->data[pos], out->data, out->length); + pos += out->length; + } + } + + /* Free the context */ + UA_PrintOutput *o, *o2; + TAILQ_FOREACH_SAFE(o, &ctx.outputs, next, o2) { + TAILQ_REMOVE(&ctx.outputs, o, next); + UA_free(o); + } + return retval; +} + +#endif /* UA_ENABLE_TYPEDESCRIPTION */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/types_generated.c" ***********************************/ + +/* Generated from Opc.Ua.Types.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:02 */ + + +/* Boolean */ +#define Boolean_members NULL + +/* SByte */ +#define SByte_members NULL + +/* Byte */ +#define Byte_members NULL + +/* Int16 */ +#define Int16_members NULL + +/* UInt16 */ +#define UInt16_members NULL + +/* Int32 */ +#define Int32_members NULL + +/* UInt32 */ +#define UInt32_members NULL + +/* Int64 */ +#define Int64_members NULL + +/* UInt64 */ +#define UInt64_members NULL + +/* Float */ +#define Float_members NULL + +/* Double */ +#define Double_members NULL + +/* String */ +#define String_members NULL + +/* DateTime */ +#define DateTime_members NULL + +/* Guid */ +#define Guid_members NULL + +/* ByteString */ +#define ByteString_members NULL + +/* XmlElement */ +#define XmlElement_members NULL + +/* NodeId */ +#define NodeId_members NULL + +/* ExpandedNodeId */ +#define ExpandedNodeId_members NULL + +/* StatusCode */ +#define StatusCode_members NULL + +/* QualifiedName */ +#define QualifiedName_members NULL + +/* LocalizedText */ +#define LocalizedText_members NULL + +/* ExtensionObject */ +#define ExtensionObject_members NULL + +/* DataValue */ +#define DataValue_members NULL + +/* Variant */ +#define Variant_members NULL + +/* DiagnosticInfo */ +#define DiagnosticInfo_members NULL + +/* ViewAttributes */ +static UA_DataTypeMember ViewAttributes_members[7] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, displayName) - offsetof(UA_ViewAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, description) - offsetof(UA_ViewAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, writeMask) - offsetof(UA_ViewAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, userWriteMask) - offsetof(UA_ViewAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, containsNoLoops) - offsetof(UA_ViewAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ContainsNoLoops") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_ViewAttributes, eventNotifier) - offsetof(UA_ViewAttributes, containsNoLoops) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EventNotifier") /* .memberName */ +},}; + +/* XVType */ +static UA_DataTypeMember XVType_members[2] = { +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("X") /* .memberName */ +}, +{ + UA_TYPES_FLOAT, /* .memberTypeIndex */ + offsetof(UA_XVType, value) - offsetof(UA_XVType, x) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +},}; + +/* ElementOperand */ +static UA_DataTypeMember ElementOperand_members[1] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Index") /* .memberName */ +},}; + +/* VariableAttributes */ +static UA_DataTypeMember VariableAttributes_members[13] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, displayName) - offsetof(UA_VariableAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, description) - offsetof(UA_VariableAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, writeMask) - offsetof(UA_VariableAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, userWriteMask) - offsetof(UA_VariableAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, value) - offsetof(UA_VariableAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, dataType) - offsetof(UA_VariableAttributes, value) - sizeof(UA_Variant), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DataType") /* .memberName */ +}, +{ + UA_TYPES_INT32, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, valueRank) - offsetof(UA_VariableAttributes, dataType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ValueRank") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, arrayDimensionsSize) - offsetof(UA_VariableAttributes, valueRank) - sizeof(UA_Int32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ArrayDimensions") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, accessLevel) - offsetof(UA_VariableAttributes, arrayDimensions) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AccessLevel") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, userAccessLevel) - offsetof(UA_VariableAttributes, accessLevel) - sizeof(UA_Byte), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserAccessLevel") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, minimumSamplingInterval) - offsetof(UA_VariableAttributes, userAccessLevel) - sizeof(UA_Byte), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MinimumSamplingInterval") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_VariableAttributes, historizing) - offsetof(UA_VariableAttributes, minimumSamplingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Historizing") /* .memberName */ +},}; + +/* EnumValueType */ +static UA_DataTypeMember EnumValueType_members[3] = { +{ + UA_TYPES_INT64, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EnumValueType, displayName) - offsetof(UA_EnumValueType, value) - sizeof(UA_Int64), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EnumValueType, description) - offsetof(UA_EnumValueType, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +},}; + +/* EventFieldList */ +static UA_DataTypeMember EventFieldList_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientHandle") /* .memberName */ +}, +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + offsetof(UA_EventFieldList, eventFieldsSize) - offsetof(UA_EventFieldList, clientHandle) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EventFields") /* .memberName */ +},}; + +/* MonitoredItemCreateResult */ +static UA_DataTypeMember MonitoredItemCreateResult_members[5] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateResult, monitoredItemId) - offsetof(UA_MonitoredItemCreateResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoredItemId") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateResult, revisedSamplingInterval) - offsetof(UA_MonitoredItemCreateResult, monitoredItemId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedSamplingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateResult, revisedQueueSize) - offsetof(UA_MonitoredItemCreateResult, revisedSamplingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedQueueSize") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateResult, filterResult) - offsetof(UA_MonitoredItemCreateResult, revisedQueueSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("FilterResult") /* .memberName */ +},}; + +/* EUInformation */ +static UA_DataTypeMember EUInformation_members[4] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NamespaceUri") /* .memberName */ +}, +{ + UA_TYPES_INT32, /* .memberTypeIndex */ + offsetof(UA_EUInformation, unitId) - offsetof(UA_EUInformation, namespaceUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UnitId") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EUInformation, displayName) - offsetof(UA_EUInformation, unitId) - sizeof(UA_Int32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EUInformation, description) - offsetof(UA_EUInformation, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +},}; + +/* ServerDiagnosticsSummaryDataType */ +static UA_DataTypeMember ServerDiagnosticsSummaryDataType_members[12] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerViewCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, currentSessionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, serverViewCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CurrentSessionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, cumulatedSessionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, currentSessionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CumulatedSessionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, securityRejectedSessionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, cumulatedSessionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityRejectedSessionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, rejectedSessionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, securityRejectedSessionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RejectedSessionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, sessionTimeoutCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, rejectedSessionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SessionTimeoutCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, sessionAbortCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, sessionTimeoutCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SessionAbortCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, currentSubscriptionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, sessionAbortCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CurrentSubscriptionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, cumulatedSubscriptionCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, currentSubscriptionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CumulatedSubscriptionCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, publishingIntervalCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, cumulatedSubscriptionCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PublishingIntervalCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, securityRejectedRequestsCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, publishingIntervalCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityRejectedRequestsCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerDiagnosticsSummaryDataType, rejectedRequestsCount) - offsetof(UA_ServerDiagnosticsSummaryDataType, securityRejectedRequestsCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RejectedRequestsCount") /* .memberName */ +},}; + +/* ContentFilterElementResult */ +static UA_DataTypeMember ContentFilterElementResult_members[3] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_ContentFilterElementResult, operandStatusCodesSize) - offsetof(UA_ContentFilterElementResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("OperandStatusCodes") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ContentFilterElementResult, operandDiagnosticInfosSize) - offsetof(UA_ContentFilterElementResult, operandStatusCodes) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("OperandDiagnosticInfos") /* .memberName */ +},}; + +/* LiteralOperand */ +static UA_DataTypeMember LiteralOperand_members[1] = { +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +},}; + +/* MessageSecurityMode */ +#define MessageSecurityMode_members NULL + +/* UtcTime */ +#define UtcTime_members NULL + +/* UserIdentityToken */ +static UA_DataTypeMember UserIdentityToken_members[1] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +},}; + +/* X509IdentityToken */ +static UA_DataTypeMember X509IdentityToken_members[2] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_X509IdentityToken, certificateData) - offsetof(UA_X509IdentityToken, policyId) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CertificateData") /* .memberName */ +},}; + +/* MonitoredItemNotification */ +static UA_DataTypeMember MonitoredItemNotification_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientHandle") /* .memberName */ +}, +{ + UA_TYPES_DATAVALUE, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemNotification, value) - offsetof(UA_MonitoredItemNotification, clientHandle) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +},}; + +/* StructureType */ +#define StructureType_members NULL + +/* ResponseHeader */ +static UA_DataTypeMember ResponseHeader_members[6] = { +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Timestamp") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ResponseHeader, requestHandle) - offsetof(UA_ResponseHeader, timestamp) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHandle") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_ResponseHeader, serviceResult) - offsetof(UA_ResponseHeader, requestHandle) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServiceResult") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ResponseHeader, serviceDiagnostics) - offsetof(UA_ResponseHeader, serviceResult) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServiceDiagnostics") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ResponseHeader, stringTableSize) - offsetof(UA_ResponseHeader, serviceDiagnostics) - sizeof(UA_DiagnosticInfo), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StringTable") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_ResponseHeader, additionalHeader) - offsetof(UA_ResponseHeader, stringTable) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AdditionalHeader") /* .memberName */ +},}; + +/* SignatureData */ +static UA_DataTypeMember SignatureData_members[2] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Algorithm") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_SignatureData, signature) - offsetof(UA_SignatureData, algorithm) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Signature") /* .memberName */ +},}; + +/* ModifySubscriptionResponse */ +static UA_DataTypeMember ModifySubscriptionResponse_members[4] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionResponse, revisedPublishingInterval) - offsetof(UA_ModifySubscriptionResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedPublishingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionResponse, revisedLifetimeCount) - offsetof(UA_ModifySubscriptionResponse, revisedPublishingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedLifetimeCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionResponse, revisedMaxKeepAliveCount) - offsetof(UA_ModifySubscriptionResponse, revisedLifetimeCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedMaxKeepAliveCount") /* .memberName */ +},}; + +/* NodeAttributes */ +static UA_DataTypeMember NodeAttributes_members[5] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_NodeAttributes, displayName) - offsetof(UA_NodeAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_NodeAttributes, description) - offsetof(UA_NodeAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_NodeAttributes, writeMask) - offsetof(UA_NodeAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_NodeAttributes, userWriteMask) - offsetof(UA_NodeAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +},}; + +/* ActivateSessionResponse */ +static UA_DataTypeMember ActivateSessionResponse_members[4] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionResponse, serverNonce) - offsetof(UA_ActivateSessionResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerNonce") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionResponse, resultsSize) - offsetof(UA_ActivateSessionResponse, serverNonce) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionResponse, diagnosticInfosSize) - offsetof(UA_ActivateSessionResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* EnumField */ +static UA_DataTypeMember EnumField_members[4] = { +{ + UA_TYPES_INT64, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EnumField, displayName) - offsetof(UA_EnumField, value) - sizeof(UA_Int64), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_EnumField, description) - offsetof(UA_EnumField, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_EnumField, name) - offsetof(UA_EnumField, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Name") /* .memberName */ +},}; + +/* VariableTypeAttributes */ +static UA_DataTypeMember VariableTypeAttributes_members[10] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, displayName) - offsetof(UA_VariableTypeAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, description) - offsetof(UA_VariableTypeAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, writeMask) - offsetof(UA_VariableTypeAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, userWriteMask) - offsetof(UA_VariableTypeAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, value) - offsetof(UA_VariableTypeAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, dataType) - offsetof(UA_VariableTypeAttributes, value) - sizeof(UA_Variant), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DataType") /* .memberName */ +}, +{ + UA_TYPES_INT32, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, valueRank) - offsetof(UA_VariableTypeAttributes, dataType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ValueRank") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, arrayDimensionsSize) - offsetof(UA_VariableTypeAttributes, valueRank) - sizeof(UA_Int32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ArrayDimensions") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_VariableTypeAttributes, isAbstract) - offsetof(UA_VariableTypeAttributes, arrayDimensions) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsAbstract") /* .memberName */ +},}; + +/* CallMethodResult */ +static UA_DataTypeMember CallMethodResult_members[4] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_CallMethodResult, inputArgumentResultsSize) - offsetof(UA_CallMethodResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("InputArgumentResults") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_CallMethodResult, inputArgumentDiagnosticInfosSize) - offsetof(UA_CallMethodResult, inputArgumentResults) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("InputArgumentDiagnosticInfos") /* .memberName */ +}, +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + offsetof(UA_CallMethodResult, outputArgumentsSize) - offsetof(UA_CallMethodResult, inputArgumentDiagnosticInfos) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("OutputArguments") /* .memberName */ +},}; + +/* MonitoringMode */ +#define MonitoringMode_members NULL + +/* SetMonitoringModeResponse */ +static UA_DataTypeMember SetMonitoringModeResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_SetMonitoringModeResponse, resultsSize) - offsetof(UA_SetMonitoringModeResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_SetMonitoringModeResponse, diagnosticInfosSize) - offsetof(UA_SetMonitoringModeResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* BrowseResultMask */ +#define BrowseResultMask_members NULL + +/* RequestHeader */ +static UA_DataTypeMember RequestHeader_members[7] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AuthenticationToken") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, timestamp) - offsetof(UA_RequestHeader, authenticationToken) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Timestamp") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, requestHandle) - offsetof(UA_RequestHeader, timestamp) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHandle") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, returnDiagnostics) - offsetof(UA_RequestHeader, requestHandle) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReturnDiagnostics") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, auditEntryId) - offsetof(UA_RequestHeader, returnDiagnostics) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AuditEntryId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, timeoutHint) - offsetof(UA_RequestHeader, auditEntryId) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TimeoutHint") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_RequestHeader, additionalHeader) - offsetof(UA_RequestHeader, timeoutHint) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AdditionalHeader") /* .memberName */ +},}; + +/* MonitoredItemModifyResult */ +static UA_DataTypeMember MonitoredItemModifyResult_members[4] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemModifyResult, revisedSamplingInterval) - offsetof(UA_MonitoredItemModifyResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedSamplingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemModifyResult, revisedQueueSize) - offsetof(UA_MonitoredItemModifyResult, revisedSamplingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedQueueSize") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemModifyResult, filterResult) - offsetof(UA_MonitoredItemModifyResult, revisedQueueSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("FilterResult") /* .memberName */ +},}; + +/* CloseSecureChannelRequest */ +static UA_DataTypeMember CloseSecureChannelRequest_members[1] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +},}; + +/* NotificationMessage */ +static UA_DataTypeMember NotificationMessage_members[3] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SequenceNumber") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_NotificationMessage, publishTime) - offsetof(UA_NotificationMessage, sequenceNumber) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PublishTime") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_NotificationMessage, notificationDataSize) - offsetof(UA_NotificationMessage, publishTime) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NotificationData") /* .memberName */ +},}; + +/* CreateSubscriptionResponse */ +static UA_DataTypeMember CreateSubscriptionResponse_members[5] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionResponse, subscriptionId) - offsetof(UA_CreateSubscriptionResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionResponse, revisedPublishingInterval) - offsetof(UA_CreateSubscriptionResponse, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedPublishingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionResponse, revisedLifetimeCount) - offsetof(UA_CreateSubscriptionResponse, revisedPublishingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedLifetimeCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionResponse, revisedMaxKeepAliveCount) - offsetof(UA_CreateSubscriptionResponse, revisedLifetimeCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedMaxKeepAliveCount") /* .memberName */ +},}; + +/* EnumDefinition */ +static UA_DataTypeMember EnumDefinition_members[1] = { +{ + UA_TYPES_ENUMFIELD, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Fields") /* .memberName */ +},}; + +/* AxisScaleEnumeration */ +#define AxisScaleEnumeration_members NULL + +/* BrowseDirection */ +#define BrowseDirection_members NULL + +/* CallMethodRequest */ +static UA_DataTypeMember CallMethodRequest_members[3] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ObjectId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_CallMethodRequest, methodId) - offsetof(UA_CallMethodRequest, objectId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MethodId") /* .memberName */ +}, +{ + UA_TYPES_VARIANT, /* .memberTypeIndex */ + offsetof(UA_CallMethodRequest, inputArgumentsSize) - offsetof(UA_CallMethodRequest, methodId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("InputArguments") /* .memberName */ +},}; + +/* ReadResponse */ +static UA_DataTypeMember ReadResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_DATAVALUE, /* .memberTypeIndex */ + offsetof(UA_ReadResponse, resultsSize) - offsetof(UA_ReadResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ReadResponse, diagnosticInfosSize) - offsetof(UA_ReadResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* TimestampsToReturn */ +#define TimestampsToReturn_members NULL + +/* NodeClass */ +#define NodeClass_members NULL + +/* ObjectTypeAttributes */ +static UA_DataTypeMember ObjectTypeAttributes_members[6] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ObjectTypeAttributes, displayName) - offsetof(UA_ObjectTypeAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ObjectTypeAttributes, description) - offsetof(UA_ObjectTypeAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ObjectTypeAttributes, writeMask) - offsetof(UA_ObjectTypeAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ObjectTypeAttributes, userWriteMask) - offsetof(UA_ObjectTypeAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_ObjectTypeAttributes, isAbstract) - offsetof(UA_ObjectTypeAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsAbstract") /* .memberName */ +},}; + +/* SecurityTokenRequestType */ +#define SecurityTokenRequestType_members NULL + +/* CloseSessionResponse */ +static UA_DataTypeMember CloseSessionResponse_members[1] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +},}; + +/* SetPublishingModeRequest */ +static UA_DataTypeMember SetPublishingModeRequest_members[3] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_SetPublishingModeRequest, publishingEnabled) - offsetof(UA_SetPublishingModeRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PublishingEnabled") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetPublishingModeRequest, subscriptionIdsSize) - offsetof(UA_SetPublishingModeRequest, publishingEnabled) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionIds") /* .memberName */ +},}; + +/* IssuedIdentityToken */ +static UA_DataTypeMember IssuedIdentityToken_members[3] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_IssuedIdentityToken, tokenData) - offsetof(UA_IssuedIdentityToken, policyId) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TokenData") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_IssuedIdentityToken, encryptionAlgorithm) - offsetof(UA_IssuedIdentityToken, tokenData) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EncryptionAlgorithm") /* .memberName */ +},}; + +/* DeleteMonitoredItemsResponse */ +static UA_DataTypeMember DeleteMonitoredItemsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_DeleteMonitoredItemsResponse, resultsSize) - offsetof(UA_DeleteMonitoredItemsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_DeleteMonitoredItemsResponse, diagnosticInfosSize) - offsetof(UA_DeleteMonitoredItemsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* ApplicationType */ +#define ApplicationType_members NULL + +/* BrowseNextRequest */ +static UA_DataTypeMember BrowseNextRequest_members[3] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_BrowseNextRequest, releaseContinuationPoints) - offsetof(UA_BrowseNextRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReleaseContinuationPoints") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_BrowseNextRequest, continuationPointsSize) - offsetof(UA_BrowseNextRequest, releaseContinuationPoints) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ContinuationPoints") /* .memberName */ +},}; + +/* ModifySubscriptionRequest */ +static UA_DataTypeMember ModifySubscriptionRequest_members[7] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, subscriptionId) - offsetof(UA_ModifySubscriptionRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, requestedPublishingInterval) - offsetof(UA_ModifySubscriptionRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedPublishingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, requestedLifetimeCount) - offsetof(UA_ModifySubscriptionRequest, requestedPublishingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedLifetimeCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, requestedMaxKeepAliveCount) - offsetof(UA_ModifySubscriptionRequest, requestedLifetimeCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedMaxKeepAliveCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, maxNotificationsPerPublish) - offsetof(UA_ModifySubscriptionRequest, requestedMaxKeepAliveCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxNotificationsPerPublish") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_ModifySubscriptionRequest, priority) - offsetof(UA_ModifySubscriptionRequest, maxNotificationsPerPublish) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Priority") /* .memberName */ +},}; + +/* BrowseDescription */ +static UA_DataTypeMember BrowseDescription_members[6] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_BROWSEDIRECTION, /* .memberTypeIndex */ + offsetof(UA_BrowseDescription, browseDirection) - offsetof(UA_BrowseDescription, nodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowseDirection") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_BrowseDescription, referenceTypeId) - offsetof(UA_BrowseDescription, browseDirection) - sizeof(UA_BrowseDirection), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_BrowseDescription, includeSubtypes) - offsetof(UA_BrowseDescription, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IncludeSubtypes") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_BrowseDescription, nodeClassMask) - offsetof(UA_BrowseDescription, includeSubtypes) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeClassMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_BrowseDescription, resultMask) - offsetof(UA_BrowseDescription, nodeClassMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResultMask") /* .memberName */ +},}; + +/* SignedSoftwareCertificate */ +static UA_DataTypeMember SignedSoftwareCertificate_members[2] = { +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CertificateData") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_SignedSoftwareCertificate, signature) - offsetof(UA_SignedSoftwareCertificate, certificateData) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Signature") /* .memberName */ +},}; + +/* BrowsePathTarget */ +static UA_DataTypeMember BrowsePathTarget_members[2] = { +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_BrowsePathTarget, remainingPathIndex) - offsetof(UA_BrowsePathTarget, targetId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RemainingPathIndex") /* .memberName */ +},}; + +/* WriteResponse */ +static UA_DataTypeMember WriteResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_WriteResponse, resultsSize) - offsetof(UA_WriteResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_WriteResponse, diagnosticInfosSize) - offsetof(UA_WriteResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* AddNodesResult */ +static UA_DataTypeMember AddNodesResult_members[2] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_AddNodesResult, addedNodeId) - offsetof(UA_AddNodesResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AddedNodeId") /* .memberName */ +},}; + +/* AddReferencesItem */ +static UA_DataTypeMember AddReferencesItem_members[6] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SourceNodeId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_AddReferencesItem, referenceTypeId) - offsetof(UA_AddReferencesItem, sourceNodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_AddReferencesItem, isForward) - offsetof(UA_AddReferencesItem, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsForward") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_AddReferencesItem, targetServerUri) - offsetof(UA_AddReferencesItem, isForward) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetServerUri") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_AddReferencesItem, targetNodeId) - offsetof(UA_AddReferencesItem, targetServerUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetNodeId") /* .memberName */ +}, +{ + UA_TYPES_NODECLASS, /* .memberTypeIndex */ + offsetof(UA_AddReferencesItem, targetNodeClass) - offsetof(UA_AddReferencesItem, targetNodeId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetNodeClass") /* .memberName */ +},}; + +/* DeleteReferencesResponse */ +static UA_DataTypeMember DeleteReferencesResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesResponse, resultsSize) - offsetof(UA_DeleteReferencesResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesResponse, diagnosticInfosSize) - offsetof(UA_DeleteReferencesResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* RelativePathElement */ +static UA_DataTypeMember RelativePathElement_members[4] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_RelativePathElement, isInverse) - offsetof(UA_RelativePathElement, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsInverse") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_RelativePathElement, includeSubtypes) - offsetof(UA_RelativePathElement, isInverse) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IncludeSubtypes") /* .memberName */ +}, +{ + UA_TYPES_QUALIFIEDNAME, /* .memberTypeIndex */ + offsetof(UA_RelativePathElement, targetName) - offsetof(UA_RelativePathElement, includeSubtypes) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetName") /* .memberName */ +},}; + +/* SubscriptionAcknowledgement */ +static UA_DataTypeMember SubscriptionAcknowledgement_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SubscriptionAcknowledgement, sequenceNumber) - offsetof(UA_SubscriptionAcknowledgement, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SequenceNumber") /* .memberName */ +},}; + +/* TransferResult */ +static UA_DataTypeMember TransferResult_members[2] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TransferResult, availableSequenceNumbersSize) - offsetof(UA_TransferResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AvailableSequenceNumbers") /* .memberName */ +},}; + +/* CreateMonitoredItemsResponse */ +static UA_DataTypeMember CreateMonitoredItemsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_MONITOREDITEMCREATERESULT, /* .memberTypeIndex */ + offsetof(UA_CreateMonitoredItemsResponse, resultsSize) - offsetof(UA_CreateMonitoredItemsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_CreateMonitoredItemsResponse, diagnosticInfosSize) - offsetof(UA_CreateMonitoredItemsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* DeleteReferencesItem */ +static UA_DataTypeMember DeleteReferencesItem_members[5] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SourceNodeId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesItem, referenceTypeId) - offsetof(UA_DeleteReferencesItem, sourceNodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesItem, isForward) - offsetof(UA_DeleteReferencesItem, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsForward") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesItem, targetNodeId) - offsetof(UA_DeleteReferencesItem, isForward) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TargetNodeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesItem, deleteBidirectional) - offsetof(UA_DeleteReferencesItem, targetNodeId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DeleteBidirectional") /* .memberName */ +},}; + +/* WriteValue */ +static UA_DataTypeMember WriteValue_members[4] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_WriteValue, attributeId) - offsetof(UA_WriteValue, nodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AttributeId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_WriteValue, indexRange) - offsetof(UA_WriteValue, attributeId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IndexRange") /* .memberName */ +}, +{ + UA_TYPES_DATAVALUE, /* .memberTypeIndex */ + offsetof(UA_WriteValue, value) - offsetof(UA_WriteValue, indexRange) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Value") /* .memberName */ +},}; + +/* DataTypeAttributes */ +static UA_DataTypeMember DataTypeAttributes_members[6] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_DataTypeAttributes, displayName) - offsetof(UA_DataTypeAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_DataTypeAttributes, description) - offsetof(UA_DataTypeAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DataTypeAttributes, writeMask) - offsetof(UA_DataTypeAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DataTypeAttributes, userWriteMask) - offsetof(UA_DataTypeAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_DataTypeAttributes, isAbstract) - offsetof(UA_DataTypeAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsAbstract") /* .memberName */ +},}; + +/* TransferSubscriptionsResponse */ +static UA_DataTypeMember TransferSubscriptionsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_TRANSFERRESULT, /* .memberTypeIndex */ + offsetof(UA_TransferSubscriptionsResponse, resultsSize) - offsetof(UA_TransferSubscriptionsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_TransferSubscriptionsResponse, diagnosticInfosSize) - offsetof(UA_TransferSubscriptionsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* AddReferencesResponse */ +static UA_DataTypeMember AddReferencesResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_AddReferencesResponse, resultsSize) - offsetof(UA_AddReferencesResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_AddReferencesResponse, diagnosticInfosSize) - offsetof(UA_AddReferencesResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* DeadbandType */ +#define DeadbandType_members NULL + +/* DataChangeTrigger */ +#define DataChangeTrigger_members NULL + +/* BuildInfo */ +static UA_DataTypeMember BuildInfo_members[6] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProductUri") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_BuildInfo, manufacturerName) - offsetof(UA_BuildInfo, productUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ManufacturerName") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_BuildInfo, productName) - offsetof(UA_BuildInfo, manufacturerName) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProductName") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_BuildInfo, softwareVersion) - offsetof(UA_BuildInfo, productName) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SoftwareVersion") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_BuildInfo, buildNumber) - offsetof(UA_BuildInfo, softwareVersion) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BuildNumber") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_BuildInfo, buildDate) - offsetof(UA_BuildInfo, buildNumber) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BuildDate") /* .memberName */ +},}; + +/* FilterOperand */ +#define FilterOperand_members NULL + +/* MonitoringParameters */ +static UA_DataTypeMember MonitoringParameters_members[5] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientHandle") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_MonitoringParameters, samplingInterval) - offsetof(UA_MonitoringParameters, clientHandle) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SamplingInterval") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_MonitoringParameters, filter) - offsetof(UA_MonitoringParameters, samplingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Filter") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MonitoringParameters, queueSize) - offsetof(UA_MonitoringParameters, filter) - sizeof(UA_ExtensionObject), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("QueueSize") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_MonitoringParameters, discardOldest) - offsetof(UA_MonitoringParameters, queueSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiscardOldest") /* .memberName */ +},}; + +/* DoubleComplexNumberType */ +static UA_DataTypeMember DoubleComplexNumberType_members[2] = { +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Real") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_DoubleComplexNumberType, imaginary) - offsetof(UA_DoubleComplexNumberType, real) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Imaginary") /* .memberName */ +},}; + +/* DeleteNodesItem */ +static UA_DataTypeMember DeleteNodesItem_members[2] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_DeleteNodesItem, deleteTargetReferences) - offsetof(UA_DeleteNodesItem, nodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DeleteTargetReferences") /* .memberName */ +},}; + +/* ReadValueId */ +static UA_DataTypeMember ReadValueId_members[4] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ReadValueId, attributeId) - offsetof(UA_ReadValueId, nodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AttributeId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ReadValueId, indexRange) - offsetof(UA_ReadValueId, attributeId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IndexRange") /* .memberName */ +}, +{ + UA_TYPES_QUALIFIEDNAME, /* .memberTypeIndex */ + offsetof(UA_ReadValueId, dataEncoding) - offsetof(UA_ReadValueId, indexRange) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DataEncoding") /* .memberName */ +},}; + +/* CallRequest */ +static UA_DataTypeMember CallRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_CALLMETHODREQUEST, /* .memberTypeIndex */ + offsetof(UA_CallRequest, methodsToCallSize) - offsetof(UA_CallRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MethodsToCall") /* .memberName */ +},}; + +/* RelativePath */ +static UA_DataTypeMember RelativePath_members[1] = { +{ + UA_TYPES_RELATIVEPATHELEMENT, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Elements") /* .memberName */ +},}; + +/* DeleteNodesRequest */ +static UA_DataTypeMember DeleteNodesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_DELETENODESITEM, /* .memberTypeIndex */ + offsetof(UA_DeleteNodesRequest, nodesToDeleteSize) - offsetof(UA_DeleteNodesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToDelete") /* .memberName */ +},}; + +/* MonitoredItemModifyRequest */ +static UA_DataTypeMember MonitoredItemModifyRequest_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoredItemId") /* .memberName */ +}, +{ + UA_TYPES_MONITORINGPARAMETERS, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemModifyRequest, requestedParameters) - offsetof(UA_MonitoredItemModifyRequest, monitoredItemId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedParameters") /* .memberName */ +},}; + +/* UserTokenType */ +#define UserTokenType_members NULL + +/* AggregateConfiguration */ +static UA_DataTypeMember AggregateConfiguration_members[5] = { +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UseServerCapabilitiesDefaults") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_AggregateConfiguration, treatUncertainAsBad) - offsetof(UA_AggregateConfiguration, useServerCapabilitiesDefaults) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TreatUncertainAsBad") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_AggregateConfiguration, percentDataBad) - offsetof(UA_AggregateConfiguration, treatUncertainAsBad) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PercentDataBad") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_AggregateConfiguration, percentDataGood) - offsetof(UA_AggregateConfiguration, percentDataBad) - sizeof(UA_Byte), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PercentDataGood") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_AggregateConfiguration, useSlopedExtrapolation) - offsetof(UA_AggregateConfiguration, percentDataGood) - sizeof(UA_Byte), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UseSlopedExtrapolation") /* .memberName */ +},}; + +/* LocaleId */ +#define LocaleId_members NULL + +/* UnregisterNodesResponse */ +static UA_DataTypeMember UnregisterNodesResponse_members[1] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +},}; + +/* ContentFilterResult */ +static UA_DataTypeMember ContentFilterResult_members[2] = { +{ + UA_TYPES_CONTENTFILTERELEMENTRESULT, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ElementResults") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ContentFilterResult, elementDiagnosticInfosSize) - offsetof(UA_ContentFilterResult, elementResults) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ElementDiagnosticInfos") /* .memberName */ +},}; + +/* UserTokenPolicy */ +static UA_DataTypeMember UserTokenPolicy_members[5] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +}, +{ + UA_TYPES_USERTOKENTYPE, /* .memberTypeIndex */ + offsetof(UA_UserTokenPolicy, tokenType) - offsetof(UA_UserTokenPolicy, policyId) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TokenType") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_UserTokenPolicy, issuedTokenType) - offsetof(UA_UserTokenPolicy, tokenType) - sizeof(UA_UserTokenType), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IssuedTokenType") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_UserTokenPolicy, issuerEndpointUrl) - offsetof(UA_UserTokenPolicy, issuedTokenType) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IssuerEndpointUrl") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_UserTokenPolicy, securityPolicyUri) - offsetof(UA_UserTokenPolicy, issuerEndpointUrl) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityPolicyUri") /* .memberName */ +},}; + +/* DeleteMonitoredItemsRequest */ +static UA_DataTypeMember DeleteMonitoredItemsRequest_members[3] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DeleteMonitoredItemsRequest, subscriptionId) - offsetof(UA_DeleteMonitoredItemsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DeleteMonitoredItemsRequest, monitoredItemIdsSize) - offsetof(UA_DeleteMonitoredItemsRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoredItemIds") /* .memberName */ +},}; + +/* SetMonitoringModeRequest */ +static UA_DataTypeMember SetMonitoringModeRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetMonitoringModeRequest, subscriptionId) - offsetof(UA_SetMonitoringModeRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_MONITORINGMODE, /* .memberTypeIndex */ + offsetof(UA_SetMonitoringModeRequest, monitoringMode) - offsetof(UA_SetMonitoringModeRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoringMode") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetMonitoringModeRequest, monitoredItemIdsSize) - offsetof(UA_SetMonitoringModeRequest, monitoringMode) - sizeof(UA_MonitoringMode), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoredItemIds") /* .memberName */ +},}; + +/* Duration */ +#define Duration_members NULL + +/* ReferenceTypeAttributes */ +static UA_DataTypeMember ReferenceTypeAttributes_members[8] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, displayName) - offsetof(UA_ReferenceTypeAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, description) - offsetof(UA_ReferenceTypeAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, writeMask) - offsetof(UA_ReferenceTypeAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, userWriteMask) - offsetof(UA_ReferenceTypeAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, isAbstract) - offsetof(UA_ReferenceTypeAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsAbstract") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, symmetric) - offsetof(UA_ReferenceTypeAttributes, isAbstract) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Symmetric") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ReferenceTypeAttributes, inverseName) - offsetof(UA_ReferenceTypeAttributes, symmetric) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("InverseName") /* .memberName */ +},}; + +/* GetEndpointsRequest */ +static UA_DataTypeMember GetEndpointsRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_GetEndpointsRequest, endpointUrl) - offsetof(UA_GetEndpointsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EndpointUrl") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_GetEndpointsRequest, localeIdsSize) - offsetof(UA_GetEndpointsRequest, endpointUrl) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("LocaleIds") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_GetEndpointsRequest, profileUrisSize) - offsetof(UA_GetEndpointsRequest, localeIds) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProfileUris") /* .memberName */ +},}; + +/* CloseSecureChannelResponse */ +static UA_DataTypeMember CloseSecureChannelResponse_members[1] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +},}; + +/* ViewDescription */ +static UA_DataTypeMember ViewDescription_members[3] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ViewId") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_ViewDescription, timestamp) - offsetof(UA_ViewDescription, viewId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Timestamp") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ViewDescription, viewVersion) - offsetof(UA_ViewDescription, timestamp) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ViewVersion") /* .memberName */ +},}; + +/* SetPublishingModeResponse */ +static UA_DataTypeMember SetPublishingModeResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_SetPublishingModeResponse, resultsSize) - offsetof(UA_SetPublishingModeResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_SetPublishingModeResponse, diagnosticInfosSize) - offsetof(UA_SetPublishingModeResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* StatusChangeNotification */ +static UA_DataTypeMember StatusChangeNotification_members[2] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Status") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_StatusChangeNotification, diagnosticInfo) - offsetof(UA_StatusChangeNotification, status) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfo") /* .memberName */ +},}; + +/* StructureField */ +static UA_DataTypeMember StructureField_members[7] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Name") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_StructureField, description) - offsetof(UA_StructureField, name) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_StructureField, dataType) - offsetof(UA_StructureField, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DataType") /* .memberName */ +}, +{ + UA_TYPES_INT32, /* .memberTypeIndex */ + offsetof(UA_StructureField, valueRank) - offsetof(UA_StructureField, dataType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ValueRank") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_StructureField, arrayDimensionsSize) - offsetof(UA_StructureField, valueRank) - sizeof(UA_Int32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ArrayDimensions") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_StructureField, maxStringLength) - offsetof(UA_StructureField, arrayDimensions) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxStringLength") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_StructureField, isOptional) - offsetof(UA_StructureField, maxStringLength) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsOptional") /* .memberName */ +},}; + +/* NodeAttributesMask */ +#define NodeAttributesMask_members NULL + +/* EventFilterResult */ +static UA_DataTypeMember EventFilterResult_members[3] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SelectClauseResults") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_EventFilterResult, selectClauseDiagnosticInfosSize) - offsetof(UA_EventFilterResult, selectClauseResults) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SelectClauseDiagnosticInfos") /* .memberName */ +}, +{ + UA_TYPES_CONTENTFILTERRESULT, /* .memberTypeIndex */ + offsetof(UA_EventFilterResult, whereClauseResult) - offsetof(UA_EventFilterResult, selectClauseDiagnosticInfos) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WhereClauseResult") /* .memberName */ +},}; + +/* MonitoredItemCreateRequest */ +static UA_DataTypeMember MonitoredItemCreateRequest_members[3] = { +{ + UA_TYPES_READVALUEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ItemToMonitor") /* .memberName */ +}, +{ + UA_TYPES_MONITORINGMODE, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateRequest, monitoringMode) - offsetof(UA_MonitoredItemCreateRequest, itemToMonitor) - sizeof(UA_ReadValueId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoringMode") /* .memberName */ +}, +{ + UA_TYPES_MONITORINGPARAMETERS, /* .memberTypeIndex */ + offsetof(UA_MonitoredItemCreateRequest, requestedParameters) - offsetof(UA_MonitoredItemCreateRequest, monitoringMode) - sizeof(UA_MonitoringMode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedParameters") /* .memberName */ +},}; + +/* ComplexNumberType */ +static UA_DataTypeMember ComplexNumberType_members[2] = { +{ + UA_TYPES_FLOAT, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Real") /* .memberName */ +}, +{ + UA_TYPES_FLOAT, /* .memberTypeIndex */ + offsetof(UA_ComplexNumberType, imaginary) - offsetof(UA_ComplexNumberType, real) - sizeof(UA_Float), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Imaginary") /* .memberName */ +},}; + +/* Range */ +static UA_DataTypeMember Range_members[2] = { +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Low") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_Range, high) - offsetof(UA_Range, low) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("High") /* .memberName */ +},}; + +/* DataChangeNotification */ +static UA_DataTypeMember DataChangeNotification_members[2] = { +{ + UA_TYPES_MONITOREDITEMNOTIFICATION, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MonitoredItems") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_DataChangeNotification, diagnosticInfosSize) - offsetof(UA_DataChangeNotification, monitoredItems) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* Argument */ +static UA_DataTypeMember Argument_members[5] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Name") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_Argument, dataType) - offsetof(UA_Argument, name) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DataType") /* .memberName */ +}, +{ + UA_TYPES_INT32, /* .memberTypeIndex */ + offsetof(UA_Argument, valueRank) - offsetof(UA_Argument, dataType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ValueRank") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_Argument, arrayDimensionsSize) - offsetof(UA_Argument, valueRank) - sizeof(UA_Int32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ArrayDimensions") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_Argument, description) - offsetof(UA_Argument, arrayDimensions) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +},}; + +/* TransferSubscriptionsRequest */ +static UA_DataTypeMember TransferSubscriptionsRequest_members[3] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TransferSubscriptionsRequest, subscriptionIdsSize) - offsetof(UA_TransferSubscriptionsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionIds") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_TransferSubscriptionsRequest, sendInitialValues) - offsetof(UA_TransferSubscriptionsRequest, subscriptionIds) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SendInitialValues") /* .memberName */ +},}; + +/* ChannelSecurityToken */ +static UA_DataTypeMember ChannelSecurityToken_members[4] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ChannelId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ChannelSecurityToken, tokenId) - offsetof(UA_ChannelSecurityToken, channelId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TokenId") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_ChannelSecurityToken, createdAt) - offsetof(UA_ChannelSecurityToken, tokenId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CreatedAt") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ChannelSecurityToken, revisedLifetime) - offsetof(UA_ChannelSecurityToken, createdAt) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedLifetime") /* .memberName */ +},}; + +/* ServerState */ +#define ServerState_members NULL + +/* EventNotificationList */ +static UA_DataTypeMember EventNotificationList_members[1] = { +{ + UA_TYPES_EVENTFIELDLIST, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Events") /* .memberName */ +},}; + +/* AnonymousIdentityToken */ +static UA_DataTypeMember AnonymousIdentityToken_members[1] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +},}; + +/* FilterOperator */ +#define FilterOperator_members NULL + +/* AggregateFilter */ +static UA_DataTypeMember AggregateFilter_members[4] = { +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StartTime") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_AggregateFilter, aggregateType) - offsetof(UA_AggregateFilter, startTime) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AggregateType") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_AggregateFilter, processingInterval) - offsetof(UA_AggregateFilter, aggregateType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProcessingInterval") /* .memberName */ +}, +{ + UA_TYPES_AGGREGATECONFIGURATION, /* .memberTypeIndex */ + offsetof(UA_AggregateFilter, aggregateConfiguration) - offsetof(UA_AggregateFilter, processingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AggregateConfiguration") /* .memberName */ +},}; + +/* RepublishResponse */ +static UA_DataTypeMember RepublishResponse_members[2] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_NOTIFICATIONMESSAGE, /* .memberTypeIndex */ + offsetof(UA_RepublishResponse, notificationMessage) - offsetof(UA_RepublishResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NotificationMessage") /* .memberName */ +},}; + +/* DeleteSubscriptionsResponse */ +static UA_DataTypeMember DeleteSubscriptionsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_DeleteSubscriptionsResponse, resultsSize) - offsetof(UA_DeleteSubscriptionsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_DeleteSubscriptionsResponse, diagnosticInfosSize) - offsetof(UA_DeleteSubscriptionsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* RegisterNodesRequest */ +static UA_DataTypeMember RegisterNodesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_RegisterNodesRequest, nodesToRegisterSize) - offsetof(UA_RegisterNodesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToRegister") /* .memberName */ +},}; + +/* StructureDefinition */ +static UA_DataTypeMember StructureDefinition_members[4] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DefaultEncodingId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_StructureDefinition, baseDataType) - offsetof(UA_StructureDefinition, defaultEncodingId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BaseDataType") /* .memberName */ +}, +{ + UA_TYPES_STRUCTURETYPE, /* .memberTypeIndex */ + offsetof(UA_StructureDefinition, structureType) - offsetof(UA_StructureDefinition, baseDataType) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StructureType") /* .memberName */ +}, +{ + UA_TYPES_STRUCTUREFIELD, /* .memberTypeIndex */ + offsetof(UA_StructureDefinition, fieldsSize) - offsetof(UA_StructureDefinition, structureType) - sizeof(UA_StructureType), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Fields") /* .memberName */ +},}; + +/* MethodAttributes */ +static UA_DataTypeMember MethodAttributes_members[7] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, displayName) - offsetof(UA_MethodAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, description) - offsetof(UA_MethodAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, writeMask) - offsetof(UA_MethodAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, userWriteMask) - offsetof(UA_MethodAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, executable) - offsetof(UA_MethodAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Executable") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_MethodAttributes, userExecutable) - offsetof(UA_MethodAttributes, executable) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserExecutable") /* .memberName */ +},}; + +/* UserNameIdentityToken */ +static UA_DataTypeMember UserNameIdentityToken_members[4] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PolicyId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_UserNameIdentityToken, userName) - offsetof(UA_UserNameIdentityToken, policyId) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserName") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_UserNameIdentityToken, password) - offsetof(UA_UserNameIdentityToken, userName) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Password") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_UserNameIdentityToken, encryptionAlgorithm) - offsetof(UA_UserNameIdentityToken, password) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EncryptionAlgorithm") /* .memberName */ +},}; + +/* UnregisterNodesRequest */ +static UA_DataTypeMember UnregisterNodesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_UnregisterNodesRequest, nodesToUnregisterSize) - offsetof(UA_UnregisterNodesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToUnregister") /* .memberName */ +},}; + +/* OpenSecureChannelResponse */ +static UA_DataTypeMember OpenSecureChannelResponse_members[4] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelResponse, serverProtocolVersion) - offsetof(UA_OpenSecureChannelResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerProtocolVersion") /* .memberName */ +}, +{ + UA_TYPES_CHANNELSECURITYTOKEN, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelResponse, securityToken) - offsetof(UA_OpenSecureChannelResponse, serverProtocolVersion) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityToken") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelResponse, serverNonce) - offsetof(UA_OpenSecureChannelResponse, securityToken) - sizeof(UA_ChannelSecurityToken), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerNonce") /* .memberName */ +},}; + +/* SetTriggeringResponse */ +static UA_DataTypeMember SetTriggeringResponse_members[5] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringResponse, addResultsSize) - offsetof(UA_SetTriggeringResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AddResults") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringResponse, addDiagnosticInfosSize) - offsetof(UA_SetTriggeringResponse, addResults) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AddDiagnosticInfos") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringResponse, removeResultsSize) - offsetof(UA_SetTriggeringResponse, addDiagnosticInfos) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RemoveResults") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringResponse, removeDiagnosticInfosSize) - offsetof(UA_SetTriggeringResponse, removeResults) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RemoveDiagnosticInfos") /* .memberName */ +},}; + +/* SimpleAttributeOperand */ +static UA_DataTypeMember SimpleAttributeOperand_members[4] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TypeDefinitionId") /* .memberName */ +}, +{ + UA_TYPES_QUALIFIEDNAME, /* .memberTypeIndex */ + offsetof(UA_SimpleAttributeOperand, browsePathSize) - offsetof(UA_SimpleAttributeOperand, typeDefinitionId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowsePath") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SimpleAttributeOperand, attributeId) - offsetof(UA_SimpleAttributeOperand, browsePath) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AttributeId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_SimpleAttributeOperand, indexRange) - offsetof(UA_SimpleAttributeOperand, attributeId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IndexRange") /* .memberName */ +},}; + +/* RepublishRequest */ +static UA_DataTypeMember RepublishRequest_members[3] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_RepublishRequest, subscriptionId) - offsetof(UA_RepublishRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_RepublishRequest, retransmitSequenceNumber) - offsetof(UA_RepublishRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RetransmitSequenceNumber") /* .memberName */ +},}; + +/* RegisterNodesResponse */ +static UA_DataTypeMember RegisterNodesResponse_members[2] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_RegisterNodesResponse, registeredNodeIdsSize) - offsetof(UA_RegisterNodesResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RegisteredNodeIds") /* .memberName */ +},}; + +/* ModifyMonitoredItemsResponse */ +static UA_DataTypeMember ModifyMonitoredItemsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_MONITOREDITEMMODIFYRESULT, /* .memberTypeIndex */ + offsetof(UA_ModifyMonitoredItemsResponse, resultsSize) - offsetof(UA_ModifyMonitoredItemsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_ModifyMonitoredItemsResponse, diagnosticInfosSize) - offsetof(UA_ModifyMonitoredItemsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* DeleteSubscriptionsRequest */ +static UA_DataTypeMember DeleteSubscriptionsRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DeleteSubscriptionsRequest, subscriptionIdsSize) - offsetof(UA_DeleteSubscriptionsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionIds") /* .memberName */ +},}; + +/* RedundancySupport */ +#define RedundancySupport_members NULL + +/* BrowsePath */ +static UA_DataTypeMember BrowsePath_members[2] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StartingNode") /* .memberName */ +}, +{ + UA_TYPES_RELATIVEPATH, /* .memberTypeIndex */ + offsetof(UA_BrowsePath, relativePath) - offsetof(UA_BrowsePath, startingNode) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RelativePath") /* .memberName */ +},}; + +/* ObjectAttributes */ +static UA_DataTypeMember ObjectAttributes_members[6] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SpecifiedAttributes") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ObjectAttributes, displayName) - offsetof(UA_ObjectAttributes, specifiedAttributes) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ObjectAttributes, description) - offsetof(UA_ObjectAttributes, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Description") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ObjectAttributes, writeMask) - offsetof(UA_ObjectAttributes, description) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WriteMask") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ObjectAttributes, userWriteMask) - offsetof(UA_ObjectAttributes, writeMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserWriteMask") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_ObjectAttributes, eventNotifier) - offsetof(UA_ObjectAttributes, userWriteMask) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EventNotifier") /* .memberName */ +},}; + +/* PublishRequest */ +static UA_DataTypeMember PublishRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT, /* .memberTypeIndex */ + offsetof(UA_PublishRequest, subscriptionAcknowledgementsSize) - offsetof(UA_PublishRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionAcknowledgements") /* .memberName */ +},}; + +/* FindServersRequest */ +static UA_DataTypeMember FindServersRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_FindServersRequest, endpointUrl) - offsetof(UA_FindServersRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EndpointUrl") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_FindServersRequest, localeIdsSize) - offsetof(UA_FindServersRequest, endpointUrl) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("LocaleIds") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_FindServersRequest, serverUrisSize) - offsetof(UA_FindServersRequest, localeIds) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerUris") /* .memberName */ +},}; + +/* ReferenceDescription */ +static UA_DataTypeMember ReferenceDescription_members[7] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, isForward) - offsetof(UA_ReferenceDescription, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IsForward") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, nodeId) - offsetof(UA_ReferenceDescription, isForward) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_QUALIFIEDNAME, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, browseName) - offsetof(UA_ReferenceDescription, nodeId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowseName") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, displayName) - offsetof(UA_ReferenceDescription, browseName) - sizeof(UA_QualifiedName), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DisplayName") /* .memberName */ +}, +{ + UA_TYPES_NODECLASS, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, nodeClass) - offsetof(UA_ReferenceDescription, displayName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeClass") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_ReferenceDescription, typeDefinition) - offsetof(UA_ReferenceDescription, nodeClass) - sizeof(UA_NodeClass), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TypeDefinition") /* .memberName */ +},}; + +/* CreateSubscriptionRequest */ +static UA_DataTypeMember CreateSubscriptionRequest_members[7] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, requestedPublishingInterval) - offsetof(UA_CreateSubscriptionRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedPublishingInterval") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, requestedLifetimeCount) - offsetof(UA_CreateSubscriptionRequest, requestedPublishingInterval) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedLifetimeCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, requestedMaxKeepAliveCount) - offsetof(UA_CreateSubscriptionRequest, requestedLifetimeCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedMaxKeepAliveCount") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, maxNotificationsPerPublish) - offsetof(UA_CreateSubscriptionRequest, requestedMaxKeepAliveCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxNotificationsPerPublish") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, publishingEnabled) - offsetof(UA_CreateSubscriptionRequest, maxNotificationsPerPublish) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("PublishingEnabled") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_CreateSubscriptionRequest, priority) - offsetof(UA_CreateSubscriptionRequest, publishingEnabled) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Priority") /* .memberName */ +},}; + +/* CallResponse */ +static UA_DataTypeMember CallResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_CALLMETHODRESULT, /* .memberTypeIndex */ + offsetof(UA_CallResponse, resultsSize) - offsetof(UA_CallResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_CallResponse, diagnosticInfosSize) - offsetof(UA_CallResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* DeleteNodesResponse */ +static UA_DataTypeMember DeleteNodesResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_DeleteNodesResponse, resultsSize) - offsetof(UA_DeleteNodesResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_DeleteNodesResponse, diagnosticInfosSize) - offsetof(UA_DeleteNodesResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* ModifyMonitoredItemsRequest */ +static UA_DataTypeMember ModifyMonitoredItemsRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ModifyMonitoredItemsRequest, subscriptionId) - offsetof(UA_ModifyMonitoredItemsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_TIMESTAMPSTORETURN, /* .memberTypeIndex */ + offsetof(UA_ModifyMonitoredItemsRequest, timestampsToReturn) - offsetof(UA_ModifyMonitoredItemsRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TimestampsToReturn") /* .memberName */ +}, +{ + UA_TYPES_MONITOREDITEMMODIFYREQUEST, /* .memberTypeIndex */ + offsetof(UA_ModifyMonitoredItemsRequest, itemsToModifySize) - offsetof(UA_ModifyMonitoredItemsRequest, timestampsToReturn) - sizeof(UA_TimestampsToReturn), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ItemsToModify") /* .memberName */ +},}; + +/* ServiceFault */ +static UA_DataTypeMember ServiceFault_members[1] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +},}; + +/* PublishResponse */ +static UA_DataTypeMember PublishResponse_members[7] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, subscriptionId) - offsetof(UA_PublishResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, availableSequenceNumbersSize) - offsetof(UA_PublishResponse, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AvailableSequenceNumbers") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, moreNotifications) - offsetof(UA_PublishResponse, availableSequenceNumbers) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MoreNotifications") /* .memberName */ +}, +{ + UA_TYPES_NOTIFICATIONMESSAGE, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, notificationMessage) - offsetof(UA_PublishResponse, moreNotifications) - sizeof(UA_Boolean), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NotificationMessage") /* .memberName */ +}, +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, resultsSize) - offsetof(UA_PublishResponse, notificationMessage) - sizeof(UA_NotificationMessage), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_PublishResponse, diagnosticInfosSize) - offsetof(UA_PublishResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* CreateMonitoredItemsRequest */ +static UA_DataTypeMember CreateMonitoredItemsRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateMonitoredItemsRequest, subscriptionId) - offsetof(UA_CreateMonitoredItemsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_TIMESTAMPSTORETURN, /* .memberTypeIndex */ + offsetof(UA_CreateMonitoredItemsRequest, timestampsToReturn) - offsetof(UA_CreateMonitoredItemsRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TimestampsToReturn") /* .memberName */ +}, +{ + UA_TYPES_MONITOREDITEMCREATEREQUEST, /* .memberTypeIndex */ + offsetof(UA_CreateMonitoredItemsRequest, itemsToCreateSize) - offsetof(UA_CreateMonitoredItemsRequest, timestampsToReturn) - sizeof(UA_TimestampsToReturn), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ItemsToCreate") /* .memberName */ +},}; + +/* OpenSecureChannelRequest */ +static UA_DataTypeMember OpenSecureChannelRequest_members[6] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelRequest, clientProtocolVersion) - offsetof(UA_OpenSecureChannelRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientProtocolVersion") /* .memberName */ +}, +{ + UA_TYPES_SECURITYTOKENREQUESTTYPE, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelRequest, requestType) - offsetof(UA_OpenSecureChannelRequest, clientProtocolVersion) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestType") /* .memberName */ +}, +{ + UA_TYPES_MESSAGESECURITYMODE, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelRequest, securityMode) - offsetof(UA_OpenSecureChannelRequest, requestType) - sizeof(UA_SecurityTokenRequestType), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityMode") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelRequest, clientNonce) - offsetof(UA_OpenSecureChannelRequest, securityMode) - sizeof(UA_MessageSecurityMode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientNonce") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_OpenSecureChannelRequest, requestedLifetime) - offsetof(UA_OpenSecureChannelRequest, clientNonce) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedLifetime") /* .memberName */ +},}; + +/* CloseSessionRequest */ +static UA_DataTypeMember CloseSessionRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_BOOLEAN, /* .memberTypeIndex */ + offsetof(UA_CloseSessionRequest, deleteSubscriptions) - offsetof(UA_CloseSessionRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DeleteSubscriptions") /* .memberName */ +},}; + +/* SetTriggeringRequest */ +static UA_DataTypeMember SetTriggeringRequest_members[5] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringRequest, subscriptionId) - offsetof(UA_SetTriggeringRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SubscriptionId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringRequest, triggeringItemId) - offsetof(UA_SetTriggeringRequest, subscriptionId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TriggeringItemId") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringRequest, linksToAddSize) - offsetof(UA_SetTriggeringRequest, triggeringItemId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("LinksToAdd") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SetTriggeringRequest, linksToRemoveSize) - offsetof(UA_SetTriggeringRequest, linksToAdd) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("LinksToRemove") /* .memberName */ +},}; + +/* BrowseResult */ +static UA_DataTypeMember BrowseResult_members[3] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_BrowseResult, continuationPoint) - offsetof(UA_BrowseResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ContinuationPoint") /* .memberName */ +}, +{ + UA_TYPES_REFERENCEDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_BrowseResult, referencesSize) - offsetof(UA_BrowseResult, continuationPoint) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("References") /* .memberName */ +},}; + +/* AddReferencesRequest */ +static UA_DataTypeMember AddReferencesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_ADDREFERENCESITEM, /* .memberTypeIndex */ + offsetof(UA_AddReferencesRequest, referencesToAddSize) - offsetof(UA_AddReferencesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferencesToAdd") /* .memberName */ +},}; + +/* AddNodesItem */ +static UA_DataTypeMember AddNodesItem_members[7] = { +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ParentNodeId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, referenceTypeId) - offsetof(UA_AddNodesItem, parentNodeId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferenceTypeId") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, requestedNewNodeId) - offsetof(UA_AddNodesItem, referenceTypeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedNewNodeId") /* .memberName */ +}, +{ + UA_TYPES_QUALIFIEDNAME, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, browseName) - offsetof(UA_AddNodesItem, requestedNewNodeId) - sizeof(UA_ExpandedNodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowseName") /* .memberName */ +}, +{ + UA_TYPES_NODECLASS, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, nodeClass) - offsetof(UA_AddNodesItem, browseName) - sizeof(UA_QualifiedName), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeClass") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, nodeAttributes) - offsetof(UA_AddNodesItem, nodeClass) - sizeof(UA_NodeClass), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeAttributes") /* .memberName */ +}, +{ + UA_TYPES_EXPANDEDNODEID, /* .memberTypeIndex */ + offsetof(UA_AddNodesItem, typeDefinition) - offsetof(UA_AddNodesItem, nodeAttributes) - sizeof(UA_ExtensionObject), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TypeDefinition") /* .memberName */ +},}; + +/* ServerStatusDataType */ +static UA_DataTypeMember ServerStatusDataType_members[6] = { +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StartTime") /* .memberName */ +}, +{ + UA_TYPES_DATETIME, /* .memberTypeIndex */ + offsetof(UA_ServerStatusDataType, currentTime) - offsetof(UA_ServerStatusDataType, startTime) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("CurrentTime") /* .memberName */ +}, +{ + UA_TYPES_SERVERSTATE, /* .memberTypeIndex */ + offsetof(UA_ServerStatusDataType, state) - offsetof(UA_ServerStatusDataType, currentTime) - sizeof(UA_DateTime), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("State") /* .memberName */ +}, +{ + UA_TYPES_BUILDINFO, /* .memberTypeIndex */ + offsetof(UA_ServerStatusDataType, buildInfo) - offsetof(UA_ServerStatusDataType, state) - sizeof(UA_ServerState), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BuildInfo") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_ServerStatusDataType, secondsTillShutdown) - offsetof(UA_ServerStatusDataType, buildInfo) - sizeof(UA_BuildInfo), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecondsTillShutdown") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ServerStatusDataType, shutdownReason) - offsetof(UA_ServerStatusDataType, secondsTillShutdown) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ShutdownReason") /* .memberName */ +},}; + +/* BrowseNextResponse */ +static UA_DataTypeMember BrowseNextResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_BROWSERESULT, /* .memberTypeIndex */ + offsetof(UA_BrowseNextResponse, resultsSize) - offsetof(UA_BrowseNextResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_BrowseNextResponse, diagnosticInfosSize) - offsetof(UA_BrowseNextResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* AxisInformation */ +static UA_DataTypeMember AxisInformation_members[5] = { +{ + UA_TYPES_EUINFORMATION, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EngineeringUnits") /* .memberName */ +}, +{ + UA_TYPES_RANGE, /* .memberTypeIndex */ + offsetof(UA_AxisInformation, eURange) - offsetof(UA_AxisInformation, engineeringUnits) - sizeof(UA_EUInformation), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EURange") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_AxisInformation, title) - offsetof(UA_AxisInformation, eURange) - sizeof(UA_Range), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Title") /* .memberName */ +}, +{ + UA_TYPES_AXISSCALEENUMERATION, /* .memberTypeIndex */ + offsetof(UA_AxisInformation, axisScaleType) - offsetof(UA_AxisInformation, title) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AxisScaleType") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_AxisInformation, axisStepsSize) - offsetof(UA_AxisInformation, axisScaleType) - sizeof(UA_AxisScaleEnumeration), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AxisSteps") /* .memberName */ +},}; + +/* ApplicationDescription */ +static UA_DataTypeMember ApplicationDescription_members[7] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ApplicationUri") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, productUri) - offsetof(UA_ApplicationDescription, applicationUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProductUri") /* .memberName */ +}, +{ + UA_TYPES_LOCALIZEDTEXT, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, applicationName) - offsetof(UA_ApplicationDescription, productUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ApplicationName") /* .memberName */ +}, +{ + UA_TYPES_APPLICATIONTYPE, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, applicationType) - offsetof(UA_ApplicationDescription, applicationName) - sizeof(UA_LocalizedText), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ApplicationType") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, gatewayServerUri) - offsetof(UA_ApplicationDescription, applicationType) - sizeof(UA_ApplicationType), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("GatewayServerUri") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, discoveryProfileUri) - offsetof(UA_ApplicationDescription, gatewayServerUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiscoveryProfileUri") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ApplicationDescription, discoveryUrlsSize) - offsetof(UA_ApplicationDescription, discoveryProfileUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiscoveryUrls") /* .memberName */ +},}; + +/* ReadRequest */ +static UA_DataTypeMember ReadRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_ReadRequest, maxAge) - offsetof(UA_ReadRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxAge") /* .memberName */ +}, +{ + UA_TYPES_TIMESTAMPSTORETURN, /* .memberTypeIndex */ + offsetof(UA_ReadRequest, timestampsToReturn) - offsetof(UA_ReadRequest, maxAge) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TimestampsToReturn") /* .memberName */ +}, +{ + UA_TYPES_READVALUEID, /* .memberTypeIndex */ + offsetof(UA_ReadRequest, nodesToReadSize) - offsetof(UA_ReadRequest, timestampsToReturn) - sizeof(UA_TimestampsToReturn), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToRead") /* .memberName */ +},}; + +/* ActivateSessionRequest */ +static UA_DataTypeMember ActivateSessionRequest_members[6] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_SIGNATUREDATA, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionRequest, clientSignature) - offsetof(UA_ActivateSessionRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientSignature") /* .memberName */ +}, +{ + UA_TYPES_SIGNEDSOFTWARECERTIFICATE, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionRequest, clientSoftwareCertificatesSize) - offsetof(UA_ActivateSessionRequest, clientSignature) - sizeof(UA_SignatureData), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientSoftwareCertificates") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionRequest, localeIdsSize) - offsetof(UA_ActivateSessionRequest, clientSoftwareCertificates) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("LocaleIds") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionRequest, userIdentityToken) - offsetof(UA_ActivateSessionRequest, localeIds) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserIdentityToken") /* .memberName */ +}, +{ + UA_TYPES_SIGNATUREDATA, /* .memberTypeIndex */ + offsetof(UA_ActivateSessionRequest, userTokenSignature) - offsetof(UA_ActivateSessionRequest, userIdentityToken) - sizeof(UA_ExtensionObject), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserTokenSignature") /* .memberName */ +},}; + +/* BrowsePathResult */ +static UA_DataTypeMember BrowsePathResult_members[2] = { +{ + UA_TYPES_STATUSCODE, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("StatusCode") /* .memberName */ +}, +{ + UA_TYPES_BROWSEPATHTARGET, /* .memberTypeIndex */ + offsetof(UA_BrowsePathResult, targetsSize) - offsetof(UA_BrowsePathResult, statusCode) - sizeof(UA_StatusCode), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Targets") /* .memberName */ +},}; + +/* AddNodesRequest */ +static UA_DataTypeMember AddNodesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_ADDNODESITEM, /* .memberTypeIndex */ + offsetof(UA_AddNodesRequest, nodesToAddSize) - offsetof(UA_AddNodesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToAdd") /* .memberName */ +},}; + +/* BrowseRequest */ +static UA_DataTypeMember BrowseRequest_members[4] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_VIEWDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_BrowseRequest, view) - offsetof(UA_BrowseRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("View") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_BrowseRequest, requestedMaxReferencesPerNode) - offsetof(UA_BrowseRequest, view) - sizeof(UA_ViewDescription), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedMaxReferencesPerNode") /* .memberName */ +}, +{ + UA_TYPES_BROWSEDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_BrowseRequest, nodesToBrowseSize) - offsetof(UA_BrowseRequest, requestedMaxReferencesPerNode) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToBrowse") /* .memberName */ +},}; + +/* WriteRequest */ +static UA_DataTypeMember WriteRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_WRITEVALUE, /* .memberTypeIndex */ + offsetof(UA_WriteRequest, nodesToWriteSize) - offsetof(UA_WriteRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodesToWrite") /* .memberName */ +},}; + +/* AddNodesResponse */ +static UA_DataTypeMember AddNodesResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_ADDNODESRESULT, /* .memberTypeIndex */ + offsetof(UA_AddNodesResponse, resultsSize) - offsetof(UA_AddNodesResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_AddNodesResponse, diagnosticInfosSize) - offsetof(UA_AddNodesResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* AttributeOperand */ +static UA_DataTypeMember AttributeOperand_members[5] = { +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("NodeId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_AttributeOperand, alias) - offsetof(UA_AttributeOperand, nodeId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Alias") /* .memberName */ +}, +{ + UA_TYPES_RELATIVEPATH, /* .memberTypeIndex */ + offsetof(UA_AttributeOperand, browsePath) - offsetof(UA_AttributeOperand, alias) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowsePath") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_AttributeOperand, attributeId) - offsetof(UA_AttributeOperand, browsePath) - sizeof(UA_RelativePath), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AttributeId") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_AttributeOperand, indexRange) - offsetof(UA_AttributeOperand, attributeId) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("IndexRange") /* .memberName */ +},}; + +/* DataChangeFilter */ +static UA_DataTypeMember DataChangeFilter_members[3] = { +{ + UA_TYPES_DATACHANGETRIGGER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Trigger") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_DataChangeFilter, deadbandType) - offsetof(UA_DataChangeFilter, trigger) - sizeof(UA_DataChangeTrigger), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DeadbandType") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_DataChangeFilter, deadbandValue) - offsetof(UA_DataChangeFilter, deadbandType) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DeadbandValue") /* .memberName */ +},}; + +/* EndpointDescription */ +static UA_DataTypeMember EndpointDescription_members[8] = { +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EndpointUrl") /* .memberName */ +}, +{ + UA_TYPES_APPLICATIONDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, server) - offsetof(UA_EndpointDescription, endpointUrl) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Server") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, serverCertificate) - offsetof(UA_EndpointDescription, server) - sizeof(UA_ApplicationDescription), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerCertificate") /* .memberName */ +}, +{ + UA_TYPES_MESSAGESECURITYMODE, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, securityMode) - offsetof(UA_EndpointDescription, serverCertificate) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityMode") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, securityPolicyUri) - offsetof(UA_EndpointDescription, securityMode) - sizeof(UA_MessageSecurityMode), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityPolicyUri") /* .memberName */ +}, +{ + UA_TYPES_USERTOKENPOLICY, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, userIdentityTokensSize) - offsetof(UA_EndpointDescription, securityPolicyUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("UserIdentityTokens") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, transportProfileUri) - offsetof(UA_EndpointDescription, userIdentityTokens) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TransportProfileUri") /* .memberName */ +}, +{ + UA_TYPES_BYTE, /* .memberTypeIndex */ + offsetof(UA_EndpointDescription, securityLevel) - offsetof(UA_EndpointDescription, transportProfileUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityLevel") /* .memberName */ +},}; + +/* DeleteReferencesRequest */ +static UA_DataTypeMember DeleteReferencesRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_DELETEREFERENCESITEM, /* .memberTypeIndex */ + offsetof(UA_DeleteReferencesRequest, referencesToDeleteSize) - offsetof(UA_DeleteReferencesRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReferencesToDelete") /* .memberName */ +},}; + +/* TranslateBrowsePathsToNodeIdsRequest */ +static UA_DataTypeMember TranslateBrowsePathsToNodeIdsRequest_members[2] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_BROWSEPATH, /* .memberTypeIndex */ + offsetof(UA_TranslateBrowsePathsToNodeIdsRequest, browsePathsSize) - offsetof(UA_TranslateBrowsePathsToNodeIdsRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("BrowsePaths") /* .memberName */ +},}; + +/* FindServersResponse */ +static UA_DataTypeMember FindServersResponse_members[2] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_APPLICATIONDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_FindServersResponse, serversSize) - offsetof(UA_FindServersResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Servers") /* .memberName */ +},}; + +/* CreateSessionRequest */ +static UA_DataTypeMember CreateSessionRequest_members[9] = { +{ + UA_TYPES_REQUESTHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestHeader") /* .memberName */ +}, +{ + UA_TYPES_APPLICATIONDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, clientDescription) - offsetof(UA_CreateSessionRequest, requestHeader) - sizeof(UA_RequestHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientDescription") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, serverUri) - offsetof(UA_CreateSessionRequest, clientDescription) - sizeof(UA_ApplicationDescription), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerUri") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, endpointUrl) - offsetof(UA_CreateSessionRequest, serverUri) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EndpointUrl") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, sessionName) - offsetof(UA_CreateSessionRequest, endpointUrl) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SessionName") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, clientNonce) - offsetof(UA_CreateSessionRequest, sessionName) - sizeof(UA_String), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientNonce") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, clientCertificate) - offsetof(UA_CreateSessionRequest, clientNonce) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ClientCertificate") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, requestedSessionTimeout) - offsetof(UA_CreateSessionRequest, clientCertificate) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestedSessionTimeout") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSessionRequest, maxResponseMessageSize) - offsetof(UA_CreateSessionRequest, requestedSessionTimeout) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxResponseMessageSize") /* .memberName */ +},}; + +/* ContentFilterElement */ +static UA_DataTypeMember ContentFilterElement_members[2] = { +{ + UA_TYPES_FILTEROPERATOR, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("FilterOperator") /* .memberName */ +}, +{ + UA_TYPES_EXTENSIONOBJECT, /* .memberTypeIndex */ + offsetof(UA_ContentFilterElement, filterOperandsSize) - offsetof(UA_ContentFilterElement, filterOperator) - sizeof(UA_FilterOperator), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("FilterOperands") /* .memberName */ +},}; + +/* TranslateBrowsePathsToNodeIdsResponse */ +static UA_DataTypeMember TranslateBrowsePathsToNodeIdsResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_BROWSEPATHRESULT, /* .memberTypeIndex */ + offsetof(UA_TranslateBrowsePathsToNodeIdsResponse, resultsSize) - offsetof(UA_TranslateBrowsePathsToNodeIdsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_TranslateBrowsePathsToNodeIdsResponse, diagnosticInfosSize) - offsetof(UA_TranslateBrowsePathsToNodeIdsResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* BrowseResponse */ +static UA_DataTypeMember BrowseResponse_members[3] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_BROWSERESULT, /* .memberTypeIndex */ + offsetof(UA_BrowseResponse, resultsSize) - offsetof(UA_BrowseResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Results") /* .memberName */ +}, +{ + UA_TYPES_DIAGNOSTICINFO, /* .memberTypeIndex */ + offsetof(UA_BrowseResponse, diagnosticInfosSize) - offsetof(UA_BrowseResponse, results) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("DiagnosticInfos") /* .memberName */ +},}; + +/* CreateSessionResponse */ +static UA_DataTypeMember CreateSessionResponse_members[10] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, sessionId) - offsetof(UA_CreateSessionResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SessionId") /* .memberName */ +}, +{ + UA_TYPES_NODEID, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, authenticationToken) - offsetof(UA_CreateSessionResponse, sessionId) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("AuthenticationToken") /* .memberName */ +}, +{ + UA_TYPES_DOUBLE, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, revisedSessionTimeout) - offsetof(UA_CreateSessionResponse, authenticationToken) - sizeof(UA_NodeId), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RevisedSessionTimeout") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, serverNonce) - offsetof(UA_CreateSessionResponse, revisedSessionTimeout) - sizeof(UA_Double), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerNonce") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, serverCertificate) - offsetof(UA_CreateSessionResponse, serverNonce) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerCertificate") /* .memberName */ +}, +{ + UA_TYPES_ENDPOINTDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, serverEndpointsSize) - offsetof(UA_CreateSessionResponse, serverCertificate) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerEndpoints") /* .memberName */ +}, +{ + UA_TYPES_SIGNEDSOFTWARECERTIFICATE, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, serverSoftwareCertificatesSize) - offsetof(UA_CreateSessionResponse, serverEndpoints) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerSoftwareCertificates") /* .memberName */ +}, +{ + UA_TYPES_SIGNATUREDATA, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, serverSignature) - offsetof(UA_CreateSessionResponse, serverSoftwareCertificates) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ServerSignature") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_CreateSessionResponse, maxRequestMessageSize) - offsetof(UA_CreateSessionResponse, serverSignature) - sizeof(UA_SignatureData), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxRequestMessageSize") /* .memberName */ +},}; + +/* ContentFilter */ +static UA_DataTypeMember ContentFilter_members[1] = { +{ + UA_TYPES_CONTENTFILTERELEMENT, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Elements") /* .memberName */ +},}; + +/* GetEndpointsResponse */ +static UA_DataTypeMember GetEndpointsResponse_members[2] = { +{ + UA_TYPES_RESPONSEHEADER, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ResponseHeader") /* .memberName */ +}, +{ + UA_TYPES_ENDPOINTDESCRIPTION, /* .memberTypeIndex */ + offsetof(UA_GetEndpointsResponse, endpointsSize) - offsetof(UA_GetEndpointsResponse, responseHeader) - sizeof(UA_ResponseHeader), /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Endpoints") /* .memberName */ +},}; + +/* EventFilter */ +static UA_DataTypeMember EventFilter_members[2] = { +{ + UA_TYPES_SIMPLEATTRIBUTEOPERAND, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + true, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SelectClauses") /* .memberName */ +}, +{ + UA_TYPES_CONTENTFILTER, /* .memberTypeIndex */ + offsetof(UA_EventFilter, whereClause) - offsetof(UA_EventFilter, selectClauses) - sizeof(void *), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("WhereClause") /* .memberName */ +},}; +const UA_DataType UA_TYPES[UA_TYPES_COUNT] = { +/* Boolean */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {1LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Boolean), /* .memSize */ + UA_TYPES_BOOLEAN, /* .typeIndex */ + UA_DATATYPEKIND_BOOLEAN, /* .typeKind */ + true, /* .pointerFree */ + true, /* .overlayable */ + 0, /* .membersSize */ + Boolean_members /* .members */ + UA_TYPENAME("Boolean") /* .typeName */ +}, +/* SByte */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {2LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_SByte), /* .memSize */ + UA_TYPES_SBYTE, /* .typeIndex */ + UA_DATATYPEKIND_SBYTE, /* .typeKind */ + true, /* .pointerFree */ + true, /* .overlayable */ + 0, /* .membersSize */ + SByte_members /* .members */ + UA_TYPENAME("SByte") /* .typeName */ +}, +/* Byte */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {3LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Byte), /* .memSize */ + UA_TYPES_BYTE, /* .typeIndex */ + UA_DATATYPEKIND_BYTE, /* .typeKind */ + true, /* .pointerFree */ + true, /* .overlayable */ + 0, /* .membersSize */ + Byte_members /* .members */ + UA_TYPENAME("Byte") /* .typeName */ +}, +/* Int16 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {4LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Int16), /* .memSize */ + UA_TYPES_INT16, /* .typeIndex */ + UA_DATATYPEKIND_INT16, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + Int16_members /* .members */ + UA_TYPENAME("Int16") /* .typeName */ +}, +/* UInt16 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {5LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_UInt16), /* .memSize */ + UA_TYPES_UINT16, /* .typeIndex */ + UA_DATATYPEKIND_UINT16, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + UInt16_members /* .members */ + UA_TYPENAME("UInt16") /* .typeName */ +}, +/* Int32 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {6LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Int32), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_INT32, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + Int32_members /* .members */ + UA_TYPENAME("Int32") /* .typeName */ +}, +/* UInt32 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {7LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_UInt32), /* .memSize */ + UA_TYPES_UINT32, /* .typeIndex */ + UA_DATATYPEKIND_UINT32, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + UInt32_members /* .members */ + UA_TYPENAME("UInt32") /* .typeName */ +}, +/* Int64 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {8LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Int64), /* .memSize */ + UA_TYPES_INT64, /* .typeIndex */ + UA_DATATYPEKIND_INT64, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + Int64_members /* .members */ + UA_TYPENAME("Int64") /* .typeName */ +}, +/* UInt64 */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {9LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_UInt64), /* .memSize */ + UA_TYPES_UINT64, /* .typeIndex */ + UA_DATATYPEKIND_UINT64, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + UInt64_members /* .members */ + UA_TYPENAME("UInt64") /* .typeName */ +}, +/* Float */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {10LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Float), /* .memSize */ + UA_TYPES_FLOAT, /* .typeIndex */ + UA_DATATYPEKIND_FLOAT, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_FLOAT, /* .overlayable */ + 0, /* .membersSize */ + Float_members /* .members */ + UA_TYPENAME("Float") /* .typeName */ +}, +/* Double */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {11LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Double), /* .memSize */ + UA_TYPES_DOUBLE, /* .typeIndex */ + UA_DATATYPEKIND_DOUBLE, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_FLOAT, /* .overlayable */ + 0, /* .membersSize */ + Double_members /* .members */ + UA_TYPENAME("Double") /* .typeName */ +}, +/* String */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_String), /* .memSize */ + UA_TYPES_STRING, /* .typeIndex */ + UA_DATATYPEKIND_STRING, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + String_members /* .members */ + UA_TYPENAME("String") /* .typeName */ +}, +/* DateTime */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {13LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_DateTime), /* .memSize */ + UA_TYPES_DATETIME, /* .typeIndex */ + UA_DATATYPEKIND_DATETIME, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + DateTime_members /* .members */ + UA_TYPENAME("DateTime") /* .typeName */ +}, +/* Guid */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {14LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Guid), /* .memSize */ + UA_TYPES_GUID, /* .typeIndex */ + UA_DATATYPEKIND_GUID, /* .typeKind */ + true, /* .pointerFree */ + (UA_BINARY_OVERLAYABLE_INTEGER && offsetof(UA_Guid, data2) == sizeof(UA_UInt32) && offsetof(UA_Guid, data3) == (sizeof(UA_UInt16) + sizeof(UA_UInt32)) && offsetof(UA_Guid, data4) == (2*sizeof(UA_UInt32))), /* .overlayable */ + 0, /* .membersSize */ + Guid_members /* .members */ + UA_TYPENAME("Guid") /* .typeName */ +}, +/* ByteString */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {15LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ByteString), /* .memSize */ + UA_TYPES_BYTESTRING, /* .typeIndex */ + UA_DATATYPEKIND_BYTESTRING, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + ByteString_members /* .members */ + UA_TYPENAME("ByteString") /* .typeName */ +}, +/* XmlElement */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {16LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_XmlElement), /* .memSize */ + UA_TYPES_XMLELEMENT, /* .typeIndex */ + UA_DATATYPEKIND_XMLELEMENT, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + XmlElement_members /* .members */ + UA_TYPENAME("XmlElement") /* .typeName */ +}, +/* NodeId */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {17LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_NodeId), /* .memSize */ + UA_TYPES_NODEID, /* .typeIndex */ + UA_DATATYPEKIND_NODEID, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + NodeId_members /* .members */ + UA_TYPENAME("NodeId") /* .typeName */ +}, +/* ExpandedNodeId */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {18LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ExpandedNodeId), /* .memSize */ + UA_TYPES_EXPANDEDNODEID, /* .typeIndex */ + UA_DATATYPEKIND_EXPANDEDNODEID, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + ExpandedNodeId_members /* .members */ + UA_TYPENAME("ExpandedNodeId") /* .typeName */ +}, +/* StatusCode */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {19LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_StatusCode), /* .memSize */ + UA_TYPES_STATUSCODE, /* .typeIndex */ + UA_DATATYPEKIND_STATUSCODE, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + StatusCode_members /* .members */ + UA_TYPENAME("StatusCode") /* .typeName */ +}, +/* QualifiedName */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {20LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_QualifiedName), /* .memSize */ + UA_TYPES_QUALIFIEDNAME, /* .typeIndex */ + UA_DATATYPEKIND_QUALIFIEDNAME, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + QualifiedName_members /* .members */ + UA_TYPENAME("QualifiedName") /* .typeName */ +}, +/* LocalizedText */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {21LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_LocalizedText), /* .memSize */ + UA_TYPES_LOCALIZEDTEXT, /* .typeIndex */ + UA_DATATYPEKIND_LOCALIZEDTEXT, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + LocalizedText_members /* .members */ + UA_TYPENAME("LocalizedText") /* .typeName */ +}, +/* ExtensionObject */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {22LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ExtensionObject), /* .memSize */ + UA_TYPES_EXTENSIONOBJECT, /* .typeIndex */ + UA_DATATYPEKIND_EXTENSIONOBJECT, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + ExtensionObject_members /* .members */ + UA_TYPENAME("ExtensionObject") /* .typeName */ +}, +/* DataValue */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {23LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_DataValue), /* .memSize */ + UA_TYPES_DATAVALUE, /* .typeIndex */ + UA_DATATYPEKIND_DATAVALUE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + DataValue_members /* .members */ + UA_TYPENAME("DataValue") /* .typeName */ +}, +/* Variant */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {24LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Variant), /* .memSize */ + UA_TYPES_VARIANT, /* .typeIndex */ + UA_DATATYPEKIND_VARIANT, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + Variant_members /* .members */ + UA_TYPENAME("Variant") /* .typeName */ +}, +/* DiagnosticInfo */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {25LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_DiagnosticInfo), /* .memSize */ + UA_TYPES_DIAGNOSTICINFO, /* .typeIndex */ + UA_DATATYPEKIND_DIAGNOSTICINFO, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + DiagnosticInfo_members /* .members */ + UA_TYPENAME("DiagnosticInfo") /* .typeName */ +}, +/* ViewAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {373LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {375LU}}, /* .binaryEncodingId */ + sizeof(UA_ViewAttributes), /* .memSize */ + UA_TYPES_VIEWATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + ViewAttributes_members /* .members */ + UA_TYPENAME("ViewAttributes") /* .typeName */ +}, +/* XVType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12080LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {12090LU}}, /* .binaryEncodingId */ + sizeof(UA_XVType), /* .memSize */ + UA_TYPES_XVTYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + XVType_members /* .members */ + UA_TYPENAME("XVType") /* .typeName */ +}, +/* ElementOperand */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {592LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {594LU}}, /* .binaryEncodingId */ + sizeof(UA_ElementOperand), /* .memSize */ + UA_TYPES_ELEMENTOPERAND, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + ElementOperand_members /* .members */ + UA_TYPENAME("ElementOperand") /* .typeName */ +}, +/* VariableAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {355LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {357LU}}, /* .binaryEncodingId */ + sizeof(UA_VariableAttributes), /* .memSize */ + UA_TYPES_VARIABLEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 13, /* .membersSize */ + VariableAttributes_members /* .members */ + UA_TYPENAME("VariableAttributes") /* .typeName */ +}, +/* EnumValueType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {7594LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {8251LU}}, /* .binaryEncodingId */ + sizeof(UA_EnumValueType), /* .memSize */ + UA_TYPES_ENUMVALUETYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + EnumValueType_members /* .members */ + UA_TYPENAME("EnumValueType") /* .typeName */ +}, +/* EventFieldList */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {917LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {919LU}}, /* .binaryEncodingId */ + sizeof(UA_EventFieldList), /* .memSize */ + UA_TYPES_EVENTFIELDLIST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + EventFieldList_members /* .members */ + UA_TYPENAME("EventFieldList") /* .typeName */ +}, +/* MonitoredItemCreateResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {746LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {748LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoredItemCreateResult), /* .memSize */ + UA_TYPES_MONITOREDITEMCREATERESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + MonitoredItemCreateResult_members /* .members */ + UA_TYPENAME("MonitoredItemCreateResult") /* .typeName */ +}, +/* EUInformation */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {887LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {889LU}}, /* .binaryEncodingId */ + sizeof(UA_EUInformation), /* .memSize */ + UA_TYPES_EUINFORMATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + EUInformation_members /* .members */ + UA_TYPENAME("EUInformation") /* .typeName */ +}, +/* ServerDiagnosticsSummaryDataType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {859LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {861LU}}, /* .binaryEncodingId */ + sizeof(UA_ServerDiagnosticsSummaryDataType), /* .memSize */ + UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 12, /* .membersSize */ + ServerDiagnosticsSummaryDataType_members /* .members */ + UA_TYPENAME("ServerDiagnosticsSummaryDataType") /* .typeName */ +}, +/* ContentFilterElementResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {604LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {606LU}}, /* .binaryEncodingId */ + sizeof(UA_ContentFilterElementResult), /* .memSize */ + UA_TYPES_CONTENTFILTERELEMENTRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + ContentFilterElementResult_members /* .members */ + UA_TYPENAME("ContentFilterElementResult") /* .typeName */ +}, +/* LiteralOperand */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {595LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {597LU}}, /* .binaryEncodingId */ + sizeof(UA_LiteralOperand), /* .memSize */ + UA_TYPES_LITERALOPERAND, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + LiteralOperand_members /* .members */ + UA_TYPENAME("LiteralOperand") /* .typeName */ +}, +/* MessageSecurityMode */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {302LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_MessageSecurityMode), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + MessageSecurityMode_members /* .members */ + UA_TYPENAME("MessageSecurityMode") /* .typeName */ +}, +/* UtcTime */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {294LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_UtcTime), /* .memSize */ + UA_TYPES_UTCTIME, /* .typeIndex */ + UA_DATATYPEKIND_DATETIME, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + UtcTime_members /* .members */ + UA_TYPENAME("UtcTime") /* .typeName */ +}, +/* UserIdentityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {316LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {318LU}}, /* .binaryEncodingId */ + sizeof(UA_UserIdentityToken), /* .memSize */ + UA_TYPES_USERIDENTITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + UserIdentityToken_members /* .members */ + UA_TYPENAME("UserIdentityToken") /* .typeName */ +}, +/* X509IdentityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {325LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {327LU}}, /* .binaryEncodingId */ + sizeof(UA_X509IdentityToken), /* .memSize */ + UA_TYPES_X509IDENTITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + X509IdentityToken_members /* .members */ + UA_TYPENAME("X509IdentityToken") /* .typeName */ +}, +/* MonitoredItemNotification */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {806LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {808LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoredItemNotification), /* .memSize */ + UA_TYPES_MONITOREDITEMNOTIFICATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + MonitoredItemNotification_members /* .members */ + UA_TYPENAME("MonitoredItemNotification") /* .typeName */ +}, +/* StructureType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {98LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_StructureType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + StructureType_members /* .members */ + UA_TYPENAME("StructureType") /* .typeName */ +}, +/* ResponseHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {392LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {394LU}}, /* .binaryEncodingId */ + sizeof(UA_ResponseHeader), /* .memSize */ + UA_TYPES_RESPONSEHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + ResponseHeader_members /* .members */ + UA_TYPENAME("ResponseHeader") /* .typeName */ +}, +/* SignatureData */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {456LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {458LU}}, /* .binaryEncodingId */ + sizeof(UA_SignatureData), /* .memSize */ + UA_TYPES_SIGNATUREDATA, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + SignatureData_members /* .members */ + UA_TYPENAME("SignatureData") /* .typeName */ +}, +/* ModifySubscriptionResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {794LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {796LU}}, /* .binaryEncodingId */ + sizeof(UA_ModifySubscriptionResponse), /* .memSize */ + UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ModifySubscriptionResponse_members /* .members */ + UA_TYPENAME("ModifySubscriptionResponse") /* .typeName */ +}, +/* NodeAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {349LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {351LU}}, /* .binaryEncodingId */ + sizeof(UA_NodeAttributes), /* .memSize */ + UA_TYPES_NODEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + NodeAttributes_members /* .members */ + UA_TYPENAME("NodeAttributes") /* .typeName */ +}, +/* ActivateSessionResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {468LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {470LU}}, /* .binaryEncodingId */ + sizeof(UA_ActivateSessionResponse), /* .memSize */ + UA_TYPES_ACTIVATESESSIONRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ActivateSessionResponse_members /* .members */ + UA_TYPENAME("ActivateSessionResponse") /* .typeName */ +}, +/* EnumField */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {102LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {14845LU}}, /* .binaryEncodingId */ + sizeof(UA_EnumField), /* .memSize */ + UA_TYPES_ENUMFIELD, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + EnumField_members /* .members */ + UA_TYPENAME("EnumField") /* .typeName */ +}, +/* VariableTypeAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {364LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {366LU}}, /* .binaryEncodingId */ + sizeof(UA_VariableTypeAttributes), /* .memSize */ + UA_TYPES_VARIABLETYPEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 10, /* .membersSize */ + VariableTypeAttributes_members /* .members */ + UA_TYPENAME("VariableTypeAttributes") /* .typeName */ +}, +/* CallMethodResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {707LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {709LU}}, /* .binaryEncodingId */ + sizeof(UA_CallMethodResult), /* .memSize */ + UA_TYPES_CALLMETHODRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + CallMethodResult_members /* .members */ + UA_TYPENAME("CallMethodResult") /* .typeName */ +}, +/* MonitoringMode */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {716LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_MonitoringMode), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + MonitoringMode_members /* .members */ + UA_TYPENAME("MonitoringMode") /* .typeName */ +}, +/* SetMonitoringModeResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {770LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {772LU}}, /* .binaryEncodingId */ + sizeof(UA_SetMonitoringModeResponse), /* .memSize */ + UA_TYPES_SETMONITORINGMODERESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + SetMonitoringModeResponse_members /* .members */ + UA_TYPENAME("SetMonitoringModeResponse") /* .typeName */ +}, +/* BrowseResultMask */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {517LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_BrowseResultMask), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + BrowseResultMask_members /* .members */ + UA_TYPENAME("BrowseResultMask") /* .typeName */ +}, +/* RequestHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {389LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {391LU}}, /* .binaryEncodingId */ + sizeof(UA_RequestHeader), /* .memSize */ + UA_TYPES_REQUESTHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + RequestHeader_members /* .members */ + UA_TYPENAME("RequestHeader") /* .typeName */ +}, +/* MonitoredItemModifyResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {758LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {760LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoredItemModifyResult), /* .memSize */ + UA_TYPES_MONITOREDITEMMODIFYRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + MonitoredItemModifyResult_members /* .members */ + UA_TYPENAME("MonitoredItemModifyResult") /* .typeName */ +}, +/* CloseSecureChannelRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {450LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {452LU}}, /* .binaryEncodingId */ + sizeof(UA_CloseSecureChannelRequest), /* .memSize */ + UA_TYPES_CLOSESECURECHANNELREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + CloseSecureChannelRequest_members /* .members */ + UA_TYPENAME("CloseSecureChannelRequest") /* .typeName */ +}, +/* NotificationMessage */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {803LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {805LU}}, /* .binaryEncodingId */ + sizeof(UA_NotificationMessage), /* .memSize */ + UA_TYPES_NOTIFICATIONMESSAGE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + NotificationMessage_members /* .members */ + UA_TYPENAME("NotificationMessage") /* .typeName */ +}, +/* CreateSubscriptionResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {788LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {790LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateSubscriptionResponse), /* .memSize */ + UA_TYPES_CREATESUBSCRIPTIONRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + CreateSubscriptionResponse_members /* .members */ + UA_TYPENAME("CreateSubscriptionResponse") /* .typeName */ +}, +/* EnumDefinition */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {100LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {123LU}}, /* .binaryEncodingId */ + sizeof(UA_EnumDefinition), /* .memSize */ + UA_TYPES_ENUMDEFINITION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + EnumDefinition_members /* .members */ + UA_TYPENAME("EnumDefinition") /* .typeName */ +}, +/* AxisScaleEnumeration */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12077LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_AxisScaleEnumeration), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + AxisScaleEnumeration_members /* .members */ + UA_TYPENAME("AxisScaleEnumeration") /* .typeName */ +}, +/* BrowseDirection */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {510LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_BrowseDirection), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + BrowseDirection_members /* .members */ + UA_TYPENAME("BrowseDirection") /* .typeName */ +}, +/* CallMethodRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {704LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {706LU}}, /* .binaryEncodingId */ + sizeof(UA_CallMethodRequest), /* .memSize */ + UA_TYPES_CALLMETHODREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + CallMethodRequest_members /* .members */ + UA_TYPENAME("CallMethodRequest") /* .typeName */ +}, +/* ReadResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {632LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {634LU}}, /* .binaryEncodingId */ + sizeof(UA_ReadResponse), /* .memSize */ + UA_TYPES_READRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + ReadResponse_members /* .members */ + UA_TYPENAME("ReadResponse") /* .typeName */ +}, +/* TimestampsToReturn */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {625LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_TimestampsToReturn), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + TimestampsToReturn_members /* .members */ + UA_TYPENAME("TimestampsToReturn") /* .typeName */ +}, +/* NodeClass */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {257LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_NodeClass), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + NodeClass_members /* .members */ + UA_TYPENAME("NodeClass") /* .typeName */ +}, +/* ObjectTypeAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {361LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {363LU}}, /* .binaryEncodingId */ + sizeof(UA_ObjectTypeAttributes), /* .memSize */ + UA_TYPES_OBJECTTYPEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + ObjectTypeAttributes_members /* .members */ + UA_TYPENAME("ObjectTypeAttributes") /* .typeName */ +}, +/* SecurityTokenRequestType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {315LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_SecurityTokenRequestType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + SecurityTokenRequestType_members /* .members */ + UA_TYPENAME("SecurityTokenRequestType") /* .typeName */ +}, +/* CloseSessionResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {474LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {476LU}}, /* .binaryEncodingId */ + sizeof(UA_CloseSessionResponse), /* .memSize */ + UA_TYPES_CLOSESESSIONRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + CloseSessionResponse_members /* .members */ + UA_TYPENAME("CloseSessionResponse") /* .typeName */ +}, +/* SetPublishingModeRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {797LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {799LU}}, /* .binaryEncodingId */ + sizeof(UA_SetPublishingModeRequest), /* .memSize */ + UA_TYPES_SETPUBLISHINGMODEREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + SetPublishingModeRequest_members /* .members */ + UA_TYPENAME("SetPublishingModeRequest") /* .typeName */ +}, +/* IssuedIdentityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {938LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {940LU}}, /* .binaryEncodingId */ + sizeof(UA_IssuedIdentityToken), /* .memSize */ + UA_TYPES_ISSUEDIDENTITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + IssuedIdentityToken_members /* .members */ + UA_TYPENAME("IssuedIdentityToken") /* .typeName */ +}, +/* DeleteMonitoredItemsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {782LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {784LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteMonitoredItemsResponse), /* .memSize */ + UA_TYPES_DELETEMONITOREDITEMSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DeleteMonitoredItemsResponse_members /* .members */ + UA_TYPENAME("DeleteMonitoredItemsResponse") /* .typeName */ +}, +/* ApplicationType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {307LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ApplicationType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + ApplicationType_members /* .members */ + UA_TYPENAME("ApplicationType") /* .typeName */ +}, +/* BrowseNextRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {531LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {533LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseNextRequest), /* .memSize */ + UA_TYPES_BROWSENEXTREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + BrowseNextRequest_members /* .members */ + UA_TYPENAME("BrowseNextRequest") /* .typeName */ +}, +/* ModifySubscriptionRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {791LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {793LU}}, /* .binaryEncodingId */ + sizeof(UA_ModifySubscriptionRequest), /* .memSize */ + UA_TYPES_MODIFYSUBSCRIPTIONREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + ModifySubscriptionRequest_members /* .members */ + UA_TYPENAME("ModifySubscriptionRequest") /* .typeName */ +}, +/* BrowseDescription */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {514LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {516LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseDescription), /* .memSize */ + UA_TYPES_BROWSEDESCRIPTION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + BrowseDescription_members /* .members */ + UA_TYPENAME("BrowseDescription") /* .typeName */ +}, +/* SignedSoftwareCertificate */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {344LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {346LU}}, /* .binaryEncodingId */ + sizeof(UA_SignedSoftwareCertificate), /* .memSize */ + UA_TYPES_SIGNEDSOFTWARECERTIFICATE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + SignedSoftwareCertificate_members /* .members */ + UA_TYPENAME("SignedSoftwareCertificate") /* .typeName */ +}, +/* BrowsePathTarget */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {546LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {548LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowsePathTarget), /* .memSize */ + UA_TYPES_BROWSEPATHTARGET, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + BrowsePathTarget_members /* .members */ + UA_TYPENAME("BrowsePathTarget") /* .typeName */ +}, +/* WriteResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {674LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {676LU}}, /* .binaryEncodingId */ + sizeof(UA_WriteResponse), /* .memSize */ + UA_TYPES_WRITERESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + WriteResponse_members /* .members */ + UA_TYPENAME("WriteResponse") /* .typeName */ +}, +/* AddNodesResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {483LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {485LU}}, /* .binaryEncodingId */ + sizeof(UA_AddNodesResult), /* .memSize */ + UA_TYPES_ADDNODESRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + AddNodesResult_members /* .members */ + UA_TYPENAME("AddNodesResult") /* .typeName */ +}, +/* AddReferencesItem */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {379LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {381LU}}, /* .binaryEncodingId */ + sizeof(UA_AddReferencesItem), /* .memSize */ + UA_TYPES_ADDREFERENCESITEM, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + AddReferencesItem_members /* .members */ + UA_TYPENAME("AddReferencesItem") /* .typeName */ +}, +/* DeleteReferencesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {507LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {509LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteReferencesResponse), /* .memSize */ + UA_TYPES_DELETEREFERENCESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DeleteReferencesResponse_members /* .members */ + UA_TYPENAME("DeleteReferencesResponse") /* .typeName */ +}, +/* RelativePathElement */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {537LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {539LU}}, /* .binaryEncodingId */ + sizeof(UA_RelativePathElement), /* .memSize */ + UA_TYPES_RELATIVEPATHELEMENT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + RelativePathElement_members /* .members */ + UA_TYPENAME("RelativePathElement") /* .typeName */ +}, +/* SubscriptionAcknowledgement */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {821LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {823LU}}, /* .binaryEncodingId */ + sizeof(UA_SubscriptionAcknowledgement), /* .memSize */ + UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + SubscriptionAcknowledgement_members /* .members */ + UA_TYPENAME("SubscriptionAcknowledgement") /* .typeName */ +}, +/* TransferResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {836LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {838LU}}, /* .binaryEncodingId */ + sizeof(UA_TransferResult), /* .memSize */ + UA_TYPES_TRANSFERRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + TransferResult_members /* .members */ + UA_TYPENAME("TransferResult") /* .typeName */ +}, +/* CreateMonitoredItemsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {752LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {754LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateMonitoredItemsResponse), /* .memSize */ + UA_TYPES_CREATEMONITOREDITEMSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + CreateMonitoredItemsResponse_members /* .members */ + UA_TYPENAME("CreateMonitoredItemsResponse") /* .typeName */ +}, +/* DeleteReferencesItem */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {385LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {387LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteReferencesItem), /* .memSize */ + UA_TYPES_DELETEREFERENCESITEM, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + DeleteReferencesItem_members /* .members */ + UA_TYPENAME("DeleteReferencesItem") /* .typeName */ +}, +/* WriteValue */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {668LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {670LU}}, /* .binaryEncodingId */ + sizeof(UA_WriteValue), /* .memSize */ + UA_TYPES_WRITEVALUE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + WriteValue_members /* .members */ + UA_TYPENAME("WriteValue") /* .typeName */ +}, +/* DataTypeAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {370LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {372LU}}, /* .binaryEncodingId */ + sizeof(UA_DataTypeAttributes), /* .memSize */ + UA_TYPES_DATATYPEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + DataTypeAttributes_members /* .members */ + UA_TYPENAME("DataTypeAttributes") /* .typeName */ +}, +/* TransferSubscriptionsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {842LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {844LU}}, /* .binaryEncodingId */ + sizeof(UA_TransferSubscriptionsResponse), /* .memSize */ + UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + TransferSubscriptionsResponse_members /* .members */ + UA_TYPENAME("TransferSubscriptionsResponse") /* .typeName */ +}, +/* AddReferencesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {495LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {497LU}}, /* .binaryEncodingId */ + sizeof(UA_AddReferencesResponse), /* .memSize */ + UA_TYPES_ADDREFERENCESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + AddReferencesResponse_members /* .members */ + UA_TYPENAME("AddReferencesResponse") /* .typeName */ +}, +/* DeadbandType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {718LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_DeadbandType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + DeadbandType_members /* .members */ + UA_TYPENAME("DeadbandType") /* .typeName */ +}, +/* DataChangeTrigger */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {717LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_DataChangeTrigger), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + DataChangeTrigger_members /* .members */ + UA_TYPENAME("DataChangeTrigger") /* .typeName */ +}, +/* BuildInfo */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {338LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {340LU}}, /* .binaryEncodingId */ + sizeof(UA_BuildInfo), /* .memSize */ + UA_TYPES_BUILDINFO, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + BuildInfo_members /* .members */ + UA_TYPENAME("BuildInfo") /* .typeName */ +}, +/* FilterOperand */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {589LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {591LU}}, /* .binaryEncodingId */ + sizeof(UA_FilterOperand), /* .memSize */ + UA_TYPES_FILTEROPERAND, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + FilterOperand_members /* .members */ + UA_TYPENAME("FilterOperand") /* .typeName */ +}, +/* MonitoringParameters */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {740LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {742LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoringParameters), /* .memSize */ + UA_TYPES_MONITORINGPARAMETERS, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + MonitoringParameters_members /* .members */ + UA_TYPENAME("MonitoringParameters") /* .typeName */ +}, +/* DoubleComplexNumberType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12172LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {12182LU}}, /* .binaryEncodingId */ + sizeof(UA_DoubleComplexNumberType), /* .memSize */ + UA_TYPES_DOUBLECOMPLEXNUMBERTYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DoubleComplexNumberType_members /* .members */ + UA_TYPENAME("DoubleComplexNumberType") /* .typeName */ +}, +/* DeleteNodesItem */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {382LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {384LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteNodesItem), /* .memSize */ + UA_TYPES_DELETENODESITEM, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DeleteNodesItem_members /* .members */ + UA_TYPENAME("DeleteNodesItem") /* .typeName */ +}, +/* ReadValueId */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {626LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {628LU}}, /* .binaryEncodingId */ + sizeof(UA_ReadValueId), /* .memSize */ + UA_TYPES_READVALUEID, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ReadValueId_members /* .members */ + UA_TYPENAME("ReadValueId") /* .typeName */ +}, +/* CallRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {710LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {712LU}}, /* .binaryEncodingId */ + sizeof(UA_CallRequest), /* .memSize */ + UA_TYPES_CALLREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + CallRequest_members /* .members */ + UA_TYPENAME("CallRequest") /* .typeName */ +}, +/* RelativePath */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {540LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {542LU}}, /* .binaryEncodingId */ + sizeof(UA_RelativePath), /* .memSize */ + UA_TYPES_RELATIVEPATH, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + RelativePath_members /* .members */ + UA_TYPENAME("RelativePath") /* .typeName */ +}, +/* DeleteNodesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {498LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {500LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteNodesRequest), /* .memSize */ + UA_TYPES_DELETENODESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DeleteNodesRequest_members /* .members */ + UA_TYPENAME("DeleteNodesRequest") /* .typeName */ +}, +/* MonitoredItemModifyRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {755LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {757LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoredItemModifyRequest), /* .memSize */ + UA_TYPES_MONITOREDITEMMODIFYREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + MonitoredItemModifyRequest_members /* .members */ + UA_TYPENAME("MonitoredItemModifyRequest") /* .typeName */ +}, +/* UserTokenType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {303LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_UserTokenType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + UserTokenType_members /* .members */ + UA_TYPENAME("UserTokenType") /* .typeName */ +}, +/* AggregateConfiguration */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {948LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {950LU}}, /* .binaryEncodingId */ + sizeof(UA_AggregateConfiguration), /* .memSize */ + UA_TYPES_AGGREGATECONFIGURATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + AggregateConfiguration_members /* .members */ + UA_TYPENAME("AggregateConfiguration") /* .typeName */ +}, +/* LocaleId */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {295LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_LocaleId), /* .memSize */ + UA_TYPES_LOCALEID, /* .typeIndex */ + UA_DATATYPEKIND_STRING, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + LocaleId_members /* .members */ + UA_TYPENAME("LocaleId") /* .typeName */ +}, +/* UnregisterNodesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {567LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {569LU}}, /* .binaryEncodingId */ + sizeof(UA_UnregisterNodesResponse), /* .memSize */ + UA_TYPES_UNREGISTERNODESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + UnregisterNodesResponse_members /* .members */ + UA_TYPENAME("UnregisterNodesResponse") /* .typeName */ +}, +/* ContentFilterResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {607LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {609LU}}, /* .binaryEncodingId */ + sizeof(UA_ContentFilterResult), /* .memSize */ + UA_TYPES_CONTENTFILTERRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + ContentFilterResult_members /* .members */ + UA_TYPENAME("ContentFilterResult") /* .typeName */ +}, +/* UserTokenPolicy */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {304LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {306LU}}, /* .binaryEncodingId */ + sizeof(UA_UserTokenPolicy), /* .memSize */ + UA_TYPES_USERTOKENPOLICY, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + UserTokenPolicy_members /* .members */ + UA_TYPENAME("UserTokenPolicy") /* .typeName */ +}, +/* DeleteMonitoredItemsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {779LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {781LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteMonitoredItemsRequest), /* .memSize */ + UA_TYPES_DELETEMONITOREDITEMSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DeleteMonitoredItemsRequest_members /* .members */ + UA_TYPENAME("DeleteMonitoredItemsRequest") /* .typeName */ +}, +/* SetMonitoringModeRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {767LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {769LU}}, /* .binaryEncodingId */ + sizeof(UA_SetMonitoringModeRequest), /* .memSize */ + UA_TYPES_SETMONITORINGMODEREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + SetMonitoringModeRequest_members /* .members */ + UA_TYPENAME("SetMonitoringModeRequest") /* .typeName */ +}, +/* Duration */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {290LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_Duration), /* .memSize */ + UA_TYPES_DURATION, /* .typeIndex */ + UA_DATATYPEKIND_DOUBLE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 0, /* .membersSize */ + Duration_members /* .members */ + UA_TYPENAME("Duration") /* .typeName */ +}, +/* ReferenceTypeAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {367LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {369LU}}, /* .binaryEncodingId */ + sizeof(UA_ReferenceTypeAttributes), /* .memSize */ + UA_TYPES_REFERENCETYPEATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 8, /* .membersSize */ + ReferenceTypeAttributes_members /* .members */ + UA_TYPENAME("ReferenceTypeAttributes") /* .typeName */ +}, +/* GetEndpointsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {426LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {428LU}}, /* .binaryEncodingId */ + sizeof(UA_GetEndpointsRequest), /* .memSize */ + UA_TYPES_GETENDPOINTSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + GetEndpointsRequest_members /* .members */ + UA_TYPENAME("GetEndpointsRequest") /* .typeName */ +}, +/* CloseSecureChannelResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {453LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {455LU}}, /* .binaryEncodingId */ + sizeof(UA_CloseSecureChannelResponse), /* .memSize */ + UA_TYPES_CLOSESECURECHANNELRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + CloseSecureChannelResponse_members /* .members */ + UA_TYPENAME("CloseSecureChannelResponse") /* .typeName */ +}, +/* ViewDescription */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {511LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {513LU}}, /* .binaryEncodingId */ + sizeof(UA_ViewDescription), /* .memSize */ + UA_TYPES_VIEWDESCRIPTION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + ViewDescription_members /* .members */ + UA_TYPENAME("ViewDescription") /* .typeName */ +}, +/* SetPublishingModeResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {800LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {802LU}}, /* .binaryEncodingId */ + sizeof(UA_SetPublishingModeResponse), /* .memSize */ + UA_TYPES_SETPUBLISHINGMODERESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + SetPublishingModeResponse_members /* .members */ + UA_TYPENAME("SetPublishingModeResponse") /* .typeName */ +}, +/* StatusChangeNotification */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {818LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {820LU}}, /* .binaryEncodingId */ + sizeof(UA_StatusChangeNotification), /* .memSize */ + UA_TYPES_STATUSCHANGENOTIFICATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + StatusChangeNotification_members /* .members */ + UA_TYPENAME("StatusChangeNotification") /* .typeName */ +}, +/* StructureField */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {101LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {14844LU}}, /* .binaryEncodingId */ + sizeof(UA_StructureField), /* .memSize */ + UA_TYPES_STRUCTUREFIELD, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + StructureField_members /* .members */ + UA_TYPENAME("StructureField") /* .typeName */ +}, +/* NodeAttributesMask */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {348LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_NodeAttributesMask), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + NodeAttributesMask_members /* .members */ + UA_TYPENAME("NodeAttributesMask") /* .typeName */ +}, +/* EventFilterResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {734LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {736LU}}, /* .binaryEncodingId */ + sizeof(UA_EventFilterResult), /* .memSize */ + UA_TYPES_EVENTFILTERRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + EventFilterResult_members /* .members */ + UA_TYPENAME("EventFilterResult") /* .typeName */ +}, +/* MonitoredItemCreateRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {743LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {745LU}}, /* .binaryEncodingId */ + sizeof(UA_MonitoredItemCreateRequest), /* .memSize */ + UA_TYPES_MONITOREDITEMCREATEREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + MonitoredItemCreateRequest_members /* .members */ + UA_TYPENAME("MonitoredItemCreateRequest") /* .typeName */ +}, +/* ComplexNumberType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12171LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {12181LU}}, /* .binaryEncodingId */ + sizeof(UA_ComplexNumberType), /* .memSize */ + UA_TYPES_COMPLEXNUMBERTYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + ComplexNumberType_members /* .members */ + UA_TYPENAME("ComplexNumberType") /* .typeName */ +}, +/* Range */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {884LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {886LU}}, /* .binaryEncodingId */ + sizeof(UA_Range), /* .memSize */ + UA_TYPES_RANGE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + Range_members /* .members */ + UA_TYPENAME("Range") /* .typeName */ +}, +/* DataChangeNotification */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {809LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {811LU}}, /* .binaryEncodingId */ + sizeof(UA_DataChangeNotification), /* .memSize */ + UA_TYPES_DATACHANGENOTIFICATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DataChangeNotification_members /* .members */ + UA_TYPENAME("DataChangeNotification") /* .typeName */ +}, +/* Argument */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {296LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {298LU}}, /* .binaryEncodingId */ + sizeof(UA_Argument), /* .memSize */ + UA_TYPES_ARGUMENT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + Argument_members /* .members */ + UA_TYPENAME("Argument") /* .typeName */ +}, +/* TransferSubscriptionsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {839LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {841LU}}, /* .binaryEncodingId */ + sizeof(UA_TransferSubscriptionsRequest), /* .memSize */ + UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + TransferSubscriptionsRequest_members /* .members */ + UA_TYPENAME("TransferSubscriptionsRequest") /* .typeName */ +}, +/* ChannelSecurityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {441LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {443LU}}, /* .binaryEncodingId */ + sizeof(UA_ChannelSecurityToken), /* .memSize */ + UA_TYPES_CHANNELSECURITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ChannelSecurityToken_members /* .members */ + UA_TYPENAME("ChannelSecurityToken") /* .typeName */ +}, +/* ServerState */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {852LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ServerState), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + ServerState_members /* .members */ + UA_TYPENAME("ServerState") /* .typeName */ +}, +/* EventNotificationList */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {914LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {916LU}}, /* .binaryEncodingId */ + sizeof(UA_EventNotificationList), /* .memSize */ + UA_TYPES_EVENTNOTIFICATIONLIST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + EventNotificationList_members /* .members */ + UA_TYPENAME("EventNotificationList") /* .typeName */ +}, +/* AnonymousIdentityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {319LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {321LU}}, /* .binaryEncodingId */ + sizeof(UA_AnonymousIdentityToken), /* .memSize */ + UA_TYPES_ANONYMOUSIDENTITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + AnonymousIdentityToken_members /* .members */ + UA_TYPENAME("AnonymousIdentityToken") /* .typeName */ +}, +/* FilterOperator */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {576LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_FilterOperator), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + FilterOperator_members /* .members */ + UA_TYPENAME("FilterOperator") /* .typeName */ +}, +/* AggregateFilter */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {728LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {730LU}}, /* .binaryEncodingId */ + sizeof(UA_AggregateFilter), /* .memSize */ + UA_TYPES_AGGREGATEFILTER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + AggregateFilter_members /* .members */ + UA_TYPENAME("AggregateFilter") /* .typeName */ +}, +/* RepublishResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {833LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {835LU}}, /* .binaryEncodingId */ + sizeof(UA_RepublishResponse), /* .memSize */ + UA_TYPES_REPUBLISHRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + RepublishResponse_members /* .members */ + UA_TYPENAME("RepublishResponse") /* .typeName */ +}, +/* DeleteSubscriptionsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {848LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {850LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteSubscriptionsResponse), /* .memSize */ + UA_TYPES_DELETESUBSCRIPTIONSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DeleteSubscriptionsResponse_members /* .members */ + UA_TYPENAME("DeleteSubscriptionsResponse") /* .typeName */ +}, +/* RegisterNodesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {558LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {560LU}}, /* .binaryEncodingId */ + sizeof(UA_RegisterNodesRequest), /* .memSize */ + UA_TYPES_REGISTERNODESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + RegisterNodesRequest_members /* .members */ + UA_TYPENAME("RegisterNodesRequest") /* .typeName */ +}, +/* StructureDefinition */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {99LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {122LU}}, /* .binaryEncodingId */ + sizeof(UA_StructureDefinition), /* .memSize */ + UA_TYPES_STRUCTUREDEFINITION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + StructureDefinition_members /* .members */ + UA_TYPENAME("StructureDefinition") /* .typeName */ +}, +/* MethodAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {358LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {360LU}}, /* .binaryEncodingId */ + sizeof(UA_MethodAttributes), /* .memSize */ + UA_TYPES_METHODATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + MethodAttributes_members /* .members */ + UA_TYPENAME("MethodAttributes") /* .typeName */ +}, +/* UserNameIdentityToken */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {322LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {324LU}}, /* .binaryEncodingId */ + sizeof(UA_UserNameIdentityToken), /* .memSize */ + UA_TYPES_USERNAMEIDENTITYTOKEN, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + UserNameIdentityToken_members /* .members */ + UA_TYPENAME("UserNameIdentityToken") /* .typeName */ +}, +/* UnregisterNodesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {564LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {566LU}}, /* .binaryEncodingId */ + sizeof(UA_UnregisterNodesRequest), /* .memSize */ + UA_TYPES_UNREGISTERNODESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + UnregisterNodesRequest_members /* .members */ + UA_TYPENAME("UnregisterNodesRequest") /* .typeName */ +}, +/* OpenSecureChannelResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {447LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {449LU}}, /* .binaryEncodingId */ + sizeof(UA_OpenSecureChannelResponse), /* .memSize */ + UA_TYPES_OPENSECURECHANNELRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + OpenSecureChannelResponse_members /* .members */ + UA_TYPENAME("OpenSecureChannelResponse") /* .typeName */ +}, +/* SetTriggeringResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {776LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {778LU}}, /* .binaryEncodingId */ + sizeof(UA_SetTriggeringResponse), /* .memSize */ + UA_TYPES_SETTRIGGERINGRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + SetTriggeringResponse_members /* .members */ + UA_TYPENAME("SetTriggeringResponse") /* .typeName */ +}, +/* SimpleAttributeOperand */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {601LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {603LU}}, /* .binaryEncodingId */ + sizeof(UA_SimpleAttributeOperand), /* .memSize */ + UA_TYPES_SIMPLEATTRIBUTEOPERAND, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + SimpleAttributeOperand_members /* .members */ + UA_TYPENAME("SimpleAttributeOperand") /* .typeName */ +}, +/* RepublishRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {830LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {832LU}}, /* .binaryEncodingId */ + sizeof(UA_RepublishRequest), /* .memSize */ + UA_TYPES_REPUBLISHREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + RepublishRequest_members /* .members */ + UA_TYPENAME("RepublishRequest") /* .typeName */ +}, +/* RegisterNodesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {561LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {563LU}}, /* .binaryEncodingId */ + sizeof(UA_RegisterNodesResponse), /* .memSize */ + UA_TYPES_REGISTERNODESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + RegisterNodesResponse_members /* .members */ + UA_TYPENAME("RegisterNodesResponse") /* .typeName */ +}, +/* ModifyMonitoredItemsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {764LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {766LU}}, /* .binaryEncodingId */ + sizeof(UA_ModifyMonitoredItemsResponse), /* .memSize */ + UA_TYPES_MODIFYMONITOREDITEMSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + ModifyMonitoredItemsResponse_members /* .members */ + UA_TYPENAME("ModifyMonitoredItemsResponse") /* .typeName */ +}, +/* DeleteSubscriptionsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {845LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {847LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteSubscriptionsRequest), /* .memSize */ + UA_TYPES_DELETESUBSCRIPTIONSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DeleteSubscriptionsRequest_members /* .members */ + UA_TYPENAME("DeleteSubscriptionsRequest") /* .typeName */ +}, +/* RedundancySupport */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {851LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_RedundancySupport), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + RedundancySupport_members /* .members */ + UA_TYPENAME("RedundancySupport") /* .typeName */ +}, +/* BrowsePath */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {543LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {545LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowsePath), /* .memSize */ + UA_TYPES_BROWSEPATH, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + BrowsePath_members /* .members */ + UA_TYPENAME("BrowsePath") /* .typeName */ +}, +/* ObjectAttributes */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {352LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {354LU}}, /* .binaryEncodingId */ + sizeof(UA_ObjectAttributes), /* .memSize */ + UA_TYPES_OBJECTATTRIBUTES, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + ObjectAttributes_members /* .members */ + UA_TYPENAME("ObjectAttributes") /* .typeName */ +}, +/* PublishRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {824LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {826LU}}, /* .binaryEncodingId */ + sizeof(UA_PublishRequest), /* .memSize */ + UA_TYPES_PUBLISHREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + PublishRequest_members /* .members */ + UA_TYPENAME("PublishRequest") /* .typeName */ +}, +/* FindServersRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {420LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {422LU}}, /* .binaryEncodingId */ + sizeof(UA_FindServersRequest), /* .memSize */ + UA_TYPES_FINDSERVERSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + FindServersRequest_members /* .members */ + UA_TYPENAME("FindServersRequest") /* .typeName */ +}, +/* ReferenceDescription */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {518LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {520LU}}, /* .binaryEncodingId */ + sizeof(UA_ReferenceDescription), /* .memSize */ + UA_TYPES_REFERENCEDESCRIPTION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + ReferenceDescription_members /* .members */ + UA_TYPENAME("ReferenceDescription") /* .typeName */ +}, +/* CreateSubscriptionRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {785LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {787LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateSubscriptionRequest), /* .memSize */ + UA_TYPES_CREATESUBSCRIPTIONREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + CreateSubscriptionRequest_members /* .members */ + UA_TYPENAME("CreateSubscriptionRequest") /* .typeName */ +}, +/* CallResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {713LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {715LU}}, /* .binaryEncodingId */ + sizeof(UA_CallResponse), /* .memSize */ + UA_TYPES_CALLRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + CallResponse_members /* .members */ + UA_TYPENAME("CallResponse") /* .typeName */ +}, +/* DeleteNodesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {501LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {503LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteNodesResponse), /* .memSize */ + UA_TYPES_DELETENODESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DeleteNodesResponse_members /* .members */ + UA_TYPENAME("DeleteNodesResponse") /* .typeName */ +}, +/* ModifyMonitoredItemsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {761LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {763LU}}, /* .binaryEncodingId */ + sizeof(UA_ModifyMonitoredItemsRequest), /* .memSize */ + UA_TYPES_MODIFYMONITOREDITEMSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ModifyMonitoredItemsRequest_members /* .members */ + UA_TYPENAME("ModifyMonitoredItemsRequest") /* .typeName */ +}, +/* ServiceFault */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {395LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {397LU}}, /* .binaryEncodingId */ + sizeof(UA_ServiceFault), /* .memSize */ + UA_TYPES_SERVICEFAULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + ServiceFault_members /* .members */ + UA_TYPENAME("ServiceFault") /* .typeName */ +}, +/* PublishResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {827LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {829LU}}, /* .binaryEncodingId */ + sizeof(UA_PublishResponse), /* .memSize */ + UA_TYPES_PUBLISHRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + PublishResponse_members /* .members */ + UA_TYPENAME("PublishResponse") /* .typeName */ +}, +/* CreateMonitoredItemsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {749LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {751LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateMonitoredItemsRequest), /* .memSize */ + UA_TYPES_CREATEMONITOREDITEMSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + CreateMonitoredItemsRequest_members /* .members */ + UA_TYPENAME("CreateMonitoredItemsRequest") /* .typeName */ +}, +/* OpenSecureChannelRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {444LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {446LU}}, /* .binaryEncodingId */ + sizeof(UA_OpenSecureChannelRequest), /* .memSize */ + UA_TYPES_OPENSECURECHANNELREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + OpenSecureChannelRequest_members /* .members */ + UA_TYPENAME("OpenSecureChannelRequest") /* .typeName */ +}, +/* CloseSessionRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {471LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {473LU}}, /* .binaryEncodingId */ + sizeof(UA_CloseSessionRequest), /* .memSize */ + UA_TYPES_CLOSESESSIONREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + CloseSessionRequest_members /* .members */ + UA_TYPENAME("CloseSessionRequest") /* .typeName */ +}, +/* SetTriggeringRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {773LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {775LU}}, /* .binaryEncodingId */ + sizeof(UA_SetTriggeringRequest), /* .memSize */ + UA_TYPES_SETTRIGGERINGREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + SetTriggeringRequest_members /* .members */ + UA_TYPENAME("SetTriggeringRequest") /* .typeName */ +}, +/* BrowseResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {522LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {524LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseResult), /* .memSize */ + UA_TYPES_BROWSERESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + BrowseResult_members /* .members */ + UA_TYPENAME("BrowseResult") /* .typeName */ +}, +/* AddReferencesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {492LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {494LU}}, /* .binaryEncodingId */ + sizeof(UA_AddReferencesRequest), /* .memSize */ + UA_TYPES_ADDREFERENCESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + AddReferencesRequest_members /* .members */ + UA_TYPENAME("AddReferencesRequest") /* .typeName */ +}, +/* AddNodesItem */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {376LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {378LU}}, /* .binaryEncodingId */ + sizeof(UA_AddNodesItem), /* .memSize */ + UA_TYPES_ADDNODESITEM, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + AddNodesItem_members /* .members */ + UA_TYPENAME("AddNodesItem") /* .typeName */ +}, +/* ServerStatusDataType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {862LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {864LU}}, /* .binaryEncodingId */ + sizeof(UA_ServerStatusDataType), /* .memSize */ + UA_TYPES_SERVERSTATUSDATATYPE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + ServerStatusDataType_members /* .members */ + UA_TYPENAME("ServerStatusDataType") /* .typeName */ +}, +/* BrowseNextResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {534LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {536LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseNextResponse), /* .memSize */ + UA_TYPES_BROWSENEXTRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + BrowseNextResponse_members /* .members */ + UA_TYPENAME("BrowseNextResponse") /* .typeName */ +}, +/* AxisInformation */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {12079LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {12089LU}}, /* .binaryEncodingId */ + sizeof(UA_AxisInformation), /* .memSize */ + UA_TYPES_AXISINFORMATION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + AxisInformation_members /* .members */ + UA_TYPENAME("AxisInformation") /* .typeName */ +}, +/* ApplicationDescription */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {308LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {310LU}}, /* .binaryEncodingId */ + sizeof(UA_ApplicationDescription), /* .memSize */ + UA_TYPES_APPLICATIONDESCRIPTION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 7, /* .membersSize */ + ApplicationDescription_members /* .members */ + UA_TYPENAME("ApplicationDescription") /* .typeName */ +}, +/* ReadRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {629LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {631LU}}, /* .binaryEncodingId */ + sizeof(UA_ReadRequest), /* .memSize */ + UA_TYPES_READREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + ReadRequest_members /* .members */ + UA_TYPENAME("ReadRequest") /* .typeName */ +}, +/* ActivateSessionRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {465LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {467LU}}, /* .binaryEncodingId */ + sizeof(UA_ActivateSessionRequest), /* .memSize */ + UA_TYPES_ACTIVATESESSIONREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + ActivateSessionRequest_members /* .members */ + UA_TYPENAME("ActivateSessionRequest") /* .typeName */ +}, +/* BrowsePathResult */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {549LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {551LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowsePathResult), /* .memSize */ + UA_TYPES_BROWSEPATHRESULT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + BrowsePathResult_members /* .members */ + UA_TYPENAME("BrowsePathResult") /* .typeName */ +}, +/* AddNodesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {486LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {488LU}}, /* .binaryEncodingId */ + sizeof(UA_AddNodesRequest), /* .memSize */ + UA_TYPES_ADDNODESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + AddNodesRequest_members /* .members */ + UA_TYPENAME("AddNodesRequest") /* .typeName */ +}, +/* BrowseRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {525LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {527LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseRequest), /* .memSize */ + UA_TYPES_BROWSEREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 4, /* .membersSize */ + BrowseRequest_members /* .members */ + UA_TYPENAME("BrowseRequest") /* .typeName */ +}, +/* WriteRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {671LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {673LU}}, /* .binaryEncodingId */ + sizeof(UA_WriteRequest), /* .memSize */ + UA_TYPES_WRITEREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + WriteRequest_members /* .members */ + UA_TYPENAME("WriteRequest") /* .typeName */ +}, +/* AddNodesResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {489LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {491LU}}, /* .binaryEncodingId */ + sizeof(UA_AddNodesResponse), /* .memSize */ + UA_TYPES_ADDNODESRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + AddNodesResponse_members /* .members */ + UA_TYPENAME("AddNodesResponse") /* .typeName */ +}, +/* AttributeOperand */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {598LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {600LU}}, /* .binaryEncodingId */ + sizeof(UA_AttributeOperand), /* .memSize */ + UA_TYPES_ATTRIBUTEOPERAND, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + AttributeOperand_members /* .members */ + UA_TYPENAME("AttributeOperand") /* .typeName */ +}, +/* DataChangeFilter */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {722LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {724LU}}, /* .binaryEncodingId */ + sizeof(UA_DataChangeFilter), /* .memSize */ + UA_TYPES_DATACHANGEFILTER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + DataChangeFilter_members /* .members */ + UA_TYPENAME("DataChangeFilter") /* .typeName */ +}, +/* EndpointDescription */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {312LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {314LU}}, /* .binaryEncodingId */ + sizeof(UA_EndpointDescription), /* .memSize */ + UA_TYPES_ENDPOINTDESCRIPTION, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 8, /* .membersSize */ + EndpointDescription_members /* .members */ + UA_TYPENAME("EndpointDescription") /* .typeName */ +}, +/* DeleteReferencesRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {504LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {506LU}}, /* .binaryEncodingId */ + sizeof(UA_DeleteReferencesRequest), /* .memSize */ + UA_TYPES_DELETEREFERENCESREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + DeleteReferencesRequest_members /* .members */ + UA_TYPENAME("DeleteReferencesRequest") /* .typeName */ +}, +/* TranslateBrowsePathsToNodeIdsRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {552LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {554LU}}, /* .binaryEncodingId */ + sizeof(UA_TranslateBrowsePathsToNodeIdsRequest), /* .memSize */ + UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + TranslateBrowsePathsToNodeIdsRequest_members /* .members */ + UA_TYPENAME("TranslateBrowsePathsToNodeIdsRequest") /* .typeName */ +}, +/* FindServersResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {423LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {425LU}}, /* .binaryEncodingId */ + sizeof(UA_FindServersResponse), /* .memSize */ + UA_TYPES_FINDSERVERSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + FindServersResponse_members /* .members */ + UA_TYPENAME("FindServersResponse") /* .typeName */ +}, +/* CreateSessionRequest */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {459LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {461LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateSessionRequest), /* .memSize */ + UA_TYPES_CREATESESSIONREQUEST, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 9, /* .membersSize */ + CreateSessionRequest_members /* .members */ + UA_TYPENAME("CreateSessionRequest") /* .typeName */ +}, +/* ContentFilterElement */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {583LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {585LU}}, /* .binaryEncodingId */ + sizeof(UA_ContentFilterElement), /* .memSize */ + UA_TYPES_CONTENTFILTERELEMENT, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + ContentFilterElement_members /* .members */ + UA_TYPENAME("ContentFilterElement") /* .typeName */ +}, +/* TranslateBrowsePathsToNodeIdsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {555LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {557LU}}, /* .binaryEncodingId */ + sizeof(UA_TranslateBrowsePathsToNodeIdsResponse), /* .memSize */ + UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + TranslateBrowsePathsToNodeIdsResponse_members /* .members */ + UA_TYPENAME("TranslateBrowsePathsToNodeIdsResponse") /* .typeName */ +}, +/* BrowseResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {528LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {530LU}}, /* .binaryEncodingId */ + sizeof(UA_BrowseResponse), /* .memSize */ + UA_TYPES_BROWSERESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + BrowseResponse_members /* .members */ + UA_TYPENAME("BrowseResponse") /* .typeName */ +}, +/* CreateSessionResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {462LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {464LU}}, /* .binaryEncodingId */ + sizeof(UA_CreateSessionResponse), /* .memSize */ + UA_TYPES_CREATESESSIONRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 10, /* .membersSize */ + CreateSessionResponse_members /* .members */ + UA_TYPENAME("CreateSessionResponse") /* .typeName */ +}, +/* ContentFilter */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {586LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {588LU}}, /* .binaryEncodingId */ + sizeof(UA_ContentFilter), /* .memSize */ + UA_TYPES_CONTENTFILTER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + ContentFilter_members /* .members */ + UA_TYPENAME("ContentFilter") /* .typeName */ +}, +/* GetEndpointsResponse */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {429LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {431LU}}, /* .binaryEncodingId */ + sizeof(UA_GetEndpointsResponse), /* .memSize */ + UA_TYPES_GETENDPOINTSRESPONSE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + GetEndpointsResponse_members /* .members */ + UA_TYPENAME("GetEndpointsResponse") /* .typeName */ +}, +/* EventFilter */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {725LU}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {727LU}}, /* .binaryEncodingId */ + sizeof(UA_EventFilter), /* .memSize */ + UA_TYPES_EVENTFILTER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + EventFilter_members /* .members */ + UA_TYPENAME("EventFilter") /* .typeName */ +}, +}; + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/transport_generated.c" ***********************************/ + +/* Generated from Custom.Opc.Ua.Transport.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:03 */ + + +/* TcpHelloMessage */ +static UA_DataTypeMember TcpHelloMessage_members[6] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProtocolVersion") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpHelloMessage, receiveBufferSize) - offsetof(UA_TcpHelloMessage, protocolVersion) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReceiveBufferSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpHelloMessage, sendBufferSize) - offsetof(UA_TcpHelloMessage, receiveBufferSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SendBufferSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpHelloMessage, maxMessageSize) - offsetof(UA_TcpHelloMessage, sendBufferSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxMessageSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpHelloMessage, maxChunkCount) - offsetof(UA_TcpHelloMessage, maxMessageSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxChunkCount") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_TcpHelloMessage, endpointUrl) - offsetof(UA_TcpHelloMessage, maxChunkCount) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("EndpointUrl") /* .memberName */ +},}; + +/* TcpErrorMessage */ +static UA_DataTypeMember TcpErrorMessage_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Error") /* .memberName */ +}, +{ + UA_TYPES_STRING, /* .memberTypeIndex */ + offsetof(UA_TcpErrorMessage, reason) - offsetof(UA_TcpErrorMessage, error) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("Reason") /* .memberName */ +},}; + +/* MessageType */ +#define MessageType_members NULL + +/* AsymmetricAlgorithmSecurityHeader */ +static UA_DataTypeMember AsymmetricAlgorithmSecurityHeader_members[3] = { +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SecurityPolicyUri") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_AsymmetricAlgorithmSecurityHeader, senderCertificate) - offsetof(UA_AsymmetricAlgorithmSecurityHeader, securityPolicyUri) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SenderCertificate") /* .memberName */ +}, +{ + UA_TYPES_BYTESTRING, /* .memberTypeIndex */ + offsetof(UA_AsymmetricAlgorithmSecurityHeader, receiverCertificateThumbprint) - offsetof(UA_AsymmetricAlgorithmSecurityHeader, senderCertificate) - sizeof(UA_ByteString), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReceiverCertificateThumbprint") /* .memberName */ +},}; + +/* TcpAcknowledgeMessage */ +static UA_DataTypeMember TcpAcknowledgeMessage_members[5] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ProtocolVersion") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpAcknowledgeMessage, receiveBufferSize) - offsetof(UA_TcpAcknowledgeMessage, protocolVersion) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("ReceiveBufferSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpAcknowledgeMessage, sendBufferSize) - offsetof(UA_TcpAcknowledgeMessage, receiveBufferSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SendBufferSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpAcknowledgeMessage, maxMessageSize) - offsetof(UA_TcpAcknowledgeMessage, sendBufferSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxMessageSize") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpAcknowledgeMessage, maxChunkCount) - offsetof(UA_TcpAcknowledgeMessage, maxMessageSize) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MaxChunkCount") /* .memberName */ +},}; + +/* SequenceHeader */ +static UA_DataTypeMember SequenceHeader_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("SequenceNumber") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_SequenceHeader, requestId) - offsetof(UA_SequenceHeader, sequenceNumber) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("RequestId") /* .memberName */ +},}; + +/* TcpMessageHeader */ +static UA_DataTypeMember TcpMessageHeader_members[2] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MessageTypeAndChunkType") /* .memberName */ +}, +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + offsetof(UA_TcpMessageHeader, messageSize) - offsetof(UA_TcpMessageHeader, messageTypeAndChunkType) - sizeof(UA_UInt32), /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("MessageSize") /* .memberName */ +},}; + +/* ChunkType */ +#define ChunkType_members NULL + +/* SymmetricAlgorithmSecurityHeader */ +static UA_DataTypeMember SymmetricAlgorithmSecurityHeader_members[1] = { +{ + UA_TYPES_UINT32, /* .memberTypeIndex */ + 0, /* .padding */ + true, /* .namespaceZero */ + false, /* .isArray */ + false /* .isOptional */ + UA_TYPENAME("TokenId") /* .memberName */ +},}; +const UA_DataType UA_TRANSPORT[UA_TRANSPORT_COUNT] = { +/* TcpHelloMessage */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_TcpHelloMessage), /* .memSize */ + UA_TRANSPORT_TCPHELLOMESSAGE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 6, /* .membersSize */ + TcpHelloMessage_members /* .members */ + UA_TYPENAME("TcpHelloMessage") /* .typeName */ +}, +/* TcpErrorMessage */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_TcpErrorMessage), /* .memSize */ + UA_TRANSPORT_TCPERRORMESSAGE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + TcpErrorMessage_members /* .members */ + UA_TYPENAME("TcpErrorMessage") /* .typeName */ +}, +/* MessageType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_MessageType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + MessageType_members /* .members */ + UA_TYPENAME("MessageType") /* .typeName */ +}, +/* AsymmetricAlgorithmSecurityHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_AsymmetricAlgorithmSecurityHeader), /* .memSize */ + UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + false, /* .pointerFree */ + false, /* .overlayable */ + 3, /* .membersSize */ + AsymmetricAlgorithmSecurityHeader_members /* .members */ + UA_TYPENAME("AsymmetricAlgorithmSecurityHeader") /* .typeName */ +}, +/* TcpAcknowledgeMessage */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_TcpAcknowledgeMessage), /* .memSize */ + UA_TRANSPORT_TCPACKNOWLEDGEMESSAGE, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 5, /* .membersSize */ + TcpAcknowledgeMessage_members /* .members */ + UA_TYPENAME("TcpAcknowledgeMessage") /* .typeName */ +}, +/* SequenceHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_SequenceHeader), /* .memSize */ + UA_TRANSPORT_SEQUENCEHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + SequenceHeader_members /* .members */ + UA_TYPENAME("SequenceHeader") /* .typeName */ +}, +/* TcpMessageHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_TcpMessageHeader), /* .memSize */ + UA_TRANSPORT_TCPMESSAGEHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 2, /* .membersSize */ + TcpMessageHeader_members /* .members */ + UA_TYPENAME("TcpMessageHeader") /* .typeName */ +}, +/* ChunkType */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_ChunkType), /* .memSize */ + UA_TYPES_INT32, /* .typeIndex */ + UA_DATATYPEKIND_ENUM, /* .typeKind */ + true, /* .pointerFree */ + UA_BINARY_OVERLAYABLE_INTEGER, /* .overlayable */ + 0, /* .membersSize */ + ChunkType_members /* .members */ + UA_TYPENAME("ChunkType") /* .typeName */ +}, +/* SymmetricAlgorithmSecurityHeader */ +{ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .typeId */ + {0, UA_NODEIDTYPE_NUMERIC, {0}}, /* .binaryEncodingId */ + sizeof(UA_SymmetricAlgorithmSecurityHeader), /* .memSize */ + UA_TRANSPORT_SYMMETRICALGORITHMSECURITYHEADER, /* .typeIndex */ + UA_DATATYPEKIND_STRUCTURE, /* .typeKind */ + true, /* .pointerFree */ + false, /* .overlayable */ + 1, /* .membersSize */ + SymmetricAlgorithmSecurityHeader_members /* .members */ + UA_TYPENAME("SymmetricAlgorithmSecurityHeader") /* .typeName */ +}, +}; + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/statuscodes.c" ***********************************/ + +/********************************************************** + * Autogenerated -- do not modify + * Generated from /home/rosselliot/sandbox/open62541/tools/schema/StatusCode.csv with script /home/rosselliot/sandbox/open62541/tools/generate_statuscode_descriptions.py + *********************************************************/ + + +typedef struct { + UA_StatusCode code; + const char *name; +} UA_StatusCodeName; + +#ifndef UA_ENABLE_STATUSCODE_DESCRIPTIONS +static const char * emptyStatusCodeName = ""; +const char * UA_StatusCode_name(UA_StatusCode code) { + return emptyStatusCodeName; +} +#else +static const size_t statusCodeDescriptionsSize = 237; +static const UA_StatusCodeName statusCodeDescriptions[237] = { + {UA_STATUSCODE_GOOD, "Good"}, + {UA_STATUSCODE_BADUNEXPECTEDERROR, "BadUnexpectedError"}, + {UA_STATUSCODE_BADINTERNALERROR, "BadInternalError"}, + {UA_STATUSCODE_BADOUTOFMEMORY, "BadOutOfMemory"}, + {UA_STATUSCODE_BADRESOURCEUNAVAILABLE, "BadResourceUnavailable"}, + {UA_STATUSCODE_BADCOMMUNICATIONERROR, "BadCommunicationError"}, + {UA_STATUSCODE_BADENCODINGERROR, "BadEncodingError"}, + {UA_STATUSCODE_BADDECODINGERROR, "BadDecodingError"}, + {UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED, "BadEncodingLimitsExceeded"}, + {UA_STATUSCODE_BADREQUESTTOOLARGE, "BadRequestTooLarge"}, + {UA_STATUSCODE_BADRESPONSETOOLARGE, "BadResponseTooLarge"}, + {UA_STATUSCODE_BADUNKNOWNRESPONSE, "BadUnknownResponse"}, + {UA_STATUSCODE_BADTIMEOUT, "BadTimeout"}, + {UA_STATUSCODE_BADSERVICEUNSUPPORTED, "BadServiceUnsupported"}, + {UA_STATUSCODE_BADSHUTDOWN, "BadShutdown"}, + {UA_STATUSCODE_BADSERVERNOTCONNECTED, "BadServerNotConnected"}, + {UA_STATUSCODE_BADSERVERHALTED, "BadServerHalted"}, + {UA_STATUSCODE_BADNOTHINGTODO, "BadNothingToDo"}, + {UA_STATUSCODE_BADTOOMANYOPERATIONS, "BadTooManyOperations"}, + {UA_STATUSCODE_BADTOOMANYMONITOREDITEMS, "BadTooManyMonitoredItems"}, + {UA_STATUSCODE_BADDATATYPEIDUNKNOWN, "BadDataTypeIdUnknown"}, + {UA_STATUSCODE_BADCERTIFICATEINVALID, "BadCertificateInvalid"}, + {UA_STATUSCODE_BADSECURITYCHECKSFAILED, "BadSecurityChecksFailed"}, + {UA_STATUSCODE_BADCERTIFICATEPOLICYCHECKFAILED, "BadCertificatePolicyCheckFailed"}, + {UA_STATUSCODE_BADCERTIFICATETIMEINVALID, "BadCertificateTimeInvalid"}, + {UA_STATUSCODE_BADCERTIFICATEISSUERTIMEINVALID, "BadCertificateIssuerTimeInvalid"}, + {UA_STATUSCODE_BADCERTIFICATEHOSTNAMEINVALID, "BadCertificateHostNameInvalid"}, + {UA_STATUSCODE_BADCERTIFICATEURIINVALID, "BadCertificateUriInvalid"}, + {UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED, "BadCertificateUseNotAllowed"}, + {UA_STATUSCODE_BADCERTIFICATEISSUERUSENOTALLOWED, "BadCertificateIssuerUseNotAllowed"}, + {UA_STATUSCODE_BADCERTIFICATEUNTRUSTED, "BadCertificateUntrusted"}, + {UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN, "BadCertificateRevocationUnknown"}, + {UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN, "BadCertificateIssuerRevocationUnknown"}, + {UA_STATUSCODE_BADCERTIFICATEREVOKED, "BadCertificateRevoked"}, + {UA_STATUSCODE_BADCERTIFICATEISSUERREVOKED, "BadCertificateIssuerRevoked"}, + {UA_STATUSCODE_BADCERTIFICATECHAININCOMPLETE, "BadCertificateChainIncomplete"}, + {UA_STATUSCODE_BADUSERACCESSDENIED, "BadUserAccessDenied"}, + {UA_STATUSCODE_BADIDENTITYTOKENINVALID, "BadIdentityTokenInvalid"}, + {UA_STATUSCODE_BADIDENTITYTOKENREJECTED, "BadIdentityTokenRejected"}, + {UA_STATUSCODE_BADSECURECHANNELIDINVALID, "BadSecureChannelIdInvalid"}, + {UA_STATUSCODE_BADINVALIDTIMESTAMP, "BadInvalidTimestamp"}, + {UA_STATUSCODE_BADNONCEINVALID, "BadNonceInvalid"}, + {UA_STATUSCODE_BADSESSIONIDINVALID, "BadSessionIdInvalid"}, + {UA_STATUSCODE_BADSESSIONCLOSED, "BadSessionClosed"}, + {UA_STATUSCODE_BADSESSIONNOTACTIVATED, "BadSessionNotActivated"}, + {UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID, "BadSubscriptionIdInvalid"}, + {UA_STATUSCODE_BADREQUESTHEADERINVALID, "BadRequestHeaderInvalid"}, + {UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID, "BadTimestampsToReturnInvalid"}, + {UA_STATUSCODE_BADREQUESTCANCELLEDBYCLIENT, "BadRequestCancelledByClient"}, + {UA_STATUSCODE_BADTOOMANYARGUMENTS, "BadTooManyArguments"}, + {UA_STATUSCODE_BADLICENSEEXPIRED, "BadLicenseExpired"}, + {UA_STATUSCODE_BADLICENSELIMITSEXCEEDED, "BadLicenseLimitsExceeded"}, + {UA_STATUSCODE_BADLICENSENOTAVAILABLE, "BadLicenseNotAvailable"}, + {UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED, "GoodSubscriptionTransferred"}, + {UA_STATUSCODE_GOODCOMPLETESASYNCHRONOUSLY, "GoodCompletesAsynchronously"}, + {UA_STATUSCODE_GOODOVERLOAD, "GoodOverload"}, + {UA_STATUSCODE_GOODCLAMPED, "GoodClamped"}, + {UA_STATUSCODE_BADNOCOMMUNICATION, "BadNoCommunication"}, + {UA_STATUSCODE_BADWAITINGFORINITIALDATA, "BadWaitingForInitialData"}, + {UA_STATUSCODE_BADNODEIDINVALID, "BadNodeIdInvalid"}, + {UA_STATUSCODE_BADNODEIDUNKNOWN, "BadNodeIdUnknown"}, + {UA_STATUSCODE_BADATTRIBUTEIDINVALID, "BadAttributeIdInvalid"}, + {UA_STATUSCODE_BADINDEXRANGEINVALID, "BadIndexRangeInvalid"}, + {UA_STATUSCODE_BADINDEXRANGENODATA, "BadIndexRangeNoData"}, + {UA_STATUSCODE_BADDATAENCODINGINVALID, "BadDataEncodingInvalid"}, + {UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED, "BadDataEncodingUnsupported"}, + {UA_STATUSCODE_BADNOTREADABLE, "BadNotReadable"}, + {UA_STATUSCODE_BADNOTWRITABLE, "BadNotWritable"}, + {UA_STATUSCODE_BADOUTOFRANGE, "BadOutOfRange"}, + {UA_STATUSCODE_BADNOTSUPPORTED, "BadNotSupported"}, + {UA_STATUSCODE_BADNOTFOUND, "BadNotFound"}, + {UA_STATUSCODE_BADOBJECTDELETED, "BadObjectDeleted"}, + {UA_STATUSCODE_BADNOTIMPLEMENTED, "BadNotImplemented"}, + {UA_STATUSCODE_BADMONITORINGMODEINVALID, "BadMonitoringModeInvalid"}, + {UA_STATUSCODE_BADMONITOREDITEMIDINVALID, "BadMonitoredItemIdInvalid"}, + {UA_STATUSCODE_BADMONITOREDITEMFILTERINVALID, "BadMonitoredItemFilterInvalid"}, + {UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED, "BadMonitoredItemFilterUnsupported"}, + {UA_STATUSCODE_BADFILTERNOTALLOWED, "BadFilterNotAllowed"}, + {UA_STATUSCODE_BADSTRUCTUREMISSING, "BadStructureMissing"}, + {UA_STATUSCODE_BADEVENTFILTERINVALID, "BadEventFilterInvalid"}, + {UA_STATUSCODE_BADCONTENTFILTERINVALID, "BadContentFilterInvalid"}, + {UA_STATUSCODE_BADFILTEROPERATORINVALID, "BadFilterOperatorInvalid"}, + {UA_STATUSCODE_BADFILTEROPERATORUNSUPPORTED, "BadFilterOperatorUnsupported"}, + {UA_STATUSCODE_BADFILTEROPERANDCOUNTMISMATCH, "BadFilterOperandCountMismatch"}, + {UA_STATUSCODE_BADFILTEROPERANDINVALID, "BadFilterOperandInvalid"}, + {UA_STATUSCODE_BADFILTERELEMENTINVALID, "BadFilterElementInvalid"}, + {UA_STATUSCODE_BADFILTERLITERALINVALID, "BadFilterLiteralInvalid"}, + {UA_STATUSCODE_BADCONTINUATIONPOINTINVALID, "BadContinuationPointInvalid"}, + {UA_STATUSCODE_BADNOCONTINUATIONPOINTS, "BadNoContinuationPoints"}, + {UA_STATUSCODE_BADREFERENCETYPEIDINVALID, "BadReferenceTypeIdInvalid"}, + {UA_STATUSCODE_BADBROWSEDIRECTIONINVALID, "BadBrowseDirectionInvalid"}, + {UA_STATUSCODE_BADNODENOTINVIEW, "BadNodeNotInView"}, + {UA_STATUSCODE_BADNUMERICOVERFLOW, "BadNumericOverflow"}, + {UA_STATUSCODE_BADSERVERURIINVALID, "BadServerUriInvalid"}, + {UA_STATUSCODE_BADSERVERNAMEMISSING, "BadServerNameMissing"}, + {UA_STATUSCODE_BADDISCOVERYURLMISSING, "BadDiscoveryUrlMissing"}, + {UA_STATUSCODE_BADSEMPAHOREFILEMISSING, "BadSempahoreFileMissing"}, + {UA_STATUSCODE_BADREQUESTTYPEINVALID, "BadRequestTypeInvalid"}, + {UA_STATUSCODE_BADSECURITYMODEREJECTED, "BadSecurityModeRejected"}, + {UA_STATUSCODE_BADSECURITYPOLICYREJECTED, "BadSecurityPolicyRejected"}, + {UA_STATUSCODE_BADTOOMANYSESSIONS, "BadTooManySessions"}, + {UA_STATUSCODE_BADUSERSIGNATUREINVALID, "BadUserSignatureInvalid"}, + {UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID, "BadApplicationSignatureInvalid"}, + {UA_STATUSCODE_BADNOVALIDCERTIFICATES, "BadNoValidCertificates"}, + {UA_STATUSCODE_BADIDENTITYCHANGENOTSUPPORTED, "BadIdentityChangeNotSupported"}, + {UA_STATUSCODE_BADREQUESTCANCELLEDBYREQUEST, "BadRequestCancelledByRequest"}, + {UA_STATUSCODE_BADPARENTNODEIDINVALID, "BadParentNodeIdInvalid"}, + {UA_STATUSCODE_BADREFERENCENOTALLOWED, "BadReferenceNotAllowed"}, + {UA_STATUSCODE_BADNODEIDREJECTED, "BadNodeIdRejected"}, + {UA_STATUSCODE_BADNODEIDEXISTS, "BadNodeIdExists"}, + {UA_STATUSCODE_BADNODECLASSINVALID, "BadNodeClassInvalid"}, + {UA_STATUSCODE_BADBROWSENAMEINVALID, "BadBrowseNameInvalid"}, + {UA_STATUSCODE_BADBROWSENAMEDUPLICATED, "BadBrowseNameDuplicated"}, + {UA_STATUSCODE_BADNODEATTRIBUTESINVALID, "BadNodeAttributesInvalid"}, + {UA_STATUSCODE_BADTYPEDEFINITIONINVALID, "BadTypeDefinitionInvalid"}, + {UA_STATUSCODE_BADSOURCENODEIDINVALID, "BadSourceNodeIdInvalid"}, + {UA_STATUSCODE_BADTARGETNODEIDINVALID, "BadTargetNodeIdInvalid"}, + {UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED, "BadDuplicateReferenceNotAllowed"}, + {UA_STATUSCODE_BADINVALIDSELFREFERENCE, "BadInvalidSelfReference"}, + {UA_STATUSCODE_BADREFERENCELOCALONLY, "BadReferenceLocalOnly"}, + {UA_STATUSCODE_BADNODELETERIGHTS, "BadNoDeleteRights"}, + {UA_STATUSCODE_UNCERTAINREFERENCENOTDELETED, "UncertainReferenceNotDeleted"}, + {UA_STATUSCODE_BADSERVERINDEXINVALID, "BadServerIndexInvalid"}, + {UA_STATUSCODE_BADVIEWIDUNKNOWN, "BadViewIdUnknown"}, + {UA_STATUSCODE_BADVIEWTIMESTAMPINVALID, "BadViewTimestampInvalid"}, + {UA_STATUSCODE_BADVIEWPARAMETERMISMATCH, "BadViewParameterMismatch"}, + {UA_STATUSCODE_BADVIEWVERSIONINVALID, "BadViewVersionInvalid"}, + {UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE, "UncertainNotAllNodesAvailable"}, + {UA_STATUSCODE_GOODRESULTSMAYBEINCOMPLETE, "GoodResultsMayBeIncomplete"}, + {UA_STATUSCODE_BADNOTTYPEDEFINITION, "BadNotTypeDefinition"}, + {UA_STATUSCODE_UNCERTAINREFERENCEOUTOFSERVER, "UncertainReferenceOutOfServer"}, + {UA_STATUSCODE_BADTOOMANYMATCHES, "BadTooManyMatches"}, + {UA_STATUSCODE_BADQUERYTOOCOMPLEX, "BadQueryTooComplex"}, + {UA_STATUSCODE_BADNOMATCH, "BadNoMatch"}, + {UA_STATUSCODE_BADMAXAGEINVALID, "BadMaxAgeInvalid"}, + {UA_STATUSCODE_BADSECURITYMODEINSUFFICIENT, "BadSecurityModeInsufficient"}, + {UA_STATUSCODE_BADHISTORYOPERATIONINVALID, "BadHistoryOperationInvalid"}, + {UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED, "BadHistoryOperationUnsupported"}, + {UA_STATUSCODE_BADINVALIDTIMESTAMPARGUMENT, "BadInvalidTimestampArgument"}, + {UA_STATUSCODE_BADWRITENOTSUPPORTED, "BadWriteNotSupported"}, + {UA_STATUSCODE_BADTYPEMISMATCH, "BadTypeMismatch"}, + {UA_STATUSCODE_BADMETHODINVALID, "BadMethodInvalid"}, + {UA_STATUSCODE_BADARGUMENTSMISSING, "BadArgumentsMissing"}, + {UA_STATUSCODE_BADNOTEXECUTABLE, "BadNotExecutable"}, + {UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS, "BadTooManySubscriptions"}, + {UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS, "BadTooManyPublishRequests"}, + {UA_STATUSCODE_BADNOSUBSCRIPTION, "BadNoSubscription"}, + {UA_STATUSCODE_BADSEQUENCENUMBERUNKNOWN, "BadSequenceNumberUnknown"}, + {UA_STATUSCODE_BADMESSAGENOTAVAILABLE, "BadMessageNotAvailable"}, + {UA_STATUSCODE_BADINSUFFICIENTCLIENTPROFILE, "BadInsufficientClientProfile"}, + {UA_STATUSCODE_BADSTATENOTACTIVE, "BadStateNotActive"}, + {UA_STATUSCODE_BADALREADYEXISTS, "BadAlreadyExists"}, + {UA_STATUSCODE_BADTCPSERVERTOOBUSY, "BadTcpServerTooBusy"}, + {UA_STATUSCODE_BADTCPMESSAGETYPEINVALID, "BadTcpMessageTypeInvalid"}, + {UA_STATUSCODE_BADTCPSECURECHANNELUNKNOWN, "BadTcpSecureChannelUnknown"}, + {UA_STATUSCODE_BADTCPMESSAGETOOLARGE, "BadTcpMessageTooLarge"}, + {UA_STATUSCODE_BADTCPNOTENOUGHRESOURCES, "BadTcpNotEnoughResources"}, + {UA_STATUSCODE_BADTCPINTERNALERROR, "BadTcpInternalError"}, + {UA_STATUSCODE_BADTCPENDPOINTURLINVALID, "BadTcpEndpointUrlInvalid"}, + {UA_STATUSCODE_BADREQUESTINTERRUPTED, "BadRequestInterrupted"}, + {UA_STATUSCODE_BADREQUESTTIMEOUT, "BadRequestTimeout"}, + {UA_STATUSCODE_BADSECURECHANNELCLOSED, "BadSecureChannelClosed"}, + {UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN, "BadSecureChannelTokenUnknown"}, + {UA_STATUSCODE_BADSEQUENCENUMBERINVALID, "BadSequenceNumberInvalid"}, + {UA_STATUSCODE_BADPROTOCOLVERSIONUNSUPPORTED, "BadProtocolVersionUnsupported"}, + {UA_STATUSCODE_BADCONFIGURATIONERROR, "BadConfigurationError"}, + {UA_STATUSCODE_BADNOTCONNECTED, "BadNotConnected"}, + {UA_STATUSCODE_BADDEVICEFAILURE, "BadDeviceFailure"}, + {UA_STATUSCODE_BADSENSORFAILURE, "BadSensorFailure"}, + {UA_STATUSCODE_BADOUTOFSERVICE, "BadOutOfService"}, + {UA_STATUSCODE_BADDEADBANDFILTERINVALID, "BadDeadbandFilterInvalid"}, + {UA_STATUSCODE_UNCERTAINNOCOMMUNICATIONLASTUSABLEVALUE, "UncertainNoCommunicationLastUsableValue"}, + {UA_STATUSCODE_UNCERTAINLASTUSABLEVALUE, "UncertainLastUsableValue"}, + {UA_STATUSCODE_UNCERTAINSUBSTITUTEVALUE, "UncertainSubstituteValue"}, + {UA_STATUSCODE_UNCERTAININITIALVALUE, "UncertainInitialValue"}, + {UA_STATUSCODE_UNCERTAINSENSORNOTACCURATE, "UncertainSensorNotAccurate"}, + {UA_STATUSCODE_UNCERTAINENGINEERINGUNITSEXCEEDED, "UncertainEngineeringUnitsExceeded"}, + {UA_STATUSCODE_UNCERTAINSUBNORMAL, "UncertainSubNormal"}, + {UA_STATUSCODE_GOODLOCALOVERRIDE, "GoodLocalOverride"}, + {UA_STATUSCODE_BADREFRESHINPROGRESS, "BadRefreshInProgress"}, + {UA_STATUSCODE_BADCONDITIONALREADYDISABLED, "BadConditionAlreadyDisabled"}, + {UA_STATUSCODE_BADCONDITIONALREADYENABLED, "BadConditionAlreadyEnabled"}, + {UA_STATUSCODE_BADCONDITIONDISABLED, "BadConditionDisabled"}, + {UA_STATUSCODE_BADEVENTIDUNKNOWN, "BadEventIdUnknown"}, + {UA_STATUSCODE_BADEVENTNOTACKNOWLEDGEABLE, "BadEventNotAcknowledgeable"}, + {UA_STATUSCODE_BADDIALOGNOTACTIVE, "BadDialogNotActive"}, + {UA_STATUSCODE_BADDIALOGRESPONSEINVALID, "BadDialogResponseInvalid"}, + {UA_STATUSCODE_BADCONDITIONBRANCHALREADYACKED, "BadConditionBranchAlreadyAcked"}, + {UA_STATUSCODE_BADCONDITIONBRANCHALREADYCONFIRMED, "BadConditionBranchAlreadyConfirmed"}, + {UA_STATUSCODE_BADCONDITIONALREADYSHELVED, "BadConditionAlreadyShelved"}, + {UA_STATUSCODE_BADCONDITIONNOTSHELVED, "BadConditionNotShelved"}, + {UA_STATUSCODE_BADSHELVINGTIMEOUTOFRANGE, "BadShelvingTimeOutOfRange"}, + {UA_STATUSCODE_BADNODATA, "BadNoData"}, + {UA_STATUSCODE_BADBOUNDNOTFOUND, "BadBoundNotFound"}, + {UA_STATUSCODE_BADBOUNDNOTSUPPORTED, "BadBoundNotSupported"}, + {UA_STATUSCODE_BADDATALOST, "BadDataLost"}, + {UA_STATUSCODE_BADDATAUNAVAILABLE, "BadDataUnavailable"}, + {UA_STATUSCODE_BADENTRYEXISTS, "BadEntryExists"}, + {UA_STATUSCODE_BADNOENTRYEXISTS, "BadNoEntryExists"}, + {UA_STATUSCODE_BADTIMESTAMPNOTSUPPORTED, "BadTimestampNotSupported"}, + {UA_STATUSCODE_GOODENTRYINSERTED, "GoodEntryInserted"}, + {UA_STATUSCODE_GOODENTRYREPLACED, "GoodEntryReplaced"}, + {UA_STATUSCODE_UNCERTAINDATASUBNORMAL, "UncertainDataSubNormal"}, + {UA_STATUSCODE_GOODNODATA, "GoodNoData"}, + {UA_STATUSCODE_GOODMOREDATA, "GoodMoreData"}, + {UA_STATUSCODE_BADAGGREGATELISTMISMATCH, "BadAggregateListMismatch"}, + {UA_STATUSCODE_BADAGGREGATENOTSUPPORTED, "BadAggregateNotSupported"}, + {UA_STATUSCODE_BADAGGREGATEINVALIDINPUTS, "BadAggregateInvalidInputs"}, + {UA_STATUSCODE_BADAGGREGATECONFIGURATIONREJECTED, "BadAggregateConfigurationRejected"}, + {UA_STATUSCODE_GOODDATAIGNORED, "GoodDataIgnored"}, + {UA_STATUSCODE_BADREQUESTNOTALLOWED, "BadRequestNotAllowed"}, + {UA_STATUSCODE_BADREQUESTNOTCOMPLETE, "BadRequestNotComplete"}, + {UA_STATUSCODE_GOODEDITED, "GoodEdited"}, + {UA_STATUSCODE_GOODPOSTACTIONFAILED, "GoodPostActionFailed"}, + {UA_STATUSCODE_UNCERTAINDOMINANTVALUECHANGED, "UncertainDominantValueChanged"}, + {UA_STATUSCODE_GOODDEPENDENTVALUECHANGED, "GoodDependentValueChanged"}, + {UA_STATUSCODE_BADDOMINANTVALUECHANGED, "BadDominantValueChanged"}, + {UA_STATUSCODE_UNCERTAINDEPENDENTVALUECHANGED, "UncertainDependentValueChanged"}, + {UA_STATUSCODE_BADDEPENDENTVALUECHANGED, "BadDependentValueChanged"}, + {UA_STATUSCODE_GOODCOMMUNICATIONEVENT, "GoodCommunicationEvent"}, + {UA_STATUSCODE_GOODSHUTDOWNEVENT, "GoodShutdownEvent"}, + {UA_STATUSCODE_GOODCALLAGAIN, "GoodCallAgain"}, + {UA_STATUSCODE_GOODNONCRITICALTIMEOUT, "GoodNonCriticalTimeout"}, + {UA_STATUSCODE_BADINVALIDARGUMENT, "BadInvalidArgument"}, + {UA_STATUSCODE_BADCONNECTIONREJECTED, "BadConnectionRejected"}, + {UA_STATUSCODE_BADDISCONNECT, "BadDisconnect"}, + {UA_STATUSCODE_BADCONNECTIONCLOSED, "BadConnectionClosed"}, + {UA_STATUSCODE_BADINVALIDSTATE, "BadInvalidState"}, + {UA_STATUSCODE_BADENDOFSTREAM, "BadEndOfStream"}, + {UA_STATUSCODE_BADNODATAAVAILABLE, "BadNoDataAvailable"}, + {UA_STATUSCODE_BADWAITINGFORRESPONSE, "BadWaitingForResponse"}, + {UA_STATUSCODE_BADOPERATIONABANDONED, "BadOperationAbandoned"}, + {UA_STATUSCODE_BADEXPECTEDSTREAMTOBLOCK, "BadExpectedStreamToBlock"}, + {UA_STATUSCODE_BADWOULDBLOCK, "BadWouldBlock"}, + {UA_STATUSCODE_BADSYNTAXERROR, "BadSyntaxError"}, + {UA_STATUSCODE_BADMAXCONNECTIONSREACHED, "BadMaxConnectionsReached"}, + {0xffffffff, "Unknown StatusCode"} +}; + +const char * UA_StatusCode_name(UA_StatusCode code) { + for (size_t i = 0; i < statusCodeDescriptionsSize; ++i) { + if (statusCodeDescriptions[i].code == code) + return statusCodeDescriptions[i].name; + } + return statusCodeDescriptions[statusCodeDescriptionsSize-1].name; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_util.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014, 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014 (c) Florian Palm + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +size_t +UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) { + UA_assert(buf); + UA_assert(number); + u32 n = 0; + size_t progress = 0; + /* read numbers until the end or a non-number character appears */ + while(progress < buflen) { + u8 c = buf[progress]; + if(c >= '0' && c <= '9' && c <= '0' + (base-1)) + n = (n * base) + c - '0'; + else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11)) + n = (n * base) + c-'a' + 10; + else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11)) + n = (n * base) + c-'A' + 10; + else + break; + ++progress; + } + *number = n; + return progress; +} + +size_t +UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) { + return UA_readNumberWithBase(buf, buflen, number, 10); +} + +UA_StatusCode +UA_parseEndpointUrl(const UA_String *endpointUrl, UA_String *outHostname, + u16 *outPort, UA_String *outPath) { + /* Url must begin with "opc.tcp://" or opc.udp:// (if pubsub enabled) */ + if(endpointUrl->length < 11) { + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + } + if (strncmp((char*)endpointUrl->data, "opc.tcp://", 10) != 0) { +#ifdef UA_ENABLE_PUBSUB + if (strncmp((char*)endpointUrl->data, "opc.udp://", 10) != 0 && + strncmp((char*)endpointUrl->data, "opc.mqtt://", 11) != 0) { + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + } +#else + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; +#endif + } + + /* Where does the hostname end? */ + size_t curr = 10; + if(endpointUrl->data[curr] == '[') { + /* IPv6: opc.tcp://[2001:0db8:85a3::8a2e:0370:7334]:1234/path */ + for(; curr < endpointUrl->length; ++curr) { + if(endpointUrl->data[curr] == ']') + break; + } + if(curr == endpointUrl->length) + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + curr++; + } else { + /* IPv4 or hostname: opc.tcp://something.something:1234/path */ + for(; curr < endpointUrl->length; ++curr) { + if(endpointUrl->data[curr] == ':' || endpointUrl->data[curr] == '/') + break; + } + } + + /* Set the hostname */ + outHostname->data = &endpointUrl->data[10]; + outHostname->length = curr - 10; + if(curr == endpointUrl->length) + return UA_STATUSCODE_GOOD; + + /* Set the port */ + if(endpointUrl->data[curr] == ':') { + if(++curr == endpointUrl->length) + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + u32 largeNum; + size_t progress = UA_readNumber(&endpointUrl->data[curr], endpointUrl->length - curr, &largeNum); + if(progress == 0 || largeNum > 65535) + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + /* Test if the end of a valid port was reached */ + curr += progress; + if(curr == endpointUrl->length || endpointUrl->data[curr] == '/') + *outPort = (u16)largeNum; + if(curr == endpointUrl->length) + return UA_STATUSCODE_GOOD; + } + + /* Set the path */ + UA_assert(curr < endpointUrl->length); + if(endpointUrl->data[curr] != '/') + return UA_STATUSCODE_BADTCPENDPOINTURLINVALID; + if(++curr == endpointUrl->length) + return UA_STATUSCODE_GOOD; + outPath->data = &endpointUrl->data[curr]; + outPath->length = endpointUrl->length - curr; + + /* Remove trailing slash from the path */ + if(endpointUrl->data[endpointUrl->length - 1] == '/') + outPath->length--; + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_parseEndpointUrlEthernet(const UA_String *endpointUrl, UA_String *target, + UA_UInt16 *vid, UA_Byte *pcp) { + /* Url must begin with "opc.eth://" */ + if(endpointUrl->length < 11) { + return UA_STATUSCODE_BADINTERNALERROR; + } + if(strncmp((char*) endpointUrl->data, "opc.eth://", 10) != 0) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Where does the host address end? */ + size_t curr = 10; + for(; curr < endpointUrl->length; ++curr) { + if(endpointUrl->data[curr] == ':') { + break; + } + } + + /* set host address */ + target->data = &endpointUrl->data[10]; + target->length = curr - 10; + if(curr == endpointUrl->length) { + return UA_STATUSCODE_GOOD; + } + + /* Set VLAN */ + u32 value = 0; + curr++; /* skip ':' */ + size_t progress = UA_readNumber(&endpointUrl->data[curr], + endpointUrl->length - curr, &value); + if(progress == 0 || value > 4096) { + return UA_STATUSCODE_BADINTERNALERROR; + } + curr += progress; + if(curr == endpointUrl->length || endpointUrl->data[curr] == '.') { + *vid = (UA_UInt16) value; + } + if(curr == endpointUrl->length) { + return UA_STATUSCODE_GOOD; + } + + /* Set priority */ + if(endpointUrl->data[curr] != '.') { + return UA_STATUSCODE_BADINTERNALERROR; + } + curr++; /* skip '.' */ + progress = UA_readNumber(&endpointUrl->data[curr], + endpointUrl->length - curr, &value); + if(progress == 0 || value > 7) { + return UA_STATUSCODE_BADINTERNALERROR; + } + curr += progress; + if(curr != endpointUrl->length) { + return UA_STATUSCODE_BADINTERNALERROR; + } + *pcp = (UA_Byte) value; + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_ByteString_toBase64(const UA_ByteString *byteString, + UA_String *str) { + UA_String_init(str); + if(!byteString || !byteString->data) + return UA_STATUSCODE_GOOD; + + str->data = (UA_Byte*) + UA_base64(byteString->data, byteString->length, &str->length); + if(!str->data) + return UA_STATUSCODE_BADOUTOFMEMORY; + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode UA_EXPORT +UA_ByteString_fromBase64(UA_ByteString *bs, + const UA_String *input) { + UA_ByteString_init(bs); + if(input->length == 0) + return UA_STATUSCODE_GOOD; + bs->data = UA_unbase64((const unsigned char*)input->data, + input->length, &bs->length); + /* TODO: Differentiate between encoding and memory errors */ + if(!bs->data) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_timer.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017, 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +/* There may be several entries with the same nextTime in the tree. We give them + * an absolute order by considering the memory address to break ties. Because of + * this, the nextTime property cannot be used to lookup specific entries. */ +static enum ZIP_CMP +cmpDateTime(const UA_DateTime *a, const UA_DateTime *b) { + if(*a < *b) + return ZIP_CMP_LESS; + if(*a > *b) + return ZIP_CMP_MORE; + if(a == b) + return ZIP_CMP_EQ; + if(a < b) + return ZIP_CMP_LESS; + return ZIP_CMP_MORE; +} + +ZIP_PROTOTYPE(UA_TimerZip, UA_TimerEntry, UA_DateTime) +ZIP_IMPL(UA_TimerZip, UA_TimerEntry, zipfields, UA_DateTime, nextTime, cmpDateTime) + +/* The identifiers of entries are unique */ +static enum ZIP_CMP +cmpId(const UA_UInt64 *a, const UA_UInt64 *b) { + if(*a < *b) + return ZIP_CMP_LESS; + if(*a == *b) + return ZIP_CMP_EQ; + return ZIP_CMP_MORE; +} + +ZIP_PROTOTYPE(UA_TimerIdZip, UA_TimerEntry, UA_UInt64) +ZIP_IMPL(UA_TimerIdZip, UA_TimerEntry, idZipfields, UA_UInt64, id, cmpId) + +void +UA_Timer_init(UA_Timer *t) { + memset(t, 0, sizeof(UA_Timer)); + UA_LOCK_INIT(t->timerMutex) +} + +void +UA_Timer_addTimerEntry(UA_Timer *t, UA_TimerEntry *te, UA_UInt64 *callbackId) { + UA_LOCK(t->timerMutex); + te->id = ++t->idCounter; + if(callbackId) + *callbackId = te->id; + ZIP_INSERT(UA_TimerZip, &t->root, te, ZIP_FFS32(UA_UInt32_random())); + ZIP_INSERT(UA_TimerIdZip, &t->idRoot, te, ZIP_RANK(te, zipfields)); + UA_UNLOCK(t->timerMutex); +} + +static UA_StatusCode +addCallback(UA_Timer *t, UA_ApplicationCallback callback, void *application, void *data, + UA_DateTime nextTime, UA_UInt64 interval, UA_UInt64 *callbackId) { + /* A callback method needs to be present */ + if(!callback) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the repeated callback structure */ + UA_TimerEntry *te = (UA_TimerEntry*)UA_malloc(sizeof(UA_TimerEntry)); + if(!te) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Set the repeated callback */ + te->interval = (UA_UInt64)interval; + te->id = ++t->idCounter; + te->callback = callback; + te->application = application; + te->data = data; + te->nextTime = nextTime; + + /* Set the output identifier */ + if(callbackId) + *callbackId = te->id; + + ZIP_INSERT(UA_TimerZip, &t->root, te, ZIP_FFS32(UA_UInt32_random())); + ZIP_INSERT(UA_TimerIdZip, &t->idRoot, te, ZIP_RANK(te, zipfields)); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Timer_addTimedCallback(UA_Timer *t, UA_ApplicationCallback callback, + void *application, void *data, UA_DateTime date, + UA_UInt64 *callbackId) { + UA_LOCK(t->timerMutex); + UA_StatusCode res = addCallback(t, callback, application, data, date, 0, callbackId); + UA_UNLOCK(t->timerMutex); + return res; +} + +/* Adding repeated callbacks: Add an entry with the "nextTime" timestamp in the + * future. This will be picked up in the next iteration and inserted at the + * correct place. So that the next execution takes place ät "nextTime". */ +UA_StatusCode +UA_Timer_addRepeatedCallback(UA_Timer *t, UA_ApplicationCallback callback, + void *application, void *data, UA_Double interval_ms, + UA_UInt64 *callbackId) { + /* The interval needs to be positive */ + if(interval_ms <= 0.0) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_UInt64 interval = (UA_UInt64)(interval_ms * UA_DATETIME_MSEC); + if(interval == 0) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_DateTime nextTime = UA_DateTime_nowMonotonic() + (UA_DateTime)interval; + UA_LOCK(t->timerMutex); + UA_StatusCode res = addCallback(t, callback, application, data, nextTime, + interval, callbackId); + UA_UNLOCK(t->timerMutex); + return res; +} + +UA_StatusCode +UA_Timer_changeRepeatedCallbackInterval(UA_Timer *t, UA_UInt64 callbackId, + UA_Double interval_ms) { + /* The interval needs to be positive */ + if(interval_ms <= 0.0) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_LOCK(t->timerMutex); + + /* Remove from the sorted list */ + UA_TimerEntry *te = ZIP_FIND(UA_TimerIdZip, &t->idRoot, &callbackId); + if(!te) { + UA_UNLOCK(t->timerMutex); + return UA_STATUSCODE_BADNOTFOUND; + } + + /* Set the repeated callback */ + ZIP_REMOVE(UA_TimerZip, &t->root, te); + te->interval = (UA_UInt64)(interval_ms * UA_DATETIME_MSEC); /* in 100ns resolution */ + te->nextTime = UA_DateTime_nowMonotonic() + (UA_DateTime)te->interval; + ZIP_INSERT(UA_TimerZip, &t->root, te, ZIP_RANK(te, zipfields)); + + UA_UNLOCK(t->timerMutex); + return UA_STATUSCODE_GOOD; +} + +void +UA_Timer_removeCallback(UA_Timer *t, UA_UInt64 callbackId) { + UA_LOCK(t->timerMutex); + UA_TimerEntry *te = ZIP_FIND(UA_TimerIdZip, &t->idRoot, &callbackId); + if(!te) { + UA_UNLOCK(t->timerMutex); + return; + } + + ZIP_REMOVE(UA_TimerZip, &t->root, te); + ZIP_REMOVE(UA_TimerIdZip, &t->idRoot, te); + UA_free(te); + UA_UNLOCK(t->timerMutex); +} + +UA_DateTime +UA_Timer_process(UA_Timer *t, UA_DateTime nowMonotonic, + UA_TimerExecutionCallback executionCallback, + void *executionApplication) { + UA_LOCK(t->timerMutex); + UA_TimerEntry *first; + while((first = ZIP_MIN(UA_TimerZip, &t->root)) && + first->nextTime <= nowMonotonic) { + ZIP_REMOVE(UA_TimerZip, &t->root, first); + + /* Reinsert / remove to their new position first. Because the callback + * can interact with the zip tree and expects the same entries in the + * root and idRoot trees. */ + + if(first->interval == 0) { + ZIP_REMOVE(UA_TimerIdZip, &t->idRoot, first); + if(first->callback) { + UA_UNLOCK(t->timerMutex); + executionCallback(executionApplication, first->callback, + first->application, first->data); + UA_LOCK(t->timerMutex); + } + UA_free(first); + continue; + } + + /* Set the time for the next execution. Prevent an infinite loop by + * forcing the next processing into the next iteration. */ + first->nextTime += (UA_Int64)first->interval; + if(first->nextTime < nowMonotonic) + first->nextTime = nowMonotonic + 1; + ZIP_INSERT(UA_TimerZip, &t->root, first, ZIP_RANK(first, zipfields)); + + if(!first->callback) + continue; + + /* Unlock the mutes before dropping into the callback. So that the timer + * itself can be edited within the callback. When we return, only the + * pointer to t must still exist. */ + UA_ApplicationCallback cb = first->callback; + void *app = first->application; + void *data = first->data; + UA_UNLOCK(t->timerMutex); + executionCallback(executionApplication, cb, app, data); + UA_LOCK(t->timerMutex); + } + + /* Return the timestamp of the earliest next callback */ + first = ZIP_MIN(UA_TimerZip, &t->root); + UA_DateTime next = (first) ? first->nextTime : UA_INT64_MAX; + if(next < nowMonotonic) + next = nowMonotonic; + UA_UNLOCK(t->timerMutex); + return next; +} + +static void +freeEntry(UA_TimerEntry *te, void *data) { + UA_free(te); +} + +void +UA_Timer_clear(UA_Timer *t) { + UA_LOCK(t->timerMutex); + /* Free all nodes and reset the root */ + ZIP_ITER(UA_TimerZip, &t->root, freeEntry, NULL); + UA_UNLOCK(t->timerMutex); +#if UA_MULTITHREADING >= 100 + UA_LOCK_DESTROY(t->timerMutex) +#endif + ZIP_INIT(&t->root); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_connection.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2016-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + + +/* Hides some errors before sending them to a client according to the + * standard. */ +static void +hideErrors(UA_TcpErrorMessage *const error) { + switch(error->error) { + case UA_STATUSCODE_BADCERTIFICATEUNTRUSTED: + case UA_STATUSCODE_BADCERTIFICATEREVOKED: + error->error = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + error->reason = UA_STRING_NULL; + break; + // TODO: Check if these are all cases that need to be covered. + default: + break; + } +} + +void +UA_Connection_sendError(UA_Connection *connection, UA_TcpErrorMessage *error) { + hideErrors(error); + + UA_TcpMessageHeader header; + header.messageTypeAndChunkType = UA_MESSAGETYPE_ERR + UA_CHUNKTYPE_FINAL; + // Header + ErrorMessage (error + reasonLength_field + length) + header.messageSize = 8 + (4 + 4 + (UA_UInt32)error->reason.length); + + /* Get the send buffer from the network layer */ + UA_ByteString msg = UA_BYTESTRING_NULL; + UA_StatusCode retval = connection->getSendBuffer(connection, header.messageSize, &msg); + if(retval != UA_STATUSCODE_GOOD) + return; + + /* Encode and send the response */ + UA_Byte *bufPos = msg.data; + const UA_Byte *bufEnd = &msg.data[msg.length]; + UA_TcpMessageHeader_encodeBinary(&header, &bufPos, bufEnd); + UA_TcpErrorMessage_encodeBinary(error, &bufPos, bufEnd); + msg.length = header.messageSize; + connection->send(connection, &msg); +} + +void UA_Connection_detachSecureChannel(UA_Connection *connection) { + UA_SecureChannel *channel = connection->channel; + if(channel) + /* only replace when the channel points to this connection */ + UA_atomic_cmpxchg((void**)&channel->connection, connection, NULL); + UA_atomic_xchg((void**)&connection->channel, NULL); +} + +// TODO: Return an error code +void +UA_Connection_attachSecureChannel(UA_Connection *connection, UA_SecureChannel *channel) { + if(UA_atomic_cmpxchg((void**)&channel->connection, NULL, connection) == NULL) + UA_atomic_xchg((void**)&connection->channel, (void*)channel); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_securechannel.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2016-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016 (c) TorbenD + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018-2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + +#define UA_BITMASK_MESSAGETYPE 0x00ffffffu +#define UA_BITMASK_CHUNKTYPE 0xff000000u +#define UA_CONNECTION_PROTOCOL_MESSAGE_HEADER_SIZE 8 + +const UA_ByteString UA_SECURITY_POLICY_NONE_URI = + {47, (UA_Byte *)"http://opcfoundation.org/UA/SecurityPolicy#None"}; + +#ifdef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS +UA_StatusCode decrypt_verifySignatureFailure; +UA_StatusCode sendAsym_sendFailure; +UA_StatusCode processSym_seqNumberFailure; +#endif + +void UA_SecureChannel_init(UA_SecureChannel *channel, + const UA_ConnectionConfig *config) { + /* Linked lists are also initialized by zeroing out */ + memset(channel, 0, sizeof(UA_SecureChannel)); + channel->state = UA_SECURECHANNELSTATE_FRESH; + SIMPLEQ_INIT(&channel->completeChunks); + SIMPLEQ_INIT(&channel->decryptedChunks); + SLIST_INIT(&channel->sessions); + channel->config = *config; +} + +UA_StatusCode +UA_SecureChannel_setSecurityPolicy(UA_SecureChannel *channel, + const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate) { + /* Is a policy already configured? */ + if(channel->securityPolicy) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Security policy already configured"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + UA_StatusCode retval = securityPolicy->channelModule. + newContext(securityPolicy, remoteCertificate, &channel->channelContext); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not set up the SecureChannel context"); + return retval; + } + + retval = UA_ByteString_copy(remoteCertificate, &channel->remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_ByteString remoteCertificateThumbprint = {20, channel->remoteCertificateThumbprint}; + retval = securityPolicy->asymmetricModule. + makeCertificateThumbprint(securityPolicy, &channel->remoteCertificate, + &remoteCertificateThumbprint); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not create the certificate thumbprint"); + return retval; + } + + channel->securityPolicy = securityPolicy; + return UA_STATUSCODE_GOOD; +} + +static void +UA_Chunk_delete(UA_Chunk *chunk) { + if(chunk->copied) + UA_ByteString_clear(&chunk->bytes); + UA_free(chunk); +} + +static void +deleteChunks(UA_ChunkQueue *queue) { + UA_Chunk *chunk; + while((chunk = SIMPLEQ_FIRST(queue))) { + SIMPLEQ_REMOVE_HEAD(queue, pointers); + UA_Chunk_delete(chunk); + } +} + +void +UA_SecureChannel_deleteBuffered(UA_SecureChannel *channel) { + deleteChunks(&channel->completeChunks); + deleteChunks(&channel->decryptedChunks); + UA_ByteString_clear(&channel->incompleteChunk); +} + +void +UA_SecureChannel_close(UA_SecureChannel *channel) { + /* Set the status to closed */ + channel->state = UA_SECURECHANNELSTATE_CLOSED; + + /* Detach from the connection and close the connection */ + if(channel->connection) { + if(channel->connection->state != UA_CONNECTIONSTATE_CLOSED) + channel->connection->close(channel->connection); + UA_Connection_detachSecureChannel(channel->connection); + } + + /* Remove session pointers (not the sessions) and NULL the pointers back to + * the SecureChannel in the Session */ + UA_SessionHeader *sh; + while((sh = SLIST_FIRST(&channel->sessions))) { + sh->channel = NULL; + SLIST_REMOVE_HEAD(&channel->sessions, next); + } + + /* Delete the channel context for the security policy */ + if(channel->securityPolicy) { + channel->securityPolicy->channelModule.deleteContext(channel->channelContext); + channel->securityPolicy = NULL; + channel->channelContext = NULL; + } + + /* Delete members */ + UA_ByteString_clear(&channel->remoteCertificate); + UA_ByteString_clear(&channel->localNonce); + UA_ByteString_clear(&channel->remoteNonce); + UA_ChannelSecurityToken_clear(&channel->securityToken); + UA_ChannelSecurityToken_clear(&channel->altSecurityToken); + UA_SecureChannel_deleteBuffered(channel); +} + +UA_StatusCode +UA_SecureChannel_processHELACK(UA_SecureChannel *channel, + const UA_TcpAcknowledgeMessage *remoteConfig) { + /* The lowest common version is used by both sides */ + if(channel->config.protocolVersion > remoteConfig->protocolVersion) + channel->config.protocolVersion = remoteConfig->protocolVersion; + + /* Can we receive the max send size? */ + if(channel->config.sendBufferSize > remoteConfig->receiveBufferSize) + channel->config.sendBufferSize = remoteConfig->receiveBufferSize; + + /* Can we send the max receive size? */ + if(channel->config.recvBufferSize > remoteConfig->sendBufferSize) + channel->config.recvBufferSize = remoteConfig->sendBufferSize; + + channel->config.remoteMaxMessageSize = remoteConfig->maxMessageSize; + channel->config.remoteMaxChunkCount = remoteConfig->maxChunkCount; + + /* Chunks of at least 8192 bytes must be permissible. + * See Part 6, Clause 6.7.1 */ + if(channel->config.recvBufferSize < 8192 || + channel->config.sendBufferSize < 8192 || + (channel->config.remoteMaxMessageSize != 0 && + channel->config.remoteMaxMessageSize < 8192)) + return UA_STATUSCODE_BADINTERNALERROR; + + channel->connection->state = UA_CONNECTIONSTATE_ESTABLISHED; + + return UA_STATUSCODE_GOOD; +} + +/* Sends an OPN message using asymmetric encryption if defined */ +UA_StatusCode +UA_SecureChannel_sendAsymmetricOPNMessage(UA_SecureChannel *channel, + UA_UInt32 requestId, const void *content, + const UA_DataType *contentType) { + if(channel->securityMode == UA_MESSAGESECURITYMODE_INVALID) + return UA_STATUSCODE_BADSECURITYMODEREJECTED; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_Connection *connection = channel->connection; + if(!connection) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the message buffer */ + UA_ByteString buf = UA_BYTESTRING_NULL; + UA_StatusCode retval = + connection->getSendBuffer(connection, channel->config.sendBufferSize, &buf); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Restrict buffer to the available space for the payload */ + UA_Byte *buf_pos = buf.data; + const UA_Byte *buf_end = &buf.data[buf.length]; + hideBytesAsym(channel, &buf_pos, &buf_end); + + /* Encode the message type and content */ + retval |= UA_encodeBinary(&contentType->binaryEncodingId, &UA_TYPES[UA_TYPES_NODEID], + &buf_pos, &buf_end, NULL, NULL); + retval |= UA_encodeBinary(content, contentType, &buf_pos, &buf_end, NULL, NULL); + if(retval != UA_STATUSCODE_GOOD) { + connection->releaseSendBuffer(connection, &buf); + return retval; + } + + const size_t securityHeaderLength = calculateAsymAlgSecurityHeaderLength(channel); + + /* Add padding to the chunk */ +#ifdef UA_ENABLE_ENCRYPTION + padChunkAsym(channel, &buf, securityHeaderLength, &buf_pos); +#endif + + /* The total message length */ + size_t pre_sig_length = (uintptr_t)buf_pos - (uintptr_t)buf.data; + size_t total_length = pre_sig_length; + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGN || + channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + total_length += sp->asymmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + + /* The total message length is known here which is why we encode the headers + * at this step and not earlier. */ + size_t finalLength = 0; + retval = prependHeadersAsym(channel, buf.data, buf_end, total_length, + securityHeaderLength, requestId, &finalLength); + if(retval != UA_STATUSCODE_GOOD) { + connection->releaseSendBuffer(connection, &buf); + return retval; + } + +#ifdef UA_ENABLE_ENCRYPTION + retval = signAndEncryptAsym(channel, pre_sig_length, &buf, securityHeaderLength, total_length); + if(retval != UA_STATUSCODE_GOOD) { + connection->releaseSendBuffer(connection, &buf); + return retval; + } +#endif + + /* Send the message, the buffer is freed in the network layer */ + buf.length = finalLength; + retval = connection->send(connection, &buf); +#ifdef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS + retval |= sendAsym_sendFailure; +#endif + return retval; +} + +/* Will this chunk surpass the capacity of the SecureChannel for the message? */ +static UA_StatusCode +checkLimitsSym(UA_MessageContext *const mc, size_t *const bodyLength) { + UA_Byte *buf_body_start = mc->messageBuffer.data + UA_SECURE_MESSAGE_HEADER_LENGTH; + const UA_Byte *buf_body_end = mc->buf_pos; + *bodyLength = (uintptr_t)buf_body_end - (uintptr_t)buf_body_start; + mc->messageSizeSoFar += *bodyLength; + mc->chunksSoFar++; + + UA_SecureChannel *channel = mc->channel; + if(mc->messageSizeSoFar > channel->config.localMaxMessageSize && + channel->config.localMaxMessageSize != 0) + return UA_STATUSCODE_BADRESPONSETOOLARGE; + + if(mc->chunksSoFar > channel->config.localMaxChunkCount && + channel->config.localMaxChunkCount != 0) + return UA_STATUSCODE_BADRESPONSETOOLARGE; + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +encodeHeadersSym(UA_MessageContext *const messageContext, size_t totalLength) { + UA_SecureChannel *channel = messageContext->channel; + UA_Byte *header_pos = messageContext->messageBuffer.data; + + UA_TcpMessageHeader header; + header.messageTypeAndChunkType = messageContext->messageType; + header.messageSize = (UA_UInt32)totalLength; + if(messageContext->final) + header.messageTypeAndChunkType += UA_CHUNKTYPE_FINAL; + else + header.messageTypeAndChunkType += UA_CHUNKTYPE_INTERMEDIATE; + + UA_SequenceHeader seqHeader; + seqHeader.requestId = messageContext->requestId; + seqHeader.sequenceNumber = UA_atomic_addUInt32(&channel->sendSequenceNumber, 1); + + UA_StatusCode res = UA_STATUSCODE_GOOD; + res |= UA_encodeBinary(&header, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER], + &header_pos, &messageContext->buf_end, NULL, NULL); + res |= UA_encodeBinary(&channel->securityToken.channelId, &UA_TYPES[UA_TYPES_UINT32], + &header_pos, &messageContext->buf_end, NULL, NULL); + res |= UA_encodeBinary(&channel->securityToken.tokenId, &UA_TYPES[UA_TYPES_UINT32], + &header_pos, &messageContext->buf_end, NULL, NULL); + res |= UA_encodeBinary(&seqHeader, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER], + &header_pos, &messageContext->buf_end, NULL, NULL); + return res; +} + +static UA_StatusCode +sendSymmetricChunk(UA_MessageContext *messageContext) { + UA_SecureChannel *const channel = messageContext->channel; + const UA_SecurityPolicy *securityPolicy = channel->securityPolicy; + UA_Connection *const connection = channel->connection; + if(!connection) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t bodyLength = 0; + UA_StatusCode res = checkLimitsSym(messageContext, &bodyLength); + size_t total_length = 0; + size_t pre_sig_length = 0; + if(res != UA_STATUSCODE_GOOD) + goto error; + + /* Add padding */ +#ifdef UA_ENABLE_ENCRYPTION + padChunkSym(messageContext, bodyLength); +#endif + + /* The total message length */ + pre_sig_length = (uintptr_t)(messageContext->buf_pos) - + (uintptr_t)messageContext->messageBuffer.data; + total_length = pre_sig_length; + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGN || + channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + total_length += securityPolicy->symmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(securityPolicy, channel->channelContext); + /* Space for the padding and the signature have been reserved in setBufPos() */ + UA_assert(total_length <= channel->config.sendBufferSize); + + /* For giving the buffer to the network layer */ + messageContext->messageBuffer.length = total_length; + + UA_assert(res == UA_STATUSCODE_GOOD); + res = encodeHeadersSym(messageContext, total_length); + if(res != UA_STATUSCODE_GOOD) + goto error; + +#ifdef UA_ENABLE_ENCRYPTION + res = signChunkSym(messageContext, pre_sig_length); + if(res != UA_STATUSCODE_GOOD) + goto error; + + res = encryptChunkSym(messageContext, total_length); + if(res != UA_STATUSCODE_GOOD) + goto error; +#endif + + /* Send the chunk, the buffer is freed in the network layer */ + return connection->send(channel->connection, &messageContext->messageBuffer); + +error: + connection->releaseSendBuffer(channel->connection, &messageContext->messageBuffer); + return res; +} + +/* Callback from the encoding layer. Send the chunk and replace the buffer. */ +static UA_StatusCode +sendSymmetricEncodingCallback(void *data, UA_Byte **buf_pos, const UA_Byte **buf_end) { + /* Set buf values from encoding in the messagecontext */ + UA_MessageContext *mc = (UA_MessageContext *)data; + mc->buf_pos = *buf_pos; + mc->buf_end = *buf_end; + + /* Send out */ + UA_StatusCode retval = sendSymmetricChunk(mc); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set a new buffer for the next chunk */ + UA_Connection *connection = mc->channel->connection; + if(!connection) + return UA_STATUSCODE_BADINTERNALERROR; + + retval = connection->getSendBuffer(connection, mc->channel->config.sendBufferSize, + &mc->messageBuffer); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Hide bytes for header, padding and signature */ + setBufPos(mc); + *buf_pos = mc->buf_pos; + *buf_end = mc->buf_end; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_MessageContext_begin(UA_MessageContext *mc, UA_SecureChannel *channel, + UA_UInt32 requestId, UA_MessageType messageType) { + UA_Connection *connection = channel->connection; + if(!connection) + return UA_STATUSCODE_BADINTERNALERROR; + + if(messageType != UA_MESSAGETYPE_MSG && messageType != UA_MESSAGETYPE_CLO) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Create the chunking info structure */ + mc->channel = channel; + mc->requestId = requestId; + mc->chunksSoFar = 0; + mc->messageSizeSoFar = 0; + mc->final = false; + mc->messageBuffer = UA_BYTESTRING_NULL; + mc->messageType = messageType; + + /* Allocate the message buffer */ + UA_StatusCode retval = + connection->getSendBuffer(connection, channel->config.sendBufferSize, + &mc->messageBuffer); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Hide bytes for header, padding and signature */ + setBufPos(mc); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_MessageContext_encode(UA_MessageContext *mc, const void *content, + const UA_DataType *contentType) { + UA_StatusCode retval = UA_encodeBinary(content, contentType, &mc->buf_pos, &mc->buf_end, + sendSymmetricEncodingCallback, mc); + if(retval != UA_STATUSCODE_GOOD && mc->messageBuffer.length > 0) + UA_MessageContext_abort(mc); + return retval; +} + +UA_StatusCode +UA_MessageContext_finish(UA_MessageContext *mc) { + mc->final = true; + return sendSymmetricChunk(mc); +} + +void +UA_MessageContext_abort(UA_MessageContext *mc) { + UA_Connection *connection = mc->channel->connection; + connection->releaseSendBuffer(connection, &mc->messageBuffer); +} + +UA_StatusCode +UA_SecureChannel_sendSymmetricMessage(UA_SecureChannel *channel, UA_UInt32 requestId, + UA_MessageType messageType, void *payload, + const UA_DataType *payloadType) { + if(!channel || !channel->connection || !payload || !payloadType) + return UA_STATUSCODE_BADINTERNALERROR; + + if(channel->state != UA_SECURECHANNELSTATE_OPEN) + return UA_STATUSCODE_BADCONNECTIONCLOSED; + + if(channel->connection->state != UA_CONNECTIONSTATE_ESTABLISHED) + return UA_STATUSCODE_BADCONNECTIONCLOSED; + + UA_MessageContext mc; + UA_StatusCode retval = UA_MessageContext_begin(&mc, channel, requestId, messageType); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Assert's required for clang-analyzer */ + UA_assert(mc.buf_pos == &mc.messageBuffer.data[UA_SECURE_MESSAGE_HEADER_LENGTH]); + UA_assert(mc.buf_end <= &mc.messageBuffer.data[mc.messageBuffer.length]); + + retval = UA_MessageContext_encode(&mc, &payloadType->binaryEncodingId, + &UA_TYPES[UA_TYPES_NODEID]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_MessageContext_encode(&mc, payload, payloadType); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + return UA_MessageContext_finish(&mc); +} + +/********************************/ +/* Receive and Process Messages */ +/********************************/ + +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +static UA_StatusCode +processSequenceNumberSym(UA_SecureChannel *channel, UA_UInt32 sequenceNumber) { + /* Failure mode hook for unit tests */ +#ifdef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS + if(processSym_seqNumberFailure != UA_STATUSCODE_GOOD) + return processSym_seqNumberFailure; +#endif + + /* Does the sequence number match? */ + if(sequenceNumber != channel->receiveSequenceNumber + 1) { + /* FIXME: Remove magic numbers :( */ + if(channel->receiveSequenceNumber + 1 > 4294966271 && sequenceNumber < 1024) + channel->receiveSequenceNumber = sequenceNumber - 1; /* Roll over */ + else + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + ++channel->receiveSequenceNumber; + return UA_STATUSCODE_GOOD; +} + +#endif + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +static UA_StatusCode +processSequenceNumberNop(UA_SecureChannel *channel, UA_UInt32 sequenceNumber) { + return UA_STATUSCODE_GOOD; +} +#endif + +static UA_StatusCode +decryptMessageChunk(UA_SecureChannel *channel, UA_Chunk *chunk, void *application) { + size_t offset = UA_CONNECTION_PROTOCOL_MESSAGE_HEADER_SIZE; /* Skip the message header */ + UA_UInt32 secureChannelId; + UA_StatusCode res = UA_UInt32_decodeBinary(&chunk->bytes, &offset, &secureChannelId); + if(res != UA_STATUSCODE_GOOD) + return res; + + UA_AsymmetricAlgorithmSecurityHeader asymHeader; + UA_SymmetricAlgorithmSecurityHeader symHeader; + UA_StatusCode (*processSequenceNumber)(UA_SecureChannel *, UA_UInt32); + UA_StatusCode (*checkHeader)(const UA_SecureChannel *, void *); + void (*clearHeader)(void *); + void *securityHeader; + const UA_SecurityPolicyCryptoModule *cryptoModule; + UA_SequenceHeader sequenceHeader; + + if(chunk->messageType == UA_MESSAGETYPE_OPN) { + if(channel->state != UA_SECURECHANNELSTATE_OPEN && + channel->state != UA_SECURECHANNELSTATE_OPN_SENT && + channel->state != UA_SECURECHANNELSTATE_ACK_SENT) + return UA_STATUSCODE_BADINVALIDSTATE; + processSequenceNumber = processSequenceNumberAsym; + checkHeader = (UA_StatusCode (*)(const UA_SecureChannel *, void *)) checkAsymHeader; + securityHeader = &asymHeader; + clearHeader = (void (*)(void *)) UA_AsymmetricAlgorithmSecurityHeader_clear; + res = UA_AsymmetricAlgorithmSecurityHeader_decodeBinary(&chunk->bytes, &offset, &asymHeader); + if(res != UA_STATUSCODE_GOOD) + goto error; + + if(asymHeader.senderCertificate.length > 0) { + if(channel->certificateVerification == NULL) { + res = UA_STATUSCODE_BADINTERNALERROR; + goto error; + } + res = channel->certificateVerification-> + verifyCertificate(channel->certificateVerification->context, + &asymHeader.senderCertificate); + if(res != UA_STATUSCODE_GOOD) + goto error; + } + + if(channel->processOPNHeader != NULL && channel->securityPolicy == NULL) { + res = channel->processOPNHeader(application, channel, &asymHeader); + if(res != UA_STATUSCODE_GOOD) + goto error; + } + + if(secureChannelId != 0 && channel->securityToken.channelId == 0) + channel->securityToken.channelId = secureChannelId; + + if(!channel->securityPolicy) { + res = UA_STATUSCODE_BADINTERNALERROR; + goto error; + } + cryptoModule = &channel->securityPolicy->asymmetricModule.cryptoModule; + } else { + if(channel->state == UA_SECURECHANNELSTATE_CLOSED) + return UA_STATUSCODE_BADSECURECHANNELCLOSED; +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + processSequenceNumber = processSequenceNumberSym; +#else + processSequenceNumber = processSequenceNumberNop; +#endif + checkHeader = (UA_StatusCode (*)(const UA_SecureChannel *, void *)) checkSymHeader; + securityHeader = &symHeader; + clearHeader = (void (*)(void *)) UA_SymmetricAlgorithmSecurityHeader_clear; + res = UA_SymmetricAlgorithmSecurityHeader_decodeBinary(&chunk->bytes, &offset, &symHeader); + if(res != UA_STATUSCODE_GOOD) + goto error; + + if(!channel->securityPolicy) { + res = UA_STATUSCODE_BADINTERNALERROR; + goto error; + } + cryptoModule = &channel->securityPolicy->symmetricModule.cryptoModule; + } + +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) + /* Check the ChannelId. Non-opened channels have the id zero. */ + if(secureChannelId != channel->securityToken.channelId) { + res = UA_STATUSCODE_BADSECURECHANNELIDINVALID; + goto error; + } +#endif + + /* Check (and revolve) the SecurityToken */ + res = checkHeader(channel, securityHeader); + clearHeader(securityHeader); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Decrypt the chunk payload */ + res = decryptAndVerifyChunk(channel, cryptoModule, chunk->messageType, + &chunk->bytes, offset); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Check the sequence number. Skip sequence number checking for fuzzer to + * improve coverage */ + res = UA_SequenceHeader_decodeBinary(&chunk->bytes, &offset, &sequenceHeader); +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + res |= processSequenceNumber(channel, sequenceHeader.sequenceNumber); +#endif + if(res != UA_STATUSCODE_GOOD) + return res; + + chunk->requestId = sequenceHeader.requestId; + chunk->bytes.data += offset; + chunk->bytes.length -= offset; + return res; + +error: + if(securityHeader != NULL) + clearHeader(securityHeader); + return res; +} + +static UA_StatusCode +assembleProcessMessage(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback) { + UA_Chunk *chunk = SIMPLEQ_FIRST(&channel->decryptedChunks); + UA_assert(chunk != NULL); + + if(chunk->chunkType == UA_CHUNKTYPE_FINAL) { + SIMPLEQ_REMOVE_HEAD(&channel->decryptedChunks, pointers); + UA_assert(chunk->chunkType == UA_CHUNKTYPE_FINAL); + UA_StatusCode retval = callback(application, channel, chunk->messageType, chunk->requestId, &chunk->bytes); + UA_Chunk_delete(chunk); + return retval; + } + + UA_UInt32 requestId = chunk->requestId; + UA_MessageType messageType = chunk->messageType; + UA_ChunkType chunkType = chunk->chunkType; + UA_assert(chunkType == UA_CHUNKTYPE_INTERMEDIATE); + + size_t messageSize = 0; + SIMPLEQ_FOREACH(chunk, &channel->decryptedChunks, pointers) { + /* Consistency check */ + if(requestId != chunk->requestId) + return UA_STATUSCODE_BADINTERNALERROR; + if(chunkType != chunk->chunkType && chunk->chunkType != UA_CHUNKTYPE_FINAL) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + if(chunk->messageType != messageType) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + + /* Sum up the lengths */ + messageSize += chunk->bytes.length; + if(chunk->chunkType == UA_CHUNKTYPE_FINAL) + break; + } + + /* Allocate memory for the full message */ + UA_ByteString payload; + UA_StatusCode res = UA_ByteString_allocBuffer(&payload, messageSize); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Assemble the full message */ + size_t offset = 0; + while(true) { + chunk = SIMPLEQ_FIRST(&channel->decryptedChunks); + memcpy(&payload.data[offset], chunk->bytes.data, chunk->bytes.length); + offset += chunk->bytes.length; + SIMPLEQ_REMOVE_HEAD(&channel->decryptedChunks, pointers); + UA_ChunkType ct = chunk->chunkType; + UA_Chunk_delete(chunk); + if(ct == UA_CHUNKTYPE_FINAL) + break; + } + + /* Process the assembled message */ + UA_StatusCode retval = callback(application, channel, messageType, requestId, &payload); + UA_ByteString_clear(&payload); + return retval; +} + +static UA_StatusCode +persistCompleteChunks(UA_ChunkQueue *queue) { + UA_Chunk *chunk; + SIMPLEQ_FOREACH(chunk, queue, pointers) { + if(chunk->copied) + continue; + UA_ByteString copy; + UA_StatusCode retval = UA_ByteString_copy(&chunk->bytes, ©); + if(retval != UA_STATUSCODE_GOOD) + return retval; + chunk->bytes = copy; + chunk->copied = true; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +persistIncompleteChunk(UA_SecureChannel *channel, const UA_ByteString *buffer, + size_t offset) { + UA_assert(channel->incompleteChunk.length == 0); + UA_assert(offset < buffer->length); + size_t length = buffer->length - offset; + UA_StatusCode retval = UA_ByteString_allocBuffer(&channel->incompleteChunk, length); + if(retval != UA_STATUSCODE_GOOD) + return retval; + memcpy(channel->incompleteChunk.data, &buffer->data[offset], length); + return UA_STATUSCODE_GOOD; +} + +/* Processes chunks and puts them into the payloads queue. Once a final chunk is + * put into the queue, the message is assembled and the callback is called. The + * queue will be cleared for the next message. */ +static UA_StatusCode +processChunks(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback) { + UA_Chunk *chunk; + UA_StatusCode retval; + while((chunk = SIMPLEQ_FIRST(&channel->completeChunks))) { + /* Decrypt and add to the decrypted queue */ + SIMPLEQ_REMOVE_HEAD(&channel->completeChunks, pointers); + if(chunk->messageType == UA_MESSAGETYPE_OPN || + chunk->messageType == UA_MESSAGETYPE_MSG || + chunk->messageType == UA_MESSAGETYPE_CLO) { + retval = decryptMessageChunk(channel, chunk, application); + if(retval != UA_STATUSCODE_GOOD) { + UA_Chunk_delete(chunk); + return retval; + } + } else { + chunk->bytes.data += UA_CONNECTION_PROTOCOL_MESSAGE_HEADER_SIZE; + chunk->bytes.length -= UA_CONNECTION_PROTOCOL_MESSAGE_HEADER_SIZE; + } + SIMPLEQ_INSERT_TAIL(&channel->decryptedChunks, chunk, pointers); + + /* Check the ressource limits */ + channel->decryptedChunksCount++; + channel->decryptedChunksLength += chunk->bytes.length; + if((channel->config.localMaxChunkCount != 0 && + channel->decryptedChunksCount > channel->config.localMaxChunkCount) || + (channel->config.localMaxMessageSize != 0 && + channel->decryptedChunksLength > channel->config.localMaxMessageSize)) { + return UA_STATUSCODE_BADTCPMESSAGETOOLARGE; + } + + /* Continue */ + if(chunk->chunkType != UA_CHUNKTYPE_FINAL) + continue; + + /* The decrypted queue contains a full message. Process it. */ + retval = assembleProcessMessage(channel, application, callback); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Reset the counters */ + channel->decryptedChunksCount = 0; + channel->decryptedChunksLength = 0; + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +extractCompleteChunk(UA_SecureChannel *channel, const UA_ByteString *buffer, + size_t *offset, UA_Boolean *done) { + /* At least 8 byte needed for the header. Wait for the next chunk. */ + size_t initial_offset = *offset; + size_t remaining = buffer->length - initial_offset; + if(remaining < UA_CONNECTION_PROTOCOL_MESSAGE_HEADER_SIZE) { + *done = true; + return UA_STATUSCODE_GOOD; + } + + /* Decoding cannot fail */ + UA_TcpMessageHeader hdr; + UA_TcpMessageHeader_decodeBinary(buffer, &initial_offset, &hdr); + UA_MessageType msgType = (UA_MessageType) + (hdr.messageTypeAndChunkType & UA_BITMASK_MESSAGETYPE); + UA_ChunkType chunkType = (UA_ChunkType) + (hdr.messageTypeAndChunkType & UA_BITMASK_CHUNKTYPE); + + /* The message size is not allowed */ + if(hdr.messageSize < 16) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + if(hdr.messageSize > channel->config.recvBufferSize) + return UA_STATUSCODE_BADTCPMESSAGETOOLARGE; + + /* Incomplete chunk */ + if(hdr.messageSize > remaining) { + *done = true; + return UA_STATUSCODE_GOOD; + } + + /* ByteString with only this chunk. */ + UA_ByteString chunkPayload; + chunkPayload.data = &buffer->data[*offset]; + chunkPayload.length = hdr.messageSize; + + if(msgType == UA_MESSAGETYPE_HEL || msgType == UA_MESSAGETYPE_ACK || + msgType == UA_MESSAGETYPE_ERR || msgType == UA_MESSAGETYPE_OPN) { + if(chunkType != UA_CHUNKTYPE_FINAL) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + } else { + /* Only messages on SecureChannel-level with symmetric encryption afterwards */ + if(msgType != UA_MESSAGETYPE_MSG && + msgType != UA_MESSAGETYPE_CLO) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + + /* Check the chunk type before decrypting */ + if(chunkType != UA_CHUNKTYPE_FINAL && + chunkType != UA_CHUNKTYPE_INTERMEDIATE && + chunkType != UA_CHUNKTYPE_ABORT) + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + } + + /* Add the chunk; forward the offset */ + *offset += hdr.messageSize; + UA_Chunk *chunk = (UA_Chunk *) UA_malloc(sizeof(UA_Chunk)); + if(!chunk) + return UA_STATUSCODE_BADOUTOFMEMORY; + + chunk->bytes = chunkPayload; + chunk->messageType = msgType; + chunk->chunkType = chunkType; + chunk->requestId = 0; + chunk->copied = false; + + SIMPLEQ_INSERT_TAIL(&channel->completeChunks, chunk, pointers); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_SecureChannel_processBuffer(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback, + const UA_ByteString *buffer) { + /* Prepend the incomplete last chunk. This is usually done in the + * networklayer. But we test for a buffered incomplete chunk here again to + * work around "lazy" network layers. */ + UA_ByteString appended = channel->incompleteChunk; + if(appended.length > 0) { + channel->incompleteChunk = UA_BYTESTRING_NULL; + UA_Byte *t = (UA_Byte*)UA_realloc(appended.data, appended.length + buffer->length); + if(!t) { + UA_ByteString_clear(&appended); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + memcpy(&t[appended.length], buffer->data, buffer->length); + appended.data = t; + appended.length += buffer->length; + buffer = &appended; + } + + /* Loop over the received chunks */ + size_t offset = 0; + UA_Boolean done = false; + UA_StatusCode res; + while(!done) { + res = extractCompleteChunk(channel, buffer, &offset, &done); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Buffer half-received chunk. Before processing the messages so that + * processing is reentrant. */ + if(offset < buffer->length) { + res = persistIncompleteChunk(channel, buffer, offset); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Process whatever we can. Chunks of completed and processed messages are + * removed. */ + res = processChunks(channel, application, callback); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Persist full chunks that still point to the buffer. Can only return + * UA_STATUSCODE_BADOUTOFMEMORY as an error code. So merging res works. */ + res |= persistCompleteChunks(&channel->completeChunks); + res |= persistCompleteChunks(&channel->decryptedChunks); + + cleanup: + UA_ByteString_clear(&appended); + return res; +} + +UA_StatusCode +UA_SecureChannel_receive(UA_SecureChannel *channel, void *application, + UA_ProcessMessageCallback callback, UA_UInt32 timeout) { + UA_Connection *connection = channel->connection; + if(!connection) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Listen for messages to arrive */ + UA_ByteString buffer = UA_BYTESTRING_NULL; + UA_StatusCode retval = connection->recv(connection, &buffer, timeout); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Try to process one complete chunk */ + retval = UA_SecureChannel_processBuffer(channel, application, callback, &buffer); + connection->releaseRecvBuffer(connection, &buffer); + return retval; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_securechannel_crypto.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2016-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016 (c) TorbenD + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB + */ + + + +#define UA_ASYMMETRIC_ALG_SECURITY_HEADER_FIXED_LENGTH 12 +#define UA_SEQUENCE_HEADER_LENGTH 8 +#define UA_SYMMETRIC_ALG_SECURITY_HEADER_LENGTH 4 +#define UA_SECUREMH_AND_SYMALGH_LENGTH \ + (UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH + \ + UA_SYMMETRIC_ALG_SECURITY_HEADER_LENGTH) + +UA_StatusCode +UA_SecureChannel_generateLocalNonce(UA_SecureChannel *channel) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_LOG_DEBUG_CHANNEL(sp->logger, channel, "Generating new local nonce"); + + /* Is the length of the previous nonce correct? */ + size_t nonceLength = sp->symmetricModule.secureChannelNonceLength; + if(channel->localNonce.length != nonceLength) { + UA_ByteString_clear(&channel->localNonce); + UA_StatusCode retval = UA_ByteString_allocBuffer(&channel->localNonce, nonceLength); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + return sp->symmetricModule.generateNonce(sp, &channel->localNonce); +} + +UA_StatusCode +UA_SecureChannel_generateLocalKeys(const UA_SecureChannel *channel) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_LOG_TRACE_CHANNEL(sp->logger, channel, "Generating new local keys"); + + void *cc = channel->channelContext; + const UA_SecurityPolicyChannelModule *cm = &sp->channelModule; + const UA_SecurityPolicySymmetricModule *sm = &sp->symmetricModule; + const UA_SecurityPolicyCryptoModule *crm = &sm->cryptoModule; + + /* Generate symmetric key buffer of the required length */ + UA_ByteString buf; + size_t encrKL = crm->encryptionAlgorithm.getLocalKeyLength(sp, cc); + size_t encrBS = crm->encryptionAlgorithm.getLocalBlockSize(sp, cc); + size_t signKL = crm->signatureAlgorithm.getLocalKeyLength(sp, cc); + UA_StatusCode retval = UA_ByteString_allocBuffer(&buf, encrBS + signKL + encrKL); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + // No keys to generate + if(buf.length == 0) + return UA_STATUSCODE_GOOD; + + /* Generate key */ + retval = sm->generateKey(sp, &channel->remoteNonce, &channel->localNonce, &buf); + if(retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear(&buf); + return retval; + } + + /* Set the channel context */ + const UA_ByteString localSigningKey = {signKL, buf.data}; + const UA_ByteString localEncryptingKey = {encrKL, &buf.data[signKL]}; + const UA_ByteString localIv = {encrBS, &buf.data[signKL + encrKL]}; + retval |= cm->setLocalSymSigningKey(cc, &localSigningKey); + retval |= cm->setLocalSymEncryptingKey(cc, &localEncryptingKey); + retval |= cm->setLocalSymIv(cc, &localIv); + UA_ByteString_clear(&buf); + return retval; +} + +UA_StatusCode +generateRemoteKeys(const UA_SecureChannel *channel) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_LOG_TRACE_CHANNEL(sp->logger, channel, "Generating new remote keys"); + + void *cc = channel->channelContext; + const UA_SecurityPolicyChannelModule *cm = &sp->channelModule; + const UA_SecurityPolicySymmetricModule *sm = &sp->symmetricModule; + const UA_SecurityPolicyCryptoModule *crm = &sm->cryptoModule; + + /* Generate symmetric key buffer of the required length */ + UA_ByteString buf; + size_t encrKL = crm->encryptionAlgorithm.getRemoteKeyLength(sp, cc); + size_t encrBS = crm->encryptionAlgorithm.getRemoteBlockSize(sp, cc); + size_t signKL = crm->signatureAlgorithm.getRemoteKeyLength(sp, cc); + UA_StatusCode retval = UA_ByteString_allocBuffer(&buf, encrBS + signKL + encrKL); + if(retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear(&buf); + return retval; + } + + // No keys to generate. + if(buf.length == 0) + return UA_STATUSCODE_GOOD; + + /* Generate key */ + retval = sm->generateKey(sp, &channel->localNonce, &channel->remoteNonce, &buf); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the channel context */ + const UA_ByteString remoteSigningKey = {signKL, buf.data}; + const UA_ByteString remoteEncryptingKey = {encrKL, &buf.data[signKL]}; + const UA_ByteString remoteIv = {encrBS, &buf.data[signKL + encrKL]}; + retval |= cm->setRemoteSymSigningKey(cc, &remoteSigningKey); + retval |= cm->setRemoteSymEncryptingKey(cc, &remoteEncryptingKey); + retval |= cm->setRemoteSymIv(cc, &remoteIv); + UA_ByteString_clear(&buf); + return retval; +} + +/***************************/ +/* Send Asymmetric Message */ +/***************************/ + +size_t +calculateAsymAlgSecurityHeaderLength(const UA_SecureChannel *channel) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t asymHeaderLength = UA_ASYMMETRIC_ALG_SECURITY_HEADER_FIXED_LENGTH + + sp->policyUri.length; + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return asymHeaderLength; + + /* OPN is always encrypted even if the mode is sign only */ + asymHeaderLength += 20; /* Thumbprints are always 20 byte long */ + asymHeaderLength += sp->localCertificate.length; + return asymHeaderLength; +} + +UA_StatusCode +prependHeadersAsym(UA_SecureChannel *const channel, UA_Byte *header_pos, + const UA_Byte *buf_end, size_t totalLength, + size_t securityHeaderLength, UA_UInt32 requestId, + size_t *const finalLength) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t dataToEncryptLength = + totalLength - (UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH + securityHeaderLength); + + UA_TcpMessageHeader messageHeader; + messageHeader.messageTypeAndChunkType = UA_MESSAGETYPE_OPN + UA_CHUNKTYPE_FINAL; + messageHeader.messageSize = (UA_UInt32) + (totalLength + + UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(sp, channel->channelContext, + dataToEncryptLength)); + UA_UInt32 secureChannelId = channel->securityToken.channelId; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + retval |= UA_encodeBinary(&messageHeader, &UA_TRANSPORT[UA_TRANSPORT_TCPMESSAGEHEADER], + &header_pos, &buf_end, NULL, NULL); + retval |= UA_encodeBinary(&secureChannelId, &UA_TYPES[UA_TYPES_UINT32], + &header_pos, &buf_end, NULL, NULL); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_AsymmetricAlgorithmSecurityHeader asymHeader; + UA_AsymmetricAlgorithmSecurityHeader_init(&asymHeader); + asymHeader.securityPolicyUri = sp->policyUri; + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGN || + channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + asymHeader.senderCertificate = sp->localCertificate; + asymHeader.receiverCertificateThumbprint.length = 20; + asymHeader.receiverCertificateThumbprint.data = channel->remoteCertificateThumbprint; + } + retval = UA_encodeBinary(&asymHeader, + &UA_TRANSPORT[UA_TRANSPORT_ASYMMETRICALGORITHMSECURITYHEADER], + &header_pos, &buf_end, NULL, NULL); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_SequenceHeader seqHeader; + seqHeader.requestId = requestId; + seqHeader.sequenceNumber = UA_atomic_addUInt32(&channel->sendSequenceNumber, 1); + retval = UA_encodeBinary(&seqHeader, &UA_TRANSPORT[UA_TRANSPORT_SEQUENCEHEADER], + &header_pos, &buf_end, NULL, NULL); + + *finalLength = messageHeader.messageSize; + + return retval; +} + +void +hideBytesAsym(const UA_SecureChannel *channel, UA_Byte **buf_start, + const UA_Byte **buf_end) { + *buf_start += UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH; + *buf_start += calculateAsymAlgSecurityHeaderLength(channel); + *buf_start += UA_SEQUENCE_HEADER_LENGTH; + +#ifdef UA_ENABLE_ENCRYPTION + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + + /* Hide bytes for signature and padding */ + size_t potentialEncryptMaxSize = (size_t)(*buf_end - *buf_start) + UA_SEQUENCE_HEADER_LENGTH; + *buf_end -= sp->asymmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + *buf_end -= 2; /* padding byte and extraPadding byte */ + + /* Add some overhead length due to RSA implementations adding a signature themselves */ + *buf_end -= UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(sp, + channel->channelContext, + potentialEncryptMaxSize); +#endif +} + +#ifdef UA_ENABLE_ENCRYPTION + +void +padChunkAsym(UA_SecureChannel *channel, const UA_ByteString *buf, + size_t securityHeaderLength, UA_Byte **buf_pos) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + + /* Also pad if the securityMode is SIGN_ONLY, since we are using + * asymmetric communication to exchange keys and thus need to encrypt. */ + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return; + + const UA_Byte *buf_body_start = + &buf->data[UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH + + UA_SEQUENCE_HEADER_LENGTH + securityHeaderLength]; + const size_t bytesToWrite = + (uintptr_t)*buf_pos - (uintptr_t)buf_body_start + UA_SEQUENCE_HEADER_LENGTH; + + /* Compute the padding length */ + size_t plainTextBlockSize = sp->asymmetricModule.cryptoModule.encryptionAlgorithm. + getRemotePlainTextBlockSize(sp, channel->channelContext); + size_t signatureSize = sp->asymmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + size_t paddingBytes = 1; + if(sp->asymmetricModule.cryptoModule.encryptionAlgorithm. + getRemoteKeyLength(sp, channel->channelContext) > 2048) + ++paddingBytes; /* extra padding */ + size_t totalPaddingSize = + (plainTextBlockSize - ((bytesToWrite + signatureSize + paddingBytes) % plainTextBlockSize)); + + /* Write the padding. This is <= because the paddingSize byte also has to be written */ + UA_Byte paddingSize = (UA_Byte)(totalPaddingSize & 0xffu); + for(UA_UInt16 i = 0; i <= totalPaddingSize; ++i) { + **buf_pos = paddingSize; + ++*buf_pos; + } + + /* Write the extra padding byte if required */ + if(sp->asymmetricModule.cryptoModule.encryptionAlgorithm. + getRemoteKeyLength(sp, channel->channelContext) > 2048) { + UA_Byte extraPaddingSize = (UA_Byte)(totalPaddingSize >> 8u); + **buf_pos = extraPaddingSize; + ++*buf_pos; + } +} + +UA_StatusCode +signAndEncryptAsym(UA_SecureChannel *channel, size_t preSignLength, + UA_ByteString *buf, size_t securityHeaderLength, + size_t totalLength) { + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + + /* Sign message */ + const UA_ByteString dataToSign = {preSignLength, buf->data}; + size_t sigsize = sp->asymmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + UA_ByteString signature = {sigsize, buf->data + preSignLength}; + UA_StatusCode retval = sp->asymmetricModule.cryptoModule.signatureAlgorithm. + sign(sp, channel->channelContext, &dataToSign, &signature); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Specification part 6, 6.7.4: The OpenSecureChannel Messages are + * signed and encrypted if the SecurityMode is not None (even if the + * SecurityMode is SignOnly). */ + size_t unencrypted_length = + UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH + securityHeaderLength; + UA_ByteString dataToEncrypt = {totalLength - unencrypted_length, + &buf->data[unencrypted_length]}; + return sp->asymmetricModule.cryptoModule.encryptionAlgorithm. + encrypt(sp, channel->channelContext, &dataToEncrypt); +} + +/**************************/ +/* Send Symmetric Message */ +/**************************/ + +static UA_UInt16 +calculatePaddingSym(const UA_SecurityPolicy *sp, const void *channelContext, + size_t bytesToWrite, UA_Byte *paddingSize, UA_Byte *extraPaddingSize) { + size_t encryptionBlockSize = sp->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalBlockSize(sp, channelContext); + size_t signatureSize = sp->symmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channelContext); + + size_t padding = (encryptionBlockSize - + ((bytesToWrite + signatureSize + 1) % encryptionBlockSize)); + *paddingSize = (UA_Byte)padding; + *extraPaddingSize = (UA_Byte)(padding >> 8u); + return (UA_UInt16)padding; +} + +void +padChunkSym(UA_MessageContext *messageContext, size_t bodyLength) { + if(messageContext->channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return; + + /* The bytes for the padding and signature were removed from buf_end before + * encoding the payload. So we don't have to check if there is enough + * space. */ + + size_t bytesToWrite = bodyLength + UA_SEQUENCE_HEADER_LENGTH; + UA_Byte paddingSize = 0; + UA_Byte extraPaddingSize = 0; + UA_UInt16 totalPaddingSize = + calculatePaddingSym(messageContext->channel->securityPolicy, + messageContext->channel->channelContext, + bytesToWrite, &paddingSize, &extraPaddingSize); + + /* This is <= because the paddingSize byte also has to be written. */ + for(UA_UInt16 i = 0; i <= totalPaddingSize; ++i) { + *messageContext->buf_pos = paddingSize; + ++(messageContext->buf_pos); + } + if(extraPaddingSize > 0) { + *messageContext->buf_pos = extraPaddingSize; + ++(messageContext->buf_pos); + } +} + +UA_StatusCode +signChunkSym(UA_MessageContext *const messageContext, size_t preSigLength) { + const UA_SecureChannel *channel = messageContext->channel; + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + UA_ByteString dataToSign = messageContext->messageBuffer; + dataToSign.length = preSigLength; + UA_ByteString signature; + signature.length = sp->symmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + signature.data = messageContext->buf_pos; + + return sp->symmetricModule.cryptoModule.signatureAlgorithm. + sign(sp, channel->channelContext, &dataToSign, &signature); +} + +UA_StatusCode +encryptChunkSym(UA_MessageContext *const messageContext, size_t totalLength) { + const UA_SecureChannel *channel = messageContext->channel; + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + UA_ByteString dataToEncrypt; + dataToEncrypt.data = messageContext->messageBuffer.data + UA_SECUREMH_AND_SYMALGH_LENGTH; + dataToEncrypt.length = totalLength - UA_SECUREMH_AND_SYMALGH_LENGTH; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + return sp->symmetricModule.cryptoModule.encryptionAlgorithm. + encrypt(sp, channel->channelContext, &dataToEncrypt); +} + +#endif /* UA_ENABLE_ENCRYPTION */ + +void +setBufPos(UA_MessageContext *mc) { + /* Forward the data pointer so that the payload is encoded after the + * message header */ + mc->buf_pos = &mc->messageBuffer.data[UA_SECURE_MESSAGE_HEADER_LENGTH]; + mc->buf_end = &mc->messageBuffer.data[mc->messageBuffer.length]; + +#ifdef UA_ENABLE_ENCRYPTION + const UA_SecureChannel *channel = mc->channel; + const UA_SecurityPolicy *sp = channel->securityPolicy; + + /* Reserve space for the message footer at the end of the chunk if the chunk + * is signed and/or encrypted. The footer includes the fields PaddingSize, + * Padding, ExtraPadding and Signature. The padding fields are only present + * if the chunk is encrypted. */ + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGN || + channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + mc->buf_end -= sp->symmetricModule.cryptoModule.signatureAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + + /* The size of the padding depends on the amount of data that shall be sent + * and is unknown at this point. Reserve space for the PaddingSize byte, + * the maximum amount of Padding which equals the block size of the + * symmetric encryption algorithm and last 1 byte for the ExtraPaddingSize + * field that is present if the encryption key is larger than 2048 bits. + * The actual padding size is later calculated by the function + * calculatePaddingSym(). */ + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + /* PaddingSize and ExtraPaddingSize fields */ + size_t encryptionBlockSize = sp->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalBlockSize(sp, channel->channelContext); + mc->buf_end -= 1 + ((encryptionBlockSize >> 8u) ? 1 : 0); + + /* Reduce the message body size with the remainder of the operation + * maxEncryptedDataSize modulo EncryptionBlockSize to get a whole + * number of blocks to encrypt later. Also reserve one byte for + * padding (1 <= paddingSize <= encryptionBlockSize). */ + size_t maxEncryptDataSize = mc->messageBuffer.length - + UA_SECURE_CONVERSATION_MESSAGE_HEADER_LENGTH - + UA_SYMMETRIC_ALG_SECURITY_HEADER_LENGTH; + mc->buf_end -= (maxEncryptDataSize % encryptionBlockSize) + 1; + } +#endif +} + +/****************************/ +/* Process a received Chunk */ +/****************************/ + +static UA_UInt16 +decodeChunkPadding(const UA_SecureChannel *channel, + const UA_SecurityPolicyCryptoModule *cryptoModule, + UA_MessageType messageType, const UA_ByteString *chunk, + size_t sigsize) { + /* Is padding used? */ + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT && + !(messageType == UA_MESSAGETYPE_OPN && + !UA_String_equal(&cryptoModule->encryptionAlgorithm.uri, &UA_STRING_NULL))) + return 0; + + size_t paddingSize = chunk->data[chunk->length - sigsize - 1]; + + /* Extra padding size */ + size_t keyLength = cryptoModule->encryptionAlgorithm. + getLocalKeyLength(channel->securityPolicy, channel->channelContext); + if(keyLength > 2048) { + paddingSize <<= 8u; + paddingSize += 1; + paddingSize += chunk->data[chunk->length - sigsize - 2]; + } + + /* We need to add one to the padding size since the paddingSize byte itself + * need to be removed as well. */ + paddingSize += 1; + + UA_LOG_TRACE_CHANNEL(channel->securityPolicy->logger, channel, + "Calculated padding size to be %lu", + (long unsigned int)paddingSize); + return (UA_UInt16)paddingSize; +} + +static UA_StatusCode +verifySignature(const UA_SecureChannel *channel, + const UA_SecurityPolicyCryptoModule *cryptoModule, + const UA_ByteString *chunk, size_t sigsize) { + UA_LOG_TRACE_CHANNEL(channel->securityPolicy->logger, channel, + "Verifying chunk signature"); + if(sigsize >= chunk->length) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + const UA_ByteString content = {chunk->length - sigsize, chunk->data}; + const UA_ByteString sig = {sigsize, chunk->data + chunk->length - sigsize}; + UA_StatusCode retval = cryptoModule->signatureAlgorithm. + verify(channel->securityPolicy, channel->channelContext, &content, &sig); +#ifdef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS + retval |= decrypt_verifySignatureFailure; +#endif + return retval; +} + +/* Sets the payload to a pointer inside the chunk buffer. Returns the requestId + * and the sequenceNumber */ +UA_StatusCode +decryptAndVerifyChunk(const UA_SecureChannel *channel, + const UA_SecurityPolicyCryptoModule *cryptoModule, + UA_MessageType messageType, UA_ByteString *chunk, + size_t offset) { + /* Decrypt the chunk */ + UA_StatusCode res = UA_STATUSCODE_GOOD; + const UA_SecurityPolicy *sp = channel->securityPolicy; + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT || + messageType == UA_MESSAGETYPE_OPN) { + UA_ByteString cipherText = {chunk->length - offset, chunk->data + offset}; + res = cryptoModule->encryptionAlgorithm. + decrypt(sp, channel->channelContext, &cipherText); + if(res != UA_STATUSCODE_GOOD) + return res; + chunk->length = cipherText.length + offset; + } + + /* Does the message have a signature? */ + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT && + messageType != UA_MESSAGETYPE_OPN) + return UA_STATUSCODE_GOOD; + + /* Verify the chunk signature */ + size_t sigsize = cryptoModule->signatureAlgorithm. + getRemoteSignatureSize(sp, channel->channelContext); + res = verifySignature(channel, cryptoModule, chunk, sigsize); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Compute and verify the padding. The encrypted payload has to be at least + * 9 bytes long (8 byte for the SequenceHeader and one byte for the actual + * message). */ + size_t paddingSize = + decodeChunkPadding(channel, cryptoModule, messageType, chunk, sigsize); + if(offset + paddingSize + sigsize + 9 >= chunk->length) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Hide the signature and padding */ + chunk->length -= (sigsize + paddingSize); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +processSequenceNumberAsym(UA_SecureChannel *channel, UA_UInt32 sequenceNumber) { + channel->receiveSequenceNumber = sequenceNumber; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +checkAsymHeader(UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader) { + const UA_SecurityPolicy *sp = channel->securityPolicy; + + if(!UA_ByteString_equal(&sp->policyUri, &asymHeader->securityPolicyUri)) + return UA_STATUSCODE_BADSECURITYPOLICYREJECTED; + + return sp->asymmetricModule. + compareCertificateThumbprint(sp, &asymHeader->receiverCertificateThumbprint); + + /* The certificate in the header is verified via the configured PKI plugin + * as certificateVerification.verifyCertificate(...). We cannot do it here + * because the client/server context is needed. */ +} + +UA_StatusCode +checkSymHeader(UA_SecureChannel *channel, + const UA_SymmetricAlgorithmSecurityHeader *symHeader) { + /* If no match, try to revolve to the next token after a + * RenewSecureChannel */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_ChannelSecurityToken *token = &channel->securityToken; + switch(channel->renewState) { + case UA_SECURECHANNELRENEWSTATE_NORMAL: + case UA_SECURECHANNELRENEWSTATE_SENT: + default: + break; + + case UA_SECURECHANNELRENEWSTATE_NEWTOKEN_SERVER: + /* Old token still in use */ + if(symHeader->tokenId == channel->securityToken.tokenId) + break; + + /* Not the new token */ + if(symHeader->tokenId != channel->altSecurityToken.tokenId) { + UA_LOG_WARNING_CHANNEL(channel->securityPolicy->logger, channel, + "Unknown SecurityToken"); + return UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN; + } + + /* Roll over to the new token, generate new local and remote keys */ + channel->renewState = UA_SECURECHANNELRENEWSTATE_NORMAL; + channel->securityToken = channel->altSecurityToken; + UA_ChannelSecurityToken_init(&channel->altSecurityToken); + retval = UA_SecureChannel_generateLocalKeys(channel); + retval |= generateRemoteKeys(channel); + break; + + case UA_SECURECHANNELRENEWSTATE_NEWTOKEN_CLIENT: + /* The server is still using the old token. That's okay. */ + if(symHeader->tokenId == channel->altSecurityToken.tokenId) { + token = &channel->altSecurityToken; + break; + } + + /* Not the new token */ + if(symHeader->tokenId != channel->securityToken.tokenId) { + UA_LOG_WARNING_CHANNEL(channel->securityPolicy->logger, channel, + "Unknown SecurityToken"); + return UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN; + } + + /* The remote server uses the new token for the first time. Delete the + * old token and roll the remote key over. The local key already uses + * the nonce pair from the last OPN exchange. */ + channel->renewState = UA_SECURECHANNELRENEWSTATE_NORMAL; + UA_ChannelSecurityToken_init(&channel->altSecurityToken); + retval = generateRemoteKeys(channel); + } + + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_DateTime timeout = token->createdAt + (token->revisedLifetime * UA_DATETIME_MSEC); + if(channel->state == UA_SECURECHANNELSTATE_OPEN && + timeout < UA_DateTime_nowMonotonic()) { + UA_LOG_WARNING_CHANNEL(channel->securityPolicy->logger, channel, + "SecurityToken timed out"); + UA_SecureChannel_close(channel); + return UA_STATUSCODE_BADSECURECHANNELCLOSED; + } + + return UA_STATUSCODE_GOOD; +} + +/* Functionality used by both the SecureChannel and the SecurityPolicy */ + +size_t +UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(const UA_SecurityPolicy *securityPolicy, + const void *channelContext, + size_t maxEncryptionLength) { + if(maxEncryptionLength == 0) + return 0; + + size_t plainTextBlockSize = securityPolicy->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemotePlainTextBlockSize(securityPolicy, channelContext); + size_t encryptedBlockSize = securityPolicy->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemoteBlockSize(securityPolicy, channelContext); + if(plainTextBlockSize == 0) + return 0; + + size_t maxNumberOfBlocks = maxEncryptionLength / plainTextBlockSize; + return maxNumberOfBlocks * (encryptedBlockSize - plainTextBlockSize); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_session.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS +#endif + +#define UA_SESSION_NONCELENTH 32 + +void UA_Session_init(UA_Session *session) { + memset(session, 0, sizeof(UA_Session)); + session->availableContinuationPoints = UA_MAXCONTINUATIONPOINTS; +#ifdef UA_ENABLE_SUBSCRIPTIONS + SIMPLEQ_INIT(&session->responseQueue); + TAILQ_INIT(&session->subscriptions); +#endif +} + +void UA_Session_clear(UA_Session *session, UA_Server* server) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Remove all Subscriptions. This may send out remaining publish + * responses. */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_Subscription *sub, *tempsub; + TAILQ_FOREACH_SAFE(sub, &session->subscriptions, sessionListEntry, tempsub) { + UA_Subscription_delete(server, sub); + } +#endif + + UA_Session_detachFromSecureChannel(session); + UA_ApplicationDescription_clear(&session->clientDescription); + UA_NodeId_clear(&session->header.authenticationToken); + UA_NodeId_clear(&session->sessionId); + UA_String_clear(&session->sessionName); + UA_ByteString_clear(&session->serverNonce); + struct ContinuationPoint *cp, *next = session->continuationPoints; + while((cp = next)) { + next = ContinuationPoint_clear(cp); + UA_free(cp); + } + session->continuationPoints = NULL; + session->availableContinuationPoints = UA_MAXCONTINUATIONPOINTS; +} + +void +UA_Session_attachToSecureChannel(UA_Session *session, UA_SecureChannel *channel) { + UA_Session_detachFromSecureChannel(session); + session->header.channel = channel; + SLIST_INSERT_HEAD(&channel->sessions, &session->header, next); +} + +void +UA_Session_detachFromSecureChannel(UA_Session *session) { + UA_SecureChannel *channel = session->header.channel; + if(!channel) + return; + session->header.channel = NULL; + UA_SessionHeader *sh; + SLIST_FOREACH(sh, &channel->sessions, next) { + if((UA_Session*)sh != session) + continue; + SLIST_REMOVE(&channel->sessions, sh, UA_SessionHeader, next); + break; + } +} + +UA_StatusCode +UA_Session_generateNonce(UA_Session *session) { + UA_SecureChannel *channel = session->header.channel; + if(!channel || !channel->securityPolicy) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Is the length of the previous nonce correct? */ + if(session->serverNonce.length != UA_SESSION_NONCELENTH) { + UA_ByteString_clear(&session->serverNonce); + UA_StatusCode retval = + UA_ByteString_allocBuffer(&session->serverNonce, UA_SESSION_NONCELENTH); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + return channel->securityPolicy->symmetricModule. + generateNonce(channel->securityPolicy, &session->serverNonce); +} + +void UA_Session_updateLifetime(UA_Session *session) { + session->validTill = UA_DateTime_nowMonotonic() + + (UA_DateTime)(session->timeout * UA_DATETIME_MSEC); +} + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +void +UA_Session_attachSubscription(UA_Session *session, UA_Subscription *sub) { + /* Attach to the session */ + sub->session = session; + TAILQ_INSERT_TAIL(&session->subscriptions, sub, sessionListEntry); + + /* Increase the count */ + session->subscriptionsSize++; + + /* Increase the number of outstanding retransmissions */ + session->totalRetransmissionQueueSize += sub->retransmissionQueueSize; +} + +void +UA_Session_detachSubscription(UA_Server *server, UA_Session *session, + UA_Subscription *sub) { + /* Detach from the session */ + sub->session = NULL; + TAILQ_REMOVE(&session->subscriptions, sub, sessionListEntry); + + /* Reduce the count */ + UA_assert(session->subscriptionsSize > 0); + session->subscriptionsSize--; + + /* Reduce the number of outstanding retransmissions */ + session->totalRetransmissionQueueSize -= sub->retransmissionQueueSize; + + /* Send remaining publish responses if the last subscription was removed */ + if(!TAILQ_EMPTY(&session->subscriptions)) + return; + UA_PublishResponseEntry *pre; + while((pre = UA_Session_dequeuePublishReq(session))) { + UA_PublishResponse *response = &pre->response; + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOSUBSCRIPTION; + response->responseHeader.timestamp = UA_DateTime_now(); + sendResponse(server, session, session->header.channel, pre->requestId, + (UA_Response*)response, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); + UA_PublishResponse_clear(response); + UA_free(pre); + } +} + +UA_Subscription * +UA_Session_getSubscriptionById(UA_Session *session, UA_UInt32 subscriptionId) { + UA_Subscription *sub; + TAILQ_FOREACH(sub, &session->subscriptions, sessionListEntry) { + /* Prevent lookup of subscriptions that are to be deleted with a statuschange */ + if(sub->statusChange != UA_STATUSCODE_GOOD) + continue; + if(sub->subscriptionId == subscriptionId) + break; + } + return sub; +} + +UA_Subscription * +UA_Server_getSubscriptionById(UA_Server *server, UA_UInt32 subscriptionId) { + UA_Subscription *sub; + LIST_FOREACH(sub, &server->subscriptions, serverListEntry) { + /* Prevent lookup of subscriptions that are to be deleted with a statuschange */ + if(sub->statusChange != UA_STATUSCODE_GOOD) + continue; + if(sub->subscriptionId == subscriptionId) + break; + } + return sub; +} + +UA_PublishResponseEntry* +UA_Session_dequeuePublishReq(UA_Session *session) { + UA_PublishResponseEntry* entry = SIMPLEQ_FIRST(&session->responseQueue); + if(entry) { + SIMPLEQ_REMOVE_HEAD(&session->responseQueue, listEntry); + session->numPublishReq--; + } + return entry; +} + +void +UA_Session_queuePublishReq(UA_Session *session, UA_PublishResponseEntry* entry, UA_Boolean head) { + if(!head) + SIMPLEQ_INSERT_TAIL(&session->responseQueue, entry, listEntry); + else + SIMPLEQ_INSERT_HEAD(&session->responseQueue, entry, listEntry); + session->numPublishReq++; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_nodes.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015, 2017 (c) Florian Palm + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Julian Grothoff + */ + + +static enum aa_cmp +cmpRefTargetId(const void *a, const void *b) { + const UA_ReferenceTarget *aa = (const UA_ReferenceTarget*)a; + const UA_ReferenceTarget *bb = (const UA_ReferenceTarget*)b; + if(aa->targetIdHash < bb->targetIdHash) + return AA_CMP_LESS; + if(aa->targetIdHash > bb->targetIdHash) + return AA_CMP_MORE; + return (enum aa_cmp)UA_ExpandedNodeId_order(&aa->targetId, &bb->targetId); +} + +static enum aa_cmp +cmpRefTargetName(const void *a, const void *b) { + const UA_UInt32 *nameHashA = (const UA_UInt32*)a; + const UA_UInt32 *nameHashB = (const UA_UInt32*)b; + if(*nameHashA < *nameHashB) + return AA_CMP_LESS; + if(*nameHashA > *nameHashB) + return AA_CMP_MORE; + return AA_CMP_EQ; +} + +/* Reusable binary search tree "heads". Just switch out the root pointer. */ +static const struct aa_head idTreeHead = + { NULL, cmpRefTargetId, offsetof(UA_ReferenceTarget, idTreeEntry), 0 }; +const struct aa_head nameTreeHead = + { NULL, cmpRefTargetName, offsetof(UA_ReferenceTarget, nameTreeEntry), + offsetof(UA_ReferenceTarget, targetNameHash) }; + +/* General node handling methods. There is no UA_Node_new() method here. + * Creating nodes is part of the Nodestore layer */ + +void UA_Node_clear(UA_Node *node) { + /* Delete references */ + UA_Node_deleteReferences(node); + + /* Delete other head content */ + UA_NodeHead *head = &node->head; + UA_NodeId_clear(&head->nodeId); + UA_QualifiedName_clear(&head->browseName); + UA_LocalizedText_clear(&head->displayName); + UA_LocalizedText_clear(&head->description); + + /* Delete unique content of the nodeclass */ + switch(head->nodeClass) { + case UA_NODECLASS_OBJECT: + break; + case UA_NODECLASS_METHOD: + break; + case UA_NODECLASS_OBJECTTYPE: + break; + case UA_NODECLASS_VARIABLE: + case UA_NODECLASS_VARIABLETYPE: { + UA_VariableNode *p = &node->variableNode; + UA_NodeId_clear(&p->dataType); + UA_Array_delete(p->arrayDimensions, p->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_INT32]); + p->arrayDimensions = NULL; + p->arrayDimensionsSize = 0; + if(p->valueSource == UA_VALUESOURCE_DATA) + UA_DataValue_clear(&p->value.data.value); + break; + } + case UA_NODECLASS_REFERENCETYPE: { + UA_ReferenceTypeNode *p = &node->referenceTypeNode; + UA_LocalizedText_clear(&p->inverseName); + break; + } + case UA_NODECLASS_DATATYPE: + break; + case UA_NODECLASS_VIEW: + break; + default: + break; + } +} + +static UA_StatusCode +UA_ObjectNode_copy(const UA_ObjectNode *src, UA_ObjectNode *dst) { + dst->eventNotifier = src->eventNotifier; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_CommonVariableNode_copy(const UA_VariableNode *src, UA_VariableNode *dst) { + UA_StatusCode retval = + UA_Array_copy(src->arrayDimensions, src->arrayDimensionsSize, + (void**)&dst->arrayDimensions, &UA_TYPES[UA_TYPES_INT32]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + dst->arrayDimensionsSize = src->arrayDimensionsSize; + retval = UA_NodeId_copy(&src->dataType, &dst->dataType); + dst->valueRank = src->valueRank; + dst->valueSource = src->valueSource; + if(src->valueSource == UA_VALUESOURCE_DATA) { + retval |= UA_DataValue_copy(&src->value.data.value, + &dst->value.data.value); + dst->value.data.callback = src->value.data.callback; + } else + dst->value.dataSource = src->value.dataSource; + return retval; +} + +static UA_StatusCode +UA_VariableNode_copy(const UA_VariableNode *src, UA_VariableNode *dst) { + dst->accessLevel = src->accessLevel; + dst->minimumSamplingInterval = src->minimumSamplingInterval; + dst->historizing = src->historizing; + dst->isDynamic = src->isDynamic; + return UA_CommonVariableNode_copy(src, dst); +} + +static UA_StatusCode +UA_VariableTypeNode_copy(const UA_VariableTypeNode *src, + UA_VariableTypeNode *dst) { + dst->isAbstract = src->isAbstract; + return UA_CommonVariableNode_copy((const UA_VariableNode*)src, (UA_VariableNode*)dst); +} + +static UA_StatusCode +UA_MethodNode_copy(const UA_MethodNode *src, UA_MethodNode *dst) { + dst->executable = src->executable; + dst->method = src->method; +#if UA_MULTITHREADING >= 100 + dst->async = src->async; +#endif + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_ObjectTypeNode_copy(const UA_ObjectTypeNode *src, UA_ObjectTypeNode *dst) { + dst->isAbstract = src->isAbstract; + dst->lifecycle = src->lifecycle; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_ReferenceTypeNode_copy(const UA_ReferenceTypeNode *src, + UA_ReferenceTypeNode *dst) { + dst->isAbstract = src->isAbstract; + dst->symmetric = src->symmetric; + dst->referenceTypeIndex = src->referenceTypeIndex; + dst->subTypes = src->subTypes; + return UA_LocalizedText_copy(&src->inverseName, &dst->inverseName); +} + +static UA_StatusCode +UA_DataTypeNode_copy(const UA_DataTypeNode *src, UA_DataTypeNode *dst) { + dst->isAbstract = src->isAbstract; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_ViewNode_copy(const UA_ViewNode *src, UA_ViewNode *dst) { + dst->containsNoLoops = src->containsNoLoops; + dst->eventNotifier = src->eventNotifier; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +addReferenceTarget(UA_NodeReferenceKind *refs, const UA_ExpandedNodeId *target, + UA_UInt32 targetIdHash, UA_UInt32 targetNameHash); + +UA_StatusCode +UA_Node_copy(const UA_Node *src, UA_Node *dst) { + const UA_NodeHead *srchead = &src->head; + UA_NodeHead *dsthead = &dst->head; + if(srchead->nodeClass != dsthead->nodeClass) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Copy standard content */ + UA_StatusCode retval = UA_NodeId_copy(&srchead->nodeId, &dsthead->nodeId); + retval |= UA_QualifiedName_copy(&srchead->browseName, &dsthead->browseName); + retval |= UA_LocalizedText_copy(&srchead->displayName, &dsthead->displayName); + retval |= UA_LocalizedText_copy(&srchead->description, &dsthead->description); + dsthead->writeMask = srchead->writeMask; + dsthead->context = srchead->context; + dsthead->constructed = srchead->constructed; + if(retval != UA_STATUSCODE_GOOD) { + UA_Node_clear(dst); + return retval; + } + + /* Copy the references */ + dsthead->references = NULL; + if(srchead->referencesSize > 0) { + dsthead->references = (UA_NodeReferenceKind*) + UA_calloc(srchead->referencesSize, sizeof(UA_NodeReferenceKind)); + if(!dsthead->references) { + UA_Node_clear(dst); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + dsthead->referencesSize = srchead->referencesSize; + + for(size_t i = 0; i < srchead->referencesSize; ++i) { + UA_NodeReferenceKind *srefs = &srchead->references[i]; + + UA_NodeReferenceKind *drefs = &dsthead->references[i]; + drefs->referenceTypeIndex = srefs->referenceTypeIndex; + drefs->isInverse = srefs->isInverse; + TAILQ_INIT(&drefs->queueHead); + drefs->idTreeRoot = NULL; + drefs->nameTreeRoot = NULL; + + UA_ReferenceTarget *sTarget; + TAILQ_FOREACH(sTarget, &srefs->queueHead, queuePointers) { + retval = addReferenceTarget(drefs, &sTarget->targetId, + sTarget->targetIdHash, sTarget->targetNameHash); + if(retval != UA_STATUSCODE_GOOD) + break; + } + if(retval != UA_STATUSCODE_GOOD) + break; + } + + if(retval != UA_STATUSCODE_GOOD) { + UA_Node_clear(dst); + return retval; + } + } + + /* Copy unique content of the nodeclass */ + switch(src->head.nodeClass) { + case UA_NODECLASS_OBJECT: + retval = UA_ObjectNode_copy(&src->objectNode, &dst->objectNode); + break; + case UA_NODECLASS_VARIABLE: + retval = UA_VariableNode_copy(&src->variableNode, &dst->variableNode); + break; + case UA_NODECLASS_METHOD: + retval = UA_MethodNode_copy(&src->methodNode, &dst->methodNode); + break; + case UA_NODECLASS_OBJECTTYPE: + retval = UA_ObjectTypeNode_copy(&src->objectTypeNode, &dst->objectTypeNode); + break; + case UA_NODECLASS_VARIABLETYPE: + retval = UA_VariableTypeNode_copy(&src->variableTypeNode, &dst->variableTypeNode); + break; + case UA_NODECLASS_REFERENCETYPE: + retval = UA_ReferenceTypeNode_copy(&src->referenceTypeNode, &dst->referenceTypeNode); + break; + case UA_NODECLASS_DATATYPE: + retval = UA_DataTypeNode_copy(&src->dataTypeNode, &dst->dataTypeNode); + break; + case UA_NODECLASS_VIEW: + retval = UA_ViewNode_copy(&src->viewNode, &dst->viewNode); + break; + default: + break; + } + + if(retval != UA_STATUSCODE_GOOD) + UA_Node_clear(dst); + + return retval; +} + +UA_Node * +UA_Node_copy_alloc(const UA_Node *src) { + size_t nodesize = 0; + switch(src->head.nodeClass) { + case UA_NODECLASS_OBJECT: + nodesize = sizeof(UA_ObjectNode); + break; + case UA_NODECLASS_VARIABLE: + nodesize = sizeof(UA_VariableNode); + break; + case UA_NODECLASS_METHOD: + nodesize = sizeof(UA_MethodNode); + break; + case UA_NODECLASS_OBJECTTYPE: + nodesize = sizeof(UA_ObjectTypeNode); + break; + case UA_NODECLASS_VARIABLETYPE: + nodesize = sizeof(UA_VariableTypeNode); + break; + case UA_NODECLASS_REFERENCETYPE: + nodesize = sizeof(UA_ReferenceTypeNode); + break; + case UA_NODECLASS_DATATYPE: + nodesize = sizeof(UA_DataTypeNode); + break; + case UA_NODECLASS_VIEW: + nodesize = sizeof(UA_ViewNode); + break; + default: + return NULL; + } + + UA_Node *dst = (UA_Node*)UA_calloc(1, nodesize); + if(!dst) + return NULL; + + dst->head.nodeClass = src->head.nodeClass; + + UA_StatusCode retval = UA_Node_copy(src, dst); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(dst); + return NULL; + } + return dst; +} +/******************************/ +/* Copy Attributes into Nodes */ +/******************************/ + +static UA_StatusCode +copyStandardAttributes(UA_NodeHead *head, const UA_NodeAttributes *attr) { + /* UA_NodeId_copy(&item->requestedNewNodeId.nodeId, &node->nodeId); */ + /* UA_QualifiedName_copy(&item->browseName, &node->browseName); */ + + head->writeMask = attr->writeMask; + UA_StatusCode retval = UA_LocalizedText_copy(&attr->description, &head->description); + /* The new nodeset format has optional display names: + * https://github.com/open62541/open62541/issues/2627. If the display name + * is NULL, take the name part of the browse name */ + if(attr->displayName.text.length == 0) + retval |= UA_String_copy(&head->browseName.name, &head->displayName.text); + else + retval |= UA_LocalizedText_copy(&attr->displayName, &head->displayName); + return retval; +} + +static UA_StatusCode +copyCommonVariableAttributes(UA_VariableNode *node, + const UA_VariableAttributes *attr) { + /* Copy the array dimensions */ + UA_StatusCode retval = + UA_Array_copy(attr->arrayDimensions, attr->arrayDimensionsSize, + (void**)&node->arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + node->arrayDimensionsSize = attr->arrayDimensionsSize; + + /* Data type and value rank */ + retval = UA_NodeId_copy(&attr->dataType, &node->dataType); + if(retval != UA_STATUSCODE_GOOD) + return retval; + node->valueRank = attr->valueRank; + + /* Copy the value */ + retval = UA_Variant_copy(&attr->value, &node->value.data.value.value); + node->valueSource = UA_VALUESOURCE_DATA; + node->value.data.value.hasValue = (node->value.data.value.value.type != NULL); + + return retval; +} + +static UA_StatusCode +copyVariableNodeAttributes(UA_VariableNode *vnode, + const UA_VariableAttributes *attr) { + vnode->accessLevel = attr->accessLevel; + vnode->historizing = attr->historizing; + vnode->minimumSamplingInterval = attr->minimumSamplingInterval; + return copyCommonVariableAttributes(vnode, attr); +} + +static UA_StatusCode +copyVariableTypeNodeAttributes(UA_VariableTypeNode *vtnode, + const UA_VariableTypeAttributes *attr) { + vtnode->isAbstract = attr->isAbstract; + return copyCommonVariableAttributes((UA_VariableNode*)vtnode, + (const UA_VariableAttributes*)attr); +} + +static UA_StatusCode +copyObjectNodeAttributes(UA_ObjectNode *onode, const UA_ObjectAttributes *attr) { + onode->eventNotifier = attr->eventNotifier; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyReferenceTypeNodeAttributes(UA_ReferenceTypeNode *rtnode, + const UA_ReferenceTypeAttributes *attr) { + rtnode->isAbstract = attr->isAbstract; + rtnode->symmetric = attr->symmetric; + return UA_LocalizedText_copy(&attr->inverseName, &rtnode->inverseName); +} + +static UA_StatusCode +copyObjectTypeNodeAttributes(UA_ObjectTypeNode *otnode, + const UA_ObjectTypeAttributes *attr) { + otnode->isAbstract = attr->isAbstract; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyViewNodeAttributes(UA_ViewNode *vnode, const UA_ViewAttributes *attr) { + vnode->containsNoLoops = attr->containsNoLoops; + vnode->eventNotifier = attr->eventNotifier; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyDataTypeNodeAttributes(UA_DataTypeNode *dtnode, + const UA_DataTypeAttributes *attr) { + dtnode->isAbstract = attr->isAbstract; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +copyMethodNodeAttributes(UA_MethodNode *mnode, + const UA_MethodAttributes *attr) { + mnode->executable = attr->executable; + return UA_STATUSCODE_GOOD; +} + +#define CHECK_ATTRIBUTES(TYPE) \ + if(attributeType != &UA_TYPES[UA_TYPES_##TYPE]) { \ + retval = UA_STATUSCODE_BADNODEATTRIBUTESINVALID; \ + break; \ + } + +UA_StatusCode +UA_Node_setAttributes(UA_Node *node, const void *attributes, const UA_DataType *attributeType) { + /* Copy the attributes into the node */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + switch(node->head.nodeClass) { + case UA_NODECLASS_OBJECT: + CHECK_ATTRIBUTES(OBJECTATTRIBUTES); + retval = copyObjectNodeAttributes(&node->objectNode, + (const UA_ObjectAttributes*)attributes); + break; + case UA_NODECLASS_VARIABLE: + CHECK_ATTRIBUTES(VARIABLEATTRIBUTES); + retval = copyVariableNodeAttributes(&node->variableNode, + (const UA_VariableAttributes*)attributes); + break; + case UA_NODECLASS_OBJECTTYPE: + CHECK_ATTRIBUTES(OBJECTTYPEATTRIBUTES); + retval = copyObjectTypeNodeAttributes(&node->objectTypeNode, + (const UA_ObjectTypeAttributes*)attributes); + break; + case UA_NODECLASS_VARIABLETYPE: + CHECK_ATTRIBUTES(VARIABLETYPEATTRIBUTES); + retval = copyVariableTypeNodeAttributes(&node->variableTypeNode, + (const UA_VariableTypeAttributes*)attributes); + break; + case UA_NODECLASS_REFERENCETYPE: + CHECK_ATTRIBUTES(REFERENCETYPEATTRIBUTES); + retval = copyReferenceTypeNodeAttributes(&node->referenceTypeNode, + (const UA_ReferenceTypeAttributes*)attributes); + break; + case UA_NODECLASS_DATATYPE: + CHECK_ATTRIBUTES(DATATYPEATTRIBUTES); + retval = copyDataTypeNodeAttributes(&node->dataTypeNode, + (const UA_DataTypeAttributes*)attributes); + break; + case UA_NODECLASS_VIEW: + CHECK_ATTRIBUTES(VIEWATTRIBUTES); + retval = copyViewNodeAttributes(&node->viewNode, (const UA_ViewAttributes*)attributes); + break; + case UA_NODECLASS_METHOD: + CHECK_ATTRIBUTES(METHODATTRIBUTES); + retval = copyMethodNodeAttributes(&node->methodNode, (const UA_MethodAttributes*)attributes); + break; + case UA_NODECLASS_UNSPECIFIED: + default: + retval = UA_STATUSCODE_BADNODECLASSINVALID; + } + + if(retval == UA_STATUSCODE_GOOD) + retval = copyStandardAttributes(&node->head, (const UA_NodeAttributes*)attributes); + if(retval != UA_STATUSCODE_GOOD) + UA_Node_clear(node); + return retval; +} + +/*********************/ +/* Manage References */ +/*********************/ + +static UA_StatusCode +addReferenceTarget(UA_NodeReferenceKind *refs, const UA_ExpandedNodeId *target, + UA_UInt32 targetIdHash, UA_UInt32 targetNameHash) { + UA_ReferenceTarget *entry = (UA_ReferenceTarget*) + UA_malloc(sizeof(UA_ReferenceTarget)); + if(!entry) + return UA_STATUSCODE_BADOUTOFMEMORY; + + UA_StatusCode retval = UA_ExpandedNodeId_copy(target, &entry->targetId); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(entry); + return retval; + } + + entry->targetIdHash = targetIdHash; + entry->targetNameHash = targetNameHash; + TAILQ_INSERT_TAIL(&refs->queueHead, entry, queuePointers); + + /* Insert to the id lookup binary search tree. Only the root is kept in refs + * to save space. */ + struct aa_head _idTreeHead = idTreeHead; + _idTreeHead.root = refs->idTreeRoot; + aa_insert(&_idTreeHead, entry); + refs->idTreeRoot = _idTreeHead.root; + + /* Insert to the name lookup binary search tree */ + struct aa_head _nameTreeHead = nameTreeHead; + _nameTreeHead.root = refs->nameTreeRoot; + aa_insert(&_nameTreeHead, entry); + refs->nameTreeRoot = _nameTreeHead.root; + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +addReferenceKind(UA_NodeHead *head, UA_Byte refTypeIndex, UA_Boolean isForward, + const UA_ExpandedNodeId *targetNodeId, UA_UInt32 targetBrowseNameHash) { + UA_NodeReferenceKind *refs = (UA_NodeReferenceKind*) + UA_realloc(head->references, sizeof(UA_NodeReferenceKind) * (head->referencesSize+1)); + if(!refs) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Repair the backpointer in the queue */ + for(size_t i = 0; i < head->referencesSize; i++) + TAILQ_FIRST(&refs[i].queueHead)->queuePointers.tqe_prev = &refs[i].queueHead.tqh_first; + head->references = refs; + + UA_NodeReferenceKind *newRef = &refs[head->referencesSize]; + newRef->referenceTypeIndex = refTypeIndex; + newRef->isInverse = !isForward; + TAILQ_INIT(&newRef->queueHead); + newRef->idTreeRoot = NULL; + newRef->nameTreeRoot = NULL; + UA_StatusCode retval = + addReferenceTarget(newRef, targetNodeId, + UA_ExpandedNodeId_hash(targetNodeId), + targetBrowseNameHash); + if(retval != UA_STATUSCODE_GOOD) { + if(head->referencesSize == 0) { + UA_free(head->references); + head->references = NULL; + } + return retval; + } + + head->referencesSize++; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Node_addReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, + const UA_ExpandedNodeId *targetNodeId, + UA_UInt32 targetBrowseNameHash) { + struct aa_head _idTreeHead = idTreeHead; + + /* Find the matching reference kind */ + for(size_t i = 0; i < node->head.referencesSize; ++i) { + UA_NodeReferenceKind *refs = &node->head.references[i]; + + /* Reference direction does not match */ + if(refs->isInverse == isForward) + continue; + + /* Reference type does not match */ + if(refs->referenceTypeIndex != refTypeIndex) + continue; + + /* Does an identical reference already exist? */ + UA_ReferenceTarget tmpTarget; + tmpTarget.targetId = *targetNodeId; + tmpTarget.targetIdHash = UA_ExpandedNodeId_hash(targetNodeId); + _idTreeHead.root = refs->idTreeRoot; + UA_ReferenceTarget *found = (UA_ReferenceTarget*) + aa_find(&_idTreeHead, &tmpTarget); + if(found) + return UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED; + + /* Add to existing ReferenceKind */ + return addReferenceTarget(refs, targetNodeId, tmpTarget.targetIdHash, + targetBrowseNameHash); + } + + /* Add new ReferenceKind for the target */ + return addReferenceKind(&node->head, refTypeIndex, isForward, + targetNodeId, targetBrowseNameHash); + +} + +UA_StatusCode +UA_Node_deleteReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, + const UA_ExpandedNodeId *targetNodeId) { + struct aa_head _idTreeHead = idTreeHead; + struct aa_head _nameTreeHead = nameTreeHead; + + UA_NodeHead *head = &node->head; + for(size_t i = head->referencesSize; i > 0; --i) { + UA_NodeReferenceKind *refs = &head->references[i-1]; + if(isForward == refs->isInverse) + continue; + if(refTypeIndex != refs->referenceTypeIndex) + continue; + + _idTreeHead.root = refs->idTreeRoot; + _nameTreeHead.root = refs->nameTreeRoot; + + UA_ReferenceTarget tmpTarget; + tmpTarget.targetId = *targetNodeId; + tmpTarget.targetIdHash = UA_ExpandedNodeId_hash(targetNodeId); + UA_ReferenceTarget *target = (UA_ReferenceTarget*) + aa_find(&_idTreeHead, &tmpTarget); + if(!target) + continue; + + /* Ok, delete the reference */ + TAILQ_REMOVE(&refs->queueHead, target, queuePointers); + aa_remove(&_idTreeHead, target); + aa_remove(&_nameTreeHead, target); + UA_ExpandedNodeId_clear(&target->targetId); + UA_free(target); + + refs->idTreeRoot = _idTreeHead.root; + refs->nameTreeRoot = _nameTreeHead.root; + + if(!TAILQ_EMPTY(&refs->queueHead)) + return UA_STATUSCODE_GOOD; /* At least one target remains for the refkind */ + + head->referencesSize--; + if(head->referencesSize > 0) { + /* No target for the ReferenceType remaining. Remove and shrink down + * allocated buffer. */ + if(i-1 != head->referencesSize) + head->references[i-1] = head->references[node->head.referencesSize]; + UA_NodeReferenceKind *newRefs = (UA_NodeReferenceKind*) + UA_realloc(head->references, sizeof(UA_NodeReferenceKind) * head->referencesSize); + /* Ignore errors in case memory buffer could not be shrinked down */ + if(newRefs) { + /* Repair the backpointer in the queue */ + for(size_t j = 0; j < head->referencesSize; j++) + TAILQ_FIRST(&newRefs[j].queueHead)->queuePointers.tqe_prev = + &newRefs[j].queueHead.tqh_first; + head->references = newRefs; + } + } else { + /* No remaining references of any ReferenceType */ + UA_free(head->references); + head->references = NULL; + } + return UA_STATUSCODE_GOOD; + } + return UA_STATUSCODE_UNCERTAINREFERENCENOTDELETED; +} + +void +UA_Node_deleteReferencesSubset(UA_Node *node, const UA_ReferenceTypeSet *keepSet) { + UA_NodeHead *head = &node->head; + for(size_t i = head->referencesSize; i > 0; --i) { + /* Keep the references of this type? */ + UA_NodeReferenceKind *refs = &head->references[i-1]; + if(UA_ReferenceTypeSet_contains(keepSet, refs->referenceTypeIndex)) + continue; + + /* Remove all target entries. Don't remove entries from the tree. The + * entire ReferenceKind will be removed anyway. */ + UA_ReferenceTarget *target, *tmp; + TAILQ_FOREACH_SAFE(target, &refs->queueHead, queuePointers, tmp) { + TAILQ_REMOVE(&refs->queueHead, target, queuePointers); + UA_ExpandedNodeId_clear(&target->targetId); + UA_free(target); + } + head->referencesSize--; + + /* Move last references-kind entry to this position */ + if(i-1 != head->referencesSize) /* Don't memcpy over the same position */ + head->references[i-1] = head->references[head->referencesSize]; + } + + if(head->referencesSize > 0) { + /* Realloc to save memory */ + UA_NodeReferenceKind *refs = (UA_NodeReferenceKind*) + UA_realloc(head->references, sizeof(UA_NodeReferenceKind) * head->referencesSize); + /* Ignore if realloc fails */ + if(refs) { + /* Repair the backpointer in the queue */ + for(size_t i = 0; i < head->referencesSize; i++) + TAILQ_FIRST(&refs[i].queueHead)->queuePointers.tqe_prev = + &refs[i].queueHead.tqh_first; + head->references = refs; + } + } else { + /* The array is empty. Remove. */ + UA_free(head->references); + head->references = NULL; + } +} + +void UA_Node_deleteReferences(UA_Node *node) { + UA_ReferenceTypeSet noRefs; + UA_ReferenceTypeSet_init(&noRefs); + UA_Node_deleteReferencesSubset(node, &noRefs); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015 (c) LEvertz + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2016 (c) Julian Grothoff + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Hilscher Gesellschaft für Systemautomation mbH (Author: Martin Lang) + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL +#endif + + +#ifdef UA_ENABLE_SUBSCRIPTIONS +#endif + +#ifdef UA_ENABLE_VALGRIND_INTERACTIVE +#include <valgrind/memcheck.h> +#endif + +#define STARTCHANNELID 1 +#define STARTTOKENID 1 + +/**********************/ +/* Namespace Handling */ +/**********************/ + +/* The NS1 Uri can be changed by the user to some custom string. This method is + * called to initialize the NS1 Uri if it is not set before to the default + * Application URI. + * + * This is done as soon as the Namespace Array is read or written via node value + * read / write services, or UA_Server_addNamespace, + * UA_Server_getNamespaceByName or UA_Server_run_startup is called. + * + * Therefore one has to set the custom NS1 URI before one of the previously + * mentioned steps. */ +void +setupNs1Uri(UA_Server *server) { + if(!server->namespaces[1].data) { + UA_String_copy(&server->config.applicationDescription.applicationUri, + &server->namespaces[1]); + } +} + +UA_UInt16 addNamespace(UA_Server *server, const UA_String name) { + /* ensure that the uri for ns1 is set up from the app description */ + setupNs1Uri(server); + + /* Check if the namespace already exists in the server's namespace array */ + for(UA_UInt16 i = 0; i < server->namespacesSize; ++i) { + if(UA_String_equal(&name, &server->namespaces[i])) + return i; + } + + /* Make the array bigger */ + UA_String *newNS = (UA_String*)UA_realloc(server->namespaces, + sizeof(UA_String) * (server->namespacesSize + 1)); + if(!newNS) + return 0; + server->namespaces = newNS; + + /* Copy the namespace string */ + UA_StatusCode retval = UA_String_copy(&name, &server->namespaces[server->namespacesSize]); + if(retval != UA_STATUSCODE_GOOD) + return 0; + + /* Announce the change (otherwise, the array appears unchanged) */ + ++server->namespacesSize; + return (UA_UInt16)(server->namespacesSize - 1); +} + +UA_UInt16 UA_Server_addNamespace(UA_Server *server, const char* name) { + /* Override const attribute to get string (dirty hack) */ + UA_String nameString; + nameString.length = strlen(name); + nameString.data = (UA_Byte*)(uintptr_t)name; + UA_LOCK(server->serviceMutex); + UA_UInt16 retVal = addNamespace(server, nameString); + UA_UNLOCK(server->serviceMutex); + return retVal; +} + +UA_ServerConfig* +UA_Server_getConfig(UA_Server *server) { + if(!server) + return NULL; + return &server->config; +} + +UA_StatusCode +getNamespaceByName(UA_Server *server, const UA_String namespaceUri, + size_t *foundIndex) { + /* ensure that the uri for ns1 is set up from the app description */ + setupNs1Uri(server); + UA_StatusCode res = UA_STATUSCODE_BADNOTFOUND; + for(size_t idx = 0; idx < server->namespacesSize; idx++) { + if(UA_String_equal(&server->namespaces[idx], &namespaceUri)) { + (*foundIndex) = idx; + res = UA_STATUSCODE_GOOD; + break; + } + } + return res; +} + +UA_StatusCode +UA_Server_getNamespaceByName(UA_Server *server, const UA_String namespaceUri, + size_t *foundIndex) { + UA_LOCK(server->serviceMutex); + UA_StatusCode res = getNamespaceByName(server, namespaceUri, foundIndex); + UA_UNLOCK(server->serviceMutex); + return res; +} + +UA_StatusCode +UA_Server_forEachChildNodeCall(UA_Server *server, UA_NodeId parentNodeId, + UA_NodeIteratorCallback callback, void *handle) { + UA_LOCK(server->serviceMutex); + const UA_Node *parent = UA_NODESTORE_GET(server, &parentNodeId); + if(!parent) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADNODEIDINVALID; + } + + /* TODO: We need to do an ugly copy of the references array since users may + * delete references from within the callback. In single-threaded mode this + * changes the same node we point at here. In multi-threaded mode, this + * creates a new copy as nodes are truly immutable. + * The callback could remove a node via the regular public API. + * This can remove a member of the nodes-array we iterate over... + * */ + UA_Node *parentCopy = UA_Node_copy_alloc(parent); + if(!parentCopy) { + UA_NODESTORE_RELEASE(server, parent); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t i = parentCopy->head.referencesSize; i > 0; --i) { + UA_NodeReferenceKind *ref = &parentCopy->head.references[i - 1]; + UA_NodeId refTypeId = + *UA_NODESTORE_GETREFERENCETYPEID(server, ref->referenceTypeIndex); + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &ref->queueHead, queuePointers) { + UA_UNLOCK(server->serviceMutex); + retval = callback(target->targetId.nodeId, ref->isInverse, refTypeId, handle); + UA_LOCK(server->serviceMutex); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + } + +cleanup: + UA_Node_clear(parentCopy); + UA_free(parentCopy); + + UA_NODESTORE_RELEASE(server, parent); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/********************/ +/* Server Lifecycle */ +/********************/ + +static void +serverExecuteRepeatedCallback(UA_Server *server, UA_ApplicationCallback cb, + void *callbackApplication, void *data); + +/* The server needs to be stopped before it can be deleted */ +void UA_Server_delete(UA_Server *server) { + UA_LOCK(server->serviceMutex); + + UA_Server_deleteSecureChannels(server); + session_list_entry *current, *temp; + LIST_FOREACH_SAFE(current, &server->sessions, pointers, temp) { + UA_Server_removeSession(server, current, UA_DIAGNOSTICEVENT_CLOSE); + } + UA_Array_delete(server->namespaces, server->namespacesSize, &UA_TYPES[UA_TYPES_STRING]); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_MonitoredItem *mon, *mon_tmp; + LIST_FOREACH_SAFE(mon, &server->localMonitoredItems, listEntry, mon_tmp) { + LIST_REMOVE(mon, listEntry); + UA_MonitoredItem_delete(server, mon); + } + + /* Remove subscriptions without a session */ + UA_Subscription *sub, *sub_tmp; + LIST_FOREACH_SAFE(sub, &server->subscriptions, serverListEntry, sub_tmp) { + UA_Subscription_delete(server, sub); + } + UA_assert(server->monitoredItemsSize == 0); + UA_assert(server->subscriptionsSize == 0); + +#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS + UA_ConditionList_delete(server); +#endif + +#endif + +#ifdef UA_ENABLE_PUBSUB + UA_PubSubManager_delete(server, &server->pubSubManager); +#endif + +#ifdef UA_ENABLE_DISCOVERY + UA_DiscoveryManager_clear(&server->discoveryManager, server); +#endif + +#if UA_MULTITHREADING >= 100 + UA_AsyncManager_clear(&server->asyncManager, server); +#endif + + /* Clean up the Admin Session */ + UA_Session_clear(&server->adminSession, server); + + UA_UNLOCK(server->serviceMutex); /* The timer has its own mutex */ + + /* Execute all remaining delayed events and clean up the timer */ + UA_Timer_process(&server->timer, UA_DateTime_nowMonotonic() + 1, + (UA_TimerExecutionCallback)serverExecuteRepeatedCallback, server); + UA_Timer_clear(&server->timer); + + /* Clean up the config */ + UA_ServerConfig_clean(&server->config); + +#if UA_MULTITHREADING >= 100 + UA_LOCK_DESTROY(server->networkMutex) + UA_LOCK_DESTROY(server->serviceMutex) +#endif + + /* Delete the server itself */ + UA_free(server); +} + +/* Recurring cleanup. Removing unused and timed-out channels and sessions */ +static void +UA_Server_cleanup(UA_Server *server, void *_) { + UA_LOCK(server->serviceMutex); + UA_DateTime nowMonotonic = UA_DateTime_nowMonotonic(); + UA_Server_cleanupSessions(server, nowMonotonic); + UA_Server_cleanupTimedOutSecureChannels(server, nowMonotonic); +#ifdef UA_ENABLE_DISCOVERY + UA_Discovery_cleanupTimedOut(server, nowMonotonic); +#endif + UA_UNLOCK(server->serviceMutex); +} + +/********************/ +/* Server Lifecycle */ +/********************/ + +static UA_Server * +UA_Server_init(UA_Server *server) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + + if(!server->config.nodestore.getNode) { + UA_LOG_FATAL(&server->config.logger, UA_LOGCATEGORY_SERVER, + "No Nodestore configured in the server"); + goto cleanup; + } + + /* Init start time to zero, the actual start time will be sampled in + * UA_Server_run_startup() */ + server->startTime = 0; + + /* Set a seed for non-cyptographic randomness */ +#ifndef UA_ENABLE_DETERMINISTIC_RNG + UA_random_seed((UA_UInt64)UA_DateTime_now()); +#endif + +#if UA_MULTITHREADING >= 100 + UA_LOCK_INIT(server->networkMutex) + UA_LOCK_INIT(server->serviceMutex) +#endif + + /* Initialize the handling of repeated callbacks */ + UA_Timer_init(&server->timer); + + /* Initialize the adminSession */ + UA_Session_init(&server->adminSession); + server->adminSession.sessionId.identifierType = UA_NODEIDTYPE_GUID; + server->adminSession.sessionId.identifier.guid.data1 = 1; + server->adminSession.validTill = UA_INT64_MAX; + + /* Create Namespaces 0 and 1 + * Ns1 will be filled later with the uri from the app description */ + server->namespaces = (UA_String *)UA_Array_new(2, &UA_TYPES[UA_TYPES_STRING]); + if(!server->namespaces) { + UA_Server_delete(server); + return NULL; + } + server->namespaces[0] = UA_STRING_ALLOC("http://opcfoundation.org/UA/"); + server->namespaces[1] = UA_STRING_NULL; + server->namespacesSize = 2; + + /* Initialize SecureChannel */ + TAILQ_INIT(&server->channels); + /* TODO: use an ID that is likely to be unique after a restart */ + server->lastChannelId = STARTCHANNELID; + server->lastTokenId = STARTTOKENID; + + /* Initialize Session Management */ + LIST_INIT(&server->sessions); + server->sessionCount = 0; + +#if UA_MULTITHREADING >= 100 + UA_AsyncManager_init(&server->asyncManager, server); +#endif + + /* Add a regular callback for cleanup and maintenance. With a 10s interval. */ + UA_Server_addRepeatedCallback(server, (UA_ServerCallback)UA_Server_cleanup, NULL, + 10000.0, NULL); + + /* Initialize namespace 0*/ + res = UA_Server_initNS0(server); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + +#ifdef UA_ENABLE_PUBSUB + /* Build PubSub information model */ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + UA_Server_initPubSubNS0(server); +#endif + + server->config.pubsubConfiguration = (UA_PubSubConfiguration*) UA_calloc(1, sizeof(UA_PubSubConfiguration)); + if (!server->config.pubsubConfiguration) { + goto cleanup; + } + +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* setup default PubSub monitoring callbacks */ + if (UA_PubSubManager_setDefaultMonitoringCallbacks(&(server->config.pubsubConfiguration->monitoringInterface)) != + UA_STATUSCODE_GOOD) { + goto cleanup; + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ +#endif /* UA_ENABLE_PUBSUB */ + return server; + + cleanup: + UA_Server_delete(server); + return NULL; +} + +UA_Server * +UA_Server_newWithConfig(UA_ServerConfig *config) { + if(!config) + return NULL; + UA_Server *server = (UA_Server *)UA_calloc(1, sizeof(UA_Server)); + if(!server) { + UA_ServerConfig_clean(config); + return NULL; + } + server->config = *config; + + + /* The config might have been "moved" into the server struct. Ensure that + * the logger pointer is correct. */ + for(size_t i = 0; i < server->config.securityPoliciesSize; i++) + server->config.securityPolicies[i].logger = &server->config.logger; + + /* Reset the old config */ + memset(config, 0, sizeof(UA_ServerConfig)); + return UA_Server_init(server); +} + +/* Returns if the server should be shut down immediately */ +static UA_Boolean +setServerShutdown(UA_Server *server) { + if(server->endTime != 0) + return false; + if(server->config.shutdownDelay == 0) + return true; + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Shutting down the server with a delay of %i ms", (int)server->config.shutdownDelay); + server->endTime = UA_DateTime_now() + (UA_DateTime)(server->config.shutdownDelay * UA_DATETIME_MSEC); + return false; +} + +/*******************/ +/* Timed Callbacks */ +/*******************/ + +UA_StatusCode +UA_Server_addTimedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_DateTime date, UA_UInt64 *callbackId) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = UA_Timer_addTimedCallback(&server->timer, + (UA_ApplicationCallback)callback, + server, data, date, callbackId); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, + UA_UInt64 *callbackId) { + return UA_Timer_addRepeatedCallback(&server->timer, + (UA_ApplicationCallback)callback, + server, data, interval_ms, callbackId); +} + +UA_StatusCode +UA_Server_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, + UA_UInt64 *callbackId) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = addRepeatedCallback(server, callback, data, interval_ms, callbackId); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, + UA_Double interval_ms) { + return UA_Timer_changeRepeatedCallbackInterval(&server->timer, callbackId, + interval_ms); +} + +UA_StatusCode +UA_Server_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, + UA_Double interval_ms) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = changeRepeatedCallbackInterval(server, callbackId, interval_ms); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +void +removeCallback(UA_Server *server, UA_UInt64 callbackId) { + UA_Timer_removeCallback(&server->timer, callbackId); +} + +void +UA_Server_removeCallback(UA_Server *server, UA_UInt64 callbackId) { + UA_LOCK(server->serviceMutex); + removeCallback(server, callbackId); + UA_UNLOCK(server->serviceMutex); +} + +UA_StatusCode +UA_Server_updateCertificate(UA_Server *server, + const UA_ByteString *oldCertificate, + const UA_ByteString *newCertificate, + const UA_ByteString *newPrivateKey, + UA_Boolean closeSessions, + UA_Boolean closeSecureChannels) { + + if(!server || !oldCertificate || !newCertificate || !newPrivateKey) + return UA_STATUSCODE_BADINTERNALERROR; + + if(closeSessions) { + session_list_entry *current; + LIST_FOREACH(current, &server->sessions, pointers) { + if(UA_ByteString_equal(oldCertificate, + ¤t->session.header.channel->securityPolicy->localCertificate)) { + UA_LOCK(server->serviceMutex); + UA_Server_removeSessionByToken(server, ¤t->session.header.authenticationToken, + UA_DIAGNOSTICEVENT_CLOSE); + UA_UNLOCK(server->serviceMutex); + } + } + + } + + if(closeSecureChannels) { + channel_entry *entry; + TAILQ_FOREACH(entry, &server->channels, pointers) { + if(UA_ByteString_equal(&entry->channel.securityPolicy->localCertificate, oldCertificate)) + UA_Server_closeSecureChannel(server, &entry->channel, UA_DIAGNOSTICEVENT_CLOSE); + } + } + + size_t i = 0; + while(i < server->config.endpointsSize) { + UA_EndpointDescription *ed = &server->config.endpoints[i]; + if(UA_ByteString_equal(&ed->serverCertificate, oldCertificate)) { + UA_String_clear(&ed->serverCertificate); + UA_String_copy(newCertificate, &ed->serverCertificate); + UA_SecurityPolicy *sp = + UA_SecurityPolicy_getSecurityPolicyByUri(server, + &server->config.endpoints[i].securityPolicyUri); + if(!sp) + return UA_STATUSCODE_BADINTERNALERROR; + sp->updateCertificateAndPrivateKey(sp, *newCertificate, *newPrivateKey); + } + i++; + } + + return UA_STATUSCODE_GOOD; +} + +/***************************/ +/* Server lookup functions */ +/***************************/ + +UA_SecurityPolicy * +UA_SecurityPolicy_getSecurityPolicyByUri(const UA_Server *server, + const UA_ByteString *securityPolicyUri) { + for(size_t i = 0; i < server->config.securityPoliciesSize; i++) { + UA_SecurityPolicy *securityPolicyCandidate = &server->config.securityPolicies[i]; + if(UA_ByteString_equal(securityPolicyUri, &securityPolicyCandidate->policyUri)) + return securityPolicyCandidate; + } + return NULL; +} + +#ifdef UA_ENABLE_ENCRYPTION +/* The local ApplicationURI has to match the certificates of the + * SecurityPolicies */ +static UA_StatusCode +verifyServerApplicationURI(const UA_Server *server) { + for(size_t i = 0; i < server->config.securityPoliciesSize; i++) { + UA_SecurityPolicy *sp = &server->config.securityPolicies[i]; + UA_StatusCode retval = server->config.certificateVerification. + verifyApplicationURI(server->config.certificateVerification.context, + &sp->localCertificate, + &server->config.applicationDescription.applicationUri); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "The configured ApplicationURI \"%.*s\"does not match the " + "ApplicationURI specified in the certificate for the " + "SecurityPolicy %.*s", + (int)server->config.applicationDescription.applicationUri.length, + server->config.applicationDescription.applicationUri.data, + (int)sp->policyUri.length, sp->policyUri.data); + return retval; + } + } + return UA_STATUSCODE_GOOD; +} +#endif + +UA_ServerStatistics UA_Server_getStatistics(UA_Server *server) +{ + return server->serverStats; +} + +/********************/ +/* Main Server Loop */ +/********************/ + +#define UA_MAXTIMEOUT 50 /* Max timeout in ms between main-loop iterations */ + +/* Start: Spin up the workers and the network layer and sample the server's + * start time. + * Iterate: Process repeated callbacks and events in the network layer. This + * part can be driven from an external main-loop in an event-driven + * single-threaded architecture. + * Stop: Stop workers, finish all callbacks, stop the network layer, clean up */ + +UA_StatusCode +UA_Server_run_startup(UA_Server *server) { + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Prominently warn user that fuzzing build is enabled. This will tamper with authentication tokens and other important variables + * E.g. if fuzzing is enabled, and two clients are connected, subscriptions do not work properly, + * since the tokens will be overridden to allow easier fuzzing. */ + UA_LOG_FATAL(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Server was built with unsafe fuzzing mode. " + "This should only be used for specific fuzzing builds."); +#endif + + /* ensure that the uri for ns1 is set up from the app description */ + setupNs1Uri(server); + + /* write ServerArray with same ApplicationURI value as NamespaceArray */ + UA_StatusCode retVal = + writeNs0VariableArray(server, UA_NS0ID_SERVER_SERVERARRAY, + &server->config.applicationDescription.applicationUri, + 1, &UA_TYPES[UA_TYPES_STRING]); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + if(server->state > UA_SERVERLIFECYCLE_FRESH) + return UA_STATUSCODE_GOOD; + + /* At least one endpoint has to be configured */ + if(server->config.endpointsSize == 0) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "There has to be at least one endpoint."); + } + + /* Initialized discovery */ +#ifdef UA_ENABLE_DISCOVERY + UA_DiscoveryManager_init(&server->discoveryManager, server); +#endif + + /* Does the ApplicationURI match the local certificates? */ +#ifdef UA_ENABLE_ENCRYPTION + retVal = verifyServerApplicationURI(server); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; +#endif + + /* Sample the start time and set it to the Server object */ + server->startTime = UA_DateTime_now(); + UA_Variant var; + UA_Variant_init(&var); + UA_Variant_setScalar(&var, &server->startTime, &UA_TYPES[UA_TYPES_DATETIME]); + UA_Server_writeValue(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_STARTTIME), + var); + + /* Start the networklayers */ + UA_StatusCode result = UA_STATUSCODE_GOOD; + for(size_t i = 0; i < server->config.networkLayersSize; ++i) { + UA_ServerNetworkLayer *nl = &server->config.networkLayers[i]; + nl->statistics = &server->serverStats.ns; + result |= nl->start(nl, &server->config.logger, &server->config.customHostname); + } + if(result != UA_STATUSCODE_GOOD) + return result; + + /* Update the application description to match the previously added + * discovery urls. We can only do this after the network layer is started + * since it inits the discovery url */ + if(server->config.applicationDescription.discoveryUrlsSize != 0) { + UA_Array_delete(server->config.applicationDescription.discoveryUrls, + server->config.applicationDescription.discoveryUrlsSize, + &UA_TYPES[UA_TYPES_STRING]); + server->config.applicationDescription.discoveryUrlsSize = 0; + } + server->config.applicationDescription.discoveryUrls = (UA_String *) + UA_Array_new(server->config.networkLayersSize, &UA_TYPES[UA_TYPES_STRING]); + if(!server->config.applicationDescription.discoveryUrls) + return UA_STATUSCODE_BADOUTOFMEMORY; + server->config.applicationDescription.discoveryUrlsSize = + server->config.networkLayersSize; + for(size_t i = 0; i < server->config.applicationDescription.discoveryUrlsSize; i++) { + UA_ServerNetworkLayer *nl = &server->config.networkLayers[i]; + UA_String_copy(&nl->discoveryUrl, + &server->config.applicationDescription.discoveryUrls[i]); + } + + /* Start the multicast discovery server */ +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + if(server->config.mdnsEnabled) + startMulticastDiscoveryServer(server); +#endif + + server->state = UA_SERVERLIFECYCLE_FRESH; + + return result; +} + +static void +serverExecuteRepeatedCallback(UA_Server *server, UA_ApplicationCallback cb, + void *callbackApplication, void *data) { + /* Service mutex is not set inside the timer that triggers the callback */ + UA_LOCK_ASSERT(server->serviceMutex, 0); + cb(callbackApplication, data); +} + +UA_UInt16 +UA_Server_run_iterate(UA_Server *server, UA_Boolean waitInternal) { + /* Process repeated work */ + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_DateTime nextRepeated = UA_Timer_process(&server->timer, now, + (UA_TimerExecutionCallback)serverExecuteRepeatedCallback, server); + UA_DateTime latest = now + (UA_MAXTIMEOUT * UA_DATETIME_MSEC); + if(nextRepeated > latest) + nextRepeated = latest; + + UA_UInt16 timeout = 0; + + /* round always to upper value to avoid timeout to be set to 0 + * if(nextRepeated - now) < (UA_DATETIME_MSEC/2) */ + if(waitInternal) + timeout = (UA_UInt16)(((nextRepeated - now) + (UA_DATETIME_MSEC - 1)) / UA_DATETIME_MSEC); + + /* Listen on the networklayer */ + for(size_t i = 0; i < server->config.networkLayersSize; ++i) { + UA_ServerNetworkLayer *nl = &server->config.networkLayers[i]; + nl->listen(nl, server, timeout); + } + +#if defined(UA_ENABLE_PUBSUB_MQTT) + /* Listen on the pubsublayer, but only if the yield function is set */ + UA_PubSubConnection *connection; + TAILQ_FOREACH(connection, &server->pubSubManager.connections, listEntry){ + UA_PubSubConnection *ps = connection; + if(ps && ps->channel->yield){ + ps->channel->yield(ps->channel, timeout); + } + } +#endif + + UA_LOCK(server->serviceMutex); + +#if defined(UA_ENABLE_DISCOVERY_MULTICAST) && (UA_MULTITHREADING < 200) + if(server->config.mdnsEnabled) { + /* TODO multicastNextRepeat does not consider new input data (requests) + * on the socket. It will be handled on the next call. if needed, we + * need to use select with timeout on the multicast socket + * server->mdnsSocket (see example in mdnsd library) on higher level. */ + UA_DateTime multicastNextRepeat = 0; + UA_StatusCode hasNext = + iterateMulticastDiscoveryServer(server, &multicastNextRepeat, true); + if(hasNext == UA_STATUSCODE_GOOD && multicastNextRepeat < nextRepeated) + nextRepeated = multicastNextRepeat; + } +#endif + + UA_UNLOCK(server->serviceMutex); + + now = UA_DateTime_nowMonotonic(); + timeout = 0; + if(nextRepeated > now) + timeout = (UA_UInt16)((nextRepeated - now) / UA_DATETIME_MSEC); + return timeout; +} + +UA_StatusCode +UA_Server_run_shutdown(UA_Server *server) { + /* Stop the netowrk layer */ + for(size_t i = 0; i < server->config.networkLayersSize; ++i) { + UA_ServerNetworkLayer *nl = &server->config.networkLayers[i]; + nl->stop(nl, server); + } + +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + /* Stop multicast discovery */ + if(server->config.mdnsEnabled) + stopMulticastDiscoveryServer(server); +#endif + + return UA_STATUSCODE_GOOD; +} + +static UA_Boolean +testShutdownCondition(UA_Server *server) { + if(server->endTime == 0) + return false; + return (UA_DateTime_now() > server->endTime); +} + +UA_StatusCode +UA_Server_run(UA_Server *server, const volatile UA_Boolean *running) { + UA_StatusCode retval = UA_Server_run_startup(server); + if(retval != UA_STATUSCODE_GOOD) + return retval; +#ifdef UA_ENABLE_VALGRIND_INTERACTIVE + size_t loopCount = 0; +#endif + while(!testShutdownCondition(server)) { +#ifdef UA_ENABLE_VALGRIND_INTERACTIVE + if(loopCount == 0) { + VALGRIND_DO_LEAK_CHECK; + } + ++loopCount; + loopCount %= UA_VALGRIND_INTERACTIVE_INTERVAL; +#endif + UA_Server_run_iterate(server, true); + if(!*running) { + if(setServerShutdown(server)) + break; + } + } + return UA_Server_run_shutdown(server); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_ns0.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Thomas Bender + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017 (c) Henrik Norrman + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + + +static UA_StatusCode +addNode_raw(UA_Server *server, UA_NodeClass nodeClass, + UA_UInt32 nodeId, char *name, void *attributes, + const UA_DataType *attributesType) { + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.nodeClass = nodeClass; + item.requestedNewNodeId.nodeId = UA_NODEID_NUMERIC(0, nodeId); + item.browseName = UA_QUALIFIEDNAME(0, name); + UA_ExtensionObject_setValueNoDelete(&item.nodeAttributes, + attributes, attributesType); + return AddNode_raw(server, &server->adminSession, NULL, &item, NULL); +} + +static UA_StatusCode +addNode_finish(UA_Server *server, UA_UInt32 nodeId, + UA_UInt32 parentNodeId, UA_UInt32 referenceTypeId) { + const UA_NodeId sourceId = UA_NODEID_NUMERIC(0, nodeId); + const UA_NodeId refTypeId = UA_NODEID_NUMERIC(0, referenceTypeId); + const UA_ExpandedNodeId targetId = UA_EXPANDEDNODEID_NUMERIC(0, parentNodeId); + UA_StatusCode retval = UA_Server_addReference(server, sourceId, refTypeId, targetId, false); + if(retval != UA_STATUSCODE_GOOD) + return retval; + return AddNode_finish(server, &server->adminSession, &sourceId); +} + +static UA_StatusCode +addObjectNode(UA_Server *server, char* name, UA_UInt32 objectid, + UA_UInt32 parentid, UA_UInt32 referenceid, UA_UInt32 type_id) { + UA_ObjectAttributes object_attr = UA_ObjectAttributes_default; + object_attr.displayName = UA_LOCALIZEDTEXT("", name); + return UA_Server_addObjectNode(server, UA_NODEID_NUMERIC(0, objectid), + UA_NODEID_NUMERIC(0, parentid), + UA_NODEID_NUMERIC(0, referenceid), + UA_QUALIFIEDNAME(0, name), + UA_NODEID_NUMERIC(0, type_id), + object_attr, NULL, NULL); +} + +static UA_StatusCode +addReferenceTypeNode(UA_Server *server, char* name, char *inverseName, UA_UInt32 referencetypeid, + UA_Boolean isabstract, UA_Boolean symmetric, UA_UInt32 parentid) { + UA_ReferenceTypeAttributes reference_attr = UA_ReferenceTypeAttributes_default; + reference_attr.displayName = UA_LOCALIZEDTEXT("", name); + reference_attr.isAbstract = isabstract; + reference_attr.symmetric = symmetric; + if(inverseName) + reference_attr.inverseName = UA_LOCALIZEDTEXT("", inverseName); + return UA_Server_addReferenceTypeNode(server, UA_NODEID_NUMERIC(0, referencetypeid), + UA_NODEID_NUMERIC(0, parentid), UA_NODEID_NULL, + UA_QUALIFIEDNAME(0, name), reference_attr, NULL, NULL); +} + +/***************************/ +/* Bootstrap NS0 hierarchy */ +/***************************/ + +/* Creates the basic nodes which are expected by the nodeset compiler to be + * already created. This is necessary to reduce the dependencies for the nodeset + * compiler. */ +static UA_StatusCode +UA_Server_createNS0_base(UA_Server *server) { + /* Bootstrap ReferenceTypes. The order of these is important for the + * ReferenceTypeIndex. The ReferenceTypeIndex is created with the raw node. + * The ReferenceTypeSet of subtypes for every ReferenceType is created + * during the call to AddNode_finish. */ + UA_StatusCode ret = UA_STATUSCODE_GOOD; + UA_ReferenceTypeAttributes references_attr = UA_ReferenceTypeAttributes_default; + references_attr.displayName = UA_LOCALIZEDTEXT("", "References"); + references_attr.isAbstract = true; + references_attr.symmetric = true; + references_attr.inverseName = UA_LOCALIZEDTEXT("", "References"); + ret |= addNode_raw(server, UA_NODECLASS_REFERENCETYPE, UA_NS0ID_REFERENCES, "References", + &references_attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); + + UA_ReferenceTypeAttributes hassubtype_attr = UA_ReferenceTypeAttributes_default; + hassubtype_attr.displayName = UA_LOCALIZEDTEXT("", "HasSubtype"); + hassubtype_attr.isAbstract = false; + hassubtype_attr.symmetric = false; + hassubtype_attr.inverseName = UA_LOCALIZEDTEXT("", "HasSupertype"); + ret |= addNode_raw(server, UA_NODECLASS_REFERENCETYPE, UA_NS0ID_HASSUBTYPE, "HasSubtype", + &hassubtype_attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); + + UA_ReferenceTypeAttributes aggregates_attr = UA_ReferenceTypeAttributes_default; + aggregates_attr.displayName = UA_LOCALIZEDTEXT("", "Aggregates"); + aggregates_attr.isAbstract = true; + aggregates_attr.symmetric = false; + aggregates_attr.inverseName = UA_LOCALIZEDTEXT("", "AggregatedBy"); + ret |= addNode_raw(server, UA_NODECLASS_REFERENCETYPE, UA_NS0ID_AGGREGATES, "Aggregates", + &aggregates_attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); + + ret |= addReferenceTypeNode(server, "HierarchicalReferences", NULL, + UA_NS0ID_HIERARCHICALREFERENCES, true, false, UA_NS0ID_REFERENCES); + + ret |= addReferenceTypeNode(server, "NonHierarchicalReferences", NULL, + UA_NS0ID_NONHIERARCHICALREFERENCES, true, true, UA_NS0ID_REFERENCES); + + ret |= addReferenceTypeNode(server, "HasChild", NULL, UA_NS0ID_HASCHILD, + true, false, UA_NS0ID_HIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "Organizes", "OrganizedBy", UA_NS0ID_ORGANIZES, + false, false, UA_NS0ID_HIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "HasEventSource", "EventSourceOf", UA_NS0ID_HASEVENTSOURCE, + false, false, UA_NS0ID_HIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "HasModellingRule", "ModellingRuleOf", UA_NS0ID_HASMODELLINGRULE, + false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "HasEncoding", "EncodingOf", UA_NS0ID_HASENCODING, + false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "HasDescription", "DescriptionOf", UA_NS0ID_HASDESCRIPTION, + false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "HasTypeDefinition", "TypeDefinitionOf", UA_NS0ID_HASTYPEDEFINITION, + false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + ret |= addReferenceTypeNode(server, "GeneratesEvent", "GeneratedBy", UA_NS0ID_GENERATESEVENT, + false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + /* Complete bootstrap of Aggregates */ + ret |= addNode_finish(server, UA_NS0ID_AGGREGATES, UA_NS0ID_HASCHILD, UA_NS0ID_HASSUBTYPE); + + /* Complete bootstrap of HasSubtype */ + ret |= addNode_finish(server, UA_NS0ID_HASSUBTYPE, UA_NS0ID_HASCHILD, UA_NS0ID_HASSUBTYPE); + + ret |= addReferenceTypeNode(server, "HasProperty", "PropertyOf", UA_NS0ID_HASPROPERTY, + false, false, UA_NS0ID_AGGREGATES); + + ret |= addReferenceTypeNode(server, "HasComponent", "ComponentOf", UA_NS0ID_HASCOMPONENT, + false, false, UA_NS0ID_AGGREGATES); + + ret |= addReferenceTypeNode(server, "HasNotifier", "NotifierOf", UA_NS0ID_HASNOTIFIER, + false, false, UA_NS0ID_HASEVENTSOURCE); + + ret |= addReferenceTypeNode(server, "HasOrderedComponent", "OrderedComponentOf", + UA_NS0ID_HASORDEREDCOMPONENT, false, false, UA_NS0ID_HASCOMPONENT); + + ret |= addReferenceTypeNode(server, "HasInterface", "InterfaceOf", + UA_NS0ID_HASINTERFACE, false, false, UA_NS0ID_NONHIERARCHICALREFERENCES); + + /**************/ + /* Data Types */ + /**************/ + + /* Bootstrap BaseDataType */ + UA_DataTypeAttributes basedatatype_attr = UA_DataTypeAttributes_default; + basedatatype_attr.displayName = UA_LOCALIZEDTEXT("", "BaseDataType"); + basedatatype_attr.isAbstract = true; + ret |= addNode_raw(server, UA_NODECLASS_DATATYPE, UA_NS0ID_BASEDATATYPE, "BaseDataType", + &basedatatype_attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); + + /*****************/ + /* VariableTypes */ + /*****************/ + + UA_VariableTypeAttributes basevar_attr = UA_VariableTypeAttributes_default; + basevar_attr.displayName = UA_LOCALIZEDTEXT("", "BaseVariableType"); + basevar_attr.isAbstract = true; + basevar_attr.valueRank = UA_VALUERANK_ANY; + basevar_attr.dataType = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATATYPE); + ret |= addNode_raw(server, UA_NODECLASS_VARIABLETYPE, UA_NS0ID_BASEVARIABLETYPE, "BaseVariableType", + &basevar_attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); + + UA_VariableTypeAttributes bdv_attr = UA_VariableTypeAttributes_default; + bdv_attr.displayName = UA_LOCALIZEDTEXT("", "BaseDataVariableType"); + bdv_attr.dataType = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATATYPE); + bdv_attr.valueRank = UA_VALUERANK_ANY; + ret |= UA_Server_addVariableTypeNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE), + UA_NODEID_NUMERIC(0, UA_NS0ID_BASEVARIABLETYPE), + UA_NODEID_NULL, UA_QUALIFIEDNAME(0, "BaseDataVariableType"), + UA_NODEID_NULL, bdv_attr, NULL, NULL); + + UA_VariableTypeAttributes prop_attr = UA_VariableTypeAttributes_default; + prop_attr.displayName = UA_LOCALIZEDTEXT("", "PropertyType"); + prop_attr.dataType = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATATYPE); + prop_attr.valueRank = UA_VALUERANK_ANY; + ret |= UA_Server_addVariableTypeNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PROPERTYTYPE), + UA_NODEID_NUMERIC(0, UA_NS0ID_BASEVARIABLETYPE), + UA_NODEID_NULL, UA_QUALIFIEDNAME(0, "PropertyType"), + UA_NODEID_NULL, prop_attr, NULL, NULL); + + /***************/ + /* ObjectTypes */ + /***************/ + + UA_ObjectTypeAttributes baseobj_attr = UA_ObjectTypeAttributes_default; + baseobj_attr.displayName = UA_LOCALIZEDTEXT("", "BaseObjectType"); + ret |= addNode_raw(server, UA_NODECLASS_OBJECTTYPE, UA_NS0ID_BASEOBJECTTYPE, "BaseObjectType", + &baseobj_attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); + + UA_ObjectTypeAttributes folder_attr = UA_ObjectTypeAttributes_default; + folder_attr.displayName = UA_LOCALIZEDTEXT("", "FolderType"); + ret |= UA_Server_addObjectTypeNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE), + UA_NODEID_NUMERIC(0, UA_NS0ID_BASEOBJECTTYPE), + UA_NODEID_NULL, UA_QUALIFIEDNAME(0, "FolderType"), + folder_attr, NULL, NULL); + + /******************/ + /* Root and below */ + /******************/ + + ret |= addObjectNode(server, "Root", UA_NS0ID_ROOTFOLDER, 0, 0, UA_NS0ID_FOLDERTYPE); + + ret |= addObjectNode(server, "Objects", UA_NS0ID_OBJECTSFOLDER, UA_NS0ID_ROOTFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + + ret |= addObjectNode(server, "Types", UA_NS0ID_TYPESFOLDER, UA_NS0ID_ROOTFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + + ret |= addObjectNode(server, "ReferenceTypes", UA_NS0ID_REFERENCETYPESFOLDER, UA_NS0ID_TYPESFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + ret |= addNode_finish(server, UA_NS0ID_REFERENCES, UA_NS0ID_REFERENCETYPESFOLDER, + UA_NS0ID_ORGANIZES); + + ret |= addObjectNode(server, "DataTypes", UA_NS0ID_DATATYPESFOLDER, UA_NS0ID_TYPESFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + ret |= addNode_finish(server, UA_NS0ID_BASEDATATYPE, UA_NS0ID_DATATYPESFOLDER, + UA_NS0ID_ORGANIZES); + + ret |= addObjectNode(server, "VariableTypes", UA_NS0ID_VARIABLETYPESFOLDER, UA_NS0ID_TYPESFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + ret |= addNode_finish(server, UA_NS0ID_BASEVARIABLETYPE, UA_NS0ID_VARIABLETYPESFOLDER, + UA_NS0ID_ORGANIZES); + + ret |= addObjectNode(server, "ObjectTypes", UA_NS0ID_OBJECTTYPESFOLDER, UA_NS0ID_TYPESFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + ret |= addNode_finish(server, UA_NS0ID_BASEOBJECTTYPE, UA_NS0ID_OBJECTTYPESFOLDER, + UA_NS0ID_ORGANIZES); + + ret |= addObjectNode(server, "EventTypes", UA_NS0ID_EVENTTYPESFOLDER, UA_NS0ID_TYPESFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + + ret |= addObjectNode(server, "Views", UA_NS0ID_VIEWSFOLDER, UA_NS0ID_ROOTFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_FOLDERTYPE); + + /* Add BaseEventType */ + UA_ObjectTypeAttributes eventtype_attr = UA_ObjectTypeAttributes_default; + eventtype_attr.displayName = UA_LOCALIZEDTEXT("", "BaseEventType"); + ret |= addNode_raw(server, UA_NODECLASS_OBJECTTYPE, UA_NS0ID_BASEEVENTTYPE, "BaseEventType", + &eventtype_attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); + ret |= addNode_finish(server, UA_NS0ID_BASEEVENTTYPE, UA_NS0ID_EVENTTYPESFOLDER, + UA_NS0ID_ORGANIZES); + + if(ret != UA_STATUSCODE_GOOD) + ret = UA_STATUSCODE_BADINTERNALERROR; + + return ret; +} + +/****************/ +/* Data Sources */ +/****************/ + +static UA_StatusCode +readStatus(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext, UA_Boolean sourceTimestamp, + const UA_NumericRange *range, UA_DataValue *value) { + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + + if(sourceTimestamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = UA_DateTime_now(); + } + + void *data = NULL; + + UA_assert(nodeId->identifierType == UA_NODEIDTYPE_NUMERIC); + + switch(nodeId->identifier.numeric) { + case UA_NS0ID_SERVER_SERVERSTATUS_SECONDSTILLSHUTDOWN: { + UA_UInt32 *shutdown = UA_UInt32_new(); + if(!shutdown) + return UA_STATUSCODE_BADOUTOFMEMORY; + if(server->endTime != 0) + *shutdown = (UA_UInt32)((server->endTime - UA_DateTime_now()) / UA_DATETIME_SEC); + value->value.data = shutdown; + value->value.type = &UA_TYPES[UA_TYPES_UINT32]; + value->hasValue = true; + return UA_STATUSCODE_GOOD; + } + + case UA_NS0ID_SERVER_SERVERSTATUS_STATE: { + UA_ServerState *state = UA_ServerState_new(); + if(!state) + return UA_STATUSCODE_BADOUTOFMEMORY; + if(server->endTime != 0) + *state = UA_SERVERSTATE_SHUTDOWN; + value->value.data = state; + value->value.type = &UA_TYPES[UA_TYPES_SERVERSTATE]; + value->hasValue = true; + return UA_STATUSCODE_GOOD; + } + + case UA_NS0ID_SERVER_SERVERSTATUS: { + UA_ServerStatusDataType *statustype = UA_ServerStatusDataType_new(); + if(!statustype) + return UA_STATUSCODE_BADOUTOFMEMORY; + statustype->startTime = server->startTime; + statustype->currentTime = UA_DateTime_now(); + + statustype->state = UA_SERVERSTATE_RUNNING; + statustype->secondsTillShutdown = 0; + if(server->endTime != 0) { + statustype->state = UA_SERVERSTATE_SHUTDOWN; + statustype->secondsTillShutdown = (UA_UInt32) + ((server->endTime - UA_DateTime_now()) / UA_DATETIME_SEC); + } + + value->value.data = statustype; + value->value.type = &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]; + value->hasValue = true; + return UA_BuildInfo_copy(&server->config.buildInfo, &statustype->buildInfo); + } + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO: + value->value.type = &UA_TYPES[UA_TYPES_BUILDINFO]; + data = &server->config.buildInfo; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTURI: + value->value.type = &UA_TYPES[UA_TYPES_STRING]; + data = &server->config.buildInfo.productUri; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_MANUFACTURERNAME: + value->value.type = &UA_TYPES[UA_TYPES_STRING]; + data = &server->config.buildInfo.manufacturerName; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTNAME: + value->value.type = &UA_TYPES[UA_TYPES_STRING]; + data = &server->config.buildInfo.productName; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_SOFTWAREVERSION: + value->value.type = &UA_TYPES[UA_TYPES_STRING]; + data = &server->config.buildInfo.softwareVersion; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDNUMBER: + value->value.type = &UA_TYPES[UA_TYPES_STRING]; + data = &server->config.buildInfo.buildNumber; + break; + + case UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDDATE: + value->value.type = &UA_TYPES[UA_TYPES_DATETIME]; + data = &server->config.buildInfo.buildDate; + break; + + default: + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; + } + + value->value.data = UA_new(value->value.type); + if(!value->value.data) { + value->value.type = NULL; + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + value->hasValue = true; + return UA_copy(data, value->value.data, value->value.type); +} + +#ifdef UA_GENERATED_NAMESPACE_ZERO +static UA_StatusCode +readServiceLevel(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, UA_DataValue *value) { + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + + value->value.type = &UA_TYPES[UA_TYPES_BYTE]; + value->value.arrayLength = 0; + UA_Byte *byte = UA_Byte_new(); + *byte = 255; + value->value.data = byte; + value->value.arrayDimensionsSize = 0; + value->value.arrayDimensions = NULL; + value->hasValue = true; + if(includeSourceTimeStamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = UA_DateTime_now(); + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +readAuditing(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, UA_DataValue *value) { + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + + value->value.type = &UA_TYPES[UA_TYPES_BOOLEAN]; + value->value.arrayLength = 0; + UA_Boolean *boolean = UA_Boolean_new(); + *boolean = false; + value->value.data = boolean; + value->value.arrayDimensionsSize = 0; + value->value.arrayDimensions = NULL; + value->hasValue = true; + if(includeSourceTimeStamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = UA_DateTime_now(); + } + return UA_STATUSCODE_GOOD; +} +#endif + +static UA_StatusCode +readNamespaces(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeid, void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, + UA_DataValue *value) { + /* ensure that the uri for ns1 is set up from the app description */ + setupNs1Uri(server); + + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + UA_StatusCode retval; + retval = UA_Variant_setArrayCopy(&value->value, server->namespaces, + server->namespacesSize, &UA_TYPES[UA_TYPES_STRING]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + value->hasValue = true; + if(includeSourceTimeStamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = UA_DateTime_now(); + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +writeNamespaces(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeid, void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *value) { + /* Check the data type */ + if(!value->hasValue || + value->value.type != &UA_TYPES[UA_TYPES_STRING]) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* Check that the variant is not empty */ + if(!value->value.data) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* TODO: Writing with a range is not implemented */ + if(range) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_String *newNamespaces = (UA_String*)value->value.data; + size_t newNamespacesSize = value->value.arrayLength; + + /* Test if we append to the existing namespaces */ + if(newNamespacesSize <= server->namespacesSize) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* ensure that the uri for ns1 is set up from the app description */ + setupNs1Uri(server); + + /* Test if the existing namespaces are unchanged */ + for(size_t i = 0; i < server->namespacesSize; ++i) { + if(!UA_String_equal(&server->namespaces[i], &newNamespaces[i])) + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Add namespaces */ + for(size_t i = server->namespacesSize; i < newNamespacesSize; ++i) + addNamespace(server, newNamespaces[i]); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +readCurrentTime(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeid, void *nodeContext, UA_Boolean sourceTimeStamp, + const UA_NumericRange *range, UA_DataValue *value) { + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + UA_DateTime currentTime = UA_DateTime_now(); + UA_StatusCode retval = UA_Variant_setScalarCopy(&value->value, ¤tTime, + &UA_TYPES[UA_TYPES_DATETIME]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + value->hasValue = true; + if(sourceTimeStamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = currentTime; + } + return UA_STATUSCODE_GOOD; +} + +#ifdef UA_GENERATED_NAMESPACE_ZERO +static UA_StatusCode +readMinSamplingInterval(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeid, void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, + UA_DataValue *value) { + if(range) { + value->hasStatus = true; + value->status = UA_STATUSCODE_BADINDEXRANGEINVALID; + return UA_STATUSCODE_GOOD; + } + + UA_StatusCode retval; + UA_Duration minInterval; +#ifdef UA_ENABLE_SUBSCRIPTIONS + minInterval = server->config.samplingIntervalLimits.min; +#else + minInterval = 0.0; +#endif + retval = UA_Variant_setScalarCopy(&value->value, &minInterval, &UA_TYPES[UA_TYPES_DURATION]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + value->hasValue = true; + if(includeSourceTimeStamp) { + value->hasSourceTimestamp = true; + value->sourceTimestamp = UA_DateTime_now(); + } + return UA_STATUSCODE_GOOD; +} +#endif + +#if defined(UA_GENERATED_NAMESPACE_ZERO) && defined(UA_ENABLE_METHODCALLS) && defined(UA_ENABLE_SUBSCRIPTIONS) +static UA_StatusCode +readMonitoredItems(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *methodId, void *methodContext, const UA_NodeId *objectId, + void *objectContext, size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output) { + /* Return two empty arrays by default */ + UA_Variant_setArray(&output[0], UA_Array_new(0, &UA_TYPES[UA_TYPES_UINT32]), + 0, &UA_TYPES[UA_TYPES_UINT32]); + UA_Variant_setArray(&output[1], UA_Array_new(0, &UA_TYPES[UA_TYPES_UINT32]), + 0, &UA_TYPES[UA_TYPES_UINT32]); + + /* Get the Session */ + UA_LOCK(server->serviceMutex); + UA_Session *session = UA_Server_getSessionById(server, sessionId); + if(!session) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADINTERNALERROR; + } + if(inputSize == 0 || !input[0].data) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + } + + /* Get the Subscription */ + UA_UInt32 subscriptionId = *((UA_UInt32*)(input[0].data)); + UA_Subscription *subscription = UA_Session_getSubscriptionById(session, subscriptionId); + if(!subscription) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + } + + /* Count the MonitoredItems */ + UA_UInt32 sizeOfOutput = 0; + UA_MonitoredItem* monitoredItem; + LIST_FOREACH(monitoredItem, &subscription->monitoredItems, listEntry) { + ++sizeOfOutput; + } + if(sizeOfOutput == 0) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_GOOD; + } + + /* Allocate the output arrays */ + UA_UInt32 *clientHandles = (UA_UInt32*) + UA_Array_new(sizeOfOutput, &UA_TYPES[UA_TYPES_UINT32]); + if(!clientHandles) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + UA_UInt32 *serverHandles = (UA_UInt32*) + UA_Array_new(sizeOfOutput, &UA_TYPES[UA_TYPES_UINT32]); + if(!serverHandles) { + UA_UNLOCK(server->serviceMutex); + UA_free(clientHandles); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Fill the array */ + UA_UInt32 i = 0; + LIST_FOREACH(monitoredItem, &subscription->monitoredItems, listEntry) { + clientHandles[i] = monitoredItem->parameters.clientHandle; + serverHandles[i] = monitoredItem->monitoredItemId; + ++i; + } + UA_Variant_setArray(&output[0], serverHandles, sizeOfOutput, &UA_TYPES[UA_TYPES_UINT32]); + UA_Variant_setArray(&output[1], clientHandles, sizeOfOutput, &UA_TYPES[UA_TYPES_UINT32]); + + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_GOOD; +} +#endif /* defined(UA_ENABLE_METHODCALLS) && defined(UA_ENABLE_SUBSCRIPTIONS) */ + +UA_StatusCode +writeNs0VariableArray(UA_Server *server, UA_UInt32 id, void *v, + size_t length, const UA_DataType *type) { + UA_Variant var; + UA_Variant_init(&var); + UA_Variant_setArray(&var, v, length, type); + return UA_Server_writeValue(server, UA_NODEID_NUMERIC(0, id), var); +} + +#ifndef UA_GENERATED_NAMESPACE_ZERO +static UA_StatusCode +addVariableNode(UA_Server *server, char* name, UA_UInt32 variableid, + UA_UInt32 parentid, UA_UInt32 referenceid, + UA_Int32 valueRank, UA_UInt32 dataType) { + UA_VariableAttributes attr = UA_VariableAttributes_default; + attr.displayName = UA_LOCALIZEDTEXT("", name); + attr.dataType = UA_NODEID_NUMERIC(0, dataType); + attr.valueRank = valueRank; + attr.accessLevel = UA_ACCESSLEVELMASK_READ; + return UA_Server_addVariableNode(server, UA_NODEID_NUMERIC(0, variableid), + UA_NODEID_NUMERIC(0, parentid), UA_NODEID_NUMERIC(0, referenceid), + UA_QUALIFIEDNAME(0, name), + UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE), + attr, NULL, NULL); +} + +/* A minimal server object that is not complete and does not use the mandated + * references to a server type. To be used on very constrained devices. */ +static UA_StatusCode +UA_Server_minimalServerObject(UA_Server *server) { + /* Server */ + UA_StatusCode retval = addObjectNode(server, "Server", UA_NS0ID_SERVER, UA_NS0ID_OBJECTSFOLDER, + UA_NS0ID_ORGANIZES, UA_NS0ID_BASEOBJECTTYPE); + + /* Use a valuerank of -2 for now. The array is added later on and the valuerank set to 1. */ + retval |= addVariableNode(server, "ServerArray", UA_NS0ID_SERVER_SERVERARRAY, + UA_NS0ID_SERVER, UA_NS0ID_HASPROPERTY, + UA_VALUERANK_ANY, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "NamespaceArray", UA_NS0ID_SERVER_NAMESPACEARRAY, + UA_NS0ID_SERVER, UA_NS0ID_HASPROPERTY, + UA_VALUERANK_ANY, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "ServerStatus", UA_NS0ID_SERVER_SERVERSTATUS, + UA_NS0ID_SERVER, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "CurrentTime", UA_NS0ID_SERVER_SERVERSTATUS_CURRENTTIME, + UA_NS0ID_SERVER_SERVERSTATUS, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "State", UA_NS0ID_SERVER_SERVERSTATUS_STATE, + UA_NS0ID_SERVER_SERVERSTATUS, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "BuildInfo", UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, + UA_NS0ID_SERVER_SERVERSTATUS, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "ProductUri", UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTURI, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "ManufacturerName", + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_MANUFACTURERNAME, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "ProductName", + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTNAME, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "SoftwareVersion", + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_SOFTWAREVERSION, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "BuildNumber", + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDNUMBER, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + retval |= addVariableNode(server, "BuildDate", + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDDATE, + UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO, UA_NS0ID_HASCOMPONENT, + UA_VALUERANK_SCALAR, UA_NS0ID_BASEDATATYPE); + + return retval; +} + +#else + +static UA_StatusCode +writeNs0Variable(UA_Server *server, UA_UInt32 id, void *v, const UA_DataType *type) { + UA_Variant var; + UA_Variant_init(&var); + UA_Variant_setScalar(&var, v, type); + return UA_Server_writeValue(server, UA_NODEID_NUMERIC(0, id), var); +} + +static void +addModellingRules(UA_Server *server) { + /* Test if the ModellingRules folder was added. (Only for the full ns0.) */ + UA_NodeClass mrnc = UA_NODECLASS_UNSPECIFIED; + UA_StatusCode retval = UA_Server_readNodeClass(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + &mrnc); + if(retval != UA_STATUSCODE_GOOD) + return; + + /* Add ExposesItsArray */ + UA_Server_addReference(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_MODELLINGRULE_EXPOSESITSARRAY), + true); + + /* Add Mandatory */ + UA_Server_addReference(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_MODELLINGRULE_MANDATORY), + true); + + + /* Add MandatoryPlaceholder */ + UA_Server_addReference(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_MODELLINGRULE_MANDATORYPLACEHOLDER), + true); + + /* Add Optional */ + UA_Server_addReference(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_MODELLINGRULE_OPTIONAL), + true); + + /* Add OptionalPlaceholder */ + UA_Server_addReference(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_MODELLINGRULE_OPTIONALPLACEHOLDER), + true); +} + +#endif + +/* Initialize the nodeset 0 by using the generated code of the nodeset compiler. + * This also initialized the data sources for various variables, such as for + * example server time. */ +UA_StatusCode +UA_Server_initNS0(UA_Server *server) { + /* Initialize base nodes which are always required an cannot be created + * through the NS compiler */ + server->bootstrapNS0 = true; + UA_StatusCode retVal = UA_Server_createNS0_base(server); + +#ifdef UA_GENERATED_NAMESPACE_ZERO + /* Load nodes and references generated from the XML ns0 definition */ + retVal |= namespace0_generated(server); +#else + /* Create a minimal server object */ + retVal |= UA_Server_minimalServerObject(server); +#endif + + server->bootstrapNS0 = false; + + if(retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Initialization of Namespace 0 failed with %s. " + "See previous outputs for any error messages.", + UA_StatusCode_name(retVal)); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* NamespaceArray */ + UA_DataSource namespaceDataSource = {readNamespaces, writeNamespaces}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_NAMESPACEARRAY), + namespaceDataSource); + retVal |= UA_Server_writeValueRank(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_NAMESPACEARRAY), 1); + + /* ServerArray */ + retVal |= writeNs0VariableArray(server, UA_NS0ID_SERVER_SERVERARRAY, + &server->config.applicationDescription.applicationUri, + 1, &UA_TYPES[UA_TYPES_STRING]); + retVal |= UA_Server_writeValueRank(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERARRAY), 1); + + /* ServerStatus */ + UA_DataSource serverStatus = {readStatus, NULL}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS), serverStatus); + + /* StartTime will be sampled in UA_Server_run_startup()*/ + + /* CurrentTime */ + UA_DataSource currentTime = {readCurrentTime, NULL}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_CURRENTTIME), currentTime); + + /* State */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_STATE), + serverStatus); + + /* BuildInfo */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO), serverStatus); + + /* BuildInfo - ProductUri */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTURI), + serverStatus); + + /* BuildInfo - ManufacturerName */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_MANUFACTURERNAME), + serverStatus); + + /* BuildInfo - ProductName */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTNAME), + serverStatus); + + /* BuildInfo - SoftwareVersion */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_SOFTWAREVERSION), + serverStatus); + + /* BuildInfo - BuildNumber */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDNUMBER), + serverStatus); + + /* BuildInfo - BuildDate */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDDATE), + serverStatus); + +#ifdef UA_GENERATED_NAMESPACE_ZERO + + /* SecondsTillShutdown */ + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_SECONDSTILLSHUTDOWN), + serverStatus); + + /* ShutDownReason */ + UA_LocalizedText shutdownReason; + UA_LocalizedText_init(&shutdownReason); + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERSTATUS_SHUTDOWNREASON, + &shutdownReason, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); + + /* ServiceLevel */ + UA_DataSource serviceLevel = {readServiceLevel, NULL}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVICELEVEL), serviceLevel); + + /* ServerDiagnostics - ServerDiagnosticsSummary */ + UA_ServerDiagnosticsSummaryDataType serverDiagnosticsSummary; + UA_ServerDiagnosticsSummaryDataType_init(&serverDiagnosticsSummary); + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY, + &serverDiagnosticsSummary, + &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); + + /* ServerDiagnostics - EnabledFlag */ + UA_Boolean enabledFlag = false; + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_ENABLEDFLAG, + &enabledFlag, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* According to Specification part-5 - pg.no-11(PDF pg.no-29), when the ServerDiagnostics is disabled the client + * may modify the value of enabledFlag=true in the server. By default, this node have CurrentRead/Write access. + * In CTT, Subscription_Minimum_1/002.js test will modify the above flag. This will not be a problem when build + * configuration is set at UA_NAMESPACE_ZERO="REDUCED" as NodeIds will not be present. When UA_NAMESPACE_ZERO="FULL", + * the test will fail. Hence made the NodeId as read only */ + retVal |= UA_Server_writeAccessLevel(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_ENABLEDFLAG), + UA_ACCESSLEVELMASK_READ); + + /* Auditing */ + UA_DataSource auditing = {readAuditing, NULL}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_AUDITING), auditing); + + /* Redundancy Support */ + UA_RedundancySupport redundancySupport = UA_REDUNDANCYSUPPORT_NONE; + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERREDUNDANCY_REDUNDANCYSUPPORT, + &redundancySupport, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); + + /* Remove unused subtypes of ServerRedundancy */ + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERREDUNDANCY_CURRENTSERVERID), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERREDUNDANCY_REDUNDANTSERVERARRAY), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERREDUNDANCY_SERVERURIARRAY), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERREDUNDANCY_SERVERNETWORKGROUPS), true); + + /* ServerCapabilities - LocaleIdArray */ + UA_LocaleId locale_en = UA_STRING("en"); + retVal |= writeNs0VariableArray(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_LOCALEIDARRAY, + &locale_en, 1, &UA_TYPES[UA_TYPES_LOCALEID]); + + /* ServerCapabilities - MaxBrowseContinuationPoints */ + UA_UInt16 maxBrowseContinuationPoints = UA_MAXCONTINUATIONPOINTS; + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXBROWSECONTINUATIONPOINTS, + &maxBrowseContinuationPoints, &UA_TYPES[UA_TYPES_UINT16]); + + /* ServerProfileArray */ + UA_String profileArray[3]; + UA_UInt16 profileArraySize = 0; +#define ADDPROFILEARRAY(x) profileArray[profileArraySize++] = UA_STRING(x) + ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/MicroEmbeddedDevice"); +#ifdef UA_ENABLE_NODEMANAGEMENT + ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/NodeManagement"); +#endif +#ifdef UA_ENABLE_METHODCALLS + ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/Methods"); +#endif + retVal |= writeNs0VariableArray(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_SERVERPROFILEARRAY, + profileArray, profileArraySize, &UA_TYPES[UA_TYPES_STRING]); + + /* ServerCapabilities - MaxQueryContinuationPoints */ + UA_UInt16 maxQueryContinuationPoints = 0; + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXQUERYCONTINUATIONPOINTS, + &maxQueryContinuationPoints, &UA_TYPES[UA_TYPES_UINT16]); + + /* ServerCapabilities - MaxHistoryContinuationPoints */ + UA_UInt16 maxHistoryContinuationPoints = 0; + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXHISTORYCONTINUATIONPOINTS, + &maxHistoryContinuationPoints, &UA_TYPES[UA_TYPES_UINT16]); + + /* ServerCapabilities - MinSupportedSampleRate */ + UA_DataSource samplingInterval = {readMinSamplingInterval, NULL}; + retVal |= UA_Server_setVariableNode_dataSource(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MINSUPPORTEDSAMPLERATE), + samplingInterval); + + /* ServerCapabilities - OperationLimits - MaxNodesPerRead */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREAD, + &server->config.maxNodesPerRead, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - maxNodesPerWrite */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERWRITE, + &server->config.maxNodesPerWrite, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxNodesPerMethodCall */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERMETHODCALL, + &server->config.maxNodesPerMethodCall, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxNodesPerBrowse */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERBROWSE, + &server->config.maxNodesPerBrowse, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxNodesPerRegisterNodes */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREGISTERNODES, + &server->config.maxNodesPerRegisterNodes, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxNodesPerTranslateBrowsePathsToNodeIds */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERTRANSLATEBROWSEPATHSTONODEIDS, + &server->config.maxNodesPerTranslateBrowsePathsToNodeIds, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxNodesPerNodeManagement */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERNODEMANAGEMENT, + &server->config.maxNodesPerNodeManagement, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - OperationLimits - MaxMonitoredItemsPerCall */ + retVal |= writeNs0Variable(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXMONITOREDITEMSPERCALL, + &server->config.maxMonitoredItemsPerCall, &UA_TYPES[UA_TYPES_UINT32]); + +#ifdef UA_ENABLE_MICRO_EMB_DEV_PROFILE + /* Remove unused operation limit components */ + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADDATA), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADEVENTS), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEDATA), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEEVENTS), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXSTRINGLENGTH), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXARRAYLENGTH), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXBYTESTRINGLENGTH), true); + + /* Remove not supported Server Instance */ + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_DICTIONARIES), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_ESTIMATEDRETURNTIME), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_LOCALTIME), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_NAMESPACES), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_REQUESTSERVERSTATECHANGE), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_RESENDDATA), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVERCONFIGURATION), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SETSUBSCRIPTIONDURABLE), true); + + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SAMPLINGINTERVALDIAGNOSTICSARRAY), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY), true); + + /* Removing these NodeIds make Server Object to be non-complaint with UA 1.03 in CTT (Base Inforamtion/Base Info Core Structure/ 001.js) + * In the 1.04 specification this has been resolved by allowing to remove these static nodes as well */ + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY), true); + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SUBSCRIPTIONDIAGNOSTICSARRAY), true); +#endif + +#ifndef UA_ENABLE_HISTORIZING + UA_Server_deleteNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_HISTORYSERVERCAPABILITIES), true); +#else + /* ServerCapabilities - HistoryServerCapabilities - AccessHistoryDataCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_ACCESSHISTORYDATACAPABILITY, + &server->config.accessHistoryDataCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - MaxReturnDataValues */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_MAXRETURNDATAVALUES, + &server->config.maxReturnDataValues, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - HistoryServerCapabilities - AccessHistoryEventsCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_ACCESSHISTORYEVENTSCAPABILITY, + &server->config.accessHistoryEventsCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - MaxReturnEventValues */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_MAXRETURNEVENTVALUES, + &server->config.maxReturnEventValues, &UA_TYPES[UA_TYPES_UINT32]); + + /* ServerCapabilities - HistoryServerCapabilities - InsertDataCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTDATACAPABILITY, + &server->config.insertDataCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - InsertEventCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTEVENTCAPABILITY, + &server->config.insertEventCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - InsertAnnotationsCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTANNOTATIONCAPABILITY, + &server->config.insertAnnotationsCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - ReplaceDataCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_REPLACEDATACAPABILITY, + &server->config.replaceDataCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - ReplaceEventCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_REPLACEEVENTCAPABILITY, + &server->config.replaceEventCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - UpdateDataCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_UPDATEDATACAPABILITY, + &server->config.updateDataCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - UpdateEventCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_UPDATEEVENTCAPABILITY, + &server->config.updateEventCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - DeleteRawCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETERAWCAPABILITY, + &server->config.deleteRawCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - DeleteEventCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETEEVENTCAPABILITY, + &server->config.deleteEventCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); + + /* ServerCapabilities - HistoryServerCapabilities - DeleteAtTimeDataCapability */ + retVal |= writeNs0Variable(server, UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETEATTIMECAPABILITY, + &server->config.deleteAtTimeDataCapability, &UA_TYPES[UA_TYPES_BOOLEAN]); +#endif + +#if defined(UA_ENABLE_METHODCALLS) && defined(UA_ENABLE_SUBSCRIPTIONS) + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_GETMONITOREDITEMS), readMonitoredItems); +#endif + + /* The HasComponent references to the ModellingRules are not part of the + * Nodeset2.xml. So we add the references manually. */ + addModellingRules(server); + +#endif /* UA_GENERATED_NAMESPACE_ZERO */ + + /* create the OverFlowEventType + * The EventQueueOverflowEventType is defined as abstract, therefore we can not create an instance of that type + * directly, but need to create a subtype. This is already posted on the OPC Foundation bug tracker under the + * following link for clarification: https://opcfoundation-onlineapplications.org/mantis/view.php?id=4206 */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_ObjectTypeAttributes overflowAttr = UA_ObjectTypeAttributes_default; + overflowAttr.description = UA_LOCALIZEDTEXT("en-US", "A simple event for indicating a queue overflow."); + overflowAttr.displayName = UA_LOCALIZEDTEXT("en-US", "SimpleOverflowEventType"); + retVal |= UA_Server_addObjectTypeNode(server, UA_NODEID_NUMERIC(0, UA_NS0ID_SIMPLEOVERFLOWEVENTTYPE), + UA_NODEID_NUMERIC(0, UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE), + UA_QUALIFIEDNAME(0, "SimpleOverflowEventType"), + overflowAttr, NULL, NULL); +#endif + + if(retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Initialization of Namespace 0 (after bootstrapping) " + "failed with %s. See previous outputs for any error messages.", + UA_StatusCode_name(retVal)); + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_config.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + +void +UA_ServerConfig_clean(UA_ServerConfig *config) { + if(!config) + return; + + /* Server Description */ + UA_BuildInfo_clear(&config->buildInfo); + UA_ApplicationDescription_clear(&config->applicationDescription); +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + UA_MdnsDiscoveryConfiguration_clear(&config->mdnsConfig); + UA_String_clear(&config->mdnsInterfaceIP); +# if !defined(UA_HAS_GETIFADDR) + if (config->mdnsIpAddressListSize) { + UA_free(config->mdnsIpAddressList); + } +# endif +#endif + + /* Custom DataTypes */ + /* nothing to do */ + + /* Networking */ + for(size_t i = 0; i < config->networkLayersSize; ++i) + config->networkLayers[i].clear(&config->networkLayers[i]); + UA_free(config->networkLayers); + config->networkLayers = NULL; + config->networkLayersSize = 0; + UA_String_clear(&config->customHostname); + config->customHostname = UA_STRING_NULL; + + for(size_t i = 0; i < config->securityPoliciesSize; ++i) { + UA_SecurityPolicy *policy = &config->securityPolicies[i]; + policy->clear(policy); + } + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + config->securityPoliciesSize = 0; + + for(size_t i = 0; i < config->endpointsSize; ++i) + UA_EndpointDescription_clear(&config->endpoints[i]); + + UA_free(config->endpoints); + config->endpoints = NULL; + config->endpointsSize = 0; + + /* Nodestore */ + if(config->nodestore.context && config->nodestore.clear) { + config->nodestore.clear(config->nodestore.context); + config->nodestore.context = NULL; + } + + /* Certificate Validation */ + if(config->certificateVerification.clear) + config->certificateVerification.clear(&config->certificateVerification); + + /* Access Control */ + if(config->accessControl.clear) + config->accessControl.clear(&config->accessControl); + + /* Historical data */ +#ifdef UA_ENABLE_HISTORIZING + if(config->historyDatabase.clear) + config->historyDatabase.clear(&config->historyDatabase); +#endif + + /* Logger */ + if(config->logger.clear) + config->logger.clear(config->logger.context); + config->logger.log = NULL; + config->logger.clear = NULL; + +#ifdef UA_ENABLE_PUBSUB + /* PubSub configuration */ + if (config->pubsubConfiguration != NULL) { + UA_free(config->pubsubConfiguration); + config->pubsubConfiguration = 0; + } +#endif /* UA_ENABLE_PUBSUB */ +} + +#ifdef UA_ENABLE_PUBSUB +/* Add a pubsubTransportLayer to the configuration. Memory is reallocated on + * demand. */ +UA_StatusCode +UA_ServerConfig_addPubSubTransportLayer(UA_ServerConfig *config, + UA_PubSubTransportLayer *pubsubTransportLayer) { + + if(config->pubsubTransportLayersSize == 0) { + config->pubsubTransportLayers = (UA_PubSubTransportLayer *) + UA_malloc(sizeof(UA_PubSubTransportLayer)); + } else { + config->pubsubTransportLayers = (UA_PubSubTransportLayer*) + UA_realloc(config->pubsubTransportLayers, + sizeof(UA_PubSubTransportLayer) * (config->pubsubTransportLayersSize + 1)); + } + + if(config->pubsubTransportLayers == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + + memcpy(&config->pubsubTransportLayers[config->pubsubTransportLayersSize], + pubsubTransportLayer, sizeof(UA_PubSubTransportLayer)); + config->pubsubTransportLayersSize++; + + return UA_STATUSCODE_GOOD; +} +#endif /* UA_ENABLE_PUBSUB */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_binary.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2016 (c) Sten Grüner + * Copyright 2014-2015, 2017 (c) Florian Palm + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2016 (c) Joakim L. Gilje + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) TorbenD + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +// store the authentication token and session ID so we can help fuzzing by setting +// these values in the next request automatically +UA_NodeId unsafe_fuzz_authenticationToken = {0, UA_NODEIDTYPE_NUMERIC, {0}}; +#endif + +#ifdef UA_DEBUG_DUMP_PKGS_FILE +void UA_debug_dumpCompleteChunk(UA_Server *const server, UA_Connection *const connection, + UA_ByteString *messageBuffer); +#endif + +/********************/ +/* Helper Functions */ +/********************/ + +UA_StatusCode +sendServiceFault(UA_SecureChannel *channel, UA_UInt32 requestId, UA_UInt32 requestHandle, + const UA_DataType *responseType, UA_StatusCode statusCode) { + UA_Response response; + UA_init(&response, responseType); + UA_ResponseHeader *responseHeader = &response.responseHeader; + responseHeader->requestHandle = requestHandle; + responseHeader->timestamp = UA_DateTime_now(); + responseHeader->serviceResult = statusCode; + + UA_LOG_DEBUG(channel->securityPolicy->logger, UA_LOGCATEGORY_SERVER, + "Sending response for RequestId %u with ServiceResult %s", + (unsigned)requestId, UA_StatusCode_name(statusCode)); + + /* Send error message. Message type is MSG and not ERR, since we are on a + * SecureChannel! */ + return UA_SecureChannel_sendSymmetricMessage(channel, requestId, UA_MESSAGETYPE_MSG, + &response, responseType); +} + + /* This is not an ERR message, the connection is not closed afterwards */ +static UA_StatusCode +decodeHeaderSendServiceFault(UA_SecureChannel *channel, const UA_ByteString *msg, + size_t offset, const UA_DataType *responseType, + UA_UInt32 requestId, UA_StatusCode error) { + UA_RequestHeader requestHeader; + UA_StatusCode retval = UA_RequestHeader_decodeBinary(msg, &offset, &requestHeader); + if(retval != UA_STATUSCODE_GOOD) + return retval; + retval = sendServiceFault(channel, requestId, requestHeader.requestHandle, + responseType, error); + UA_RequestHeader_clear(&requestHeader); + return retval; +} + +static void +getServicePointers(UA_UInt32 requestTypeId, const UA_DataType **requestType, + const UA_DataType **responseType, UA_Service *service, + UA_Boolean *requiresSession) { + switch(requestTypeId) { + case UA_NS0ID_GETENDPOINTSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_GetEndpoints; + *requestType = &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]; + *requiresSession = false; + break; + case UA_NS0ID_FINDSERVERSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_FindServers; + *requestType = &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]; + *requiresSession = false; + break; +#ifdef UA_ENABLE_DISCOVERY +# ifdef UA_ENABLE_DISCOVERY_MULTICAST + case UA_NS0ID_FINDSERVERSONNETWORKREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_FindServersOnNetwork; + *requestType = &UA_TYPES[UA_TYPES_FINDSERVERSONNETWORKREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_FINDSERVERSONNETWORKRESPONSE]; + *requiresSession = false; + break; +# endif + case UA_NS0ID_REGISTERSERVERREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_RegisterServer; + *requestType = &UA_TYPES[UA_TYPES_REGISTERSERVERREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_REGISTERSERVERRESPONSE]; + *requiresSession = false; + break; + case UA_NS0ID_REGISTERSERVER2REQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_RegisterServer2; + *requestType = &UA_TYPES[UA_TYPES_REGISTERSERVER2REQUEST]; + *responseType = &UA_TYPES[UA_TYPES_REGISTERSERVER2RESPONSE]; + *requiresSession = false; + break; +#endif + case UA_NS0ID_CREATESESSIONREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)(uintptr_t)Service_CreateSession; + *requestType = &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]; + *requiresSession = false; + break; + case UA_NS0ID_ACTIVATESESSIONREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)(uintptr_t)Service_ActivateSession; + *requestType = &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]; + break; + case UA_NS0ID_CLOSESESSIONREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)(uintptr_t)Service_CloseSession; + *requestType = &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]; + break; + case UA_NS0ID_READREQUEST_ENCODING_DEFAULTBINARY: + *service = NULL; + *service = (UA_Service)Service_Read; + *requestType = &UA_TYPES[UA_TYPES_READREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_READRESPONSE]; + break; + case UA_NS0ID_WRITEREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_Write; + *requestType = &UA_TYPES[UA_TYPES_WRITEREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_WRITERESPONSE]; + break; + case UA_NS0ID_BROWSEREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_Browse; + *requestType = &UA_TYPES[UA_TYPES_BROWSEREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_BROWSERESPONSE]; + break; + case UA_NS0ID_BROWSENEXTREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_BrowseNext; + *requestType = &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]; + break; + case UA_NS0ID_REGISTERNODESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_RegisterNodes; + *requestType = &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]; + break; + case UA_NS0ID_UNREGISTERNODESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_UnregisterNodes; + *requestType = &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]; + break; + case UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_TranslateBrowsePathsToNodeIds; + *requestType = &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]; + break; + +#ifdef UA_ENABLE_SUBSCRIPTIONS + case UA_NS0ID_CREATESUBSCRIPTIONREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_CreateSubscription; + *requestType = &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]; + break; + case UA_NS0ID_PUBLISHREQUEST_ENCODING_DEFAULTBINARY: + *requestType = &UA_TYPES[UA_TYPES_PUBLISHREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]; + break; + case UA_NS0ID_REPUBLISHREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_Republish; + *requestType = &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]; + break; + case UA_NS0ID_MODIFYSUBSCRIPTIONREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_ModifySubscription; + *requestType = &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]; + break; + case UA_NS0ID_SETPUBLISHINGMODEREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_SetPublishingMode; + *requestType = &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]; + break; + case UA_NS0ID_DELETESUBSCRIPTIONSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_DeleteSubscriptions; + *requestType = &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]; + break; + case UA_NS0ID_TRANSFERSUBSCRIPTIONSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_TransferSubscriptions; + *requestType = &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]; + break; + case UA_NS0ID_CREATEMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_CreateMonitoredItems; + *requestType = &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]; + break; + case UA_NS0ID_DELETEMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_DeleteMonitoredItems; + *requestType = &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]; + break; + case UA_NS0ID_MODIFYMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_ModifyMonitoredItems; + *requestType = &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]; + break; + case UA_NS0ID_SETMONITORINGMODEREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_SetMonitoringMode; + *requestType = &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]; + break; + case UA_NS0ID_SETTRIGGERINGREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_SetTriggering; + *requestType = &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]; + break; +#endif +#ifdef UA_ENABLE_HISTORIZING + /* For History read */ + case UA_NS0ID_HISTORYREADREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_HistoryRead; + *requestType = &UA_TYPES[UA_TYPES_HISTORYREADREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_HISTORYREADRESPONSE]; + break; + /* For History update */ + case UA_NS0ID_HISTORYUPDATEREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_HistoryUpdate; + *requestType = &UA_TYPES[UA_TYPES_HISTORYUPDATEREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_HISTORYUPDATERESPONSE]; + break; +#endif + +#ifdef UA_ENABLE_METHODCALLS + case UA_NS0ID_CALLREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_Call; + *requestType = &UA_TYPES[UA_TYPES_CALLREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_CALLRESPONSE]; + break; +#endif + +#ifdef UA_ENABLE_NODEMANAGEMENT + case UA_NS0ID_ADDNODESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_AddNodes; + *requestType = &UA_TYPES[UA_TYPES_ADDNODESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]; + break; + case UA_NS0ID_ADDREFERENCESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_AddReferences; + *requestType = &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]; + break; + case UA_NS0ID_DELETENODESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_DeleteNodes; + *requestType = &UA_TYPES[UA_TYPES_DELETENODESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]; + break; + case UA_NS0ID_DELETEREFERENCESREQUEST_ENCODING_DEFAULTBINARY: + *service = (UA_Service)Service_DeleteReferences; + *requestType = &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]; + *responseType = &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]; + break; +#endif + + default: + break; + } +} + +/*************************/ +/* Process Message Types */ +/*************************/ + +/* HEL -> Open up the connection */ +static UA_StatusCode +processHEL(UA_Server *server, UA_SecureChannel *channel, const UA_ByteString *msg) { + if(channel->state != UA_SECURECHANNELSTATE_FRESH) + return UA_STATUSCODE_BADINTERNALERROR; + size_t offset = 0; /* Go to the beginning of the TcpHelloMessage */ + UA_TcpHelloMessage helloMessage; + UA_StatusCode retval = UA_TcpHelloMessage_decodeBinary(msg, &offset, &helloMessage); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Currently not checked */ + UA_String_clear(&helloMessage.endpointUrl); + + /* Parameterize the connection. The TcpHelloMessage casts to a + * TcpAcknowledgeMessage. */ + retval = UA_SecureChannel_processHELACK(channel, + (UA_TcpAcknowledgeMessage*)&helloMessage); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Error during the HEL/ACK handshake", + (int)(channel->connection->sockfd)); + return retval; + } + + /* Get the send buffer from the network layer */ + UA_Connection *connection = channel->connection; + UA_ByteString ack_msg; + UA_ByteString_init(&ack_msg); + retval = connection->getSendBuffer(connection, channel->config.sendBufferSize, &ack_msg); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Build acknowledge response */ + UA_TcpAcknowledgeMessage ackMessage; + ackMessage.protocolVersion = 0; + ackMessage.receiveBufferSize = channel->config.recvBufferSize; + ackMessage.sendBufferSize = channel->config.sendBufferSize; + ackMessage.maxMessageSize = channel->config.localMaxMessageSize; + ackMessage.maxChunkCount = channel->config.localMaxChunkCount; + + UA_TcpMessageHeader ackHeader; + ackHeader.messageTypeAndChunkType = UA_MESSAGETYPE_ACK + UA_CHUNKTYPE_FINAL; + ackHeader.messageSize = 8 + 20; /* ackHeader + ackMessage */ + + /* Encode and send the response */ + UA_Byte *bufPos = ack_msg.data; + const UA_Byte *bufEnd = &ack_msg.data[ack_msg.length]; + retval |= UA_TcpMessageHeader_encodeBinary(&ackHeader, &bufPos, bufEnd); + retval |= UA_TcpAcknowledgeMessage_encodeBinary(&ackMessage, &bufPos, bufEnd); + if(retval != UA_STATUSCODE_GOOD) { + connection->releaseSendBuffer(connection, &ack_msg); + return retval; + } + + ack_msg.length = ackHeader.messageSize; + retval = connection->send(connection, &ack_msg); + if(retval == UA_STATUSCODE_GOOD) + channel->state = UA_SECURECHANNELSTATE_ACK_SENT; + return retval; +} + +/* OPN -> Open up/renew the securechannel */ +static UA_StatusCode +processOPN(UA_Server *server, UA_SecureChannel *channel, + const UA_UInt32 requestId, const UA_ByteString *msg) { + if(channel->state != UA_SECURECHANNELSTATE_ACK_SENT && channel->state != UA_SECURECHANNELSTATE_OPEN) + return UA_STATUSCODE_BADINTERNALERROR; + /* Decode the request */ + UA_NodeId requestType; + UA_OpenSecureChannelRequest openSecureChannelRequest; + size_t offset = 0; + UA_StatusCode retval = UA_NodeId_decodeBinary(msg, &offset, &requestType); + + if(retval != UA_STATUSCODE_GOOD) { + UA_NodeId_clear(&requestType); + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "Could not decode the NodeId. Closing the connection"); + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_REJECT); + return retval; + } + retval = UA_OpenSecureChannelRequest_decodeBinary(msg, &offset, &openSecureChannelRequest); + + /* Error occurred */ + if(retval != UA_STATUSCODE_GOOD || + !UA_NodeId_equal(&requestType, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST].binaryEncodingId)) { + UA_NodeId_clear(&requestType); + UA_OpenSecureChannelRequest_clear(&openSecureChannelRequest); + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "Could not decode the OPN message. Closing the connection."); + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_REJECT); + return retval; + } + UA_NodeId_clear(&requestType); + + /* Call the service */ + UA_OpenSecureChannelResponse openScResponse; + UA_OpenSecureChannelResponse_init(&openScResponse); + Service_OpenSecureChannel(server, channel, &openSecureChannelRequest, &openScResponse); + UA_OpenSecureChannelRequest_clear(&openSecureChannelRequest); + if(openScResponse.responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, "Could not open a SecureChannel. " + "Closing the connection."); + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_REJECT); + return openScResponse.responseHeader.serviceResult; + } + + /* Send the response */ + retval = UA_SecureChannel_sendAsymmetricOPNMessage(channel, requestId, &openScResponse, + &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); + UA_OpenSecureChannelResponse_clear(&openScResponse); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "Could not send the OPN answer with error code %s", + UA_StatusCode_name(retval)); + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_REJECT); + } + + return retval; +} + +/* The responseHeader must have the requestHandle already set */ +UA_StatusCode +sendResponse(UA_Server *server, UA_Session *session, UA_SecureChannel *channel, + UA_UInt32 requestId, UA_Response *response, const UA_DataType *responseType) { + if(!channel) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Prepare the ResponseHeader */ + response->responseHeader.timestamp = UA_DateTime_now(); + + if(session) { +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Sending response for RequestId %u of type %s", + (unsigned)requestId, responseType->typeName); +#else + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Sending reponse for RequestId %u of type %" PRIi16, + (unsigned)requestId, responseType->binaryEncodingId.identifier.numeric); +#endif + } else { +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_DEBUG_CHANNEL(&server->config.logger, channel, + "Sending response for RequestId %u of type %s", + (unsigned)requestId, responseType->typeName); +#else + UA_LOG_DEBUG_CHANNEL(&server->config.logger, channel, + "Sending reponse for RequestId %u of type %" PRIi16, + (unsigned)requestId, responseType->binaryEncodingId.identifier.numeric); +#endif + } + + /* Start the message context */ + UA_MessageContext mc; + UA_StatusCode retval = UA_MessageContext_begin(&mc, channel, requestId, UA_MESSAGETYPE_MSG); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Assert's required for clang-analyzer */ + UA_assert(mc.buf_pos == &mc.messageBuffer.data[UA_SECURE_MESSAGE_HEADER_LENGTH]); + UA_assert(mc.buf_end <= &mc.messageBuffer.data[mc.messageBuffer.length]); + + /* Encode the response type */ + retval = UA_MessageContext_encode(&mc, &responseType->binaryEncodingId, + &UA_TYPES[UA_TYPES_NODEID]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Encode the response */ + retval = UA_MessageContext_encode(&mc, response, responseType); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Finish / send out */ + return UA_MessageContext_finish(&mc); +} + +/* A Session is "bound" to a SecureChannel if it was created by the + * SecureChannel or if it was activated on it. A Session can only be bound to + * one SecureChannel. A Session can only be closed from the SecureChannel to + * which it is bound. + * + * Returns Good if the AuthenticationToken exists nowhere (for CTT). */ +UA_StatusCode +getBoundSession(UA_Server *server, const UA_SecureChannel *channel, + const UA_NodeId *token, UA_Session **session) { + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_SessionHeader *sh; + SLIST_FOREACH(sh, &channel->sessions, next) { + if(!UA_NodeId_equal(token, &sh->authenticationToken)) + continue; + UA_Session *current = (UA_Session*)sh; + /* Has the session timed out? */ + if(current->validTill < now) + return UA_STATUSCODE_BADSESSIONCLOSED; + *session = current; + return UA_STATUSCODE_GOOD; + } + + /* Session exists on another SecureChannel. The CTT expect this error. */ + if(getSessionByToken(server, token)) + return UA_STATUSCODE_BADSECURECHANNELIDINVALID; + + return UA_STATUSCODE_GOOD; +} + +static const UA_String securityPolicyNone = + UA_STRING_STATIC("http://opcfoundation.org/UA/SecurityPolicy#None"); + +static UA_StatusCode +processMSGDecoded(UA_Server *server, UA_SecureChannel *channel, UA_UInt32 requestId, + UA_Service service, const UA_Request *request, + const UA_DataType *requestType, UA_Response *response, + const UA_DataType *responseType, UA_Boolean sessionRequired) { + const UA_RequestHeader *requestHeader = &request->requestHeader; + + /* If it is an unencrypted (#None) channel, only allow the discovery services */ + if(server->config.securityPolicyNoneDiscoveryOnly && + UA_String_equal(&channel->securityPolicy->policyUri, &securityPolicyNone ) && + requestType != &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST] && + requestType != &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST] +#if defined(UA_ENABLE_DISCOVERY) && defined(UA_ENABLE_DISCOVERY_MULTICAST) + && requestType != &UA_TYPES[UA_TYPES_FINDSERVERSONNETWORKREQUEST] +#endif + ) { + return sendServiceFault(channel, requestId, requestHeader->requestHandle, + responseType, UA_STATUSCODE_BADSECURITYPOLICYREJECTED); + } + + /* Session lifecycle services. */ + if(requestType == &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST] || + requestType == &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST] || + requestType == &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]) { + UA_LOCK(server->serviceMutex); + ((UA_ChannelService)(uintptr_t)service)(server, channel, request, response); + UA_UNLOCK(server->serviceMutex); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Store the authentication token so we can help fuzzing by setting + * these values in the next request automatically */ + if(requestType == &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]) { + UA_CreateSessionResponse *res = &response->createSessionResponse; + UA_NodeId_copy(&res->authenticationToken, &unsafe_fuzz_authenticationToken); + } +#endif + return sendResponse(server, NULL, channel, requestId, response, responseType); + } + + /* Get the Session bound to the SecureChannel (not necessarily activated) */ + UA_Session *session = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(!UA_NodeId_isNull(&requestHeader->authenticationToken)) { + UA_LOCK(server->serviceMutex); + retval = getBoundSession(server, channel, &requestHeader->authenticationToken, &session); + UA_UNLOCK(server->serviceMutex); + if(retval != UA_STATUSCODE_GOOD) + return sendServiceFault(channel, requestId, requestHeader->requestHandle, + responseType, retval); + } + + /* Set an anonymous, inactive session for services that need no session */ + UA_Session anonymousSession; + if(!session) { + if(sessionRequired) { +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "%s refused without a valid session", + requestType->typeName); +#else + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "Service %" PRIi16 " refused without a valid session", + requestType->binaryEncodingId.identifier.numeric); +#endif + return sendServiceFault(channel, requestId, requestHeader->requestHandle, + responseType, UA_STATUSCODE_BADSESSIONIDINVALID); + } + + UA_Session_init(&anonymousSession); + anonymousSession.sessionId = UA_NODEID_GUID(0, UA_GUID_NULL); + anonymousSession.header.channel = channel; + session = &anonymousSession; + } + + UA_assert(session != NULL); + + /* Trying to use a non-activated session? */ + if(sessionRequired && !session->activated) { +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "%s refused on a non-activated session", + requestType->typeName); +#else + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "Service %" PRIi16 " refused on a non-activated session", + requestType->binaryEncodingId.identifier.numeric); +#endif + if(session != &anonymousSession) { + UA_LOCK(server->serviceMutex); + UA_Server_removeSessionByToken(server, &session->header.authenticationToken, + UA_DIAGNOSTICEVENT_ABORT); + UA_UNLOCK(server->serviceMutex); + } + return sendServiceFault(channel, requestId, requestHeader->requestHandle, + responseType, UA_STATUSCODE_BADSESSIONNOTACTIVATED); + } + + /* Update the session lifetime */ + UA_Session_updateLifetime(session); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* The publish request is not answered immediately */ + if(requestType == &UA_TYPES[UA_TYPES_PUBLISHREQUEST]) { + UA_LOCK(server->serviceMutex); + Service_Publish(server, session, &request->publishRequest, requestId); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_GOOD; + } +#endif + +#if UA_MULTITHREADING >= 100 + /* The call request might not be answered immediately */ + if(requestType == &UA_TYPES[UA_TYPES_CALLREQUEST]) { + UA_Boolean finished = true; + UA_LOCK(server->serviceMutex); + Service_CallAsync(server, session, requestId, &request->callRequest, + &response->callResponse, &finished); + UA_UNLOCK(server->serviceMutex); + + /* Async method calls remain. Don't send a response now */ + if(!finished) + return UA_STATUSCODE_GOOD; + + /* We are done here */ + return sendResponse(server, session, channel, requestId, response, responseType); + } +#endif + + /* Dispatch the synchronous service call and send the response */ + UA_LOCK(server->serviceMutex); + service(server, session, request, response); + UA_UNLOCK(server->serviceMutex); + return sendResponse(server, session, channel, requestId, response, responseType); +} + +static UA_StatusCode +processMSG(UA_Server *server, UA_SecureChannel *channel, + UA_UInt32 requestId, const UA_ByteString *msg) { + if(channel->state != UA_SECURECHANNELSTATE_OPEN) + return UA_STATUSCODE_BADINTERNALERROR; + /* Decode the nodeid */ + size_t offset = 0; + UA_NodeId requestTypeId; + UA_StatusCode retval = UA_NodeId_decodeBinary(msg, &offset, &requestTypeId); + if(retval != UA_STATUSCODE_GOOD) + return retval; + if(requestTypeId.namespaceIndex != 0 || + requestTypeId.identifierType != UA_NODEIDTYPE_NUMERIC) + UA_NodeId_clear(&requestTypeId); /* leads to badserviceunsupported */ + + size_t requestPos = offset; /* Store the offset (for sendServiceFault) */ + + /* Get the service pointers */ + UA_Service service = NULL; + UA_Boolean sessionRequired = true; + const UA_DataType *requestType = NULL; + const UA_DataType *responseType = NULL; + getServicePointers(requestTypeId.identifier.numeric, &requestType, + &responseType, &service, &sessionRequired); + if(!requestType) { + if(requestTypeId.identifier.numeric == 787) { + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Client requested a subscription, " \ + "but those are not enabled in the build"); + } else { + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Unknown request with type identifier %" PRIi32, + requestTypeId.identifier.numeric); + } + return decodeHeaderSendServiceFault(channel, msg, requestPos, + &UA_TYPES[UA_TYPES_SERVICEFAULT], + requestId, UA_STATUSCODE_BADSERVICEUNSUPPORTED); + } + UA_assert(responseType); + + /* Decode the request */ + UA_Request request; + retval = UA_decodeBinary(msg, &offset, &request, requestType, server->config.customDataTypes); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG_CHANNEL(&server->config.logger, channel, + "Could not decode the request with StatusCode %s", + UA_StatusCode_name(retval)); + return decodeHeaderSendServiceFault(channel, msg, requestPos, + responseType, requestId, retval); + } + + /* Check timestamp in the request header */ + UA_RequestHeader *requestHeader = &request.requestHeader; + if(requestHeader->timestamp == 0) { + if(server->config.verifyRequestTimestamp <= UA_RULEHANDLING_WARN) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "The server sends no timestamp in the request header. " + "See the 'verifyRequestTimestamp' setting."); + if(server->config.verifyRequestTimestamp <= UA_RULEHANDLING_ABORT) { + retval = sendServiceFault(channel, requestId, requestHeader->requestHandle, + responseType, UA_STATUSCODE_BADINVALIDTIMESTAMP); + UA_clear(&request, requestType); + return retval; + } + } + } + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Set the authenticationToken from the create session request to help + * fuzzing cover more lines */ + if(!UA_NodeId_isNull(&unsafe_fuzz_authenticationToken) && + !UA_NodeId_isNull(&requestHeader->authenticationToken)) { + UA_NodeId_clear(&requestHeader->authenticationToken); + UA_NodeId_copy(&unsafe_fuzz_authenticationToken, &requestHeader->authenticationToken); + } +#endif + + /* Prepare the respone and process the request */ + UA_Response response; + UA_init(&response, responseType); + response.responseHeader.requestHandle = requestHeader->requestHandle; + retval = processMSGDecoded(server, channel, requestId, service, &request, requestType, + &response, responseType, sessionRequired); + + /* Clean up */ + UA_clear(&request, requestType); + UA_clear(&response, responseType); + return retval; +} + +/* Takes decoded messages starting at the nodeid of the content type. */ +static UA_StatusCode +processSecureChannelMessage(void *application, UA_SecureChannel *channel, + UA_MessageType messagetype, UA_UInt32 requestId, + UA_ByteString *message) { + UA_Server *server = (UA_Server*)application; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + switch(messagetype) { + case UA_MESSAGETYPE_HEL: + UA_LOG_TRACE_CHANNEL(&server->config.logger, channel, "Process a HEL message"); + retval = processHEL(server, channel, message); + break; + case UA_MESSAGETYPE_OPN: + UA_LOG_TRACE_CHANNEL(&server->config.logger, channel, "Process an OPN message"); + retval = processOPN(server, channel, requestId, message); + break; + case UA_MESSAGETYPE_MSG: + UA_LOG_TRACE_CHANNEL(&server->config.logger, channel, "Process a MSG"); + retval = processMSG(server, channel, requestId, message); + break; + case UA_MESSAGETYPE_CLO: + UA_LOG_TRACE_CHANNEL(&server->config.logger, channel, "Process a CLO"); + Service_CloseSecureChannel(server, channel); /* Regular close */ + break; + default: + UA_LOG_TRACE_CHANNEL(&server->config.logger, channel, "Invalid message type"); + retval = UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + break; + } + if(retval != UA_STATUSCODE_GOOD) { + if(!channel->connection) { + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Processing the message failed. Channel already closed " + "with StatusCode %s. ", UA_StatusCode_name(retval)); + return retval; + } + + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Processing the message failed with StatusCode %s. " + "Closing the channel.", UA_StatusCode_name(retval)); + UA_TcpErrorMessage errMsg; + UA_TcpErrorMessage_init(&errMsg); + errMsg.error = retval; + UA_Connection_sendError(channel->connection, &errMsg); + switch(retval) { + case UA_STATUSCODE_BADSECURITYMODEREJECTED: + case UA_STATUSCODE_BADSECURITYCHECKSFAILED: + case UA_STATUSCODE_BADSECURECHANNELIDINVALID: + case UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN: + case UA_STATUSCODE_BADSECURITYPOLICYREJECTED: + case UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED: + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_SECURITYREJECT); + break; + default: + UA_Server_closeSecureChannel(server, channel, UA_DIAGNOSTICEVENT_CLOSE); + break; + } + } + + return retval; +} + +void +UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, + UA_ByteString *message) { + UA_LOG_TRACE(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Received a packet.", (int)(connection->sockfd)); + + UA_TcpErrorMessage error; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_SecureChannel *channel = connection->channel; + + /* Add a SecureChannel to a new connection */ + if(!channel) { + retval = UA_Server_createSecureChannel(server, connection); + if(retval != UA_STATUSCODE_GOOD) + goto error; + channel = connection->channel; + UA_assert(channel); + } + +#ifdef UA_DEBUG_DUMP_PKGS + UA_dump_hex_pkg(message->data, message->length); +#endif +#ifdef UA_DEBUG_DUMP_PKGS_FILE + UA_debug_dumpCompleteChunk(server, channel->connection, message); +#endif + + retval = UA_SecureChannel_processBuffer(channel, server, processSecureChannelMessage, message); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Processing the message failed with error %s", + (int)(connection->sockfd), UA_StatusCode_name(retval)); + goto error; + } + + return; + + error: + /* Send an ERR message and close the connection */ + error.error = retval; + error.reason = UA_STRING_NULL; + UA_Connection_sendError(connection, &error); + connection->close(connection); +} + +void +UA_Server_removeConnection(UA_Server *server, UA_Connection *connection) { + UA_Connection_detachSecureChannel(connection); + connection->free(connection); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_utils.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Florian Palm + * Copyright 2017-2018 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Julian Grothoff + */ + + +const UA_DataType * +UA_Server_findDataType(UA_Server *server, const UA_NodeId *typeId) { + return UA_findDataTypeWithCustom(typeId, server->config.customDataTypes); +} + +/********************************/ +/* Information Model Operations */ +/********************************/ + +const UA_Node * +getNodeType(UA_Server *server, const UA_NodeHead *head) { + /* The reference to the parent is different for variable and variabletype */ + UA_Byte parentRefIndex; + UA_Boolean inverse; + UA_NodeClass typeNodeClass; + switch(head->nodeClass) { + case UA_NODECLASS_OBJECT: + parentRefIndex = UA_REFERENCETYPEINDEX_HASTYPEDEFINITION; + inverse = false; + typeNodeClass = UA_NODECLASS_OBJECTTYPE; + break; + case UA_NODECLASS_VARIABLE: + parentRefIndex = UA_REFERENCETYPEINDEX_HASTYPEDEFINITION; + inverse = false; + typeNodeClass = UA_NODECLASS_VARIABLETYPE; + break; + case UA_NODECLASS_OBJECTTYPE: + case UA_NODECLASS_VARIABLETYPE: + case UA_NODECLASS_REFERENCETYPE: + case UA_NODECLASS_DATATYPE: + parentRefIndex = UA_REFERENCETYPEINDEX_HASSUBTYPE; + inverse = true; + typeNodeClass = head->nodeClass; + break; + default: + return NULL; + } + + /* Return the first matching candidate */ + for(size_t i = 0; i < head->referencesSize; ++i) { + if(head->references[i].isInverse != inverse) + continue; + if(head->references[i].referenceTypeIndex != parentRefIndex) + continue; + UA_assert(!TAILQ_EMPTY(&head->references[i].queueHead)); + const UA_NodeId *targetId = &TAILQ_FIRST(&head->references[i].queueHead)->targetId.nodeId; + const UA_Node *type = UA_NODESTORE_GET(server, targetId); + if(!type) + continue; + if(type->head.nodeClass == typeNodeClass) + return type; + UA_NODESTORE_RELEASE(server, type); + } + + return NULL; +} + +UA_Boolean +UA_Node_hasSubTypeOrInstances(const UA_NodeHead *head) { + for(size_t i = 0; i < head->referencesSize; ++i) { + if(head->references[i].isInverse == false && + head->references[i].referenceTypeIndex == UA_REFERENCETYPEINDEX_HASSUBTYPE) + return true; + if(head->references[i].isInverse == true && + head->references[i].referenceTypeIndex == UA_REFERENCETYPEINDEX_HASTYPEDEFINITION) + return true; + } + return false; +} + +UA_StatusCode +getParentTypeAndInterfaceHierarchy(UA_Server *server, const UA_NodeId *typeNode, + UA_NodeId **typeHierarchy, size_t *typeHierarchySize) { + UA_ReferenceTypeSet reftypes_subtype = + UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASSUBTYPE); + UA_ExpandedNodeId *subTypes = NULL; + size_t subTypesSize = 0; + UA_StatusCode retval = browseRecursive(server, 1, typeNode, + UA_BROWSEDIRECTION_INVERSE, + &reftypes_subtype, UA_NODECLASS_UNSPECIFIED, + false, &subTypesSize, &subTypes); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_assert(subTypesSize < 1000); + + UA_ReferenceTypeSet reftypes_interface = + UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASINTERFACE); + UA_ExpandedNodeId *interfaces = NULL; + size_t interfacesSize = 0; + retval = browseRecursive(server, 1, typeNode, UA_BROWSEDIRECTION_FORWARD, + &reftypes_interface, UA_NODECLASS_UNSPECIFIED, + false, &interfacesSize, &interfaces); + if(retval != UA_STATUSCODE_GOOD) { + UA_Array_delete(subTypes, subTypesSize, &UA_TYPES[UA_TYPES_NODEID]); + return retval; + } + + UA_assert(interfacesSize < 1000); + + UA_NodeId *hierarchy = (UA_NodeId*) + UA_malloc(sizeof(UA_NodeId) * (1 + subTypesSize + interfacesSize)); + if(!hierarchy) { + UA_Array_delete(subTypes, subTypesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + UA_Array_delete(interfaces, interfacesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + retval = UA_NodeId_copy(typeNode, hierarchy); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(hierarchy); + UA_Array_delete(subTypes, subTypesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + UA_Array_delete(interfaces, interfacesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + for(size_t i = 0; i < subTypesSize; i++) { + hierarchy[i+1] = subTypes[i].nodeId; + UA_NodeId_init(&subTypes[i].nodeId); + } + for(size_t i = 0; i < interfacesSize; i++) { + hierarchy[i+1+subTypesSize] = interfaces[i].nodeId; + UA_NodeId_init(&interfaces[i].nodeId); + } + + *typeHierarchy = hierarchy; + *typeHierarchySize = subTypesSize + interfacesSize + 1; + + UA_assert(*typeHierarchySize < 1000); + + UA_Array_delete(subTypes, subTypesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + UA_Array_delete(interfaces, interfacesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +getInterfaceHierarchy(UA_Server *server, const UA_NodeId *objectNode, + UA_NodeId **typeHierarchy, size_t *typeHierarchySize) { + UA_ReferenceTypeSet reftypes_interface = + UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASINTERFACE); + UA_ExpandedNodeId *interfaces = NULL; + size_t interfacesSize = 0; + UA_StatusCode retval = browseRecursive(server, 1, objectNode, UA_BROWSEDIRECTION_FORWARD, + &reftypes_interface, UA_NODECLASS_UNSPECIFIED, + false, &interfacesSize, &interfaces); + if(retval != UA_STATUSCODE_GOOD) { + return retval; + } + + UA_assert(interfacesSize < 1000); + + if (interfacesSize == 0) { + *typeHierarchySize = 0; + return UA_STATUSCODE_GOOD; + } + + UA_NodeId *hierarchy = (UA_NodeId*) + UA_malloc(sizeof(UA_NodeId) * (interfacesSize)); + if(!hierarchy) { + UA_Array_delete(interfaces, interfacesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + for(size_t i = 0; i < interfacesSize; i++) { + hierarchy[i] = interfaces[i].nodeId; + UA_NodeId_init(&interfaces[i].nodeId); + } + + *typeHierarchy = hierarchy; + *typeHierarchySize = interfacesSize; + + UA_assert(*typeHierarchySize < 1000); + UA_Array_delete(interfaces, interfacesSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_GOOD; +} + +/* For mulithreading: make a copy of the node, edit and replace. + * For singlethreading: edit the original */ +UA_StatusCode +UA_Server_editNode(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId, UA_EditNodeCallback callback, + void *data) { +#ifndef UA_ENABLE_IMMUTABLE_NODES + /* Get the node and process it in-situ */ + const UA_Node *node = UA_NODESTORE_GET(server, nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + UA_StatusCode retval = callback(server, session, (UA_Node*)(uintptr_t)node, data); + UA_NODESTORE_RELEASE(server, node); + return retval; +#else + UA_StatusCode retval; + do { + /* Get an editable copy of the node */ + UA_Node *node; + retval = UA_NODESTORE_GETCOPY(server, nodeId, &node); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Run the operation on the copy */ + retval = callback(server, session, node, data); + if(retval != UA_STATUSCODE_GOOD) { + UA_NODESTORE_DELETE(server, node); + return retval; + } + + /* Replace the node */ + retval = UA_NODESTORE_REPLACE(server, node); + } while(retval != UA_STATUSCODE_GOOD); + return retval; +#endif +} + +UA_StatusCode +UA_Server_processServiceOperations(UA_Server *server, UA_Session *session, + UA_ServiceOperation operationCallback, + const void *context, const size_t *requestOperations, + const UA_DataType *requestOperationsType, + size_t *responseOperations, + const UA_DataType *responseOperationsType) { + size_t ops = *requestOperations; + if(ops == 0) + return UA_STATUSCODE_BADNOTHINGTODO; + + /* No padding after size_t */ + void **respPos = (void**)((uintptr_t)responseOperations + sizeof(size_t)); + *respPos = UA_Array_new(ops, responseOperationsType); + if(!(*respPos)) + return UA_STATUSCODE_BADOUTOFMEMORY; + + *responseOperations = ops; + uintptr_t respOp = (uintptr_t)*respPos; + /* No padding after size_t */ + uintptr_t reqOp = *(uintptr_t*)((uintptr_t)requestOperations + sizeof(size_t)); + for(size_t i = 0; i < ops; i++) { + operationCallback(server, session, context, (void*)reqOp, (void*)respOp); + reqOp += requestOperationsType->memSize; + respOp += responseOperationsType->memSize; + } + return UA_STATUSCODE_GOOD; +} + +/* A few global NodeId definitions */ +const UA_NodeId subtypeId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASSUBTYPE}}; +const UA_NodeId hierarchicalReferences = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HIERARCHICALREFERENCES}}; + +/*********************************/ +/* Default attribute definitions */ +/*********************************/ + +const UA_ObjectAttributes UA_ObjectAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + 0 /* eventNotifier */ +}; + +const UA_VariableAttributes UA_VariableAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + {NULL, UA_VARIANT_DATA, + 0, NULL, 0, NULL}, /* value */ + {0, UA_NODEIDTYPE_NUMERIC, + {UA_NS0ID_BASEDATATYPE}}, /* dataType */ + UA_VALUERANK_ANY, /* valueRank */ + 0, NULL, /* arrayDimensions */ + UA_ACCESSLEVELMASK_READ, 0, /* accessLevel (userAccessLevel) */ + 0.0, /* minimumSamplingInterval */ + false /* historizing */ +}; + +const UA_MethodAttributes UA_MethodAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + true, true /* executable (userExecutable) */ +}; + +const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + false /* isAbstract */ +}; + +const UA_VariableTypeAttributes UA_VariableTypeAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + {NULL, UA_VARIANT_DATA, + 0, NULL, 0, NULL}, /* value */ + {0, UA_NODEIDTYPE_NUMERIC, + {UA_NS0ID_BASEDATATYPE}}, /* dataType */ + UA_VALUERANK_ANY, /* valueRank */ + 0, NULL, /* arrayDimensions */ + false /* isAbstract */ +}; + +const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + false, /* isAbstract */ + false, /* symmetric */ + {{0, NULL}, {0, NULL}} /* inverseName */ +}; + +const UA_DataTypeAttributes UA_DataTypeAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + false /* isAbstract */ +}; + +const UA_ViewAttributes UA_ViewAttributes_default = { + 0, /* specifiedAttributes */ + {{0, NULL}, {0, NULL}}, /* displayName */ + {{0, NULL}, {0, NULL}}, /* description */ + 0, 0, /* writeMask (userWriteMask) */ + false, /* containsNoLoops */ + 0 /* eventNotifier */ +}; + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_discovery.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + +#ifdef UA_ENABLE_DISCOVERY + +UA_StatusCode +register_server_with_discovery_server(UA_Server *server, + void *pClient, + const UA_Boolean isUnregister, + const char* semaphoreFilePath) { + UA_Client *client = (UA_Client *) pClient; + + /* Prepare the request. Do not cleanup the request after the service call, + * as the members are stack-allocated or point into the server config. */ + UA_RegisterServer2Request request; + UA_RegisterServer2Request_init(&request); + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + + request.server.isOnline = !isUnregister; + request.server.serverUri = server->config.applicationDescription.applicationUri; + request.server.productUri = server->config.applicationDescription.productUri; + request.server.serverType = server->config.applicationDescription.applicationType; + request.server.gatewayServerUri = server->config.applicationDescription.gatewayServerUri; + + if(semaphoreFilePath) { +#ifdef UA_ENABLE_DISCOVERY_SEMAPHORE + request.server.semaphoreFilePath = + UA_STRING((char*)(uintptr_t)semaphoreFilePath); /* dirty cast */ +#else + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_CLIENT, + "Ignoring semaphore file path. open62541 not compiled " + "with UA_ENABLE_DISCOVERY_SEMAPHORE=ON"); +#endif + } + + request.server.serverNames = &server->config.applicationDescription.applicationName; + request.server.serverNamesSize = 1; + + /* Mirror the discovery urls from the server config and the network layers */ + size_t config_discurls = server->config.applicationDescription.discoveryUrlsSize; + size_t nl_discurls = server->config.networkLayersSize; + size_t total_discurls = config_discurls + nl_discurls; + request.server.discoveryUrls = (UA_String*) + UA_Array_new(total_discurls, &UA_TYPES[UA_TYPES_STRING]); + if(!request.server.discoveryUrls) + return UA_STATUSCODE_BADOUTOFMEMORY; + + for(size_t i = 0; i < config_discurls; ++i) + request.server.discoveryUrls[i] = server->config.applicationDescription.discoveryUrls[i]; + /* TODO: Add nl only if discoveryUrl not already present */ + for(size_t i = 0; i < nl_discurls; ++i) { + UA_ServerNetworkLayer *nl = &server->config.networkLayers[i]; + request.server.discoveryUrls[config_discurls + i] = nl->discoveryUrl; + } + request.server.discoveryUrlsSize = total_discurls; + +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + request.discoveryConfigurationSize = 1; + request.discoveryConfiguration = UA_ExtensionObject_new(); + // Set to NODELETE so that we can just use a pointer to the mdns config + UA_ExtensionObject_setValueNoDelete(request.discoveryConfiguration, + &server->config.mdnsConfig, + &UA_TYPES[UA_TYPES_MDNSDISCOVERYCONFIGURATION]); +#endif + + // First try with RegisterServer2, if that isn't implemented, use RegisterServer + UA_RegisterServer2Response response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_REGISTERSERVER2REQUEST], + &response, &UA_TYPES[UA_TYPES_REGISTERSERVER2RESPONSE]); + + UA_StatusCode serviceResult = response.responseHeader.serviceResult; + UA_RegisterServer2Response_clear(&response); + UA_Array_delete(request.discoveryConfiguration, + request.discoveryConfigurationSize, + &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); + if(total_discurls > 0) + UA_free(request.server.discoveryUrls); + + if(serviceResult == UA_STATUSCODE_BADNOTIMPLEMENTED || + serviceResult == UA_STATUSCODE_BADSERVICEUNSUPPORTED) { + /* Try RegisterServer */ + UA_RegisterServerRequest request_fallback; + UA_RegisterServerRequest_init(&request_fallback); + /* Copy from RegisterServer2 request */ + request_fallback.requestHeader = request.requestHeader; + request_fallback.server = request.server; + + UA_RegisterServerResponse response_fallback; + + __UA_Client_Service(client, &request_fallback, + &UA_TYPES[UA_TYPES_REGISTERSERVERREQUEST], + &response_fallback, + &UA_TYPES[UA_TYPES_REGISTERSERVERRESPONSE]); + + serviceResult = response_fallback.responseHeader.serviceResult; + UA_RegisterServerResponse_clear(&response_fallback); + } + + if(serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_CLIENT, + "RegisterServer/RegisterServer2 failed with statuscode %s", + UA_StatusCode_name(serviceResult)); + } + + return serviceResult; +} + +UA_StatusCode +UA_Server_register_discovery(UA_Server *server, UA_Client *client, + const char* semaphoreFilePath) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = register_server_with_discovery_server(server, client, + false, semaphoreFilePath); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +UA_Server_unregister_discovery(UA_Server *server, UA_Client *client) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = register_server_with_discovery_server(server, client, + true, NULL); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +#endif /* UA_ENABLE_DISCOVERY */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_server_async.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2019 (c) Fraunhofer IOSB (Author: Klaus Schick) + * Copyright 2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + +#if UA_MULTITHREADING >= 100 + +static void +UA_AsyncOperation_delete(UA_AsyncOperation *ar) { + UA_CallMethodRequest_clear(&ar->request); + UA_CallMethodResult_clear(&ar->response); + UA_free(ar); +} + +static UA_StatusCode +UA_AsyncManager_sendAsyncResponse(UA_AsyncManager *am, UA_Server *server, + UA_AsyncResponse *ar) { + /* Get the session */ + UA_StatusCode res = UA_STATUSCODE_GOOD; + UA_LOCK(server->serviceMutex); + UA_Session* session = UA_Server_getSessionById(server, &ar->sessionId); + UA_UNLOCK(server->serviceMutex); + UA_SecureChannel* channel = NULL; + UA_ResponseHeader *responseHeader = NULL; + if(!session) { + res = UA_STATUSCODE_BADSESSIONIDINVALID; + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_InsertMethodResponse: Session is gone"); + goto clean_up; + } + + /* Check the channel */ + channel = session->header.channel; + if(!channel) { + res = UA_STATUSCODE_BADSECURECHANNELCLOSED; + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_InsertMethodResponse: Channel is gone"); + goto clean_up; + } + + /* Okay, here we go, send the UA_CallResponse */ + responseHeader = (UA_ResponseHeader*) + &ar->response.callResponse.responseHeader; + responseHeader->requestHandle = ar->requestHandle; + res = sendResponse(server, session, channel, ar->requestId, + (UA_Response*)&ar->response, &UA_TYPES[UA_TYPES_CALLRESPONSE]); + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SendResponse: Response for Req# %" PRIu32 " sent", ar->requestId); + + clean_up: + /* Remove from the AsyncManager */ + UA_AsyncManager_removeAsyncResponse(&server->asyncManager, ar); + return res; +} + +/* Integrate operation result in the AsyncResponse and send out the response if + * it is ready. */ +static void +integrateOperationResult(UA_AsyncManager *am, UA_Server *server, + UA_AsyncOperation *ao) { + /* Grab the open request, so we can continue to construct the response */ + UA_AsyncResponse *ar = ao->parent; + + /* Reduce the number of open results */ + ar->opCountdown -= 1; + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Return result in the server thread with %" PRIu32 " remaining", + ar->opCountdown); + + /* Move the UA_CallMethodResult to UA_CallResponse */ + ar->response.callResponse.results[ao->index] = ao->response; + UA_CallMethodResult_init(&ao->response); + + /* Are we done with all operations? */ + if(ar->opCountdown == 0) + UA_AsyncManager_sendAsyncResponse(am, server, ar); +} + +/* Process all operations in the result queue -> move content over to the + * AsyncResponse. This is only done by the server thread. */ +static void +processAsyncResults(UA_Server *server, void *data) { + UA_AsyncManager *am = &server->asyncManager; + while(true) { + UA_LOCK(am->queueLock); + UA_AsyncOperation *ao = TAILQ_FIRST(&am->resultQueue); + if(ao) + TAILQ_REMOVE(&am->resultQueue, ao, pointers); + UA_UNLOCK(am->queueLock); + if(!ao) + break; + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_CallMethodResponse: Got Response: OKAY"); + integrateOperationResult(am, server, ao); + UA_AsyncOperation_delete(ao); + am->opsCount--; + } +} + +/* Check if any operations have timed out */ +static void +checkTimeouts(UA_Server *server, void *_) { + /* Timeouts are not configured */ + if(server->config.asyncOperationTimeout <= 0.0) + return; + + UA_AsyncManager *am = &server->asyncManager; + const UA_DateTime tNow = UA_DateTime_now(); + + UA_LOCK(am->queueLock); + + /* Loop over the queue of dispatched ops */ + UA_AsyncOperation *op = NULL, *op_tmp = NULL; + TAILQ_FOREACH_SAFE(op, &am->dispatchedQueue, pointers, op_tmp) { + /* The timeout has not passed. Also for all elements following in the queue. */ + if(tNow <= op->parent->timeout) + break; + + /* Mark as timed out and put it into the result queue */ + op->response.statusCode = UA_STATUSCODE_BADTIMEOUT; + TAILQ_REMOVE(&am->dispatchedQueue, op, pointers); + TAILQ_INSERT_TAIL(&am->resultQueue, op, pointers); + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Operation was removed due to a timeout"); + } + + /* Loop over the queue of new ops */ + TAILQ_FOREACH_SAFE(op, &am->newQueue, pointers, op_tmp) { + /* The timeout has not passed. Also for all elements following in the queue. */ + if(tNow <= op->parent->timeout) + break; + + /* Mark as timed out and put it into the result queue */ + op->response.statusCode = UA_STATUSCODE_BADTIMEOUT; + TAILQ_REMOVE(&am->newQueue, op, pointers); + TAILQ_INSERT_TAIL(&am->resultQueue, op, pointers); + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Operation was removed due to a timeout"); + } + + UA_UNLOCK(am->queueLock); + + /* Integrate async results and send out complete responses */ + processAsyncResults(server, NULL); +} + +void +UA_AsyncManager_init(UA_AsyncManager *am, UA_Server *server) { + memset(am, 0, sizeof(UA_AsyncManager)); + TAILQ_INIT(&am->asyncResponses); + TAILQ_INIT(&am->newQueue); + TAILQ_INIT(&am->dispatchedQueue); + TAILQ_INIT(&am->resultQueue); + UA_LOCK_INIT(am->queueLock); + + /* Add a regular callback for cleanup and sending finished responses at a + * 100s interval. */ + UA_Server_addRepeatedCallback(server, (UA_ServerCallback)checkTimeouts, + NULL, 100.0, &am->checkTimeoutCallbackId); +} + +void +UA_AsyncManager_clear(UA_AsyncManager *am, UA_Server *server) { + removeCallback(server, am->checkTimeoutCallbackId); + + UA_AsyncOperation *ar; + + /* Clean up queues */ + UA_LOCK(am->queueLock); + while((ar = TAILQ_FIRST(&am->newQueue))) { + TAILQ_REMOVE(&am->resultQueue, ar, pointers); + UA_AsyncOperation_delete(ar); + } + while((ar = TAILQ_FIRST(&am->dispatchedQueue))) { + TAILQ_REMOVE(&am->resultQueue, ar, pointers); + UA_AsyncOperation_delete(ar); + } + while((ar = TAILQ_FIRST(&am->resultQueue))) { + TAILQ_REMOVE(&am->resultQueue, ar, pointers); + UA_AsyncOperation_delete(ar); + } + UA_UNLOCK(am->queueLock); + + /* Remove responses */ + UA_AsyncResponse *current, *temp; + TAILQ_FOREACH_SAFE(current, &am->asyncResponses, pointers, temp) { + UA_AsyncManager_removeAsyncResponse(am, current); + } + + /* Delete all locks */ + UA_LOCK_DESTROY(am->queueLock); +} + +UA_StatusCode +UA_AsyncManager_createAsyncResponse(UA_AsyncManager *am, UA_Server *server, + const UA_NodeId *sessionId, + const UA_UInt32 requestId, const UA_UInt32 requestHandle, + const UA_AsyncOperationType operationType, + UA_AsyncResponse **outAr) { + UA_AsyncResponse *newentry = (UA_AsyncResponse*)UA_calloc(1, sizeof(UA_AsyncResponse)); + if(!newentry) + return UA_STATUSCODE_BADOUTOFMEMORY; + + UA_StatusCode res = UA_NodeId_copy(sessionId, &newentry->sessionId); + if(res != UA_STATUSCODE_GOOD) { + UA_free(newentry); + return res; + } + + am->asyncResponsesCount += 1; + newentry->requestId = requestId; + newentry->requestHandle = requestHandle; + newentry->timeout = UA_DateTime_now(); + if(server->config.asyncOperationTimeout > 0.0) + newentry->timeout += (UA_DateTime) + (server->config.asyncOperationTimeout * (UA_DateTime)UA_DATETIME_MSEC); + TAILQ_INSERT_TAIL(&am->asyncResponses, newentry, pointers); + + *outAr = newentry; + return UA_STATUSCODE_GOOD; +} + +/* Remove entry and free all allocated data */ +void +UA_AsyncManager_removeAsyncResponse(UA_AsyncManager *am, UA_AsyncResponse *ar) { + TAILQ_REMOVE(&am->asyncResponses, ar, pointers); + am->asyncResponsesCount -= 1; + UA_CallResponse_clear(&ar->response.callResponse); + UA_NodeId_clear(&ar->sessionId); + UA_free(ar); +} + +/* Enqueue next MethodRequest */ +UA_StatusCode +UA_AsyncManager_createAsyncOp(UA_AsyncManager *am, UA_Server *server, + UA_AsyncResponse *ar, size_t opIndex, + const UA_CallMethodRequest *opRequest) { + if(server->config.maxAsyncOperationQueueSize != 0 && + am->opsCount >= server->config.maxAsyncOperationQueueSize) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetNextAsyncMethod: Queue exceeds limit (%d).", + (int unsigned)server->config.maxAsyncOperationQueueSize); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + + UA_AsyncOperation *ao = (UA_AsyncOperation*)UA_calloc(1, sizeof(UA_AsyncOperation)); + if(!ao) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetNextAsyncMethod: Mem alloc failed."); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_StatusCode result = UA_CallMethodRequest_copy(opRequest, &ao->request); + if(result != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetAsyncMethodResult: UA_CallMethodRequest_copy failed."); + UA_free(ao); + return result; + } + + UA_CallMethodResult_init(&ao->response); + ao->index = opIndex; + ao->parent = ar; + + UA_LOCK(am->queueLock); + TAILQ_INSERT_TAIL(&am->newQueue, ao, pointers); + am->opsCount++; + ar->opCountdown++; + UA_UNLOCK(am->queueLock); + + if(server->config.asyncOperationNotifyCallback) + server->config.asyncOperationNotifyCallback(server); + + return UA_STATUSCODE_GOOD; +} + +/* Get and remove next Method Call Request */ +UA_Boolean +UA_Server_getAsyncOperationNonBlocking(UA_Server *server, UA_AsyncOperationType *type, + const UA_AsyncOperationRequest **request, + void **context, UA_DateTime *timeout) { + UA_AsyncManager *am = &server->asyncManager; + + UA_Boolean bRV = false; + *type = UA_ASYNCOPERATIONTYPE_INVALID; + UA_LOCK(am->queueLock); + UA_AsyncOperation *ao = TAILQ_FIRST(&am->newQueue); + if(ao) { + TAILQ_REMOVE(&am->newQueue, ao, pointers); + TAILQ_INSERT_TAIL(&am->dispatchedQueue, ao, pointers); + *type = UA_ASYNCOPERATIONTYPE_CALL; + *request = (UA_AsyncOperationRequest*)&ao->request; + *context = (void*)ao; + if(timeout) + *timeout = ao->parent->timeout; + bRV = true; + } + UA_UNLOCK(am->queueLock); + + return bRV; +} + +UA_Boolean +UA_Server_getAsyncOperation(UA_Server *server, UA_AsyncOperationType *type, + const UA_AsyncOperationRequest **request, + void **context) { + return UA_Server_getAsyncOperationNonBlocking(server, type, request, context, NULL); +} + +/* Worker submits Method Call Response */ +void +UA_Server_setAsyncOperationResult(UA_Server *server, + const UA_AsyncOperationResponse *response, + void *context) { + UA_AsyncManager *am = &server->asyncManager; + + UA_AsyncOperation *ao = (UA_AsyncOperation*)context; + if(!ao) { + /* Something went wrong. Not a good AsyncOp. */ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetAsyncMethodResult: Invalid context"); + return; + } + + UA_LOCK(am->queueLock); + + /* See if the operation is still in the dispatched queue. Otherwise it has + * been removed due to a timeout. + * + * TODO: Add a tree-structure for the dispatch queue. The linear lookup does + * not scale. */ + UA_Boolean found = false; + UA_AsyncOperation *op = NULL; + TAILQ_FOREACH(op, &am->dispatchedQueue, pointers) { + if(op == ao) { + found = true; + break; + } + } + + if(!found) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetAsyncMethodResult: The operation has timed out"); + UA_UNLOCK(am->queueLock); + return; + } + + /* Copy the result into the internal AsyncOperation */ + UA_StatusCode result = + UA_CallMethodResult_copy(&response->callMethodResult, &ao->response); + if(result != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_Server_SetAsyncMethodResult: UA_CallMethodResult_copy failed."); + ao->response.statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Move to the result queue */ + TAILQ_REMOVE(&am->dispatchedQueue, ao, pointers); + TAILQ_INSERT_TAIL(&am->resultQueue, ao, pointers); + + UA_UNLOCK(am->queueLock); + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Set the result from the worker thread"); +} + +/******************/ +/* Server Methods */ +/******************/ + +static UA_StatusCode +setMethodNodeAsync(UA_Server *server, UA_Session *session, + UA_Node *node, UA_Boolean *isAsync) { + if(node->head.nodeClass != UA_NODECLASS_METHOD) + return UA_STATUSCODE_BADNODECLASSINVALID; + node->methodNode.async = *isAsync; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_setMethodNodeAsync(UA_Server *server, const UA_NodeId id, + UA_Boolean isAsync) { + return UA_Server_editNode(server, &server->adminSession, &id, + (UA_EditNodeCallback)setMethodNodeAsync, &isAsync); +} + +UA_StatusCode +UA_Server_processServiceOperationsAsync(UA_Server *server, UA_Session *session, + UA_UInt32 requestId, UA_UInt32 requestHandle, + UA_AsyncServiceOperation operationCallback, + const size_t *requestOperations, + const UA_DataType *requestOperationsType, + size_t *responseOperations, + const UA_DataType *responseOperationsType, + UA_AsyncResponse **ar) { + size_t ops = *requestOperations; + if(ops == 0) + return UA_STATUSCODE_BADNOTHINGTODO; + + /* Allocate the response array. No padding after size_t */ + void **respPos = (void**)((uintptr_t)responseOperations + sizeof(size_t)); + *respPos = UA_Array_new(ops, responseOperationsType); + if(!*respPos) + return UA_STATUSCODE_BADOUTOFMEMORY; + *responseOperations = ops; + + /* Finish / dispatch the operations. This may allocate a new AsyncResponse internally */ + uintptr_t respOp = (uintptr_t)*respPos; + uintptr_t reqOp = *(uintptr_t*)((uintptr_t)requestOperations + sizeof(size_t)); + for(size_t i = 0; i < ops; i++) { + operationCallback(server, session, requestId, requestHandle, + i, (void*)reqOp, (void*)respOp, ar); + reqOp += requestOperationsType->memSize; + respOp += responseOperationsType->memSize; + } + + return UA_STATUSCODE_GOOD; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_networkmessage.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Tino Bischoff) + * Copyright (c) 2019 Fraunhofer IOSB (Author: Andreas Ebner) + */ + + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + + +const UA_Byte NM_VERSION_MASK = 15; +const UA_Byte NM_PUBLISHER_ID_ENABLED_MASK = 16; +const UA_Byte NM_GROUP_HEADER_ENABLED_MASK = 32; +const UA_Byte NM_PAYLOAD_HEADER_ENABLED_MASK = 64; +const UA_Byte NM_EXTENDEDFLAGS1_ENABLED_MASK = 128; +const UA_Byte NM_PUBLISHER_ID_MASK = 7; +const UA_Byte NM_DATASET_CLASSID_ENABLED_MASK = 8; +const UA_Byte NM_SECURITY_ENABLED_MASK = 16; +const UA_Byte NM_TIMESTAMP_ENABLED_MASK = 32; +const UA_Byte NM_PICOSECONDS_ENABLED_MASK = 64; +const UA_Byte NM_EXTENDEDFLAGS2_ENABLED_MASK = 128; +const UA_Byte NM_NETWORK_MSG_TYPE_MASK = 28; +const UA_Byte NM_CHUNK_MESSAGE_MASK = 1; +const UA_Byte NM_PROMOTEDFIELDS_ENABLED_MASK = 2; +const UA_Byte GROUP_HEADER_WRITER_GROUPID_ENABLED = 1; +const UA_Byte GROUP_HEADER_GROUP_VERSION_ENABLED = 2; +const UA_Byte GROUP_HEADER_NM_NUMBER_ENABLED = 4; +const UA_Byte GROUP_HEADER_SEQUENCE_NUMBER_ENABLED = 8; +const UA_Byte SECURITY_HEADER_NM_SIGNED = 1; +const UA_Byte SECURITY_HEADER_NM_ENCRYPTED = 2; +const UA_Byte SECURITY_HEADER_SEC_FOOTER_ENABLED = 4; +const UA_Byte SECURITY_HEADER_FORCE_KEY_RESET = 8; +const UA_Byte DS_MESSAGEHEADER_DS_MSG_VALID = 1; +const UA_Byte DS_MESSAGEHEADER_FIELD_ENCODING_MASK = 6; +const UA_Byte DS_MESSAGEHEADER_SEQ_NR_ENABLED_MASK = 8; +const UA_Byte DS_MESSAGEHEADER_STATUS_ENABLED_MASK = 16; +const UA_Byte DS_MESSAGEHEADER_CONFIGMAJORVERSION_ENABLED_MASK = 32; +const UA_Byte DS_MESSAGEHEADER_CONFIGMINORVERSION_ENABLED_MASK = 64; +const UA_Byte DS_MESSAGEHEADER_FLAGS2_ENABLED_MASK = 128; +const UA_Byte DS_MESSAGEHEADER_DS_MESSAGE_TYPE_MASK = 15; +const UA_Byte DS_MESSAGEHEADER_TIMESTAMP_ENABLED_MASK = 16; +const UA_Byte DS_MESSAGEHEADER_PICOSECONDS_INCLUDED_MASK = 32; +const UA_Byte NM_SHIFT_LEN = 2; +const UA_Byte DS_MH_SHIFT_LEN = 1; + +static UA_Boolean UA_NetworkMessage_ExtendedFlags1Enabled(const UA_NetworkMessage* src); +static UA_Boolean UA_NetworkMessage_ExtendedFlags2Enabled(const UA_NetworkMessage* src); +static UA_Boolean UA_DataSetMessageHeader_DataSetFlags2Enabled(const UA_DataSetMessageHeader* src); + +UA_StatusCode +UA_NetworkMessage_updateBufferedMessage(UA_NetworkMessageOffsetBuffer *buffer){ + UA_StatusCode rv = UA_STATUSCODE_GOOD; + for (size_t i = 0; i < buffer->offsetsSize; ++i) { + const UA_Byte *bufEnd = &buffer->buffer.data[buffer->buffer.length]; + UA_Byte *bufPos = &buffer->buffer.data[buffer->offsets[i].offset]; + switch (buffer->offsets[i].contentType) { + case UA_PUBSUB_OFFSETTYPE_DATASETMESSAGE_SEQUENCENUMBER: + rv = UA_UInt16_encodeBinary((UA_UInt16 *) buffer->offsets[i].offsetData.value.value->value.data, &bufPos, bufEnd); + break; + case UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_SEQUENCENUMBER: + rv = UA_UInt16_encodeBinary((UA_UInt16 *) buffer->offsets[i].offsetData.value.value->value.data, &bufPos, bufEnd); + break; + case UA_PUBSUB_OFFSETTYPE_PAYLOAD_DATAVALUE: + rv = UA_DataValue_encodeBinary(buffer->offsets[i].offsetData.value.value, &bufPos, bufEnd); + break; + case UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT: + rv = UA_Variant_encodeBinary(&buffer->offsets[i].offsetData.value.value->value, &bufPos, bufEnd); + break; + default: + return UA_STATUSCODE_BADNOTSUPPORTED; + } + } + return rv; +} + +UA_StatusCode +UA_NetworkMessage_updateBufferedNwMessage(UA_NetworkMessageOffsetBuffer *buffer, + const UA_ByteString *src, size_t *bufferPosition){ + UA_StatusCode rv = UA_STATUSCODE_GOOD; + size_t payloadCounter = 0; + size_t offset = 0; + UA_DataSetMessage* dsm = buffer->nm->payload.dataSetPayload.dataSetMessages; // Considering one DSM in RT TODO: Clarify multiple DSM + for (size_t i = 0; i < buffer->offsetsSize; ++i) { + offset = buffer->offsets[i].offset + *bufferPosition; + switch (buffer->offsets[i].contentType) { + case UA_PUBSUB_OFFSETTYPE_PUBLISHERID: + switch (buffer->nm->publisherIdType) { + case UA_PUBLISHERDATATYPE_BYTE: + rv = UA_Byte_decodeBinary(src, &offset, &(buffer->nm->publisherId.publisherIdByte)); + break; + case UA_PUBLISHERDATATYPE_UINT16: + rv = UA_UInt16_decodeBinary(src, &offset, &(buffer->nm->publisherId.publisherIdUInt16)); + break; + case UA_PUBLISHERDATATYPE_UINT32: + rv = UA_UInt32_decodeBinary(src, &offset, &(buffer->nm->publisherId.publisherIdUInt32)); + break; + case UA_PUBLISHERDATATYPE_UINT64: + rv = UA_UInt64_decodeBinary(src, &offset, &(buffer->nm->publisherId.publisherIdUInt64)); + break; + default: + return UA_STATUSCODE_BADNOTSUPPORTED; + } + break; + case UA_PUBSUB_OFFSETTYPE_WRITERGROUPID: + rv = UA_UInt16_decodeBinary(src, &offset, &buffer->nm->groupHeader.writerGroupId); + if(rv != UA_STATUSCODE_GOOD) + return rv; + break; + case UA_PUBSUB_OFFSETTYPE_DATASETWRITERID: + rv = UA_UInt16_decodeBinary(src, &offset, + &buffer->nm->payloadHeader.dataSetPayloadHeader.dataSetWriterIds[0]); /* TODO */ + if(rv != UA_STATUSCODE_GOOD) + return rv; + break; + case UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_SEQUENCENUMBER: + rv = UA_UInt16_decodeBinary(src, &offset, &buffer->nm->groupHeader.sequenceNumber); + if(rv != UA_STATUSCODE_GOOD) + return rv; + break; + case UA_PUBSUB_OFFSETTYPE_PAYLOAD_DATAVALUE: + rv = UA_DataValue_decodeBinary(src, &offset, + &(dsm->data.keyFrameData.dataSetFields[payloadCounter])); + if(rv != UA_STATUSCODE_GOOD) + return rv; + payloadCounter++; + break; + case UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT: + rv = UA_Variant_decodeBinary(src, &offset, + &dsm->data.keyFrameData.dataSetFields[payloadCounter].value); + if(rv != UA_STATUSCODE_GOOD) + return rv; + dsm->data.keyFrameData.dataSetFields[payloadCounter].hasValue = true; + payloadCounter++; + break; + default: + return UA_STATUSCODE_BADNOTSUPPORTED; + } + } + *bufferPosition = offset; + return rv; +} + +UA_StatusCode +UA_NetworkMessage_encodeBinary(const UA_NetworkMessage* src, UA_Byte **bufPos, + const UA_Byte *bufEnd) { + /* UADPVersion + UADP Flags */ + UA_Byte v = src->version; + if(src->publisherIdEnabled) + v |= NM_PUBLISHER_ID_ENABLED_MASK; + + if(src->groupHeaderEnabled) + v |= NM_GROUP_HEADER_ENABLED_MASK; + + if(src->payloadHeaderEnabled) + v |= NM_PAYLOAD_HEADER_ENABLED_MASK; + + if(UA_NetworkMessage_ExtendedFlags1Enabled(src)) + v |= NM_EXTENDEDFLAGS1_ENABLED_MASK; + + UA_StatusCode rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // ExtendedFlags1 + if(UA_NetworkMessage_ExtendedFlags1Enabled(src)) { + v = (UA_Byte)src->publisherIdType; + + if(src->dataSetClassIdEnabled) + v |= NM_DATASET_CLASSID_ENABLED_MASK; + + if(src->securityEnabled) + v |= NM_SECURITY_ENABLED_MASK; + + if(src->timestampEnabled) + v |= NM_TIMESTAMP_ENABLED_MASK; + + if(src->picosecondsEnabled) + v |= NM_PICOSECONDS_ENABLED_MASK; + + if(UA_NetworkMessage_ExtendedFlags2Enabled(src)) + v |= NM_EXTENDEDFLAGS2_ENABLED_MASK; + + rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // ExtendedFlags2 + if(UA_NetworkMessage_ExtendedFlags2Enabled(src)) { + v = (UA_Byte)src->networkMessageType; + // shift left 2 bit + v = (UA_Byte) (v << NM_SHIFT_LEN); + + if(src->chunkMessage) + v |= NM_CHUNK_MESSAGE_MASK; + + if(src->promotedFieldsEnabled) + v |= NM_PROMOTEDFIELDS_ENABLED_MASK; + + rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // PublisherId + if(src->publisherIdEnabled) { + switch (src->publisherIdType) { + case UA_PUBLISHERDATATYPE_BYTE: + rv = UA_Byte_encodeBinary(&(src->publisherId.publisherIdByte), bufPos, bufEnd); + break; + + case UA_PUBLISHERDATATYPE_UINT16: + rv = UA_UInt16_encodeBinary(&(src->publisherId.publisherIdUInt16), bufPos, bufEnd); + break; + + case UA_PUBLISHERDATATYPE_UINT32: + rv = UA_UInt32_encodeBinary(&(src->publisherId.publisherIdUInt32), bufPos, bufEnd); + break; + + case UA_PUBLISHERDATATYPE_UINT64: + rv = UA_UInt64_encodeBinary(&(src->publisherId.publisherIdUInt64), bufPos, bufEnd); + break; + + case UA_PUBLISHERDATATYPE_STRING: + rv = UA_String_encodeBinary(&(src->publisherId.publisherIdString), bufPos, bufEnd); + break; + + default: + rv = UA_STATUSCODE_BADINTERNALERROR; + break; + } + + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // DataSetClassId + if(src->dataSetClassIdEnabled) { + rv = UA_Guid_encodeBinary(&(src->dataSetClassId), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // Group Header + if(src->groupHeaderEnabled) { + v = 0; + + if(src->groupHeader.writerGroupIdEnabled) + v |= GROUP_HEADER_WRITER_GROUPID_ENABLED; + + if(src->groupHeader.groupVersionEnabled) + v |= GROUP_HEADER_GROUP_VERSION_ENABLED; + + if(src->groupHeader.networkMessageNumberEnabled) + v |= GROUP_HEADER_NM_NUMBER_ENABLED; + + if(src->groupHeader.sequenceNumberEnabled) + v |= GROUP_HEADER_SEQUENCE_NUMBER_ENABLED; + + rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(src->groupHeader.writerGroupIdEnabled) { + rv = UA_UInt16_encodeBinary(&(src->groupHeader.writerGroupId), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(src->groupHeader.groupVersionEnabled) { + rv = UA_UInt32_encodeBinary(&(src->groupHeader.groupVersion), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(src->groupHeader.networkMessageNumberEnabled) { + rv = UA_UInt16_encodeBinary(&(src->groupHeader.networkMessageNumber), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(src->groupHeader.sequenceNumberEnabled) { + rv = UA_UInt16_encodeBinary(&(src->groupHeader.sequenceNumber), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Payload-Header + if(src->payloadHeaderEnabled) { + if(src->networkMessageType != UA_NETWORKMESSAGE_DATASET) + return UA_STATUSCODE_BADNOTIMPLEMENTED; + + rv = UA_Byte_encodeBinary(&(src->payloadHeader.dataSetPayloadHeader.count), bufPos, bufEnd); + + if(src->payloadHeader.dataSetPayloadHeader.dataSetWriterIds == NULL) + return UA_STATUSCODE_BADENCODINGERROR; + + for(UA_Byte i = 0; i < src->payloadHeader.dataSetPayloadHeader.count; i++) { + rv = UA_UInt16_encodeBinary(&(src->payloadHeader.dataSetPayloadHeader.dataSetWriterIds[i]), + bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Timestamp + if(src->timestampEnabled) + rv = UA_DateTime_encodeBinary(&(src->timestamp), bufPos, bufEnd); + + // Picoseconds + if(src->picosecondsEnabled) + rv = UA_UInt16_encodeBinary(&(src->picoseconds), bufPos, bufEnd); + + // PromotedFields + if(src->promotedFieldsEnabled) { + /* Size (calculate & encode) */ + UA_UInt16 pfSize = 0; + for(UA_UInt16 i = 0; i < src->promotedFieldsSize; i++) + pfSize = (UA_UInt16) (pfSize + UA_Variant_calcSizeBinary(&src->promotedFields[i])); + rv |= UA_UInt16_encodeBinary(&pfSize, bufPos, bufEnd); + + for (UA_UInt16 i = 0; i < src->promotedFieldsSize; i++) + rv |= UA_Variant_encodeBinary(&(src->promotedFields[i]), bufPos, bufEnd); + } + + // SecurityHeader + if(src->securityEnabled) { + // SecurityFlags + v = 0; + if(src->securityHeader.networkMessageSigned) + v |= SECURITY_HEADER_NM_SIGNED; + + if(src->securityHeader.networkMessageEncrypted) + v |= SECURITY_HEADER_NM_ENCRYPTED; + + if(src->securityHeader.securityFooterEnabled) + v |= SECURITY_HEADER_SEC_FOOTER_ENABLED; + + if(src->securityHeader.forceKeyReset) + v |= SECURITY_HEADER_FORCE_KEY_RESET; + + rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // SecurityTokenId + rv = UA_UInt32_encodeBinary(&src->securityHeader.securityTokenId, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // NonceLength + rv = UA_Byte_encodeBinary(&src->securityHeader.nonceLength, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // MessageNonce + for (UA_Byte i = 0; i < src->securityHeader.nonceLength; i++) { + rv = UA_Byte_encodeBinary(&(src->securityHeader.messageNonce.data[i]), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // SecurityFooterSize + if(src->securityHeader.securityFooterEnabled) { + rv = UA_UInt16_encodeBinary(&src->securityHeader.securityFooterSize, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Payload + if(src->networkMessageType != UA_NETWORKMESSAGE_DATASET) + return UA_STATUSCODE_BADNOTIMPLEMENTED; + + UA_Byte count = 1; + + if(src->payloadHeaderEnabled) { + count = src->payloadHeader.dataSetPayloadHeader.count; + if(count > 1) { + for (UA_Byte i = 0; i < count; i++) { + // initially calculate the size, if not specified + UA_UInt16 sz = 0; + if((src->payload.dataSetPayload.sizes != NULL) && + (src->payload.dataSetPayload.sizes[i] != 0)) { + sz = src->payload.dataSetPayload.sizes[i]; + } else { + sz = (UA_UInt16) UA_DataSetMessage_calcSizeBinary(&src->payload.dataSetPayload.dataSetMessages[i], + NULL, 0); + } + + rv = UA_UInt16_encodeBinary(&sz, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } + + for(UA_Byte i = 0; i < count; i++) { + rv = UA_DataSetMessage_encodeBinary(&(src->payload.dataSetPayload.dataSetMessages[i]), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(src->securityEnabled) { + // SecurityFooter + if(src->securityHeader.securityFooterEnabled) { + for(UA_Byte i = 0; i < src->securityHeader.securityFooterSize; i++) { + rv = UA_Byte_encodeBinary(&(src->securityFooter.data[i]), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Signature + if(src->securityHeader.networkMessageSigned) { + rv = UA_ByteString_encodeBinary(&(src->signature), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_NetworkMessage_decodeBinaryInternal(const UA_ByteString *src, size_t *offset, + UA_NetworkMessage* dst) { + memset(dst, 0, sizeof(UA_NetworkMessage)); + UA_Byte v = 0; + UA_StatusCode rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + dst->version = v & NM_VERSION_MASK; + + if((v & NM_PUBLISHER_ID_ENABLED_MASK) != 0) + dst->publisherIdEnabled = true; + + if((v & NM_GROUP_HEADER_ENABLED_MASK) != 0) + dst->groupHeaderEnabled = true; + + if((v & NM_PAYLOAD_HEADER_ENABLED_MASK) != 0) + dst->payloadHeaderEnabled = true; + + if((v & NM_EXTENDEDFLAGS1_ENABLED_MASK) != 0) { + v = 0; + rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + dst->publisherIdType = (UA_PublisherIdDatatype)(v & NM_PUBLISHER_ID_MASK); + if((v & NM_DATASET_CLASSID_ENABLED_MASK) != 0) + dst->dataSetClassIdEnabled = true; + + if((v & NM_SECURITY_ENABLED_MASK) != 0) + dst->securityEnabled = true; + + if((v & NM_TIMESTAMP_ENABLED_MASK) != 0) + dst->timestampEnabled = true; + + if((v & NM_PICOSECONDS_ENABLED_MASK) != 0) + dst->picosecondsEnabled = true; + + if((v & NM_EXTENDEDFLAGS2_ENABLED_MASK) != 0) { + v = 0; + rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if((v & NM_CHUNK_MESSAGE_MASK) != 0) + dst->chunkMessage = true; + + if((v & NM_PROMOTEDFIELDS_ENABLED_MASK) != 0) + dst->promotedFieldsEnabled = true; + + v = v & NM_NETWORK_MSG_TYPE_MASK; + v = (UA_Byte) (v >> NM_SHIFT_LEN); + dst->networkMessageType = (UA_NetworkMessageType)v; + } + } + + if(dst->publisherIdEnabled) { + switch (dst->publisherIdType) { + case UA_PUBLISHERDATATYPE_BYTE: + rv = UA_Byte_decodeBinary(src, offset, &(dst->publisherId.publisherIdByte)); + break; + + case UA_PUBLISHERDATATYPE_UINT16: + rv = UA_UInt16_decodeBinary(src, offset, &(dst->publisherId.publisherIdUInt16)); + break; + + case UA_PUBLISHERDATATYPE_UINT32: + rv = UA_UInt32_decodeBinary(src, offset, &(dst->publisherId.publisherIdUInt32)); + break; + + case UA_PUBLISHERDATATYPE_UINT64: + rv = UA_UInt64_decodeBinary(src, offset, &(dst->publisherId.publisherIdUInt64)); + break; + + case UA_PUBLISHERDATATYPE_STRING: + rv = UA_String_decodeBinary(src, offset, &(dst->publisherId.publisherIdString)); + break; + + default: + rv = UA_STATUSCODE_BADINTERNALERROR; + break; + } + + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(dst->dataSetClassIdEnabled) { + rv = UA_Guid_decodeBinary(src, offset, &(dst->dataSetClassId)); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // GroupHeader + if(dst->groupHeaderEnabled) { + v = 0; + rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if((v & GROUP_HEADER_WRITER_GROUPID_ENABLED) != 0) + dst->groupHeader.writerGroupIdEnabled = true; + + if((v & GROUP_HEADER_GROUP_VERSION_ENABLED) != 0) + dst->groupHeader.groupVersionEnabled = true; + + if((v & GROUP_HEADER_NM_NUMBER_ENABLED) != 0) + dst->groupHeader.networkMessageNumberEnabled = true; + + if((v & GROUP_HEADER_SEQUENCE_NUMBER_ENABLED) != 0) + dst->groupHeader.sequenceNumberEnabled = true; + + if(dst->groupHeader.writerGroupIdEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->groupHeader.writerGroupId); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(dst->groupHeader.groupVersionEnabled) { + rv = UA_UInt32_decodeBinary(src, offset, &dst->groupHeader.groupVersion); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(dst->groupHeader.networkMessageNumberEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->groupHeader.networkMessageNumber); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(dst->groupHeader.sequenceNumberEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->groupHeader.sequenceNumber); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Payload-Header + if(dst->payloadHeaderEnabled) { + if(dst->networkMessageType != UA_NETWORKMESSAGE_DATASET) + return UA_STATUSCODE_BADNOTIMPLEMENTED; + + rv = UA_Byte_decodeBinary(src, offset, &dst->payloadHeader.dataSetPayloadHeader.count); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + dst->payloadHeader.dataSetPayloadHeader.dataSetWriterIds = + (UA_UInt16 *)UA_Array_new(dst->payloadHeader.dataSetPayloadHeader.count, + &UA_TYPES[UA_TYPES_UINT16]); + for (UA_Byte i = 0; i < dst->payloadHeader.dataSetPayloadHeader.count; i++) { + rv = UA_UInt16_decodeBinary(src, offset, + &dst->payloadHeader.dataSetPayloadHeader.dataSetWriterIds[i]); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Timestamp + if(dst->timestampEnabled) { + rv = UA_DateTime_decodeBinary(src, offset, &(dst->timestamp)); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // Picoseconds + if(dst->picosecondsEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &(dst->picoseconds)); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // PromotedFields + if(dst->promotedFieldsEnabled) { + // Size + UA_UInt16 promotedFieldsSize = 0; + rv = UA_UInt16_decodeBinary(src, offset, &promotedFieldsSize); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // promotedFieldsSize: here size in Byte, not the number of objects! + if(promotedFieldsSize > 0) { + // store offset, later compared with promotedFieldsSize + size_t offsetEnd = (*offset) + promotedFieldsSize; + + unsigned int counter = 0; + do { + if(counter == 0) { + dst->promotedFields = (UA_Variant*)UA_malloc(UA_TYPES[UA_TYPES_VARIANT].memSize); + // set promotedFieldsSize to the number of objects + dst->promotedFieldsSize = (UA_UInt16) (counter + 1); + } else { + dst->promotedFields = (UA_Variant*) + UA_realloc(dst->promotedFields, + UA_TYPES[UA_TYPES_VARIANT].memSize * (counter + 1)); + // set promotedFieldsSize to the number of objects + dst->promotedFieldsSize = (UA_UInt16) (counter + 1); + } + + UA_Variant_init(&dst->promotedFields[counter]); + rv = UA_Variant_decodeBinary(src, offset, &dst->promotedFields[counter]); + if(rv != UA_STATUSCODE_GOOD) + return rv; + counter++; + } while ((*offset) < offsetEnd); + } + } + + // SecurityHeader + if(dst->securityEnabled) { + // SecurityFlags + v = 0; + rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if((v & SECURITY_HEADER_NM_SIGNED) != 0) + dst->securityHeader.networkMessageSigned = true; + + if((v & SECURITY_HEADER_NM_ENCRYPTED) != 0) + dst->securityHeader.networkMessageEncrypted = true; + + if((v & SECURITY_HEADER_SEC_FOOTER_ENABLED) != 0) + dst->securityHeader.securityFooterEnabled = true; + + if((v & SECURITY_HEADER_FORCE_KEY_RESET) != 0) + dst->securityHeader.forceKeyReset = true; + + // SecurityTokenId + rv = UA_UInt32_decodeBinary(src, offset, &dst->securityHeader.securityTokenId); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // NonceLength + rv = UA_Byte_decodeBinary(src, offset, &dst->securityHeader.nonceLength); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // MessageNonce + if(dst->securityHeader.nonceLength > 0) { + rv = UA_ByteString_allocBuffer(&dst->securityHeader.messageNonce, + dst->securityHeader.nonceLength); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + for (UA_Byte i = 0; i < dst->securityHeader.nonceLength; i++) { + rv = UA_Byte_decodeBinary(src, offset, &(dst->securityHeader.messageNonce.data[i])); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // SecurityFooterSize + if(dst->securityHeader.securityFooterEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->securityHeader.securityFooterSize); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Payload + if(dst->networkMessageType != UA_NETWORKMESSAGE_DATASET) + return UA_STATUSCODE_BADNOTIMPLEMENTED; + + UA_Byte count = 1; + if(dst->payloadHeaderEnabled) { + count = dst->payloadHeader.dataSetPayloadHeader.count; + if(count > 1) { + dst->payload.dataSetPayload.sizes = (UA_UInt16 *)UA_Array_new(count, &UA_TYPES[UA_TYPES_UINT16]); + for (UA_Byte i = 0; i < count; i++) { + rv = UA_UInt16_decodeBinary(src, offset, &(dst->payload.dataSetPayload.sizes[i])); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } + + dst->payload.dataSetPayload.dataSetMessages = (UA_DataSetMessage*) + UA_calloc(count, sizeof(UA_DataSetMessage)); + for(UA_Byte i = 0; i < count; i++) { + rv = UA_DataSetMessage_decodeBinary(src, offset, &(dst->payload.dataSetPayload.dataSetMessages[i])); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(dst->securityEnabled) { + // SecurityFooter + if(dst->securityHeader.securityFooterEnabled && (dst->securityHeader.securityFooterSize > 0)) { + rv = UA_ByteString_allocBuffer(&dst->securityFooter, dst->securityHeader.securityFooterSize); + if (rv != UA_STATUSCODE_GOOD) + return rv; + + for (UA_Byte i = 0; i < dst->securityHeader.securityFooterSize; i++) { + rv = UA_Byte_decodeBinary(src, offset, &(dst->securityFooter.data[i])); + if (rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + // Signature + if(dst->securityHeader.networkMessageSigned) { + rv = UA_ByteString_decodeBinary(src, offset, &(dst->signature)); + if (rv != UA_STATUSCODE_GOOD) + return rv; + } + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_NetworkMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NetworkMessage* dst) { + UA_StatusCode retval = UA_NetworkMessage_decodeBinaryInternal(src, offset, dst); + + if(retval != UA_STATUSCODE_GOOD) + UA_NetworkMessage_clear(dst); + + return retval; +} + +static UA_Boolean +increaseOffsetArray(UA_NetworkMessageOffsetBuffer *offsetBuffer) { + UA_NetworkMessageOffset *tmpOffsets = (UA_NetworkMessageOffset *) + UA_realloc(offsetBuffer->offsets, sizeof(UA_NetworkMessageOffset) * (offsetBuffer->offsetsSize + (size_t)1)); + if(!tmpOffsets) + return false; + offsetBuffer->offsets = tmpOffsets; + offsetBuffer->offsetsSize++; + return true; +} + +size_t +UA_NetworkMessage_calcSizeBinary(UA_NetworkMessage *p, UA_NetworkMessageOffsetBuffer *offsetBuffer) { + size_t retval = 0; + UA_Byte byte; + size_t size = UA_Byte_calcSizeBinary(&byte); // UADPVersion + UADPFlags + if(UA_NetworkMessage_ExtendedFlags1Enabled(p)) { + size += UA_Byte_calcSizeBinary(&byte); + if(UA_NetworkMessage_ExtendedFlags2Enabled(p)) + size += UA_Byte_calcSizeBinary(&byte); + } + + if(p->publisherIdEnabled) { + if(offsetBuffer && offsetBuffer->RTsubscriberEnabled){ + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_PUBLISHERID; + } + switch (p->publisherIdType) { + case UA_PUBLISHERDATATYPE_BYTE: + size += UA_Byte_calcSizeBinary(&p->publisherId.publisherIdByte); + break; + + case UA_PUBLISHERDATATYPE_UINT16: + size += UA_UInt16_calcSizeBinary(&p->publisherId.publisherIdUInt16); + break; + + case UA_PUBLISHERDATATYPE_UINT32: + size += UA_UInt32_calcSizeBinary(&p->publisherId.publisherIdUInt32); + break; + + case UA_PUBLISHERDATATYPE_UINT64: + size += UA_UInt64_calcSizeBinary(&p->publisherId.publisherIdUInt64); + break; + + case UA_PUBLISHERDATATYPE_STRING: + size += UA_String_calcSizeBinary(&p->publisherId.publisherIdString); + break; + } + } + + if(p->dataSetClassIdEnabled) + size += UA_Guid_calcSizeBinary(&p->dataSetClassId); + + // Group Header + if(p->groupHeaderEnabled) { + size += UA_Byte_calcSizeBinary(&byte); + + if(p->groupHeader.writerGroupIdEnabled) { + if(offsetBuffer && offsetBuffer->RTsubscriberEnabled){ + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_WRITERGROUPID; + } + size += UA_UInt16_calcSizeBinary(&p->groupHeader.writerGroupId); + } + + if(p->groupHeader.groupVersionEnabled) + size += UA_UInt32_calcSizeBinary(&p->groupHeader.groupVersion); + + if(p->groupHeader.networkMessageNumberEnabled) { + size += UA_UInt16_calcSizeBinary(&p->groupHeader.networkMessageNumber); + } + + if(p->groupHeader.sequenceNumberEnabled){ + if(offsetBuffer){ + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].offsetData.value.value = UA_DataValue_new(); + UA_DataValue_init(offsetBuffer->offsets[pos].offsetData.value.value); + UA_Variant_setScalar(&offsetBuffer->offsets[pos].offsetData.value.value->value, + &p->groupHeader.sequenceNumber, &UA_TYPES[UA_TYPES_UINT16]); + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_SEQUENCENUMBER; + } + size += UA_UInt16_calcSizeBinary(&p->groupHeader.sequenceNumber); + } + } + + // Payload Header + if(p->payloadHeaderEnabled) { + if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) { + size += UA_Byte_calcSizeBinary(&p->payloadHeader.dataSetPayloadHeader.count); + if(p->payloadHeader.dataSetPayloadHeader.dataSetWriterIds != NULL) { + if(offsetBuffer && offsetBuffer->RTsubscriberEnabled){ + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_DATASETWRITERID; + } + size += UA_UInt16_calcSizeBinary(&p->payloadHeader.dataSetPayloadHeader.dataSetWriterIds[0]) * + p->payloadHeader.dataSetPayloadHeader.count; + } else { + return 0; /* no dataSetWriterIds given! */ + } + } else { + // not implemented + } + } + + if(p->timestampEnabled) { + if(offsetBuffer){ + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_TIMESTAMP; + } + size += UA_DateTime_calcSizeBinary(&p->timestamp); + } + + if(p->picosecondsEnabled){ + if (offsetBuffer) { + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_TIMESTAMP_PICOSECONDS; + } + size += UA_UInt16_calcSizeBinary(&p->picoseconds); + } + + if(p->promotedFieldsEnabled) { + size += UA_UInt16_calcSizeBinary(&p->promotedFieldsSize); + for (UA_UInt16 i = 0; i < p->promotedFieldsSize; i++) + size += UA_Variant_calcSizeBinary(&p->promotedFields[i]); + } + + if(p->securityEnabled) { + size += UA_Byte_calcSizeBinary(&byte); + size += UA_UInt32_calcSizeBinary(&p->securityHeader.securityTokenId); + size += UA_Byte_calcSizeBinary(&p->securityHeader.nonceLength); + if(p->securityHeader.nonceLength > 0) + size += (UA_Byte_calcSizeBinary(&p->securityHeader.messageNonce.data[0]) * p->securityHeader.nonceLength); + if(p->securityHeader.securityFooterEnabled) + size += UA_UInt16_calcSizeBinary(&p->securityHeader.securityFooterSize); + } + + if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) { + UA_Byte count = 1; + if(p->payloadHeaderEnabled) { + count = p->payloadHeader.dataSetPayloadHeader.count; + if(count > 1) + size += UA_UInt16_calcSizeBinary(&(p->payload.dataSetPayload.sizes[0])) * count; + } + + for (size_t i = 0; i < count; i++) { + if (offsetBuffer) + UA_DataSetMessage_calcSizeBinary(&(p->payload.dataSetPayload.dataSetMessages[i]), offsetBuffer, + size); + size += UA_DataSetMessage_calcSizeBinary(&(p->payload.dataSetPayload.dataSetMessages[i]), NULL, 0); + } + } + + if (p->securityEnabled) { + if (p->securityHeader.securityFooterEnabled) + size += p->securityHeader.securityFooterSize; + + if (p->securityHeader.networkMessageSigned) + size += UA_ByteString_calcSizeBinary(&p->signature); + } + + retval = size; + return retval; +} + +void +UA_NetworkMessage_clear(UA_NetworkMessage* p) { + if(p->promotedFieldsEnabled) + UA_Array_delete(p->promotedFields, p->promotedFieldsSize, &UA_TYPES[UA_TYPES_VARIANT]); + + if(p->securityEnabled && (p->securityHeader.nonceLength > 0)) + UA_ByteString_clear(&p->securityHeader.messageNonce); + + if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) { + if(p->payloadHeaderEnabled) { + if(p->payloadHeader.dataSetPayloadHeader.dataSetWriterIds != NULL) { + UA_Array_delete(p->payloadHeader.dataSetPayloadHeader.dataSetWriterIds, + p->payloadHeader.dataSetPayloadHeader.count, &UA_TYPES[UA_TYPES_UINT16]); + } + + if(p->payload.dataSetPayload.sizes != NULL) { + UA_Array_delete(p->payload.dataSetPayload.sizes, + p->payloadHeader.dataSetPayloadHeader.count, &UA_TYPES[UA_TYPES_UINT16]); + } + } + + if(p->payload.dataSetPayload.dataSetMessages != NULL) { + UA_Byte count = 1; + if(p->payloadHeaderEnabled) + count = p->payloadHeader.dataSetPayloadHeader.count; + + for(size_t i = 0; i < count; i++) + UA_DataSetMessage_clear(&(p->payload.dataSetPayload.dataSetMessages[i])); + + UA_free(p->payload.dataSetPayload.dataSetMessages); + } + } + + if(p->securityHeader.securityFooterEnabled && (p->securityHeader.securityFooterSize > 0)) + UA_ByteString_clear(&p->securityFooter); + + if(p->messageIdEnabled){ + UA_String_clear(&p->messageId); + } + + if(p->publisherIdEnabled && p->publisherIdType == UA_PUBLISHERDATATYPE_STRING){ + UA_String_clear(&p->publisherId.publisherIdString); + } + + memset(p, 0, sizeof(UA_NetworkMessage)); +} + +void UA_NetworkMessage_delete(UA_NetworkMessage* p) { + UA_NetworkMessage_clear(p); +} + +UA_Boolean +UA_NetworkMessage_ExtendedFlags1Enabled(const UA_NetworkMessage* src) { + UA_Boolean retval = false; + + if((src->publisherIdType != UA_PUBLISHERDATATYPE_BYTE) + || src->dataSetClassIdEnabled + || src->securityEnabled + || src->timestampEnabled + || src->picosecondsEnabled + || UA_NetworkMessage_ExtendedFlags2Enabled(src)) + { + retval = true; + } + + return retval; +} + +UA_Boolean +UA_NetworkMessage_ExtendedFlags2Enabled(const UA_NetworkMessage* src) { + if(src->chunkMessage || src->promotedFieldsEnabled || + src->networkMessageType != UA_NETWORKMESSAGE_DATASET) + return true; + return false; +} + +UA_Boolean +UA_DataSetMessageHeader_DataSetFlags2Enabled(const UA_DataSetMessageHeader* src) { + if(src->dataSetMessageType != UA_DATASETMESSAGE_DATAKEYFRAME || + src->timestampEnabled || src->picoSecondsIncluded) + return true; + return false; +} + +UA_StatusCode +UA_DataSetMessageHeader_encodeBinary(const UA_DataSetMessageHeader* src, UA_Byte **bufPos, + const UA_Byte *bufEnd) { + UA_Byte v; + // DataSetFlags1 + v = (UA_Byte)src->fieldEncoding; + // shift left 1 bit + v = (UA_Byte)(v << DS_MH_SHIFT_LEN); + + if(src->dataSetMessageValid) + v |= DS_MESSAGEHEADER_DS_MSG_VALID; + + if(src->dataSetMessageSequenceNrEnabled) + v |= DS_MESSAGEHEADER_SEQ_NR_ENABLED_MASK; + + if(src->statusEnabled) + v |= DS_MESSAGEHEADER_STATUS_ENABLED_MASK; + + if(src->configVersionMajorVersionEnabled) + v |= DS_MESSAGEHEADER_CONFIGMAJORVERSION_ENABLED_MASK; + + if(src->configVersionMinorVersionEnabled) + v |= DS_MESSAGEHEADER_CONFIGMINORVERSION_ENABLED_MASK; + + if(UA_DataSetMessageHeader_DataSetFlags2Enabled(src)) + v |= DS_MESSAGEHEADER_FLAGS2_ENABLED_MASK; + + UA_StatusCode rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + // DataSetFlags2 + if(UA_DataSetMessageHeader_DataSetFlags2Enabled(src)) { + v = (UA_Byte)src->dataSetMessageType; + + if(src->timestampEnabled) + v |= DS_MESSAGEHEADER_TIMESTAMP_ENABLED_MASK; + + if(src->picoSecondsIncluded) + v |= DS_MESSAGEHEADER_PICOSECONDS_INCLUDED_MASK; + + rv = UA_Byte_encodeBinary(&v, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // DataSetMessageSequenceNr + if(src->dataSetMessageSequenceNrEnabled) { + rv = UA_UInt16_encodeBinary(&src->dataSetMessageSequenceNr, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // Timestamp + if(src->timestampEnabled) { + rv = UA_DateTime_encodeBinary(&(src->timestamp), bufPos, bufEnd); /* UtcTime */ + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // PicoSeconds + if(src->picoSecondsIncluded) { + rv = UA_UInt16_encodeBinary(&(src->picoSeconds), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // Status + if(src->statusEnabled) { + rv = UA_UInt16_encodeBinary(&(src->status), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // ConfigVersionMajorVersion + if(src->configVersionMajorVersionEnabled) { + rv = UA_UInt32_encodeBinary(&(src->configVersionMajorVersion), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + // ConfigVersionMinorVersion + if(src->configVersionMinorVersionEnabled) { + rv = UA_UInt32_encodeBinary(&(src->configVersionMinorVersion), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_DataSetMessageHeader_decodeBinary(const UA_ByteString *src, size_t *offset, + UA_DataSetMessageHeader* dst) { + memset(dst, 0, sizeof(UA_DataSetMessageHeader)); + UA_Byte v = 0; + UA_StatusCode rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + UA_Byte v2 = v & DS_MESSAGEHEADER_FIELD_ENCODING_MASK; + v2 = (UA_Byte)(v2 >> DS_MH_SHIFT_LEN); + dst->fieldEncoding = (UA_FieldEncoding)v2; + + if((v & DS_MESSAGEHEADER_DS_MSG_VALID) != 0) + dst->dataSetMessageValid = true; + + if((v & DS_MESSAGEHEADER_SEQ_NR_ENABLED_MASK) != 0) + dst->dataSetMessageSequenceNrEnabled = true; + + if((v & DS_MESSAGEHEADER_STATUS_ENABLED_MASK) != 0) + dst->statusEnabled = true; + + if((v & DS_MESSAGEHEADER_CONFIGMAJORVERSION_ENABLED_MASK) != 0) + dst->configVersionMajorVersionEnabled = true; + + if((v & DS_MESSAGEHEADER_CONFIGMINORVERSION_ENABLED_MASK) != 0) + dst->configVersionMinorVersionEnabled = true; + + if((v & DS_MESSAGEHEADER_FLAGS2_ENABLED_MASK) != 0) { + v = 0; + rv = UA_Byte_decodeBinary(src, offset, &v); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + dst->dataSetMessageType = (UA_DataSetMessageType)(v & DS_MESSAGEHEADER_DS_MESSAGE_TYPE_MASK); + + if((v & DS_MESSAGEHEADER_TIMESTAMP_ENABLED_MASK) != 0) + dst->timestampEnabled = true; + + if((v & DS_MESSAGEHEADER_PICOSECONDS_INCLUDED_MASK) != 0) + dst->picoSecondsIncluded = true; + } else { + dst->dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME; + dst->picoSecondsIncluded = false; + } + + if(dst->dataSetMessageSequenceNrEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->dataSetMessageSequenceNr); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->dataSetMessageSequenceNr = 0; + } + + if(dst->timestampEnabled) { + rv = UA_DateTime_decodeBinary(src, offset, &dst->timestamp); /* UtcTime */ + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->timestamp = 0; + } + + if(dst->picoSecondsIncluded) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->picoSeconds); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->picoSeconds = 0; + } + + if(dst->statusEnabled) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->status); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->status = 0; + } + + if(dst->configVersionMajorVersionEnabled) { + rv = UA_UInt32_decodeBinary(src, offset, &dst->configVersionMajorVersion); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->configVersionMajorVersion = 0; + } + + if(dst->configVersionMinorVersionEnabled) { + rv = UA_UInt32_decodeBinary(src, offset, &dst->configVersionMinorVersion); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } else { + dst->configVersionMinorVersion = 0; + } + + return UA_STATUSCODE_GOOD; +} + +size_t +UA_DataSetMessageHeader_calcSizeBinary(const UA_DataSetMessageHeader* p) { + UA_Byte byte; + size_t size = UA_Byte_calcSizeBinary(&byte); // DataSetMessage Type + Flags + if(UA_DataSetMessageHeader_DataSetFlags2Enabled(p)) + size += UA_Byte_calcSizeBinary(&byte); + + if(p->dataSetMessageSequenceNrEnabled) + size += UA_UInt16_calcSizeBinary(&p->dataSetMessageSequenceNr); + + if(p->timestampEnabled) + size += UA_DateTime_calcSizeBinary(&p->timestamp); /* UtcTime */ + + if(p->picoSecondsIncluded) + size += UA_UInt16_calcSizeBinary(&p->picoSeconds); + + if(p->statusEnabled) + size += UA_UInt16_calcSizeBinary(&p->status); + + if(p->configVersionMajorVersionEnabled) + size += UA_UInt32_calcSizeBinary(&p->configVersionMajorVersion); + + if(p->configVersionMinorVersionEnabled) + size += UA_UInt32_calcSizeBinary(&p->configVersionMinorVersion); + + return size; +} + +UA_StatusCode +UA_DataSetMessage_encodeBinary(const UA_DataSetMessage* src, UA_Byte **bufPos, + const UA_Byte *bufEnd) { + UA_StatusCode rv = UA_DataSetMessageHeader_encodeBinary(&src->header, bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(src->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) { + if(src->header.fieldEncoding != UA_FIELDENCODING_RAWDATA) { + rv = UA_UInt16_encodeBinary(&(src->data.keyFrameData.fieldCount), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + + if(src->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + for (UA_UInt16 i = 0; i < src->data.keyFrameData.fieldCount; i++) { + rv = UA_Variant_encodeBinary(&(src->data.keyFrameData.dataSetFields[i].value), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } else if(src->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } else if(src->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + for (UA_UInt16 i = 0; i < src->data.keyFrameData.fieldCount; i++) { + rv = UA_DataValue_encodeBinary(&(src->data.keyFrameData.dataSetFields[i]), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } else if(src->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) { + // Encode Delta Frame + // Here the FieldCount is always present + rv = UA_UInt16_encodeBinary(&(src->data.keyFrameData.fieldCount), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(src->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + for (UA_UInt16 i = 0; i < src->data.deltaFrameData.fieldCount; i++) { + rv = UA_UInt16_encodeBinary(&(src->data.deltaFrameData.deltaFrameFields[i].fieldIndex), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + rv = UA_Variant_encodeBinary(&(src->data.deltaFrameData.deltaFrameFields[i].fieldValue.value), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } else if(src->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } else if(src->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + for (UA_UInt16 i = 0; i < src->data.deltaFrameData.fieldCount; i++) { + rv = UA_UInt16_encodeBinary(&(src->data.deltaFrameData.deltaFrameFields[i].fieldIndex), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + rv = UA_DataValue_encodeBinary(&(src->data.deltaFrameData.deltaFrameFields[i].fieldValue), bufPos, bufEnd); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } else if(src->header.dataSetMessageType != UA_DATASETMESSAGE_KEEPALIVE) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } + + /* Keep-Alive Message contains no Payload Data */ + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_DataSetMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataSetMessage* dst) { + memset(dst, 0, sizeof(UA_DataSetMessage)); + UA_StatusCode rv = UA_DataSetMessageHeader_decodeBinary(src, offset, &dst->header); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(dst->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) { + if(dst->header.fieldEncoding != UA_FIELDENCODING_RAWDATA) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->data.keyFrameData.fieldCount); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(dst->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + dst->data.keyFrameData.dataSetFields = + (UA_DataValue *)UA_Array_new(dst->data.keyFrameData.fieldCount, &UA_TYPES[UA_TYPES_DATAVALUE]); + for (UA_UInt16 i = 0; i < dst->data.keyFrameData.fieldCount; i++) { + UA_DataValue_init(&dst->data.keyFrameData.dataSetFields[i]); + rv = UA_Variant_decodeBinary(src, offset, &dst->data.keyFrameData.dataSetFields[i].value); + if(rv != UA_STATUSCODE_GOOD) + return rv; + dst->data.keyFrameData.dataSetFields[i].hasValue = true; + } + } else if(dst->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } else if(dst->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + dst->data.keyFrameData.dataSetFields = + (UA_DataValue *)UA_Array_new(dst->data.keyFrameData.fieldCount, &UA_TYPES[UA_TYPES_DATAVALUE]); + for (UA_UInt16 i = 0; i < dst->data.keyFrameData.fieldCount; i++) { + rv = UA_DataValue_decodeBinary(src, offset, &(dst->data.keyFrameData.dataSetFields[i])); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } + } else if(dst->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) { + if(dst->header.fieldEncoding != UA_FIELDENCODING_RAWDATA) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->data.deltaFrameData.fieldCount); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + if(dst->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + size_t memsize = sizeof(UA_DataSetMessage_DeltaFrameField) * dst->data.deltaFrameData.fieldCount; + dst->data.deltaFrameData.deltaFrameFields = (UA_DataSetMessage_DeltaFrameField*)UA_malloc(memsize); + for (UA_UInt16 i = 0; i < dst->data.deltaFrameData.fieldCount; i++) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->data.deltaFrameData.deltaFrameFields[i].fieldIndex); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + UA_DataValue_init(&dst->data.deltaFrameData.deltaFrameFields[i].fieldValue); + rv = UA_Variant_decodeBinary(src, offset, &dst->data.deltaFrameData.deltaFrameFields[i].fieldValue.value); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + dst->data.deltaFrameData.deltaFrameFields[i].fieldValue.hasValue = true; + } + } else if(dst->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } else if(dst->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + size_t memsize = sizeof(UA_DataSetMessage_DeltaFrameField) * dst->data.deltaFrameData.fieldCount; + dst->data.deltaFrameData.deltaFrameFields = (UA_DataSetMessage_DeltaFrameField*)UA_malloc(memsize); + for (UA_UInt16 i = 0; i < dst->data.deltaFrameData.fieldCount; i++) { + rv = UA_UInt16_decodeBinary(src, offset, &dst->data.deltaFrameData.deltaFrameFields[i].fieldIndex); + if(rv != UA_STATUSCODE_GOOD) + return rv; + + rv = UA_DataValue_decodeBinary(src, offset, &(dst->data.deltaFrameData.deltaFrameFields[i].fieldValue)); + if(rv != UA_STATUSCODE_GOOD) + return rv; + } + } + } + } else if(dst->header.dataSetMessageType != UA_DATASETMESSAGE_KEEPALIVE) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } + + /* Keep-Alive Message contains no Payload Data */ + return UA_STATUSCODE_GOOD; +} + +size_t +UA_DataSetMessage_calcSizeBinary(UA_DataSetMessage* p, UA_NetworkMessageOffsetBuffer *offsetBuffer, size_t currentOffset) { + size_t size = currentOffset; + UA_Byte byte; + size += UA_Byte_calcSizeBinary(&byte); // DataSetMessage Type + Flags + if(UA_DataSetMessageHeader_DataSetFlags2Enabled(&p->header)) + size += UA_Byte_calcSizeBinary(&byte); + + if(p->header.dataSetMessageSequenceNrEnabled) { + if (offsetBuffer) { + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].offsetData.value.value = UA_DataValue_new(); + UA_DataValue_init(offsetBuffer->offsets[pos].offsetData.value.value); + UA_Variant_setScalar(&offsetBuffer->offsets[pos].offsetData.value.value->value, + &p->header.dataSetMessageSequenceNr, &UA_TYPES[UA_TYPES_UINT16]); + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_DATASETMESSAGE_SEQUENCENUMBER; + } + size += UA_UInt16_calcSizeBinary(&p->header.dataSetMessageSequenceNr); + } + + if(p->header.timestampEnabled) + size += UA_DateTime_calcSizeBinary(&p->header.timestamp); /* UtcTime */ + + if(p->header.picoSecondsIncluded) + size += UA_UInt16_calcSizeBinary(&p->header.picoSeconds); + + if(p->header.statusEnabled) + size += UA_UInt16_calcSizeBinary(&p->header.status); + + if(p->header.configVersionMajorVersionEnabled) + size += UA_UInt32_calcSizeBinary(&p->header.configVersionMajorVersion); + + if(p->header.configVersionMinorVersionEnabled) + size += UA_UInt32_calcSizeBinary(&p->header.configVersionMinorVersion); + + if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) { + if(p->header.fieldEncoding != UA_FIELDENCODING_RAWDATA){ + //TODO clarify RT and Rawdata behavior + size += UA_calcSizeBinary(&p->data.keyFrameData.fieldCount, &UA_TYPES[UA_TYPES_UINT16]); + } + + if(p->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + for (UA_UInt16 i = 0; i < p->data.keyFrameData.fieldCount; i++){ + if (offsetBuffer) { + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT; + //TODO check value source and alloc! + //offsetBuffer->offsets[pos].offsetData.value.value = p->data.keyFrameData.dataSetFields; + offsetBuffer->offsets[pos].offsetData.value.value = UA_DataValue_new(); + UA_Variant_setScalar(&offsetBuffer->offsets[pos].offsetData.value.value->value, + p->data.keyFrameData.dataSetFields[i].value.data, + p->data.keyFrameData.dataSetFields[i].value.type); + offsetBuffer->offsets[pos].offsetData.value.value->value.storageType = UA_VARIANT_DATA_NODELETE; + } + size += UA_calcSizeBinary(&p->data.keyFrameData.dataSetFields[i].value, &UA_TYPES[UA_TYPES_VARIANT]); + } + } else if(p->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + // not implemented + } else if(p->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + for (UA_UInt16 i = 0; i < p->data.keyFrameData.fieldCount; i++) { + if (offsetBuffer) { + size_t pos = offsetBuffer->offsetsSize; + if(!increaseOffsetArray(offsetBuffer)) + return 0; + offsetBuffer->offsets[pos].offset = size; + offsetBuffer->offsets[pos].contentType = UA_PUBSUB_OFFSETTYPE_PAYLOAD_DATAVALUE; + //TODO check value source, change implementation to 'variant' + offsetBuffer->offsets[pos].offsetData.value.value = p->data.keyFrameData.dataSetFields; + } + size += UA_calcSizeBinary(&p->data.keyFrameData.dataSetFields[i], &UA_TYPES[UA_TYPES_DATAVALUE]); + } + } + } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) { + //TODO clarify how to handle DATADELTAFRAME messages with RT + if(p->header.fieldEncoding != UA_FIELDENCODING_RAWDATA) + size += UA_calcSizeBinary(&p->data.deltaFrameData.fieldCount, &UA_TYPES[UA_TYPES_UINT16]); + + if(p->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + for (UA_UInt16 i = 0; i < p->data.deltaFrameData.fieldCount; i++) { + size += UA_calcSizeBinary(&p->data.deltaFrameData.deltaFrameFields[i].fieldIndex, &UA_TYPES[UA_TYPES_UINT16]); + size += UA_calcSizeBinary(&p->data.deltaFrameData.deltaFrameFields[i].fieldValue.value, &UA_TYPES[UA_TYPES_VARIANT]); + } + } else if(p->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) { + // not implemented + } else if(p->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + for (UA_UInt16 i = 0; i < p->data.deltaFrameData.fieldCount; i++) { + size += UA_calcSizeBinary(&p->data.deltaFrameData.deltaFrameFields[i].fieldIndex, &UA_TYPES[UA_TYPES_UINT16]); + size += UA_calcSizeBinary(&p->data.deltaFrameData.deltaFrameFields[i].fieldValue, &UA_TYPES[UA_TYPES_DATAVALUE]); + } + } + } + /* KeepAlive-Message contains no Payload Data */ + return size; +} + +void +UA_DataSetMessage_clear(const UA_DataSetMessage* p) { + if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) { + if(p->data.keyFrameData.dataSetFields != NULL) + UA_Array_delete(p->data.keyFrameData.dataSetFields, + p->data.keyFrameData.fieldCount, + &UA_TYPES[UA_TYPES_DATAVALUE]); + /* Json keys */ + if(p->data.keyFrameData.fieldNames != NULL){ + UA_Array_delete(p->data.keyFrameData.fieldNames, + p->data.keyFrameData.fieldCount, + &UA_TYPES[UA_TYPES_STRING]); + } + } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) { + if(p->data.deltaFrameData.deltaFrameFields != NULL) { + for(UA_UInt16 i = 0; i < p->data.deltaFrameData.fieldCount; i++) { + if(p->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + UA_DataValue_clear(&p->data.deltaFrameData.deltaFrameFields[i].fieldValue); + } else if(p->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + UA_Variant_clear(&p->data.deltaFrameData.deltaFrameFields[i].fieldValue.value); + } + } + UA_free(p->data.deltaFrameData.deltaFrameFields); + } + } +} +#endif /* UA_ENABLE_PUBSUB */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_writer.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2019 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright (c) 2019 Kalycito Infotech Private Limited + * Copyright (c) 2020 Yannick Wallerer, Siemens AG + * Copyright (c) 2020 Thomas Fischer, Siemens AG + */ + + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL +#endif + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES +#endif + +#define UA_MAX_STACKBUF 512 /* Max size of network messages on the stack */ + +/* Forward declaration */ +static void +UA_WriterGroup_clear(UA_Server *server, UA_WriterGroup *writerGroup); +static void +UA_DataSetField_clear(UA_DataSetField *field); +static UA_StatusCode +generateNetworkMessage(UA_PubSubConnection *connection, UA_WriterGroup *wg, + UA_DataSetMessage *dsm, UA_UInt16 *writerIds, UA_Byte dsmCount, + UA_ExtensionObject *messageSettings, + UA_ExtensionObject *transportSettings, + UA_NetworkMessage *networkMessage); +static UA_StatusCode +UA_DataSetWriter_generateDataSetMessage(UA_Server *server, UA_DataSetMessage *dataSetMessage, + UA_DataSetWriter *dataSetWriter); + +/**********************************************/ +/* Connection */ +/**********************************************/ + +UA_StatusCode +UA_PubSubConnectionConfig_copy(const UA_PubSubConnectionConfig *src, + UA_PubSubConnectionConfig *dst) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + memcpy(dst, src, sizeof(UA_PubSubConnectionConfig)); + res |= UA_String_copy(&src->name, &dst->name); + res |= UA_Variant_copy(&src->address, &dst->address); + res |= UA_String_copy(&src->transportProfileUri, &dst->transportProfileUri); + res |= UA_Variant_copy(&src->connectionTransportSettings, &dst->connectionTransportSettings); + if(src->connectionPropertiesSize > 0) { + dst->connectionProperties = (UA_KeyValuePair *) + UA_calloc(src->connectionPropertiesSize, sizeof(UA_KeyValuePair)); + if(!dst->connectionProperties) { + UA_PubSubConnectionConfig_clear(dst); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + for(size_t i = 0; i < src->connectionPropertiesSize; i++){ + res |= UA_QualifiedName_copy(&src->connectionProperties[i].key, + &dst->connectionProperties[i].key); + res |= UA_Variant_copy(&src->connectionProperties[i].value, + &dst->connectionProperties[i].value); + } + } + if(res != UA_STATUSCODE_GOOD) + UA_PubSubConnectionConfig_clear(dst); + return res; +} + +UA_StatusCode +UA_Server_getPubSubConnectionConfig(UA_Server *server, const UA_NodeId connection, + UA_PubSubConnectionConfig *config) { + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_PubSubConnection *currentPubSubConnection = + UA_PubSubConnection_findConnectionbyId(server, connection); + if(!currentPubSubConnection) + return UA_STATUSCODE_BADNOTFOUND; + + return UA_PubSubConnectionConfig_copy(currentPubSubConnection->config, config); +} + +UA_PubSubConnection * +UA_PubSubConnection_findConnectionbyId(UA_Server *server, UA_NodeId connectionIdentifier) { + UA_PubSubConnection *pubSubConnection; + TAILQ_FOREACH(pubSubConnection, &server->pubSubManager.connections, listEntry){ + if(UA_NodeId_equal(&connectionIdentifier, &pubSubConnection->identifier)) + break; + } + return pubSubConnection; +} + +void +UA_PubSubConnectionConfig_clear(UA_PubSubConnectionConfig *connectionConfig) { + UA_String_clear(&connectionConfig->name); + UA_String_clear(&connectionConfig->transportProfileUri); + UA_Variant_clear(&connectionConfig->connectionTransportSettings); + UA_Variant_clear(&connectionConfig->address); + for(size_t i = 0; i < connectionConfig->connectionPropertiesSize; i++){ + UA_QualifiedName_clear(&connectionConfig->connectionProperties[i].key); + UA_Variant_clear(&connectionConfig->connectionProperties[i].value); + } + UA_free(connectionConfig->connectionProperties); +} + +void +UA_PubSubConnection_clear(UA_Server *server, UA_PubSubConnection *connection) { + /* Remove WriterGroups */ + UA_WriterGroup *writerGroup, *tmpWriterGroup; + LIST_FOREACH_SAFE(writerGroup, &connection->writerGroups, listEntry, tmpWriterGroup) + UA_Server_removeWriterGroup(server, writerGroup->identifier); + + /* Remove ReaderGroups */ + UA_ReaderGroup *readerGroups, *tmpReaderGroup; + LIST_FOREACH_SAFE(readerGroups, &connection->readerGroups, listEntry, tmpReaderGroup) + UA_Server_removeReaderGroup(server, readerGroups->identifier); + + UA_NodeId_clear(&connection->identifier); + if(connection->channel) + connection->channel->close(connection->channel); + + UA_PubSubConnectionConfig_clear(connection->config); + UA_free(connection->config); +} + +UA_StatusCode +UA_PubSubConnection_regist(UA_Server *server, UA_NodeId *connectionIdentifier) { + UA_PubSubConnection *connection = + UA_PubSubConnection_findConnectionbyId(server, *connectionIdentifier); + if(!connection) + return UA_STATUSCODE_BADNOTFOUND; + + UA_StatusCode retval = connection->channel->regist(connection->channel, NULL, NULL); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "register channel failed: 0x%" PRIx32 "!", retval); + } + return retval; +} + +UA_StatusCode +UA_Server_addWriterGroup(UA_Server *server, const UA_NodeId connection, + const UA_WriterGroupConfig *writerGroupConfig, + UA_NodeId *writerGroupIdentifier) { + if(!writerGroupConfig) + return UA_STATUSCODE_BADINVALIDARGUMENT; + //search the connection by the given connectionIdentifier + UA_PubSubConnection *currentConnectionContext = + UA_PubSubConnection_findConnectionbyId(server, connection); + if(!currentConnectionContext) + return UA_STATUSCODE_BADNOTFOUND; + + if(currentConnectionContext->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding WriterGroup failed. PubSubConnection is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + /* Validate messageSettings type */ + if (writerGroupConfig->messageSettings.content.decoded.type) { + if (writerGroupConfig->encodingMimeType == UA_PUBSUB_ENCODING_JSON && + (writerGroupConfig->messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED + || writerGroupConfig->messageSettings.content.decoded.type->typeIndex != UA_TYPES_JSONWRITERGROUPMESSAGEDATATYPE) ) { + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + if (writerGroupConfig->encodingMimeType == UA_PUBSUB_ENCODING_UADP && + (writerGroupConfig->messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED + || writerGroupConfig->messageSettings.content.decoded.type->typeIndex != UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE) ) { + return UA_STATUSCODE_BADTYPEMISMATCH; + } + } + + //allocate memory for new WriterGroup + UA_WriterGroup *newWriterGroup = (UA_WriterGroup *) UA_calloc(1, sizeof(UA_WriterGroup)); + if(!newWriterGroup) + return UA_STATUSCODE_BADOUTOFMEMORY; + + newWriterGroup->componentType = UA_PUBSUB_COMPONENT_WRITERGROUP; + newWriterGroup->linkedConnection = currentConnectionContext; + UA_PubSubManager_generateUniqueNodeId(server, &newWriterGroup->identifier); + if(writerGroupIdentifier) + UA_NodeId_copy(&newWriterGroup->identifier, writerGroupIdentifier); + + //deep copy of the config + UA_WriterGroupConfig tmpWriterGroupConfig; + UA_StatusCode retVal = UA_WriterGroupConfig_copy(writerGroupConfig, &tmpWriterGroupConfig); + + if(!tmpWriterGroupConfig.messageSettings.content.decoded.type) { + UA_UadpWriterGroupMessageDataType *wgm = UA_UadpWriterGroupMessageDataType_new(); + tmpWriterGroupConfig.messageSettings.content.decoded.data = wgm; + tmpWriterGroupConfig.messageSettings.content.decoded.type = + &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE]; + tmpWriterGroupConfig.messageSettings.encoding = UA_EXTENSIONOBJECT_DECODED; + } + newWriterGroup->config = tmpWriterGroupConfig; + LIST_INSERT_HEAD(¤tConnectionContext->writerGroups, newWriterGroup, listEntry); + currentConnectionContext->writerGroupsSize++; +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addWriterGroupRepresentation(server, newWriterGroup); +#endif + return retVal; +} + +UA_StatusCode +UA_Server_removeWriterGroup(UA_Server *server, const UA_NodeId writerGroup) { + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + + if(wg->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Delete WriterGroup failed. WriterGroup is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + UA_PubSubConnection *connection = wg->linkedConnection; + if(!connection) + return UA_STATUSCODE_BADNOTFOUND; + + if(connection->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Delete WriterGroup failed. PubSubConnection is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + if(wg->state == UA_PUBSUBSTATE_OPERATIONAL){ + //unregister the publish callback + if(wg->config.pubsubManagerCallback.removeCustomCallback) + wg->config.pubsubManagerCallback.removeCustomCallback(server, wg->identifier, wg->publishCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, wg->publishCallbackId); + + } + + connection->writerGroupsSize--; +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removeGroupRepresentation(server, wg); +#endif + + UA_WriterGroup_clear(server, wg); + LIST_REMOVE(wg, listEntry); + UA_free(wg); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_freezeWriterGroupConfiguration(UA_Server *server, const UA_NodeId writerGroup) { + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + + //PubSubConnection freezeCounter++ + UA_PubSubConnection *pubSubConnection = wg->linkedConnection; + pubSubConnection->configurationFreezeCounter++; + pubSubConnection->configurationFrozen = UA_TRUE; + //WriterGroup freeze + wg->configurationFrozen = UA_TRUE; + //DataSetWriter freeze + UA_DataSetWriter *dataSetWriter; + LIST_FOREACH(dataSetWriter, &wg->writers, listEntry){ + dataSetWriter->configurationFrozen = UA_TRUE; + //PublishedDataSet freezeCounter++ + UA_PublishedDataSet *publishedDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + publishedDataSet->configurationFreezeCounter++; + publishedDataSet->configurationFrozen = UA_TRUE; + //DataSetFields freeze + UA_DataSetField *dataSetField; + TAILQ_FOREACH(dataSetField, &publishedDataSet->fields, listEntry){ + dataSetField->configurationFrozen = UA_TRUE; + } + } + + if(wg->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE){ + size_t dsmCount = 0; + if(wg->config.encodingMimeType != UA_PUBSUB_ENCODING_UADP) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: Non-RT capable encoding."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + //TODO Clarify: should we only allow = maxEncapsulatedDataSetMessageCount == 1 with RT? + //TODO Clarify: Behaviour if the finale size is more than MTU + /* Generate data set messages */ + UA_STACKARRAY(UA_UInt16, dsWriterIds, wg->writersCount); + UA_STACKARRAY(UA_DataSetMessage, dsmStore, wg->writersCount); + UA_DataSetWriter *dsw; + LIST_FOREACH(dsw, &wg->writers, listEntry) { + /* Find the dataset */ + UA_PublishedDataSet *pds = + UA_PublishedDataSet_findPDSbyId(server, dsw->connectedDataSet); + if(!pds) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Publish: PublishedDataSet not found"); + continue; + } + if(pds->promotedFieldsCount > 0) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: PDS contains promoted fields."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + UA_DataSetField *dsf; + TAILQ_FOREACH(dsf, &pds->fields, listEntry){ + const UA_VariableNode *rtNode = (const UA_VariableNode *) UA_NODESTORE_GET(server, &dsf->config.field.variable.publishParameters.publishedVariable); + if(rtNode != NULL && rtNode->valueBackend.backendType != UA_VALUEBACKENDTYPE_EXTERNAL){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: PDS contains field without external data source."); + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); + if((UA_NodeId_equal(&dsf->fieldMetaData.dataType, &UA_TYPES[UA_TYPES_STRING].typeId) || + UA_NodeId_equal(&dsf->fieldMetaData.dataType, + &UA_TYPES[UA_TYPES_BYTESTRING].typeId)) && + dsf->fieldMetaData.maxStringLength == 0) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: " + "PDS contains String/ByteString with dynamic length."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } else if(!UA_DataType_isNumeric(UA_findDataType(&dsf->fieldMetaData.dataType))){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: " + "PDS contains variable with dynamic size."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + } + /* Generate the DSM */ + UA_StatusCode res = + UA_DataSetWriter_generateDataSetMessage(server, &dsmStore[dsmCount], dsw); + if(res != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: DataSetMessage buffering failed"); + continue; + } + dsWriterIds[dsmCount] = dsw->config.dataSetWriterId; + dsmCount++; + } + UA_NetworkMessage networkMessage; + memset(&networkMessage, 0, sizeof(networkMessage)); + UA_StatusCode res = + generateNetworkMessage(pubSubConnection, wg, dsmStore, dsWriterIds, (UA_Byte) dsmCount, + &wg->config.messageSettings, &wg->config.transportSettings, + &networkMessage); + if(res != UA_STATUSCODE_GOOD) + { + return UA_STATUSCODE_BADINTERNALERROR; + } + + memset(&wg->bufferedMessage, 0, sizeof(UA_NetworkMessageOffsetBuffer)); + UA_NetworkMessage_calcSizeBinary(&networkMessage, &wg->bufferedMessage); + /* Allocate the buffer. Allocate on the stack if the buffer is small. */ + UA_ByteString buf; + size_t msgSize = UA_NetworkMessage_calcSizeBinary(&networkMessage, NULL); + res = UA_ByteString_allocBuffer(&buf, msgSize); + if(res != UA_STATUSCODE_GOOD) + { + UA_free(networkMessage.payload.dataSetPayload.sizes); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + wg->bufferedMessage.buffer = buf; + const UA_Byte *bufEnd = &wg->bufferedMessage.buffer.data[wg->bufferedMessage.buffer.length]; + UA_Byte *bufPos = wg->bufferedMessage.buffer.data; + UA_NetworkMessage_encodeBinary(&networkMessage, &bufPos, bufEnd); + + UA_free(networkMessage.payload.dataSetPayload.sizes); + /* Clean up DSM */ + for(size_t i = 0; i < dsmCount; i++){ + UA_free(dsmStore[i].data.keyFrameData.dataSetFields); +#ifdef UA_ENABLE_JSON_ENCODING + UA_free(dsmStore[i].data.keyFrameData.fieldNames); +#endif + } + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_unfreezeWriterGroupConfiguration(UA_Server *server, const UA_NodeId writerGroup){ + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + //if(wg->config.rtLevel == UA_PUBSUB_RT_NONE){ + // UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + // "PubSub configuration freeze without RT configuration has no effect."); + // return UA_STATUSCODE_BADCONFIGURATIONERROR; + //} + //PubSubConnection freezeCounter-- + UA_PubSubConnection *pubSubConnection = wg->linkedConnection; + pubSubConnection->configurationFreezeCounter--; + if(pubSubConnection->configurationFreezeCounter == 0){ + pubSubConnection->configurationFrozen = UA_FALSE; + } + //WriterGroup unfreeze + wg->configurationFrozen = UA_FALSE; + //DataSetWriter unfreeze + UA_DataSetWriter *dataSetWriter; + LIST_FOREACH(dataSetWriter, &wg->writers, listEntry) { + UA_PublishedDataSet *publishedDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + //PublishedDataSet freezeCounter-- + publishedDataSet->configurationFreezeCounter--; + if(publishedDataSet->configurationFreezeCounter == 0){ + publishedDataSet->configurationFrozen = UA_FALSE; + UA_DataSetField *dataSetField; + TAILQ_FOREACH(dataSetField, &publishedDataSet->fields, listEntry){ + dataSetField->configurationFrozen = UA_FALSE; + } + } + dataSetWriter->configurationFrozen = UA_FALSE; + } + if(wg->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) + UA_ByteString_clear(&wg->bufferedMessage.buffer); + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode UA_EXPORT +UA_Server_setWriterGroupOperational(UA_Server *server, const UA_NodeId writerGroup){ + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + return UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, wg); +} + +UA_StatusCode UA_EXPORT +UA_Server_setWriterGroupDisabled(UA_Server *server, const UA_NodeId writerGroup){ + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + return UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, wg); +} + +/**********************************************/ +/* PublishedDataSet */ +/**********************************************/ +UA_StatusCode +UA_PublishedDataSetConfig_copy(const UA_PublishedDataSetConfig *src, + UA_PublishedDataSetConfig *dst) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + memcpy(dst, src, sizeof(UA_PublishedDataSetConfig)); + res |= UA_String_copy(&src->name, &dst->name); + switch(src->publishedDataSetType){ + case UA_PUBSUB_DATASET_PUBLISHEDITEMS: + //no additional items + break; + + case UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE: + if(src->config.itemsTemplate.variablesToAddSize > 0){ + dst->config.itemsTemplate.variablesToAdd = (UA_PublishedVariableDataType *) + UA_calloc(src->config.itemsTemplate.variablesToAddSize, + sizeof(UA_PublishedVariableDataType)); + if(!dst->config.itemsTemplate.variablesToAdd) { + res = UA_STATUSCODE_BADOUTOFMEMORY; + break; + } + dst->config.itemsTemplate.variablesToAddSize = + src->config.itemsTemplate.variablesToAddSize; + } + + for(size_t i = 0; i < src->config.itemsTemplate.variablesToAddSize; i++){ + res |= UA_PublishedVariableDataType_copy(&src->config.itemsTemplate.variablesToAdd[i], + &dst->config.itemsTemplate.variablesToAdd[i]); + } + res |= UA_DataSetMetaDataType_copy(&src->config.itemsTemplate.metaData, + &dst->config.itemsTemplate.metaData); + break; + + default: + res = UA_STATUSCODE_BADINVALIDARGUMENT; + break; + } + + if(res != UA_STATUSCODE_GOOD) + UA_PublishedDataSetConfig_clear(dst); + return res; +} + +UA_StatusCode +UA_Server_getPublishedDataSetConfig(UA_Server *server, const UA_NodeId pds, + UA_PublishedDataSetConfig *config){ + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_PublishedDataSet *currentPublishedDataSet = UA_PublishedDataSet_findPDSbyId(server, pds); + if(!currentPublishedDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + UA_PublishedDataSetConfig tmpPublishedDataSetConfig; + //deep copy of the actual config + UA_PublishedDataSetConfig_copy(¤tPublishedDataSet->config, &tmpPublishedDataSetConfig); + *config = tmpPublishedDataSetConfig; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_getPublishedDataSetMetaData(UA_Server *server, const UA_NodeId pds, + UA_DataSetMetaDataType *metaData) { + if(!metaData) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_PublishedDataSet *currentPublishedDataSet = UA_PublishedDataSet_findPDSbyId(server, pds); + if(!currentPublishedDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + return UA_DataSetMetaDataType_copy(¤tPublishedDataSet->dataSetMetaData, metaData); +} + +UA_PublishedDataSet * +UA_PublishedDataSet_findPDSbyId(UA_Server *server, UA_NodeId identifier) { + UA_PublishedDataSet *tmpPDS; + TAILQ_FOREACH(tmpPDS, &server->pubSubManager.publishedDataSets, listEntry) { + if(UA_NodeId_equal(&tmpPDS->identifier, &identifier)) + break; + } + return tmpPDS; +} + +void +UA_PublishedDataSetConfig_clear(UA_PublishedDataSetConfig *pdsConfig) { + //delete pds config + UA_String_clear(&pdsConfig->name); + switch (pdsConfig->publishedDataSetType){ + case UA_PUBSUB_DATASET_PUBLISHEDITEMS: + //no additional items + break; + case UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE: + if(pdsConfig->config.itemsTemplate.variablesToAddSize > 0){ + for(size_t i = 0; i < pdsConfig->config.itemsTemplate.variablesToAddSize; i++){ + UA_PublishedVariableDataType_clear(&pdsConfig->config.itemsTemplate.variablesToAdd[i]); + } + UA_free(pdsConfig->config.itemsTemplate.variablesToAdd); + } + UA_DataSetMetaDataType_clear(&pdsConfig->config.itemsTemplate.metaData); + break; + default: + break; + } +} + +void +UA_PublishedDataSet_clear(UA_Server *server, UA_PublishedDataSet *publishedDataSet) { + UA_PublishedDataSetConfig_clear(&publishedDataSet->config); + //delete PDS + UA_DataSetField *field, *tmpField; + TAILQ_FOREACH_SAFE(field, &publishedDataSet->fields, listEntry, tmpField) { + UA_Server_removeDataSetField(server, field->identifier); + } + UA_DataSetMetaDataType_clear(&publishedDataSet->dataSetMetaData); + UA_NodeId_clear(&publishedDataSet->identifier); +} + +static UA_StatusCode +generateFieldMetaData(UA_Server *server, UA_DataSetField *field, UA_FieldMetaData *fieldMetaData) { + switch (field->config.dataSetFieldType){ + case UA_PUBSUB_DATASETFIELD_VARIABLE: + if(UA_String_copy(&field->config.field.variable.fieldNameAlias, &fieldMetaData->name) != UA_STATUSCODE_GOOD) + return UA_STATUSCODE_BADINTERNALERROR; + fieldMetaData->description = UA_LOCALIZEDTEXT_ALLOC("", ""); + fieldMetaData->dataSetFieldId = UA_GUID_NULL; + + //ToDo after freeze PR, the value source must be checked (other behavior for static value source) + if(field->config.field.variable.rtValueSource.rtFieldSourceEnabled && + !field->config.field.variable.rtValueSource.rtInformationModelNode) { + if((**(field->config.field.variable.rtValueSource.staticValueSource)).value.arrayDimensionsSize > 0) { + fieldMetaData->arrayDimensions = (UA_UInt32 *) UA_calloc( + (*(*(field->config.field.variable.rtValueSource.staticValueSource))).value.arrayDimensionsSize, sizeof(UA_UInt32)); + if(fieldMetaData->arrayDimensions == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(fieldMetaData->arrayDimensions, + (*(field->config.field.variable.rtValueSource.staticValueSource))->value.arrayDimensions, + sizeof(UA_UInt32) * ((*(*(field->config.field.variable.rtValueSource.staticValueSource))).value.arrayDimensionsSize)); + } + fieldMetaData->arrayDimensionsSize = (**(field->config.field.variable.rtValueSource.staticValueSource)).value.arrayDimensionsSize; + if(UA_NodeId_copy(&(**field->config.field.variable.rtValueSource.staticValueSource).value.type->typeId, + &fieldMetaData->dataType) != UA_STATUSCODE_GOOD){ + if(fieldMetaData->arrayDimensions){ + UA_free(fieldMetaData->arrayDimensions); + return UA_STATUSCODE_BADINTERNALERROR; + } + } + fieldMetaData->properties = NULL; + fieldMetaData->propertiesSize = 0; + //TODO collect value rank for the static field source + fieldMetaData->fieldFlags = UA_DATASETFIELDFLAGS_NONE; + return UA_STATUSCODE_GOOD; + } + UA_Variant value; + UA_Variant_init(&value); + if(UA_Server_readArrayDimensions(server, field->config.field.variable.publishParameters.publishedVariable, + &value) != UA_STATUSCODE_GOOD){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub meta data generation. Reading ArrayDimension failed."); + } else { + if (value.arrayDimensionsSize > 0) { + fieldMetaData->arrayDimensions = (UA_UInt32 *) UA_calloc(value.arrayDimensionsSize, sizeof(UA_UInt32)); + if(fieldMetaData->arrayDimensions == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(fieldMetaData->arrayDimensions, value.arrayDimensions, sizeof(UA_UInt32)*value.arrayDimensionsSize); + } + fieldMetaData->arrayDimensionsSize = value.arrayDimensionsSize; + } + if(UA_Server_readDataType(server, field->config.field.variable.publishParameters.publishedVariable, + &fieldMetaData->dataType) != UA_STATUSCODE_GOOD){ + if(fieldMetaData->arrayDimensions){ + UA_free(fieldMetaData->arrayDimensions); + return UA_STATUSCODE_BADINTERNALERROR; + } + } + fieldMetaData->properties = NULL; + fieldMetaData->propertiesSize = 0; + UA_Int32 valueRank; + if(UA_Server_readValueRank(server, field->config.field.variable.publishParameters.publishedVariable, + &valueRank) != UA_STATUSCODE_GOOD){ + if(fieldMetaData->arrayDimensions){ + UA_free(fieldMetaData->arrayDimensions); + return UA_STATUSCODE_BADINTERNALERROR; + } + } + fieldMetaData->valueRank = valueRank; + if(field->config.field.variable.promotedField){ + fieldMetaData->fieldFlags = UA_DATASETFIELDFLAGS_PROMOTEDFIELD; + } else { + fieldMetaData->fieldFlags = UA_DATASETFIELDFLAGS_NONE; + } + //TODO collect the following fields*/ + //fieldMetaData.builtInType + //fieldMetaData.maxStringLength + return UA_STATUSCODE_GOOD; + case UA_PUBSUB_DATASETFIELD_EVENT: + return UA_STATUSCODE_BADNOTSUPPORTED; + default: + return UA_STATUSCODE_BADNOTSUPPORTED; + } +} + +UA_DataSetFieldResult +UA_Server_addDataSetField(UA_Server *server, const UA_NodeId publishedDataSet, + const UA_DataSetFieldConfig *fieldConfig, + UA_NodeId *fieldIdentifier) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_DataSetFieldResult result = {UA_STATUSCODE_BADINVALIDARGUMENT, {0, 0}}; + if(!fieldConfig) + return result; + + UA_PublishedDataSet *currentDataSet = UA_PublishedDataSet_findPDSbyId(server, publishedDataSet); + if(currentDataSet == NULL){ + result.result = UA_STATUSCODE_BADNOTFOUND; + return result; + } + + if(currentDataSet->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding DataSetField failed. PublishedDataSet is frozen."); + result.result = UA_STATUSCODE_BADCONFIGURATIONERROR; + return result; + } + + if(currentDataSet->config.publishedDataSetType != UA_PUBSUB_DATASET_PUBLISHEDITEMS){ + result.result = UA_STATUSCODE_BADNOTIMPLEMENTED; + return result; + } + + UA_DataSetField *newField = (UA_DataSetField *) UA_calloc(1, sizeof(UA_DataSetField)); + if(!newField){ + result.result = UA_STATUSCODE_BADINTERNALERROR; + return result; + } + + UA_DataSetFieldConfig tmpFieldConfig; + retVal |= UA_DataSetFieldConfig_copy(fieldConfig, &tmpFieldConfig); + newField->config = tmpFieldConfig; + UA_PubSubManager_generateUniqueNodeId(server, &newField->identifier); + if(fieldIdentifier != NULL){ + UA_NodeId_copy(&newField->identifier, fieldIdentifier); + } + newField->publishedDataSet = currentDataSet->identifier; + //update major version of parent published data set + currentDataSet->dataSetMetaData.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference(); + /* The order of DataSetFields should be the same in both creating and publishing. + * So adding DataSetFields at the the end of the DataSets using TAILQ structure */ + if (currentDataSet->fieldSize != 0) + TAILQ_INSERT_TAIL(¤tDataSet->fields, newField, listEntry); + else + TAILQ_INSERT_HEAD(¤tDataSet->fields, newField, listEntry); + + if(newField->config.field.variable.promotedField) + currentDataSet->promotedFieldsCount++; + currentDataSet->fieldSize++; + + //generate fieldMetadata within the DataSetMetaData + currentDataSet->dataSetMetaData.fieldsSize++; + UA_FieldMetaData *fieldMetaData = (UA_FieldMetaData *) + UA_realloc(currentDataSet->dataSetMetaData.fields, currentDataSet->dataSetMetaData.fieldsSize * + sizeof(UA_FieldMetaData)); + if(!fieldMetaData){ + result.result = UA_STATUSCODE_BADOUTOFMEMORY; + return result; + } + currentDataSet->dataSetMetaData.fields = fieldMetaData; + + UA_FieldMetaData_init(&fieldMetaData[currentDataSet->fieldSize-1]); + if(generateFieldMetaData(server, newField, &fieldMetaData[currentDataSet->fieldSize-1]) != UA_STATUSCODE_GOOD){ + UA_Server_removeDataSetField(server, newField->identifier); + result.result = UA_STATUSCODE_BADINTERNALERROR; + return result; + } + UA_DataSetField *dsf; + size_t counter = 0; + TAILQ_FOREACH(dsf, ¤tDataSet->fields, listEntry){ + dsf->fieldMetaData = fieldMetaData[counter++]; + } + result.result = retVal; + result.configurationVersion.majorVersion = currentDataSet->dataSetMetaData.configurationVersion.majorVersion; + result.configurationVersion.minorVersion = currentDataSet->dataSetMetaData.configurationVersion.minorVersion; + return result; +} + +UA_DataSetFieldResult +UA_Server_removeDataSetField(UA_Server *server, const UA_NodeId dsf) { + UA_DataSetField *currentField = UA_DataSetField_findDSFbyId(server, dsf); + UA_DataSetFieldResult result = {UA_STATUSCODE_BADNOTFOUND, {0, 0}}; + if(!currentField) + return result; + + if(currentField->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetField failed. DataSetField is frozen."); + result.result = UA_STATUSCODE_BADCONFIGURATIONERROR; + return result; + } + + UA_PublishedDataSet *parentPublishedDataSet = + UA_PublishedDataSet_findPDSbyId(server, currentField->publishedDataSet); + if(!parentPublishedDataSet) + return result; + + if(parentPublishedDataSet->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetField failed. PublishedDataSet is frozen."); + result.result = UA_STATUSCODE_BADCONFIGURATIONERROR; + return result; + } + + parentPublishedDataSet->fieldSize--; + if(currentField->config.field.variable.promotedField) + parentPublishedDataSet->promotedFieldsCount--; + /* update major version of PublishedDataSet */ + parentPublishedDataSet->dataSetMetaData.configurationVersion.majorVersion = + UA_PubSubConfigurationVersionTimeDifference(); + + currentField->fieldMetaData.arrayDimensions = NULL; + currentField->fieldMetaData.properties = NULL; + currentField->fieldMetaData.name = UA_STRING_NULL; + currentField->fieldMetaData.description.locale = UA_STRING_NULL; + currentField->fieldMetaData.description.text = UA_STRING_NULL; + UA_DataSetField_clear(currentField); + TAILQ_REMOVE(&parentPublishedDataSet->fields, currentField, listEntry); + UA_free(currentField); + + result.result = UA_STATUSCODE_GOOD; + //regenerate DataSetMetaData + parentPublishedDataSet->dataSetMetaData.fieldsSize--; + if(parentPublishedDataSet->dataSetMetaData.fieldsSize > 0){ + for(size_t i = 0; i < parentPublishedDataSet->dataSetMetaData.fieldsSize+1; i++) { + UA_FieldMetaData_clear(&parentPublishedDataSet->dataSetMetaData.fields[i]); + } + UA_free(parentPublishedDataSet->dataSetMetaData.fields); + UA_FieldMetaData *fieldMetaData = (UA_FieldMetaData *) + UA_calloc(parentPublishedDataSet->dataSetMetaData.fieldsSize, + sizeof(UA_FieldMetaData)); + if(!fieldMetaData){ + result.result = UA_STATUSCODE_BADOUTOFMEMORY; + return result; + } + UA_DataSetField *tmpDSF; + size_t counter = 0; + TAILQ_FOREACH(tmpDSF, &parentPublishedDataSet->fields, listEntry){ + UA_FieldMetaData tmpFieldMetaData; + UA_FieldMetaData_init(&tmpFieldMetaData); + if(generateFieldMetaData(server, tmpDSF, &tmpFieldMetaData) != UA_STATUSCODE_GOOD){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub MetaData generation failed!"); + //TODO how to ensure consistency if the metadata regeneration fails + result.result = UA_STATUSCODE_BADINTERNALERROR; + } + fieldMetaData[counter++] = tmpFieldMetaData; + } + parentPublishedDataSet->dataSetMetaData.fields = fieldMetaData; + } else { + UA_FieldMetaData_delete(parentPublishedDataSet->dataSetMetaData.fields); + parentPublishedDataSet->dataSetMetaData.fields = NULL; + } + + result.configurationVersion.majorVersion = parentPublishedDataSet->dataSetMetaData.configurationVersion.majorVersion; + result.configurationVersion.minorVersion = parentPublishedDataSet->dataSetMetaData.configurationVersion.minorVersion; + return result; +} + +/**********************************************/ +/* DataSetWriter */ +/**********************************************/ + +UA_StatusCode +UA_DataSetWriterConfig_copy(const UA_DataSetWriterConfig *src, + UA_DataSetWriterConfig *dst){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + memcpy(dst, src, sizeof(UA_DataSetWriterConfig)); + retVal |= UA_String_copy(&src->name, &dst->name); + retVal |= UA_String_copy(&src->dataSetName, &dst->dataSetName); + retVal |= UA_ExtensionObject_copy(&src->messageSettings, &dst->messageSettings); + if (src->dataSetWriterPropertiesSize > 0) { + dst->dataSetWriterProperties = (UA_KeyValuePair *) + UA_calloc(src->dataSetWriterPropertiesSize, sizeof(UA_KeyValuePair)); + if(!dst->dataSetWriterProperties) + return UA_STATUSCODE_BADOUTOFMEMORY; + for(size_t i = 0; i < src->dataSetWriterPropertiesSize; i++){ + retVal |= UA_KeyValuePair_copy(&src->dataSetWriterProperties[i], &dst->dataSetWriterProperties[i]); + } + } + return retVal; +} + +UA_StatusCode +UA_Server_getDataSetWriterConfig(UA_Server *server, const UA_NodeId dsw, + UA_DataSetWriterConfig *config){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_DataSetWriter *currentDataSetWriter = UA_DataSetWriter_findDSWbyId(server, dsw); + if(!currentDataSetWriter) + return UA_STATUSCODE_BADNOTFOUND; + + UA_DataSetWriterConfig tmpWriterConfig; + //deep copy of the actual config + retVal |= UA_DataSetWriterConfig_copy(¤tDataSetWriter->config, &tmpWriterConfig); + *config = tmpWriterConfig; + return retVal; +} + +UA_StatusCode +UA_Server_DataSetWriter_getState(UA_Server *server, UA_NodeId dataSetWriterIdentifier, + UA_PubSubState *state) { + if((server == NULL) || (state == NULL)) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_DataSetWriter *currentDataSetWriter = UA_DataSetWriter_findDSWbyId(server, dataSetWriterIdentifier); + if(currentDataSetWriter == NULL) + return UA_STATUSCODE_BADNOTFOUND; + *state = currentDataSetWriter->state; + return UA_STATUSCODE_GOOD; +} + +UA_DataSetWriter * +UA_DataSetWriter_findDSWbyId(UA_Server *server, UA_NodeId identifier) { + UA_PubSubConnection *pubSubConnection; + TAILQ_FOREACH(pubSubConnection, &server->pubSubManager.connections, listEntry){ + UA_WriterGroup *tmpWriterGroup; + LIST_FOREACH(tmpWriterGroup, &pubSubConnection->writerGroups, listEntry){ + UA_DataSetWriter *tmpWriter; + LIST_FOREACH(tmpWriter, &tmpWriterGroup->writers, listEntry){ + if(UA_NodeId_equal(&tmpWriter->identifier, &identifier)){ + return tmpWriter; + } + } + } + } + return NULL; +} + +void +UA_DataSetWriterConfig_clear(UA_DataSetWriterConfig *pdsConfig) { + UA_String_clear(&pdsConfig->name); + UA_String_clear(&pdsConfig->dataSetName); + for(size_t i = 0; i < pdsConfig->dataSetWriterPropertiesSize; i++){ + UA_KeyValuePair_clear(&pdsConfig->dataSetWriterProperties[i]); + } + UA_free(pdsConfig->dataSetWriterProperties); + UA_ExtensionObject_clear(&pdsConfig->messageSettings); +} + +static void +UA_DataSetWriter_clear(UA_Server *server, UA_DataSetWriter *dataSetWriter) { + UA_DataSetWriterConfig_clear(&dataSetWriter->config); + //delete DataSetWriter + UA_NodeId_clear(&dataSetWriter->identifier); + UA_NodeId_clear(&dataSetWriter->linkedWriterGroup); + UA_NodeId_clear(&dataSetWriter->connectedDataSet); +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES + //delete lastSamples store + for(size_t i = 0; i < dataSetWriter->lastSamplesCount; i++) { + UA_DataValue_clear(&dataSetWriter->lastSamples[i].value); + } + UA_free(dataSetWriter->lastSamples); + dataSetWriter->lastSamples = NULL; + dataSetWriter->lastSamplesCount = 0; +#endif +} + +//state machine methods not part of the open62541 state machine API +UA_StatusCode +UA_DataSetWriter_setPubSubState(UA_Server *server, UA_PubSubState state, UA_DataSetWriter *dataSetWriter) { + switch(state){ + case UA_PUBSUBSTATE_DISABLED: + switch (dataSetWriter->state){ + case UA_PUBSUBSTATE_DISABLED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_PAUSED: + dataSetWriter->state = UA_PUBSUBSTATE_DISABLED; + //no further action is required + break; + case UA_PUBSUBSTATE_OPERATIONAL: + dataSetWriter->state = UA_PUBSUBSTATE_DISABLED; + + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_PAUSED: + switch (dataSetWriter->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_OPERATIONAL: + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_OPERATIONAL: + switch (dataSetWriter->state){ + case UA_PUBSUBSTATE_DISABLED: + dataSetWriter->state = UA_PUBSUBSTATE_OPERATIONAL; + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_ERROR: + switch (dataSetWriter->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + break; + case UA_PUBSUBSTATE_ERROR: + return UA_STATUSCODE_GOOD; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + return UA_STATUSCODE_GOOD; +} + +/**********************************************/ +/* WriterGroup */ +/**********************************************/ + +UA_StatusCode +UA_WriterGroupConfig_copy(const UA_WriterGroupConfig *src, + UA_WriterGroupConfig *dst){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + memcpy(dst, src, sizeof(UA_WriterGroupConfig)); + retVal |= UA_String_copy(&src->name, &dst->name); + retVal |= UA_ExtensionObject_copy(&src->transportSettings, &dst->transportSettings); + retVal |= UA_ExtensionObject_copy(&src->messageSettings, &dst->messageSettings); + if (src->groupPropertiesSize > 0) { + dst->groupProperties = (UA_KeyValuePair *) UA_calloc(src->groupPropertiesSize, sizeof(UA_KeyValuePair)); + if(!dst->groupProperties) + return UA_STATUSCODE_BADOUTOFMEMORY; + for(size_t i = 0; i < src->groupPropertiesSize; i++){ + retVal |= UA_KeyValuePair_copy(&src->groupProperties[i], &dst->groupProperties[i]); + } + } + return retVal; +} + +UA_StatusCode +UA_Server_getWriterGroupConfig(UA_Server *server, const UA_NodeId writerGroup, + UA_WriterGroupConfig *config){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_WriterGroup *currentWriterGroup = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!currentWriterGroup){ + return UA_STATUSCODE_BADNOTFOUND; + } + UA_WriterGroupConfig tmpWriterGroupConfig; + //deep copy of the actual config + retVal |= UA_WriterGroupConfig_copy(¤tWriterGroup->config, &tmpWriterGroupConfig); + *config = tmpWriterGroupConfig; + return retVal; +} + +UA_StatusCode +UA_Server_updateWriterGroupConfig(UA_Server *server, UA_NodeId writerGroupIdentifier, + const UA_WriterGroupConfig *config){ + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_WriterGroup *currentWriterGroup = UA_WriterGroup_findWGbyId(server, writerGroupIdentifier); + if(!currentWriterGroup) + return UA_STATUSCODE_BADNOTFOUND; + + if(currentWriterGroup->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Modify WriterGroup failed. WriterGroup is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + //The update functionality will be extended during the next PubSub batches. + //Currently is only a change of the publishing interval possible. + if(currentWriterGroup->config.maxEncapsulatedDataSetMessageCount != config->maxEncapsulatedDataSetMessageCount){ + currentWriterGroup->config.maxEncapsulatedDataSetMessageCount = config->maxEncapsulatedDataSetMessageCount; + if(currentWriterGroup->config.messageSettings.encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "MaxEncapsulatedDataSetMessag need enabled 'PayloadHeader' within the message settings."); + } + } + if(currentWriterGroup->config.publishingInterval != config->publishingInterval) { + if(currentWriterGroup->config.rtLevel == UA_PUBSUB_RT_NONE && currentWriterGroup->state == UA_PUBSUBSTATE_OPERATIONAL){ + if(currentWriterGroup->config.pubsubManagerCallback.removeCustomCallback) + currentWriterGroup->config.pubsubManagerCallback.removeCustomCallback(server, currentWriterGroup->identifier, currentWriterGroup->publishCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, currentWriterGroup->publishCallbackId); + + currentWriterGroup->config.publishingInterval = config->publishingInterval; + UA_WriterGroup_addPublishCallback(server, currentWriterGroup); + } else { + currentWriterGroup->config.publishingInterval = config->publishingInterval; + } + } + if(currentWriterGroup->config.priority != config->priority) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "No or unsupported WriterGroup update."); + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_WriterGroup_getState(UA_Server *server, UA_NodeId writerGroupIdentifier, + UA_PubSubState *state) { + if((server == NULL) || (state == NULL)) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_WriterGroup *currentWriterGroup = UA_WriterGroup_findWGbyId(server, writerGroupIdentifier); + if(currentWriterGroup == NULL) + return UA_STATUSCODE_BADNOTFOUND; + *state = currentWriterGroup->state; + return UA_STATUSCODE_GOOD; +} + +UA_WriterGroup * +UA_WriterGroup_findWGbyId(UA_Server *server, UA_NodeId identifier){ + UA_PubSubConnection *tmpConnection; + TAILQ_FOREACH(tmpConnection, &server->pubSubManager.connections, listEntry){ + UA_WriterGroup *tmpWriterGroup; + LIST_FOREACH(tmpWriterGroup, &tmpConnection->writerGroups, listEntry) { + if(UA_NodeId_equal(&identifier, &tmpWriterGroup->identifier)){ + return tmpWriterGroup; + } + } + } + return NULL; +} + +void +UA_WriterGroupConfig_clear(UA_WriterGroupConfig *writerGroupConfig){ + //delete writerGroup config + UA_String_clear(&writerGroupConfig->name); + UA_ExtensionObject_clear(&writerGroupConfig->transportSettings); + UA_ExtensionObject_clear(&writerGroupConfig->messageSettings); + UA_Array_delete(writerGroupConfig->groupProperties, + writerGroupConfig->groupPropertiesSize, + &UA_TYPES[UA_TYPES_KEYVALUEPAIR]); + writerGroupConfig->groupProperties = NULL; +} + +static void +UA_WriterGroup_clear(UA_Server *server, UA_WriterGroup *writerGroup) { + UA_WriterGroupConfig_clear(&writerGroup->config); + //delete WriterGroup + //delete all writers. Therefore removeDataSetWriter is called from PublishedDataSet + UA_DataSetWriter *dataSetWriter, *tmpDataSetWriter; + LIST_FOREACH_SAFE(dataSetWriter, &writerGroup->writers, listEntry, tmpDataSetWriter){ + UA_Server_removeDataSetWriter(server, dataSetWriter->identifier); + } + if(writerGroup->bufferedMessage.offsetsSize > 0){ + for (size_t i = 0; i < writerGroup->bufferedMessage.offsetsSize; i++) { + if(writerGroup->bufferedMessage.offsets[i].contentType == UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT){ + UA_DataValue_delete(writerGroup->bufferedMessage.offsets[i].offsetData.value.value); + } + } + UA_ByteString_clear(&writerGroup->bufferedMessage.buffer); + UA_free(writerGroup->bufferedMessage.offsets); + } + UA_NodeId_clear(&writerGroup->identifier); +} + +UA_StatusCode +UA_WriterGroup_setPubSubState(UA_Server *server, UA_PubSubState state, UA_WriterGroup *writerGroup){ + UA_DataSetWriter *dataSetWriter; + switch(state){ + case UA_PUBSUBSTATE_DISABLED: + switch (writerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + if(writerGroup->config.pubsubManagerCallback.removeCustomCallback) + writerGroup->config.pubsubManagerCallback.removeCustomCallback(server, writerGroup->identifier, writerGroup->publishCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, writerGroup->publishCallbackId); + + LIST_FOREACH(dataSetWriter, &writerGroup->writers, listEntry){ + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, dataSetWriter); + } + writerGroup->state = UA_PUBSUBSTATE_DISABLED; + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_PAUSED: + switch (writerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_OPERATIONAL: + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_OPERATIONAL: + switch (writerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + writerGroup->state = UA_PUBSUBSTATE_OPERATIONAL; + if(writerGroup->config.pubsubManagerCallback.removeCustomCallback) + writerGroup->config.pubsubManagerCallback.removeCustomCallback(server, writerGroup->identifier, writerGroup->publishCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, writerGroup->publishCallbackId); + + LIST_FOREACH(dataSetWriter, &writerGroup->writers, listEntry){ + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, dataSetWriter); + } + UA_WriterGroup_addPublishCallback(server, writerGroup); + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_ERROR: { + switch (writerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + UA_PubSubManager_removeRepeatedPubSubCallback(server, writerGroup->publishCallbackId); + LIST_FOREACH(dataSetWriter, &writerGroup->writers, listEntry){ + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dataSetWriter); + } + break; + case UA_PUBSUBSTATE_ERROR: + return UA_STATUSCODE_GOOD; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + writerGroup->state = UA_PUBSUBSTATE_ERROR; + /* TODO: WIP - example usage of pubsubStateChangeCallback -> inform application about error state, reason param necessary */ + UA_ServerConfig *pConfig = UA_Server_getConfig(server); + if (pConfig->pubsubConfiguration->pubsubStateChangeCallback != 0) { + pConfig->pubsubConfiguration->pubsubStateChangeCallback(&writerGroup->identifier, UA_PUBSUBSTATE_ERROR, UA_STATUSCODE_BADINTERNALERROR); + } + break; + } + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + return UA_STATUSCODE_GOOD; +} + + +UA_StatusCode +UA_Server_addDataSetWriter(UA_Server *server, + const UA_NodeId writerGroup, const UA_NodeId dataSet, + const UA_DataSetWriterConfig *dataSetWriterConfig, + UA_NodeId *writerIdentifier) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(!dataSetWriterConfig) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_PublishedDataSet *currentDataSetContext = UA_PublishedDataSet_findPDSbyId(server, dataSet); + if(!currentDataSetContext) + return UA_STATUSCODE_BADNOTFOUND; + + if(currentDataSetContext->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding DataSetWriter failed. PublishedDataSet is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, writerGroup); + if(!wg) + return UA_STATUSCODE_BADNOTFOUND; + + if(wg->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding DataSetWriter failed. WriterGroup is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + if(wg->config.rtLevel != UA_PUBSUB_RT_NONE){ + UA_DataSetField *tmpDSF; + TAILQ_FOREACH(tmpDSF, ¤tDataSetContext->fields, listEntry){ + if(tmpDSF->config.field.variable.rtValueSource.rtFieldSourceEnabled != UA_TRUE && + tmpDSF->config.field.variable.rtValueSource.rtInformationModelNode != UA_TRUE){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding DataSetWriter failed. Fields in PDS are not RT capable."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + } + } + + UA_DataSetWriter *newDataSetWriter = (UA_DataSetWriter *) UA_calloc(1, sizeof(UA_DataSetWriter)); + if(!newDataSetWriter) + return UA_STATUSCODE_BADOUTOFMEMORY; + + newDataSetWriter->componentType = UA_PUBSUB_COMPONENT_DATASETWRITER; + + if (wg->state == UA_PUBSUBSTATE_OPERATIONAL) { + retVal = UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, newDataSetWriter); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Add DataSetWriter failed. setPubSubState failed."); + return retVal; + } + } + + //copy the config into the new dataSetWriter + UA_DataSetWriterConfig tmpDataSetWriterConfig; + retVal |= UA_DataSetWriterConfig_copy(dataSetWriterConfig, &tmpDataSetWriterConfig); + newDataSetWriter->config = tmpDataSetWriterConfig; + //save the current version of the connected PublishedDataSet + newDataSetWriter->connectedDataSetVersion = currentDataSetContext->dataSetMetaData.configurationVersion; + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES + //initialize the queue for the last values + if (currentDataSetContext->fieldSize > 0) { + newDataSetWriter->lastSamples = (UA_DataSetWriterSample * ) + UA_calloc(currentDataSetContext->fieldSize, sizeof(UA_DataSetWriterSample)); + if(!newDataSetWriter->lastSamples) { + UA_DataSetWriterConfig_clear(&newDataSetWriter->config); + UA_free(newDataSetWriter); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + newDataSetWriter->lastSamplesCount = currentDataSetContext->fieldSize; + for(size_t i = 0; i < newDataSetWriter->lastSamplesCount; i++) { + UA_DataValue_init(&newDataSetWriter->lastSamples[i].value); + newDataSetWriter->lastSamples[i].valueChanged = false; + } + } +#endif + + //connect PublishedDataSet with DataSetWriter + newDataSetWriter->connectedDataSet = currentDataSetContext->identifier; + newDataSetWriter->linkedWriterGroup = wg->identifier; + UA_PubSubManager_generateUniqueNodeId(server, &newDataSetWriter->identifier); + if(writerIdentifier != NULL) + UA_NodeId_copy(&newDataSetWriter->identifier, writerIdentifier); + //add the new writer to the group + LIST_INSERT_HEAD(&wg->writers, newDataSetWriter, listEntry); + wg->writersCount++; +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addDataSetWriterRepresentation(server, newDataSetWriter); +#endif + return retVal; +} + +UA_StatusCode +UA_Server_removeDataSetWriter(UA_Server *server, const UA_NodeId dsw){ + UA_DataSetWriter *dataSetWriter = UA_DataSetWriter_findDSWbyId(server, dsw); + if(!dataSetWriter) + return UA_STATUSCODE_BADNOTFOUND; + + if(dataSetWriter->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetWriter failed. DataSetWriter is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + UA_WriterGroup *linkedWriterGroup = + UA_WriterGroup_findWGbyId(server, dataSetWriter->linkedWriterGroup); + if(!linkedWriterGroup) + return UA_STATUSCODE_BADNOTFOUND; + + if(linkedWriterGroup->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetWriter failed. WriterGroup is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + UA_PublishedDataSet *publishedDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + if(!publishedDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + linkedWriterGroup->writersCount--; +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removeDataSetWriterRepresentation(server, dataSetWriter); +#endif + + //remove DataSetWriter from group + UA_DataSetWriter_clear(server, dataSetWriter); + LIST_REMOVE(dataSetWriter, listEntry); + UA_free(dataSetWriter); + return UA_STATUSCODE_GOOD; +} + +/**********************************************/ +/* DataSetField */ +/**********************************************/ + +UA_StatusCode +UA_DataSetFieldConfig_copy(const UA_DataSetFieldConfig *src, UA_DataSetFieldConfig *dst){ + memcpy(dst, src, sizeof(UA_DataSetFieldConfig)); + if(src->dataSetFieldType == UA_PUBSUB_DATASETFIELD_VARIABLE) { + UA_String_copy(&src->field.variable.fieldNameAlias, &dst->field.variable.fieldNameAlias); + UA_PublishedVariableDataType_copy(&src->field.variable.publishParameters, + &dst->field.variable.publishParameters); + } else { + return UA_STATUSCODE_BADNOTSUPPORTED; + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_getDataSetFieldConfig(UA_Server *server, const UA_NodeId dsf, + UA_DataSetFieldConfig *config) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_DataSetField *currentDataSetField = UA_DataSetField_findDSFbyId(server, dsf); + if(!currentDataSetField) + return UA_STATUSCODE_BADNOTFOUND; + UA_DataSetFieldConfig tmpFieldConfig; + //deep copy of the actual config + retVal |= UA_DataSetFieldConfig_copy(¤tDataSetField->config, &tmpFieldConfig); + *config = tmpFieldConfig; + return retVal; +} + +UA_DataSetField * +UA_DataSetField_findDSFbyId(UA_Server *server, UA_NodeId identifier) { + UA_PublishedDataSet *tmpPDS; + TAILQ_FOREACH(tmpPDS, &server->pubSubManager.publishedDataSets, listEntry){ + UA_DataSetField *tmpField; + TAILQ_FOREACH(tmpField, &tmpPDS->fields, listEntry){ + if(UA_NodeId_equal(&tmpField->identifier, &identifier)){ + return tmpField; + } + } + } + return NULL; +} + +void +UA_DataSetFieldConfig_clear(UA_DataSetFieldConfig *dataSetFieldConfig){ + if(dataSetFieldConfig->dataSetFieldType == UA_PUBSUB_DATASETFIELD_VARIABLE){ + UA_String_clear(&dataSetFieldConfig->field.variable.fieldNameAlias); + UA_PublishedVariableDataType_clear(&dataSetFieldConfig->field.variable.publishParameters); + } +} + +static void +UA_DataSetField_clear(UA_DataSetField *field) { + UA_DataSetFieldConfig_clear(&field->config); + //delete DataSetField + UA_NodeId_clear(&field->identifier); + UA_NodeId_clear(&field->publishedDataSet); + UA_FieldMetaData_clear(&field->fieldMetaData); +} + +/*********************************************************/ +/* PublishValues handling */ +/*********************************************************/ + +/** + * Compare two variants. Internally used for value change detection. + * + * @return true if the value has changed + */ +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES +static UA_Boolean +valueChangedVariant(UA_Variant *oldValue, UA_Variant *newValue){ + if(! (oldValue && newValue)) + return false; + + UA_ByteString *oldValueEncoding = UA_ByteString_new(), *newValueEncoding = UA_ByteString_new(); + size_t oldValueEncodingSize, newValueEncodingSize; + oldValueEncodingSize = UA_calcSizeBinary(oldValue, &UA_TYPES[UA_TYPES_VARIANT]); + newValueEncodingSize = UA_calcSizeBinary(newValue, &UA_TYPES[UA_TYPES_VARIANT]); + if((oldValueEncodingSize == 0) || (newValueEncodingSize == 0)) + return false; + + if(oldValueEncodingSize != newValueEncodingSize) + return true; + + if(UA_ByteString_allocBuffer(oldValueEncoding, oldValueEncodingSize) != UA_STATUSCODE_GOOD) + return false; + + if(UA_ByteString_allocBuffer(newValueEncoding, newValueEncodingSize) != UA_STATUSCODE_GOOD) + return false; + + UA_Byte *bufPosOldValue = oldValueEncoding->data; + const UA_Byte *bufEndOldValue = &oldValueEncoding->data[oldValueEncoding->length]; + UA_Byte *bufPosNewValue = newValueEncoding->data; + const UA_Byte *bufEndNewValue = &newValueEncoding->data[newValueEncoding->length]; + if(UA_encodeBinary(oldValue, &UA_TYPES[UA_TYPES_VARIANT], + &bufPosOldValue, &bufEndOldValue, NULL, NULL) != UA_STATUSCODE_GOOD){ + return false; + } + if(UA_encodeBinary(newValue, &UA_TYPES[UA_TYPES_VARIANT], + &bufPosNewValue, &bufEndNewValue, NULL, NULL) != UA_STATUSCODE_GOOD){ + return false; + } + oldValueEncoding->length = (uintptr_t)bufPosOldValue - (uintptr_t)oldValueEncoding->data; + newValueEncoding->length = (uintptr_t)bufPosNewValue - (uintptr_t)newValueEncoding->data; + UA_Boolean compareResult = !UA_ByteString_equal(oldValueEncoding, newValueEncoding); + UA_ByteString_delete(oldValueEncoding); + UA_ByteString_delete(newValueEncoding); + return compareResult; +} +#endif + +/** + * Obtain the latest value for a specific DataSetField. This method is currently + * called inside the DataSetMessage generation process. + */ +static void +UA_PubSubDataSetField_sampleValue(UA_Server *server, UA_DataSetField *field, + UA_DataValue *value) { + /* Read the value */ + if(field->config.field.variable.rtValueSource.rtInformationModelNode) { + const UA_VariableNode *rtNode = (const UA_VariableNode *) UA_NODESTORE_GET(server, + &field->config.field.variable.publishParameters.publishedVariable); + *value = **rtNode->valueBackend.backend.external.value; + value->value.storageType = UA_VARIANT_DATA_NODELETE; + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); + } else if(field->config.field.variable.rtValueSource.rtFieldSourceEnabled == UA_FALSE){ + UA_ReadValueId rvid; + UA_ReadValueId_init(&rvid); + rvid.nodeId = field->config.field.variable.publishParameters.publishedVariable; + rvid.attributeId = field->config.field.variable.publishParameters.attributeId; + rvid.indexRange = field->config.field.variable.publishParameters.indexRange; + *value = UA_Server_read(server, &rvid, UA_TIMESTAMPSTORETURN_BOTH); + } else { + *value = **field->config.field.variable.rtValueSource.staticValueSource; + value->value.storageType = UA_VARIANT_DATA_NODELETE; + } +} + +static UA_StatusCode +UA_PubSubDataSetWriter_generateKeyFrameMessage(UA_Server *server, + UA_DataSetMessage *dataSetMessage, + UA_DataSetWriter *dataSetWriter) { + UA_PublishedDataSet *currentDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + if(!currentDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + /* Prepare DataSetMessageContent */ + dataSetMessage->header.dataSetMessageValid = true; + dataSetMessage->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME; + dataSetMessage->data.keyFrameData.fieldCount = currentDataSet->fieldSize; + dataSetMessage->data.keyFrameData.dataSetFields = (UA_DataValue *) + UA_Array_new(currentDataSet->fieldSize, &UA_TYPES[UA_TYPES_DATAVALUE]); + if(!dataSetMessage->data.keyFrameData.dataSetFields) + return UA_STATUSCODE_BADOUTOFMEMORY; + +#ifdef UA_ENABLE_JSON_ENCODING + dataSetMessage->data.keyFrameData.fieldNames = (UA_String *) + UA_Array_new(currentDataSet->fieldSize, &UA_TYPES[UA_TYPES_STRING]); + if(!dataSetMessage->data.keyFrameData.fieldNames) { + UA_DataSetMessage_clear(dataSetMessage); + return UA_STATUSCODE_BADOUTOFMEMORY; + } +#endif + + /* Loop over the fields */ + size_t counter = 0; + UA_DataSetField *dsf; + TAILQ_FOREACH(dsf, ¤tDataSet->fields, listEntry) { +#ifdef UA_ENABLE_JSON_ENCODING + /* Set the field name alias */ + UA_String_copy(&dsf->config.field.variable.fieldNameAlias, + &dataSetMessage->data.keyFrameData.fieldNames[counter]); +#endif + + /* Sample the value */ + UA_DataValue *dfv = &dataSetMessage->data.keyFrameData.dataSetFields[counter]; + UA_PubSubDataSetField_sampleValue(server, dsf, dfv); + + /* Deactivate statuscode? */ + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_STATUSCODE) == 0) + dfv->hasStatus = false; + + /* Deactivate timestamps */ + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCETIMESTAMP) == 0) + dfv->hasSourceTimestamp = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCEPICOSECONDS) == 0) + dfv->hasSourcePicoseconds = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERTIMESTAMP) == 0) + dfv->hasServerTimestamp = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERPICOSECONDS) == 0) + dfv->hasServerPicoseconds = false; + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES + /* Update lastValue store */ + UA_DataValue_clear(&dataSetWriter->lastSamples[counter].value); + UA_DataValue_copy(dfv, &dataSetWriter->lastSamples[counter].value); +#endif + + counter++; + } + return UA_STATUSCODE_GOOD; +} + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES +static UA_StatusCode +UA_PubSubDataSetWriter_generateDeltaFrameMessage(UA_Server *server, + UA_DataSetMessage *dataSetMessage, + UA_DataSetWriter *dataSetWriter) { + UA_PublishedDataSet *currentDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + if(!currentDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + /* Prepare DataSetMessageContent */ + memset(dataSetMessage, 0, sizeof(UA_DataSetMessage)); + dataSetMessage->header.dataSetMessageValid = true; + dataSetMessage->header.dataSetMessageType = UA_DATASETMESSAGE_DATADELTAFRAME; + if(currentDataSet->fieldSize == 0) + return UA_STATUSCODE_GOOD; + + UA_DataSetField *dsf; + size_t counter = 0; + TAILQ_FOREACH(dsf, ¤tDataSet->fields, listEntry) { + /* Sample the value */ + UA_DataValue value; + UA_DataValue_init(&value); + UA_PubSubDataSetField_sampleValue(server, dsf, &value); + + /* Check if the value has changed */ + if(valueChangedVariant(&dataSetWriter->lastSamples[counter].value.value, &value.value)) { + /* increase fieldCount for current delta message */ + dataSetMessage->data.deltaFrameData.fieldCount++; + dataSetWriter->lastSamples[counter].valueChanged = true; + + /* Update last stored sample */ + UA_DataValue_clear(&dataSetWriter->lastSamples[counter].value); + dataSetWriter->lastSamples[counter].value = value; + } else { + UA_DataValue_clear(&value); + dataSetWriter->lastSamples[counter].valueChanged = false; + } + + counter++; + } + + /* Allocate DeltaFrameFields */ + UA_DataSetMessage_DeltaFrameField *deltaFields = (UA_DataSetMessage_DeltaFrameField *) + UA_calloc(dataSetMessage->data.deltaFrameData.fieldCount, + sizeof(UA_DataSetMessage_DeltaFrameField)); + if(!deltaFields) + return UA_STATUSCODE_BADOUTOFMEMORY; + + dataSetMessage->data.deltaFrameData.deltaFrameFields = deltaFields; + size_t currentDeltaField = 0; + for(size_t i = 0; i < currentDataSet->fieldSize; i++) { + if(!dataSetWriter->lastSamples[i].valueChanged) + continue; + + UA_DataSetMessage_DeltaFrameField *dff = &deltaFields[currentDeltaField]; + + dff->fieldIndex = (UA_UInt16) i; + UA_DataValue_copy(&dataSetWriter->lastSamples[i].value, &dff->fieldValue); + dataSetWriter->lastSamples[i].valueChanged = false; + + /* Deactivate statuscode? */ + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_STATUSCODE) == 0) + dff->fieldValue.hasStatus = false; + + /* Deactivate timestamps? */ + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCETIMESTAMP) == 0) + dff->fieldValue.hasSourceTimestamp = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCEPICOSECONDS) == 0) + dff->fieldValue.hasServerPicoseconds = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERTIMESTAMP) == 0) + dff->fieldValue.hasServerTimestamp = false; + if(((u64)dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERPICOSECONDS) == 0) + dff->fieldValue.hasServerPicoseconds = false; + + currentDeltaField++; + } + return UA_STATUSCODE_GOOD; +} +#endif + +/** + * Generate a DataSetMessage for the given writer. + * + * @param dataSetWriter ptr to corresponding writer + * @return ptr to generated DataSetMessage + */ +static UA_StatusCode +UA_DataSetWriter_generateDataSetMessage(UA_Server *server, UA_DataSetMessage *dataSetMessage, + UA_DataSetWriter *dataSetWriter) { + UA_PublishedDataSet *currentDataSet = + UA_PublishedDataSet_findPDSbyId(server, dataSetWriter->connectedDataSet); + if(!currentDataSet) + return UA_STATUSCODE_BADNOTFOUND; + + /* Reset the message */ + memset(dataSetMessage, 0, sizeof(UA_DataSetMessage)); + + /* store messageType to switch between json or uadp (default) */ + UA_UInt16 messageType = UA_TYPES_UADPDATASETWRITERMESSAGEDATATYPE; + UA_JsonDataSetWriterMessageDataType *jsonDataSetWriterMessageDataType = NULL; + + /* The configuration Flags are included + * inside the std. defined UA_UadpDataSetWriterMessageDataType */ + UA_UadpDataSetWriterMessageDataType defaultUadpConfiguration; + UA_UadpDataSetWriterMessageDataType *dataSetWriterMessageDataType = NULL; + if((dataSetWriter->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED || + dataSetWriter->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED_NODELETE) && + (dataSetWriter->config.messageSettings.content.decoded.type == + &UA_TYPES[UA_TYPES_UADPDATASETWRITERMESSAGEDATATYPE])) { + dataSetWriterMessageDataType = (UA_UadpDataSetWriterMessageDataType *) + dataSetWriter->config.messageSettings.content.decoded.data; + + /* type is UADP */ + messageType = UA_TYPES_UADPDATASETWRITERMESSAGEDATATYPE; + } else if((dataSetWriter->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED || + dataSetWriter->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED_NODELETE) && + (dataSetWriter->config.messageSettings.content.decoded.type == + &UA_TYPES[UA_TYPES_JSONDATASETWRITERMESSAGEDATATYPE])) { + jsonDataSetWriterMessageDataType = (UA_JsonDataSetWriterMessageDataType *) + dataSetWriter->config.messageSettings.content.decoded.data; + + /* type is JSON */ + messageType = UA_TYPES_JSONDATASETWRITERMESSAGEDATATYPE; + } else { + /* create default flag configuration if no + * UadpDataSetWriterMessageDataType was passed in */ + memset(&defaultUadpConfiguration, 0, sizeof(UA_UadpDataSetWriterMessageDataType)); + defaultUadpConfiguration.dataSetMessageContentMask = (UA_UadpDataSetMessageContentMask) + ((u64)UA_UADPDATASETMESSAGECONTENTMASK_TIMESTAMP | + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MAJORVERSION | + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MINORVERSION); + dataSetWriterMessageDataType = &defaultUadpConfiguration; + } + + /* Sanity-test the configuration */ + if(dataSetWriterMessageDataType && + (dataSetWriterMessageDataType->networkMessageNumber != 0 || + dataSetWriterMessageDataType->dataSetOffset != 0 || + dataSetWriterMessageDataType->configuredSize != 0)) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Static DSM configuration not supported. Using defaults"); + dataSetWriterMessageDataType->networkMessageNumber = 0; + dataSetWriterMessageDataType->dataSetOffset = 0; + dataSetWriterMessageDataType->configuredSize = 0; + } + + /* The field encoding depends on the flags inside the writer config. + * TODO: This can be moved to the encoding layer. */ + if(dataSetWriter->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_RAWDATA) { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_RAWDATA; + } else if((u64)dataSetWriter->config.dataSetFieldContentMask & + ((u64)UA_DATASETFIELDCONTENTMASK_SOURCETIMESTAMP | + (u64)UA_DATASETFIELDCONTENTMASK_SERVERPICOSECONDS | + (u64)UA_DATASETFIELDCONTENTMASK_SOURCEPICOSECONDS | + (u64)UA_DATASETFIELDCONTENTMASK_STATUSCODE)) { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE; + } else { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_VARIANT; + } + + if(messageType == UA_TYPES_UADPDATASETWRITERMESSAGEDATATYPE) { + /* Std: 'The DataSetMessageContentMask defines the flags for the content + * of the DataSetMessage header.' */ + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MAJORVERSION) { + dataSetMessage->header.configVersionMajorVersionEnabled = true; + dataSetMessage->header.configVersionMajorVersion = + currentDataSet->dataSetMetaData.configurationVersion.majorVersion; + } + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MINORVERSION) { + dataSetMessage->header.configVersionMinorVersionEnabled = true; + dataSetMessage->header.configVersionMinorVersion = + currentDataSet->dataSetMetaData.configurationVersion.minorVersion; + } + + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_SEQUENCENUMBER) { + dataSetMessage->header.dataSetMessageSequenceNrEnabled = true; + dataSetMessage->header.dataSetMessageSequenceNr = + dataSetWriter->actualDataSetMessageSequenceCount; + } + + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_TIMESTAMP) { + dataSetMessage->header.timestampEnabled = true; + dataSetMessage->header.timestamp = UA_DateTime_now(); + } + /* TODO: Picoseconds resolution not supported atm */ + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_PICOSECONDS) { + dataSetMessage->header.picoSecondsIncluded = false; + } + + /* TODO: Statuscode not supported yet */ + if((u64)dataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_STATUS) { + dataSetMessage->header.statusEnabled = false; + } + } else if(messageType == UA_TYPES_JSONDATASETWRITERMESSAGEDATATYPE) { + if((u64)jsonDataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_JSONDATASETMESSAGECONTENTMASK_METADATAVERSION) { + dataSetMessage->header.configVersionMajorVersionEnabled = true; + dataSetMessage->header.configVersionMajorVersion = + currentDataSet->dataSetMetaData.configurationVersion.majorVersion; + } + if((u64)jsonDataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_JSONDATASETMESSAGECONTENTMASK_METADATAVERSION) { + dataSetMessage->header.configVersionMinorVersionEnabled = true; + dataSetMessage->header.configVersionMinorVersion = + currentDataSet->dataSetMetaData.configurationVersion.minorVersion; + } + + if((u64)jsonDataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_JSONDATASETMESSAGECONTENTMASK_SEQUENCENUMBER) { + dataSetMessage->header.dataSetMessageSequenceNrEnabled = true; + dataSetMessage->header.dataSetMessageSequenceNr = + dataSetWriter->actualDataSetMessageSequenceCount; + } + + if((u64)jsonDataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_JSONDATASETMESSAGECONTENTMASK_TIMESTAMP) { + dataSetMessage->header.timestampEnabled = true; + dataSetMessage->header.timestamp = UA_DateTime_now(); + } + + /* TODO: Statuscode not supported yet */ + if((u64)jsonDataSetWriterMessageDataType->dataSetMessageContentMask & + (u64)UA_JSONDATASETMESSAGECONTENTMASK_STATUS) { + dataSetMessage->header.statusEnabled = false; + } + } + + /* Set the sequence count. Automatically rolls over to zero */ + dataSetWriter->actualDataSetMessageSequenceCount++; + + /* JSON does not differ between deltaframes and keyframes, only keyframes are currently used. */ + if(messageType != UA_TYPES_JSONDATASETWRITERMESSAGEDATATYPE){ +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES + /* Check if the PublishedDataSet version has changed -> if yes flush the + * lastValue store and send a KeyFrame */ + if(dataSetWriter->connectedDataSetVersion.majorVersion != + currentDataSet->dataSetMetaData.configurationVersion.majorVersion || + dataSetWriter->connectedDataSetVersion.minorVersion != + currentDataSet->dataSetMetaData.configurationVersion.minorVersion) { + /* Remove old samples */ + for(size_t i = 0; i < dataSetWriter->lastSamplesCount; i++) + UA_DataValue_clear(&dataSetWriter->lastSamples[i].value); + + /* Realloc pds dependent memory */ + dataSetWriter->lastSamplesCount = currentDataSet->fieldSize; + UA_DataSetWriterSample *newSamplesArray = (UA_DataSetWriterSample * ) + UA_realloc(dataSetWriter->lastSamples, + sizeof(UA_DataSetWriterSample) * dataSetWriter->lastSamplesCount); + if(!newSamplesArray) + return UA_STATUSCODE_BADOUTOFMEMORY; + dataSetWriter->lastSamples = newSamplesArray; + memset(dataSetWriter->lastSamples, 0, + sizeof(UA_DataSetWriterSample) * dataSetWriter->lastSamplesCount); + + dataSetWriter->connectedDataSetVersion = currentDataSet->dataSetMetaData.configurationVersion; + UA_PubSubDataSetWriter_generateKeyFrameMessage(server, dataSetMessage, dataSetWriter); + dataSetWriter->deltaFrameCounter = 0; + return UA_STATUSCODE_GOOD; + } + + /* The standard defines: if a PDS contains only one fields no delta messages + * should be generated because they need more memory than a keyframe with 1 + * field. */ + if(currentDataSet->fieldSize > 1 && dataSetWriter->deltaFrameCounter > 0 && + dataSetWriter->deltaFrameCounter <= dataSetWriter->config.keyFrameCount) { + UA_PubSubDataSetWriter_generateDeltaFrameMessage(server, dataSetMessage, dataSetWriter); + dataSetWriter->deltaFrameCounter++; + return UA_STATUSCODE_GOOD; + } + + dataSetWriter->deltaFrameCounter = 1; +#endif + } + + return UA_PubSubDataSetWriter_generateKeyFrameMessage(server, dataSetMessage, dataSetWriter); +} + +static UA_StatusCode +sendNetworkMessageJson(UA_PubSubConnection *connection, UA_DataSetMessage *dsm, + UA_UInt16 *writerIds, UA_Byte dsmCount, + UA_ExtensionObject *transportSettings) { + UA_StatusCode retval = UA_STATUSCODE_BADNOTSUPPORTED; +#ifdef UA_ENABLE_JSON_ENCODING + UA_NetworkMessage nm; + memset(&nm, 0, sizeof(UA_NetworkMessage)); + nm.version = 1; + nm.networkMessageType = UA_NETWORKMESSAGE_DATASET; + nm.payloadHeaderEnabled = true; + + nm.payloadHeader.dataSetPayloadHeader.count = dsmCount; + nm.payloadHeader.dataSetPayloadHeader.dataSetWriterIds = writerIds; + nm.payload.dataSetPayload.dataSetMessages = dsm; + + /* Allocate the buffer. Allocate on the stack if the buffer is small. */ + UA_ByteString buf; + size_t msgSize = UA_NetworkMessage_calcSizeJson(&nm, NULL, 0, NULL, 0, true); + size_t stackSize = 1; + if(msgSize <= UA_MAX_STACKBUF) + stackSize = msgSize; + UA_STACKARRAY(UA_Byte, stackBuf, stackSize); + buf.data = stackBuf; + buf.length = msgSize; + if(msgSize > UA_MAX_STACKBUF) { + retval = UA_ByteString_allocBuffer(&buf, msgSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* Encode the message */ + UA_Byte *bufPos = buf.data; + memset(bufPos, 0, msgSize); + const UA_Byte *bufEnd = &buf.data[buf.length]; + retval = UA_NetworkMessage_encodeJson(&nm, &bufPos, &bufEnd, NULL, 0, NULL, 0, true); + if(retval != UA_STATUSCODE_GOOD) { + if(msgSize > UA_MAX_STACKBUF) + UA_ByteString_clear(&buf); + return retval; + } + + /* Send the prepared messages */ + retval = connection->channel->send(connection->channel, transportSettings, &buf); + if(msgSize > UA_MAX_STACKBUF) + UA_ByteString_clear(&buf); +#endif + return retval; +} + +static UA_StatusCode +generateNetworkMessage(UA_PubSubConnection *connection, UA_WriterGroup *wg, + UA_DataSetMessage *dsm, UA_UInt16 *writerIds, UA_Byte dsmCount, + UA_ExtensionObject *messageSettings, + UA_ExtensionObject *transportSettings, + UA_NetworkMessage *networkMessage) { + if(messageSettings->content.decoded.type != + &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE]) + return UA_STATUSCODE_BADINTERNALERROR; + UA_UadpWriterGroupMessageDataType *wgm = (UA_UadpWriterGroupMessageDataType*) + messageSettings->content.decoded.data; + + networkMessage->publisherIdEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PUBLISHERID) != 0; + networkMessage->groupHeaderEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_GROUPHEADER) != 0; + networkMessage->groupHeader.writerGroupIdEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_WRITERGROUPID) != 0; + networkMessage->groupHeader.groupVersionEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_GROUPVERSION) != 0; + networkMessage->groupHeader.networkMessageNumberEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_NETWORKMESSAGENUMBER) != 0; + networkMessage->groupHeader.sequenceNumberEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_SEQUENCENUMBER) != 0; + networkMessage->payloadHeaderEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PAYLOADHEADER) != 0; + networkMessage->timestampEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_TIMESTAMP) != 0; + networkMessage->picosecondsEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PICOSECONDS) != 0; + networkMessage->dataSetClassIdEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_DATASETCLASSID) != 0; + networkMessage->promotedFieldsEnabled = + ((u64)wgm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PROMOTEDFIELDS) != 0; + networkMessage->version = 1; + networkMessage->networkMessageType = UA_NETWORKMESSAGE_DATASET; + if(connection->config->publisherIdType == UA_PUBSUB_PUBLISHERID_NUMERIC) { + networkMessage->publisherIdType = UA_PUBLISHERDATATYPE_UINT16; + networkMessage->publisherId.publisherIdUInt32 = connection->config->publisherId.numeric; + } else if(connection->config->publisherIdType == UA_PUBSUB_PUBLISHERID_STRING){ + networkMessage->publisherIdType = UA_PUBLISHERDATATYPE_STRING; + networkMessage->publisherId.publisherIdString = connection->config->publisherId.string; + } + if(networkMessage->groupHeader.sequenceNumberEnabled) + networkMessage->groupHeader.sequenceNumber = wg->sequenceNumber; + /* Compute the length of the dsm separately for the header */ + UA_UInt16 *dsmLengths = (UA_UInt16 *) UA_calloc(dsmCount, sizeof(UA_UInt16)); + if(!dsmLengths) + return UA_STATUSCODE_BADOUTOFMEMORY; + + for(UA_Byte i = 0; i < dsmCount; i++) + dsmLengths[i] = (UA_UInt16) UA_DataSetMessage_calcSizeBinary(&dsm[i], NULL, 0); + + networkMessage->payloadHeader.dataSetPayloadHeader.count = dsmCount; + networkMessage->payloadHeader.dataSetPayloadHeader.dataSetWriterIds = writerIds; + networkMessage->groupHeader.writerGroupId = wg->config.writerGroupId; + /* number of the NetworkMessage inside a PublishingInterval */ + networkMessage->groupHeader.networkMessageNumber = 1; + networkMessage->payload.dataSetPayload.sizes = dsmLengths; + networkMessage->payload.dataSetPayload.dataSetMessages = dsm; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sendBufferedNetworkMessage(UA_Server *server, UA_PubSubConnection *connection, + UA_NetworkMessageOffsetBuffer *buffer, + UA_ExtensionObject *transportSettings) { + if(UA_NetworkMessage_updateBufferedMessage(buffer) != UA_STATUSCODE_GOOD) + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub sending. Unknown field type."); + return connection->channel->send(connection->channel, + transportSettings, &buffer->buffer); +} + +static UA_StatusCode +sendNetworkMessage(UA_PubSubConnection *connection, UA_WriterGroup *wg, + UA_DataSetMessage *dsm, UA_UInt16 *writerIds, UA_Byte dsmCount, + UA_ExtensionObject *messageSettings, + UA_ExtensionObject *transportSettings) { + UA_NetworkMessage nm; + memset(&nm, 0, sizeof(UA_NetworkMessage)); + generateNetworkMessage(connection, wg, dsm, writerIds, dsmCount, + messageSettings, transportSettings, &nm); + + /* Allocate the buffer. Allocate on the stack if the buffer is small. */ + UA_ByteString buf; + size_t msgSize = UA_NetworkMessage_calcSizeBinary(&nm, NULL); + size_t stackSize = 1; + if(msgSize <= UA_MAX_STACKBUF) + stackSize = msgSize; + UA_STACKARRAY(UA_Byte, stackBuf, stackSize); + buf.data = stackBuf; + buf.length = msgSize; + UA_StatusCode retval; + if(msgSize > UA_MAX_STACKBUF) { + retval = UA_ByteString_allocBuffer(&buf, msgSize); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Encode the message */ + UA_Byte *bufPos = buf.data; + memset(bufPos, 0, msgSize); + const UA_Byte *bufEnd = &buf.data[buf.length]; + retval = UA_NetworkMessage_encodeBinary(&nm, &bufPos, bufEnd); + if(retval != UA_STATUSCODE_GOOD) { + if(msgSize > UA_MAX_STACKBUF) + UA_ByteString_clear(&buf); + goto cleanup; + } + + /* Send the prepared messages */ + retval = connection->channel->send(connection->channel, transportSettings, &buf); + if(msgSize > UA_MAX_STACKBUF) + UA_ByteString_clear(&buf); + +cleanup: + UA_free(nm.payload.dataSetPayload.sizes); + return retval; +} + +/* This callback triggers the collection and publish of NetworkMessages and the + * contained DataSetMessages. */ +void +UA_WriterGroup_publishCallback(UA_Server *server, UA_WriterGroup *writerGroup) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "Publish Callback"); + + if(!writerGroup) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Publish failed. WriterGroup not found"); + return; + } + + /* Nothing to do? */ + if(writerGroup->writersCount <= 0) + return; + + /* Binary or Json encoding? */ + if(writerGroup->config.encodingMimeType != UA_PUBSUB_ENCODING_UADP && + writerGroup->config.encodingMimeType != UA_PUBSUB_ENCODING_JSON) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Publish failed: Unknown encoding type."); + UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, writerGroup); + return; + } + + /* Find the connection associated with the writer */ + UA_PubSubConnection *connection = writerGroup->linkedConnection; + if(!connection) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Publish failed. PubSubConnection invalid."); + UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, writerGroup); + return; + } + + if(writerGroup->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) { + UA_StatusCode res = + sendBufferedNetworkMessage(server, connection, &writerGroup->bufferedMessage, + &writerGroup->config.transportSettings); + if(res == UA_STATUSCODE_GOOD) { + writerGroup->sequenceNumber++; + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Publish failed. RT fixed size. sendBufferedNetworkMessage failed"); + UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, writerGroup); + } + return; + } + + /* How many DSM can be sent in one NM? */ + UA_Byte maxDSM = (UA_Byte)writerGroup->config.maxEncapsulatedDataSetMessageCount; + if(writerGroup->config.maxEncapsulatedDataSetMessageCount > UA_BYTE_MAX) + maxDSM = UA_BYTE_MAX; + /* If the maxEncapsulatedDataSetMessageCount is set to 0->1 */ + if(maxDSM == 0) + maxDSM = 1; + + /* It is possible to put several DataSetMessages into one NetworkMessage. + * But only if they do not contain promoted fields. NM with only DSM are + * sent out right away. The others are kept in a buffer for "batching". */ + size_t dsmCount = 0; + UA_StatusCode res = UA_STATUSCODE_GOOD; + UA_STACKARRAY(UA_UInt16, dsWriterIds, writerGroup->writersCount); + UA_STACKARRAY(UA_DataSetMessage, dsmStore, writerGroup->writersCount); + UA_DataSetWriter *dsw; + LIST_FOREACH(dsw, &writerGroup->writers, listEntry) { + if(dsw->state != UA_PUBSUBSTATE_OPERATIONAL) + continue; + + /* Find the dataset */ + UA_PublishedDataSet *pds = + UA_PublishedDataSet_findPDSbyId(server, dsw->connectedDataSet); + if(!pds) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Publish: PublishedDataSet not found"); + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dsw); + continue; + } + + /* Generate the DSM */ + res = UA_DataSetWriter_generateDataSetMessage(server, &dsmStore[dsmCount], dsw); + if(res != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Publish: DataSetMessage creation failed"); + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dsw); + continue; + } + + /* There is no promoted field and we can batch dsm. So do the batching. */ + if(pds->promotedFieldsCount == 0 && maxDSM > 1) { + dsWriterIds[dsmCount] = dsw->config.dataSetWriterId; + dsmCount++; + continue; + } + + /* Send right away */ + if(writerGroup->config.encodingMimeType == UA_PUBSUB_ENCODING_UADP){ + res = sendNetworkMessage(connection, writerGroup, &dsmStore[dsmCount], + &dsw->config.dataSetWriterId, 1, + &writerGroup->config.messageSettings, + &writerGroup->config.transportSettings); + } else { /* if(writerGroup->config.encodingMimeType == UA_PUBSUB_ENCODING_JSON) */ + res = sendNetworkMessageJson(connection, &dsmStore[dsmCount], + &dsw->config.dataSetWriterId, 1, + &writerGroup->config.transportSettings); + } + + if(res != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Publish: Could not send a NetworkMessage"); + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dsw); + } + + /* Clean up */ + if(writerGroup->config.rtLevel == UA_PUBSUB_RT_DIRECT_VALUE_ACCESS) { + for(size_t i = 0; i < dsmStore[dsmCount].data.keyFrameData.fieldCount; ++i) { + dsmStore[dsmCount].data.keyFrameData.dataSetFields[i].value.data = NULL; + } + } + UA_DataSetMessage_clear(&dsmStore[dsmCount]); + } + + /* Send the NetworkMessages with batched DataSetMessages */ + size_t i = 0; + while(i < dsmCount) { + /* How many dsm in this iteration? */ + UA_Byte nmDsmCount = maxDSM; + if(i + nmDsmCount > dsmCount) { + nmDsmCount = (UA_Byte)(dsmCount - i); + } + + if(writerGroup->config.encodingMimeType == UA_PUBSUB_ENCODING_UADP){ + res = sendNetworkMessage(connection, writerGroup, &dsmStore[i], + &dsWriterIds[i], nmDsmCount, + &writerGroup->config.messageSettings, + &writerGroup->config.transportSettings); + } else { /* if(writerGroup->config.encodingMimeType == UA_PUBSUB_ENCODING_JSON) */ + res = sendNetworkMessageJson(connection, &dsmStore[i], + &dsWriterIds[i], nmDsmCount, + &writerGroup->config.transportSettings); + } + + if(res == UA_STATUSCODE_GOOD) { + writerGroup->sequenceNumber++; /* TODO: Why not in the direct-send case? */ + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Publish: Sending a NetworkMessage failed"); + LIST_FOREACH(dsw, &writerGroup->writers, listEntry) { + if(dsWriterIds[i * maxDSM] != dsw->config.dataSetWriterId) + continue; + UA_DataSetWriter_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dsw); + } + } + + /* Forward the position for the next iteration */ + i += nmDsmCount; + } + + /* Clean up DSM */ + for(i = 0; i < dsmCount; i++) + UA_DataSetMessage_clear(&dsmStore[i]); +} + +/* Add new publishCallback. The first execution is triggered directly after + * creation. */ +UA_StatusCode +UA_WriterGroup_addPublishCallback(UA_Server *server, UA_WriterGroup *writerGroup) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(writerGroup->config.pubsubManagerCallback.addCustomCallback) + retval |= writerGroup->config.pubsubManagerCallback.addCustomCallback(server, writerGroup->identifier, + (UA_ServerCallback) UA_WriterGroup_publishCallback, + writerGroup, writerGroup->config.publishingInterval, + &writerGroup->publishCallbackId); + else + retval |= UA_PubSubManager_addRepeatedCallback(server, + (UA_ServerCallback) UA_WriterGroup_publishCallback, + writerGroup, writerGroup->config.publishingInterval, + &writerGroup->publishCallbackId); + + if(retval == UA_STATUSCODE_GOOD) + writerGroup->publishCallbackIsRegistered = true; + + /* Run once after creation */ + UA_WriterGroup_publishCallback(server, writerGroup); + return retval; +} + +#endif /* UA_ENABLE_PUBSUB */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_reader.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright (c) 2019 Kalycito Infotech Private Limited + */ + + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL +#endif + +#ifdef UA_ENABLE_PUBSUB_DELTAFRAMES +#endif + +#define UA_MAX_SIZENAME 64 /* Max size of Qualified Name of Subscribed Variable */ + +/* Clear ReaderGroup */ +static void +UA_Server_ReaderGroup_clear(UA_Server* server, UA_ReaderGroup *readerGroup); +/* Clear DataSetReader */ +static void +UA_DataSetReader_clear(UA_Server *server, UA_DataSetReader *dataSetReader); + +static void +UA_PubSubDSRDataSetField_sampleValue(UA_Server *server, UA_DataSetReader *dataSetReader, + UA_DataValue *value, size_t fieldNumber) { + /* TODO: Static value source without RT information model + * This API supports only to external datasource in RT configutation + * TODO: Extend to support other configuration if required */ + /* Read the value */ + const UA_VariableNode *rtNode = (const UA_VariableNode *) UA_NODESTORE_GET(server, + &dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[fieldNumber].targetVariable.targetNodeId); + if (rtNode->valueBackend.backendType == UA_VALUEBACKENDTYPE_EXTERNAL) { + dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[fieldNumber].externalDataValue = rtNode->valueBackend.backend.external.value; + *value = (**(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[fieldNumber].externalDataValue)); + value->value.storageType = UA_VARIANT_DATA_NODELETE; + } + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); +} + +static UA_StatusCode +UA_PubSubDataSetReader_generateKeyFrameMessage(UA_Server *server, + UA_DataSetMessage *dataSetMessage, + UA_DataSetReader *dataSetReader) { + /* Prepare DataSetMessageContent */ + dataSetMessage->header.dataSetMessageValid = true; + dataSetMessage->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME; + dataSetMessage->data.keyFrameData.fieldCount = (UA_UInt16) dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize; + dataSetMessage->data.keyFrameData.dataSetFields = (UA_DataValue *) + UA_Array_new(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize, &UA_TYPES[UA_TYPES_DATAVALUE]); + if(!dataSetMessage->data.keyFrameData.dataSetFields) + return UA_STATUSCODE_BADOUTOFMEMORY; + + for(size_t counter = 0; counter < dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize; counter++) { + /* Sample the value */ + UA_DataValue *dfv = &dataSetMessage->data.keyFrameData.dataSetFields[counter]; + UA_PubSubDSRDataSetField_sampleValue(server, dataSetReader, dfv, counter); + + /* Deactivate statuscode? */ + if(((u64)dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_STATUSCODE) == 0) + dfv->hasStatus = false; + + /* Deactivate timestamps */ + if(((u64)dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCETIMESTAMP) == 0) + dfv->hasSourceTimestamp = false; + if(((u64)dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SOURCEPICOSECONDS) == 0) + dfv->hasSourcePicoseconds = false; + if(((u64)dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERTIMESTAMP) == 0) + dfv->hasServerTimestamp = false; + if(((u64)dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_SERVERPICOSECONDS) == 0) + dfv->hasServerPicoseconds = false; + } + + return UA_STATUSCODE_GOOD; +} + +/** + * Generate a DataSetMessage for the given reader. + * + * @param dataSetReader ptr to corresponding reader + * @return ptr to generated DataSetMessage + */ +static UA_StatusCode +UA_DataSetReader_generateDataSetMessage(UA_Server *server, UA_DataSetMessage *dataSetMessage, + UA_DataSetReader *dataSetReader) { + /* Reset the message */ + memset(dataSetMessage, 0, sizeof(UA_DataSetMessage)); + + /* Support only for UADP configuration + * TODO: JSON encoding if UA_DataSetReader_generateDataSetMessage used other that RT configuration + */ + + if(dataSetReader->config.messageSettings.content.decoded.type != &UA_TYPES[UA_TYPES_UADPDATASETREADERMESSAGEDATATYPE]) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Only UADP encoding is supported."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + + /* The configuration Flags are included inside the std. defined UA_UadpDataSetReaderMessageDataType */ + UA_UadpDataSetReaderMessageDataType defaultUadpConfiguration; + UA_UadpDataSetReaderMessageDataType *dataSetReaderMessageDataType = (UA_UadpDataSetReaderMessageDataType *) + dataSetReader->config.messageSettings.content.decoded.data; + + if(!(dataSetReader->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED || + dataSetReader->config.messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED_NODELETE) || + !dataSetReaderMessageDataType->dataSetMessageContentMask) { + /* create default flag configuration if no dataSetMessageContentMask or even messageSettings in + * UadpDataSetWriterMessageDataType was passed in */ + memset(&defaultUadpConfiguration, 0, sizeof(UA_UadpDataSetReaderMessageDataType)); + defaultUadpConfiguration.dataSetMessageContentMask = (UA_UadpDataSetMessageContentMask) + ((u64)UA_UADPDATASETMESSAGECONTENTMASK_TIMESTAMP | + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MAJORVERSION | + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MINORVERSION); + dataSetReaderMessageDataType = &defaultUadpConfiguration; + } + + /* Sanity-test the configuration */ + if(dataSetReaderMessageDataType && + (dataSetReaderMessageDataType->networkMessageNumber != 0 || + dataSetReaderMessageDataType->dataSetOffset != 0)) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Static DSM configuration not supported. Using defaults"); + dataSetReaderMessageDataType->networkMessageNumber = 0; + dataSetReaderMessageDataType->dataSetOffset = 0; + } + + /* The field encoding depends on the flags inside the reader config. */ + if(dataSetReader->config.dataSetFieldContentMask & + (u64)UA_DATASETFIELDCONTENTMASK_RAWDATA) { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_RAWDATA; + } else if((u64)dataSetReader->config.dataSetFieldContentMask & + ((u64)UA_DATASETFIELDCONTENTMASK_SOURCETIMESTAMP | + (u64)UA_DATASETFIELDCONTENTMASK_SERVERPICOSECONDS | + (u64)UA_DATASETFIELDCONTENTMASK_SOURCEPICOSECONDS | + (u64)UA_DATASETFIELDCONTENTMASK_STATUSCODE)) { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE; + } else { + dataSetMessage->header.fieldEncoding = UA_FIELDENCODING_VARIANT; + } + + /* Std: 'The DataSetMessageContentMask defines the flags for the content + * of the DataSetMessage header.' */ + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MAJORVERSION) { + dataSetMessage->header.configVersionMajorVersionEnabled = true; + dataSetMessage->header.configVersionMajorVersion = + dataSetReader->config.dataSetMetaData.configurationVersion.majorVersion; + } + + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_MINORVERSION) { + dataSetMessage->header.configVersionMinorVersionEnabled = true; + dataSetMessage->header.configVersionMinorVersion = + dataSetReader->config.dataSetMetaData.configurationVersion.minorVersion; + } + + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_SEQUENCENUMBER) { + dataSetMessage->header.dataSetMessageSequenceNrEnabled = true; + dataSetMessage->header.dataSetMessageSequenceNr = 1; // Will be modified when subscriber receives new nw msg. + } + + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_TIMESTAMP) { + dataSetMessage->header.timestampEnabled = true; + dataSetMessage->header.timestamp = UA_DateTime_now(); + } + + /* TODO: Picoseconds resolution not supported atm */ + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_PICOSECONDS) { + dataSetMessage->header.picoSecondsIncluded = false; + } + /* TODO: Statuscode not supported yet */ + if((u64)dataSetReaderMessageDataType->dataSetMessageContentMask & + (u64)UA_UADPDATASETMESSAGECONTENTMASK_STATUS) { + dataSetMessage->header.statusEnabled = false; + } + + /* Not supported for Delta frames atm*/ + + return UA_PubSubDataSetReader_generateKeyFrameMessage(server, dataSetMessage, dataSetReader); +} + +static UA_StatusCode +UA_DataSetReader_generateNetworkMessage(UA_PubSubConnection *pubSubConnection, UA_DataSetReader *dataSetReader, UA_DataSetMessage *dsm, + UA_UInt16 *writerId, UA_Byte dsmCount, UA_NetworkMessage *networkMessage) { + if(dataSetReader->config.messageSettings.content.decoded.type != &UA_TYPES[UA_TYPES_UADPDATASETREADERMESSAGEDATATYPE]) + return UA_STATUSCODE_BADNOTSUPPORTED; + + UA_UadpDataSetReaderMessageDataType *dsrm = (UA_UadpDataSetReaderMessageDataType *) dataSetReader->config.messageSettings.content.decoded.data; + networkMessage->publisherIdEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PUBLISHERID) != 0; + networkMessage->groupHeaderEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_GROUPHEADER) != 0; + networkMessage->groupHeader.writerGroupIdEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_WRITERGROUPID) != 0; + networkMessage->groupHeader.groupVersionEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_GROUPVERSION) != 0; + networkMessage->groupHeader.networkMessageNumberEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_NETWORKMESSAGENUMBER) != 0; + networkMessage->groupHeader.sequenceNumberEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_SEQUENCENUMBER) != 0; + networkMessage->payloadHeaderEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PAYLOADHEADER) != 0; + networkMessage->timestampEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_TIMESTAMP) != 0; + networkMessage->picosecondsEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PICOSECONDS) != 0; + networkMessage->dataSetClassIdEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_DATASETCLASSID) != 0; + networkMessage->promotedFieldsEnabled = + ((u64)dsrm->networkMessageContentMask & + (u64)UA_UADPNETWORKMESSAGECONTENTMASK_PROMOTEDFIELDS) != 0; + networkMessage->version = 1; + networkMessage->networkMessageType = UA_NETWORKMESSAGE_DATASET; + if(UA_DataType_isNumeric(dataSetReader->config.publisherId.type)) { + /* TODO Support all numeric types */ + networkMessage->publisherIdType = UA_PUBLISHERDATATYPE_UINT16; + networkMessage->publisherId.publisherIdUInt16 = *(UA_UInt16 *) dataSetReader->config.publisherId.data; + } else { + return UA_STATUSCODE_BADNOTSUPPORTED; + } + + if(networkMessage->groupHeader.sequenceNumberEnabled) + networkMessage->groupHeader.sequenceNumber = 1; // Will be modified when subscriber receives new nw msg. + /* Compute the length of the dsm separately for the header */ + UA_UInt16 *dsmLengths = (UA_UInt16 *) UA_calloc(dsmCount, sizeof(UA_UInt16)); + if(!dsmLengths) + return UA_STATUSCODE_BADOUTOFMEMORY; + for(UA_Byte i = 0; i < dsmCount; i++) + dsmLengths[i] = (UA_UInt16) UA_DataSetMessage_calcSizeBinary(&dsm[i], NULL, 0); + + networkMessage->payloadHeader.dataSetPayloadHeader.count = dsmCount; + networkMessage->payloadHeader.dataSetPayloadHeader.dataSetWriterIds = writerId; + networkMessage->groupHeader.writerGroupId = dataSetReader->config.writerGroupId; + /* number of the NetworkMessage inside a PublishingInterval */ + networkMessage->groupHeader.networkMessageNumber = 1; + networkMessage->payload.dataSetPayload.sizes = dsmLengths; + networkMessage->payload.dataSetPayload.dataSetMessages = dsm; + return UA_STATUSCODE_GOOD; +} +/***************/ +/* ReaderGroup */ +/***************/ + +UA_StatusCode +UA_Server_addReaderGroup(UA_Server *server, UA_NodeId connectionIdentifier, + const UA_ReaderGroupConfig *readerGroupConfig, + UA_NodeId *readerGroupIdentifier) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + + /* Check for valid readergroup configuration */ + if(!readerGroupConfig) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Search the connection by the given connectionIdentifier */ + UA_PubSubConnection *currentConnectionContext = + UA_PubSubConnection_findConnectionbyId(server, connectionIdentifier); + if(!currentConnectionContext) + return UA_STATUSCODE_BADNOTFOUND; + + if(currentConnectionContext->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Adding ReaderGroup failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + /* Allocate memory for new reader group */ + UA_ReaderGroup *newGroup = (UA_ReaderGroup *)UA_calloc(1, sizeof(UA_ReaderGroup)); + if(!newGroup) + return UA_STATUSCODE_BADOUTOFMEMORY; + + newGroup->componentType = UA_PUBSUB_COMPONENT_READERGROUP; + /* Generate nodeid for the readergroup identifier */ + newGroup->linkedConnection = currentConnectionContext->identifier; + UA_PubSubManager_generateUniqueNodeId(server, &newGroup->identifier); + if(readerGroupIdentifier) + UA_NodeId_copy(&newGroup->identifier, readerGroupIdentifier); + + /* Deep copy of the config */ + retval |= UA_ReaderGroupConfig_copy(readerGroupConfig, &newGroup->config); + LIST_INSERT_HEAD(¤tConnectionContext->readerGroups, newGroup, listEntry); + currentConnectionContext->readerGroupsSize++; + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addReaderGroupRepresentation(server, newGroup); +#endif + + return retval; +} + +UA_StatusCode +UA_Server_removeReaderGroup(UA_Server *server, UA_NodeId groupIdentifier) { + UA_ReaderGroup* readerGroup = UA_ReaderGroup_findRGbyId(server, groupIdentifier); + if(readerGroup == NULL) + return UA_STATUSCODE_BADNOTFOUND; + + if(readerGroup->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove ReaderGroup failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + /* Search the connection to which the given readergroup is connected to */ + UA_PubSubConnection *connection = + UA_PubSubConnection_findConnectionbyId(server, readerGroup->linkedConnection); + if(connection == NULL) + return UA_STATUSCODE_BADNOTFOUND; + + /* Unregister subscribe callback */ + if(readerGroup->state == UA_PUBSUBSTATE_OPERATIONAL) { + if(readerGroup->config.pubsubManagerCallback.removeCustomCallback) + readerGroup->config.pubsubManagerCallback.removeCustomCallback(server, readerGroup->identifier, readerGroup->subscribeCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, readerGroup->subscribeCallbackId); + } + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removeReaderGroupRepresentation(server, readerGroup); +#endif + + /* UA_Server_ReaderGroup_clear also removes itself from the list */ + UA_Server_ReaderGroup_clear(server, readerGroup); + /* Remove readerGroup from Connection */ + LIST_REMOVE(readerGroup, listEntry); + UA_free(readerGroup); + return UA_STATUSCODE_GOOD; +} + +/* TODO: Implement +UA_StatusCode +UA_Server_ReaderGroup_updateConfig(UA_Server *server, UA_NodeId readerGroupIdentifier, + const UA_ReaderGroupConfig *config) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} +*/ + +UA_StatusCode +UA_Server_ReaderGroup_getConfig(UA_Server *server, UA_NodeId readerGroupIdentifier, + UA_ReaderGroupConfig *config) { + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Identify the readergroup through the readerGroupIdentifier */ + UA_ReaderGroup *currentReaderGroup = UA_ReaderGroup_findRGbyId(server, readerGroupIdentifier); + if(!currentReaderGroup) + return UA_STATUSCODE_BADNOTFOUND; + + UA_ReaderGroupConfig tmpReaderGroupConfig; + /* deep copy of the actual config */ + UA_ReaderGroupConfig_copy(¤tReaderGroup->config, &tmpReaderGroupConfig); + *config = tmpReaderGroupConfig; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_ReaderGroup_getState(UA_Server *server, UA_NodeId readerGroupIdentifier, + UA_PubSubState *state) +{ + if((server == NULL) || (state == NULL)) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_ReaderGroup *currentReaderGroup = UA_ReaderGroup_findRGbyId(server, readerGroupIdentifier); + if(currentReaderGroup == NULL) + return UA_STATUSCODE_BADNOTFOUND; + *state = currentReaderGroup->state; + return UA_STATUSCODE_GOOD; +} + +static void +UA_Server_ReaderGroup_clear(UA_Server* server, UA_ReaderGroup *readerGroup) { + /* To Do Call UA_ReaderGroupConfig_delete */ + UA_DataSetReader *dataSetReader, *tmpDataSetReader; + LIST_FOREACH_SAFE(dataSetReader, &readerGroup->readers, listEntry, tmpDataSetReader) { + UA_Server_removeDataSetReader(server, dataSetReader->identifier); + } + UA_PubSubConnection* pConn = + UA_PubSubConnection_findConnectionbyId(server, readerGroup->linkedConnection); + if(pConn != NULL) + pConn->readerGroupsSize--; + + /* Delete ReaderGroup and its members */ + UA_String_clear(&readerGroup->config.name); + UA_NodeId_clear(&readerGroup->linkedConnection); + UA_NodeId_clear(&readerGroup->identifier); +} + +UA_StatusCode +UA_ReaderGroupConfig_copy(const UA_ReaderGroupConfig *src, + UA_ReaderGroupConfig *dst) { + /* Currently simple memcpy only */ + memcpy(dst, src, sizeof(UA_ReaderGroupConfig)); + memcpy(&dst->securityParameters, &src->securityParameters, sizeof(UA_PubSubSecurityParameters)); + UA_String_copy(&src->name, &dst->name); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_ReaderGroup_setPubSubState(UA_Server *server, UA_PubSubState state, UA_ReaderGroup *readerGroup){ + UA_DataSetReader *dataSetReader; + switch(state){ + case UA_PUBSUBSTATE_DISABLED: + switch (readerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + if(readerGroup->config.pubsubManagerCallback.removeCustomCallback) + readerGroup->config.pubsubManagerCallback.removeCustomCallback(server, readerGroup->identifier, readerGroup->subscribeCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, readerGroup->subscribeCallbackId); + + LIST_FOREACH(dataSetReader, &readerGroup->readers, listEntry){ + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, dataSetReader); + } + readerGroup->state = UA_PUBSUBSTATE_DISABLED; + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_PAUSED: + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub state paused is unsupported at the moment!"); + switch (readerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_OPERATIONAL: + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_OPERATIONAL: + switch (readerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + readerGroup->state = UA_PUBSUBSTATE_OPERATIONAL; + if(readerGroup->config.pubsubManagerCallback.removeCustomCallback) + readerGroup->config.pubsubManagerCallback.removeCustomCallback(server, readerGroup->identifier, readerGroup->subscribeCallbackId); + else + UA_PubSubManager_removeRepeatedPubSubCallback(server, readerGroup->subscribeCallbackId); + + LIST_FOREACH(dataSetReader, &readerGroup->readers, listEntry){ + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, dataSetReader); + } + UA_ReaderGroup_addSubscribeCallback(server, readerGroup); + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_ERROR: + switch (readerGroup->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + break; + case UA_PUBSUBSTATE_OPERATIONAL: + UA_PubSubManager_removeRepeatedPubSubCallback(server, readerGroup->subscribeCallbackId); + LIST_FOREACH(dataSetReader, &readerGroup->readers, listEntry){ + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dataSetReader); + } + break; + case UA_PUBSUBSTATE_ERROR: + return UA_STATUSCODE_GOOD; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + readerGroup->state = UA_PUBSUBSTATE_ERROR; + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_freezeReaderGroupConfiguration(UA_Server *server, const UA_NodeId readerGroupId) { + UA_ReaderGroup *rg = UA_ReaderGroup_findRGbyId(server, readerGroupId); + if(!rg) + return UA_STATUSCODE_BADNOTFOUND; + + //PubSubConnection freezeCounter++ + UA_NodeId pubSubConnectionId = rg->linkedConnection; + UA_PubSubConnection *pubSubConnection = UA_PubSubConnection_findConnectionbyId(server, pubSubConnectionId); + pubSubConnection->configurationFreezeCounter++; + pubSubConnection->configurationFrozen = UA_TRUE; + //ReaderGroup freeze + rg->configurationFrozen = UA_TRUE; + // TODO: Clarify on the freeze functionality in multiple DSR, multiple networkMessage conf in a RG + //DataSetReader freeze + UA_DataSetReader *dataSetReader; + UA_UInt16 dsrCount = 0; + LIST_FOREACH(dataSetReader, &rg->readers, listEntry){ + dataSetReader->configurationFrozen = UA_TRUE; + dsrCount++; + /* TODO: Configuration frozen for subscribedDataSet once + * UA_Server_DataSetReader_addTargetVariables API modified to support + * adding target variable one by one or in a group stored in a list. + */ + } + + if(rg->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) { + if(dsrCount > 1) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Mutiple DSR in a readerGroup not supported in RT fixed size configuration"); + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } + + dataSetReader = LIST_FIRST(&rg->readers); + // Support only to UADP encoding + if(dataSetReader->config.messageSettings.content.decoded.type != &UA_TYPES[UA_TYPES_UADPDATASETREADERMESSAGEDATATYPE]) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: Non-RT capable encoding."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + + size_t fieldsSize = dataSetReader->config.dataSetMetaData.fieldsSize; + for(size_t i = 0; i < fieldsSize; i++) { + const UA_VariableNode *rtNode = (const UA_VariableNode *) UA_NODESTORE_GET(server, &dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId); + if(rtNode != NULL && rtNode->valueBackend.backendType != UA_VALUEBACKENDTYPE_EXTERNAL){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: PDS contains field without external data source."); + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + + UA_NODESTORE_RELEASE(server, (const UA_Node *) rtNode); + if((UA_NodeId_equal(&dataSetReader->config.dataSetMetaData.fields[i].dataType, &UA_TYPES[UA_TYPES_STRING].typeId) || + UA_NodeId_equal(&dataSetReader->config.dataSetMetaData.fields[i].dataType, + &UA_TYPES[UA_TYPES_BYTESTRING].typeId)) && + dataSetReader->config.dataSetMetaData.fields[i].maxStringLength == 0) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: " + "PDS contains String/ByteString with dynamic length."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } else if(!UA_DataType_isNumeric(UA_findDataType(&dataSetReader->config.dataSetMetaData.fields[i].dataType))){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub-RT configuration fail: " + "PDS contains variable with dynamic size."); + return UA_STATUSCODE_BADNOTSUPPORTED; + } + } + + UA_DataSetMessage *dsm = (UA_DataSetMessage *) UA_calloc(1, sizeof(UA_DataSetMessage)); + if(!dsm) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: DSM creation failed"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Generate the DSM */ + UA_StatusCode res = UA_DataSetReader_generateDataSetMessage(server, dsm, dataSetReader); + if(res != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: DataSetMessage generation failed"); + UA_DataSetMessage_clear(dsm); + UA_free(dsm); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Generate data set messages - Considering 1 DSM as max */ + UA_UInt16 *dsWriterIds = (UA_UInt16 *)UA_calloc(1, sizeof(UA_UInt16)); + if(!dsWriterIds) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: DataSetWriterId creation failed"); + UA_DataSetMessage_clear(dsm); + UA_free(dsm); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + *dsWriterIds = dataSetReader->config.dataSetWriterId; + + UA_NetworkMessage *networkMessage = (UA_NetworkMessage *)UA_calloc(1, sizeof(UA_NetworkMessage)); + if(!networkMessage) { + UA_free(dsWriterIds); + UA_DataSetMessage_clear(dsm); + UA_free(dsm); + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: Network message creation failed"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + res = UA_DataSetReader_generateNetworkMessage(pubSubConnection, dataSetReader, dsm, + dsWriterIds, 1, networkMessage); + if(res != UA_STATUSCODE_GOOD) { + UA_free(networkMessage->payload.dataSetPayload.sizes); + UA_free(networkMessage); + UA_free(dsWriterIds); + UA_DataSetMessage_clear(dsm); + UA_free(dsm); + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub RT Offset calculation: NetworkMessage generation failed"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + memset(&dataSetReader->bufferedMessage, 0, sizeof(UA_NetworkMessageOffsetBuffer)); + dataSetReader->bufferedMessage.RTsubscriberEnabled = UA_TRUE; + /* Fix the offsets necessary to decode */ + UA_NetworkMessage_calcSizeBinary(networkMessage, &dataSetReader->bufferedMessage); + dataSetReader->bufferedMessage.nm = networkMessage; + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_unfreezeReaderGroupConfiguration(UA_Server *server, const UA_NodeId readerGroupId){ + UA_ReaderGroup *rg = UA_ReaderGroup_findRGbyId(server, readerGroupId); + if(!rg) + return UA_STATUSCODE_BADNOTFOUND; + //PubSubConnection freezeCounter-- + UA_NodeId pubSubConnectionId = rg->linkedConnection; + UA_PubSubConnection *pubSubConnection = UA_PubSubConnection_findConnectionbyId(server, pubSubConnectionId); + pubSubConnection->configurationFreezeCounter--; + if(pubSubConnection->configurationFreezeCounter == 0){ + pubSubConnection->configurationFrozen = UA_FALSE; + } + //ReaderGroup unfreeze + rg->configurationFrozen = UA_FALSE; + //DataSetReader unfreeze + UA_DataSetReader *dataSetReader; + LIST_FOREACH(dataSetReader, &rg->readers, listEntry) { + dataSetReader->configurationFrozen = UA_FALSE; + } + + if(rg->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) { + dataSetReader = LIST_FIRST(&rg->readers); + if(dataSetReader->bufferedMessage.offsetsSize > 0){ + for (size_t i = 0; i < dataSetReader->bufferedMessage.offsetsSize; i++) { + if(dataSetReader->bufferedMessage.offsets[i].contentType == UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT){ + UA_DataValue_delete(dataSetReader->bufferedMessage.offsets[i].offsetData.value.value); + } + } + + UA_free(dataSetReader->bufferedMessage.offsets); + } + + if(dataSetReader->bufferedMessage.RTsubscriberEnabled) { + if(dataSetReader->bufferedMessage.nm != NULL) { + UA_NetworkMessage_delete(dataSetReader->bufferedMessage.nm); + UA_free(dataSetReader->bufferedMessage.nm); + } + } + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode UA_EXPORT +UA_Server_setReaderGroupOperational(UA_Server *server, const UA_NodeId readerGroupId){ + UA_ReaderGroup *rg = UA_ReaderGroup_findRGbyId(server, readerGroupId); + if(!rg) + return UA_STATUSCODE_BADNOTFOUND; + return UA_ReaderGroup_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, rg); +} + +UA_StatusCode UA_EXPORT +UA_Server_setReaderGroupDisabled(UA_Server *server, const UA_NodeId readerGroupId){ + UA_ReaderGroup *rg = UA_ReaderGroup_findRGbyId(server, readerGroupId); + if(!rg) + return UA_STATUSCODE_BADNOTFOUND; + return UA_ReaderGroup_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, rg); +} + +static UA_StatusCode +checkReaderIdentifier(UA_Server *server, UA_NetworkMessage *pMsg, UA_DataSetReader *reader) { + if(!pMsg->groupHeaderEnabled && + !pMsg->groupHeader.writerGroupIdEnabled && + !pMsg->payloadHeaderEnabled) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Cannot process DataSetReader without WriterGroup" + "and DataSetWriter identifiers"); + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } + + if((reader->config.writerGroupId == pMsg->groupHeader.writerGroupId) && + (reader->config.dataSetWriterId == *pMsg->payloadHeader.dataSetPayloadHeader.dataSetWriterIds)) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "DataSetReader found. Process NetworkMessage"); + return UA_STATUSCODE_GOOD; + } + + return UA_STATUSCODE_BADNOTFOUND; +} + +static UA_StatusCode +getReaderFromIdentifier(UA_Server *server, UA_NetworkMessage *pMsg, + UA_DataSetReader **dataSetReader, UA_PubSubConnection *pConnection) { + UA_StatusCode retval = UA_STATUSCODE_BADNOTFOUND; + if(!pMsg->publisherIdEnabled) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Cannot process DataSetReader without PublisherId"); + return UA_STATUSCODE_BADNOTIMPLEMENTED; /* TODO: Handle DSR without PublisherId */ + } + + UA_ReaderGroup* readerGroup; + LIST_FOREACH(readerGroup, &pConnection->readerGroups, listEntry) { + UA_DataSetReader *tmpReader; + LIST_FOREACH(tmpReader, &readerGroup->readers, listEntry) { + switch (pMsg->publisherIdType) { + case UA_PUBLISHERDATATYPE_BYTE: + if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_BYTE] && + pMsg->publisherIdType == UA_PUBLISHERDATATYPE_BYTE && + pMsg->publisherId.publisherIdByte == *(UA_Byte*)tmpReader->config.publisherId.data) { + retval = checkReaderIdentifier(server, pMsg, tmpReader); + } + break; + case UA_PUBLISHERDATATYPE_UINT16: + if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT16] && + pMsg->publisherIdType == UA_PUBLISHERDATATYPE_UINT16 && + pMsg->publisherId.publisherIdUInt16 == *(UA_UInt16*) tmpReader->config.publisherId.data) { + retval = checkReaderIdentifier(server, pMsg, tmpReader); + } + break; + case UA_PUBLISHERDATATYPE_UINT32: + if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT32] && + pMsg->publisherIdType == UA_PUBLISHERDATATYPE_UINT32 && + pMsg->publisherId.publisherIdUInt32 == *(UA_UInt32*)tmpReader->config.publisherId.data) { + retval = checkReaderIdentifier(server, pMsg, tmpReader); + } + break; + case UA_PUBLISHERDATATYPE_UINT64: + if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_UINT64] && + pMsg->publisherIdType == UA_PUBLISHERDATATYPE_UINT64 && + pMsg->publisherId.publisherIdUInt64 == *(UA_UInt64*)tmpReader->config.publisherId.data) { + retval = checkReaderIdentifier(server, pMsg, tmpReader); + } + break; + case UA_PUBLISHERDATATYPE_STRING: + if(tmpReader->config.publisherId.type == &UA_TYPES[UA_TYPES_STRING] && + pMsg->publisherIdType == UA_PUBLISHERDATATYPE_STRING && + UA_String_equal(&pMsg->publisherId.publisherIdString, + (UA_String*)tmpReader->config.publisherId.data)) { + retval = checkReaderIdentifier(server, pMsg, tmpReader); + } + break; + default: + return UA_STATUSCODE_BADINTERNALERROR; + } + + if(retval == UA_STATUSCODE_GOOD) { + *dataSetReader = tmpReader; + return UA_STATUSCODE_GOOD; + } + } + } + + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Dataset reader not found. Check PublisherID, WriterGroupID and DatasetWriterID"); + return UA_STATUSCODE_BADNOTFOUND; +} + +UA_ReaderGroup * +UA_ReaderGroup_findRGbyId(UA_Server *server, UA_NodeId identifier) { + UA_PubSubConnection *pubSubConnection; + TAILQ_FOREACH(pubSubConnection, &server->pubSubManager.connections, listEntry){ + UA_ReaderGroup* readerGroup = NULL; + LIST_FOREACH(readerGroup, &pubSubConnection->readerGroups, listEntry) { + if(UA_NodeId_equal(&identifier, &readerGroup->identifier)) + return readerGroup; + } + } + + return NULL; +} + +UA_DataSetReader *UA_ReaderGroup_findDSRbyId(UA_Server *server, UA_NodeId identifier) { + UA_PubSubConnection *pubSubConnection; + TAILQ_FOREACH(pubSubConnection, &server->pubSubManager.connections, listEntry){ + UA_ReaderGroup* readerGroup = NULL; + LIST_FOREACH(readerGroup, &pubSubConnection->readerGroups, listEntry) { + UA_DataSetReader *tmpReader; + LIST_FOREACH(tmpReader, &readerGroup->readers, listEntry) { + if(UA_NodeId_equal(&tmpReader->identifier, &identifier)) { + return tmpReader; + } + } + } + } + return NULL; +} + +/* This callback triggers the collection and reception of NetworkMessages and the + * contained DataSetMessages. */ +void UA_ReaderGroup_subscribeCallback(UA_Server *server, UA_ReaderGroup *readerGroup) { + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "PubSub subscribe callback"); + + if(!readerGroup) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Subscribe failed. ReaderGroup not found"); + return; + } + + UA_PubSubConnection *connection = + UA_PubSubConnection_findConnectionbyId(server, readerGroup->linkedConnection); + if (!connection) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "SubscribeCallback(): " + "Find linked connection failed"); + UA_ReaderGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, readerGroup); + return; + } + + UA_ByteString buffer; + if(UA_ByteString_allocBuffer(&buffer, 4096) != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "SubscribeCallback(): Message buffer alloc failed!"); + UA_ReaderGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, readerGroup); + return; + } + + UA_StatusCode res = connection->channel->receive(connection->channel, &buffer, NULL, 1000); + if (UA_StatusCode_isBad(res)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "SubscribeCallback(): Connection receive failed!"); + UA_ReaderGroup_setPubSubState(server, UA_PUBSUBSTATE_ERROR, readerGroup); + UA_ByteString_clear(&buffer); + return; + } + size_t currentPosition = 0; + if(buffer.length > 0) { + if (readerGroup->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) { + do { + /* Considering max DSM as 1 + * TODO: + * Process with the static value source + */ + UA_DataSetReader *dataSetReader = LIST_FIRST(&readerGroup->readers); + /* Decode only the necessary offset and update the networkMessage */ + if(UA_NetworkMessage_updateBufferedNwMessage(&dataSetReader->bufferedMessage, &buffer, ¤tPosition) != UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub receive. Unknown field type."); + UA_ByteString_clear(&buffer); + return; + } + + /* Check the decoded message is the expected one + * TODO: PublisherID check after modification in NM to support all datatypes */ + if((dataSetReader->bufferedMessage.nm->groupHeader.writerGroupId != dataSetReader->config.writerGroupId) || + (*dataSetReader->bufferedMessage.nm->payloadHeader.dataSetPayloadHeader.dataSetWriterIds != dataSetReader->config.dataSetWriterId)) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub receive. Unknown message received. Will not be processed."); + UA_ByteString_clear(&buffer); + return; + } + + UA_Server_DataSetReader_process(server, dataSetReader, + dataSetReader->bufferedMessage.nm->payload.dataSetPayload.dataSetMessages); + + /* Delete the payload value of every dsf's decoded */ + UA_DataSetMessage *dsm = dataSetReader->bufferedMessage.nm->payload.dataSetPayload.dataSetMessages; + if(dsm->header.fieldEncoding == UA_FIELDENCODING_VARIANT) { + for(UA_UInt16 i = 0; i < dsm->data.keyFrameData.fieldCount; i++) { + UA_Variant_clear(&dsm->data.keyFrameData.dataSetFields[i].value); + } + } + else if(dsm->header.fieldEncoding == UA_FIELDENCODING_DATAVALUE) { + for(UA_UInt16 i = 0; i < dsm->data.keyFrameData.fieldCount; i++) { + UA_DataValue_clear(&dsm->data.keyFrameData.dataSetFields[i]); + } + } + } while((buffer.length) > currentPosition); + UA_ByteString_clear(&buffer); + return; + } + else { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_USERLAND, "Message received:"); + do { + UA_NetworkMessage currentNetworkMessage; + memset(¤tNetworkMessage, 0, sizeof(UA_NetworkMessage)); + UA_NetworkMessage_decodeBinary(&buffer, ¤tPosition, ¤tNetworkMessage); + UA_Server_processNetworkMessage(server, ¤tNetworkMessage, connection); + UA_NetworkMessage_clear(¤tNetworkMessage); + } while((buffer.length) > currentPosition); + } + } + UA_ByteString_clear(&buffer); +} + +/* Add new subscribeCallback. The first execution is triggered directly after + * creation. */ +UA_StatusCode +UA_ReaderGroup_addSubscribeCallback(UA_Server *server, UA_ReaderGroup *readerGroup) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(readerGroup->config.pubsubManagerCallback.addCustomCallback) + retval |= readerGroup->config.pubsubManagerCallback.addCustomCallback(server, readerGroup->identifier, + (UA_ServerCallback) UA_ReaderGroup_subscribeCallback, + readerGroup, 5, &readerGroup->subscribeCallbackId); + else + retval |= UA_PubSubManager_addRepeatedCallback(server, + (UA_ServerCallback) UA_ReaderGroup_subscribeCallback, + readerGroup, 5, &readerGroup->subscribeCallbackId); // TODO: Remove the hardcode of interval (5ms) + + if(retval == UA_STATUSCODE_GOOD) + readerGroup->subscribeCallbackIsRegistered = true; + + /* Run once after creation */ + UA_ReaderGroup_subscribeCallback(server, readerGroup); + return retval; +} + +/**********/ +/* Reader */ +/**********/ + +UA_StatusCode +UA_Server_addDataSetReader(UA_Server *server, UA_NodeId readerGroupIdentifier, + const UA_DataSetReaderConfig *dataSetReaderConfig, + UA_NodeId *readerIdentifier) { + /* Search the reader group by the given readerGroupIdentifier */ + UA_ReaderGroup *readerGroup = UA_ReaderGroup_findRGbyId(server, readerGroupIdentifier); + if(readerGroup == NULL) + return UA_STATUSCODE_BADNOTFOUND; + + if(!dataSetReaderConfig) + return UA_STATUSCODE_BADNOTFOUND; + + if(readerGroup->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Add DataSetReader failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + /* Allocate memory for new DataSetReader */ + UA_DataSetReader *newDataSetReader = (UA_DataSetReader *)UA_calloc(1, sizeof(UA_DataSetReader)); + if(!newDataSetReader) + return UA_STATUSCODE_BADOUTOFMEMORY; + + newDataSetReader->componentType = UA_PUBSUB_COMPONENT_DATASETREADER; + if (readerGroup->state == UA_PUBSUBSTATE_OPERATIONAL) { + UA_StatusCode retVal = UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, newDataSetReader); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Add DataSetReader failed. setPubSubState failed."); + return retVal; + } + } + + /* Copy the config into the new dataSetReader */ + UA_DataSetReaderConfig_copy(dataSetReaderConfig, &newDataSetReader->config); + newDataSetReader->linkedReaderGroup = readerGroup->identifier; + UA_PubSubManager_generateUniqueNodeId(server, &newDataSetReader->identifier); + if(readerIdentifier != NULL) { + UA_NodeId_copy(&newDataSetReader->identifier, readerIdentifier); + } + +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* create message receive timeout timer */ + UA_StatusCode retVal = server->config.pubsubConfiguration->monitoringInterface.createMonitoring(server, newDataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, newDataSetReader, UA_DataSetReader_handleMessageReceiveTimeout); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Add DataSetReader failed. Create message receive timeout timer failed."); + UA_DataSetReaderConfig_clear(&newDataSetReader->config); + UA_free(newDataSetReader); + newDataSetReader = 0; + return retVal; + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + + /* Add the new reader to the group */ + LIST_INSERT_HEAD(&readerGroup->readers, newDataSetReader, listEntry); + readerGroup->readersCount++; + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addDataSetReaderRepresentation(server, newDataSetReader); +#endif + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_removeDataSetReader(UA_Server *server, UA_NodeId readerIdentifier) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + /* Remove datasetreader given by the identifier */ + UA_DataSetReader *dataSetReader = UA_ReaderGroup_findDSRbyId(server, readerIdentifier); + if(!dataSetReader) + return UA_STATUSCODE_BADNOTFOUND; + + if(dataSetReader->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetReader failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removeDataSetReaderRepresentation(server, dataSetReader); +#endif + +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* stop and remove message receive timeout timer */ + retVal = UA_STATUSCODE_GOOD; + if (dataSetReader->msgRcvTimeoutTimerRunning == UA_TRUE) { + retVal = server->config.pubsubConfiguration->monitoringInterface.stopMonitoring(server, dataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, dataSetReader); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetReader failed. Stop message receive timeout timer of DataSetReader " + "'%.*s' failed.", (int) dataSetReader->config.name.length, dataSetReader->config.name.data); + } + } + retVal |= server->config.pubsubConfiguration->monitoringInterface.deleteMonitoring(server, dataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, dataSetReader); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove DataSetReader failed. Delete message receive timeout timer of DataSetReader " + "'%.*s' failed.", (int) dataSetReader->config.name.length, dataSetReader->config.name.data); + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + + UA_DataSetReader_clear(server, dataSetReader); + return retVal; +} + +UA_StatusCode +UA_Server_DataSetReader_updateConfig(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_NodeId readerGroupIdentifier, + const UA_DataSetReaderConfig *config) { + if(config == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_DataSetReader *currentDataSetReader = UA_ReaderGroup_findDSRbyId(server, dataSetReaderIdentifier); + if(!currentDataSetReader) + return UA_STATUSCODE_BADNOTFOUND; + + if(currentDataSetReader->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Update DataSetReader config failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + UA_ReaderGroup *currentReaderGroup = UA_ReaderGroup_findRGbyId(server, readerGroupIdentifier); + if(currentReaderGroup->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Update DataSetReader config failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + /* The update functionality will be extended during the next PubSub batches. + * Currently changes for writerGroupId, dataSetWriterId and TargetVariables are possible. */ + if(currentDataSetReader->config.writerGroupId != config->writerGroupId) + currentDataSetReader->config.writerGroupId = config->writerGroupId; + + if(currentDataSetReader->config.dataSetWriterId != config->dataSetWriterId) + currentDataSetReader->config.dataSetWriterId = config->dataSetWriterId; + + if(currentDataSetReader->config.subscribedDataSetType == UA_PUBSUB_SDS_TARGET) { + if(currentDataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize == + config->subscribedDataSet.subscribedDataSetTarget.targetVariablesSize) { + for(size_t i = 0; i < config->subscribedDataSet.subscribedDataSetTarget.targetVariablesSize; i++) { + if(!UA_NodeId_equal(¤tDataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId, + &config->subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId)) { + UA_Server_DataSetReader_createTargetVariables(server, + currentDataSetReader->identifier, + config->subscribedDataSet.subscribedDataSetTarget.targetVariablesSize, + config->subscribedDataSet.subscribedDataSetTarget.targetVariables); + break; + } + } + } + else { + UA_Server_DataSetReader_createTargetVariables(server, + currentDataSetReader->identifier, + config->subscribedDataSet.subscribedDataSetTarget.targetVariablesSize, + config->subscribedDataSet.subscribedDataSetTarget.targetVariables); + } + } + else { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Unsupported SubscribedDataSetType."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + UA_StatusCode retVal = UA_STATUSCODE_GOOD; +#ifdef UA_ENABLE_PUBSUB_MONITORING + if (currentDataSetReader->config.messageReceiveTimeout != config->messageReceiveTimeout) { + /* update message receive timeout timer interval */ + currentDataSetReader->config.messageReceiveTimeout = config->messageReceiveTimeout; + retVal = server->config.pubsubConfiguration->monitoringInterface.updateMonitoringInterval(server, currentDataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, currentDataSetReader); + if (retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Update DataSetReader message receive timeout timer failed."); + } + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + return retVal; +} + +UA_StatusCode +UA_Server_DataSetReader_getConfig(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_DataSetReaderConfig *config) { + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_DataSetReader *currentDataSetReader = + UA_ReaderGroup_findDSRbyId(server, dataSetReaderIdentifier); + if(!currentDataSetReader) + return UA_STATUSCODE_BADNOTFOUND; + + UA_DataSetReaderConfig tmpReaderConfig; + /* Deep copy of the actual config */ + UA_DataSetReaderConfig_copy(¤tDataSetReader->config, &tmpReaderConfig); + *config = tmpReaderConfig; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_DataSetReaderConfig_copy(const UA_DataSetReaderConfig *src, + UA_DataSetReaderConfig *dst) { + memset(dst, 0, sizeof(UA_DataSetReaderConfig)); + UA_StatusCode retVal = UA_String_copy(&src->name, &dst->name); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + retVal = UA_Variant_copy(&src->publisherId, &dst->publisherId); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + dst->writerGroupId = src->writerGroupId; + dst->dataSetWriterId = src->dataSetWriterId; + retVal = UA_DataSetMetaDataType_copy(&src->dataSetMetaData, &dst->dataSetMetaData); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + dst->dataSetFieldContentMask = src->dataSetFieldContentMask; + dst->messageReceiveTimeout = src->messageReceiveTimeout; + + /* Currently memcpy is used to copy the securityParameters */ + memcpy(&dst->securityParameters, &src->securityParameters, sizeof(UA_PubSubSecurityParameters)); + retVal = UA_ExtensionObject_copy(&src->messageSettings, &dst->messageSettings); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + retVal = UA_ExtensionObject_copy(&src->transportSettings, &dst->transportSettings); + if (retVal != UA_STATUSCODE_GOOD) + return retVal; + + if(src->subscribedDataSetType == UA_PUBSUB_SDS_TARGET) { + retVal = UA_TargetVariables_copy(&src->subscribedDataSet.subscribedDataSetTarget, + &dst->subscribedDataSet.subscribedDataSetTarget); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + } + + return UA_STATUSCODE_GOOD; +} + +void +UA_DataSetReaderConfig_clear(UA_DataSetReaderConfig *cfg) { + UA_String_clear(&cfg->name); + UA_Variant_clear(&cfg->publisherId); + UA_DataSetMetaDataType_clear(&cfg->dataSetMetaData); + UA_ExtensionObject_clear(&cfg->messageSettings); + UA_ExtensionObject_clear(&cfg->transportSettings); + if (cfg->subscribedDataSetType == UA_PUBSUB_SDS_TARGET) { + UA_TargetVariables_clear(&cfg->subscribedDataSet.subscribedDataSetTarget); + } +} + +UA_StatusCode +UA_Server_DataSetReader_getState(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_PubSubState *state) { + + if((server == NULL) || (state == NULL)) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_DataSetReader *currentDataSetReader = UA_ReaderGroup_findDSRbyId(server, dataSetReaderIdentifier); + if(currentDataSetReader == NULL) + return UA_STATUSCODE_BADNOTFOUND; + *state = currentDataSetReader->state; + return UA_STATUSCODE_GOOD; +} + +//state machine methods not part of the open62541 state machine API +UA_StatusCode +UA_DataSetReader_setPubSubState(UA_Server *server, UA_PubSubState state, UA_DataSetReader *dataSetReader) { + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch(state){ + case UA_PUBSUBSTATE_DISABLED: + switch (dataSetReader->state){ + case UA_PUBSUBSTATE_DISABLED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_PAUSED: + dataSetReader->state = UA_PUBSUBSTATE_DISABLED; + break; + case UA_PUBSUBSTATE_OPERATIONAL: +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* stop MessageReceiveTimeout timer */ + if (dataSetReader->msgRcvTimeoutTimerRunning == UA_TRUE) { + ret = server->config.pubsubConfiguration->monitoringInterface.stopMonitoring(server, dataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, dataSetReader); + if (ret == UA_STATUSCODE_GOOD) { + dataSetReader->msgRcvTimeoutTimerRunning = UA_FALSE; + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Disable ReaderGroup failed. Stop message receive timeout timer of DataSetReader " + "'%.*s' failed.", (int) dataSetReader->config.name.length, dataSetReader->config.name.data); + } + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + if (ret == UA_STATUSCODE_GOOD) { + dataSetReader->state = UA_PUBSUBSTATE_DISABLED; + } + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_PAUSED: + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub state paused is unsupported at the moment!"); + switch (dataSetReader->state){ + case UA_PUBSUBSTATE_DISABLED: + break; + case UA_PUBSUBSTATE_PAUSED: + return UA_STATUSCODE_GOOD; + case UA_PUBSUBSTATE_OPERATIONAL: + break; + case UA_PUBSUBSTATE_ERROR: + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_OPERATIONAL: + switch (dataSetReader->state){ + case UA_PUBSUBSTATE_DISABLED: + case UA_PUBSUBSTATE_PAUSED: + case UA_PUBSUBSTATE_OPERATIONAL: + case UA_PUBSUBSTATE_ERROR: /* intended fall through */ + dataSetReader->state = UA_PUBSUBSTATE_OPERATIONAL; + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + break; + case UA_PUBSUBSTATE_ERROR: + switch (dataSetReader->state){ + case UA_PUBSUBSTATE_DISABLED: + case UA_PUBSUBSTATE_PAUSED: + case UA_PUBSUBSTATE_OPERATIONAL: + case UA_PUBSUBSTATE_ERROR: /* intended fall through */ + dataSetReader->state = state; + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + } + dataSetReader->state = UA_PUBSUBSTATE_ERROR; + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Received unknown PubSub state!"); + ret = UA_STATUSCODE_BADINTERNALERROR; + } + return ret; +} + +UA_StatusCode +UA_FieldTargetVariable_copy(const UA_FieldTargetVariable *src, UA_FieldTargetVariable *dst) { + /* Do a simple memcpy */ + memcpy(dst, src, sizeof(UA_FieldTargetVariable)); + return UA_FieldTargetDataType_copy(&src->targetVariable, &dst->targetVariable); +} + +UA_StatusCode +UA_TargetVariables_copy(const UA_TargetVariables *src, UA_TargetVariables *dst) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + memcpy(dst, src, sizeof(UA_TargetVariables)); + if(src->targetVariablesSize > 0) { + dst->targetVariables = (UA_FieldTargetVariable*) + UA_calloc(src->targetVariablesSize, sizeof(UA_FieldTargetVariable)); + if(!dst->targetVariables) + return UA_STATUSCODE_BADOUTOFMEMORY; + for(size_t i = 0; i < src->targetVariablesSize; i++) + retVal |= UA_FieldTargetVariable_copy(&src->targetVariables[i], &dst->targetVariables[i]); + } + + return retVal; +} + +void +UA_TargetVariables_clear(UA_TargetVariables *subscribedDataSetTarget) { + for(size_t i = 0; i < subscribedDataSetTarget->targetVariablesSize; i++) { + UA_FieldTargetDataType_clear(&subscribedDataSetTarget->targetVariables[i].targetVariable); + } + if(subscribedDataSetTarget->targetVariablesSize > 0) + UA_free(subscribedDataSetTarget->targetVariables); + memset(subscribedDataSetTarget, 0, sizeof(UA_TargetVariables)); +} + +/* This Method is used to initially set the SubscribedDataSet to + * TargetVariablesType and to create the list of target Variables of a + * SubscribedDataSetType. */ +UA_StatusCode +UA_Server_DataSetReader_createTargetVariables(UA_Server *server, + UA_NodeId dataSetReaderIdentifier, + size_t targetVariablesSize, + const UA_FieldTargetVariable *targetVariables) { + UA_DataSetReader *dataSetReader = UA_ReaderGroup_findDSRbyId(server, dataSetReaderIdentifier); + if(!dataSetReader) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + if(dataSetReader->configurationFrozen) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Create Target Variables failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize > 0) + UA_TargetVariables_clear(&dataSetReader->config.subscribedDataSet.subscribedDataSetTarget); + + /* Set subscribed dataset to TargetVariableType */ + dataSetReader->config.subscribedDataSetType = UA_PUBSUB_SDS_TARGET; + UA_TargetVariables tmp; + tmp.targetVariablesSize = targetVariablesSize; + tmp.targetVariables = (UA_FieldTargetVariable*)(uintptr_t)targetVariables; + return UA_TargetVariables_copy(&tmp, &dataSetReader->config.subscribedDataSet.subscribedDataSetTarget); +} + +/* This functionality of this API will be used in future to create mirror Variables - TODO */ +/* UA_StatusCode +UA_Server_DataSetReader_createDataSetMirror(UA_Server *server, UA_String *parentObjectNodeName, + UA_NodeId dataSetReaderIdentifier) { + if((server == NULL) || (parentNode == NULL)) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_DataSetReader* pDataSetReader = UA_ReaderGroup_findDSRbyId(server, dataSetReaderIdentifier); + if(pDataSetReader == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + if(pDataSetReader->configurationFrozen) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Add Target Variables failed. Subscriber configuration is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } // TODO: Frozen configuration variable in TargetVariable structure + + UA_TargetVariables targetVars; + targetVars.targetVariablesSize = pDataSetReader->config.dataSetMetaData.fieldsSize; + targetVars.targetVariables = (UA_FieldTargetVariable *) + UA_calloc(targetVars.targetVariablesSize, sizeof(UA_FieldTargetVariable)); + + for(size_t i = 0; i < pDataSetReader->config.dataSetMetaData.fieldsSize; i++) { + UA_VariableAttributes vAttr = UA_VariableAttributes_default; + vAttr.valueRank = pDataSetReader->config.dataSetMetaData.fields[i].valueRank; + if(pDataSetReader->config.dataSetMetaData.fields[i].arrayDimensionsSize > 0) { + retval = UA_Array_copy(pDataSetReader->config.dataSetMetaData.fields[i].arrayDimensions, + pDataSetReader->config.dataSetMetaData.fields[i].arrayDimensionsSize, + (void**)&vAttr.arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]); + if(retval == UA_STATUSCODE_GOOD) { + vAttr.arrayDimensionsSize = + pDataSetReader->config.dataSetMetaData.fields[i].arrayDimensionsSize; + } + + } + + vAttr.dataType = pDataSetReader->config.dataSetMetaData.fields[i].dataType; + + vAttr.accessLevel = UA_ACCESSLEVELMASK_READ; + UA_LocalizedText_copy(&pDataSetReader->config.dataSetMetaData.fields[i].description, + &vAttr.description); + UA_QualifiedName qn; + UA_QualifiedName_init(&qn); + char szTmpName[UA_MAX_SIZENAME]; + if(pDataSetReader->config.dataSetMetaData.fields[i].name.length > 0) { + UA_UInt16 slen = UA_MAX_SIZENAME -1; + vAttr.displayName.locale = UA_STRING("en-US"); + vAttr.displayName.text = pDataSetReader->config.dataSetMetaData.fields[i].name; + if(pDataSetReader->config.dataSetMetaData.fields[i].name.length < slen) { + slen = (UA_UInt16)pDataSetReader->config.dataSetMetaData.fields[i].name.length; + UA_snprintf(szTmpName, sizeof(szTmpName), "%.*s", (int)slen, + (const char*)pDataSetReader->config.dataSetMetaData.fields[i].name.data); + } + + szTmpName[slen] = '\0'; + qn = UA_QUALIFIEDNAME(1, szTmpName); + } + else { + strcpy(szTmpName, "SubscribedVariable"); + vAttr.displayName = UA_LOCALIZEDTEXT("en-US", szTmpName); + qn = UA_QUALIFIEDNAME(1, "SubscribedVariable"); + } + + // Add variable to the given parent node + UA_NodeId newNode; + retval = UA_Server_addVariableNode(server, UA_NODEID_NULL, *parentNode, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), qn, + UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE), + vAttr, NULL, &newNode); + if(retval == UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, + "addVariableNode %s succeeded", szTmpName); + } + else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_USERLAND, + "addVariableNode: error 0x%" PRIx32, retval); + } + + targetVars.targetVariables[i].targetVariable.attributeId = UA_ATTRIBUTEID_VALUE; + UA_NodeId_copy(&newNode, &targetVars.targetVariables[i].targetVariable.targetNodeId); + UA_NodeId_clear(&newNode); + if(vAttr.arrayDimensionsSize > 0) { + UA_Array_delete(vAttr.arrayDimensions, vAttr.arrayDimensionsSize, + &UA_TYPES[UA_TYPES_UINT32]); + } + } + + UA_TargetVariables_clear(&targetVars); + return retval; +}*/ + +void +UA_Server_DataSetReader_process(UA_Server *server, UA_DataSetReader *dataSetReader, + UA_DataSetMessage* dataSetMsg) { + if((dataSetReader == NULL) || (dataSetMsg == NULL) || (server == NULL)) { + return; + } + + if(!dataSetMsg->header.dataSetMessageValid) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "DataSetMessage is discarded: message is not valid"); + /* To Do check ConfigurationVersion*/ + /*if(dataSetMsg->header.configVersionMajorVersionEnabled) + * { + * if(dataSetMsg->header.configVersionMajorVersion != dataSetReader->config.dataSetMetaData.configurationVersion.majorVersion) + * { + * UA_LOG_WARNING(server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetMessage is discarded: ConfigurationVersion MajorVersion does not match"); + * return; + * } + } */ + return; + } + + UA_ReaderGroup *rg = UA_ReaderGroup_findRGbyId(server, dataSetReader->linkedReaderGroup); + if(dataSetMsg->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) { + if(dataSetMsg->header.fieldEncoding != UA_FIELDENCODING_RAWDATA) { + size_t anzFields = dataSetMsg->data.keyFrameData.fieldCount; + if(dataSetReader->config.dataSetMetaData.fieldsSize < anzFields) { + anzFields = dataSetReader->config.dataSetMetaData.fieldsSize; + } + + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize < anzFields) { + anzFields = dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize; + } + + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(rg->config.rtLevel == UA_PUBSUB_RT_FIXED_SIZE) { + for(UA_UInt16 i = 0; i < anzFields; i++) { + if(dataSetMsg->data.keyFrameData.dataSetFields[i].hasValue) { + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.attributeId == UA_ATTRIBUTEID_VALUE) { + memcpy((**(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].externalDataValue)).value.data, + dataSetMsg->data.keyFrameData.dataSetFields[i].value.data, + dataSetMsg->data.keyFrameData.dataSetFields[i].value.type->memSize); + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariableContext) + memcpy(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariableContext, + dataSetMsg->data.keyFrameData.dataSetFields[i].value.data, + dataSetMsg->data.keyFrameData.dataSetFields[i].value.type->memSize); + + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].afterWrite) + dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].afterWrite(server, + &dataSetReader->identifier, + &dataSetReader->linkedReaderGroup, + &dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId, + dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariableContext, + dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].externalDataValue); + + } + } + } + + return; + } + + for(UA_UInt16 i = 0; i < anzFields; i++) { + if(dataSetMsg->data.keyFrameData.dataSetFields[i].hasValue) { + if(dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.attributeId == UA_ATTRIBUTEID_VALUE) { + retVal = UA_Server_writeValue(server, + dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId, + dataSetMsg->data.keyFrameData.dataSetFields[i].value); + if(retVal != UA_STATUSCODE_GOOD) + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error Write Value KF %" PRIu16 ": 0x%"PRIx32, i, retVal); + } + else { + UA_WriteValue writeVal; + UA_WriteValue_init(&writeVal); + writeVal.attributeId = dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.attributeId; + writeVal.indexRange = dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.receiverIndexRange; + writeVal.nodeId = dataSetReader->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[i].targetVariable.targetNodeId; + UA_DataValue_copy(&dataSetMsg->data.keyFrameData.dataSetFields[i], &writeVal.value); + retVal = UA_Server_write(server, &writeVal); + if(retVal != UA_STATUSCODE_GOOD) + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error Write KF %" PRIu16 ": 0x%" PRIx32, i, retVal); + } + } + } + } + } + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader '%.*s': received a network message", + (int) dataSetReader->config.name.length, dataSetReader->config.name.data); +#ifdef UA_ENABLE_PUBSUB_MONITORING + /* if previous reader state was error (because we haven't received messages and ran into timeout) we should set the state back to operational */ + if (dataSetReader->state == UA_PUBSUBSTATE_ERROR) { + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_OPERATIONAL, dataSetReader); + if (server->config.pubsubConfiguration->pubsubStateChangeCallback != 0) { + server->config.pubsubConfiguration->pubsubStateChangeCallback(&dataSetReader->identifier, UA_PUBSUBSTATE_OPERATIONAL, UA_STATUSCODE_GOOD); + } + } + if (dataSetReader->msgRcvTimeoutTimerRunning == UA_TRUE) { + /* stop message receive timeout timer */ + if (server->config.pubsubConfiguration->monitoringInterface.stopMonitoring(server, dataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, dataSetReader) == UA_STATUSCODE_GOOD) { + dataSetReader->msgRcvTimeoutTimerRunning = UA_FALSE; + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "DataSetReader '%.*s': stop receive timeout timer failed", + (int) dataSetReader->config.name.length, dataSetReader->config.name.data); + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dataSetReader); + } + } + /* start message receive timeout timer */ + if (server->config.pubsubConfiguration->monitoringInterface.startMonitoring(server, dataSetReader->identifier, + UA_PUBSUB_COMPONENT_DATASETREADER, UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT, dataSetReader) == UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "Info: DataSetReader '%.*s': start receive timeout timer", + (int) dataSetReader->config.name.length, dataSetReader->config.name.data); + dataSetReader->msgRcvTimeoutTimerRunning = UA_TRUE; + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Starting Message Receive Timeout timer failed."); + UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dataSetReader); + } +#endif /* UA_ENABLE_PUBSUB_MONITORING */ +} + +#ifdef UA_ENABLE_PUBSUB_MONITORING +/* Timeout callback for DataSetReader MessageReceiveTimeout handling */ +void +UA_DataSetReader_handleMessageReceiveTimeout(UA_Server *server, void *dataSetReader) { + if ((!server) || (!dataSetReader)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_DataSetReader_handleMessageReceiveTimeout(): null pointer param"); + return; + } + UA_DataSetReader *dsReader = (UA_DataSetReader*) dataSetReader; + if (dsReader->componentType != UA_PUBSUB_COMPONENT_DATASETREADER) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_DataSetReader_handleMessageReceiveTimeout(): input param is not of type DataSetReader"); + return; + } + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_DataSetReader_handleMessageReceiveTimeout(): " + "MessageReceiveTimeout occurred at DataSetReader '%.*s': MessageReceiveTimeout = %f Timer Id = %u ", + (int) dsReader->config.name.length, dsReader->config.name.data, dsReader->config.messageReceiveTimeout, (UA_UInt32) dsReader->msgRcvTimeoutTimerId); + + UA_ServerConfig *pConfig = UA_Server_getConfig(server); + if (pConfig->pubsubConfiguration->pubsubStateChangeCallback != 0) { + pConfig->pubsubConfiguration->pubsubStateChangeCallback(&dsReader->identifier, UA_PUBSUBSTATE_ERROR, UA_STATUSCODE_BADTIMEOUT); + } + + if (UA_DataSetReader_setPubSubState(server, UA_PUBSUBSTATE_ERROR, dsReader) != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_DataSetReader_handleMessageReceiveTimeout(): setting pubsub state failed"); + } +} +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +static void +UA_DataSetReader_clear(UA_Server *server, UA_DataSetReader *dataSetReader) { + + /* Delete DataSetReader config */ + UA_DataSetReaderConfig_clear(&dataSetReader->config); + + /* Delete DataSetReader */ + UA_ReaderGroup* pGroup = UA_ReaderGroup_findRGbyId(server, dataSetReader->linkedReaderGroup); + if(pGroup != NULL) { + pGroup->readersCount--; + } + + UA_NodeId_clear(&dataSetReader->identifier); + UA_NodeId_clear(&dataSetReader->linkedReaderGroup); + if (dataSetReader->config.subscribedDataSetType == UA_PUBSUB_SDS_TARGET) { + UA_TargetVariables_clear(&dataSetReader->config.subscribedDataSet.subscribedDataSetTarget); + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_DataSetReader_clear(): unsupported subscribed dataset enum type"); + } + + /* Remove DataSetReader from group */ + LIST_REMOVE(dataSetReader, listEntry); + /* Free memory allocated for DataSetReader */ + UA_free(dataSetReader); +} + +UA_StatusCode +UA_Server_processNetworkMessage(UA_Server *server, UA_NetworkMessage *pMsg, + UA_PubSubConnection *pConnection) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(!pMsg || !pConnection) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* To Do Handle multiple DataSetMessage for one NetworkMessage */ + /* To Do The condition pMsg->dataSetClassIdEnabled + * Here some filtering is possible */ + + UA_DataSetReader *dataSetReader; + retval = getReaderFromIdentifier(server, pMsg, &dataSetReader, pConnection); + if(retval != UA_STATUSCODE_GOOD) { + return retval; + } + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "DataSetReader found with PublisherId"); + + UA_Byte anzDataSets = 1; + if(pMsg->payloadHeaderEnabled) + anzDataSets = pMsg->payloadHeader.dataSetPayloadHeader.count; + for(UA_Byte iterator = 0; iterator < anzDataSets; iterator++) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "Process Msg with DataSetReader!"); + UA_Server_DataSetReader_process(server, dataSetReader, + &pMsg->payload.dataSetPayload.dataSetMessages[iterator]); + } + + /* To Do Handle when dataSetReader parameters are null for publisherId + * and zero for WriterGroupId and DataSetWriterId */ + return UA_STATUSCODE_GOOD; +} + +#endif /* UA_ENABLE_PUBSUB */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_manager.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2019 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2018 Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + +#ifdef UA_ENABLE_PUBSUB /* conditional compilation */ + +#ifdef UA_ENABLE_PUBSUB_MONITORING +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +#define UA_DATETIMESTAMP_2000 125911584000000000 + +UA_StatusCode +UA_Server_addPubSubConnection(UA_Server *server, + const UA_PubSubConnectionConfig *connectionConfig, + UA_NodeId *connectionIdentifier) { + /* Find the matching UA_PubSubTransportLayers */ + UA_PubSubTransportLayer *tl = NULL; + for(size_t i = 0; i < server->config.pubsubTransportLayersSize; i++) { + if(connectionConfig && + UA_String_equal(&server->config.pubsubTransportLayers[i].transportProfileUri, + &connectionConfig->transportProfileUri)) { + tl = &server->config.pubsubTransportLayers[i]; + } + } + if(!tl) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Connection creation failed. Requested transport layer not found."); + return UA_STATUSCODE_BADNOTFOUND; + } + + /* Create a copy of the connection config */ + UA_PubSubConnectionConfig *tmpConnectionConfig = (UA_PubSubConnectionConfig *) + UA_calloc(1, sizeof(UA_PubSubConnectionConfig)); + if(!tmpConnectionConfig){ + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Connection creation failed. Out of Memory."); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_StatusCode retval = UA_PubSubConnectionConfig_copy(connectionConfig, tmpConnectionConfig); + if(retval != UA_STATUSCODE_GOOD){ + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Connection creation failed. Could not copy the config."); + return retval; + } + + /* Create new connection and add to UA_PubSubManager */ + UA_PubSubConnection *newConnectionsField = (UA_PubSubConnection *) + UA_calloc(1, sizeof(UA_PubSubConnection)); + if(!newConnectionsField) { + UA_PubSubConnectionConfig_clear(tmpConnectionConfig); + UA_free(tmpConnectionConfig); + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Connection creation failed. Out of Memory."); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + newConnectionsField->componentType = UA_PUBSUB_COMPONENT_CONNECTION; + if (server->pubSubManager.connectionsSize != 0) + TAILQ_INSERT_TAIL(&server->pubSubManager.connections, newConnectionsField, listEntry); + else { + TAILQ_INIT(&server->pubSubManager.connections); + TAILQ_INSERT_HEAD(&server->pubSubManager.connections, newConnectionsField, listEntry); + } + + server->pubSubManager.connectionsSize++; + + LIST_INIT(&newConnectionsField->writerGroups); + newConnectionsField->config = tmpConnectionConfig; + + /* Open the channel */ + newConnectionsField->channel = tl->createPubSubChannel(newConnectionsField->config); + if(!newConnectionsField->channel) { + UA_PubSubConnection_clear(server, newConnectionsField); + TAILQ_REMOVE(&server->pubSubManager.connections, newConnectionsField, listEntry); + server->pubSubManager.connectionsSize--; + UA_free(newConnectionsField); + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PubSub Connection creation failed. Transport layer creation problem."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + UA_PubSubManager_generateUniqueNodeId(server, &newConnectionsField->identifier); + + if(connectionIdentifier) + UA_NodeId_copy(&newConnectionsField->identifier, connectionIdentifier); + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addPubSubConnectionRepresentation(server, newConnectionsField); +#endif + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_removePubSubConnection(UA_Server *server, const UA_NodeId connection) { + //search the identified Connection and store the Connection index + UA_PubSubConnection *currentConnection = UA_PubSubConnection_findConnectionbyId(server, connection); + if(!currentConnection) + return UA_STATUSCODE_BADNOTFOUND; + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removePubSubConnectionRepresentation(server, currentConnection); +#endif + server->pubSubManager.connectionsSize--; + + UA_PubSubConnection_clear(server, currentConnection); + TAILQ_REMOVE(&server->pubSubManager.connections, currentConnection, listEntry); + UA_free(currentConnection); + return UA_STATUSCODE_GOOD; +} + +UA_AddPublishedDataSetResult +UA_Server_addPublishedDataSet(UA_Server *server, const UA_PublishedDataSetConfig *publishedDataSetConfig, + UA_NodeId *pdsIdentifier) { + UA_AddPublishedDataSetResult result = {UA_STATUSCODE_BADINVALIDARGUMENT, 0, NULL, {0, 0}}; + if(!publishedDataSetConfig){ + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PublishedDataSet creation failed. No config passed in."); + return result; + } + if(publishedDataSetConfig->publishedDataSetType != UA_PUBSUB_DATASET_PUBLISHEDITEMS){ + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PublishedDataSet creation failed. Unsupported PublishedDataSet type."); + return result; + } + //deep copy the given connection config + UA_PublishedDataSetConfig tmpPublishedDataSetConfig; + memset(&tmpPublishedDataSetConfig, 0, sizeof(UA_PublishedDataSetConfig)); + if(UA_PublishedDataSetConfig_copy(publishedDataSetConfig, &tmpPublishedDataSetConfig) != UA_STATUSCODE_GOOD){ + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PublishedDataSet creation failed. Configuration copy failed."); + result.addResult = UA_STATUSCODE_BADINTERNALERROR; + return result; + } + //create new PDS and add to UA_PubSubManager + UA_PublishedDataSet *newPubSubDataSetField = (UA_PublishedDataSet *) + UA_calloc(1, sizeof(UA_PublishedDataSet)); + if(!newPubSubDataSetField) { + UA_PublishedDataSetConfig_clear(&tmpPublishedDataSetConfig); + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "PublishedDataSet creation failed. Out of Memory."); + result.addResult = UA_STATUSCODE_BADOUTOFMEMORY; + return result; + } + memset(newPubSubDataSetField, 0, sizeof(UA_PublishedDataSet)); + TAILQ_INIT(&newPubSubDataSetField->fields); + newPubSubDataSetField->config = tmpPublishedDataSetConfig; + + if (server->pubSubManager.publishedDataSetsSize != 0) + TAILQ_INSERT_TAIL(&server->pubSubManager.publishedDataSets, newPubSubDataSetField, listEntry); + else { + TAILQ_INIT(&server->pubSubManager.publishedDataSets); + TAILQ_INSERT_HEAD(&server->pubSubManager.publishedDataSets, newPubSubDataSetField, listEntry); + } + if(tmpPublishedDataSetConfig.publishedDataSetType == UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE){ + //parse template config and add fields (later PubSub batch) + } + //generate unique nodeId + UA_PubSubManager_generateUniqueNodeId(server, &newPubSubDataSetField->identifier); + if(pdsIdentifier != NULL){ + UA_NodeId_copy(&newPubSubDataSetField->identifier, pdsIdentifier); + } + + result.addResult = UA_STATUSCODE_GOOD; + result.fieldAddResults = NULL; + result.fieldAddResultsSize = 0; + + //fill the DataSetMetaData + switch(tmpPublishedDataSetConfig.publishedDataSetType){ + case UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE: + if(UA_DataSetMetaDataType_copy(&tmpPublishedDataSetConfig.config.itemsTemplate.metaData, + &newPubSubDataSetField->dataSetMetaData) != UA_STATUSCODE_GOOD){ + UA_Server_removeDataSetField(server, newPubSubDataSetField->identifier); + result.addResult = UA_STATUSCODE_BADINTERNALERROR; + } + break; + case UA_PUBSUB_DATASET_PUBLISHEDEVENTS_TEMPLATE: + if(UA_DataSetMetaDataType_copy(&tmpPublishedDataSetConfig.config.eventTemplate.metaData, + &newPubSubDataSetField->dataSetMetaData) != UA_STATUSCODE_GOOD){ + UA_Server_removeDataSetField(server, newPubSubDataSetField->identifier); + result.addResult = UA_STATUSCODE_BADINTERNALERROR; + } + break; + case UA_PUBSUB_DATASET_PUBLISHEDEVENTS: + newPubSubDataSetField->dataSetMetaData.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference(); + newPubSubDataSetField->dataSetMetaData.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference(); + newPubSubDataSetField->dataSetMetaData.dataSetClassId = UA_GUID_NULL; + if(UA_String_copy(&tmpPublishedDataSetConfig.name, &newPubSubDataSetField->dataSetMetaData.name) != UA_STATUSCODE_GOOD){ + UA_Server_removeDataSetField(server, newPubSubDataSetField->identifier); + result.addResult = UA_STATUSCODE_BADINTERNALERROR; + } + newPubSubDataSetField->dataSetMetaData.description = UA_LOCALIZEDTEXT_ALLOC("", ""); + break; + case UA_PUBSUB_DATASET_PUBLISHEDITEMS: + newPubSubDataSetField->dataSetMetaData.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference(); + newPubSubDataSetField->dataSetMetaData.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference(); + if(UA_String_copy(&tmpPublishedDataSetConfig.name, &newPubSubDataSetField->dataSetMetaData.name) != UA_STATUSCODE_GOOD){ + UA_Server_removeDataSetField(server, newPubSubDataSetField->identifier); + result.addResult = UA_STATUSCODE_BADINTERNALERROR; + } + newPubSubDataSetField->dataSetMetaData.description = UA_LOCALIZEDTEXT_ALLOC("", ""); + newPubSubDataSetField->dataSetMetaData.dataSetClassId = UA_GUID_NULL; + break; + } + + server->pubSubManager.publishedDataSetsSize++; + result.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference(); + result.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference(); +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + addPublishedDataItemsRepresentation(server, newPubSubDataSetField); +#endif + return result; +} + +UA_StatusCode +UA_Server_removePublishedDataSet(UA_Server *server, const UA_NodeId pds) { + //search the identified PublishedDataSet and store the PDS index + UA_PublishedDataSet *publishedDataSet = UA_PublishedDataSet_findPDSbyId(server, pds); + if(!publishedDataSet){ + return UA_STATUSCODE_BADNOTFOUND; + } + if(publishedDataSet->configurationFrozen){ + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Remove PublishedDataSet failed. PublishedDataSet is frozen."); + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + + //search for referenced writers -> delete this writers. (Standard: writer must be connected with PDS) + UA_PubSubConnection *tmpConnectoin; + TAILQ_FOREACH(tmpConnectoin, &server->pubSubManager.connections, listEntry){ + UA_WriterGroup *writerGroup; + LIST_FOREACH(writerGroup, &tmpConnectoin->writerGroups, listEntry){ + UA_DataSetWriter *currentWriter, *tmpWriterGroup; + LIST_FOREACH_SAFE(currentWriter, &writerGroup->writers, listEntry, tmpWriterGroup){ + if(UA_NodeId_equal(¤tWriter->connectedDataSet, &publishedDataSet->identifier)){ + UA_Server_removeDataSetWriter(server, currentWriter->identifier); + } + } + } + } +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL + removePublishedDataSetRepresentation(server, publishedDataSet); +#endif + UA_PublishedDataSet_clear(server, publishedDataSet); + server->pubSubManager.publishedDataSetsSize--; + + TAILQ_REMOVE(&server->pubSubManager.publishedDataSets, publishedDataSet, listEntry); + UA_free(publishedDataSet); + return UA_STATUSCODE_GOOD; +} + +/* Calculate the time difference between current time and UTC (00:00) on January + * 1, 2000. */ +UA_UInt32 +UA_PubSubConfigurationVersionTimeDifference() { + UA_UInt32 timeDiffSince2000 = (UA_UInt32) (UA_DateTime_now() - UA_DATETIMESTAMP_2000); + return timeDiffSince2000; +} + +/* Generate a new unique NodeId. This NodeId will be used for the information + * model representation of PubSub entities. */ +void +UA_PubSubManager_generateUniqueNodeId(UA_Server *server, UA_NodeId *nodeId) { + UA_NodeId newNodeId = UA_NODEID_NUMERIC(0, 0); + UA_Node *newNode = UA_NODESTORE_NEW(server, UA_NODECLASS_OBJECT); + UA_NODESTORE_INSERT(server, newNode, &newNodeId); + UA_NodeId_copy(&newNodeId, nodeId); +} + +/* Delete the current PubSub configuration including all nested members. This + * action also delete the configured PubSub transport Layers. */ +void +UA_PubSubManager_delete(UA_Server *server, UA_PubSubManager *pubSubManager) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "PubSub cleanup was called."); + + /* Stop and unfreeze all WriterGroups */ + UA_PubSubConnection *tmpConnection; + TAILQ_FOREACH(tmpConnection, &server->pubSubManager.connections, listEntry){ + for(size_t i = 0; i < pubSubManager->connectionsSize; i++) { + UA_WriterGroup *writerGroup; + LIST_FOREACH(writerGroup, &tmpConnection->writerGroups, listEntry) { + UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, writerGroup); + UA_Server_unfreezeWriterGroupConfiguration(server, writerGroup->identifier); + } + } + } + + //free the currently configured transport layers + if (server->config.pubsubTransportLayersSize > 0) { + UA_free(server->config.pubsubTransportLayers); + server->config.pubsubTransportLayersSize = 0; + } + + //remove Connections and WriterGroups + UA_PubSubConnection *tmpConnection1, *tmpConnection2; + TAILQ_FOREACH_SAFE(tmpConnection1, &server->pubSubManager.connections, listEntry, tmpConnection2){ + UA_Server_removePubSubConnection(server, tmpConnection1->identifier); + } + UA_PublishedDataSet *tmpPDS1, *tmpPDS2; + TAILQ_FOREACH_SAFE(tmpPDS1, &server->pubSubManager.publishedDataSets, listEntry, tmpPDS2){ + UA_Server_removePublishedDataSet(server, tmpPDS1->identifier); + } +} + +/***********************************/ +/* PubSub Jobs abstraction */ +/***********************************/ + +/* Default Timer based PubSub Callbacks */ + +UA_StatusCode +UA_PubSubManager_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId) { + return UA_Timer_addRepeatedCallback(&server->timer, (UA_ApplicationCallback)callback, + server, data, interval_ms, callbackId); +} + +UA_StatusCode +UA_PubSubManager_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, + UA_Double interval_ms) { + return UA_Timer_changeRepeatedCallbackInterval(&server->timer, callbackId, interval_ms); +} + +void +UA_PubSubManager_removeRepeatedPubSubCallback(UA_Server *server, UA_UInt64 callbackId) { + UA_Timer_removeCallback(&server->timer, callbackId); +} + + +#ifdef UA_ENABLE_PUBSUB_MONITORING + +static UA_StatusCode +UA_PubSubComponent_createMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data, UA_ServerCallback callback) { + + if ((!server) || (!data)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error UA_PubSubComponent_createMonitoring(): " + "null pointer param"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch (eComponentType) { + case UA_PUBSUB_COMPONENT_DATASETREADER: { + UA_DataSetReader *reader = (UA_DataSetReader*) data; + switch (eMonitoringType) { + case UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT: + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_createMonitoring(): DataSetReader '%.*s' " + "- MessageReceiveTimeout", (UA_Int32) reader->config.name.length, reader->config.name.data); + reader->msgRcvTimeoutTimerCallback = callback; + break; + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_createMonitoring(): DataSetReader '%.*s' " + "DataSetReader does not support timeout type '%i'", (UA_Int32) reader->config.name.length, reader->config.name.data, + eMonitoringType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_createMonitoring(): PubSub component type '%i' is not supported", eComponentType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + return ret; +} + +static UA_StatusCode +UA_PubSubComponent_startMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data) { + + if ((!server) || (!data)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error UA_PubSubComponent_startMonitoring(): " + "null pointer param"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch (eComponentType) { + case UA_PUBSUB_COMPONENT_DATASETREADER: { + UA_DataSetReader *reader = (UA_DataSetReader*) data; + switch (eMonitoringType) { + case UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT: { + /* use a timed callback, because one notification is enough, + we assume that MessageReceiveTimeout configuration is in [ms], we do not handle or check fractions */ + UA_UInt64 interval = (UA_UInt64)(reader->config.messageReceiveTimeout * UA_DATETIME_MSEC); + ret = UA_Timer_addTimedCallback(&server->timer, (UA_ApplicationCallback) reader->msgRcvTimeoutTimerCallback, + server, reader, UA_DateTime_nowMonotonic() + (UA_DateTime) interval, &(reader->msgRcvTimeoutTimerId)); + if (ret == UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_PubSubComponent_startMonitoring(): DataSetReader '%.*s'- MessageReceiveTimeout: MessageReceiveTimeout = '%f' " + "Timer Id = '%u'", (UA_Int32) reader->config.name.length, reader->config.name.data, + reader->config.messageReceiveTimeout, (UA_UInt32) reader->msgRcvTimeoutTimerId); + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_startMonitoring(): DataSetReader '%.*s' - MessageReceiveTimeout: start timer failed", + (UA_Int32) reader->config.name.length, reader->config.name.data); + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_startMonitoring(): DataSetReader '%.*s' " + "DataSetReader does not support timeout type '%i'", (UA_Int32) reader->config.name.length, reader->config.name.data, + eMonitoringType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_startMonitoring(): PubSub component type '%i' is not supported", eComponentType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + return ret; +} + +static UA_StatusCode +UA_PubSubComponent_stopMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data) { + + if ((!server) || (!data)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error UA_PubSubComponent_stopMonitoring(): " + "null pointer param"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch (eComponentType) { + case UA_PUBSUB_COMPONENT_DATASETREADER: { + UA_DataSetReader *reader = (UA_DataSetReader*) data; + switch (eMonitoringType) { + case UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT: { + UA_Timer_removeCallback(&server->timer, reader->msgRcvTimeoutTimerId); + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_PubSubComponent_stopMonitoring(): DataSetReader '%.*s' - MessageReceiveTimeout: MessageReceiveTimeout = '%f' " + "Timer Id = '%u'", (UA_Int32) reader->config.name.length, reader->config.name.data, + reader->config.messageReceiveTimeout, (UA_UInt32) reader->msgRcvTimeoutTimerId); + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_stopMonitoring(): DataSetReader '%.*s' " + "DataSetReader does not support timeout type '%i'", (UA_Int32) reader->config.name.length, reader->config.name.data, + eMonitoringType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_stopMonitoring(): PubSub component type '%i' is not supported", eComponentType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + return ret; +} + +static UA_StatusCode +UA_PubSubComponent_updateMonitoringInterval(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data) +{ + if ((!server) || (!data)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error UA_PubSubComponent_updateMonitoringInterval(): " + "null pointer param"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch (eComponentType) { + case UA_PUBSUB_COMPONENT_DATASETREADER: { + UA_DataSetReader *reader = (UA_DataSetReader*) data; + switch (eMonitoringType) { + case UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT: { + ret = UA_Timer_changeRepeatedCallbackInterval(&server->timer, reader->msgRcvTimeoutTimerId, + reader->config.messageReceiveTimeout); + if (ret == UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_PubSubComponent_updateMonitoringInterval(): DataSetReader '%.*s' - MessageReceiveTimeout: new MessageReceiveTimeout = '%f' " + "Timer Id = '%u'", (UA_Int32) reader->config.name.length, reader->config.name.data, + reader->config.messageReceiveTimeout, (UA_UInt32) reader->msgRcvTimeoutTimerId); + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_updateMonitoringInterval(): DataSetReader '%.*s': update timer interval failed", + (UA_Int32) reader->config.name.length, reader->config.name.data); + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_createMonitoring(): DataSetReader '%.*s' " + "DataSetReader does not support timeout type '%i'", (UA_Int32) reader->config.name.length, reader->config.name.data, + eMonitoringType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_updateMonitoringInterval(): PubSub component type '%i' is not supported", eComponentType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + return ret; +} + +static UA_StatusCode +UA_PubSubComponent_deleteMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data) { + + if ((!server) || (!data)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Error UA_PubSubComponent_deleteMonitoring(): " + "null pointer param"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + UA_StatusCode ret = UA_STATUSCODE_GOOD; + switch (eComponentType) { + case UA_PUBSUB_COMPONENT_DATASETREADER: { + UA_DataSetReader *reader = (UA_DataSetReader*) data; + switch (eMonitoringType) { + case UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT: + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "UA_PubSubComponent_deleteMonitoring(): DataSetReader '%.*s' - MessageReceiveTimeout: Timer Id = '%u'", + (UA_Int32) reader->config.name.length, reader->config.name.data, (UA_UInt32) reader->msgRcvTimeoutTimerId); + break; + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "UA_PubSubComponent_deleteMonitoring(): DataSetReader '%.*s' " + "DataSetReader does not support timeout type '%i'", (UA_Int32) reader->config.name.length, reader->config.name.data, + eMonitoringType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + break; + } + default: + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Error UA_PubSubComponent_deleteMonitoring(): PubSub component type '%i' is not supported", eComponentType); + ret = UA_STATUSCODE_BADNOTSUPPORTED; + break; + } + return ret; +} + +UA_StatusCode +UA_PubSubManager_setDefaultMonitoringCallbacks(UA_PubSubMonitoringInterface *monitoringInterface) { + if (monitoringInterface == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + monitoringInterface->createMonitoring = UA_PubSubComponent_createMonitoring; + monitoringInterface->startMonitoring = UA_PubSubComponent_startMonitoring; + monitoringInterface->stopMonitoring = UA_PubSubComponent_stopMonitoring; + monitoringInterface->updateMonitoringInterval = UA_PubSubComponent_updateMonitoringInterval; + monitoringInterface->deleteMonitoring = UA_PubSubComponent_deleteMonitoring; + return UA_STATUSCODE_GOOD; +} + +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +#endif /* UA_ENABLE_PUBSUB */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_ns0.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Kalycito Infotech Private Limited + * Copyright (c) 2020 Yannick Wallerer, Siemens AG + * Copyright (c) 2020 Thomas Fischer, Siemens AG + */ + + +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG +#endif + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL /* conditional compilation */ + +typedef struct{ + UA_NodeId parentNodeId; + UA_UInt32 parentClassifier; + UA_UInt32 elementClassiefier; +} UA_NodePropertyContext; + +//Prototypes +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode addWriterGroupAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output); +static UA_StatusCode removeGroupAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output); +static UA_StatusCode addDataSetWriterAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output); + +#endif + +static UA_StatusCode +addPubSubObjectNode(UA_Server *server, char* name, UA_UInt32 objectid, + UA_UInt32 parentid, UA_UInt32 referenceid, UA_UInt32 type_id) { + UA_ObjectAttributes object_attr = UA_ObjectAttributes_default; + object_attr.displayName = UA_LOCALIZEDTEXT("", name); + return UA_Server_addObjectNode(server, UA_NODEID_NUMERIC(0, objectid), + UA_NODEID_NUMERIC(0, parentid), + UA_NODEID_NUMERIC(0, referenceid), + UA_QUALIFIEDNAME(0, name), + UA_NODEID_NUMERIC(0, type_id), + object_attr, NULL, NULL); +} + +static UA_StatusCode +writePubSubNs0VariableArray(UA_Server *server, UA_UInt32 id, void *v, + size_t length, const UA_DataType *type) { + UA_Variant var; + UA_Variant_init(&var); + UA_Variant_setArray(&var, v, length, type); + return UA_Server_writeValue(server, UA_NODEID_NUMERIC(0, id), var); +} + +static UA_NodeId +findSingleChildNode(UA_Server *server, UA_QualifiedName targetName, + UA_NodeId referenceTypeId, UA_NodeId startingNode){ + UA_NodeId resultNodeId; + UA_RelativePathElement rpe; + UA_RelativePathElement_init(&rpe); + rpe.referenceTypeId = referenceTypeId; + rpe.isInverse = false; + rpe.includeSubtypes = false; + rpe.targetName = targetName; + UA_BrowsePath bp; + UA_BrowsePath_init(&bp); + bp.startingNode = startingNode; + bp.relativePath.elementsSize = 1; + bp.relativePath.elements = &rpe; + UA_BrowsePathResult bpr = + UA_Server_translateBrowsePathToNodeIds(server, &bp); + if(bpr.statusCode != UA_STATUSCODE_GOOD || + bpr.targetsSize < 1) + return UA_NODEID_NULL; + if(UA_NodeId_copy(&bpr.targets[0].targetId.nodeId, &resultNodeId) != UA_STATUSCODE_GOOD){ + UA_BrowsePathResult_clear(&bpr); + return UA_NODEID_NULL; + } + UA_BrowsePathResult_clear(&bpr); + return resultNodeId; +} + +static void +onRead(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeid, void *context, + const UA_NumericRange *range, const UA_DataValue *data) { + UA_Variant value; + UA_Variant_init(&value); + const UA_NodePropertyContext *nodeContext = (const UA_NodePropertyContext*)context; + const UA_NodeId *myNodeId = &nodeContext->parentNodeId; + + switch(nodeContext->parentClassifier){ + case UA_NS0ID_PUBSUBCONNECTIONTYPE: { + UA_PubSubConnection *pubSubConnection = + UA_PubSubConnection_findConnectionbyId(server, *myNodeId); + switch(nodeContext->elementClassiefier) { + case UA_NS0ID_PUBSUBCONNECTIONTYPE_PUBLISHERID: + if(pubSubConnection->config->publisherIdType == UA_PUBSUB_PUBLISHERID_STRING) { + UA_Variant_setScalar(&value, &pubSubConnection->config->publisherId.numeric, + &UA_TYPES[UA_TYPES_STRING]); + } else { + UA_Variant_setScalar(&value, &pubSubConnection->config->publisherId.numeric, + &UA_TYPES[UA_TYPES_UINT32]); + } + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown property."); + } + break; + } + case UA_NS0ID_DATASETREADERTYPE: { + UA_DataSetReader *dataSetReader = UA_ReaderGroup_findDSRbyId(server, *myNodeId); + if(!dataSetReader) + return; + + switch(nodeContext->elementClassiefier) { + case UA_NS0ID_DATASETREADERTYPE_PUBLISHERID: + UA_Variant_setScalar(&value, dataSetReader->config.publisherId.data, + dataSetReader->config.publisherId.type); + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown property."); + } + break; + } + case UA_NS0ID_WRITERGROUPTYPE: { + UA_WriterGroup *writerGroup = UA_WriterGroup_findWGbyId(server, *myNodeId); + if(!writerGroup) + return; + switch(nodeContext->elementClassiefier){ + case UA_NS0ID_WRITERGROUPTYPE_PUBLISHINGINTERVAL: + UA_Variant_setScalar(&value, &writerGroup->config.publishingInterval, + &UA_TYPES[UA_TYPES_DURATION]); + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown property."); + } + break; + } + case UA_NS0ID_PUBLISHEDDATAITEMSTYPE: { + UA_PublishedDataSet *publishedDataSet = UA_PublishedDataSet_findPDSbyId(server, *myNodeId); + if(!publishedDataSet) + return; + switch(nodeContext->elementClassiefier) { + case UA_NS0ID_PUBLISHEDDATAITEMSTYPE_PUBLISHEDDATA: { + UA_PublishedVariableDataType *pvd = (UA_PublishedVariableDataType *) + UA_calloc(publishedDataSet->fieldSize, sizeof(UA_PublishedVariableDataType)); + size_t counter = 0; + UA_DataSetField *field; + TAILQ_FOREACH(field, &publishedDataSet->fields, listEntry) { + pvd[counter].attributeId = UA_ATTRIBUTEID_VALUE; + pvd[counter].publishedVariable = field->config.field.variable.publishParameters.publishedVariable; + //UA_NodeId_copy(&field->config.field.variable.publishParameters.publishedVariable, &pvd[counter].publishedVariable); + counter++; + } + UA_Variant_setArray(&value, pvd, publishedDataSet->fieldSize, + &UA_TYPES[UA_TYPES_PUBLISHEDVARIABLEDATATYPE]); + break; + } + case UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETMETADATA: { + UA_Variant_setScalarCopy(&value, &publishedDataSet->dataSetMetaData, &UA_TYPES[UA_TYPES_DATASETMETADATATYPE]); + break; + } + case UA_NS0ID_PUBLISHEDDATAITEMSTYPE_CONFIGURATIONVERSION: { + UA_Variant_setScalarCopy(&value, &publishedDataSet->dataSetMetaData.configurationVersion, + &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]); + break; + } + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown property."); + } + break; + } + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown parent element."); + } + UA_Server_writeValue(server, *nodeid, value); +} + +static void +onWrite(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext, + const UA_NumericRange *range, const UA_DataValue *data){ + UA_Variant value; + UA_NodeId myNodeId; + UA_WriterGroup *writerGroup = NULL; + switch(((UA_NodePropertyContext *) nodeContext)->parentClassifier){ + case UA_NS0ID_PUBSUBCONNECTIONTYPE: + //no runtime writable attributes + break; + case UA_NS0ID_WRITERGROUPTYPE: + myNodeId = ((UA_NodePropertyContext *) nodeContext)->parentNodeId; + writerGroup = UA_WriterGroup_findWGbyId(server, myNodeId); + UA_WriterGroupConfig writerGroupConfig; + memset(&writerGroupConfig, 0, sizeof(writerGroupConfig)); + if(!writerGroup) + return; + switch(((UA_NodePropertyContext *) nodeContext)->elementClassiefier){ + case UA_NS0ID_WRITERGROUPTYPE_PUBLISHINGINTERVAL: + UA_Server_getWriterGroupConfig(server, writerGroup->identifier, &writerGroupConfig); + writerGroupConfig.publishingInterval = *((UA_Duration *) data->value.data); + UA_Server_updateWriterGroupConfig(server, writerGroup->identifier, &writerGroupConfig); + UA_Variant_setScalar(&value, data->value.data, &UA_TYPES[UA_TYPES_DURATION]); + UA_WriterGroupConfig_clear(&writerGroupConfig); + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Write error! Unknown property element."); + } + break; + default: + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Read error! Unknown parent element."); + } +} + +static UA_StatusCode +addVariableValueSource(UA_Server *server, UA_ValueCallback valueCallback, + UA_NodeId node, UA_NodePropertyContext *context){ + UA_Server_setNodeContext(server, node, context); + return UA_Server_setVariableNode_valueCallback(server, node, valueCallback); +} + +/*************************************************/ +/* PubSubConnection */ +/*************************************************/ +UA_StatusCode +addPubSubConnectionRepresentation(UA_Server *server, UA_PubSubConnection *connection){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(connection->config->name.length > 512) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_STACKARRAY(char, connectionName, sizeof(char) * connection->config->name.length +1); + memcpy(connectionName, connection->config->name.data, connection->config->name.length); + connectionName[connection->config->name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &connection->identifier); + UA_NodeId pubSubConnectionNodeId; + UA_ObjectAttributes attr = UA_ObjectAttributes_default; + attr.displayName = UA_LOCALIZEDTEXT("de-DE", connectionName); + retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, + UA_NODEID_NUMERIC(0, connection->identifier.identifier.numeric), + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPUBSUBCONNECTION), + UA_QUALIFIEDNAME(0, connectionName), + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE), + (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], + NULL, &pubSubConnectionNodeId); + addPubSubObjectNode(server, "Address", connection->identifier.identifier.numeric+1, + pubSubConnectionNodeId.identifier.numeric, UA_NS0ID_HASCOMPONENT, + UA_NS0ID_NETWORKADDRESSURLTYPE); + UA_Server_addNode_finish(server, pubSubConnectionNodeId); + //End lock zone + + UA_NodeId addressNode, urlNode, interfaceNode, publisherIdNode, connectionPropertieNode, transportProfileUri; + addressNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "Address"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_NODEID_NUMERIC(0, connection->identifier.identifier.numeric)); + urlNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "Url"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), addressNode); + interfaceNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "NetworkInterface"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), addressNode); + publisherIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublisherId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, connection->identifier.identifier.numeric)); + connectionPropertieNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "ConnectionProperties"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, connection->identifier.identifier.numeric)); + transportProfileUri = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "TransportProfileUri"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_NODEID_NUMERIC(0, connection->identifier.identifier.numeric)); + + if(UA_NodeId_equal(&addressNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&urlNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&interfaceNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&publisherIdNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&connectionPropertieNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&transportProfileUri, &UA_NODEID_NULL)) { + return UA_STATUSCODE_BADNOTFOUND; + } + + retVal |= writePubSubNs0VariableArray(server, connectionPropertieNode.identifier.numeric, + connection->config->connectionProperties, + connection->config->connectionPropertiesSize, + &UA_TYPES[UA_TYPES_KEYVALUEPAIR]); + + UA_NetworkAddressUrlDataType *networkAddressUrlDataType = ((UA_NetworkAddressUrlDataType *) connection->config->address.data); + UA_Variant value; + UA_Variant_init(&value); + UA_Variant_setScalar(&value, &networkAddressUrlDataType->url, &UA_TYPES[UA_TYPES_STRING]); + UA_Server_writeValue(server, urlNode, value); + UA_Variant_setScalar(&value, &networkAddressUrlDataType->networkInterface, &UA_TYPES[UA_TYPES_STRING]); + UA_Server_writeValue(server, interfaceNode, value); + UA_Variant_setScalar(&value, &connection->config->transportProfileUri, &UA_TYPES[UA_TYPES_STRING]); + UA_Server_writeValue(server, transportProfileUri, value); + + UA_NodePropertyContext *connectionPublisherIdContext = (UA_NodePropertyContext *) UA_malloc(sizeof(UA_NodePropertyContext)); + connectionPublisherIdContext->parentNodeId = connection->identifier; + connectionPublisherIdContext->parentClassifier = UA_NS0ID_PUBSUBCONNECTIONTYPE; + connectionPublisherIdContext->elementClassiefier = UA_NS0ID_PUBSUBCONNECTIONTYPE_PUBLISHERID; + UA_ValueCallback valueCallback; + valueCallback.onRead = onRead; + valueCallback.onWrite = NULL; + retVal |= addVariableValueSource(server, valueCallback, publisherIdNode, connectionPublisherIdContext); + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_addReference(server, connection->identifier, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP), true); + retVal |= UA_Server_addReference(server, connection->identifier, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP), true); + retVal |= UA_Server_addReference(server, connection->identifier, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_REMOVEGROUP), true); +#endif + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addPubSubConnectionAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_PubSubConnectionDataType pubSubConnectionDataType = *((UA_PubSubConnectionDataType *) input[0].data); + UA_NetworkAddressUrlDataType networkAddressUrlDataType; + memset(&networkAddressUrlDataType, 0, sizeof(networkAddressUrlDataType)); + UA_ExtensionObject eo = pubSubConnectionDataType.address; + if(eo.encoding == UA_EXTENSIONOBJECT_DECODED){ + if(eo.content.decoded.type == &UA_TYPES[UA_TYPES_NETWORKADDRESSURLDATATYPE]){ + if(UA_NetworkAddressUrlDataType_copy((UA_NetworkAddressUrlDataType *) eo.content.decoded.data, + &networkAddressUrlDataType) != UA_STATUSCODE_GOOD){ + return UA_STATUSCODE_BADOUTOFMEMORY; + } + } + } + UA_PubSubConnectionConfig connectionConfig; + memset(&connectionConfig, 0, sizeof(UA_PubSubConnectionConfig)); + connectionConfig.transportProfileUri = pubSubConnectionDataType.transportProfileUri; + connectionConfig.name = pubSubConnectionDataType.name; + //TODO set real connection state + connectionConfig.enabled = pubSubConnectionDataType.enabled; + //connectionConfig.enabled = pubSubConnectionDataType.enabled; + UA_Variant_setScalar(&connectionConfig.address, &networkAddressUrlDataType, + &UA_TYPES[UA_TYPES_NETWORKADDRESSURLDATATYPE]); + if(pubSubConnectionDataType.publisherId.type == &UA_TYPES[UA_TYPES_UINT32]){ + connectionConfig.publisherId.numeric = * ((UA_UInt32 *) pubSubConnectionDataType.publisherId.data); + } else if(pubSubConnectionDataType.publisherId.type == &UA_TYPES[UA_TYPES_STRING]){ + connectionConfig.publisherIdType = UA_PUBSUB_PUBLISHERID_STRING; + UA_String_copy((UA_String *) pubSubConnectionDataType.publisherId.data, &connectionConfig.publisherId.string); + } else { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, "Unsupported PublisherId Type used."); + //TODO what's the best default behaviour here? + connectionConfig.publisherId.numeric = 0; + } + //call API function and create the connection + UA_NodeId connectionId; + + retVal |= UA_Server_addPubSubConnection(server, &connectionConfig, &connectionId); + + if(retVal != UA_STATUSCODE_GOOD){ + return retVal; + } + for(size_t i = 0; i < pubSubConnectionDataType.writerGroupsSize; i++){ + //UA_PubSubConnection_addWriterGroup(server, UA_NODEID_NULL, NULL, NULL); + } + for(size_t i = 0; i < pubSubConnectionDataType.readerGroupsSize; i++){ + //UA_Server_addReaderGroup(server, NULL, NULL, NULL); + } + UA_NetworkAddressUrlDataType_clear(&networkAddressUrlDataType); + //set ouput value + UA_Variant_setScalarCopy(output, &connectionId, &UA_TYPES[UA_TYPES_NODEID]); + return UA_STATUSCODE_GOOD; +} +#endif + +UA_StatusCode +removePubSubConnectionRepresentation(UA_Server *server, UA_PubSubConnection *connection){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_deleteReference(server, connection->identifier, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP), + false); + retVal |= UA_Server_deleteReference(server, connection->identifier, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP), + false); + retVal |= UA_Server_deleteReference(server, connection->identifier, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_REMOVEGROUP), + false); +#endif + retVal |= UA_Server_deleteNode(server, connection->identifier, true); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removeConnectionAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); + retVal |= UA_Server_removePubSubConnection(server, nodeToRemove); + if(retVal == UA_STATUSCODE_BADNOTFOUND) + retVal = UA_STATUSCODE_BADNODEIDUNKNOWN; + return retVal; +} +#endif + +/**********************************************/ +/* DataSetReader */ +/**********************************************/ +UA_StatusCode +addDataSetReaderRepresentation(UA_Server *server, UA_DataSetReader *dataSetReader){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId publisherIdNode, writerGroupIdNode, dataSetwriterIdNode; + + /* Display DataSetReaderName */ + if(dataSetReader->config.name.length > 512) + return UA_STATUSCODE_BADCONFIGURATIONERROR; + + UA_STACKARRAY(char, dsrName, sizeof(char) * dataSetReader->config.name.length + 1); + memcpy(dsrName, dataSetReader->config.name.data, dataSetReader->config.name.length); + dsrName[dataSetReader->config.name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &dataSetReader->identifier); + retVal |= addPubSubObjectNode(server, dsrName, dataSetReader->identifier.identifier.numeric, + dataSetReader->linkedReaderGroup.identifier.numeric, + UA_NS0ID_HASDATASETREADER, UA_NS0ID_DATASETREADERTYPE); + //End lock zone + + /* Add childNodes such as PublisherId, WriterGroupId and DataSetWriterId in DataSetReader object */ + publisherIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublisherId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, dataSetReader->identifier.identifier.numeric)); + writerGroupIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "WriterGroupId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, dataSetReader->identifier.identifier.numeric)); + dataSetwriterIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "DataSetWriterId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, dataSetReader->identifier.identifier.numeric)); + + if(UA_NodeId_equal(&publisherIdNode, &UA_NODEID_NULL) + || UA_NodeId_equal(&writerGroupIdNode, &UA_NODEID_NULL) + || UA_NodeId_equal(&dataSetwriterIdNode, &UA_NODEID_NULL)){ + return UA_STATUSCODE_BADNOTFOUND; + } + + UA_NodePropertyContext *dataSetReaderPublisherIdContext = (UA_NodePropertyContext *) UA_malloc(sizeof(UA_NodePropertyContext)); + dataSetReaderPublisherIdContext->parentNodeId = dataSetReader->identifier; + dataSetReaderPublisherIdContext->parentClassifier = UA_NS0ID_DATASETREADERTYPE; + dataSetReaderPublisherIdContext->elementClassiefier = UA_NS0ID_DATASETREADERTYPE_PUBLISHERID; + UA_ValueCallback valueCallback; + valueCallback.onRead = onRead; + valueCallback.onWrite = NULL; + retVal |= addVariableValueSource(server, valueCallback, publisherIdNode, dataSetReaderPublisherIdContext); + + /* Update childNode with values from Publisher */ + UA_Variant value; + UA_Variant_init(&value); + UA_Variant_setScalar(&value, &dataSetReader->config.writerGroupId, &UA_TYPES[UA_TYPES_UINT16]); + UA_Server_writeValue(server, writerGroupIdNode, value); + UA_Variant_setScalar(&value, &dataSetReader->config.dataSetWriterId, &UA_TYPES[UA_TYPES_UINT16]); + UA_Server_writeValue(server, dataSetwriterIdNode, value); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addDataSetReaderAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_BADNOTIMPLEMENTED; + //TODO implement reader part + return retVal; +} +#endif + +UA_StatusCode +removeDataSetReaderRepresentation(UA_Server *server, UA_DataSetReader* dataSetReader){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + retVal |= UA_Server_deleteNode(server, dataSetReader->identifier, false); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removeDataSetReaderAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_BADNOTIMPLEMENTED; + //TODO implement reader part + return retVal; +} +#endif + +/*************************************************/ +/* PublishedDataSet */ +/*************************************************/ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addDataSetFolderAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + /* defined in R 1.04 9.1.4.5.7 */ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_String newFolderName = *((UA_String *) input[0].data); + UA_NodeId generatedId; + UA_ObjectAttributes objectAttributes = UA_ObjectAttributes_default; + UA_LocalizedText name = {UA_STRING("en-US"), newFolderName}; + objectAttributes.displayName = name; + retVal |= UA_Server_addObjectNode(server, UA_NODEID_NULL, *objectId, UA_NODEID_NUMERIC(0,UA_NS0ID_ORGANIZES), + UA_QUALIFIEDNAME(0, "DataSetFolder"), UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE), + objectAttributes, NULL, &generatedId); + UA_Variant_setScalarCopy(output, &generatedId, &UA_TYPES[UA_TYPES_NODEID]); +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_addReference(server, generatedId, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS), true); + retVal |= UA_Server_addReference(server, generatedId, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET), true); + retVal |= UA_Server_addReference(server, generatedId, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER), true); + retVal |= UA_Server_addReference(server, generatedId, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER), true); +#endif + return retVal; +} +#endif + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removeDataSetFolderAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_deleteReference(server, nodeToRemove, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS), + false); + retVal |= UA_Server_deleteReference(server, nodeToRemove, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET), + false); + retVal |= UA_Server_deleteReference(server, nodeToRemove, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER), + false); + retVal |= UA_Server_deleteReference(server, nodeToRemove, UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER), + false); +#endif + retVal |= UA_Server_deleteNode(server, nodeToRemove, false); + return retVal; +} +#endif + +UA_StatusCode +addPublishedDataItemsRepresentation(UA_Server *server, UA_PublishedDataSet *publishedDataSet) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(publishedDataSet->config.name.length > 512) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_STACKARRAY(char, pdsName, sizeof(char) * publishedDataSet->config.name.length +1); + memcpy(pdsName, publishedDataSet->config.name.data, publishedDataSet->config.name.length); + pdsName[publishedDataSet->config.name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &publishedDataSet->identifier); + retVal |= addPubSubObjectNode(server, pdsName, publishedDataSet->identifier.identifier.numeric, + UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS, + UA_NS0ID_HASPROPERTY, UA_NS0ID_PUBLISHEDDATAITEMSTYPE); + //End lock zone + + UA_ValueCallback valueCallback; + valueCallback.onRead = onRead; + valueCallback.onWrite = NULL; + + UA_NodeId configurationVersionNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "ConfigurationVersion"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, publishedDataSet->identifier.identifier.numeric)); + if(UA_NodeId_equal(&configurationVersionNode, &UA_NODEID_NULL)) + return UA_STATUSCODE_BADNOTFOUND; + + UA_NodePropertyContext * configurationVersionContext = (UA_NodePropertyContext *) + UA_malloc(sizeof(UA_NodePropertyContext)); + configurationVersionContext->parentNodeId = publishedDataSet->identifier; + configurationVersionContext->parentClassifier = UA_NS0ID_PUBLISHEDDATAITEMSTYPE; + configurationVersionContext->elementClassiefier = + UA_NS0ID_PUBLISHEDDATAITEMSTYPE_CONFIGURATIONVERSION; + retVal |= addVariableValueSource(server, valueCallback, configurationVersionNode, + configurationVersionContext); + + UA_NodeId publishedDataNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublishedData"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, publishedDataSet->identifier.identifier.numeric)); + if(UA_NodeId_equal(&publishedDataNode, &UA_NODEID_NULL)) + return UA_STATUSCODE_BADNOTFOUND; + + UA_NodePropertyContext * publishingIntervalContext = (UA_NodePropertyContext *) + UA_malloc(sizeof(UA_NodePropertyContext)); + publishingIntervalContext->parentNodeId = publishedDataSet->identifier; + publishingIntervalContext->parentClassifier = UA_NS0ID_PUBLISHEDDATAITEMSTYPE; + publishingIntervalContext->elementClassiefier = UA_NS0ID_PUBLISHEDDATAITEMSTYPE_PUBLISHEDDATA; + retVal |= addVariableValueSource(server, valueCallback, publishedDataNode, + publishingIntervalContext); + + UA_NodeId dataSetMetaDataNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "DataSetMetaData"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, publishedDataSet->identifier.identifier.numeric)); + if(UA_NodeId_equal(&dataSetMetaDataNode, &UA_NODEID_NULL)) + return UA_STATUSCODE_BADNOTFOUND; + + UA_NodePropertyContext *metaDataContext = (UA_NodePropertyContext *) + UA_malloc(sizeof(UA_NodePropertyContext)); + metaDataContext->parentNodeId = publishedDataSet->identifier; + metaDataContext->parentClassifier = UA_NS0ID_PUBLISHEDDATAITEMSTYPE; + metaDataContext->elementClassiefier = UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETMETADATA; + retVal |= addVariableValueSource(server, valueCallback, dataSetMetaDataNode, metaDataContext); + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_addReference(server, publishedDataSet->identifier, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBLISHEDDATAITEMSTYPE_ADDVARIABLES), true); + retVal |= UA_Server_addReference(server, publishedDataSet->identifier, + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBLISHEDDATAITEMSTYPE_REMOVEVARIABLES), true); +#endif + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addPublishedDataItemsAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + size_t fieldNameAliasesSize = input[1].arrayLength; + UA_String * fieldNameAliases = (UA_String *) input[1].data; + size_t fieldFlagsSize = input[2].arrayLength; + UA_DataSetFieldFlags * fieldFlags = (UA_DataSetFieldFlags *) input[2].data; + size_t variablesToAddSize = input[3].arrayLength; + UA_PublishedVariableDataType *variablesToAddField = (UA_PublishedVariableDataType *) input[3].data; + + if(!(fieldNameAliasesSize == fieldFlagsSize || fieldFlagsSize == variablesToAddSize)) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_PublishedDataSetConfig publishedDataSetConfig; + memset(&publishedDataSetConfig, 0, sizeof(publishedDataSetConfig)); + publishedDataSetConfig.name = *((UA_String *) input[0].data); + publishedDataSetConfig.publishedDataSetType = UA_PUBSUB_DATASET_PUBLISHEDITEMS; + + UA_NodeId dataSetItemsNodeId; + retVal |= UA_Server_addPublishedDataSet(server, &publishedDataSetConfig, &dataSetItemsNodeId).addResult; + + UA_DataSetFieldConfig dataSetFieldConfig; + dataSetFieldConfig.field.variable.rtValueSource.staticValueSource = NULL; + for(size_t j = 0; j < variablesToAddSize; ++j) { + memset(&dataSetFieldConfig, 0, sizeof(dataSetFieldConfig)); + dataSetFieldConfig.dataSetFieldType = UA_PUBSUB_DATASETFIELD_VARIABLE; + dataSetFieldConfig.field.variable.fieldNameAlias = fieldNameAliases[j]; + if(fieldFlags[j] == UA_DATASETFIELDFLAGS_PROMOTEDFIELD){ + dataSetFieldConfig.field.variable.promotedField = UA_TRUE; + } + dataSetFieldConfig.field.variable.publishParameters = variablesToAddField[j]; + UA_Server_addDataSetField(server, dataSetItemsNodeId, &dataSetFieldConfig, NULL); + } + UA_PublishedVariableDataType_clear(variablesToAddField); + return retVal; +} +#endif + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addVariablesAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + return retVal; +} + +static UA_StatusCode +removeVariablesAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + return retVal; +} +#endif + + +UA_StatusCode +removePublishedDataSetRepresentation(UA_Server *server, UA_PublishedDataSet *publishedDataSet){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + retVal |= UA_Server_deleteNode(server, publishedDataSet->identifier, false); + + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removePublishedDataSetAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); + retVal |= UA_Server_removePublishedDataSet(server, nodeToRemove); + return retVal; +} +#endif + +/**********************************************/ +/* WriterGroup */ +/**********************************************/ + +static UA_StatusCode +readContentMask(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, UA_DataValue *value) { + UA_WriterGroup *writerGroup = (UA_WriterGroup*)nodeContext; + if((writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED && + writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) || + writerGroup->config.messageSettings.content.decoded.type != + &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE]) + return UA_STATUSCODE_BADINTERNALERROR; + UA_UadpWriterGroupMessageDataType *wgm = (UA_UadpWriterGroupMessageDataType*) + writerGroup->config.messageSettings.content.decoded.data; + + UA_Variant_setScalarCopy(&value->value, &wgm->networkMessageContentMask, + &UA_TYPES[UA_TYPES_UADPNETWORKMESSAGECONTENTMASK]); + value->hasValue = true; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +writeContentMask(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *value) { + UA_WriterGroup *writerGroup = (UA_WriterGroup*)nodeContext; + if((writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED && + writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) || + writerGroup->config.messageSettings.content.decoded.type != + &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE]) + return UA_STATUSCODE_BADINTERNALERROR; + UA_UadpWriterGroupMessageDataType *wgm = (UA_UadpWriterGroupMessageDataType*) + writerGroup->config.messageSettings.content.decoded.data; + + if(!value->value.type) + return UA_STATUSCODE_BADTYPEMISMATCH; + if(value->value.type->typeKind != UA_DATATYPEKIND_ENUM && + value->value.type->typeKind != UA_DATATYPEKIND_INT32) + return UA_STATUSCODE_BADTYPEMISMATCH; + + wgm->networkMessageContentMask = *(UA_UadpNetworkMessageContentMask*)value->value.data; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +addWriterGroupRepresentation(UA_Server *server, UA_WriterGroup *writerGroup){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(writerGroup->config.name.length > 512) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_STACKARRAY(char, wgName, sizeof(char) * writerGroup->config.name.length + 1); + memcpy(wgName, writerGroup->config.name.data, writerGroup->config.name.length); + wgName[writerGroup->config.name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &writerGroup->identifier); + retVal |= addPubSubObjectNode(server, wgName, writerGroup->identifier.identifier.numeric, + writerGroup->linkedConnection->identifier.identifier.numeric, + UA_NS0ID_HASCOMPONENT, UA_NS0ID_WRITERGROUPTYPE); + //End lock zone + UA_NodeId keepAliveNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "KeepAliveTime"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, writerGroup->identifier.identifier.numeric)); + UA_NodeId publishingIntervalNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublishingInterval"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, writerGroup->identifier.identifier.numeric)); + if(UA_NodeId_equal(&keepAliveNode, &UA_NODEID_NULL) || + UA_NodeId_equal(&publishingIntervalNode, &UA_NODEID_NULL)) + return UA_STATUSCODE_BADNOTFOUND; + + UA_NodePropertyContext * publishingIntervalContext = (UA_NodePropertyContext *) + UA_malloc(sizeof(UA_NodePropertyContext)); + publishingIntervalContext->parentNodeId = writerGroup->identifier; + publishingIntervalContext->parentClassifier = UA_NS0ID_WRITERGROUPTYPE; + publishingIntervalContext->elementClassiefier = UA_NS0ID_WRITERGROUPTYPE_PUBLISHINGINTERVAL; + UA_ValueCallback valueCallback; + valueCallback.onRead = onRead; + valueCallback.onWrite = onWrite; + retVal |= addVariableValueSource(server, valueCallback, + publishingIntervalNode, publishingIntervalContext); + UA_Server_writeAccessLevel(server, publishingIntervalNode, + UA_ACCESSLEVELMASK_READ ^ UA_ACCESSLEVELMASK_WRITE); + + UA_NodeId priorityNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "Priority"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, writerGroup->identifier.identifier.numeric)); + UA_NodeId writerGroupIdNode = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "WriterGroupId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + UA_NODEID_NUMERIC(0, writerGroup->identifier.identifier.numeric)); + UA_Variant value; + UA_Variant_init(&value); + UA_Variant_setScalar(&value, &writerGroup->config.publishingInterval, &UA_TYPES[UA_TYPES_DURATION]); + UA_Server_writeValue(server, publishingIntervalNode, value); + UA_Variant_setScalar(&value, &writerGroup->config.keepAliveTime, &UA_TYPES[UA_TYPES_DURATION]); + UA_Server_writeValue(server, keepAliveNode, value); + UA_Variant_setScalar(&value, &writerGroup->config.priority, &UA_TYPES[UA_TYPES_BYTE]); + UA_Server_writeValue(server, priorityNode, value); + UA_Variant_setScalar(&value, &writerGroup->config.writerGroupId, &UA_TYPES[UA_TYPES_UINT16]); + UA_Server_writeValue(server, writerGroupIdNode, value); + + retVal |= addPubSubObjectNode(server, "MessageSettings", 0, + writerGroup->identifier.identifier.numeric, + UA_NS0ID_HASCOMPONENT, UA_NS0ID_UADPWRITERGROUPMESSAGETYPE); + + /* Find the variable with the content mask */ + + UA_NodeId messageSettingsId = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "MessageSettings"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_NODEID_NUMERIC(0, writerGroup->identifier.identifier.numeric)); + UA_NodeId contentMaskId = + findSingleChildNode(server, UA_QUALIFIEDNAME(0, "NetworkMessageContentMask"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), messageSettingsId); + if(UA_NodeId_equal(&messageSettingsId, &UA_NODEID_NULL) || + UA_NodeId_equal(&contentMaskId, &UA_NODEID_NULL)) { + return UA_STATUSCODE_BADNOTFOUND; + } + + /* Set the callback */ + UA_DataSource ds; + ds.read = readContentMask; + ds.write = writeContentMask; + UA_Server_setVariableNode_dataSource(server, contentMaskId, ds); + UA_Server_setNodeContext(server, contentMaskId, writerGroup); + + /* Make writable */ + UA_Server_writeAccessLevel(server, contentMaskId, + UA_ACCESSLEVELMASK_WRITE | UA_ACCESSLEVELMASK_READ); + + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addWriterGroupAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_WriterGroupDataType *writerGroupDataType = ((UA_WriterGroupDataType *) input[0].data); + UA_NodeId generatedId; + UA_WriterGroupConfig writerGroupConfig; + memset(&writerGroupConfig, 0, sizeof(UA_WriterGroupConfig)); + writerGroupConfig.name = writerGroupDataType->name; + writerGroupConfig.publishingInterval = writerGroupDataType->publishingInterval; + writerGroupConfig.writerGroupId = writerGroupDataType->writerGroupId; + writerGroupConfig.enabled = writerGroupDataType->enabled; + writerGroupConfig.priority = writerGroupDataType->priority; + //TODO remove hard coded UADP + writerGroupConfig.encodingMimeType = UA_PUBSUB_ENCODING_UADP; + //ToDo transfer all arguments to internal WGConfiguration + retVal |= UA_Server_addWriterGroup(server, *objectId, &writerGroupConfig, &generatedId); + UA_Variant_setScalarCopy(output, &generatedId, &UA_TYPES[UA_TYPES_NODEID]); + return retVal; +} +#endif + +UA_StatusCode +removeGroupRepresentation(UA_Server *server, UA_WriterGroup *writerGroup) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + retVal |= UA_Server_deleteNode(server, writerGroup->identifier, false); + return retVal; +} + +UA_StatusCode +removeReaderGroupRepresentation(UA_Server *server, UA_ReaderGroup *readerGroup) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + retVal |= UA_Server_deleteNode(server, readerGroup->identifier, false); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removeGroupAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); + if(UA_WriterGroup_findWGbyId(server, nodeToRemove) != NULL) + retVal |= UA_Server_removeWriterGroup(server, nodeToRemove); + //else + //retVal |= UA_Server_removeReaderGroup(server, nodeToRemve); + return retVal; +} +#endif + +/**********************************************/ +/* ReaderGroup */ +/**********************************************/ +UA_StatusCode +addReaderGroupRepresentation(UA_Server *server, UA_ReaderGroup *readerGroup){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + /* Display ReaderGroupName */ + if(readerGroup->config.name.length > 512) { + return UA_STATUSCODE_BADCONFIGURATIONERROR; + } + else { + UA_STACKARRAY(char, rgName, sizeof(char) * readerGroup->config.name.length + 1); + memcpy(rgName, readerGroup->config.name.data, readerGroup->config.name.length); + rgName[readerGroup->config.name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &readerGroup->identifier); + + /* Add object ReaderGroup under PubSubConnectionType object */ + retVal |= addPubSubObjectNode(server, rgName, readerGroup->identifier.identifier.numeric, + readerGroup->linkedConnection.identifier.numeric, + UA_NS0ID_HASCOMPONENT, UA_NS0ID_READERGROUPTYPE); + } + + //End lock zone + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addReaderGroupAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + //TODO implement reader part + return retVal; +} +#endif + +/**********************************************/ +/* DataSetWriter */ +/**********************************************/ +UA_StatusCode +addDataSetWriterRepresentation(UA_Server *server, UA_DataSetWriter *dataSetWriter){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(dataSetWriter->config.name.length > 512) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_STACKARRAY(char, dswName, sizeof(char) * dataSetWriter->config.name.length + 1); + memcpy(dswName, dataSetWriter->config.name.data, dataSetWriter->config.name.length); + dswName[dataSetWriter->config.name.length] = '\0'; + //This code block must use a lock + UA_NODESTORE_REMOVE(server, &dataSetWriter->identifier); + retVal |= addPubSubObjectNode(server, dswName, dataSetWriter->identifier.identifier.numeric, + dataSetWriter->linkedWriterGroup.identifier.numeric, + UA_NS0ID_HASDATASETWRITER, UA_NS0ID_DATASETWRITERTYPE); + //End lock zone + retVal |= UA_Server_addReference(server, dataSetWriter->connectedDataSet, + UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETTOWRITER), + UA_EXPANDEDNODEID_NUMERIC(0, dataSetWriter->identifier.identifier.numeric), true); + + + retVal |= addPubSubObjectNode(server, "MessageSettings", 0, + dataSetWriter->identifier.identifier.numeric, + UA_NS0ID_HASCOMPONENT, UA_NS0ID_UADPDATASETWRITERMESSAGETYPE); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +addDataSetWriterAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_DataSetWriterDataType *dataSetWriterDataType = (UA_DataSetWriterDataType *) input[0].data; + + UA_NodeId targetPDS = UA_NODEID_NULL; + UA_PublishedDataSet *tmpPDS; + TAILQ_FOREACH(tmpPDS, &server->pubSubManager.publishedDataSets, listEntry){ + if(UA_String_equal(&dataSetWriterDataType->dataSetName, &tmpPDS->config.name)){ + targetPDS = tmpPDS->identifier; + } + } + + if(UA_NodeId_isNull(&targetPDS)) + return UA_STATUSCODE_BADPARENTNODEIDINVALID; + + UA_NodeId generatedId; + UA_DataSetWriterConfig dataSetWriterConfig; + memset(&dataSetWriterConfig, 0, sizeof(UA_DataSetWriterConfig)); + dataSetWriterConfig.name = dataSetWriterDataType->name; + dataSetWriterConfig.dataSetName = dataSetWriterDataType->dataSetName; + dataSetWriterConfig.keyFrameCount = dataSetWriterDataType->keyFrameCount; + dataSetWriterConfig.dataSetWriterId = dataSetWriterDataType->dataSetWriterId; + + UA_Server_addDataSetWriter(server, *objectId, targetPDS, &dataSetWriterConfig, &generatedId); + UA_Variant_setScalarCopy(output, &generatedId, &UA_TYPES[UA_TYPES_NODEID]); + return UA_STATUSCODE_GOOD; +} +#endif + + +UA_StatusCode +removeDataSetWriterRepresentation(UA_Server *server, UA_DataSetWriter *dataSetWriter) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + retVal |= UA_Server_deleteNode(server, dataSetWriter->identifier, false); + return retVal; +} + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +static UA_StatusCode +removeDataSetWriterAction(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output){ + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); + retVal |= UA_Server_removeDataSetWriter(server, nodeToRemove); + return retVal; +} +#endif + +/**********************************************/ +/* Destructors */ +/**********************************************/ + +static void +connectionTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "Connection destructor called!"); + UA_NodeId publisherIdNode; + publisherIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublisherId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), *nodeId); + UA_NodePropertyContext *internalConnectionContext; + UA_Server_getNodeContext(server, publisherIdNode, (void **) &internalConnectionContext); + if(!UA_NodeId_equal(&UA_NODEID_NULL , &publisherIdNode)){ + UA_free(internalConnectionContext); + } + +} + +static void +writerGroupTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "WriterGroup destructor called!"); + UA_NodeId intervalNode; + intervalNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublishingInterval"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), *nodeId); + UA_NodePropertyContext *internalConnectionContext; + UA_Server_getNodeContext(server, intervalNode, (void **) &internalConnectionContext); + if(!UA_NodeId_equal(&UA_NODEID_NULL , &intervalNode)){ + UA_free(internalConnectionContext); + } +} + +static void +readerGroupTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "ReaderGroup destructor called!"); +} + +static void +dataSetWriterTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "DataSetWriter destructor called!"); +} + +static void +dataSetReaderTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "DataSetReader destructor called!"); + + /* Deallocate the memory allocated for publisherId */ + UA_NodeId publisherIdNode; + publisherIdNode = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublisherId"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), *nodeId); + UA_NodePropertyContext *internalDSRContext; + UA_Server_getNodeContext(server, publisherIdNode, (void **) &internalDSRContext); + if(!UA_NodeId_equal(&UA_NODEID_NULL , &publisherIdNode)){ + UA_free(internalDSRContext); + } +} + +static void +publishedDataItemsTypeDestructor(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeId, void *typeContext, + const UA_NodeId *nodeId, void **nodeContext) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, + "PublishedDataItems destructor called!"); + void *childContext; + UA_NodeId node = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "PublishedData"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), *nodeId); + UA_Server_getNodeContext(server, node, (void**)&childContext); + if(!UA_NodeId_equal(&UA_NODEID_NULL , &node)) + UA_free(childContext); + + node = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "ConfigurationVersion"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), + *nodeId); + UA_Server_getNodeContext(server, node, (void**)&childContext); + if(!UA_NodeId_equal(&UA_NODEID_NULL , &node)) + UA_free(childContext); + + node = findSingleChildNode(server, UA_QUALIFIEDNAME(0, "DataSetMetaData"), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY), *nodeId); + UA_Server_getNodeContext(server, node, (void**)&childContext); + if(!UA_NodeId_equal(&node, &UA_NODEID_NULL)) + UA_free(childContext); +} + +/*************************************/ +/* PubSub configurator */ +/*************************************/ + +/* UA_loadPubSubConfigMethodCallback() */ +/** + * @brief callback function that will be executed when the method "PubSub configurator (replace config)" is called. + */ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG +static UA_StatusCode +UA_loadPubSubConfigMethodCallback(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output) { + if(inputSize == 1) { + UA_ByteString *inputStr = (UA_ByteString*)input->data; + return UA_PubSubManager_loadPubSubConfigFromByteString(server, *inputStr); + } else if(inputSize > 1) { + return UA_STATUSCODE_BADTOOMANYARGUMENTS; + } else { + return UA_STATUSCODE_BADARGUMENTSMISSING; + } +} +#endif +#endif /*UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS*/ + + +/* UA_addLoadPubSubConfigMethod() */ +/** + * @brief Adds method node to server. This method is used to load binary files for PubSub + * configuration and delete / replace old PubSub configurations. + * + * @param server [bi] UA_Server object that shall contain the method. + * + * @return UA_STATUSCODE_GOOD on success + */ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG +static UA_StatusCode +UA_addLoadPubSubConfigMethod(UA_Server *server) { + UA_Argument inputArgument; + UA_Argument_init(&inputArgument); + inputArgument.description = UA_LOCALIZEDTEXT("en-US", "PubSub config binfile"); + inputArgument.name = UA_STRING("BinFile"); + inputArgument.dataType = UA_TYPES[UA_TYPES_BYTESTRING].typeId; + inputArgument.valueRank = UA_VALUERANK_SCALAR; + + UA_MethodAttributes configAttr = UA_MethodAttributes_default; + configAttr.description = UA_LOCALIZEDTEXT("en-US","Load binary configuration file"); + configAttr.displayName = UA_LOCALIZEDTEXT("en-US","LoadPubSubConfigurationFile"); + configAttr.executable = true; + configAttr.userExecutable = true; + UA_StatusCode retVal = UA_Server_addMethodNode(server, UA_NODEID_NULL, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASORDEREDCOMPONENT), + UA_QUALIFIEDNAME(1, "PubSub configuration"), + configAttr, &UA_loadPubSubConfigMethodCallback, + 1, &inputArgument, 0, NULL, NULL, NULL); + return retVal; +} +#endif +#endif /*UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS*/ + + +/* UA_deletePubSubConfigMethodCallback() */ +/** + * @brief callback function that will be executed when the method "PubSub configurator (delete config)" is called. + */ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG +static UA_StatusCode +UA_deletePubSubConfigMethodCallback(UA_Server *server, + const UA_NodeId *sessionId, void *sessionHandle, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext, + size_t inputSize, const UA_Variant *input, + size_t outputSize, UA_Variant *output) { + UA_PubSubManager_delete(server, &(server->pubSubManager)); + + return UA_STATUSCODE_GOOD; +} +#endif +#endif /*UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS*/ + + +/* UA_addDeletePubSubConfigMethod() */ +/** + * @brief Adds method node to server. This method is used to delete the current PubSub configuration. + * + * @param server [bi] UA_Server object that shall contain the method. + * + * @return UA_STATUSCODE_GOOD on success + */ +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG +static UA_StatusCode +UA_addDeletePubSubConfigMethod(UA_Server *server) { + UA_MethodAttributes configAttr = UA_MethodAttributes_default; + configAttr.description = UA_LOCALIZEDTEXT("en-US","Delete current PubSub configuration"); + configAttr.displayName = UA_LOCALIZEDTEXT("en-US","DeletePubSubConfiguration"); + configAttr.executable = true; + configAttr.userExecutable = true; + UA_StatusCode retVal = UA_Server_addMethodNode(server, UA_NODEID_NULL, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASORDEREDCOMPONENT), + UA_QUALIFIEDNAME(1, "Delete PubSub config"), + configAttr, &UA_deletePubSubConfigMethodCallback, + 0, NULL, 0, NULL, NULL, NULL); + return retVal; +} +#endif +#endif /*UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS*/ + + + +UA_StatusCode +UA_Server_initPubSubNS0(UA_Server *server) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_String profileArray[1]; + profileArray[0] = UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"); + + retVal |= writePubSubNs0VariableArray(server, UA_NS0ID_PUBLISHSUBSCRIBE_SUPPORTEDTRANSPORTPROFILES, + profileArray, + 1, &UA_TYPES[UA_TYPES_STRING]); + +#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_ADDCONNECTION), addPubSubConnectionAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_REMOVECONNECTION), removeConnectionAction); + retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER), true); + retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS), true); + retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET), true); + retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS), + UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER), true); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER), addDataSetFolderAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER), removeDataSetFolderAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS), addPublishedDataItemsAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET), removePublishedDataSetAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHEDDATAITEMSTYPE_ADDVARIABLES), addVariablesAction); + retVal |= UA_Server_setMethodNode_callback(server, + UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHEDDATAITEMSTYPE_REMOVEVARIABLES), removeVariablesAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP), addWriterGroupAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP), addReaderGroupAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE_REMOVEGROUP), removeGroupAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_WRITERGROUPTYPE_ADDDATASETWRITER), addDataSetWriterAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_WRITERGROUPTYPE_REMOVEDATASETWRITER), removeDataSetWriterAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_READERGROUPTYPE_ADDDATASETREADER), addDataSetReaderAction); + retVal |= UA_Server_setMethodNode_callback(server, UA_NODEID_NUMERIC(0, UA_NS0ID_READERGROUPTYPE_REMOVEDATASETREADER), removeDataSetReaderAction); + +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG + retVal |= UA_addLoadPubSubConfigMethod(server); + retVal |= UA_addDeletePubSubConfigMethod(server); +#endif + +#else + retVal |= UA_Server_deleteReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_ADDCONNECTION), + false); + retVal |= UA_Server_deleteReference(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE), UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT), true, + UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_PUBLISHSUBSCRIBE_REMOVECONNECTION), + false); +#endif + UA_NodeTypeLifecycle lifeCycle; + lifeCycle.constructor = NULL; + lifeCycle.destructor = connectionTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBSUBCONNECTIONTYPE), lifeCycle); + lifeCycle.destructor = writerGroupTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_WRITERGROUPTYPE), lifeCycle); + lifeCycle.destructor = readerGroupTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_READERGROUPTYPE), lifeCycle); + lifeCycle.destructor = dataSetWriterTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETWRITERDATATYPE), lifeCycle); + lifeCycle.destructor = publishedDataItemsTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_PUBLISHEDDATAITEMSTYPE), lifeCycle); + lifeCycle.destructor = dataSetReaderTypeDestructor; + UA_Server_setNodeTypeLifecycle(server, UA_NODEID_NUMERIC(0, UA_NS0ID_DATASETREADERTYPE), lifeCycle); + + return retVal; +} + +#endif /* UA_ENABLE_PUBSUB_INFORMATIONMODEL */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_view.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) LEvertz + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015 (c) Ecosmos + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) pschoppe + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017 (c) Henrik Norrman + */ + + +#define UA_MAX_TREE_RECURSE 50 /* How deep up/down the tree do we recurse at most? */ + +UA_StatusCode +referenceTypeIndices(UA_Server *server, const UA_NodeId *refType, + UA_ReferenceTypeSet *indices, UA_Boolean includeSubtypes) { + UA_ReferenceTypeSet_init(indices); + + const UA_Node *refNode = UA_NODESTORE_GET(server, refType); + if(!refNode) + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + + if(refNode->head.nodeClass != UA_NODECLASS_REFERENCETYPE) { + UA_NODESTORE_RELEASE(server, refNode); + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + } + + if(!includeSubtypes) + *indices = UA_REFTYPESET(refNode->referenceTypeNode.referenceTypeIndex); + else + *indices = refNode->referenceTypeNode.subTypes; + + UA_NODESTORE_RELEASE(server, refNode); + return UA_STATUSCODE_GOOD; +} + +static UA_Boolean +matchClassMask(const UA_Node *node, UA_UInt32 nodeClassMask) { + if(nodeClassMask != UA_NODECLASS_UNSPECIFIED && + (node->head.nodeClass & nodeClassMask) == 0) + return false; + return true; +} + +/****************/ +/* IsNodeInTree */ +/****************/ + +/* Internal method to check if a node is already upwards from a leaf node */ + +/* Keeps track of visited nodes to detect circular references */ +struct ref_history { + struct ref_history *parent; /* the previous element */ + const UA_NodeId *id; /* the id of the node at this depth */ + UA_UInt16 depth; +}; + +static UA_Boolean +isNodeInTreeNoCircular(UA_Server *server, const UA_NodeId *leafNode, + const UA_NodeId *nodeToFind, struct ref_history *visitedRefs, + const UA_ReferenceTypeSet *relevantRefs) { + if(UA_NodeId_equal(nodeToFind, leafNode)) + return true; + + if(visitedRefs->depth >= UA_MAX_TREE_RECURSE) + return false; + + const UA_Node *node = UA_NODESTORE_GET(server, leafNode); + if(!node) + return false; + + for(size_t i = 0; i < node->head.referencesSize; ++i) { + UA_NodeReferenceKind *refs = &node->head.references[i]; + /* Search upwards in the tree */ + if(!refs->isInverse) + continue; + + /* Consider only the indicated reference types */ + if(!UA_ReferenceTypeSet_contains(relevantRefs, refs->referenceTypeIndex)) + continue; + + /* Match the targets or recurse */ + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &refs->queueHead, queuePointers) { + /* Check if we already have seen the referenced node and skip to + * avoid endless recursion. Do this only at every 5th depth to save + * effort. Circular dependencies are rare and forbidden for most + * reference types. */ + if(visitedRefs->depth % 5 == 4) { + struct ref_history *last = visitedRefs; + UA_Boolean skip = false; + while(!skip && last) { + if(UA_NodeId_equal(last->id, &target->targetId.nodeId)) + skip = true; + last = last->parent; + } + if(skip) + continue; + } + + /* Stack-allocate the visitedRefs structure for the next depth */ + struct ref_history nextVisitedRefs = {visitedRefs, &target->targetId.nodeId, + (UA_UInt16)(visitedRefs->depth+1)}; + + /* Recurse */ + UA_Boolean foundRecursive = + isNodeInTreeNoCircular(server, &target->targetId.nodeId, nodeToFind, + &nextVisitedRefs, relevantRefs); + if(foundRecursive) { + UA_NODESTORE_RELEASE(server, node); + return true; + } + } + } + + UA_NODESTORE_RELEASE(server, node); + return false; +} + +UA_Boolean +isNodeInTree(UA_Server *server, const UA_NodeId *leafNode, + const UA_NodeId *nodeToFind, const UA_ReferenceTypeSet *relevantRefs) { + struct ref_history visitedRefs = {NULL, leafNode, 0}; + return isNodeInTreeNoCircular(server, leafNode, nodeToFind, &visitedRefs, relevantRefs); +} + +UA_Boolean +isNodeInTree_singleRef(UA_Server *server, const UA_NodeId *leafNode, + const UA_NodeId *nodeToFind, const UA_Byte relevantRefTypeIndex) { + UA_ReferenceTypeSet reftypes = UA_REFTYPESET(relevantRefTypeIndex); + return isNodeInTree(server, leafNode, nodeToFind, &reftypes); +} + +static enum ZIP_CMP +cmpTarget(const void *a, const void *b) { + const RefEntry *aa = (const RefEntry*)a; + const RefEntry *bb = (const RefEntry*)b; + if(aa->targetHash < bb->targetHash) + return ZIP_CMP_LESS; + if(aa->targetHash > bb->targetHash) + return ZIP_CMP_MORE; + return (enum ZIP_CMP)UA_ExpandedNodeId_order(aa->target, bb->target); +} + +ZIP_PROTOTYPE(RefHead, RefEntry, RefEntry) +ZIP_IMPL(RefHead, RefEntry, zipfields, RefEntry, zipfields, cmpTarget) + +UA_StatusCode +RefTree_init(RefTree *rt) { + rt->size = 0; + rt->capacity = 0; + ZIP_INIT(&rt->head); + size_t space = (sizeof(UA_ExpandedNodeId) + sizeof(RefEntry)) * UA_REFTREE_INITIAL_SIZE; + rt->targets = (UA_ExpandedNodeId*)UA_malloc(space); + if(!rt->targets) + return UA_STATUSCODE_BADOUTOFMEMORY; + rt->capacity = UA_REFTREE_INITIAL_SIZE; + return UA_STATUSCODE_GOOD; +} + +void +RefTree_clear(RefTree *rt) { + for(size_t i = 0; i < rt->size; i++) + UA_ExpandedNodeId_clear(&rt->targets[i]); + if(rt->targets) + UA_free(rt->targets); +} + +/* Double the capacity of the reftree */ +static UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefTree_double(RefTree *rt) { + size_t capacity = rt->capacity * 2; + UA_assert(capacity > 0); + size_t space = (sizeof(UA_ExpandedNodeId) + sizeof(RefEntry)) * capacity; + UA_ExpandedNodeId *newTargets = (UA_ExpandedNodeId*)UA_realloc(rt->targets, space); + if(!newTargets) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Repair the pointers for the realloced array+tree */ + uintptr_t arraydiff = (uintptr_t)newTargets - (uintptr_t)rt->targets; + RefEntry *reArray = (RefEntry*) + ((uintptr_t)newTargets + (capacity * sizeof(UA_ExpandedNodeId))); + uintptr_t entrydiff = (uintptr_t)reArray - + ((uintptr_t)rt->targets + (rt->capacity * sizeof(UA_ExpandedNodeId))); + RefEntry *oldReArray = (RefEntry*) + ((uintptr_t)newTargets + (rt->capacity * sizeof(UA_ExpandedNodeId))); + memmove(reArray, oldReArray, rt->size * sizeof(RefEntry)); + for(size_t i = 0; i < rt->size; i++) { + uintptr_t *left = (uintptr_t*)&ZIP_LEFT(&reArray[i], zipfields); + uintptr_t *right = (uintptr_t*)&ZIP_RIGHT(&reArray[i], zipfields); + if(*left != 0) + *left += entrydiff; + if(*right != 0) + *right += entrydiff; + reArray[i].target = (UA_ExpandedNodeId*)((uintptr_t)reArray[i].target + arraydiff); + } + + rt->head.zip_root = (RefEntry*)((uintptr_t)rt->head.zip_root + entrydiff); + rt->capacity = capacity; + rt->targets = newTargets; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +RefTree_add(RefTree *rt, const UA_ExpandedNodeId *target, UA_Boolean *duplicate) { + /* Is the target already in the tree? */ + RefEntry dummy; + dummy.target = target; + dummy.targetHash = UA_ExpandedNodeId_hash(target); + if(ZIP_FIND(RefHead, &rt->head, &dummy)) { + if(duplicate) + *duplicate = true; + return UA_STATUSCODE_GOOD; + } + + UA_StatusCode s = UA_STATUSCODE_GOOD; + if(rt->capacity <= rt->size) { + s = RefTree_double(rt); + if(s != UA_STATUSCODE_GOOD) + return s; + } + s = UA_ExpandedNodeId_copy(target, &rt->targets[rt->size]); + if(s != UA_STATUSCODE_GOOD) + return s; + RefEntry *re = (RefEntry*)((uintptr_t)rt->targets + + (sizeof(UA_ExpandedNodeId) * rt->capacity) + + (sizeof(RefEntry) * rt->size)); + re->target = &rt->targets[rt->size]; + re->targetHash = dummy.targetHash; + ZIP_INSERT(RefHead, &rt->head, re, ZIP_FFS32(UA_UInt32_random())); + rt->size++; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +RefTree_addNodeId(RefTree *rt, const UA_NodeId *target, UA_Boolean *duplicate) { + UA_ExpandedNodeId en; + en.nodeId = *target; + en.namespaceUri = UA_STRING_NULL; + en.serverIndex = 0; + return RefTree_add(rt, &en, duplicate); +} + +UA_Boolean +RefTree_contains(RefTree *rt, const UA_ExpandedNodeId *target) { + RefEntry dummy; + dummy.target = target; + dummy.targetHash = UA_ExpandedNodeId_hash(target); + return !!ZIP_FIND(RefHead, &rt->head, &dummy); +} + +UA_Boolean +RefTree_containsNodeId(RefTree *rt, const UA_NodeId *target) { + UA_ExpandedNodeId en; + en.nodeId = *target; + en.namespaceUri = UA_STRING_NULL; + en.serverIndex = 0; + return RefTree_contains(rt, &en); +} + +/********************/ +/* Browse Recursive */ +/********************/ + +static UA_StatusCode +browseRecursiveInner(UA_Server *server, RefTree *rt, UA_UInt16 depth, UA_Boolean skip, + const UA_NodeId *nodeId, UA_BrowseDirection browseDirection, + const UA_ReferenceTypeSet *refTypes, UA_UInt32 nodeClassMask) { + /* Have we reached the max recursion depth? */ + if(depth >= UA_MAX_TREE_RECURSE) + return UA_STATUSCODE_GOOD; + + const UA_Node *node = UA_NODESTORE_GET(server, nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + const UA_NodeHead *head = &node->head; + + /* Add the current node to the results if we don't want to skip it (i.e. for + * includeStartNodes) and it matches the nodeClassMask filter. Process the + * children also if the nodeClassMask does not match. */ + if(!skip && matchClassMask(node, nodeClassMask)) { + UA_Boolean duplicate = false; + UA_ExpandedNodeId temp = UA_EXPANDEDNODEID_NULL; + temp.nodeId = head->nodeId; + retval = RefTree_add(rt, &temp, &duplicate); + if(duplicate || retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + + for(size_t i = 0; i < head->referencesSize; i++) { + UA_NodeReferenceKind *rk = &head->references[i]; + + /* Reference in the right direction? */ + if(rk->isInverse && browseDirection == UA_BROWSEDIRECTION_FORWARD) + continue; + if(!rk->isInverse && browseDirection == UA_BROWSEDIRECTION_INVERSE) + continue; + + /* Is the reference part of the hierarchy of references we look for? */ + if(!UA_ReferenceTypeSet_contains(refTypes, rk->referenceTypeIndex)) + continue; + + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &rk->queueHead, queuePointers) { + if(UA_ExpandedNodeId_isLocal(&target->targetId)) + retval = browseRecursiveInner(server, rt, (UA_UInt16)(depth+1), false, + &target->targetId.nodeId, browseDirection, + refTypes, nodeClassMask); + else + retval = RefTree_add(rt, &target->targetId, NULL); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + } + + cleanup: + UA_NODESTORE_RELEASE(server, node); + return retval; +} + +UA_StatusCode +browseRecursive(UA_Server *server, size_t startNodesSize, const UA_NodeId *startNodes, + UA_BrowseDirection browseDirection, const UA_ReferenceTypeSet *refTypes, + UA_UInt32 nodeClassMask, UA_Boolean includeStartNodes, + size_t *resultsSize, UA_ExpandedNodeId **results) { + RefTree rt; + UA_StatusCode retval = RefTree_init(&rt); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + for(size_t i = 0; i < startNodesSize; i++) { + /* Call the inner recursive browse separately for the search direction. + * Otherwise we might take one step up and another step down in the + * search tree. */ + if(browseDirection == UA_BROWSEDIRECTION_FORWARD || + browseDirection == UA_BROWSEDIRECTION_BOTH) + retval |= browseRecursiveInner(server, &rt, 0, !includeStartNodes, + &startNodes[i], UA_BROWSEDIRECTION_FORWARD, + refTypes, nodeClassMask); + if(browseDirection == UA_BROWSEDIRECTION_INVERSE || + browseDirection == UA_BROWSEDIRECTION_BOTH) + retval |= browseRecursiveInner(server, &rt, 0, !includeStartNodes, + &startNodes[i], UA_BROWSEDIRECTION_INVERSE, + refTypes, nodeClassMask); + if(retval != UA_STATUSCODE_GOOD) + break; + } + + if(rt.size > 0 && retval == UA_STATUSCODE_GOOD) { + *results = rt.targets; + *resultsSize = rt.size; + } else { + RefTree_clear(&rt); + } + return retval; +} + +UA_StatusCode +UA_Server_browseRecursive(UA_Server *server, const UA_BrowseDescription *bd, + size_t *resultsSize, UA_ExpandedNodeId **results) { + UA_LOCK(server->serviceMutex); + + /* Set the list of relevant reference types */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_ReferenceTypeSet refTypes; + UA_ReferenceTypeSet_any(&refTypes); + if(!UA_NodeId_isNull(&bd->referenceTypeId)) { + retval = referenceTypeIndices(server, &bd->referenceTypeId, + &refTypes, bd->includeSubtypes); + if(retval != UA_STATUSCODE_GOOD) { + UA_UNLOCK(server->serviceMutex); + return retval; + } + } + + /* Browse */ + retval = browseRecursive(server, 1, &bd->nodeId, bd->browseDirection, + &refTypes, bd->nodeClassMask, false, resultsSize, results); + + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/**********/ +/* Browse */ +/**********/ + +typedef struct { + size_t size; + size_t capacity; + UA_ReferenceDescription *descr; +} RefResult; + +static UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefResult_init(RefResult *rr) { + memset(rr, 0, sizeof(RefResult)); + rr->descr = (UA_ReferenceDescription*) + UA_Array_new(UA_REFTREE_INITIAL_SIZE, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); + if(!rr->descr) + return UA_STATUSCODE_BADOUTOFMEMORY; + rr->capacity = UA_REFTREE_INITIAL_SIZE; + rr->size = 0; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +RefResult_double(RefResult *rr) { + size_t newSize = rr->capacity * 2; + UA_ReferenceDescription *rd = (UA_ReferenceDescription*) + UA_realloc(rr->descr, newSize * sizeof(UA_ReferenceDescription)); + if(!rd) + return UA_STATUSCODE_BADOUTOFMEMORY; + memset(&rd[rr->size], 0, sizeof(UA_ReferenceDescription) * (newSize - rr->size)); + rr->descr = rd; + rr->capacity = newSize; + return UA_STATUSCODE_GOOD; +} + +static void +RefResult_clear(RefResult *rr) { + UA_assert(rr->descr != NULL); + for(size_t i = 0; i < rr->size; i++) + UA_ReferenceDescription_clear(&rr->descr[i]); + UA_free(rr->descr); +} + +struct ContinuationPoint { + ContinuationPoint *next; + UA_ByteString identifier; + UA_BrowseDescription browseDescription; + UA_UInt32 maxReferences; + + UA_ReferenceTypeSet relevantReferences; + + /* The last point in the node references? */ + size_t referenceKindIndex; + size_t targetIndex; +}; + +ContinuationPoint * +ContinuationPoint_clear(ContinuationPoint *cp) { + UA_ByteString_clear(&cp->identifier); + UA_BrowseDescription_clear(&cp->browseDescription); + return cp->next; +} + +/* Target node on top of the stack */ +static UA_StatusCode UA_FUNC_ATTR_WARN_UNUSED_RESULT +addReferenceDescription(UA_Server *server, RefResult *rr, const UA_NodeReferenceKind *ref, + UA_UInt32 mask, const UA_ExpandedNodeId *nodeId, const UA_Node *curr) { + /* Ensure capacity is left */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(rr->size >= rr->capacity) { + retval = RefResult_double(rr); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + UA_ReferenceDescription *descr = &rr->descr[rr->size]; + + /* Fields without access to the actual node */ + retval = UA_ExpandedNodeId_copy(nodeId, &descr->nodeId); + if(mask & UA_BROWSERESULTMASK_REFERENCETYPEID) + retval |= UA_NodeId_copy(UA_NODESTORE_GETREFERENCETYPEID(server, ref->referenceTypeIndex), + &descr->referenceTypeId); + if(mask & UA_BROWSERESULTMASK_ISFORWARD) + descr->isForward = !ref->isInverse; + + /* Remote references (ExpandedNodeId) are not further looked up here */ + if(!curr) { + UA_ReferenceDescription_clear(descr); + return retval; + } + + /* Fields that require the actual node */ + if(mask & UA_BROWSERESULTMASK_NODECLASS) + descr->nodeClass = curr->head.nodeClass; + if(mask & UA_BROWSERESULTMASK_BROWSENAME) + retval |= UA_QualifiedName_copy(&curr->head.browseName, &descr->browseName); + if(mask & UA_BROWSERESULTMASK_DISPLAYNAME) + retval |= UA_LocalizedText_copy(&curr->head.displayName, &descr->displayName); + if(mask & UA_BROWSERESULTMASK_TYPEDEFINITION) { + if(curr->head.nodeClass == UA_NODECLASS_OBJECT || + curr->head.nodeClass == UA_NODECLASS_VARIABLE) { + const UA_Node *type = getNodeType(server, &curr->head); + if(type) { + retval |= UA_NodeId_copy(&type->head.nodeId, &descr->typeDefinition.nodeId); + UA_NODESTORE_RELEASE(server, type); + } + } + } + + if(retval == UA_STATUSCODE_GOOD) + rr->size++; /* Increase the counter */ + else + UA_ReferenceDescription_clear(descr); + return retval; +} + +/* Returns whether the node / continuationpoint is done */ +static UA_StatusCode +browseReferences(UA_Server *server, const UA_NodeHead *head, + ContinuationPoint *cp, RefResult *rr, UA_Boolean *done) { + UA_assert(cp != NULL); + const UA_BrowseDescription *bd= &cp->browseDescription; + + size_t referenceKindIndex = cp->referenceKindIndex; + size_t targetIndex = cp->targetIndex; + + /* Loop over the node's references */ + const UA_Node *target = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(; referenceKindIndex < head->referencesSize; ++referenceKindIndex) { + UA_NodeReferenceKind *rk = &head->references[referenceKindIndex]; + + /* Reference in the right direction? */ + if(rk->isInverse && bd->browseDirection == UA_BROWSEDIRECTION_FORWARD) + continue; + if(!rk->isInverse && bd->browseDirection == UA_BROWSEDIRECTION_INVERSE) + continue; + + /* Is the reference part of the hierarchy of references we look for? */ + if(!UA_ReferenceTypeSet_contains(&cp->relevantReferences, rk->referenceTypeIndex)) + continue; + + /* Loop until we arrive at the saved index */ + size_t i = 0; + UA_ReferenceTarget *targetRef = NULL; + TAILQ_FOREACH(targetRef, &rk->queueHead, queuePointers) { + if(i == targetIndex) + break; + i++; + } + + /* Loop over the remaining targets */ + for(; targetRef; ++targetIndex, targetRef = TAILQ_NEXT(targetRef, queuePointers)) { + target = NULL; + + /* Get the node if it is not a remote reference */ + if(targetRef->targetId.serverIndex == 0 && + targetRef->targetId.namespaceUri.data == NULL) { + target = UA_NODESTORE_GET(server, &targetRef->targetId.nodeId); + + /* Test if the node class matches */ + if(target && !matchClassMask(target, bd->nodeClassMask)) { + UA_NODESTORE_RELEASE(server, target); + continue; + } + } + + /* A match! Did we reach maxrefs? */ + if(rr->size >= cp->maxReferences) { + cp->referenceKindIndex = referenceKindIndex; + cp->targetIndex = targetIndex; + if(target) + UA_NODESTORE_RELEASE(server, target); + return UA_STATUSCODE_GOOD; + } + + /* Copy the node description. Target is on top of the stack */ + retval = addReferenceDescription(server, rr, rk, bd->resultMask, + &targetRef->targetId, target); + UA_NODESTORE_RELEASE(server, target); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + targetIndex = 0; /* Start at index 0 for the next reference kind */ + } + + /* The node is done */ + *done = true; + return UA_STATUSCODE_GOOD; +} + +/* Results for a single browsedescription. This is the inner loop for both + * Browse and BrowseNext. The ContinuationPoint contains all the data used. + * Including the BrowseDescription. Returns whether there are remaining + * references. */ +static UA_Boolean +browseWithContinuation(UA_Server *server, UA_Session *session, + ContinuationPoint *cp, UA_BrowseResult *result) { + const UA_BrowseDescription *descr = &cp->browseDescription; + + /* Is the browsedirection valid? */ + if(descr->browseDirection != UA_BROWSEDIRECTION_BOTH && + descr->browseDirection != UA_BROWSEDIRECTION_FORWARD && + descr->browseDirection != UA_BROWSEDIRECTION_INVERSE) { + result->statusCode = UA_STATUSCODE_BADBROWSEDIRECTIONINVALID; + return true; + } + + /* Is the reference type valid? */ + if(!UA_NodeId_isNull(&descr->referenceTypeId)) { + const UA_Node *reftype = UA_NODESTORE_GET(server, &descr->referenceTypeId); + if(!reftype) { + result->statusCode = UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + return true; + } + + UA_Boolean isRef = (reftype->head.nodeClass == UA_NODECLASS_REFERENCETYPE); + UA_NODESTORE_RELEASE(server, reftype); + + if(!isRef) { + result->statusCode = UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + return true; + } + } + + const UA_Node *node = UA_NODESTORE_GET(server, &descr->nodeId); + if(!node) { + result->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + return true; + } + + if(session != &server->adminSession && + !server->config.accessControl.allowBrowseNode(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle, + &descr->nodeId, node->head.context)) { + result->statusCode = UA_STATUSCODE_BADUSERACCESSDENIED; + UA_NODESTORE_RELEASE(server, node); + return true; + } + + RefResult rr; + result->statusCode = RefResult_init(&rr); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_NODESTORE_RELEASE(server, node); + return true; + } + + /* Browse the references */ + UA_Boolean done = false; + result->statusCode = browseReferences(server, &node->head, cp, &rr, &done); + UA_NODESTORE_RELEASE(server, node); + if(result->statusCode != UA_STATUSCODE_GOOD) { + RefResult_clear(&rr); + return true; + } + + /* Move results */ + if(rr.size > 0) { + result->references = rr.descr; + result->referencesSize = rr.size; + } else { + /* No relevant references, return array of length zero */ + RefResult_clear(&rr); + result->references = (UA_ReferenceDescription*)UA_EMPTY_ARRAY_SENTINEL; + } + + return done; +} + +/* Start to browse with no previous cp */ +void +Operation_Browse(UA_Server *server, UA_Session *session, const UA_UInt32 *maxrefs, + const UA_BrowseDescription *descr, UA_BrowseResult *result) { + /* Stack-allocate a temporary cp */ + ContinuationPoint cp; + memset(&cp, 0, sizeof(ContinuationPoint)); + cp.maxReferences = *maxrefs; + cp.browseDescription = *descr; /* Shallow copy. Deep-copy later if we persist the cp. */ + + /* How many references can we return at most? */ + if(cp.maxReferences == 0) { + if(server->config.maxReferencesPerNode != 0) { + cp.maxReferences = server->config.maxReferencesPerNode; + } else { + cp.maxReferences = UA_INT32_MAX; + } + } else { + if(server->config.maxReferencesPerNode != 0 && + cp.maxReferences > server->config.maxReferencesPerNode) { + cp.maxReferences= server->config.maxReferencesPerNode; + } + } + + /* Get the list of relevant reference types */ + if(UA_NodeId_isNull(&descr->referenceTypeId)) { + UA_ReferenceTypeSet_any(&cp.relevantReferences); + } else { + result->statusCode = + referenceTypeIndices(server, &descr->referenceTypeId, + &cp.relevantReferences, descr->includeSubtypes); + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + } + + UA_Boolean done = browseWithContinuation(server, session, &cp, result); + + /* Exit early if done or an error occurred */ + if(done || result->statusCode != UA_STATUSCODE_GOOD) + return; + + /* Persist the new continuation point */ + + ContinuationPoint *cp2 = NULL; + UA_Guid *ident = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + + /* Enough space for the continuation point? */ + if(session->availableContinuationPoints == 0) { + retval = UA_STATUSCODE_BADNOCONTINUATIONPOINTS; + goto cleanup; + } + + /* Allocate and fill the data structure */ + cp2 = (ContinuationPoint*)UA_malloc(sizeof(ContinuationPoint)); + if(!cp2) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } + memset(cp2, 0, sizeof(ContinuationPoint)); + cp2->referenceKindIndex = cp.referenceKindIndex; + cp2->targetIndex = cp.targetIndex; + cp2->maxReferences = cp.maxReferences; + cp2->relevantReferences = cp.relevantReferences; + + /* Copy the description */ + retval = UA_BrowseDescription_copy(descr, &cp2->browseDescription); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Create a random bytestring via a Guid */ + ident = UA_Guid_new(); + if(!ident) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } + *ident = UA_Guid_random(); + cp2->identifier.data = (UA_Byte*)ident; + cp2->identifier.length = sizeof(UA_Guid); + + /* Return the cp identifier */ + retval = UA_ByteString_copy(&cp2->identifier, &result->continuationPoint); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Attach the cp to the session */ + cp2->next = session->continuationPoints; + session->continuationPoints = cp2; + --session->availableContinuationPoints; + return; + + cleanup: + if(cp2) { + ContinuationPoint_clear(cp2); + UA_free(cp2); + } + UA_BrowseResult_clear(result); + result->statusCode = retval; +} + +void Service_Browse(UA_Server *server, UA_Session *session, + const UA_BrowseRequest *request, UA_BrowseResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing BrowseRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Test the number of operations in the request */ + if(server->config.maxNodesPerBrowse != 0 && + request->nodesToBrowseSize > server->config.maxNodesPerBrowse) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* No views supported at the moment */ + if(!UA_NodeId_isNull(&request->view.viewId)) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADVIEWIDUNKNOWN; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_Browse, + &request->requestedMaxReferencesPerNode, + &request->nodesToBrowseSize, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION], + &response->resultsSize, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +UA_BrowseResult +UA_Server_browse(UA_Server *server, UA_UInt32 maxReferences, + const UA_BrowseDescription *bd) { + UA_BrowseResult result; + UA_BrowseResult_init(&result); + UA_LOCK(server->serviceMutex); + Operation_Browse(server, &server->adminSession, &maxReferences, bd, &result); + UA_UNLOCK(server->serviceMutex); + return result; +} + +static void +Operation_BrowseNext(UA_Server *server, UA_Session *session, + const UA_Boolean *releaseContinuationPoints, + const UA_ByteString *continuationPoint, UA_BrowseResult *result) { + /* Find the continuation point */ + ContinuationPoint **prev = &session->continuationPoints, *cp; + while((cp = *prev)) { + if(UA_ByteString_equal(&cp->identifier, continuationPoint)) + break; + prev = &cp->next; + } + if(!cp) { + result->statusCode = UA_STATUSCODE_BADCONTINUATIONPOINTINVALID; + return; + } + + /* Remove the cp */ + if(*releaseContinuationPoints) { + *prev = ContinuationPoint_clear(cp); + UA_free(cp); + ++session->availableContinuationPoints; + return; + } + + /* Continue browsing */ + UA_Boolean done = browseWithContinuation(server, session, cp, result); + + if(done) { + /* Remove the cp if there are no references left */ + *prev = ContinuationPoint_clear(cp); + UA_free(cp); + ++session->availableContinuationPoints; + } else { + /* Return the cp identifier */ + UA_StatusCode retval = UA_ByteString_copy(&cp->identifier, &result->continuationPoint); + if(retval != UA_STATUSCODE_GOOD) { + UA_BrowseResult_clear(result); + result->statusCode = retval; + } + } +} + +void +Service_BrowseNext(UA_Server *server, UA_Session *session, + const UA_BrowseNextRequest *request, + UA_BrowseNextResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing BrowseNextRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_Boolean releaseContinuationPoints = request->releaseContinuationPoints; /* request is const */ + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_BrowseNext, + &releaseContinuationPoints, + &request->continuationPointsSize, &UA_TYPES[UA_TYPES_BYTESTRING], + &response->resultsSize, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +UA_BrowseResult +UA_Server_browseNext(UA_Server *server, UA_Boolean releaseContinuationPoint, + const UA_ByteString *continuationPoint) { + UA_BrowseResult result; + UA_BrowseResult_init(&result); + UA_LOCK(server->serviceMutex); + Operation_BrowseNext(server, &server->adminSession, &releaseContinuationPoint, + continuationPoint, &result); + UA_UNLOCK(server->serviceMutex); + return result; +} + +/***********************/ +/* TranslateBrowsePath */ +/***********************/ + +/* Find all entries for that hash. There are duplicate for the possible hash + * collisions. The exact browsename is checked afterwards. */ +static UA_StatusCode +recursiveAddBrowseHashTarget(RefTree *results, struct aa_head *head, + const UA_ReferenceTarget *rt) { + UA_assert(rt); + UA_StatusCode res = RefTree_add(results, &rt->targetId, NULL); + UA_ReferenceTarget *prev = (UA_ReferenceTarget*)aa_prev(head, rt); + while(prev && prev->targetNameHash == rt->targetNameHash) { + res |= RefTree_add(results, &prev->targetId, NULL); + prev = (UA_ReferenceTarget*)aa_prev(head, prev); + } + UA_ReferenceTarget *next= (UA_ReferenceTarget*)aa_next(head, rt); + while(next && next->targetNameHash == rt->targetNameHash) { + res |= RefTree_add(results, &next->targetId, NULL); + next = (UA_ReferenceTarget*)aa_next(head, next); + } + return res; +} + +static UA_StatusCode +walkBrowsePathElement(UA_Server *server, UA_Session *session, + const UA_RelativePath *path, const size_t pathIndex, + UA_UInt32 nodeClassMask, const UA_QualifiedName *lastBrowseName, + UA_BrowsePathResult *result, RefTree *current, RefTree *next) { + /* For the next level. Note the difference from lastBrowseName */ + const UA_RelativePathElement *elem = &path->elements[pathIndex]; + UA_UInt32 browseNameHash = UA_QualifiedName_hash(&elem->targetName); + + /* Get the relevant ReferenceTypes */ + UA_StatusCode res = UA_STATUSCODE_GOOD; + UA_ReferenceTypeSet refTypes; + if(UA_NodeId_isNull(&elem->referenceTypeId)) { + UA_ReferenceTypeSet_any(&refTypes); + } else { + res = referenceTypeIndices(server, &elem->referenceTypeId, + &refTypes, elem->includeSubtypes); + if(res != UA_STATUSCODE_GOOD) + return UA_STATUSCODE_BADNOMATCH; + } + + struct aa_head _nameTreeHead = nameTreeHead; + + /* Loop over all Nodes in the current depth level */ + for(size_t i = 0; i < current->size; i++) { + /* Remote Node. Immediately add to the results with the RemainingPathIndex set. */ + if(current->targets[i].serverIndex > 0 || + current->targets[i].namespaceUri.length > 0) { + /* Increase the size of the results array */ + UA_BrowsePathTarget *tmpResults = (UA_BrowsePathTarget*) + UA_realloc(result->targets, sizeof(UA_BrowsePathTarget) * + (result->targetsSize + 1)); + if(!tmpResults) + return UA_STATUSCODE_BADOUTOFMEMORY; + result->targets = tmpResults; + + /* Copy over the result */ + res = UA_ExpandedNodeId_copy(¤t->targets[i], + &result->targets[result->targetsSize].targetId); + result->targets[result->targetsSize].remainingPathIndex = (UA_UInt32)pathIndex; + result->targetsSize++; + if(res != UA_STATUSCODE_GOOD) + break; + continue; + } + + /* Local Node. Add to the tree of results at the next depth. */ + const UA_Node *node = UA_NODESTORE_GET(server, ¤t->targets[i].nodeId); + if(!node) + continue; + + /* Test whether the node fits the class mask */ + UA_Boolean skip = !matchClassMask(node, nodeClassMask); + + /* Does the BrowseName match for the current node (not the references + * going out here) */ + skip |= (lastBrowseName && + !UA_QualifiedName_equal(lastBrowseName, &node->head.browseName)); + + if(skip) { + UA_NODESTORE_RELEASE(server, node); + continue; + } + + /* Loop over the ReferenceKinds */ + for(size_t j = 0; j < node->head.referencesSize; j++) { + UA_NodeReferenceKind *rk = &node->head.references[j]; + + /* Does the direction of the reference match? */ + if(rk->isInverse != elem->isInverse) + continue; + + /* Does the reference type match? */ + if(!UA_ReferenceTypeSet_contains(&refTypes, rk->referenceTypeIndex)) + continue; + + /* Retrieve by BrowseName hash. We might have several nodes where + * the hash matches. The exact BrowseName will be verified in the + * next iteration of the outer loop. So we only have to retrieve + * every node just once. */ + _nameTreeHead.root = rk->nameTreeRoot; + UA_ReferenceTarget *rt = (UA_ReferenceTarget*) + aa_find(&_nameTreeHead, &browseNameHash); + if(!rt) + continue; + + res = recursiveAddBrowseHashTarget(next, &_nameTreeHead, rt); + if(res != UA_STATUSCODE_GOOD) + break; + } + + UA_NODESTORE_RELEASE(server, node); + } + return res; +} + +static void +Operation_TranslateBrowsePathToNodeIds(UA_Server *server, UA_Session *session, + const UA_UInt32 *nodeClassMask, + const UA_BrowsePath *path, + UA_BrowsePathResult *result) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(path->relativePath.elementsSize <= 0) { + result->statusCode = UA_STATUSCODE_BADNOTHINGTODO; + return; + } + + /* RelativePath elements must not have an empty targetName */ + for(size_t i = 0; i < path->relativePath.elementsSize; ++i) { + if(UA_QualifiedName_isNull(&path->relativePath.elements[i].targetName)) { + result->statusCode = UA_STATUSCODE_BADBROWSENAMEINVALID; + return; + } + } + + /* Check if the starting node exists */ + const UA_Node *startingNode = UA_NODESTORE_GET(server, &path->startingNode); + if(!startingNode) { + result->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + return; + } + UA_NODESTORE_RELEASE(server, startingNode); + + /* Create two RefTrees that are alternated between path elements */ + RefTree rt1, rt2, *current = &rt1, *next = &rt2, *tmp; + result->statusCode |= RefTree_init(&rt1); + result->statusCode |= RefTree_init(&rt2); + UA_BrowsePathTarget *tmpResults = NULL; + UA_QualifiedName *browseNameFilter = NULL; + if(result->statusCode != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Copy the starting node into next */ + UA_ExpandedNodeId startingNodeId; + UA_ExpandedNodeId_init(&startingNodeId); + startingNodeId.nodeId = path->startingNode; + result->statusCode = RefTree_add(next, &startingNodeId, NULL); + if(result->statusCode != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Walk the path elements. Retrieve the nodes only once from the NodeStore. + * Hence the BrowseName is checked with one element "delay". */ + for(size_t i = 0; i < path->relativePath.elementsSize; i++) { + /* Switch the trees */ + tmp = current; + current = next; + next = tmp; + + /* Clear up current, keep the capacity */ + for(size_t j = 0; j < next->size; j++) + UA_ExpandedNodeId_clear(&next->targets[j]); + next->size = 0; + ZIP_INIT(&next->head); + + /* Do this check after next->size has been set to zero */ + if(current->size == 0) + break; + + /* Walk element for all NodeIds in the "current" tree. + * Puts new results in the "next" tree. */ + result->statusCode = + walkBrowsePathElement(server, session, &path->relativePath, i, + *nodeClassMask, browseNameFilter, result, current, next); + if(result->statusCode != UA_STATUSCODE_GOOD) + goto cleanup; + + browseNameFilter = &path->relativePath.elements[i].targetName; + } + + /* Allocate space for the results array */ + tmpResults = (UA_BrowsePathTarget*) + UA_realloc(result->targets, sizeof(UA_BrowsePathTarget) * + (result->targetsSize + next->size)); + if(!tmpResults) { + result->statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } + result->targets = tmpResults; + + for(size_t k = 0; k < next->size; k++) { + /* Check the BrowseName. It has been filtered only via its hash so far. */ + const UA_Node *node = UA_NODESTORE_GET(server, &next->targets[k].nodeId); + if(!node) + continue; + UA_Boolean match = UA_QualifiedName_equal(browseNameFilter, &node->head.browseName); + UA_NODESTORE_RELEASE(server, node); + if(!match) + continue; + + /* Move to the target to the results array */ + result->targets[result->targetsSize].targetId = next->targets[k]; + result->targets[result->targetsSize].remainingPathIndex = UA_UINT32_MAX; + UA_ExpandedNodeId_init(&next->targets[k]); + result->targetsSize++; + } + + /* No results => BadNoMatch status code */ + if(result->targetsSize == 0 && result->statusCode == UA_STATUSCODE_GOOD) + result->statusCode = UA_STATUSCODE_BADNOMATCH; + + /* Clean up the temporary arrays and the targets */ + cleanup: + RefTree_clear(&rt1); + RefTree_clear(&rt2); + if(result->statusCode != UA_STATUSCODE_GOOD) { + for(size_t i = 0; i < result->targetsSize; ++i) + UA_BrowsePathTarget_clear(&result->targets[i]); + if(result->targets) + UA_free(result->targets); + result->targets = NULL; + result->targetsSize = 0; + } +} + +UA_BrowsePathResult +translateBrowsePathToNodeIds(UA_Server *server, + const UA_BrowsePath *browsePath) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_BrowsePathResult result; + UA_BrowsePathResult_init(&result); + UA_UInt32 nodeClassMask = 0; /* All node classes */ + Operation_TranslateBrowsePathToNodeIds(server, &server->adminSession, &nodeClassMask, + browsePath, &result); + return result; +} + +UA_BrowsePathResult +UA_Server_translateBrowsePathToNodeIds(UA_Server *server, + const UA_BrowsePath *browsePath) { + UA_LOCK(server->serviceMutex); + UA_BrowsePathResult result = translateBrowsePathToNodeIds(server, browsePath); + UA_UNLOCK(server->serviceMutex); + return result; +} + +void +Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *session, + const UA_TranslateBrowsePathsToNodeIdsRequest *request, + UA_TranslateBrowsePathsToNodeIdsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing TranslateBrowsePathsToNodeIdsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Test the number of operations in the request */ + if(server->config.maxNodesPerTranslateBrowsePathsToNodeIds != 0 && + request->browsePathsSize > server->config.maxNodesPerTranslateBrowsePathsToNodeIds) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + UA_UInt32 nodeClassMask = 0; /* All node classes */ + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_TranslateBrowsePathToNodeIds, + &nodeClassMask, + &request->browsePathsSize, &UA_TYPES[UA_TYPES_BROWSEPATH], + &response->resultsSize, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +UA_BrowsePathResult +browseSimplifiedBrowsePath(UA_Server *server, const UA_NodeId origin, + size_t browsePathSize, const UA_QualifiedName *browsePath) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_BrowsePathResult bpr; + UA_BrowsePathResult_init(&bpr); + if(browsePathSize > UA_MAX_TREE_RECURSE) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Simplified Browse Path too long"); + bpr.statusCode = UA_STATUSCODE_BADINTERNALERROR; + return bpr; + } + + /* Construct the BrowsePath */ + UA_BrowsePath bp; + UA_BrowsePath_init(&bp); + bp.startingNode = origin; + + UA_RelativePathElement rpe[UA_MAX_TREE_RECURSE]; + memset(rpe, 0, sizeof(UA_RelativePathElement) * browsePathSize); + for(size_t j = 0; j < browsePathSize; j++) { + rpe[j].referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES); + rpe[j].includeSubtypes = true; + rpe[j].targetName = browsePath[j]; + } + bp.relativePath.elements = rpe; + bp.relativePath.elementsSize = browsePathSize; + + /* Browse */ + UA_UInt32 nodeClassMask = UA_NODECLASS_OBJECT | UA_NODECLASS_VARIABLE; +#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS + nodeClassMask |= UA_NODECLASS_OBJECTTYPE; +#endif /* UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */ + + Operation_TranslateBrowsePathToNodeIds(server, &server->adminSession, &nodeClassMask, &bp, &bpr); + return bpr; +} + +UA_BrowsePathResult +UA_Server_browseSimplifiedBrowsePath(UA_Server *server, const UA_NodeId origin, + size_t browsePathSize, const UA_QualifiedName *browsePath) { + UA_LOCK(server->serviceMutex); + UA_BrowsePathResult bpr = browseSimplifiedBrowsePath(server, origin, browsePathSize, browsePath); + UA_UNLOCK(server->serviceMutex); + return bpr; +} + +/************/ +/* Register */ +/************/ + +void Service_RegisterNodes(UA_Server *server, UA_Session *session, + const UA_RegisterNodesRequest *request, + UA_RegisterNodesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing RegisterNodesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + //TODO: hang the nodeids to the session if really needed + if(request->nodesToRegisterSize == 0) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO; + return; + } + + /* Test the number of operations in the request */ + if(server->config.maxNodesPerRegisterNodes != 0 && + request->nodesToRegisterSize > server->config.maxNodesPerRegisterNodes) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Array_copy(request->nodesToRegister, request->nodesToRegisterSize, + (void**)&response->registeredNodeIds, &UA_TYPES[UA_TYPES_NODEID]); + if(response->responseHeader.serviceResult == UA_STATUSCODE_GOOD) + response->registeredNodeIdsSize = request->nodesToRegisterSize; +} + +void Service_UnregisterNodes(UA_Server *server, UA_Session *session, + const UA_UnregisterNodesRequest *request, + UA_UnregisterNodesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing UnRegisterNodesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + //TODO: remove the nodeids from the session if really needed + if(request->nodesToUnregisterSize == 0) + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO; + + /* Test the number of operations in the request */ + if(server->config.maxNodesPerRegisterNodes != 0 && + request->nodesToUnregisterSize > server->config.maxNodesPerRegisterNodes) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_method.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2017 (c) Florian Palm + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016 (c) LEvertz + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Julian Grothoff + * Copyright 2020 (c) Hilscher Gesellschaft für Systemautomation mbH (Author: Martin Lang) + */ + + +#ifdef UA_ENABLE_METHODCALLS /* conditional compilation */ + +static const UA_VariableNode * +getArgumentsVariableNode(UA_Server *server, const UA_NodeHead *head, + UA_String withBrowseName) { + for(size_t i = 0; i < head->referencesSize; ++i) { + UA_NodeReferenceKind *rk = &head->references[i]; + if(rk->isInverse != false) + continue; + if(rk->referenceTypeIndex != UA_REFERENCETYPEINDEX_HASPROPERTY) + continue; + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &rk->queueHead, queuePointers) { + const UA_Node *refTarget = UA_NODESTORE_GET(server, &target->targetId.nodeId); + if(!refTarget) + continue; + if(refTarget->head.nodeClass == UA_NODECLASS_VARIABLE && + refTarget->head.browseName.namespaceIndex == 0 && + UA_String_equal(&withBrowseName, &refTarget->head.browseName.name)) { + return &refTarget->variableNode; + } + UA_NODESTORE_RELEASE(server, refTarget); + } + } + return NULL; +} + +/* inputArgumentResults has the length request->inputArgumentsSize */ +static UA_StatusCode +typeCheckArguments(UA_Server *server, UA_Session *session, + const UA_VariableNode *argRequirements, size_t argsSize, + UA_Variant *args, UA_StatusCode *inputArgumentResults) { + /* Verify that we have a Variant containing UA_Argument (scalar or array) in + * the "InputArguments" node */ + if(argRequirements->valueSource != UA_VALUESOURCE_DATA) + return UA_STATUSCODE_BADINTERNALERROR; + if(!argRequirements->value.data.value.hasValue) + return UA_STATUSCODE_BADINTERNALERROR; + if(argRequirements->value.data.value.value.type != &UA_TYPES[UA_TYPES_ARGUMENT]) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Verify the number of arguments. A scalar argument value is interpreted as + * an array of length 1. */ + size_t argReqsSize = argRequirements->value.data.value.value.arrayLength; + if(UA_Variant_isScalar(&argRequirements->value.data.value.value)) + argReqsSize = 1; + if(argReqsSize > argsSize) + return UA_STATUSCODE_BADARGUMENTSMISSING; + if(argReqsSize < argsSize) + return UA_STATUSCODE_BADTOOMANYARGUMENTS; + + /* Type-check every argument against the definition */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_Argument *argReqs = (UA_Argument*)argRequirements->value.data.value.value.data; + for(size_t i = 0; i < argReqsSize; ++i) { + if(!compatibleValue(server, session, &argReqs[i].dataType, argReqs[i].valueRank, + argReqs[i].arrayDimensionsSize, argReqs[i].arrayDimensions, + &args[i], NULL)) { + inputArgumentResults[i] = UA_STATUSCODE_BADTYPEMISMATCH; + retval = UA_STATUSCODE_BADINVALIDARGUMENT; + } + } + return retval; +} + +/* inputArgumentResults has the length request->inputArgumentsSize */ +static UA_StatusCode +validMethodArguments(UA_Server *server, UA_Session *session, const UA_MethodNode *method, + const UA_CallMethodRequest *request, + UA_StatusCode *inputArgumentResults) { + /* Get the input arguments node */ + const UA_VariableNode *inputArguments = + getArgumentsVariableNode(server, &method->head, UA_STRING("InputArguments")); + if(!inputArguments) { + if(request->inputArgumentsSize > 0) + return UA_STATUSCODE_BADTOOMANYARGUMENTS; + return UA_STATUSCODE_GOOD; + } + + /* Verify the request */ + UA_StatusCode retval = + typeCheckArguments(server, session, inputArguments, request->inputArgumentsSize, + request->inputArguments, inputArgumentResults); + + /* Release the input arguments node */ + UA_NODESTORE_RELEASE(server, (const UA_Node*)inputArguments); + return retval; +} + +static const UA_NodeId hasComponentNodeId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASCOMPONENT}}; +static const UA_NodeId organizedByNodeId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_ORGANIZES}}; +static const UA_String namespaceDiModel = UA_STRING_STATIC("http://opcfoundation.org/UA/DI/"); +static const UA_NodeId hasTypeDefinitionNodeId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASTYPEDEFINITION}}; +// ns=0 will be replace dynamically. DI-Spec. 1.01: <UAObjectType NodeId="ns=1;i=1005" BrowseName="1:FunctionalGroupType"> +static UA_NodeId functionGroupNodeId = {0, UA_NODEIDTYPE_NUMERIC, {1005}}; + +static void +callWithMethodAndObject(UA_Server *server, UA_Session *session, + const UA_CallMethodRequest *request, UA_CallMethodResult *result, + const UA_MethodNode *method, const UA_ObjectNode *object) { + /* Verify the object's NodeClass */ + if(object->head.nodeClass != UA_NODECLASS_OBJECT && + object->head.nodeClass != UA_NODECLASS_OBJECTTYPE) { + result->statusCode = UA_STATUSCODE_BADNODECLASSINVALID; + return; + } + + /* Verify the method's NodeClass */ + if(method->head.nodeClass != UA_NODECLASS_METHOD) { + result->statusCode = UA_STATUSCODE_BADNODECLASSINVALID; + return; + } + + /* Is there a method to execute? */ + if(!method->method) { + result->statusCode = UA_STATUSCODE_BADINTERNALERROR; + return; + } + + /* Verify method/object relations. Object must have a hasComponent or a + * subtype of hasComponent reference to the method node. Therefore, check + * every reference between the parent object and the method node if there is + * a hasComponent (or subtype) reference */ + UA_ReferenceTypeSet hasComponentRefs; + result->statusCode = + referenceTypeIndices(server, &hasComponentNodeId, &hasComponentRefs, true); + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + UA_Boolean found = false; + for(size_t i = 0; i < object->head.referencesSize && !found; ++i) { + UA_NodeReferenceKind *rk = &object->head.references[i]; + if(rk->isInverse) + continue; + if(!UA_ReferenceTypeSet_contains(&hasComponentRefs, rk->referenceTypeIndex)) + continue; + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &rk->queueHead, queuePointers) { + if(UA_NodeId_equal(&target->targetId.nodeId, &request->methodId)) { + found = true; + break; + } + } + } + + if(!found) { + /* The following ParentObject evaluation is a workaround only to fulfill + * the OPC UA Spec. Part 100 - Devices requirements regarding functional + * groups. Compare OPC UA Spec. Part 100 - Devices, Release 1.02 + * - 5.4 FunctionalGroupType + * - B.1 Functional Group Usages + * A functional group is a sub-type of the FolderType and is used to + * organize the Parameters and Methods from the complete set (named + * ParameterSet and MethodSet) in (Functional) groups for instance + * Configuration or Identification. The same Property, Parameter or + * Method can be referenced from more than one FunctionalGroup. */ + + /* Check whether the DI namespace is available */ + size_t foundNamespace = 0; + UA_StatusCode res = getNamespaceByName(server, namespaceDiModel, &foundNamespace); + if(res != UA_STATUSCODE_GOOD) { + result->statusCode = UA_STATUSCODE_BADMETHODINVALID; + return; + } + functionGroupNodeId.namespaceIndex = (UA_UInt16)foundNamespace; + + UA_ReferenceTypeSet hasTypeDefinitionRefs; + result->statusCode = + referenceTypeIndices(server, &hasTypeDefinitionNodeId, + &hasTypeDefinitionRefs, true); + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + + /* Search for a HasTypeDefinition (or sub-) reference in the parent object */ + for(size_t i = 0; i < object->head.referencesSize && !found; ++i) { + UA_NodeReferenceKind *rk = &object->head.references[i]; + if(rk->isInverse) + continue; + if(!UA_ReferenceTypeSet_contains(&hasTypeDefinitionRefs, rk->referenceTypeIndex)) + continue; + + /* Verify that the HasTypeDefinition is equal to FunctionGroupType + * (or sub-type) from the DI model */ + UA_ReferenceTarget *target, *target2; + TAILQ_FOREACH(target, &rk->queueHead, queuePointers) { + if(found) + break; + if(!isNodeInTree_singleRef(server, &target->targetId.nodeId, + &functionGroupNodeId, UA_REFERENCETYPEINDEX_HASSUBTYPE)) + continue; + + /* Search for the called method with reference Organize (or + * sub-type) from the parent object */ + for(size_t k = 0; k < object->head.referencesSize && !found; ++k) { + UA_NodeReferenceKind *rkInner = &object->head.references[k]; + if(rkInner->isInverse) + continue; + const UA_NodeId * refId = + UA_NODESTORE_GETREFERENCETYPEID(server, rkInner->referenceTypeIndex); + if(!isNodeInTree_singleRef(server, refId, &organizedByNodeId, + UA_REFERENCETYPEINDEX_HASSUBTYPE)) + continue; + + TAILQ_FOREACH(target2, &rkInner->queueHead, queuePointers) { + if(UA_NodeId_equal(&target2->targetId.nodeId, &request->methodId)) { + found = true; + break; + } + } + } + } + } + if(!found) { + result->statusCode = UA_STATUSCODE_BADMETHODINVALID; + return; + } + } + + /* Verify access rights */ + UA_Boolean executable = method->executable; + if(session != &server->adminSession) { + UA_UNLOCK(server->serviceMutex); + executable = executable && server->config.accessControl. + getUserExecutableOnObject(server, &server->config.accessControl, &session->sessionId, + session->sessionHandle, &request->methodId, method->head.context, + &request->objectId, object->head.context); + UA_LOCK(server->serviceMutex); + } + + if(!executable) { + result->statusCode = UA_STATUSCODE_BADNOTEXECUTABLE; + return; + } + + /* Allocate the inputArgumentResults array */ + result->inputArgumentResults = (UA_StatusCode*) + UA_Array_new(request->inputArgumentsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); + if(!result->inputArgumentResults) { + result->statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + result->inputArgumentResultsSize = request->inputArgumentsSize; + + /* Verify Input Arguments */ + result->statusCode = validMethodArguments(server, session, method, request, + result->inputArgumentResults); + + /* Return inputArgumentResults only for BADINVALIDARGUMENT */ + if(result->statusCode != UA_STATUSCODE_BADINVALIDARGUMENT) { + UA_Array_delete(result->inputArgumentResults, result->inputArgumentResultsSize, + &UA_TYPES[UA_TYPES_STATUSCODE]); + result->inputArgumentResults = NULL; + result->inputArgumentResultsSize = 0; + } + + /* Error during type-checking? */ + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + + /* Get the output arguments node */ + const UA_VariableNode *outputArguments = + getArgumentsVariableNode(server, &method->head, UA_STRING("OutputArguments")); + + /* Allocate the output arguments array */ + size_t outputArgsSize = 0; + if(outputArguments) + outputArgsSize = outputArguments->value.data.value.value.arrayLength; + result->outputArguments = (UA_Variant*) + UA_Array_new(outputArgsSize, &UA_TYPES[UA_TYPES_VARIANT]); + if(!result->outputArguments) { + result->statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + result->outputArgumentsSize = outputArgsSize; + + /* Release the output arguments node */ + UA_NODESTORE_RELEASE(server, (const UA_Node*)outputArguments); + + /* Call the method */ + UA_UNLOCK(server->serviceMutex); + result->statusCode = method->method(server, &session->sessionId, session->sessionHandle, + &method->head.nodeId, method->head.context, + &object->head.nodeId, object->head.context, + request->inputArgumentsSize, request->inputArguments, + result->outputArgumentsSize, result->outputArguments); + UA_LOCK(server->serviceMutex); + /* TODO: Verify Output matches the argument definition */ +} + +#if UA_MULTITHREADING >= 100 + +static void +Operation_CallMethodAsync(UA_Server *server, UA_Session *session, UA_UInt32 requestId, + UA_UInt32 requestHandle, size_t opIndex, + UA_CallMethodRequest *opRequest, UA_CallMethodResult *opResult, + UA_AsyncResponse **ar) { + /* Get the method node */ + const UA_Node *method = UA_NODESTORE_GET(server, &opRequest->methodId); + if(!method) { + opResult->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + return; + } + + /* Get the object node */ + const UA_Node *object = UA_NODESTORE_GET(server, &opRequest->objectId); + if(!object) { + opResult->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + UA_NODESTORE_RELEASE(server, method); + return; + } + + /* Synchronous execution */ + if(!method->methodNode.async) { + callWithMethodAndObject(server, session, opRequest, opResult, + &method->methodNode, &object->objectNode); + goto cleanup; + } + + /* <-- Async method call --> */ + + /* No AsyncResponse allocated so far */ + if(!*ar) { + opResult->statusCode = + UA_AsyncManager_createAsyncResponse(&server->asyncManager, server, + &session->sessionId, requestId, requestHandle, + UA_ASYNCOPERATIONTYPE_CALL, ar); + if(opResult->statusCode != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Create the Async Request to be taken by workers */ + opResult->statusCode = + UA_AsyncManager_createAsyncOp(&server->asyncManager, + server, *ar, opIndex, opRequest); + + cleanup: + /* Release the method and object node */ + UA_NODESTORE_RELEASE(server, method); + UA_NODESTORE_RELEASE(server, object); +} + +void +Service_CallAsync(UA_Server *server, UA_Session *session, UA_UInt32 requestId, + const UA_CallRequest *request, UA_CallResponse *response, + UA_Boolean *finished) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing CallRequestAsync"); + if(server->config.maxNodesPerMethodCall != 0 && + request->methodsToCallSize > server->config.maxNodesPerMethodCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + UA_AsyncResponse *ar = NULL; + response->responseHeader.serviceResult = + UA_Server_processServiceOperationsAsync(server, session, requestId, + request->requestHeader.requestHandle, + (UA_AsyncServiceOperation)Operation_CallMethodAsync, + &request->methodsToCallSize, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST], + &response->resultsSize, &UA_TYPES[UA_TYPES_CALLMETHODRESULT], &ar); + + if(ar) { + if(ar->opCountdown > 0) { + /* Move all results to the AsyncResponse. The async operation + * results will be overwritten when the workers return results. */ + ar->response.callResponse = *response; + UA_CallResponse_init(response); + *finished = false; + } else { + /* If there is a new AsyncResponse, ensure it has at least one + * pending operation */ + UA_AsyncManager_removeAsyncResponse(&server->asyncManager, ar); + } + } +} +#endif + +static void +Operation_CallMethod(UA_Server *server, UA_Session *session, void *context, + const UA_CallMethodRequest *request, UA_CallMethodResult *result) { + /* Get the method node */ + const UA_Node *method = UA_NODESTORE_GET(server, &request->methodId); + if(!method) { + result->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + return; + } + + /* Get the object node */ + const UA_Node *object = UA_NODESTORE_GET(server, &request->objectId); + if(!object) { + result->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN; + UA_NODESTORE_RELEASE(server, method); + return; + } + + /* Continue with method and object as context */ + callWithMethodAndObject(server, session, request, result, + &method->methodNode, &object->objectNode); + + /* Release the method and object node */ + UA_NODESTORE_RELEASE(server, method); + UA_NODESTORE_RELEASE(server, object); +} + +void Service_Call(UA_Server *server, UA_Session *session, + const UA_CallRequest *request, UA_CallResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing CallRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxNodesPerMethodCall != 0 && + request->methodsToCallSize > server->config.maxNodesPerMethodCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_CallMethod, NULL, + &request->methodsToCallSize, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST], + &response->resultsSize, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +UA_CallMethodResult +UA_Server_call(UA_Server *server, const UA_CallMethodRequest *request) { + UA_CallMethodResult result; + UA_CallMethodResult_init(&result); + UA_LOCK(server->serviceMutex); + Operation_CallMethod(server, &server->adminSession, NULL, request, &result); + UA_UNLOCK(server->serviceMutex); + return result; +} + +#endif /* UA_ENABLE_METHODCALLS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_session.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2014-2016 (c) Sten Grüner + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2018-2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + +/* Delayed callback to free the session memory */ +static void +removeSessionCallback(UA_Server *server, session_list_entry *entry) { + UA_LOCK(server->serviceMutex); + UA_Session_clear(&entry->session, server); + UA_UNLOCK(server->serviceMutex); +} + +void +UA_Server_removeSession(UA_Server *server, session_list_entry *sentry, + UA_DiagnosticEvent event) { + UA_Session *session = &sentry->session; + + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Remove the Subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_Subscription *sub, *tempsub; + TAILQ_FOREACH_SAFE(sub, &session->subscriptions, sessionListEntry, tempsub) { + UA_Subscription_delete(server, sub); + } + + UA_PublishResponseEntry *entry; + while((entry = UA_Session_dequeuePublishReq(session))) { + UA_PublishResponse_clear(&entry->response); + UA_free(entry); + } +#endif + + /* Callback into userland access control */ + if(server->config.accessControl.closeSession) { + UA_UNLOCK(server->serviceMutex); + server->config.accessControl.closeSession(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle); + UA_LOCK(server->serviceMutex); + } + + /* Detach the Session from the SecureChannel */ + UA_Session_detachFromSecureChannel(session); + + /* Deactivate the session */ + sentry->session.activated = false; + + /* Detach the session from the session manager and make the capacity + * available */ + LIST_REMOVE(sentry, pointers); + UA_atomic_subUInt32(&server->sessionCount, 1); + UA_atomic_subSize(&server->serverStats.ss.currentSessionCount, 1); + + switch(event) { + case UA_DIAGNOSTICEVENT_CLOSE: + case UA_DIAGNOSTICEVENT_PURGE: + break; + case UA_DIAGNOSTICEVENT_TIMEOUT: + UA_atomic_addSize(&server->serverStats.ss.sessionTimeoutCount, 1); + break; + case UA_DIAGNOSTICEVENT_REJECT: + UA_atomic_addSize(&server->serverStats.ss.rejectedSessionCount, 1); + break; + case UA_DIAGNOSTICEVENT_SECURITYREJECT: + UA_atomic_addSize(&server->serverStats.ss.securityRejectedSessionCount, 1); + break; + case UA_DIAGNOSTICEVENT_ABORT: + UA_atomic_addSize(&server->serverStats.ss.sessionAbortCount, 1); + break; + default: + UA_assert(false); + break; + } + + /* Add a delayed callback to remove the session when the currently + * scheduled jobs have completed */ + sentry->cleanupCallback.callback = (UA_ApplicationCallback)removeSessionCallback; + sentry->cleanupCallback.application = server; + sentry->cleanupCallback.data = sentry; + sentry->cleanupCallback.nextTime = UA_DateTime_nowMonotonic() + 1; + sentry->cleanupCallback.interval = 0; /* Remove the structure */ + UA_Timer_addTimerEntry(&server->timer, &sentry->cleanupCallback, NULL); +} + +UA_StatusCode +UA_Server_removeSessionByToken(UA_Server *server, const UA_NodeId *token, + UA_DiagnosticEvent event) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + session_list_entry *entry; + LIST_FOREACH(entry, &server->sessions, pointers) { + if(UA_NodeId_equal(&entry->session.header.authenticationToken, token)) { + UA_Server_removeSession(server, entry, event); + return UA_STATUSCODE_GOOD; + } + } + return UA_STATUSCODE_BADSESSIONIDINVALID; +} + +void +UA_Server_cleanupSessions(UA_Server *server, UA_DateTime nowMonotonic) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + session_list_entry *sentry, *temp; + LIST_FOREACH_SAFE(sentry, &server->sessions, pointers, temp) { + /* Session has timed out? */ + if(sentry->session.validTill >= nowMonotonic) + continue; + UA_LOG_INFO_SESSION(&server->config.logger, &sentry->session, "Session has timed out"); + UA_Server_removeSession(server, sentry, UA_DIAGNOSTICEVENT_TIMEOUT); + } +} + +/************/ +/* Services */ +/************/ + +UA_Session * +getSessionByToken(UA_Server *server, const UA_NodeId *token) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + session_list_entry *current = NULL; + LIST_FOREACH(current, &server->sessions, pointers) { + /* Token does not match */ + if(!UA_NodeId_equal(¤t->session.header.authenticationToken, token)) + continue; + + /* Session has timed out */ + if(UA_DateTime_nowMonotonic() > current->session.validTill) { + UA_LOG_INFO_SESSION(&server->config.logger, ¤t->session, + "Client tries to use a session that has timed out"); + return NULL; + } + + return ¤t->session; + } + + return NULL; +} + +UA_Session * +UA_Server_getSessionById(UA_Server *server, const UA_NodeId *sessionId) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + session_list_entry *current = NULL; + LIST_FOREACH(current, &server->sessions, pointers) { + /* Token does not match */ + if(!UA_NodeId_equal(¤t->session.sessionId, sessionId)) + continue; + + /* Session has timed out */ + if(UA_DateTime_nowMonotonic() > current->session.validTill) { + UA_LOG_INFO_SESSION(&server->config.logger, ¤t->session, + "Client tries to use a session that has timed out"); + return NULL; + } + + return ¤t->session; + } + + return NULL; +} + +static UA_StatusCode +signCreateSessionResponse(UA_Server *server, UA_SecureChannel *channel, + const UA_CreateSessionRequest *request, + UA_CreateSessionResponse *response) { + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + const UA_SecurityPolicy *securityPolicy = channel->securityPolicy; + UA_SignatureData *signatureData = &response->serverSignature; + + /* Prepare the signature */ + size_t signatureSize = securityPolicy->certificateSigningAlgorithm. + getLocalSignatureSize(securityPolicy, channel->channelContext); + UA_StatusCode retval = UA_String_copy(&securityPolicy->certificateSigningAlgorithm.uri, + &signatureData->algorithm); + retval |= UA_ByteString_allocBuffer(&signatureData->signature, signatureSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Allocate a temp buffer */ + size_t dataToSignSize = request->clientCertificate.length + request->clientNonce.length; + UA_ByteString dataToSign; + retval = UA_ByteString_allocBuffer(&dataToSign, dataToSignSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; /* signatureData->signature is cleaned up with the response */ + + /* Sign the signature */ + memcpy(dataToSign.data, request->clientCertificate.data, request->clientCertificate.length); + memcpy(dataToSign.data + request->clientCertificate.length, + request->clientNonce.data, request->clientNonce.length); + retval = securityPolicy->certificateSigningAlgorithm. + sign(securityPolicy, channel->channelContext, &dataToSign, &signatureData->signature); + + /* Clean up */ + UA_ByteString_clear(&dataToSign); + return retval; +} + +/* Creates and adds a session. But it is not yet attached to a secure channel. */ +UA_StatusCode +UA_Server_createSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CreateSessionRequest *request, UA_Session **session) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->sessionCount >= server->config.maxSessions) + return UA_STATUSCODE_BADTOOMANYSESSIONS; + + session_list_entry *newentry = (session_list_entry *)UA_malloc(sizeof(session_list_entry)); + if(!newentry) + return UA_STATUSCODE_BADOUTOFMEMORY; + + UA_atomic_addUInt32(&server->sessionCount, 1); + UA_Session_init(&newentry->session); + newentry->session.sessionId = UA_NODEID_GUID(1, UA_Guid_random()); + newentry->session.header.authenticationToken = UA_NODEID_GUID(1, UA_Guid_random()); + + if(request->requestedSessionTimeout <= server->config.maxSessionTimeout && + request->requestedSessionTimeout > 0) + newentry->session.timeout = request->requestedSessionTimeout; + else + newentry->session.timeout = server->config.maxSessionTimeout; + + /* Attach the session to the channel. But don't activate for now. */ + if(channel) + UA_Session_attachToSecureChannel(&newentry->session, channel); + UA_Session_updateLifetime(&newentry->session); + + LIST_INSERT_HEAD(&server->sessions, newentry, pointers); + *session = &newentry->session; + return UA_STATUSCODE_GOOD; +} + +void +Service_CreateSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CreateSessionRequest *request, + UA_CreateSessionResponse *response) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_LOG_DEBUG_CHANNEL(&server->config.logger, channel, "Trying to create session"); + + if(channel->securityMode == UA_MESSAGESECURITYMODE_SIGN || + channel->securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + /* Compare the clientCertificate with the remoteCertificate of the channel. + * Both the clientCertificate of this request and the remoteCertificate + * of the channel may contain a partial or a complete certificate chain. + * The compareCertificate function of the channelModule will compare the + * first certificate of each chain. The end certificate shall be located + * first in the chain according to the OPC UA specification Part 6 (1.04), + * chapter 6.2.3.*/ + UA_StatusCode retval = channel->securityPolicy->channelModule. + compareCertificate(channel->channelContext, &request->clientCertificate); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "The client certificate did not validate"); + response->responseHeader.serviceResult = UA_STATUSCODE_BADCERTIFICATEINVALID; + return; + } + } + + UA_assert(channel->securityToken.channelId != 0); + + if(!UA_ByteString_equal(&channel->securityPolicy->policyUri, + &UA_SECURITY_POLICY_NONE_URI) && + request->clientNonce.length < 32) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNONCEINVALID; + return; + } + + if(request->clientCertificate.length > 0) { + UA_CertificateVerification *cv = &server->config.certificateVerification; + response->responseHeader.serviceResult = + cv->verifyApplicationURI(cv->context, &request->clientCertificate, + &request->clientDescription.applicationUri); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "The client's ApplicationURI did not match the certificate"); + UA_atomic_addSize(&server->serverStats.ss.securityRejectedSessionCount, 1); + UA_atomic_addSize(&server->serverStats.ss.rejectedSessionCount, 1); + return; + } + } + + UA_Session *newSession = NULL; + response->responseHeader.serviceResult = + UA_Server_createSession(server, channel, request, &newSession); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "Processing CreateSessionRequest failed"); + return; + } + + UA_assert(newSession != NULL); + + /* Allocate the response */ + response->serverEndpoints = (UA_EndpointDescription *) + UA_Array_new(server->config.endpointsSize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); + if(!response->serverEndpoints) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + UA_Server_removeSessionByToken(server, &newSession->header.authenticationToken, + UA_DIAGNOSTICEVENT_REJECT); + return; + } + response->serverEndpointsSize = server->config.endpointsSize; + + /* Copy the server's endpointdescriptions into the response */ + for(size_t i = 0; i < server->config.endpointsSize; ++i) + response->responseHeader.serviceResult |= + UA_EndpointDescription_copy(&server->config.endpoints[i], + &response->serverEndpoints[i]); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_Server_removeSessionByToken(server, &newSession->header.authenticationToken, + UA_DIAGNOSTICEVENT_REJECT); + return; + } + + /* Mirror back the endpointUrl */ + for(size_t i = 0; i < response->serverEndpointsSize; ++i) { + UA_String_clear(&response->serverEndpoints[i].endpointUrl); + response->responseHeader.serviceResult |= + UA_String_copy(&request->endpointUrl, + &response->serverEndpoints[i].endpointUrl); + } + + /* Fill the session information */ + newSession->maxResponseMessageSize = request->maxResponseMessageSize; + newSession->maxRequestMessageSize = channel->config.localMaxMessageSize; + response->responseHeader.serviceResult |= + UA_ApplicationDescription_copy(&request->clientDescription, + &newSession->clientDescription); + + /* Prepare the response */ + response->sessionId = newSession->sessionId; + response->revisedSessionTimeout = (UA_Double)newSession->timeout; + response->authenticationToken = newSession->header.authenticationToken; + response->responseHeader.serviceResult |= + UA_String_copy(&request->sessionName, &newSession->sessionName); + + UA_ByteString_init(&response->serverCertificate); + + if(server->config.endpointsSize > 0) + for(size_t i = 0; i < response->serverEndpointsSize; ++i) { + if(response->serverEndpoints[i].securityMode==channel->securityMode && + UA_ByteString_equal(&response->serverEndpoints[i].securityPolicyUri, + &channel->securityPolicy->policyUri) && + UA_String_equal(&response->serverEndpoints[i].endpointUrl, + &request->endpointUrl)) + { + response->responseHeader.serviceResult |= + UA_ByteString_copy(&response->serverEndpoints[i].serverCertificate, + &response->serverCertificate); + } + } + + /* Create a session nonce */ + response->responseHeader.serviceResult |= UA_Session_generateNonce(newSession); + response->responseHeader.serviceResult |= + UA_ByteString_copy(&newSession->serverNonce, &response->serverNonce); + + /* Sign the signature */ + response->responseHeader.serviceResult |= + signCreateSessionResponse(server, channel, request, response); + + /* Failure -> remove the session */ + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_Server_removeSessionByToken(server, &newSession->header.authenticationToken, + UA_DIAGNOSTICEVENT_REJECT); + return; + } + + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Session " UA_PRINTF_GUID_FORMAT " created", + UA_PRINTF_GUID_DATA(newSession->sessionId.identifier.guid)); +} + +static UA_StatusCode +checkSignature(const UA_Server *server, const UA_SecureChannel *channel, + UA_Session *session, const UA_ActivateSessionRequest *request) { + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + /* Check for zero signature length in client signature */ + if(request->clientSignature.signature.length == 0) + return UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID; + + if(!channel->securityPolicy) + return UA_STATUSCODE_BADINTERNALERROR; + + const UA_SecurityPolicy *securityPolicy = channel->securityPolicy; + const UA_ByteString *localCertificate = &securityPolicy->localCertificate; + + UA_ByteString dataToVerify; + size_t dataToVerifySize = localCertificate->length + session->serverNonce.length; + UA_StatusCode retval = UA_ByteString_allocBuffer(&dataToVerify, dataToVerifySize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + memcpy(dataToVerify.data, localCertificate->data, localCertificate->length); + memcpy(dataToVerify.data + localCertificate->length, + session->serverNonce.data, session->serverNonce.length); + retval = securityPolicy->certificateSigningAlgorithm. + verify(securityPolicy, channel->channelContext, &dataToVerify, + &request->clientSignature.signature); + UA_ByteString_clear(&dataToVerify); + return retval; +} + +#ifdef UA_ENABLE_ENCRYPTION +static UA_StatusCode +decryptPassword(UA_SecurityPolicy *securityPolicy, void *tempChannelContext, + const UA_ByteString *serverNonce, UA_UserNameIdentityToken *userToken) { + UA_SecurityPolicyEncryptionAlgorithm *asymEnc = + &securityPolicy->asymmetricModule.cryptoModule.encryptionAlgorithm; + if(!UA_String_equal(&userToken->encryptionAlgorithm, &asymEnc->uri)) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + UA_UInt32 tokenSecretLength; + UA_ByteString decryptedTokenSecret, tokenServerNonce; + size_t tokenpos = 0; + size_t offset = 0; + if(UA_ByteString_copy(&userToken->password, &decryptedTokenSecret) != UA_STATUSCODE_GOOD) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + UA_StatusCode retval = UA_STATUSCODE_BADIDENTITYTOKENINVALID; + if(asymEnc->decrypt(securityPolicy, tempChannelContext, + &decryptedTokenSecret) != UA_STATUSCODE_GOOD) + goto cleanup; + + UA_UInt32_decodeBinary(&decryptedTokenSecret, &offset, &tokenSecretLength); + + /* The decrypted data must be large enough to include the Encrypted Token + * Secret Format and the length field must indicate enough data to include + * the server nonce. */ + if(decryptedTokenSecret.length < sizeof(UA_UInt32) + serverNonce->length || + decryptedTokenSecret.length < sizeof(UA_UInt32) + tokenSecretLength || + tokenSecretLength < serverNonce->length) + goto cleanup; + + /* If the Encrypted Token Secret contains padding, the padding must be + * zeroes according to the 1.04.1 specification errata, chapter 3. */ + for(size_t i = sizeof(UA_UInt32) + tokenSecretLength; i < decryptedTokenSecret.length; i++) { + if(decryptedTokenSecret.data[i] != 0) + goto cleanup; + } + + /* The server nonce must match according to the 1.04.1 specification errata, + * chapter 3. */ + tokenpos = sizeof(UA_UInt32) + tokenSecretLength - serverNonce->length; + tokenServerNonce.length = serverNonce->length; + tokenServerNonce.data = &decryptedTokenSecret.data[tokenpos]; + if(!UA_ByteString_equal(serverNonce, &tokenServerNonce)) + goto cleanup; + + /* The password was decrypted successfully. Replace usertoken with the + * decrypted password. The encryptionAlgorithm and policyId fields are left + * in the UserToken as an indication for the AccessControl plugin that + * evaluates the decrypted content. */ + memcpy(userToken->password.data, &decryptedTokenSecret.data[sizeof(UA_UInt32)], + tokenSecretLength - serverNonce->length); + userToken->password.length = tokenSecretLength - serverNonce->length; + retval = UA_STATUSCODE_GOOD; + + cleanup: + UA_ByteString_clear(&decryptedTokenSecret); + return retval; +} +#endif + +static void +selectEndpointAndTokenPolicy(UA_Server *server, UA_SecureChannel *channel, + const UA_ExtensionObject *identityToken, + const UA_EndpointDescription **ed, + const UA_UserTokenPolicy **utp) { + for(size_t i = 0; i < server->config.endpointsSize; ++i) { + const UA_EndpointDescription *desc = &server->config.endpoints[i]; + + /* Match the Security Mode */ + if(desc->securityMode != channel->securityMode) + continue; + + /* Match the SecurityPolicy of the endpoint with the current channel */ + if(!UA_String_equal(&desc->securityPolicyUri, &channel->securityPolicy->policyUri)) + continue; + + /* Match the UserTokenType */ + const UA_DataType *tokenDataType = identityToken->content.decoded.type; + for(size_t j = 0; j < desc->userIdentityTokensSize; j++) { + const UA_UserTokenPolicy *pol = &desc->userIdentityTokens[j]; + + /* Part 4, Section 5.6.3.2, Table 17: A NULL or empty + * UserIdentityToken should be treated as Anonymous */ + if(identityToken->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY && + pol->tokenType == UA_USERTOKENTYPE_ANONYMOUS) { + *ed = desc; + *utp = pol; + return; + } + + /* Expect decoded content */ + if(!tokenDataType) + continue; + + if(pol->tokenType == UA_USERTOKENTYPE_ANONYMOUS) { + if(tokenDataType != &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]) + continue; + } else if(pol->tokenType == UA_USERTOKENTYPE_USERNAME) { + if(tokenDataType != &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]) + continue; + } else if(pol->tokenType == UA_USERTOKENTYPE_CERTIFICATE) { + if(tokenDataType != &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]) + continue; + } else if(pol->tokenType == UA_USERTOKENTYPE_ISSUEDTOKEN) { + if(tokenDataType != &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]) + continue; + } else { + continue; + } + + /* All valid token data types start with a string policyId */ + UA_AnonymousIdentityToken *token = (UA_AnonymousIdentityToken*) + identityToken->content.decoded.data; + + if(!UA_String_equal(&pol->policyId, &token->policyId)) + continue; + + /* Match found */ + *ed = desc; + *utp = pol; + return; + } + } +} + +/* TODO: Check all of the following: The Server shall verify that the + * Certificate the Client used to create the new SecureChannel is the same as + * the Certificate used to create the original SecureChannel. In addition, the + * Server shall verify that the Client supplied a UserIdentityToken that is + * identical to the token currently associated with the Session. Once the Server + * accepts the new SecureChannel it shall reject requests sent via the old + * SecureChannel. */ + +void +Service_ActivateSession(UA_Server *server, UA_SecureChannel *channel, + const UA_ActivateSessionRequest *request, + UA_ActivateSessionResponse *response) { + const UA_EndpointDescription *ed = NULL; + const UA_UserTokenPolicy *utp = NULL; + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_Session *session = getSessionByToken(server, &request->requestHeader.authenticationToken); + if(!session) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "ActivateSession: Session not found"); + response->responseHeader.serviceResult = UA_STATUSCODE_BADSESSIONIDINVALID; + goto rejected; + } + + /* Part 4, §5.6.3: When the ActivateSession Service is called for the + * first time then the Server shall reject the request if the + * SecureChannel is not same as the one associated with the + * CreateSession request. Subsequent calls to ActivateSession may be + * associated with different SecureChannels. */ + if(!session->activated && session->header.channel != channel) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "ActivateSession: The Session has to be initially activated " + "on the SecureChannel that created it"); + response->responseHeader.serviceResult = UA_STATUSCODE_BADSESSIONIDINVALID; + goto rejected; + } + + /* Has the session timed out? */ + if(session->validTill < UA_DateTime_nowMonotonic()) { + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "ActivateSession: The Session has timed out"); + response->responseHeader.serviceResult = UA_STATUSCODE_BADSESSIONIDINVALID; + goto rejected; + } + + /* Check if the signature corresponds to the ServerNonce that was last sent + * to the client */ + response->responseHeader.serviceResult = checkSignature(server, channel, session, request); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "ActivateSession: Signature check failed with StatusCode %s", + UA_StatusCode_name(response->responseHeader.serviceResult)); + goto securityRejected; + } + + /* Find the matching Endpoint with UserTokenPolicy */ + selectEndpointAndTokenPolicy(server, channel, &request->userIdentityToken, &ed, &utp); + if(!ed) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADIDENTITYTOKENINVALID; + goto rejected; + } + + /* If it is a UserNameIdentityToken, the password may be encrypted */ + if(utp->tokenType == UA_USERTOKENTYPE_USERNAME) { + UA_UserNameIdentityToken *userToken = (UA_UserNameIdentityToken *) + request->userIdentityToken.content.decoded.data; + + /* If the userTokenPolicy doesn't specify a security policy the security + * policy of the secure channel is used. */ + UA_SecurityPolicy* securityPolicy; + if(!utp->securityPolicyUri.data) + securityPolicy = UA_SecurityPolicy_getSecurityPolicyByUri(server, &ed->securityPolicyUri); + else + securityPolicy = UA_SecurityPolicy_getSecurityPolicyByUri(server, &utp->securityPolicyUri); + if(!securityPolicy) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + goto rejected; + } + + /* Test if the encryption algorithm is correctly specified */ + if(!UA_String_equal(&userToken->encryptionAlgorithm, + &securityPolicy->asymmetricModule.cryptoModule.encryptionAlgorithm.uri)) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADIDENTITYTOKENINVALID; + goto securityRejected; + } + +#ifdef UA_ENABLE_ENCRYPTION + /* Encrypted password? */ + if(!UA_String_equal(&securityPolicy->policyUri, &UA_SECURITY_POLICY_NONE_URI)) { + /* Create a temporary channel context if a different SecurityPolicy is + * used for the password from the SecureChannel */ + void *tempChannelContext = channel->channelContext; + if(securityPolicy != channel->securityPolicy) { + /* TODO: This is a hack. We use our own certificate to create a + * channel context. Because the client does not provide one in a + * #None SecureChannel. We should not need a ChannelContext at all + * for asymmetric decryption where the remote certificate is not + * used. */ + response->responseHeader.serviceResult = + securityPolicy->channelModule. + newContext(securityPolicy, &securityPolicy->localCertificate, + &tempChannelContext); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SESSION(&server->config.logger, session, "ActivateSession: " + "Failed to create a context for the SecurityPolicy %.*s", + (int)securityPolicy->policyUri.length, + securityPolicy->policyUri.data); + goto rejected; + } + } + + /* Decrypt */ + response->responseHeader.serviceResult = + decryptPassword(securityPolicy, tempChannelContext, &session->serverNonce, userToken); + + /* Remove the temporary channel context */ + if(securityPolicy != channel->securityPolicy) + securityPolicy->channelModule.deleteContext(tempChannelContext); + } + /* If SecurityPolicy is None there shall be no EncryptionAlgorithm */ + else if( userToken->encryptionAlgorithm.length != 0 ) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADIDENTITYTOKENINVALID; + return; + } + + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SESSION(&server->config.logger, session, "ActivateSession: " + "Failed to decrypt the password with the StatusCode %s", + UA_StatusCode_name(response->responseHeader.serviceResult)); + goto securityRejected; + } +#endif + } + + /* Callback into userland access control */ + response->responseHeader.serviceResult = + server->config.accessControl. + activateSession(server, &server->config.accessControl, ed, &channel->remoteCertificate, + &session->sessionId, &request->userIdentityToken, &session->sessionHandle); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SESSION(&server->config.logger, session, "ActivateSession: The AccessControl " + "plugin denied the activation with the StatusCode %s", + UA_StatusCode_name(response->responseHeader.serviceResult)); + goto rejected; + } + + /* Attach the session to the currently used channel if the session isn't + * attached to a channel or if the session is activated on a different + * channel than it is attached to. */ + if(!session->header.channel || session->header.channel != channel) { + /* Attach the new SecureChannel, the old channel will be detached if present */ + UA_Session_attachToSecureChannel(session, channel); + UA_LOG_INFO_SESSION(&server->config.logger, session, + "ActivateSession: Session attached to new channel"); + } + + /* Generate a new session nonce for the next time ActivateSession is called */ + response->responseHeader.serviceResult = UA_Session_generateNonce(session); + response->responseHeader.serviceResult |= + UA_ByteString_copy(&session->serverNonce, &response->serverNonce); + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_Session_detachFromSecureChannel(session); + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "ActivateSession: Could not generate the server nonce"); + goto rejected; + } + + UA_Session_updateLifetime(session); + + /* Activate the session */ + if(!session->activated) { + session->activated = true; + UA_atomic_addSize(&server->serverStats.ss.currentSessionCount, 1); + UA_atomic_addSize(&server->serverStats.ss.cumulatedSessionCount, 1); + } + + UA_LOG_INFO_SESSION(&server->config.logger, session, "ActivateSession: Session activated"); + return; + +securityRejected: + UA_atomic_addSize(&server->serverStats.ss.securityRejectedSessionCount, 1); +rejected: + UA_atomic_addSize(&server->serverStats.ss.rejectedSessionCount, 1); +} + +void +Service_CloseSession(UA_Server *server, UA_SecureChannel *channel, + const UA_CloseSessionRequest *request, + UA_CloseSessionResponse *response) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Part 4, 5.6.4: When the CloseSession Service is called before the Session + * is successfully activated, the Server shall reject the request if the + * SecureChannel is not the same as the one associated with the + * CreateSession request. + * + * A non-activated Session is already bound to the SecureChannel that + * created the Session. */ + UA_Session *session = NULL; + response->responseHeader.serviceResult = + getBoundSession(server, channel, &request->requestHeader.authenticationToken, &session); + if(!session && response->responseHeader.serviceResult == UA_STATUSCODE_GOOD) + response->responseHeader.serviceResult = UA_STATUSCODE_BADSESSIONIDINVALID; + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&server->config.logger, channel, + "CloseSession: No Session activated to the SecureChannel"); + return; + } + + UA_assert(session); /* Assured by the previous section */ + UA_LOG_INFO_SESSION(&server->config.logger, session, "Closing the Session"); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* If Subscriptions are not deleted, detach them from the Session */ + if(!request->deleteSubscriptions) { + UA_Subscription *sub, *sub_tmp; + TAILQ_FOREACH_SAFE(sub, &session->subscriptions, sessionListEntry, sub_tmp) { + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, sub, + "Detaching the Subscription from the Session"); + UA_Session_detachSubscription(server, session, sub); + } + } +#endif + + /* Remove the sesison */ + response->responseHeader.serviceResult = + UA_Server_removeSessionByToken(server, &session->header.authenticationToken, + UA_DIAGNOSTICEVENT_CLOSE); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_attribute.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2015 (c) Christian Fimmers + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2015 (c) wuyangtang + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Thomas Bender + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017-2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2017 (c) Henrik Norrman + * Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart (for VDW and umati) + */ + + +#ifdef UA_ENABLE_HISTORIZING +#endif + +/******************/ +/* Access Control */ +/******************/ + +/* Session for read operations can be NULL. For example for a MonitoredItem + * where the underlying Subscription was detached during CloseSession. */ + +static UA_UInt32 +getUserWriteMask(UA_Server *server, const UA_Session *session, + const UA_NodeHead *head) { + if(session == &server->adminSession) + return 0xFFFFFFFF; /* the local admin user has all rights */ + UA_UInt32 mask = head->writeMask; + UA_UNLOCK(server->serviceMutex); + mask &= server->config.accessControl. + getUserRightsMask(server, &server->config.accessControl, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &head->nodeId, head->context); + UA_LOCK(server->serviceMutex); + return mask; +} + +static UA_Byte +getAccessLevel(UA_Server *server, const UA_Session *session, + const UA_VariableNode *node) { + if(session == &server->adminSession) + return 0xFF; /* the local admin user has all rights */ + return node->accessLevel; +} + +static UA_Byte +getUserAccessLevel(UA_Server *server, const UA_Session *session, + const UA_VariableNode *node) { + if(session == &server->adminSession) + return 0xFF; /* the local admin user has all rights */ + UA_Byte retval = node->accessLevel; + UA_UNLOCK(server->serviceMutex); + retval &= server->config.accessControl. + getUserAccessLevel(server, &server->config.accessControl, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &node->head.nodeId, node->head.context); + UA_LOCK(server->serviceMutex); + return retval; +} + +static UA_Boolean +getUserExecutable(UA_Server *server, const UA_Session *session, + const UA_MethodNode *node) { + if(session == &server->adminSession) + return true; /* the local admin user has all rights */ + UA_UNLOCK(server->serviceMutex); + UA_Boolean userExecutable = node->executable; + userExecutable &= + server->config.accessControl. + getUserExecutable(server, &server->config.accessControl, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &node->head.nodeId, node->head.context); + UA_LOCK(server->serviceMutex); + return userExecutable; +} + +/****************/ +/* Read Service */ +/****************/ + +static UA_StatusCode +readIsAbstractAttribute(const UA_Node *node, UA_Variant *v) { + const UA_Boolean *isAbstract; + switch(node->head.nodeClass) { + case UA_NODECLASS_REFERENCETYPE: + isAbstract = &node->referenceTypeNode.isAbstract; + break; + case UA_NODECLASS_OBJECTTYPE: + isAbstract = &node->objectTypeNode.isAbstract; + break; + case UA_NODECLASS_VARIABLETYPE: + isAbstract = &node->variableTypeNode.isAbstract; + break; + case UA_NODECLASS_DATATYPE: + isAbstract = &node->dataTypeNode.isAbstract; + break; + default: + return UA_STATUSCODE_BADATTRIBUTEIDINVALID; + } + + return UA_Variant_setScalarCopy(v, isAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_StatusCode +readValueAttributeFromNode(UA_Server *server, UA_Session *session, + const UA_VariableNode *vn, UA_DataValue *v, + UA_NumericRange *rangeptr) { + /* Update the value by the user callback */ + if(vn->value.data.callback.onRead) { + UA_UNLOCK(server->serviceMutex); + vn->value.data.callback.onRead(server, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &vn->head.nodeId, vn->head.context, rangeptr, + &vn->value.data.value); + UA_LOCK(server->serviceMutex); + vn = (const UA_VariableNode*)UA_NODESTORE_GET(server, &vn->head.nodeId); + if(!vn) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + } + + /* Set the result */ + if(rangeptr) + return UA_Variant_copyRange(&vn->value.data.value.value, &v->value, *rangeptr); + UA_StatusCode retval = UA_DataValue_copy(&vn->value.data.value, v); + + /* Clean up */ + if(vn->value.data.callback.onRead) + UA_NODESTORE_RELEASE(server, (const UA_Node *)vn); + return retval; +} + +static UA_StatusCode +readValueAttributeFromDataSource(UA_Server *server, UA_Session *session, + const UA_VariableNode *vn, UA_DataValue *v, + UA_TimestampsToReturn timestamps, + UA_NumericRange *rangeptr) { + if(!vn->value.dataSource.read) + return UA_STATUSCODE_BADINTERNALERROR; + UA_Boolean sourceTimeStamp = (timestamps == UA_TIMESTAMPSTORETURN_SOURCE || + timestamps == UA_TIMESTAMPSTORETURN_BOTH); + UA_DataValue v2; + UA_DataValue_init(&v2); + UA_UNLOCK(server->serviceMutex); + UA_StatusCode retval = vn->value.dataSource. + read(server, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &vn->head.nodeId, vn->head.context, + sourceTimeStamp, rangeptr, &v2); + UA_LOCK(server->serviceMutex); + if(v2.hasValue && v2.value.storageType == UA_VARIANT_DATA_NODELETE) { + retval = UA_DataValue_copy(&v2, v); + UA_DataValue_clear(&v2); + } else { + *v = v2; + } + return retval; +} + +static UA_StatusCode +readValueAttributeComplete(UA_Server *server, UA_Session *session, + const UA_VariableNode *vn, UA_TimestampsToReturn timestamps, + const UA_String *indexRange, UA_DataValue *v) { + /* Compute the index range */ + UA_NumericRange range; + UA_NumericRange *rangeptr = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(indexRange && indexRange->length > 0) { + retval = UA_NumericRange_parse(&range, *indexRange); + if(retval != UA_STATUSCODE_GOOD) + return retval; + rangeptr = ⦥ + } + + switch(vn->valueBackend.backendType) { + case UA_VALUEBACKENDTYPE_INTERNAL: + retval = readValueAttributeFromNode(server, session, vn, v, rangeptr); + //TODO change old structure to value backend + break; + case UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK: + retval = readValueAttributeFromDataSource(server, session, vn, v, + timestamps, rangeptr); + //TODO change old structure to value backend + break; + case UA_VALUEBACKENDTYPE_EXTERNAL: + if(vn->valueBackend.backend.external.callback.notificationRead){ + retval = vn->valueBackend.backend.external.callback. + notificationRead(server, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &vn->head.nodeId, vn->head.context, rangeptr); + } else { + retval = UA_STATUSCODE_BADNOTREADABLE; + } + if(retval != UA_STATUSCODE_GOOD){ + retval = UA_STATUSCODE_BADNOTREADABLE; + break; + } + /* Set the result */ + if(rangeptr) + return UA_Variant_copyRange( + (const UA_Variant *)&vn->valueBackend.backend.external.value, + &v->value, *rangeptr); + UA_DataValue_copy(*vn->valueBackend.backend.external.value, v); + break; + case UA_VALUEBACKENDTYPE_NONE: + /* Read the value */ + if(vn->valueSource == UA_VALUESOURCE_DATA) + retval = readValueAttributeFromNode(server, session, vn, v, rangeptr); + else + retval = readValueAttributeFromDataSource(server, session, vn, v, + timestamps, rangeptr); + /* end lagacy */ + break; + } + + /* Static Variables and VariableTypes have timestamps of "now". Will be set + * below in the absence of predefined timestamps. */ + if(vn->head.nodeClass == UA_NODECLASS_VARIABLE) { + if(!vn->isDynamic) { + v->hasServerTimestamp = false; + v->hasSourceTimestamp = false; + } + } else { + v->hasServerTimestamp = false; + v->hasSourceTimestamp = false; + } + + /* Clean up */ + if(rangeptr) + UA_free(range.dimensions); + return retval; +} + +UA_StatusCode +readValueAttribute(UA_Server *server, UA_Session *session, + const UA_VariableNode *vn, UA_DataValue *v) { + return readValueAttributeComplete(server, session, vn, + UA_TIMESTAMPSTORETURN_NEITHER, NULL, v); +} + +static const UA_String binEncoding = {sizeof("Default Binary")-1, (UA_Byte*)"Default Binary"}; +static const UA_String xmlEncoding = {sizeof("Default XML")-1, (UA_Byte*)"Default XML"}; +static const UA_String jsonEncoding = {sizeof("Default JSON")-1, (UA_Byte*)"Default JSON"}; + +#define CHECK_NODECLASS(CLASS) \ + if(!(node->head.nodeClass & (CLASS))) { \ + retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID; \ + break; \ + } + +#ifdef UA_ENABLE_TYPEDESCRIPTION +static const UA_DataType * +findDataType(const UA_Node *node, const UA_DataTypeArray *customTypes) { + for(size_t i = 0; i < UA_TYPES_COUNT; ++i) { + if(UA_NodeId_equal(&UA_TYPES[i].typeId, &node->head.nodeId)) { + return &UA_TYPES[i]; + } + } + + // lookup custom type + while(customTypes) { + for(size_t i = 0; i < customTypes->typesSize; ++i) { + if(UA_NodeId_equal(&customTypes->types[i].typeId, &node->head.nodeId)) + return &customTypes->types[i]; + } + customTypes = customTypes->next; + } + return NULL; +} + +static UA_StatusCode +getStructureDefinition(const UA_DataType *type, UA_StructureDefinition *def) { + UA_StatusCode retval = + UA_NodeId_copy(&type->binaryEncodingId, &def->defaultEncodingId); + if(retval != UA_STATUSCODE_GOOD) + return retval; + switch(type->typeKind) { + case UA_DATATYPEKIND_STRUCTURE: + def->structureType = UA_STRUCTURETYPE_STRUCTURE; + def->baseDataType = UA_NODEID_NUMERIC(0, UA_NS0ID_STRUCTURE); + break; + case UA_DATATYPEKIND_OPTSTRUCT: + def->structureType = UA_STRUCTURETYPE_STRUCTUREWITHOPTIONALFIELDS; + def->baseDataType = UA_NODEID_NUMERIC(0, UA_NS0ID_STRUCTURE); + break; + case UA_DATATYPEKIND_UNION: + def->structureType = UA_STRUCTURETYPE_UNION; + def->baseDataType = UA_NODEID_NUMERIC(0, UA_NS0ID_UNION); + break; + default: + return UA_STATUSCODE_BADENCODINGERROR; + } + def->fieldsSize = type->membersSize; + def->fields = (UA_StructureField *) + UA_calloc(def->fieldsSize, sizeof(UA_StructureField)); + if(!def->fields) { + UA_NodeId_clear(&def->defaultEncodingId); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + const UA_DataType *typelists[2] = {UA_TYPES, &type[-type->typeIndex]}; + for(size_t cnt = 0; cnt < def->fieldsSize; cnt++) { + const UA_DataTypeMember *m = &type->members[cnt]; + def->fields[cnt].valueRank = UA_TRUE == m->isArray ? 1 : -1; + def->fields[cnt].arrayDimensions = NULL; + def->fields[cnt].arrayDimensionsSize = 0; + def->fields[cnt].name = UA_STRING((char *)(uintptr_t)m->memberName); + def->fields[cnt].description.locale = UA_STRING_NULL; + def->fields[cnt].description.text = UA_STRING_NULL; + def->fields[cnt].dataType = typelists[!m->namespaceZero][m->memberTypeIndex].typeId; + def->fields[cnt].maxStringLength = 0; + def->fields[cnt].isOptional = m->isOptional; + } + return UA_STATUSCODE_GOOD; +} +#endif + +/* Returns a datavalue that may point into the node via the + * UA_VARIANT_DATA_NODELETE tag. Don't access the returned DataValue once the + * node has been released! */ +void +ReadWithNode(const UA_Node *node, UA_Server *server, UA_Session *session, + UA_TimestampsToReturn timestampsToReturn, + const UA_ReadValueId *id, UA_DataValue *v) { + UA_LOG_NODEID_DEBUG(&node->head.nodeId, + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Read attribute %"PRIi32 " of Node %.*s", + id->attributeId, (int)nodeIdStr.length, + nodeIdStr.data)); + + /* Only Binary Encoding is supported */ + if(id->dataEncoding.name.length > 0 && + !UA_String_equal(&binEncoding, &id->dataEncoding.name)) { + if(UA_String_equal(&xmlEncoding, &id->dataEncoding.name) || + UA_String_equal(&jsonEncoding, &id->dataEncoding.name)) + v->status = UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED; + else + v->status = UA_STATUSCODE_BADDATAENCODINGINVALID; + v->hasStatus = true; + return; + } + + /* Index range for an attribute other than value */ + if(id->indexRange.length > 0 && id->attributeId != UA_ATTRIBUTEID_VALUE) { + v->hasStatus = true; + v->status = UA_STATUSCODE_BADINDEXRANGENODATA; + return; + } + + /* Read the attribute */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + switch(id->attributeId) { + case UA_ATTRIBUTEID_NODEID: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.nodeId, + &UA_TYPES[UA_TYPES_NODEID]); + break; + case UA_ATTRIBUTEID_NODECLASS: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.nodeClass, + &UA_TYPES[UA_TYPES_NODECLASS]); + break; + case UA_ATTRIBUTEID_BROWSENAME: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.browseName, + &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); + break; + case UA_ATTRIBUTEID_DISPLAYNAME: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.displayName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); + break; + case UA_ATTRIBUTEID_DESCRIPTION: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.description, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); + break; + case UA_ATTRIBUTEID_WRITEMASK: + retval = UA_Variant_setScalarCopy(&v->value, &node->head.writeMask, + &UA_TYPES[UA_TYPES_UINT32]); + break; + case UA_ATTRIBUTEID_USERWRITEMASK: { + UA_UInt32 userWriteMask = getUserWriteMask(server, session, &node->head); + retval = UA_Variant_setScalarCopy(&v->value, &userWriteMask, + &UA_TYPES[UA_TYPES_UINT32]); + break; } + case UA_ATTRIBUTEID_ISABSTRACT: + retval = readIsAbstractAttribute(node, &v->value); + break; + case UA_ATTRIBUTEID_SYMMETRIC: + CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE); + retval = UA_Variant_setScalarCopy(&v->value, &node->referenceTypeNode.symmetric, + &UA_TYPES[UA_TYPES_BOOLEAN]); + break; + case UA_ATTRIBUTEID_INVERSENAME: + CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE); + retval = UA_Variant_setScalarCopy(&v->value, &node->referenceTypeNode.inverseName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); + break; + case UA_ATTRIBUTEID_CONTAINSNOLOOPS: + CHECK_NODECLASS(UA_NODECLASS_VIEW); + retval = UA_Variant_setScalarCopy(&v->value, &node->viewNode.containsNoLoops, + &UA_TYPES[UA_TYPES_BOOLEAN]); + break; + case UA_ATTRIBUTEID_EVENTNOTIFIER: + CHECK_NODECLASS(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT); + if(node->head.nodeClass == UA_NODECLASS_VIEW) { + retval = UA_Variant_setScalarCopy(&v->value, &node->viewNode.eventNotifier, + &UA_TYPES[UA_TYPES_BYTE]); + } else { + retval = UA_Variant_setScalarCopy(&v->value, &node->objectNode.eventNotifier, + &UA_TYPES[UA_TYPES_BYTE]); + } + break; + case UA_ATTRIBUTEID_VALUE: { + CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + /* VariableTypes don't have the AccessLevel concept. Always allow + * reading the value. */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE) { + /* The access to a value variable is granted via the AccessLevel + * and UserAccessLevel attributes */ + UA_Byte accessLevel = getAccessLevel(server, session, &node->variableNode); + if(!(accessLevel & (UA_ACCESSLEVELMASK_READ))) { + retval = UA_STATUSCODE_BADNOTREADABLE; + break; + } + accessLevel = getUserAccessLevel(server, session, &node->variableNode); + if(!(accessLevel & (UA_ACCESSLEVELMASK_READ))) { + retval = UA_STATUSCODE_BADUSERACCESSDENIED; + break; + } + } + retval = readValueAttributeComplete(server, session, &node->variableNode, + timestampsToReturn, &id->indexRange, v); + break; + } + case UA_ATTRIBUTEID_DATATYPE: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + retval = UA_Variant_setScalarCopy(&v->value, &node->variableTypeNode.dataType, + &UA_TYPES[UA_TYPES_NODEID]); + break; + case UA_ATTRIBUTEID_VALUERANK: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + retval = UA_Variant_setScalarCopy(&v->value, &node->variableTypeNode.valueRank, + &UA_TYPES[UA_TYPES_INT32]); + break; + case UA_ATTRIBUTEID_ARRAYDIMENSIONS: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + retval = UA_Variant_setArrayCopy(&v->value, node->variableTypeNode.arrayDimensions, + node->variableTypeNode.arrayDimensionsSize, + &UA_TYPES[UA_TYPES_UINT32]); + break; + case UA_ATTRIBUTEID_ACCESSLEVEL: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE); + retval = UA_Variant_setScalarCopy(&v->value, &node->variableNode.accessLevel, + &UA_TYPES[UA_TYPES_BYTE]); + break; + case UA_ATTRIBUTEID_USERACCESSLEVEL: { + CHECK_NODECLASS(UA_NODECLASS_VARIABLE); + UA_Byte userAccessLevel = getUserAccessLevel(server, session, &node->variableNode); + retval = UA_Variant_setScalarCopy(&v->value, &userAccessLevel, + &UA_TYPES[UA_TYPES_BYTE]); + break; } + case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE); + retval = UA_Variant_setScalarCopy(&v->value, + &node->variableNode.minimumSamplingInterval, + &UA_TYPES[UA_TYPES_DOUBLE]); + break; + case UA_ATTRIBUTEID_HISTORIZING: + CHECK_NODECLASS(UA_NODECLASS_VARIABLE); + retval = UA_Variant_setScalarCopy(&v->value, &node->variableNode.historizing, + &UA_TYPES[UA_TYPES_BOOLEAN]); + break; + case UA_ATTRIBUTEID_EXECUTABLE: + CHECK_NODECLASS(UA_NODECLASS_METHOD); + retval = UA_Variant_setScalarCopy(&v->value, &node->methodNode.executable, + &UA_TYPES[UA_TYPES_BOOLEAN]); + break; + case UA_ATTRIBUTEID_USEREXECUTABLE: { + CHECK_NODECLASS(UA_NODECLASS_METHOD); + UA_Boolean userExecutable = + getUserExecutable(server, session, &node->methodNode); + retval = UA_Variant_setScalarCopy(&v->value, &userExecutable, + &UA_TYPES[UA_TYPES_BOOLEAN]); + break; } + case UA_ATTRIBUTEID_DATATYPEDEFINITION: { + CHECK_NODECLASS(UA_NODECLASS_DATATYPE); + +#ifdef UA_ENABLE_TYPEDESCRIPTION + const UA_DataType *type = + findDataType(node, server->config.customDataTypes); + if(!type) { + retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID; + break; + } + + if(UA_DATATYPEKIND_STRUCTURE == type->typeKind || + UA_DATATYPEKIND_OPTSTRUCT == type->typeKind || + UA_DATATYPEKIND_UNION == type->typeKind) { + UA_StructureDefinition def; + retval = getStructureDefinition(type, &def); + if(UA_STATUSCODE_GOOD!=retval) + break; + retval = UA_Variant_setScalarCopy(&v->value, &def, + &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); + UA_free(def.fields); + break; + } +#endif + retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID; + break; } + default: + retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID; + } + + if(retval != UA_STATUSCODE_GOOD) { + /* Reading has failed but can not return because we may need to add timestamp */ + v->hasStatus = true; + v->status = retval; + } else { + v->hasValue = true; + } + + /* Create server timestamp */ + if(timestampsToReturn == UA_TIMESTAMPSTORETURN_SERVER || + timestampsToReturn == UA_TIMESTAMPSTORETURN_BOTH) { + if(!v->hasServerTimestamp) { + v->serverTimestamp = UA_DateTime_now(); + v->hasServerTimestamp = true; + } + } else { + /* In case the ServerTimestamp has been set manually */ + v->hasServerTimestamp = false; + } + + /* Handle source time stamp */ + if(id->attributeId == UA_ATTRIBUTEID_VALUE) { + if(timestampsToReturn == UA_TIMESTAMPSTORETURN_SERVER || + timestampsToReturn == UA_TIMESTAMPSTORETURN_NEITHER) { + v->hasSourceTimestamp = false; + v->hasSourcePicoseconds = false; + } else if(!v->hasSourceTimestamp) { + v->sourceTimestamp = UA_DateTime_now(); + v->hasSourceTimestamp = true; + } + } +} + +static void +Operation_Read(UA_Server *server, UA_Session *session, UA_ReadRequest *request, + UA_ReadValueId *rvi, UA_DataValue *result) { + /* Get the node */ + const UA_Node *node = UA_NODESTORE_GET(server, &rvi->nodeId); + + /* Perform the read operation */ + if(node) { + ReadWithNode(node, server, session, request->timestampsToReturn, rvi, result); + UA_NODESTORE_RELEASE(server, node); + } else { + result->hasStatus = true; + result->status = UA_STATUSCODE_BADNODEIDUNKNOWN; + } +} + +void +Service_Read(UA_Server *server, UA_Session *session, + const UA_ReadRequest *request, UA_ReadResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing ReadRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Check if the timestampstoreturn is valid */ + if(request->timestampsToReturn > UA_TIMESTAMPSTORETURN_NEITHER) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID; + return; + } + + /* Check if maxAge is valid */ + if(request->maxAge < 0) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADMAXAGEINVALID; + return; + } + + /* Check if there are too many operations */ + if(server->config.maxNodesPerRead != 0 && + request->nodesToReadSize > server->config.maxNodesPerRead) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + UA_LOCK_ASSERT(server->serviceMutex, 1); + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_Read, + request, &request->nodesToReadSize, + &UA_TYPES[UA_TYPES_READVALUEID], + &response->resultsSize, + &UA_TYPES[UA_TYPES_DATAVALUE]); +} + +UA_DataValue +UA_Server_readWithSession(UA_Server *server, UA_Session *session, + const UA_ReadValueId *item, + UA_TimestampsToReturn timestampsToReturn) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_DataValue dv; + UA_DataValue_init(&dv); + + /* Get the node */ + const UA_Node *node = UA_NODESTORE_GET(server, &item->nodeId); + if(!node) { + dv.hasStatus = true; + dv.status = UA_STATUSCODE_BADNODEIDUNKNOWN; + return dv; + } + + /* Perform the read operation */ + ReadWithNode(node, server, session, timestampsToReturn, item, &dv); + + /* Release the node and return */ + UA_NODESTORE_RELEASE(server, node); + return dv; +} + +UA_DataValue +readAttribute(UA_Server *server, const UA_ReadValueId *item, + UA_TimestampsToReturn timestamps) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + return UA_Server_readWithSession(server, &server->adminSession, item, timestamps); +} + +UA_StatusCode +readWithReadValue(UA_Server *server, const UA_NodeId *nodeId, + const UA_AttributeId attributeId, void *v) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Call the read service */ + UA_ReadValueId item; + UA_ReadValueId_init(&item); + item.nodeId = *nodeId; + item.attributeId = attributeId; + UA_DataValue dv = readAttribute(server, &item, UA_TIMESTAMPSTORETURN_NEITHER); + + /* Check the return value */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(dv.hasStatus) + retval = dv.status; + else if(!dv.hasValue) + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + if(retval != UA_STATUSCODE_GOOD) { + UA_DataValue_clear(&dv); + return retval; + } + + if(attributeId == UA_ATTRIBUTEID_VALUE || + attributeId == UA_ATTRIBUTEID_ARRAYDIMENSIONS) { + /* Return the entire variant */ + memcpy(v, &dv.value, sizeof(UA_Variant)); + } else { + /* Return the variant content only */ + memcpy(v, dv.value.data, dv.value.type->memSize); + UA_free(dv.value.data); + } + return retval; +} + +/* Exposes the Read service to local users */ +UA_DataValue +UA_Server_read(UA_Server *server, const UA_ReadValueId *item, + UA_TimestampsToReturn timestamps) { + UA_LOCK(server->serviceMutex); + UA_DataValue dv = readAttribute(server, item, timestamps); + UA_UNLOCK(server->serviceMutex); + return dv; +} + +/* Used in inline functions exposing the Read service with more syntactic sugar + * for individual attributes */ +UA_StatusCode +__UA_Server_read(UA_Server *server, const UA_NodeId *nodeId, + const UA_AttributeId attributeId, void *v) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = readWithReadValue(server, nodeId, attributeId, v); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +readObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + UA_Variant *value) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Create a BrowsePath to get the target NodeId */ + UA_RelativePathElement rpe; + UA_RelativePathElement_init(&rpe); + rpe.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY); + rpe.isInverse = false; + rpe.includeSubtypes = false; + rpe.targetName = propertyName; + + UA_BrowsePath bp; + UA_BrowsePath_init(&bp); + bp.startingNode = objectId; + bp.relativePath.elementsSize = 1; + bp.relativePath.elements = &rpe; + + UA_StatusCode retval; + UA_BrowsePathResult bpr = translateBrowsePathToNodeIds(server, &bp); + if(bpr.statusCode != UA_STATUSCODE_GOOD || bpr.targetsSize < 1) { + retval = bpr.statusCode; + UA_BrowsePathResult_clear(&bpr); + return retval; + } + + /* Use the first result from the BrowsePath */ + retval = readWithReadValue(server, &bpr.targets[0].targetId.nodeId, + UA_ATTRIBUTEID_VALUE, value); + + UA_BrowsePathResult_clear(&bpr); + return retval; +} + + +UA_StatusCode +UA_Server_readObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + UA_Variant *value) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = readObjectProperty(server, objectId, propertyName, value); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/*****************/ +/* Type Checking */ +/*****************/ + +static UA_DataTypeKind +typeEquivalence(const UA_DataType *t) { + UA_DataTypeKind k = (UA_DataTypeKind)t->typeKind; + if(k == UA_DATATYPEKIND_ENUM) + return UA_DATATYPEKIND_INT32; + return k; +} + +static const UA_NodeId enumNodeId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_ENUMERATION}}; + +UA_Boolean +compatibleValueDataType(UA_Server *server, const UA_DataType *dataType, + const UA_NodeId *constraintDataType) { + if(compatibleDataTypes(server, &dataType->typeId, constraintDataType)) + return true; + + /* For actual values, the constraint DataType may be a subtype of the + * DataType of the value. E.g. UtcTime is subtype of DateTime. But it still + * is a DateTime value when transferred over the wire. */ + if(isNodeInTree_singleRef(server, constraintDataType, &dataType->typeId, + UA_REFERENCETYPEINDEX_HASSUBTYPE)) + return true; + + return false; +} + +UA_Boolean +compatibleDataTypes(UA_Server *server, const UA_NodeId *dataType, + const UA_NodeId *constraintDataType) { + /* Do not allow empty datatypes */ + if(UA_NodeId_isNull(dataType)) + return false; + + /* No constraint or Variant / BaseDataType which allows any content */ + if(UA_NodeId_isNull(constraintDataType) || + UA_NodeId_equal(constraintDataType, &UA_TYPES[UA_TYPES_VARIANT].typeId)) + return true; + + /* Same datatypes */ + if(UA_NodeId_equal(dataType, constraintDataType)) + return true; + + /* Is the DataType a subtype of the constraint type? */ + if(isNodeInTree_singleRef(server, dataType, constraintDataType, + UA_REFERENCETYPEINDEX_HASSUBTYPE)) + return true; + + /* The constraint is an enum -> allow writing Int32 */ + if(UA_NodeId_equal(dataType, &UA_TYPES[UA_TYPES_INT32].typeId) && + isNodeInTree_singleRef(server, constraintDataType, &enumNodeId, + UA_REFERENCETYPEINDEX_HASSUBTYPE)) + return true; + + return false; +} + +/* Test whether a ValueRank and the given arraydimensions are compatible. + * + * 5.6.2 Variable NodeClass: If the maximum is unknown the value shall be 0. The + * number of elements shall be equal to the value of the ValueRank Attribute. + * This Attribute shall be null if ValueRank <= 0. */ +UA_Boolean +compatibleValueRankArrayDimensions(UA_Server *server, UA_Session *session, + UA_Int32 valueRank, size_t arrayDimensionsSize) { + /* ValueRank invalid */ + if(valueRank < UA_VALUERANK_SCALAR_OR_ONE_DIMENSION) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "The ValueRank is invalid (< -3)"); + return false; + } + + /* case -3, UA_VALUERANK_SCALAR_OR_ONE_DIMENSION: the value can be a scalar + * or a one dimensional array + * case -2, UA_VALUERANK_ANY: the value can be a scalar or an array with any + * number of dimensions + * case -1, UA_VALUERANK_SCALAR: the value is a scalar + * case 0, UA_VALUERANK_ONE_OR_MORE_DIMENSIONS: the value is an array with + * one or more dimensions */ + if(valueRank <= UA_VALUERANK_ONE_OR_MORE_DIMENSIONS) { + if(arrayDimensionsSize > 0) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "No ArrayDimensions can be defined for a ValueRank <= 0"); + return false; + } + return true; + } + + /* case >= 1, UA_VALUERANK_ONE_DIMENSION: the value is an array with the + specified number of dimensions */ + if(arrayDimensionsSize != (size_t)valueRank) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "The number of ArrayDimensions is not equal to " + "the (positive) ValueRank"); + return false; + } + return true; +} + +UA_Boolean +compatibleValueRanks(UA_Int32 valueRank, UA_Int32 constraintValueRank) { + /* Check if the valuerank of the variabletype allows the change. */ + switch(constraintValueRank) { + case UA_VALUERANK_SCALAR_OR_ONE_DIMENSION: /* the value can be a scalar or a + one dimensional array */ + if(valueRank != UA_VALUERANK_SCALAR && valueRank != UA_VALUERANK_ONE_DIMENSION) + return false; + break; + case UA_VALUERANK_ANY: /* the value can be a scalar or an array with any + number of dimensions */ + break; + case UA_VALUERANK_SCALAR: /* the value is a scalar */ + if(valueRank != UA_VALUERANK_SCALAR) + return false; + break; + case UA_VALUERANK_ONE_OR_MORE_DIMENSIONS: /* the value is an array with one + or more dimensions */ + if(valueRank < (UA_Int32) UA_VALUERANK_ONE_OR_MORE_DIMENSIONS) + return false; + break; + default: /* >= 1: the value is an array with the specified number of + dimensions */ + if(valueRank != constraintValueRank) + return false; + break; + } + return true; +} + +/* Check if the ValueRank allows for the value dimension. This is more + * permissive than checking for the ArrayDimensions attribute. Because the value + * can have dimensions if the ValueRank < 0 */ +static UA_Boolean +compatibleValueRankValue(UA_Int32 valueRank, const UA_Variant *value) { + /* Invalid ValueRank */ + if(valueRank < UA_VALUERANK_SCALAR_OR_ONE_DIMENSION) + return false; + + /* Empty arrays (-1) always match */ + if(!value->data) + return true; + + size_t arrayDims = value->arrayDimensionsSize; + if(arrayDims == 0 && !UA_Variant_isScalar(value)) + arrayDims = 1; /* array but no arraydimensions -> implicit array dimension 1 */ + + /* We cannot simply use compatibleValueRankArrayDimensions since we can have + * defined ArrayDimensions for the value if the ValueRank is -2 */ + switch(valueRank) { + case UA_VALUERANK_SCALAR_OR_ONE_DIMENSION: /* The value can be a scalar or a + one dimensional array */ + return (arrayDims <= 1); + case UA_VALUERANK_ANY: /* The value can be a scalar or an array with any + number of dimensions */ + return true; + case UA_VALUERANK_SCALAR: /* The value is a scalar */ + return (arrayDims == 0); + case UA_VALUERANK_ONE_OR_MORE_DIMENSIONS: + return (arrayDims >= 1); + default: + break; + } + + UA_assert(valueRank >= UA_VALUERANK_ONE_OR_MORE_DIMENSIONS); + + /* case 0: the value is an array with one or more dimensions */ + return (arrayDims == (UA_UInt32)valueRank); +} + +UA_Boolean +compatibleArrayDimensions(size_t constraintArrayDimensionsSize, + const UA_UInt32 *constraintArrayDimensions, + size_t testArrayDimensionsSize, + const UA_UInt32 *testArrayDimensions) { + /* No array dimensions defined -> everything is permitted if the value rank fits */ + if(constraintArrayDimensionsSize == 0) + return true; + + /* Dimension count must match */ + if(testArrayDimensionsSize != constraintArrayDimensionsSize) + return false; + + /* Dimension lengths must not be larger than the constraint. Zero in the + * constraint indicates a wildcard. */ + for(size_t i = 0; i < constraintArrayDimensionsSize; ++i) { + if(constraintArrayDimensions[i] < testArrayDimensions[i] && + constraintArrayDimensions[i] != 0) + return false; + } + return true; +} + +UA_Boolean +compatibleValueArrayDimensions(const UA_Variant *value, size_t targetArrayDimensionsSize, + const UA_UInt32 *targetArrayDimensions) { + size_t valueArrayDimensionsSize = value->arrayDimensionsSize; + UA_UInt32 *valueArrayDimensions = value->arrayDimensions; + UA_UInt32 tempArrayDimensions; + if(!valueArrayDimensions && !UA_Variant_isScalar(value)) { + valueArrayDimensionsSize = 1; + tempArrayDimensions = (UA_UInt32)value->arrayLength; + valueArrayDimensions = &tempArrayDimensions; + } + UA_assert(valueArrayDimensionsSize == 0 || valueArrayDimensions != NULL); + return compatibleArrayDimensions(targetArrayDimensionsSize, targetArrayDimensions, + valueArrayDimensionsSize, valueArrayDimensions); +} + +UA_Boolean +compatibleValue(UA_Server *server, UA_Session *session, const UA_NodeId *targetDataTypeId, + UA_Int32 targetValueRank, size_t targetArrayDimensionsSize, + const UA_UInt32 *targetArrayDimensions, const UA_Variant *value, + const UA_NumericRange *range) { + /* Empty value */ + if(!value->type) { + /* Empty value is allowed for BaseDataType */ + if(UA_NodeId_equal(targetDataTypeId, &UA_TYPES[UA_TYPES_VARIANT].typeId) || + UA_NodeId_equal(targetDataTypeId, &UA_NODEID_NULL)) + return true; + + /* Ignore if that is configured */ + if(server->bootstrapNS0 || + server->config.allowEmptyVariables == UA_RULEHANDLING_ACCEPT) + return true; + + UA_LOG_INFO_SESSION(&server->config.logger, session, + "Only Variables with data type BaseDataType " + "can contain an empty value"); + + /* Ignore if that is configured */ + if(server->config.allowEmptyVariables == UA_RULEHANDLING_WARN) + return true; + + /* Default handling is to abort */ + return false; + } + + /* Is the datatype compatible? */ + if(!compatibleValueDataType(server, value->type, targetDataTypeId)) + return false; + + /* Array dimensions are checked later when writing the range */ + if(range) + return true; + + /* See if the array dimensions match. */ + if(!compatibleValueArrayDimensions(value, targetArrayDimensionsSize, + targetArrayDimensions)) + return false; + + /* Check if the valuerank allows for the value dimension */ + return compatibleValueRankValue(targetValueRank, value); +} + +/*****************/ +/* Write Service */ +/*****************/ + +static void +adjustValue(UA_Server *server, UA_Variant *value, + const UA_NodeId *targetDataTypeId) { + const UA_DataType *targetDataType = UA_findDataType(targetDataTypeId); + if(!targetDataType) + return; + + /* A string is written to a byte array. the valuerank and array dimensions + * are checked later */ + if(targetDataType == &UA_TYPES[UA_TYPES_BYTE] && + value->type == &UA_TYPES[UA_TYPES_BYTESTRING] && + UA_Variant_isScalar(value)) { + UA_ByteString *str = (UA_ByteString*)value->data; + value->type = &UA_TYPES[UA_TYPES_BYTE]; + value->arrayLength = str->length; + value->data = str->data; + return; + } + + /* An enum was sent as an int32, or an opaque type as a bytestring. This + * is detected with the typeIndex indicating the "true" datatype. */ + UA_DataTypeKind te1 = typeEquivalence(targetDataType); + UA_DataTypeKind te2 = typeEquivalence(value->type); + if(te1 == te2 && te1 <= UA_DATATYPEKIND_ENUM) { + value->type = targetDataType; + return; + } + + /* No more possible equivalencies */ +} + +static UA_StatusCode +writeArrayDimensionsAttribute(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_VariableTypeNode *type, + size_t arrayDimensionsSize, UA_UInt32 *arrayDimensions) { + UA_assert(node != NULL); + UA_assert(type != NULL); + + /* If this is a variabletype, there must be no instances or subtypes of it + * when we do the change */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLETYPE && + UA_Node_hasSubTypeOrInstances(&node->head)) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Cannot change a variable type with existing instances"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Check that the array dimensions match with the valuerank */ + if(!compatibleValueRankArrayDimensions(server, session, node->valueRank, + arrayDimensionsSize)) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Cannot write the ArrayDimensions. The ValueRank does not match."); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Check if the array dimensions match with the wildcards in the + * variabletype (dimension length 0) */ + if(type->arrayDimensions && + !compatibleArrayDimensions(type->arrayDimensionsSize, type->arrayDimensions, + arrayDimensionsSize, arrayDimensions)) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Array dimensions in the variable type do not match"); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Check if the current value is compatible with the array dimensions */ + UA_DataValue value; + UA_DataValue_init(&value); + UA_StatusCode retval = readValueAttribute(server, session, node, &value); + if(retval != UA_STATUSCODE_GOOD) + return retval; + if(value.hasValue) { + if(!compatibleValueArrayDimensions(&value.value, arrayDimensionsSize, + arrayDimensions)) + retval = UA_STATUSCODE_BADTYPEMISMATCH; + UA_DataValue_clear(&value); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Array dimensions in the current value do not match"); + return retval; + } + } + + /* Ok, apply */ + UA_UInt32 *oldArrayDimensions = node->arrayDimensions; + size_t oldArrayDimensionsSize = node->arrayDimensionsSize; + retval = UA_Array_copy(arrayDimensions, arrayDimensionsSize, + (void**)&node->arrayDimensions, + &UA_TYPES[UA_TYPES_UINT32]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + UA_Array_delete(oldArrayDimensions, oldArrayDimensionsSize, &UA_TYPES[UA_TYPES_UINT32]); + node->arrayDimensionsSize = arrayDimensionsSize; + return UA_STATUSCODE_GOOD; +} + +/* Stack layout: ... | node | type */ +static UA_StatusCode +writeValueRankAttribute(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_VariableTypeNode *type, + UA_Int32 valueRank) { + UA_assert(node != NULL); + UA_assert(type != NULL); + + UA_Int32 constraintValueRank = type->valueRank; + + /* If this is a variabletype, there must be no instances or subtypes of it + * when we do the change */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLETYPE && + UA_Node_hasSubTypeOrInstances(&node->head)) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Check if the valuerank of the variabletype allows the change. */ + if(!compatibleValueRanks(valueRank, constraintValueRank)) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* Check if the new valuerank is compatible with the array dimensions. Use + * the read service to handle data sources. */ + size_t arrayDims = node->arrayDimensionsSize; + if(arrayDims == 0) { + /* the value could be an array with no arrayDimensions defined. + dimensions zero indicate a scalar for compatibleValueRankArrayDimensions. */ + UA_DataValue value; + UA_DataValue_init(&value); + UA_StatusCode retval = readValueAttribute(server, session, node, &value); + if(retval != UA_STATUSCODE_GOOD) + return retval; + if(!value.hasValue || !value.value.type) { + /* no value -> apply */ + node->valueRank = valueRank; + return UA_STATUSCODE_GOOD; + } + if(!UA_Variant_isScalar(&value.value)) + arrayDims = 1; + UA_DataValue_clear(&value); + } + if(!compatibleValueRankArrayDimensions(server, session, valueRank, arrayDims)) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* All good, apply the change */ + node->valueRank = valueRank; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +writeDataTypeAttribute(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_VariableTypeNode *type, + const UA_NodeId *dataType) { + UA_assert(node != NULL); + UA_assert(type != NULL); + + /* If this is a variabletype, there must be no instances or subtypes of it + when we do the change */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLETYPE && + UA_Node_hasSubTypeOrInstances(&node->head)) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Does the new type match the constraints of the variabletype? */ + if(!compatibleDataTypes(server, dataType, &type->dataType)) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* Check if the current value would match the new type */ + UA_DataValue value; + UA_DataValue_init(&value); + UA_StatusCode retval = readValueAttribute(server, session, node, &value); + if(retval != UA_STATUSCODE_GOOD) + return retval; + if(value.hasValue) { + if(!compatibleValue(server, session, dataType, node->valueRank, + node->arrayDimensionsSize, node->arrayDimensions, + &value.value, NULL)) + retval = UA_STATUSCODE_BADTYPEMISMATCH; + UA_DataValue_clear(&value); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "The current value does not match the new data type"); + return retval; + } + } + + /* Replace the datatype nodeid */ + UA_NodeId dtCopy = node->dataType; + retval = UA_NodeId_copy(dataType, &node->dataType); + if(retval != UA_STATUSCODE_GOOD) { + node->dataType = dtCopy; + return retval; + } + UA_NodeId_clear(&dtCopy); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +writeValueAttributeWithoutRange(UA_VariableNode *node, const UA_DataValue *value) { + UA_DataValue new_value; + UA_StatusCode retval = UA_DataValue_copy(value, &new_value); + if(retval != UA_STATUSCODE_GOOD) + return retval; + UA_DataValue_clear(&node->value.data.value); + node->value.data.value = new_value; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +writeValueAttributeWithRange(UA_VariableNode *node, const UA_DataValue *value, + const UA_NumericRange *rangeptr) { + /* Value on both sides? */ + if(value->status != node->value.data.value.status || + !value->hasValue || !node->value.data.value.hasValue) + return UA_STATUSCODE_BADINDEXRANGEINVALID; + + /* Make scalar a one-entry array for range matching */ + UA_Variant editableValue; + const UA_Variant *v = &value->value; + if(UA_Variant_isScalar(&value->value)) { + editableValue = value->value; + editableValue.arrayLength = 1; + v = &editableValue; + } + + /* Check that the type is an exact match and not only "compatible" */ + if(!node->value.data.value.value.type || !v->type || + !UA_NodeId_equal(&node->value.data.value.value.type->typeId, + &v->type->typeId)) + return UA_STATUSCODE_BADTYPEMISMATCH; + + /* Write the value */ + UA_StatusCode retval = + UA_Variant_setRangeCopy(&node->value.data.value.value, + v->data, v->arrayLength, *rangeptr); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Write the status and timestamps */ + node->value.data.value.hasStatus = value->hasStatus; + node->value.data.value.status = value->status; + node->value.data.value.hasSourceTimestamp = value->hasSourceTimestamp; + node->value.data.value.sourceTimestamp = value->sourceTimestamp; + node->value.data.value.hasSourcePicoseconds = value->hasSourcePicoseconds; + node->value.data.value.sourcePicoseconds = value->sourcePicoseconds; + return UA_STATUSCODE_GOOD; +} + +/* Stack layout: ... | node */ +static UA_StatusCode +writeNodeValueAttribute(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_DataValue *value, + const UA_String *indexRange) { + UA_assert(node != NULL); + UA_assert(session != NULL); + + /* Parse the range */ + UA_NumericRange range; + UA_NumericRange *rangeptr = NULL; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(indexRange && indexRange->length > 0) { + retval = UA_NumericRange_parse(&range, *indexRange); + if(retval != UA_STATUSCODE_GOOD) + return retval; + rangeptr = ⦥ + } + + /* Created an editable version. The data is not touched. Only the variant + * "container". */ + UA_DataValue adjustedValue = *value; + + /* Type checking. May change the type of editableValue */ + if(value->hasValue && value->value.type) { + adjustValue(server, &adjustedValue.value, &node->dataType); + + /* The value may be an extension object, especially the nodeset compiler + * uses extension objects to write variable values. If value is an + * extension object we check if the current node value is also an + * extension object. */ + const UA_NodeId nodeDataType = UA_NODEID_NUMERIC(0, UA_NS0ID_STRUCTURE); + const UA_NodeId *nodeDataTypePtr = &node->dataType; + if(value->value.type->typeId.identifierType == UA_NODEIDTYPE_NUMERIC && + value->value.type->typeId.identifier.numeric == UA_NS0ID_STRUCTURE) + nodeDataTypePtr = &nodeDataType; + + if(!compatibleValue(server, session, nodeDataTypePtr, node->valueRank, + node->arrayDimensionsSize, node->arrayDimensions, + &adjustedValue.value, rangeptr)) { + if(rangeptr) + UA_free(range.dimensions); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + } + + /* Set the source timestamp if there is none */ + UA_DateTime now = UA_DateTime_now(); + if(!adjustedValue.hasSourceTimestamp) { + adjustedValue.sourceTimestamp = now; + adjustedValue.hasSourceTimestamp = true; + } + + /* Update the timestamp when the value was last updated in the server */ + adjustedValue.serverTimestamp = now; + adjustedValue.hasServerTimestamp = true; + + switch(node->valueBackend.backendType) { + case UA_VALUEBACKENDTYPE_NONE: + /* Ok, do it */ + if(node->valueSource == UA_VALUESOURCE_DATA) { + if(!rangeptr) + retval = writeValueAttributeWithoutRange(node, &adjustedValue); + else + retval = writeValueAttributeWithRange(node, &adjustedValue, rangeptr); + +#ifdef UA_ENABLE_HISTORIZING + /* node is a UA_VariableNode*, but it may also point to a + UA_VariableTypeNode */ + /* UA_VariableTypeNode doesn't have the historizing attribute */ + if(retval == UA_STATUSCODE_GOOD && + node->head.nodeClass == UA_NODECLASS_VARIABLE && + server->config.historyDatabase.setValue) { + UA_UNLOCK(server->serviceMutex); + server->config.historyDatabase. + setValue(server, server->config.historyDatabase.context, + &session->sessionId, session->sessionHandle, + &node->head.nodeId, node->historizing, &adjustedValue); + UA_LOCK(server->serviceMutex); + } +#endif + /* Callback after writing */ + if(retval == UA_STATUSCODE_GOOD && node->value.data.callback.onWrite) { + UA_UNLOCK(server->serviceMutex) + node->value.data.callback. + onWrite(server, &session->sessionId, session->sessionHandle, + &node->head.nodeId, node->head.context, + rangeptr, &adjustedValue); + UA_LOCK(server->serviceMutex); + + } + } else { + if(node->value.dataSource.write) { + UA_UNLOCK(server->serviceMutex); + retval = node->value.dataSource. + write(server, &session->sessionId, session->sessionHandle, + &node->head.nodeId, node->head.context, + rangeptr, &adjustedValue); + UA_LOCK(server->serviceMutex); + } else { + retval = UA_STATUSCODE_BADWRITENOTSUPPORTED; + } + } + break; + case UA_VALUEBACKENDTYPE_INTERNAL: + break; + case UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK: + break; + case UA_VALUEBACKENDTYPE_EXTERNAL: + if(node->valueBackend.backend.external.callback.userWrite == NULL){ + if(rangeptr) + UA_free(range.dimensions); + return UA_STATUSCODE_BADWRITENOTSUPPORTED; + } + node->valueBackend.backend.external.callback. + userWrite(server, &session->sessionId, session->sessionHandle, + &node->head.nodeId, node->head.context, + rangeptr, &adjustedValue); + break; + } + + /* Clean up */ + if(rangeptr) + UA_free(range.dimensions); + return retval; +} + +static UA_StatusCode +writeIsAbstractAttribute(UA_Node *node, UA_Boolean value) { + switch(node->head.nodeClass) { + case UA_NODECLASS_OBJECTTYPE: + node->objectTypeNode.isAbstract = value; + break; + case UA_NODECLASS_REFERENCETYPE: + node->referenceTypeNode.isAbstract = value; + break; + case UA_NODECLASS_VARIABLETYPE: + node->variableTypeNode.isAbstract = value; + break; + case UA_NODECLASS_DATATYPE: + node->dataTypeNode.isAbstract = value; + break; + default: + return UA_STATUSCODE_BADNODECLASSINVALID; + } + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* Write Service */ +/*****************/ + +#define CHECK_DATATYPE_SCALAR(EXP_DT) \ + if(!wvalue->value.hasValue || \ + &UA_TYPES[UA_TYPES_##EXP_DT] != wvalue->value.value.type || \ + !UA_Variant_isScalar(&wvalue->value.value)) { \ + retval = UA_STATUSCODE_BADTYPEMISMATCH; \ + break; \ + } + +#define CHECK_DATATYPE_ARRAY(EXP_DT) \ + if(!wvalue->value.hasValue || \ + &UA_TYPES[UA_TYPES_##EXP_DT] != wvalue->value.value.type || \ + UA_Variant_isScalar(&wvalue->value.value)) { \ + retval = UA_STATUSCODE_BADTYPEMISMATCH; \ + break; \ + } + +#define CHECK_NODECLASS_WRITE(CLASS) \ + if((node->head.nodeClass & (CLASS)) == 0) { \ + retval = UA_STATUSCODE_BADNODECLASSINVALID; \ + break; \ + } + +#define CHECK_USERWRITEMASK(mask) \ + if(!(userWriteMask & (mask))) { \ + retval = UA_STATUSCODE_BADUSERACCESSDENIED; \ + break; \ + } + +#define GET_NODETYPE \ + type = (const UA_VariableTypeNode*) \ + getNodeType(server, &node->head); \ + if(!type) { \ + retval = UA_STATUSCODE_BADTYPEMISMATCH; \ + break; \ + } + +/* Update a localized text. Don't touch the target if copying fails + * (maybe due to BadOutOfMemory). */ +static UA_StatusCode +updateLocalizedText(const UA_LocalizedText *source, UA_LocalizedText *target) { + UA_LocalizedText tmp; + UA_StatusCode retval = UA_LocalizedText_copy(source, &tmp); + if(retval != UA_STATUSCODE_GOOD) + return retval; + UA_LocalizedText_clear(target); + *target = tmp; + return UA_STATUSCODE_GOOD; +} + +/* This function implements the main part of the write service and operates on a + copy of the node (not in single-threaded mode). */ +static UA_StatusCode +copyAttributeIntoNode(UA_Server *server, UA_Session *session, + UA_Node *node, const UA_WriteValue *wvalue) { + UA_assert(session != NULL); + const void *value = wvalue->value.value.data; + UA_UInt32 userWriteMask = getUserWriteMask(server, session, &node->head); + UA_StatusCode retval = UA_STATUSCODE_GOOD; + + UA_LOG_NODEID_DEBUG(&node->head.nodeId, + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Write attribute %"PRIi32 " of Node %.*s", + wvalue->attributeId, (int)nodeIdStr.length, + nodeIdStr.data)); + + const UA_VariableTypeNode *type; + + switch(wvalue->attributeId) { + case UA_ATTRIBUTEID_NODEID: + case UA_ATTRIBUTEID_NODECLASS: + case UA_ATTRIBUTEID_USERWRITEMASK: + case UA_ATTRIBUTEID_USERACCESSLEVEL: + case UA_ATTRIBUTEID_USEREXECUTABLE: + case UA_ATTRIBUTEID_BROWSENAME: /* BrowseName is tracked in a binary tree + for fast lookup */ + retval = UA_STATUSCODE_BADWRITENOTSUPPORTED; + break; + case UA_ATTRIBUTEID_DISPLAYNAME: + CHECK_USERWRITEMASK(UA_WRITEMASK_DISPLAYNAME); + CHECK_DATATYPE_SCALAR(LOCALIZEDTEXT); + retval = updateLocalizedText((const UA_LocalizedText *)value, + &node->head.displayName); + break; + case UA_ATTRIBUTEID_DESCRIPTION: + CHECK_USERWRITEMASK(UA_WRITEMASK_DESCRIPTION); + CHECK_DATATYPE_SCALAR(LOCALIZEDTEXT); + retval = updateLocalizedText((const UA_LocalizedText *)value, + &node->head.description); + break; + case UA_ATTRIBUTEID_WRITEMASK: + CHECK_USERWRITEMASK(UA_WRITEMASK_WRITEMASK); + CHECK_DATATYPE_SCALAR(UINT32); + node->head.writeMask = *(const UA_UInt32*)value; + break; + case UA_ATTRIBUTEID_ISABSTRACT: + CHECK_USERWRITEMASK(UA_WRITEMASK_ISABSTRACT); + CHECK_DATATYPE_SCALAR(BOOLEAN); + retval = writeIsAbstractAttribute(node, *(const UA_Boolean*)value); + break; + case UA_ATTRIBUTEID_SYMMETRIC: + CHECK_NODECLASS_WRITE(UA_NODECLASS_REFERENCETYPE); + CHECK_USERWRITEMASK(UA_WRITEMASK_SYMMETRIC); + CHECK_DATATYPE_SCALAR(BOOLEAN); + node->referenceTypeNode.symmetric = *(const UA_Boolean*)value; + break; + case UA_ATTRIBUTEID_INVERSENAME: + CHECK_NODECLASS_WRITE(UA_NODECLASS_REFERENCETYPE); + CHECK_USERWRITEMASK(UA_WRITEMASK_INVERSENAME); + CHECK_DATATYPE_SCALAR(LOCALIZEDTEXT); + retval = updateLocalizedText((const UA_LocalizedText *)value, + &node->referenceTypeNode.inverseName); + break; + case UA_ATTRIBUTEID_CONTAINSNOLOOPS: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VIEW); + CHECK_USERWRITEMASK(UA_WRITEMASK_CONTAINSNOLOOPS); + CHECK_DATATYPE_SCALAR(BOOLEAN); + node->viewNode.containsNoLoops = *(const UA_Boolean*)value; + break; + case UA_ATTRIBUTEID_EVENTNOTIFIER: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT); + CHECK_USERWRITEMASK(UA_WRITEMASK_EVENTNOTIFIER); + CHECK_DATATYPE_SCALAR(BYTE); + if(node->head.nodeClass == UA_NODECLASS_VIEW) { + node->viewNode.eventNotifier = *(const UA_Byte*)value; + } else { + node->objectNode.eventNotifier = *(const UA_Byte*)value; + } + break; + case UA_ATTRIBUTEID_VALUE: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + if(node->head.nodeClass == UA_NODECLASS_VARIABLE) { + /* The access to a value variable is granted via the AccessLevel + * and UserAccessLevel attributes */ + UA_Byte accessLevel = getAccessLevel(server, session, &node->variableNode); + if(!(accessLevel & (UA_ACCESSLEVELMASK_WRITE))) { + retval = UA_STATUSCODE_BADNOTWRITABLE; + break; + } + accessLevel = getUserAccessLevel(server, session, &node->variableNode); + if(!(accessLevel & (UA_ACCESSLEVELMASK_WRITE))) { + retval = UA_STATUSCODE_BADUSERACCESSDENIED; + break; + } + } else { /* UA_NODECLASS_VARIABLETYPE */ + CHECK_USERWRITEMASK(UA_WRITEMASK_VALUEFORVARIABLETYPE); + } + retval = writeNodeValueAttribute(server, session, &node->variableNode, + &wvalue->value, &wvalue->indexRange); + break; + case UA_ATTRIBUTEID_DATATYPE: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + CHECK_USERWRITEMASK(UA_WRITEMASK_DATATYPE); + CHECK_DATATYPE_SCALAR(NODEID); + GET_NODETYPE; + retval = writeDataTypeAttribute(server, session, &node->variableNode, + type, (const UA_NodeId*)value); + UA_NODESTORE_RELEASE(server, (const UA_Node*)type); + break; + case UA_ATTRIBUTEID_VALUERANK: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + CHECK_USERWRITEMASK(UA_WRITEMASK_VALUERANK); + CHECK_DATATYPE_SCALAR(INT32); + GET_NODETYPE; + retval = writeValueRankAttribute(server, session, &node->variableNode, + type, *(const UA_Int32*)value); + UA_NODESTORE_RELEASE(server, (const UA_Node*)type); + break; + case UA_ATTRIBUTEID_ARRAYDIMENSIONS: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE); + CHECK_USERWRITEMASK(UA_WRITEMASK_ARRRAYDIMENSIONS); + CHECK_DATATYPE_ARRAY(UINT32); + GET_NODETYPE; + retval = writeArrayDimensionsAttribute(server, session, &node->variableNode, + type, wvalue->value.value.arrayLength, + (UA_UInt32 *)wvalue->value.value.data); + UA_NODESTORE_RELEASE(server, (const UA_Node*)type); + break; + case UA_ATTRIBUTEID_ACCESSLEVEL: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE); + CHECK_USERWRITEMASK(UA_WRITEMASK_ACCESSLEVEL); + CHECK_DATATYPE_SCALAR(BYTE); + node->variableNode.accessLevel = *(const UA_Byte*)value; + break; + case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE); + CHECK_USERWRITEMASK(UA_WRITEMASK_MINIMUMSAMPLINGINTERVAL); + CHECK_DATATYPE_SCALAR(DOUBLE); + node->variableNode.minimumSamplingInterval = *(const UA_Double*)value; + break; + case UA_ATTRIBUTEID_HISTORIZING: + CHECK_NODECLASS_WRITE(UA_NODECLASS_VARIABLE); + CHECK_USERWRITEMASK(UA_WRITEMASK_HISTORIZING); + CHECK_DATATYPE_SCALAR(BOOLEAN); + node->variableNode.historizing = *(const UA_Boolean*)value; + break; + case UA_ATTRIBUTEID_EXECUTABLE: + CHECK_NODECLASS_WRITE(UA_NODECLASS_METHOD); + CHECK_USERWRITEMASK(UA_WRITEMASK_EXECUTABLE); + CHECK_DATATYPE_SCALAR(BOOLEAN); + node->methodNode.executable = *(const UA_Boolean*)value; + break; + default: + retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID; + break; + } + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "WriteRequest returned status code %s", + UA_StatusCode_name(retval)); + } + return retval; +} + +static void +Operation_Write(UA_Server *server, UA_Session *session, void *context, + const UA_WriteValue *wv, UA_StatusCode *result) { + UA_assert(session != NULL); + *result = UA_Server_editNode(server, session, &wv->nodeId, + (UA_EditNodeCallback)copyAttributeIntoNode, + (void*)(uintptr_t)wv); +} + +void +Service_Write(UA_Server *server, UA_Session *session, + const UA_WriteRequest *request, + UA_WriteResponse *response) { + UA_assert(session != NULL); + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing WriteRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxNodesPerWrite != 0 && + request->nodesToWriteSize > server->config.maxNodesPerWrite) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + UA_LOCK_ASSERT(server->serviceMutex, 1); + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_Write, NULL, + &request->nodesToWriteSize, + &UA_TYPES[UA_TYPES_WRITEVALUE], + &response->resultsSize, + &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_StatusCode +UA_Server_write(UA_Server *server, const UA_WriteValue *value) { + UA_StatusCode res = UA_STATUSCODE_GOOD; + UA_LOCK(server->serviceMutex); + Operation_Write(server, &server->adminSession, NULL, value, &res); + UA_UNLOCK(server->serviceMutex); + return res; +} + +/* Convenience function to be wrapped into inline functions */ +UA_StatusCode +__UA_Server_write(UA_Server *server, const UA_NodeId *nodeId, + const UA_AttributeId attributeId, + const UA_DataType *attr_type, const void *attr) { + UA_LOCK(server->serviceMutex); + UA_StatusCode res = writeAttribute(server, &server->adminSession, + nodeId, attributeId, attr, attr_type); + UA_UNLOCK(server->serviceMutex); + return res; +} + +/* Internal convenience function */ +UA_StatusCode +writeAttribute(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId, const UA_AttributeId attributeId, + const void *attr, const UA_DataType *attr_type) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_WriteValue wvalue; + UA_WriteValue_init(&wvalue); + wvalue.nodeId = *nodeId; + wvalue.attributeId = attributeId; + wvalue.value.hasValue = true; + if(attr_type == &UA_TYPES[UA_TYPES_VARIANT]) { + wvalue.value.value = *(const UA_Variant*)attr; + } else if(attr_type == &UA_TYPES[UA_TYPES_DATAVALUE]) { + wvalue.value = *(const UA_DataValue*)attr; + } else { + /* hacked cast. the target WriteValue is used as const anyway */ + UA_Variant_setScalar(&wvalue.value.value, + (void*)(uintptr_t)attr, attr_type); + } + + UA_StatusCode res = UA_STATUSCODE_GOOD; + Operation_Write(server, session, NULL, &wvalue, &res); + return res; +} + +#ifdef UA_ENABLE_HISTORIZING +typedef void + (*UA_HistoryDatabase_readFunc)(UA_Server *server, void *hdbContext, + const UA_NodeId *sessionId, void *sessionContext, + const UA_RequestHeader *requestHeader, + const void *historyReadDetails, + UA_TimestampsToReturn timestampsToReturn, + UA_Boolean releaseContinuationPoints, + size_t nodesToReadSize, + const UA_HistoryReadValueId *nodesToRead, + UA_HistoryReadResponse *response, + void * const * const historyData); + +void +Service_HistoryRead(UA_Server *server, UA_Session *session, + const UA_HistoryReadRequest *request, + UA_HistoryReadResponse *response) { + UA_assert(session != NULL); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(request->historyReadDetails.encoding != UA_EXTENSIONOBJECT_DECODED) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTSUPPORTED; + return; + } + + const UA_DataType *historyDataType = &UA_TYPES[UA_TYPES_HISTORYDATA]; + UA_HistoryDatabase_readFunc readHistory = NULL; + switch(request->historyReadDetails.content.decoded.type->typeIndex) { + case UA_TYPES_READRAWMODIFIEDDETAILS: { + UA_ReadRawModifiedDetails *details = (UA_ReadRawModifiedDetails*) + request->historyReadDetails.content.decoded.data; + if(!details->isReadModified) { + readHistory = (UA_HistoryDatabase_readFunc) + server->config.historyDatabase.readRaw; + } else { + historyDataType = &UA_TYPES[UA_TYPES_HISTORYMODIFIEDDATA]; + readHistory = (UA_HistoryDatabase_readFunc) + server->config.historyDatabase.readModified; + } + break; + } + case UA_TYPES_READEVENTDETAILS: + historyDataType = &UA_TYPES[UA_TYPES_HISTORYEVENT]; + readHistory = (UA_HistoryDatabase_readFunc) + server->config.historyDatabase.readEvent; + break; + case UA_TYPES_READPROCESSEDDETAILS: + readHistory = (UA_HistoryDatabase_readFunc) + server->config.historyDatabase.readProcessed; + break; + case UA_TYPES_READATTIMEDETAILS: + readHistory = (UA_HistoryDatabase_readFunc) + server->config.historyDatabase.readAtTime; + break; + } + + if(!readHistory) { + /* TODO handle more request->historyReadDetails.content.decoded.type types */ + response->responseHeader.serviceResult = UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED; + return; + } + + /* Something to do? */ + if(request->nodesToReadSize == 0) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO; + return; + } + + /* Check if there are too many operations */ + if(server->config.maxNodesPerRead != 0 && + request->nodesToReadSize > server->config.maxNodesPerRead) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* Allocate a temporary array to forward the result pointers to the + * backend */ + void **historyData = (void **) + UA_calloc(request->nodesToReadSize, sizeof(void*)); + if(!historyData) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + /* Allocate the results array */ + response->results = (UA_HistoryReadResult*) + UA_Array_new(request->nodesToReadSize, &UA_TYPES[UA_TYPES_HISTORYREADRESULT]); + if(!response->results) { + UA_free(historyData); + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + response->resultsSize = request->nodesToReadSize; + + for(size_t i = 0; i < response->resultsSize; ++i) { + void * data = UA_new(historyDataType); + UA_ExtensionObject_setValue(&response->results[i].historyData, + data, historyDataType); + historyData[i] = data; + } + UA_UNLOCK(server->serviceMutex); + readHistory(server, server->config.historyDatabase.context, + &session->sessionId, session->sessionHandle, + &request->requestHeader, + request->historyReadDetails.content.decoded.data, + request->timestampsToReturn, + request->releaseContinuationPoints, + request->nodesToReadSize, request->nodesToRead, + response, historyData); + UA_LOCK(server->serviceMutex); + UA_free(historyData); +} + +void +Service_HistoryUpdate(UA_Server *server, UA_Session *session, + const UA_HistoryUpdateRequest *request, + UA_HistoryUpdateResponse *response) { + UA_assert(session != NULL); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + response->resultsSize = request->historyUpdateDetailsSize; + response->results = (UA_HistoryUpdateResult*) + UA_Array_new(response->resultsSize, &UA_TYPES[UA_TYPES_HISTORYUPDATERESULT]); + if(!response->results) { + response->resultsSize = 0; + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + for(size_t i = 0; i < request->historyUpdateDetailsSize; ++i) { + UA_HistoryUpdateResult_init(&response->results[i]); + if(request->historyUpdateDetails[i].encoding != UA_EXTENSIONOBJECT_DECODED) { + response->results[i].statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + continue; + } + + const UA_DataType *updateDetailsType = + request->historyUpdateDetails[i].content.decoded.type; + void *updateDetailsData = request->historyUpdateDetails[i].content.decoded.data; + + if(updateDetailsType == &UA_TYPES[UA_TYPES_UPDATEDATADETAILS]) { + if(!server->config.historyDatabase.updateData) { + response->results[i].statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + continue; + } + UA_UNLOCK(server->serviceMutex); + server->config.historyDatabase. + updateData(server, server->config.historyDatabase.context, + &session->sessionId, session->sessionHandle, + &request->requestHeader, + (UA_UpdateDataDetails*)updateDetailsData, + &response->results[i]); + UA_LOCK(server->serviceMutex); + continue; + } + + if(updateDetailsType == &UA_TYPES[UA_TYPES_DELETERAWMODIFIEDDETAILS]) { + if(!server->config.historyDatabase.deleteRawModified) { + response->results[i].statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + continue; + } + UA_UNLOCK(server->serviceMutex); + server->config.historyDatabase. + deleteRawModified(server, server->config.historyDatabase.context, + &session->sessionId, session->sessionHandle, + &request->requestHeader, + (UA_DeleteRawModifiedDetails*)updateDetailsData, + &response->results[i]); + UA_LOCK(server->serviceMutex); + continue; + } + + response->results[i].statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + } +} + +#endif + +UA_StatusCode +UA_Server_writeObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + const UA_Variant value) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retVal = writeObjectProperty(server, objectId, propertyName, value); + UA_UNLOCK(server->serviceMutex); + return retVal; +} + +UA_StatusCode +writeObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + const UA_Variant value) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_RelativePathElement rpe; + UA_RelativePathElement_init(&rpe); + rpe.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY); + rpe.isInverse = false; + rpe.includeSubtypes = false; + rpe.targetName = propertyName; + + UA_BrowsePath bp; + UA_BrowsePath_init(&bp); + bp.startingNode = objectId; + bp.relativePath.elementsSize = 1; + bp.relativePath.elements = &rpe; + + UA_StatusCode retval; + UA_BrowsePathResult bpr = translateBrowsePathToNodeIds(server, &bp); + if(bpr.statusCode != UA_STATUSCODE_GOOD || bpr.targetsSize < 1) { + retval = bpr.statusCode; + UA_BrowsePathResult_clear(&bpr); + return retval; + } + + retval = writeValueAttribute(server, &server->adminSession, + &bpr.targets[0].targetId.nodeId, &value); + + UA_BrowsePathResult_clear(&bpr); + return retval; +} + +UA_StatusCode UA_EXPORT +UA_Server_writeObjectProperty_scalar(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + const void *value, const UA_DataType *type) { + UA_Variant var; + UA_Variant_init(&var); + UA_Variant_setScalar(&var, (void*)(uintptr_t)value, type); + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = writeObjectProperty(server, objectId, propertyName, var); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_discovery.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2016 (c) Sten Grüner + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2016 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + +#ifdef UA_ENABLE_DISCOVERY + + +static UA_StatusCode +setApplicationDescriptionFromRegisteredServer(const UA_FindServersRequest *request, + UA_ApplicationDescription *target, + const UA_RegisteredServer *registeredServer) { + UA_ApplicationDescription_init(target); + UA_StatusCode retval = UA_String_copy(®isteredServer->serverUri, &target->applicationUri); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_String_copy(®isteredServer->productUri, &target->productUri); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + // if the client requests a specific locale, select the corresponding server name + if(request->localeIdsSize) { + UA_Boolean appNameFound = false; + for(size_t i =0; i<request->localeIdsSize && !appNameFound; i++) { + for(size_t j =0; j<registeredServer->serverNamesSize; j++) { + if(UA_String_equal(&request->localeIds[i], ®isteredServer->serverNames[j].locale)) { + retval = UA_LocalizedText_copy(®isteredServer->serverNames[j], + &target->applicationName); + if(retval != UA_STATUSCODE_GOOD) + return retval; + appNameFound = true; + break; + } + } + } + + // server does not have the requested local, therefore we can select the + // most suitable one + if(!appNameFound && registeredServer->serverNamesSize) { + retval = UA_LocalizedText_copy(®isteredServer->serverNames[0], + &target->applicationName); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + } else if(registeredServer->serverNamesSize) { + // just take the first name + retval = UA_LocalizedText_copy(®isteredServer->serverNames[0], &target->applicationName); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + target->applicationType = registeredServer->serverType; + retval = UA_String_copy(®isteredServer->gatewayServerUri, &target->gatewayServerUri); + if(retval != UA_STATUSCODE_GOOD) + return retval; + // TODO where do we get the discoveryProfileUri for application data? + + target->discoveryUrlsSize = registeredServer->discoveryUrlsSize; + if(registeredServer->discoveryUrlsSize) { + size_t duSize = sizeof(UA_String) * registeredServer->discoveryUrlsSize; + target->discoveryUrls = (UA_String *)UA_malloc(duSize); + if(!target->discoveryUrls) + return UA_STATUSCODE_BADOUTOFMEMORY; + for(size_t i = 0; i < registeredServer->discoveryUrlsSize; i++) { + retval = UA_String_copy(®isteredServer->discoveryUrls[i], &target->discoveryUrls[i]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + } + + return retval; +} +#endif + +static UA_StatusCode +setApplicationDescriptionFromServer(UA_ApplicationDescription *target, const UA_Server *server) { + /* Copy ApplicationDescription from the config */ + UA_StatusCode result = UA_ApplicationDescription_copy(&server->config.applicationDescription, target); + if(result != UA_STATUSCODE_GOOD) + return result; + + /* Add the discoveryUrls from the networklayers only if discoveryUrl + * not already present and to avoid redundancy */ + if(!target->discoveryUrlsSize) { + size_t discSize = sizeof(UA_String) * (target->discoveryUrlsSize + server->config.networkLayersSize); + UA_String* disc = (UA_String *)UA_realloc(target->discoveryUrls, discSize); + if(!disc) + return UA_STATUSCODE_BADOUTOFMEMORY; + size_t existing = target->discoveryUrlsSize; + target->discoveryUrls = disc; + target->discoveryUrlsSize += server->config.networkLayersSize; + + for(size_t i = 0; i < server->config.networkLayersSize; i++) { + UA_ServerNetworkLayer* nl = &server->config.networkLayers[i]; + UA_String_copy(&nl->discoveryUrl, &target->discoveryUrls[existing + i]); + } + } + + return UA_STATUSCODE_GOOD; +} + +void Service_FindServers(UA_Server *server, UA_Session *session, + const UA_FindServersRequest *request, + UA_FindServersResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing FindServersRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Return the server itself? */ + UA_Boolean foundSelf = false; + if(request->serverUrisSize) { + for(size_t i = 0; i < request->serverUrisSize; i++) { + if(UA_String_equal(&request->serverUris[i], + &server->config.applicationDescription.applicationUri)) { + foundSelf = true; + break; + } + } + } else { + foundSelf = true; + } + +#ifndef UA_ENABLE_DISCOVERY + if(!foundSelf) + return; + + UA_ApplicationDescription *ad = UA_ApplicationDescription_new(); + if(!ad) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + UA_StatusCode retval = setApplicationDescriptionFromServer(ad, server); + if(retval != UA_STATUSCODE_GOOD) { + UA_ApplicationDescription_delete(ad); + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + response->servers = ad; + response->serversSize = 1; + return; + +#else + + /* Allocate enough memory, including memory for the "self" response */ + size_t maxResults = server->discoveryManager.registeredServersSize + 1; + response->servers = (UA_ApplicationDescription*)UA_Array_new(maxResults, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); + if(!response->servers) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + /* Copy into the response. TODO: Evaluate return codes */ + size_t pos = 0; + if(foundSelf) + setApplicationDescriptionFromServer(&response->servers[pos++], server); + + registeredServer_list_entry* current; + LIST_FOREACH(current, &server->discoveryManager.registeredServers, pointers) { + UA_Boolean usable = (request->serverUrisSize == 0); + if(!usable) { + /* If client only requested a specific set of servers */ + for(size_t i = 0; i < request->serverUrisSize; i++) { + if(UA_String_equal(¤t->registeredServer.serverUri, &request->serverUris[i])) { + usable = true; + break; + } + } + } + + if(usable) + setApplicationDescriptionFromRegisteredServer(request, &response->servers[pos++], + ¤t->registeredServer); + } + + /* Set the final size */ + if(pos > 0) { + response->serversSize = pos; + } else { + UA_free(response->servers); + response->servers = NULL; + } +#endif +} + +void +Service_GetEndpoints(UA_Server *server, UA_Session *session, + const UA_GetEndpointsRequest *request, + UA_GetEndpointsResponse *response) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* If the client expects to see a specific endpointurl, mirror it back. If + * not, clone the endpoints with the discovery url of all networklayers. */ + const UA_String *endpointUrl = &request->endpointUrl; + if(endpointUrl->length > 0) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing GetEndpointsRequest with endpointUrl " + UA_PRINTF_STRING_FORMAT, UA_PRINTF_STRING_DATA(*endpointUrl)); + } else { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing GetEndpointsRequest with an empty endpointUrl"); + } + + /* Clone the endpoint for each networklayer? */ + size_t clone_times = 1; + UA_Boolean nl_endpointurl = false; + if(endpointUrl->length == 0) { + clone_times = server->config.networkLayersSize; + nl_endpointurl = true; + } + + /* Allocate enough memory */ + response->endpoints = (UA_EndpointDescription*) + UA_Array_new(server->config.endpointsSize * clone_times, + &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); + if(!response->endpoints) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + size_t pos = 0; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t j = 0; j < server->config.endpointsSize; ++j) { + /* Test if the supported binary profile shall be returned */ + UA_Boolean usable = (request->profileUrisSize == 0); + if(!usable) { + for(size_t i = 0; i < request->profileUrisSize; ++i) { + if(!UA_String_equal(&request->profileUris[i], + &server->config.endpoints[j].transportProfileUri)) + continue; + usable = true; + break; + } + } + if(!usable) + continue; + + /* Copy into the results */ + for(size_t i = 0; i < clone_times; ++i) { + retval |= UA_EndpointDescription_copy(&server->config.endpoints[j], + &response->endpoints[pos]); + if(nl_endpointurl) + endpointUrl = &server->config.networkLayers[i].discoveryUrl; + retval |= UA_String_copy(endpointUrl, &response->endpoints[pos].endpointUrl); + retval |= UA_Array_copy(endpointUrl, 1, + (void**)&response->endpoints[pos].server.discoveryUrls, + &UA_TYPES[UA_TYPES_STRING]); + if(retval != UA_STATUSCODE_GOOD) + goto error; + response->endpoints[pos].server.discoveryUrlsSize = 1; + pos++; + } + } + + UA_assert(pos <= server->config.endpointsSize * clone_times); + response->endpointsSize = pos; + + /* Clean up the memory of there are no usable results */ + if(pos > 0) + return; + +error: + response->responseHeader.serviceResult = retval; + UA_Array_delete(response->endpoints, response->endpointsSize, + &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); + response->endpoints = NULL; + response->endpointsSize = 0; +} + +#ifdef UA_ENABLE_DISCOVERY + +static void +process_RegisterServer(UA_Server *server, UA_Session *session, + const UA_RequestHeader* requestHeader, + const UA_RegisteredServer *requestServer, + const size_t requestDiscoveryConfigurationSize, + const UA_ExtensionObject *requestDiscoveryConfiguration, + UA_ResponseHeader* responseHeader, + size_t *responseConfigurationResultsSize, + UA_StatusCode **responseConfigurationResults, + size_t *responseDiagnosticInfosSize, + UA_DiagnosticInfo *responseDiagnosticInfos) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + /* Find the server from the request in the registered list */ + registeredServer_list_entry* current; + registeredServer_list_entry *registeredServer_entry = NULL; + LIST_FOREACH(current, &server->discoveryManager.registeredServers, pointers) { + if(UA_String_equal(¤t->registeredServer.serverUri, &requestServer->serverUri)) { + registeredServer_entry = current; + break; + } + } + + UA_MdnsDiscoveryConfiguration *mdnsConfig = NULL; + + const UA_String* mdnsServerName = NULL; + if(requestDiscoveryConfigurationSize) { + *responseConfigurationResults = + (UA_StatusCode *)UA_Array_new(requestDiscoveryConfigurationSize, + &UA_TYPES[UA_TYPES_STATUSCODE]); + if(!(*responseConfigurationResults)) { + responseHeader->serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + *responseConfigurationResultsSize = requestDiscoveryConfigurationSize; + + for(size_t i = 0; i < requestDiscoveryConfigurationSize; i++) { + const UA_ExtensionObject *object = &requestDiscoveryConfiguration[i]; + if(!mdnsConfig && (object->encoding == UA_EXTENSIONOBJECT_DECODED || + object->encoding == UA_EXTENSIONOBJECT_DECODED_NODELETE) && + (object->content.decoded.type == &UA_TYPES[UA_TYPES_MDNSDISCOVERYCONFIGURATION])) { + mdnsConfig = (UA_MdnsDiscoveryConfiguration *)object->content.decoded.data; + mdnsServerName = &mdnsConfig->mdnsServerName; + (*responseConfigurationResults)[i] = UA_STATUSCODE_GOOD; + } else { + (*responseConfigurationResults)[i] = UA_STATUSCODE_BADNOTSUPPORTED; + } + } + } + + if(!mdnsServerName && requestServer->serverNamesSize) + mdnsServerName = &requestServer->serverNames[0].text; + + if(!mdnsServerName) { + responseHeader->serviceResult = UA_STATUSCODE_BADSERVERNAMEMISSING; + return; + } + + if(requestServer->discoveryUrlsSize == 0) { + responseHeader->serviceResult = UA_STATUSCODE_BADDISCOVERYURLMISSING; + return; + } + + if(requestServer->semaphoreFilePath.length) { +#ifdef UA_ENABLE_DISCOVERY_SEMAPHORE + char* filePath = (char*) + UA_malloc(sizeof(char)*requestServer->semaphoreFilePath.length+1); + if(!filePath) { + UA_LOG_ERROR_SESSION(&server->config.logger, session, + "Cannot allocate memory for semaphore path. Out of memory."); + responseHeader->serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + memcpy(filePath, requestServer->semaphoreFilePath.data, requestServer->semaphoreFilePath.length ); + filePath[requestServer->semaphoreFilePath.length] = '\0'; + if(!UA_fileExists( filePath )) { + responseHeader->serviceResult = UA_STATUSCODE_BADSEMPAHOREFILEMISSING; + UA_free(filePath); + return; + } + UA_free(filePath); +#else + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_CLIENT, + "Ignoring semaphore file path. open62541 not compiled " + "with UA_ENABLE_DISCOVERY_SEMAPHORE=ON"); +#endif + } + +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + if(server->config.mdnsEnabled) { + for(size_t i = 0; i < requestServer->discoveryUrlsSize; i++) { + /* create TXT if is online and first index, delete TXT if is offline and last index */ + UA_Boolean updateTxt = (requestServer->isOnline && i==0) || + (!requestServer->isOnline && i==requestServer->discoveryUrlsSize); + UA_Server_updateMdnsForDiscoveryUrl(server, mdnsServerName, mdnsConfig, + &requestServer->discoveryUrls[i], + requestServer->isOnline, updateTxt); + } + } +#endif + + if(!requestServer->isOnline) { + // server is shutting down. Remove it from the registered servers list + if(!registeredServer_entry) { + // server not found, show warning + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "Could not unregister server %.*s. Not registered.", + (int)requestServer->serverUri.length, requestServer->serverUri.data); + responseHeader->serviceResult = UA_STATUSCODE_BADNOTHINGTODO; + return; + } + + if(server->discoveryManager.registerServerCallback) { + UA_UNLOCK(server->serviceMutex); + server->discoveryManager. + registerServerCallback(requestServer, + server->discoveryManager.registerServerCallbackData); + UA_LOCK(server->serviceMutex); + } + + // server found, remove from list + LIST_REMOVE(registeredServer_entry, pointers); + UA_RegisteredServer_clear(®isteredServer_entry->registeredServer); + UA_free(registeredServer_entry); + server->discoveryManager.registeredServersSize--; + responseHeader->serviceResult = UA_STATUSCODE_GOOD; + return; + } + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(!registeredServer_entry) { + // server not yet registered, register it by adding it to the list + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Registering new server: %.*s", + (int)requestServer->serverUri.length, requestServer->serverUri.data); + + registeredServer_entry = + (registeredServer_list_entry *)UA_malloc(sizeof(registeredServer_list_entry)); + if(!registeredServer_entry) { + responseHeader->serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + LIST_INSERT_HEAD(&server->discoveryManager.registeredServers, registeredServer_entry, pointers); +#if UA_MULTITHREADING >= 200 + UA_atomic_addSize(&server->discoveryManager.registeredServersSize, 1); +#else + server->discoveryManager.registeredServersSize++; +#endif + } else { + UA_RegisteredServer_clear(®isteredServer_entry->registeredServer); + } + + // Always call the callback, if it is set. + // Previously we only called it if it was a new register call. It may be the case that this endpoint + // registered before, then crashed, restarts and registeres again. In that case the entry is not deleted + // and the callback would not be called. + if(server->discoveryManager.registerServerCallback) { + UA_UNLOCK(server->serviceMutex); + server->discoveryManager. + registerServerCallback(requestServer, + server->discoveryManager.registerServerCallbackData); + UA_LOCK(server->serviceMutex) + } + + // copy the data from the request into the list + UA_RegisteredServer_copy(requestServer, ®isteredServer_entry->registeredServer); + registeredServer_entry->lastSeen = UA_DateTime_nowMonotonic(); + responseHeader->serviceResult = retval; +} + +void Service_RegisterServer(UA_Server *server, UA_Session *session, + const UA_RegisterServerRequest *request, + UA_RegisterServerResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing RegisterServerRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + process_RegisterServer(server, session, &request->requestHeader, &request->server, 0, + NULL, &response->responseHeader, 0, NULL, 0, NULL); +} + +void Service_RegisterServer2(UA_Server *server, UA_Session *session, + const UA_RegisterServer2Request *request, + UA_RegisterServer2Response *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing RegisterServer2Request"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + process_RegisterServer(server, session, &request->requestHeader, &request->server, + request->discoveryConfigurationSize, request->discoveryConfiguration, + &response->responseHeader, &response->configurationResultsSize, + &response->configurationResults, &response->diagnosticInfosSize, + response->diagnosticInfos); +} + +/* Cleanup server registration: If the semaphore file path is set, then it just + * checks the existence of the file. When it is deleted, the registration is + * removed. If there is no semaphore file, then the registration will be removed + * if it is older than 60 minutes. */ +void UA_Discovery_cleanupTimedOut(UA_Server *server, UA_DateTime nowMonotonic) { + UA_DateTime timedOut = nowMonotonic; + // registration is timed out if lastSeen is older than 60 minutes (default + // value, can be modified by user). + if(server->config.discoveryCleanupTimeout) + timedOut -= server->config.discoveryCleanupTimeout * UA_DATETIME_SEC; + + registeredServer_list_entry* current, *temp; + LIST_FOREACH_SAFE(current, &server->discoveryManager.registeredServers, pointers, temp) { + UA_Boolean semaphoreDeleted = false; + +#ifdef UA_ENABLE_DISCOVERY_SEMAPHORE + if(current->registeredServer.semaphoreFilePath.length) { + size_t fpSize = sizeof(char)*current->registeredServer.semaphoreFilePath.length+1; + // todo: malloc may fail: return a statuscode + char* filePath = (char *)UA_malloc(fpSize); + if(filePath) { + memcpy(filePath, current->registeredServer.semaphoreFilePath.data, + current->registeredServer.semaphoreFilePath.length ); + filePath[current->registeredServer.semaphoreFilePath.length] = '\0'; + semaphoreDeleted = UA_fileExists(filePath) == false; + UA_free(filePath); + } else { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Cannot check registration semaphore. Out of memory"); + } + } +#endif + + if(semaphoreDeleted || (server->config.discoveryCleanupTimeout && + current->lastSeen < timedOut)) { + if(semaphoreDeleted) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Registration of server with URI %.*s is removed because " + "the semaphore file '%.*s' was deleted.", + (int)current->registeredServer.serverUri.length, + current->registeredServer.serverUri.data, + (int)current->registeredServer.semaphoreFilePath.length, + current->registeredServer.semaphoreFilePath.data); + } else { + // cppcheck-suppress unreadVariable + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Registration of server with URI %.*s has timed out and is removed.", + (int)current->registeredServer.serverUri.length, + current->registeredServer.serverUri.data); + } + LIST_REMOVE(current, pointers); + UA_RegisteredServer_clear(¤t->registeredServer); + UA_free(current); + server->discoveryManager.registeredServersSize--; + } + } +} + +/* Called by the UA_Server callback. The OPC UA specification says: + * + * > If an error occurs during registration (e.g. the Discovery Server is not running) then the Server + * > must periodically re-attempt registration. The frequency of these attempts should start at 1 second + * > but gradually increase until the registration frequency is the same as what it would be if not + * > errors occurred. The recommended approach would double the period each attempt until reaching the maximum. + * + * We will do so by using the additional data parameter which holds information + * if the next interval is default or if it is a repeated call. */ +static void +periodicServerRegister(UA_Server *server, void *data) { + UA_assert(data != NULL); + UA_LOCK(server->serviceMutex); + + struct PeriodicServerRegisterCallback *cb = (struct PeriodicServerRegisterCallback *)data; + + UA_StatusCode retval = UA_Client_connectSecureChannel(cb->client, cb->discovery_server_url); + if (retval == UA_STATUSCODE_GOOD) { + /* Register + You can also use a semaphore file. That file must exist. When the file is + deleted, the server is automatically unregistered. The semaphore file has + to be accessible by the discovery server + + UA_StatusCode retval = UA_Server_register_discovery(server, + "opc.tcp://localhost:4840", "/path/to/some/file"); + */ + retval = register_server_with_discovery_server(server, cb->client, false, NULL); + if (retval == UA_STATUSCODE_BADCONNECTIONCLOSED) { + /* If the periodic interval is higher than the maximum lifetime of + * the session, the server will close the connection. In this case + * we should try to reconnect */ + UA_Client_disconnect(cb->client); + retval = UA_Client_connectSecureChannel(cb->client, cb->discovery_server_url); + if (retval == UA_STATUSCODE_GOOD) { + retval = register_server_with_discovery_server(server, cb->client, false, NULL); + } + } + } + /* Registering failed */ + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Could not register server with discovery server. " + "Is the discovery server started? StatusCode %s", + UA_StatusCode_name(retval)); + + /* If the server was previously registered, retry in one second, + * else, double the previous interval */ + UA_Double nextInterval = 1000.0; + if(!cb->registered) + nextInterval = cb->this_interval * 2; + + /* The interval should be smaller than the default interval */ + if(nextInterval > cb->default_interval) + nextInterval = cb->default_interval; + + cb->this_interval = nextInterval; + changeRepeatedCallbackInterval(server, cb->id, nextInterval); + UA_UNLOCK(server->serviceMutex); + return; + } + + /* Registering succeeded */ + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Server successfully registered. Next periodical register will be in %d seconds", + (int)(cb->default_interval/1000)); + + if(!cb->registered) { + retval = changeRepeatedCallbackInterval(server, cb->id, cb->default_interval); + /* If changing the interval fails, try again after the next registering */ + if(retval == UA_STATUSCODE_GOOD) + cb->registered = true; + } + UA_UNLOCK(server->serviceMutex); +} + +UA_StatusCode +UA_Server_addPeriodicServerRegisterCallback(UA_Server *server, + struct UA_Client *client, + const char* discoveryServerUrl, + UA_Double intervalMs, + UA_Double delayFirstRegisterMs, + UA_UInt64 *periodicCallbackId) { + UA_LOCK(server->serviceMutex); + /* No valid server URL */ + if(!discoveryServerUrl) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "No discovery server URL provided"); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADINTERNALERROR; + } + + + if (client->connection.state != UA_CONNECTIONSTATE_CLOSED) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADINVALIDSTATE; + } + + /* Check if we are already registering with the given discovery url and + * remove the old periodic call */ + periodicServerRegisterCallback_entry *rs, *rs_tmp; + LIST_FOREACH_SAFE(rs, &server->discoveryManager. + periodicServerRegisterCallbacks, pointers, rs_tmp) { + if(strcmp(rs->callback->discovery_server_url, discoveryServerUrl) == 0) { + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "There is already a register callback for '%s' in place. " + "Removing the older one.", discoveryServerUrl); + removeCallback(server, rs->callback->id); + LIST_REMOVE(rs, pointers); + UA_free(rs->callback->discovery_server_url); + UA_free(rs->callback); + UA_free(rs); + break; + } + } + + /* Allocate and initialize */ + struct PeriodicServerRegisterCallback* cb = (struct PeriodicServerRegisterCallback*) + UA_malloc(sizeof(struct PeriodicServerRegisterCallback)); + if(!cb) { + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Start repeating a failed register after 1s, then increase the delay. Set + * to 500ms, as the delay is doubled before changing the callback + * interval.*/ + cb->this_interval = 500.0; + cb->default_interval = intervalMs; + cb->registered = false; + cb->client = client; + size_t len = strlen(discoveryServerUrl); + cb->discovery_server_url = (char*)UA_malloc(len+1); + if (!cb->discovery_server_url) { + UA_free(cb); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + memcpy(cb->discovery_server_url, discoveryServerUrl, len+1); + + /* Add the callback */ + UA_StatusCode retval = + addRepeatedCallback(server, periodicServerRegister, + cb, delayFirstRegisterMs, &cb->id); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Could not create periodic job for server register. " + "StatusCode %s", UA_StatusCode_name(retval)); + UA_free(cb); + UA_UNLOCK(server->serviceMutex); + return retval; + } + +#ifndef __clang_analyzer__ + // the analyzer reports on LIST_INSERT_HEAD a use after free false positive + periodicServerRegisterCallback_entry *newEntry = (periodicServerRegisterCallback_entry*) + UA_malloc(sizeof(periodicServerRegisterCallback_entry)); + if(!newEntry) { + removeCallback(server, cb->id); + UA_free(cb); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + newEntry->callback = cb; + LIST_INSERT_HEAD(&server->discoveryManager.periodicServerRegisterCallbacks, newEntry, pointers); +#endif + + if(periodicCallbackId) + *periodicCallbackId = cb->id; + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_GOOD; +} + +void +UA_Server_setRegisterServerCallback(UA_Server *server, + UA_Server_registerServerCallback cb, + void* data) { + UA_LOCK(server->serviceMutex); + server->discoveryManager.registerServerCallback = cb; + server->discoveryManager.registerServerCallbackData = data; + UA_UNLOCK(server->serviceMutex); +} + +#endif /* UA_ENABLE_DISCOVERY */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_subscription.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016-2017 (c) Florian Palm + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Ari Breitkreuz, fortiss GmbH + * Copyright 2017 (c) Mattias Bornhager + * Copyright 2017 (c) Henrik Norrman + * Copyright 2017-2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2017-2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +static void +setSubscriptionSettings(UA_Server *server, UA_Subscription *subscription, + UA_Double requestedPublishingInterval, + UA_UInt32 requestedLifetimeCount, + UA_UInt32 requestedMaxKeepAliveCount, + UA_UInt32 maxNotificationsPerPublish, + UA_Byte priority) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* re-parameterize the subscription */ + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.publishingIntervalLimits, + requestedPublishingInterval, subscription->publishingInterval); + /* check for nan*/ + if(requestedPublishingInterval != requestedPublishingInterval) + subscription->publishingInterval = server->config.publishingIntervalLimits.min; + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.keepAliveCountLimits, + requestedMaxKeepAliveCount, subscription->maxKeepAliveCount); + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.lifeTimeCountLimits, + requestedLifetimeCount, subscription->lifeTimeCount); + if(subscription->lifeTimeCount < 3 * subscription->maxKeepAliveCount) + subscription->lifeTimeCount = 3 * subscription->maxKeepAliveCount; + subscription->notificationsPerPublish = maxNotificationsPerPublish; + if(maxNotificationsPerPublish == 0 || + maxNotificationsPerPublish > server->config.maxNotificationsPerPublish) + subscription->notificationsPerPublish = server->config.maxNotificationsPerPublish; + subscription->priority = priority; +} + +void +Service_CreateSubscription(UA_Server *server, UA_Session *session, + const UA_CreateSubscriptionRequest *request, + UA_CreateSubscriptionResponse *response) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Check limits for the number of subscriptions */ + if(((server->config.maxSubscriptions != 0) && + (server->subscriptionsSize >= server->config.maxSubscriptions)) || + ((server->config.maxSubscriptionsPerSession != 0) && + (session->subscriptionsSize >= server->config.maxSubscriptionsPerSession))) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS; + return; + } + + /* Create the subscription */ + UA_Subscription *sub= UA_Subscription_new(); + if(!sub) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing CreateSubscriptionRequest failed"); + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + /* Set the subscription parameters */ + setSubscriptionSettings(server, sub, request->requestedPublishingInterval, + request->requestedLifetimeCount, request->requestedMaxKeepAliveCount, + request->maxNotificationsPerPublish, request->priority); + sub->publishingEnabled = request->publishingEnabled; + sub->currentKeepAliveCount = sub->maxKeepAliveCount; /* set settings first */ + + /* Assign the SubscriptionId */ + sub->subscriptionId = ++server->lastSubscriptionId; + + /* Register the cyclic callback */ + UA_StatusCode retval = Subscription_registerPublishCallback(server, sub); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_DEBUG_SESSION(&server->config.logger, sub->session, + "Subscription %" PRIu32 " | " + "Could not register publish callback with error code %s", + sub->subscriptionId, UA_StatusCode_name(retval)); + response->responseHeader.serviceResult = retval; + UA_Subscription_delete(server, sub); + return; + } + + /* Register the subscription in the server */ + LIST_INSERT_HEAD(&server->subscriptions, sub, serverListEntry); + server->subscriptionsSize++; + + /* Attach the Subscription to the session */ + UA_Session_attachSubscription(session, sub); + + /* Prepare the response */ + response->subscriptionId = sub->subscriptionId; + response->revisedPublishingInterval = sub->publishingInterval; + response->revisedLifetimeCount = sub->lifeTimeCount; + response->revisedMaxKeepAliveCount = sub->maxKeepAliveCount; + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, sub, + "Created the Subscription with a publishing interval of %.2f ms", + sub->publishingInterval); +} + +void +Service_ModifySubscription(UA_Server *server, UA_Session *session, + const UA_ModifySubscriptionRequest *request, + UA_ModifySubscriptionResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing ModifySubscriptionRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_Subscription *sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Store the old publishing interval */ + UA_Double oldPublishingInterval = sub->publishingInterval; + + /* Change the Subscription settings */ + setSubscriptionSettings(server, sub, request->requestedPublishingInterval, + request->requestedLifetimeCount, request->requestedMaxKeepAliveCount, + request->maxNotificationsPerPublish, request->priority); + + /* Reset the subscription lifetime */ + sub->currentLifetimeCount = 0; + + /* Change the repeated callback to the new interval. This cannot fail as the + * CallbackId must exist. */ + if(sub->publishCallbackId > 0 && + sub->publishingInterval != oldPublishingInterval) + changeRepeatedCallbackInterval(server, sub->publishCallbackId, sub->publishingInterval); + + /* Set the response */ + response->revisedPublishingInterval = sub->publishingInterval; + response->revisedLifetimeCount = sub->lifeTimeCount; + response->revisedMaxKeepAliveCount = sub->maxKeepAliveCount; +} + +static void +Operation_SetPublishingMode(UA_Server *server, UA_Session *session, + const UA_Boolean *publishingEnabled, const UA_UInt32 *subscriptionId, + UA_StatusCode *result) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_Subscription *sub = UA_Session_getSubscriptionById(session, *subscriptionId); + if(!sub) { + *result = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */ + sub->publishingEnabled = *publishingEnabled; /* Set the publishing mode */ +} + +void +Service_SetPublishingMode(UA_Server *server, UA_Session *session, + const UA_SetPublishingModeRequest *request, + UA_SetPublishingModeResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing SetPublishingModeRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_Boolean publishingEnabled = request->publishingEnabled; /* request is const */ + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_SetPublishingMode, + &publishingEnabled, + &request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +void +Service_Publish(UA_Server *server, UA_Session *session, + const UA_PublishRequest *request, UA_UInt32 requestId) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing PublishRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Return an error if the session has no subscription */ + if(TAILQ_EMPTY(&session->subscriptions)) { + sendServiceFault(session->header.channel, requestId, request->requestHeader.requestHandle, + &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], UA_STATUSCODE_BADNOSUBSCRIPTION); + return; + } + + /* Handle too many subscriptions to free resources before trying to allocate + * resources for the new publish request. If the limit has been reached the + * oldest publish request shall be responded */ + if((server->config.maxPublishReqPerSession != 0) && + (session->numPublishReq >= server->config.maxPublishReqPerSession)) { + if(!UA_Session_reachedPublishReqLimit(server, session)) { + sendServiceFault(session->header.channel, requestId, request->requestHeader.requestHandle, + &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], UA_STATUSCODE_BADINTERNALERROR); + return; + } + } + + /* Allocate the response to store it in the retransmission queue */ + UA_PublishResponseEntry *entry = (UA_PublishResponseEntry *) + UA_malloc(sizeof(UA_PublishResponseEntry)); + if(!entry) { + sendServiceFault(session->header.channel, requestId, request->requestHeader.requestHandle, + &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], UA_STATUSCODE_BADOUTOFMEMORY); + return; + } + + /* Prepare the response */ + entry->requestId = requestId; + UA_PublishResponse *response = &entry->response; + UA_PublishResponse_init(response); + response->responseHeader.requestHandle = request->requestHeader.requestHandle; + + /* Allocate the results array to acknowledge the acknowledge */ + if(request->subscriptionAcknowledgementsSize > 0) { + response->results = (UA_StatusCode *) + UA_Array_new(request->subscriptionAcknowledgementsSize, + &UA_TYPES[UA_TYPES_STATUSCODE]); + if(!response->results) { + UA_free(entry); + sendServiceFault(session->header.channel, requestId, request->requestHeader.requestHandle, + &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], UA_STATUSCODE_BADOUTOFMEMORY); + return; + } + response->resultsSize = request->subscriptionAcknowledgementsSize; + } + + /* Delete Acknowledged Subscription Messages */ + for(size_t i = 0; i < request->subscriptionAcknowledgementsSize; ++i) { + UA_SubscriptionAcknowledgement *ack = &request->subscriptionAcknowledgements[i]; + UA_Subscription *sub = UA_Session_getSubscriptionById(session, ack->subscriptionId); + if(!sub) { + response->results[i] = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Cannot process acknowledgements subscription %u" PRIu32, + ack->subscriptionId); + continue; + } + /* Remove the acked transmission from the retransmission queue */ + response->results[i] = UA_Subscription_removeRetransmissionMessage(sub, ack->sequenceNumber); + } + + /* Queue the publish response. It will be dequeued in a repeated publish + * callback. This can also be triggered right now for a late + * subscription. */ + UA_Session_queuePublishReq(session, entry, false); + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Queued a publication message"); + + /* If there are late subscriptions, the new publish request is used to + * answer them immediately. However, a single subscription that generates + * many notifications must not "starve" other late subscriptions. Hence we + * move it to the end of the queue when a response was sent. */ + UA_Subscription *late = NULL; + TAILQ_FOREACH(late, &session->subscriptions, sessionListEntry) { + if(late->state != UA_SUBSCRIPTIONSTATE_LATE) + continue; + + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, late, + "Send PublishResponse on a late subscription"); + UA_Subscription_publish(server, late); + /* If the subscription was not detached from the session during publish, + * enqueue at the end */ + if(late->session) { + TAILQ_REMOVE(&session->subscriptions, late, sessionListEntry); + TAILQ_INSERT_TAIL(&session->subscriptions, late, sessionListEntry); + } + break; + } +} + +static void +Operation_DeleteSubscription(UA_Server *server, UA_Session *session, void *_, + const UA_UInt32 *subscriptionId, UA_StatusCode *result) { + UA_Subscription *sub = UA_Session_getSubscriptionById(session, *subscriptionId); + if(!sub) { + *result = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Deleting Subscription with Id %" PRIu32 " failed with error code %s", + *subscriptionId, UA_StatusCode_name(*result)); + return; + } + + UA_Subscription_delete(server, sub); + *result = UA_STATUSCODE_GOOD; + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Subscription %" PRIu32 " | Subscription deleted", + *subscriptionId); +} + +void +Service_DeleteSubscriptions(UA_Server *server, UA_Session *session, + const UA_DeleteSubscriptionsRequest *request, + UA_DeleteSubscriptionsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing DeleteSubscriptionsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_DeleteSubscription, NULL, + &request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +void +Service_Republish(UA_Server *server, UA_Session *session, + const UA_RepublishRequest *request, + UA_RepublishResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing RepublishRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Get the subscription */ + UA_Subscription *sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Reset the subscription lifetime */ + sub->currentLifetimeCount = 0; + + /* Find the notification in the retransmission queue */ + UA_NotificationMessageEntry *entry; + TAILQ_FOREACH(entry, &sub->retransmissionQueue, listEntry) { + if(entry->message.sequenceNumber == request->retransmitSequenceNumber) + break; + } + if(!entry) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADMESSAGENOTAVAILABLE; + return; + } + + response->responseHeader.serviceResult = + UA_NotificationMessage_copy(&entry->message, &response->notificationMessage); +} + +static UA_StatusCode +setTransferredSequenceNumbers(const UA_Subscription *sub, UA_TransferResult *result) { + /* Allocate memory */ + result->availableSequenceNumbers = (UA_UInt32*) + UA_Array_new(sub->retransmissionQueueSize, &UA_TYPES[UA_TYPES_UINT32]); + if(!result->availableSequenceNumbers) + return UA_STATUSCODE_BADOUTOFMEMORY; + result->availableSequenceNumbersSize = sub->retransmissionQueueSize; + + /* Copy over the sequence numbers */ + UA_NotificationMessageEntry *entry; + size_t i = 0; + TAILQ_FOREACH(entry, &sub->retransmissionQueue, listEntry) { + result->availableSequenceNumbers[i] = entry->message.sequenceNumber; + i++; + } + + UA_assert(i == result->availableSequenceNumbersSize); + + return UA_STATUSCODE_GOOD; +} + +static void +Operation_TransferSubscription(UA_Server *server, UA_Session *session, + const UA_Boolean *sendInitialValues, + const UA_UInt32 *subscriptionId, + UA_TransferResult *result) { + /* Get the subscription. This requires a server-wide lookup instead of the + * usual session-wide lookup. */ + UA_Subscription *sub = UA_Server_getSubscriptionById(server, *subscriptionId); + if(!sub) { + result->statusCode = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Is this the same session? Return the sequence numbers and do nothing else. */ + UA_Session *oldSession = sub->session; + if(oldSession == session) { + result->statusCode = setTransferredSequenceNumbers(sub, result); + return; + } + + /* Check with AccessControl if the transfer is allowed */ + if(!server->config.accessControl.allowTransferSubscription || + !server->config.accessControl. + allowTransferSubscription(server, &server->config.accessControl, + oldSession ? &oldSession->sessionId : NULL, + oldSession ? oldSession->sessionHandle : NULL, + &session->sessionId, session->sessionHandle)) { + result->statusCode = UA_STATUSCODE_BADUSERACCESSDENIED; + return; + } + + /* Check limits for the number of subscriptions for this Session */ + if((server->config.maxSubscriptionsPerSession != 0) && + (session->subscriptionsSize >= server->config.maxSubscriptionsPerSession)) { + result->statusCode = UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS; + return; + } + + /* Allocate memory for the new subscription */ + UA_Subscription *newSub = (UA_Subscription*)UA_malloc(sizeof(UA_Subscription)); + if(!newSub) { + result->statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + /* Set the available sequence numbers */ + result->statusCode = setTransferredSequenceNumbers(sub, result); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_free(newSub); + return; + } + + /* Create an identical copy of the Subscription struct. The original + * subscription remains in place until a StatusChange notification has been + * sent. The elements for lists and queues are moved over manually to ensure + * that all backpointers are set correctly. */ + memcpy(newSub, sub, sizeof(UA_Subscription)); + + /* Register cyclic publish callback */ + result->statusCode = Subscription_registerPublishCallback(server, newSub); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_Array_delete(result->availableSequenceNumbers, + sub->retransmissionQueueSize, &UA_TYPES[UA_TYPES_UINT32]); + result->availableSequenceNumbers = NULL; + result->availableSequenceNumbersSize = 0; + UA_free(newSub); + return; + } + + /* <-- The point of no return --> */ + + /* Move over the MonitoredItems and adjust the backpointers */ + LIST_INIT(&newSub->monitoredItems); + UA_MonitoredItem *mon, *mon_tmp; + LIST_FOREACH_SAFE(mon, &sub->monitoredItems, listEntry, mon_tmp) { + LIST_REMOVE(mon, listEntry); + mon->subscription = newSub; + LIST_INSERT_HEAD(&newSub->monitoredItems, mon, listEntry); + } + sub->monitoredItemsSize = 0; + + /* Move over the notification queue */ + TAILQ_INIT(&newSub->notificationQueue); + UA_Notification *nn; + TAILQ_FOREACH(nn, &sub->notificationQueue, globalEntry) { + TAILQ_REMOVE(&sub->notificationQueue, nn, globalEntry); + TAILQ_INSERT_TAIL(&newSub->notificationQueue, nn, globalEntry); + } + sub->notificationQueueSize = 0; + sub->dataChangeNotifications = 0; + sub->eventNotifications = 0; + sub->readyNotifications = 0; + + TAILQ_INIT(&newSub->retransmissionQueue); + UA_NotificationMessageEntry *nme, *nme_tmp; + TAILQ_FOREACH_SAFE(nme, &sub->retransmissionQueue, listEntry, nme_tmp) { + TAILQ_REMOVE(&sub->retransmissionQueue, nme, listEntry); + TAILQ_INSERT_TAIL(&newSub->retransmissionQueue, nme, listEntry); + if(oldSession) + oldSession->totalRetransmissionQueueSize -= 1; + sub->retransmissionQueueSize -= 1; + } + UA_assert(sub->retransmissionQueueSize == 0); + sub->retransmissionQueueSize = 0; + + /* Add to the server */ + UA_assert(newSub->subscriptionId == sub->subscriptionId); + LIST_INSERT_HEAD(&server->subscriptions, newSub, serverListEntry); + server->subscriptionsSize++; + + /* Attach to the session */ + UA_Session_attachSubscription(session, newSub); + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, newSub, "Transferred to this Session"); + + /* Set StatusChange in the original subscription and force publish. This + * also removes the Subscription, even if there was no PublishResponse + * queued to send a StatusChangeNotification. */ + sub->statusChange = UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED; + UA_Subscription_publish(server, sub); + UA_assert(sub->publishCallbackId == 0); + + /* Create notifications with the current values */ + if(*sendInitialValues) { + LIST_FOREACH(mon, &newSub->monitoredItems, listEntry) { + + /* Create only DataChange notifications */ + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) + continue; + + /* Only if the mode is monitoring */ + if(mon->monitoringMode != UA_MONITORINGMODE_REPORTING) + continue; + + /* If a value is queued for a data MonitoredItem, the next value in + * the queue is sent in the Publish response. */ + if(mon->queueSize > 0) + continue; + + /* Create a notification with the last sampled value */ + UA_MonitoredItem_createDataChangeNotification(server, newSub, mon, + &mon->lastValue); + } + } + + /* Immediately try to publish. If the notification was late, include the new + * sample in the "ready-list" and don't wait until the next cyclic + * timeout. */ + newSub->readyNotifications = newSub->notificationQueueSize; + UA_Subscription_publish(server, newSub); +} + +void Service_TransferSubscriptions(UA_Server *server, UA_Session *session, + const UA_TransferSubscriptionsRequest *request, + UA_TransferSubscriptionsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing TransferSubscriptionsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_TransferSubscription, + &request->sendInitialValues, + &request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32], + &response->resultsSize, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_monitoreditem.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016-2017 (c) Florian Palm + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Ari Breitkreuz, fortiss GmbH + * Copyright 2017 (c) Mattias Bornhager + * Copyright 2017 (c) Henrik Norrman + * Copyright 2017-2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2020 (c) Kalycito Infotech Private Limited + */ + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +#ifdef UA_ENABLE_DA + +/* Translate a percentage deadband into an absolute deadband based on the + * UARange property of the variable */ +static UA_StatusCode +setAbsoluteFromPercentageDeadband(UA_Server *server, UA_Session *session, + const UA_MonitoredItem *mon, UA_DataChangeFilter *filter) { + /* A valid deadband? */ + if(filter->deadbandValue < 0.0 || filter->deadbandValue > 100.0) + return UA_STATUSCODE_BADDEADBANDFILTERINVALID; + + /* Browse for the percent range */ + UA_QualifiedName qn = UA_QUALIFIEDNAME(0, "EURange"); + UA_BrowsePathResult bpr = + browseSimplifiedBrowsePath(server, mon->itemToMonitor.nodeId, 1, &qn); + if(bpr.statusCode != UA_STATUSCODE_GOOD || bpr.targetsSize < 1) { + UA_BrowsePathResult_clear(&bpr); + return UA_STATUSCODE_BADFILTERNOTALLOWED; + } + + /* Read the range */ + UA_ReadValueId rvi; + UA_ReadValueId_init(&rvi); + rvi.nodeId = bpr.targets->targetId.nodeId; + rvi.attributeId = UA_ATTRIBUTEID_VALUE; + UA_DataValue rangeVal = UA_Server_readWithSession(server, session, &rvi, + UA_TIMESTAMPSTORETURN_NEITHER); + UA_BrowsePathResult_clear(&bpr); + if(!UA_Variant_isScalar(&rangeVal.value) || + rangeVal.value.type != &UA_TYPES[UA_TYPES_RANGE]) { + UA_DataValue_clear(&rangeVal); + return UA_STATUSCODE_BADFILTERNOTALLOWED; + } + + /* Compute the abs deadband */ + UA_Range *euRange = (UA_Range*)rangeVal.value.data; + UA_Double absDeadband = (filter->deadbandValue/100.0) * (euRange->high - euRange->low); + + /* EURange invalid or NaN? */ + if(absDeadband < 0.0 || absDeadband != absDeadband) { + UA_DataValue_clear(&rangeVal); + return UA_STATUSCODE_BADFILTERNOTALLOWED; + } + + /* Adjust the original filter */ + filter->deadbandType = UA_DEADBANDTYPE_ABSOLUTE; + filter->deadbandValue = absDeadband; + return UA_STATUSCODE_GOOD; +} + +#endif /* UA_ENABLE_DA */ + +void +Service_SetTriggering(UA_Server *server, UA_Session *session, + const UA_SetTriggeringRequest *request, + UA_SetTriggeringResponse *response) { + /* Nothing to do? */ + if(request->linksToRemoveSize == 0 && + request->linksToAddSize == 0) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO; + return; + } + + /* Get the Subscription */ + UA_Subscription *sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Get the MonitoredItem */ + UA_MonitoredItem *mon = UA_Subscription_getMonitoredItem(sub, request->triggeringItemId); + if(!mon) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + return; + } + + /* Allocate the results arrays */ + if(request->linksToRemoveSize > 0) { + response->removeResults = (UA_StatusCode*) + UA_Array_new(request->linksToRemoveSize, &UA_TYPES[UA_TYPES_STATUSCODE]); + if(!response->removeResults) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + response->removeResultsSize = request->linksToRemoveSize; + } + + if(request->linksToAddSize> 0) { + response->addResults = (UA_StatusCode*) + UA_Array_new(request->linksToAddSize, &UA_TYPES[UA_TYPES_STATUSCODE]); + if(!response->addResults) { + UA_Array_delete(response->removeResults, + request->linksToAddSize, &UA_TYPES[UA_TYPES_STATUSCODE]); + response->removeResults = NULL; + response->removeResultsSize = 0; + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + response->addResultsSize = request->linksToAddSize; + } + + /* Apply the changes */ + for(size_t i = 0; i < request->linksToRemoveSize; i++) + response->removeResults[i] = + UA_MonitoredItem_removeLink(sub, mon, request->linksToRemove[i]); + + for(size_t i = 0; i < request->linksToAddSize; i++) + response->addResults[i] = + UA_MonitoredItem_addLink(sub, mon, request->linksToAdd[i]); +} + +/* Verify and adjust the parameters of a MonitoredItem */ +static UA_StatusCode +checkAdjustMonitoredItemParams(UA_Server *server, UA_Session *session, + const UA_MonitoredItem *mon, + const UA_DataType* valueType, + UA_MonitoringParameters *params) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Check the filter */ + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) { + /* Event MonitoredItems need a filter */ +#ifndef UA_ENABLE_SUBSCRIPTIONS_EVENTS + return UA_STATUSCODE_BADNOTSUPPORTED; +#else + if(params->filter.encoding != UA_EXTENSIONOBJECT_DECODED && + params->filter.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) + return UA_STATUSCODE_BADEVENTFILTERINVALID; + if(params->filter.content.decoded.type != &UA_TYPES[UA_TYPES_EVENTFILTER]) + return UA_STATUSCODE_BADEVENTFILTERINVALID; +#endif + } else { + /* DataChange MonitoredItem. Can be "no filter" which defaults to + * triggering on Status and Value. */ + if(params->filter.encoding != UA_EXTENSIONOBJECT_DECODED && + params->filter.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE && + params->filter.encoding != UA_EXTENSIONOBJECT_ENCODED_NOBODY) + return UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED; + + /* If the filter ExtensionObject has a body, then it must be a + * DataChangeFilter */ + if(params->filter.encoding != UA_EXTENSIONOBJECT_ENCODED_NOBODY && + params->filter.content.decoded.type != &UA_TYPES[UA_TYPES_DATACHANGEFILTER]) + return UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED; + + /* Check the deadband and adjust if necessary. */ + if(params->filter.content.decoded.type == &UA_TYPES[UA_TYPES_DATACHANGEFILTER]) { + UA_DataChangeFilter *filter = (UA_DataChangeFilter *) + params->filter.content.decoded.data; + switch(filter->deadbandType) { + case UA_DEADBANDTYPE_NONE: + break; + case UA_DEADBANDTYPE_ABSOLUTE: + if(!valueType || !UA_DataType_isNumeric(valueType)) + return UA_STATUSCODE_BADFILTERNOTALLOWED; + break; +#ifdef UA_ENABLE_DA + case UA_DEADBANDTYPE_PERCENT: { + if(!valueType || !UA_DataType_isNumeric(valueType)) + return UA_STATUSCODE_BADFILTERNOTALLOWED; + /* If percentage deadband is supported, look up the range values + * and precompute as if it was an absolute deadband. */ + UA_StatusCode res = + setAbsoluteFromPercentageDeadband(server, session, mon, filter); + if(res != UA_STATUSCODE_GOOD) + return res; + break; + } +#endif + default: + return UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED; + } + } + } + + /* Read the minimum sampling interval for the variable */ + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_VALUE) { + const UA_Node *node = UA_NODESTORE_GET(server, &mon->itemToMonitor.nodeId); + if(node) { + const UA_VariableNode *vn = &node->variableNode; + if(node->head.nodeClass == UA_NODECLASS_VARIABLE && + params->samplingInterval < vn->minimumSamplingInterval) + params->samplingInterval = vn->minimumSamplingInterval; + UA_NODESTORE_RELEASE(server, node); + } + } + + /* Adjust to sampling interval to lie within the limits and check for NaN */ + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.samplingIntervalLimits, + params->samplingInterval, params->samplingInterval); + if(mon->parameters.samplingInterval != mon->parameters.samplingInterval) + params->samplingInterval = server->config.samplingIntervalLimits.min; + + /* Adjust the maximum queue size */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) { + /* 0 => Set to the configured maximum. Otherwise adjust with configured limits */ + if(params->queueSize == 0) { + params->queueSize = server->config.queueSizeLimits.max; + } else { + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.queueSizeLimits, + params->queueSize, params->queueSize); + } + } else +#endif + { + /* 0 or 1 => queue-size 1. Otherwise adjust with configured limits */ + if(params->queueSize == 0) + params->queueSize = 1; + if(params->queueSize != 1) + UA_BOUNDEDVALUE_SETWBOUNDS(server->config.queueSizeLimits, + params->queueSize, params->queueSize); + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setMonitoringMode(UA_Server *server, UA_MonitoredItem *mon, + UA_MonitoringMode monitoringMode); + +static const UA_String +binaryEncoding = {sizeof("Default Binary") - 1, (UA_Byte *)"Default Binary"}; + +/* Structure to pass additional arguments into the operation */ +struct createMonContext { + UA_Subscription *sub; + UA_TimestampsToReturn timestampsToReturn; + + /* If sub is NULL, use local callbacks */ + UA_Server_DataChangeNotificationCallback dataChangeCallback; + void *context; +}; + +static void +Operation_CreateMonitoredItem(UA_Server *server, UA_Session *session, + struct createMonContext *cmc, + const UA_MonitoredItemCreateRequest *request, + UA_MonitoredItemCreateResult *result) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Check available capacity */ + if(cmc->sub && + (((server->config.maxMonitoredItems != 0) && + (server->monitoredItemsSize >= server->config.maxMonitoredItems)) || + ((server->config.maxMonitoredItemsPerSubscription != 0) && + (cmc->sub->monitoredItemsSize >= server->config.maxMonitoredItemsPerSubscription)))) { + result->statusCode = UA_STATUSCODE_BADTOOMANYMONITOREDITEMS; + return; + } + + /* Check if the encoding is supported */ + if(request->itemToMonitor.dataEncoding.name.length > 0 && + (!UA_String_equal(&binaryEncoding, &request->itemToMonitor.dataEncoding.name) || + request->itemToMonitor.dataEncoding.namespaceIndex != 0)) { + result->statusCode = UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED; + return; + } + + /* Check if the encoding is set for a value */ + if(request->itemToMonitor.attributeId != UA_ATTRIBUTEID_VALUE && + request->itemToMonitor.dataEncoding.name.length > 0) { + result->statusCode = UA_STATUSCODE_BADDATAENCODINGINVALID; + return; + } + + /* Make an example read to get errors in the itemToMonitor. Allow return + * codes "good" and "uncertain", as well as a list of statuscodes that might + * be repaired inside the data source. */ + UA_DataValue v = UA_Server_readWithSession(server, session, &request->itemToMonitor, + cmc->timestampsToReturn); + if(v.hasStatus && (v.status >> 30) > 1 && + v.status != UA_STATUSCODE_BADRESOURCEUNAVAILABLE && + v.status != UA_STATUSCODE_BADCOMMUNICATIONERROR && + v.status != UA_STATUSCODE_BADWAITINGFORINITIALDATA && + v.status != UA_STATUSCODE_BADUSERACCESSDENIED && + v.status != UA_STATUSCODE_BADNOTREADABLE && + v.status != UA_STATUSCODE_BADINDEXRANGENODATA) { + result->statusCode = v.status; + UA_DataValue_clear(&v); + return; + } + + /* Adding an Event MonitoredItem */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(request->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) { + /* TODO: Only remote clients can add Event-MonitoredItems at the moment */ + if(!cmc->sub) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Only remote clients can add Event-MonitoredItems"); + result->statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + UA_DataValue_clear(&v); + return; + } + + /* If the 'SubscribeToEvents' bit of EventNotifier attribute is + * zero, then the object cannot be subscribed to monitor events */ + if(!v.hasValue || !v.value.data) { + result->statusCode = UA_STATUSCODE_BADINTERNALERROR; + UA_DataValue_clear(&v); + return; + } + UA_Byte eventNotifierValue = *((UA_Byte *)v.value.data); + if((eventNotifierValue & 0x01) != 1) { + result->statusCode = UA_STATUSCODE_BADNOTSUPPORTED; + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, cmc->sub, + "Could not create a MonitoredItem as the " + "'SubscribeToEvents' bit of the EventNotifier " + "attribute is not set"); + UA_DataValue_clear(&v); + return; + } + } +#endif + + const UA_DataType *valueType = v.value.type; + UA_DataValue_clear(&v); + + /* Allocate the MonitoredItem */ + UA_MonitoredItem *newMon = NULL; + if(cmc->sub) { + newMon = (UA_MonitoredItem*)UA_malloc(sizeof(UA_MonitoredItem)); + } else { + UA_LocalMonitoredItem *localMon = (UA_LocalMonitoredItem*) + UA_malloc(sizeof(UA_LocalMonitoredItem)); + if(localMon) { + /* Set special values only for the LocalMonitoredItem */ + localMon->context = cmc->context; + localMon->callback.dataChangeCallback = cmc->dataChangeCallback; + } + newMon = &localMon->monitoredItem; + } + if(!newMon) { + result->statusCode = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + + /* Initialize the MonitoredItem */ + UA_MonitoredItem_init(newMon); + newMon->subscription = cmc->sub; /* Can be NULL for local MonitoredItems */ + newMon->timestampsToReturn = cmc->timestampsToReturn; + result->statusCode |= UA_ReadValueId_copy(&request->itemToMonitor, + &newMon->itemToMonitor); + result->statusCode |= UA_MonitoringParameters_copy(&request->requestedParameters, + &newMon->parameters); + result->statusCode |= checkAdjustMonitoredItemParams(server, session, newMon, + valueType, &newMon->parameters); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, cmc->sub, + "Could not create a MonitoredItem " + "with StatusCode %s", + UA_StatusCode_name(result->statusCode)); + UA_MonitoredItem_delete(server, newMon); + return; + } + + /* Register the Monitoreditem in the server and subscription. Add Events as + * "listeners" to the monitored Node. */ + result->statusCode = UA_Server_registerMonitoredItem(server, newMon); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_MonitoredItem_delete(server, newMon); + return; + } + + /* Activate the MonitoredItem */ + result->statusCode |= setMonitoringMode(server, newMon, request->monitoringMode); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_MonitoredItem_delete(server, newMon); + return; + } + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, cmc->sub, + "MonitoredItem %" PRIi32 " | " + "Created the MonitoredItem " + "(Sampling Interval: %fms, Queue Size: %lu)", + newMon->monitoredItemId, + newMon->parameters.samplingInterval, + (unsigned long)newMon->queueSize); + + /* Create the first sample */ + if(request->monitoringMode > UA_MONITORINGMODE_DISABLED && + newMon->itemToMonitor.attributeId != UA_ATTRIBUTEID_EVENTNOTIFIER) + monitoredItem_sampleCallback(server, newMon); + + /* Prepare the response */ + result->revisedSamplingInterval = newMon->parameters.samplingInterval; + result->revisedQueueSize = newMon->parameters.queueSize; + result->monitoredItemId = newMon->monitoredItemId; +} + +void +Service_CreateMonitoredItems(UA_Server *server, UA_Session *session, + const UA_CreateMonitoredItemsRequest *request, + UA_CreateMonitoredItemsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing CreateMonitoredItemsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxMonitoredItemsPerCall != 0 && + request->itemsToCreateSize > server->config.maxMonitoredItemsPerCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* Check if the timestampstoreturn is valid */ + struct createMonContext cmc; + cmc.timestampsToReturn = request->timestampsToReturn; + if(cmc.timestampsToReturn > UA_TIMESTAMPSTORETURN_NEITHER) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID; + return; + } + + /* Find the subscription */ + cmc.sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!cmc.sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Reset the subscription lifetime */ + cmc.sub->currentLifetimeCount = 0; + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_CreateMonitoredItem, &cmc, + &request->itemsToCreateSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST], + &response->resultsSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +UA_MonitoredItemCreateResult +UA_Server_createDataChangeMonitoredItem(UA_Server *server, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, + void *monitoredItemContext, + UA_Server_DataChangeNotificationCallback callback) { + struct createMonContext cmc; + cmc.sub = NULL; + cmc.context = monitoredItemContext; + cmc.dataChangeCallback = callback; + cmc.timestampsToReturn = timestampsToReturn; + + UA_MonitoredItemCreateResult result; + UA_MonitoredItemCreateResult_init(&result); + UA_LOCK(server->serviceMutex); + Operation_CreateMonitoredItem(server, &server->adminSession, &cmc, &item, &result); + UA_UNLOCK(server->serviceMutex); + return result; +} + +static void +Operation_ModifyMonitoredItem(UA_Server *server, UA_Session *session, UA_Subscription *sub, + const UA_MonitoredItemModifyRequest *request, + UA_MonitoredItemModifyResult *result) { + /* Get the MonitoredItem */ + UA_MonitoredItem *mon = UA_Subscription_getMonitoredItem(sub, request->monitoredItemId); + if(!mon) { + result->statusCode = UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + return; + } + + /* Make local copy of the settings */ + UA_MonitoringParameters params; + result->statusCode = + UA_MonitoringParameters_copy(&request->requestedParameters, ¶ms); + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + + /* Read the current value to test if filters are possible. + * Can return an empty value (v.value.type == NULL). */ + UA_DataValue v = + UA_Server_readWithSession(server, session, &mon->itemToMonitor, + mon->timestampsToReturn); + + /* Verify and adjust the new parameters. This still leaves the original + * MonitoredItem untouched. */ + result->statusCode = + checkAdjustMonitoredItemParams(server, session, mon, + v.value.type, ¶ms); + UA_DataValue_clear(&v); + if(result->statusCode != UA_STATUSCODE_GOOD) { + UA_MonitoringParameters_clear(¶ms); + return; + } + + /* Store the old sampling interval */ + UA_Double oldSamplingInterval = mon->parameters.samplingInterval; + + /* Move over the new settings */ + UA_MonitoringParameters_clear(&mon->parameters); + mon->parameters = params; + + /* Re-register the callback if necessary */ + if(oldSamplingInterval != mon->parameters.samplingInterval) { + UA_MonitoredItem_unregisterSampleCallback(server, mon); + result->statusCode = setMonitoringMode(server, mon, mon->monitoringMode); + } + + result->revisedSamplingInterval = mon->parameters.samplingInterval; + result->revisedQueueSize = mon->parameters.queueSize; + + /* Remove some notifications if the queue is now too small */ + UA_MonitoredItem_ensureQueueSpace(server, mon); + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "Modified the MonitoredItem " + "(Sampling Interval: %fms, Queue Size: %lu)", + mon->monitoredItemId, + mon->parameters.samplingInterval, + (unsigned long)mon->queueSize); +} + +void +Service_ModifyMonitoredItems(UA_Server *server, UA_Session *session, + const UA_ModifyMonitoredItemsRequest *request, + UA_ModifyMonitoredItemsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing ModifyMonitoredItemsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxMonitoredItemsPerCall != 0 && + request->itemsToModifySize > server->config.maxMonitoredItemsPerCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* Check if the timestampstoreturn is valid */ + if(request->timestampsToReturn > UA_TIMESTAMPSTORETURN_NEITHER) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID; + return; + } + + /* Get the subscription */ + UA_Subscription *sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */ + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_ModifyMonitoredItem, sub, + &request->itemsToModifySize, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST], + &response->resultsSize, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +struct setMonitoringContext { + UA_Subscription *sub; + UA_MonitoringMode monitoringMode; +}; + +static UA_StatusCode +setMonitoringMode(UA_Server *server, UA_MonitoredItem *mon, + UA_MonitoringMode monitoringMode) { + /* Check if the MonitoringMode is valid or not */ + if(monitoringMode > UA_MONITORINGMODE_REPORTING) + return UA_STATUSCODE_BADMONITORINGMODEINVALID; + + /* Set the MonitoringMode */ + mon->monitoringMode = monitoringMode; + + UA_Notification *notification; + /* Reporting is disabled. This causes all Notifications to be dequeued and + * deleted. Also remove the last samples so that we immediately generate a + * Notification when re-activated. */ + if(mon->monitoringMode == UA_MONITORINGMODE_DISABLED) { + UA_Notification *notification_tmp; + UA_MonitoredItem_unregisterSampleCallback(server, mon); + TAILQ_FOREACH_SAFE(notification, &mon->queue, listEntry, notification_tmp) + UA_Notification_delete(server, notification); + UA_ByteString_clear(&mon->lastSampledValue); + UA_DataValue_clear(&mon->lastValue); + return UA_STATUSCODE_GOOD; + } + + /* When reporting is enabled, put all notifications that were already + * sampled into the global queue of the subscription. When sampling is + * enabled, remove all notifications from the global queue. !!! This needs + * to be the same operation as in UA_Notification_enqueue !!! */ + if(mon->monitoringMode == UA_MONITORINGMODE_REPORTING) { + /* Make all notifications reporting. Re-enqueue to ensure they have the + * right order if some notifications are already reported by a trigger + * link. */ + TAILQ_FOREACH(notification, &mon->queue, listEntry) { + UA_Notification_dequeueSub(notification); + UA_Notification_enqueueSub(notification); + } + } else /* mon->monitoringMode == UA_MONITORINGMODE_SAMPLING */ { + /* Make all notifications non-reporting */ + TAILQ_FOREACH(notification, &mon->queue, listEntry) + UA_Notification_dequeueSub(notification); + } + + /* Register the sampling callback with an interval. If registering the + * sampling callback failed, set to disabled. But don't delete the current + * notifications. */ + UA_StatusCode res = UA_MonitoredItem_registerSampleCallback(server, mon); + if(res != UA_STATUSCODE_GOOD) + mon->monitoringMode = UA_MONITORINGMODE_DISABLED; + return res; +} + +static void +Operation_SetMonitoringMode(UA_Server *server, UA_Session *session, + struct setMonitoringContext *smc, + const UA_UInt32 *monitoredItemId, UA_StatusCode *result) { + UA_MonitoredItem *mon = UA_Subscription_getMonitoredItem(smc->sub, *monitoredItemId); + if(!mon) { + *result = UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + return; + } + *result = setMonitoringMode(server, mon, smc->monitoringMode); +} + +void +Service_SetMonitoringMode(UA_Server *server, UA_Session *session, + const UA_SetMonitoringModeRequest *request, + UA_SetMonitoringModeResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing SetMonitoringMode"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxMonitoredItemsPerCall != 0 && + request->monitoredItemIdsSize > server->config.maxMonitoredItemsPerCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* Get the subscription */ + struct setMonitoringContext smc; + smc.sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!smc.sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + smc.sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */ + + smc.monitoringMode = request->monitoringMode; + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_SetMonitoringMode, &smc, + &request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +static void +Operation_DeleteMonitoredItem(UA_Server *server, UA_Session *session, UA_Subscription *sub, + const UA_UInt32 *monitoredItemId, UA_StatusCode *result) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_MonitoredItem *mon = UA_Subscription_getMonitoredItem(sub, *monitoredItemId); + if(!mon) { + *result = UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + return; + } + UA_MonitoredItem_delete(server, mon); +} + +void +Service_DeleteMonitoredItems(UA_Server *server, UA_Session *session, + const UA_DeleteMonitoredItemsRequest *request, + UA_DeleteMonitoredItemsResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing DeleteMonitoredItemsRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxMonitoredItemsPerCall != 0 && + request->monitoredItemIdsSize > server->config.maxMonitoredItemsPerCall) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + /* Get the subscription */ + UA_Subscription *sub = UA_Session_getSubscriptionById(session, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + /* Reset the subscription lifetime */ + sub->currentLifetimeCount = 0; + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_DeleteMonitoredItem, sub, + &request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_StatusCode +UA_Server_deleteMonitoredItem(UA_Server *server, UA_UInt32 monitoredItemId) { + UA_LOCK(server->serviceMutex); + UA_MonitoredItem *mon, *mon_tmp; + LIST_FOREACH_SAFE(mon, &server->localMonitoredItems, listEntry, mon_tmp) { + if(mon->monitoredItemId != monitoredItemId) + continue; + UA_MonitoredItem_delete(server, mon); + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_GOOD; + } + UA_UNLOCK(server->serviceMutex); + return UA_STATUSCODE_BADMONITOREDITEMIDINVALID; +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_securechannel.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014, 2017 (c) Florian Palm + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + */ + + +#ifndef container_of +#define container_of(ptr, type, member) \ + (type *)((uintptr_t)ptr - offsetof(type,member)) +#endif + +static void +removeSecureChannelCallback(void *_, channel_entry *entry) { + UA_SecureChannel_close(&entry->channel); +} + +/* Half-closes the channel. Will be completely closed / deleted in a deferred + * callback. Deferring is necessary so we don't remove lists that are still + * processed upwards the call stack. */ +static void +removeSecureChannel(UA_Server *server, channel_entry *entry, + UA_DiagnosticEvent event) { + if(entry->channel.state == UA_SECURECHANNELSTATE_CLOSING) + return; + entry->channel.state = UA_SECURECHANNELSTATE_CLOSING; + + /* Detach from the connection and close the connection */ + if(entry->channel.connection) { + if(entry->channel.connection->state != UA_CONNECTIONSTATE_CLOSED) + entry->channel.connection->close(entry->channel.connection); + UA_Connection_detachSecureChannel(entry->channel.connection); + } + + /* Detach the channel */ + TAILQ_REMOVE(&server->channels, entry, pointers); + + /* Update the statistics */ + UA_SecureChannelStatistics *scs = &server->serverStats.scs; + UA_atomic_subSize(&scs->currentChannelCount, 1); + switch(event) { + case UA_DIAGNOSTICEVENT_CLOSE: + break; + case UA_DIAGNOSTICEVENT_TIMEOUT: + UA_atomic_addSize(&scs->channelTimeoutCount, 1); + break; + case UA_DIAGNOSTICEVENT_PURGE: + UA_atomic_addSize(&scs->channelPurgeCount, 1); + break; + case UA_DIAGNOSTICEVENT_REJECT: + case UA_DIAGNOSTICEVENT_SECURITYREJECT: + UA_atomic_addSize(&scs->rejectedChannelCount, 1); + break; + case UA_DIAGNOSTICEVENT_ABORT: + UA_atomic_addSize(&scs->channelAbortCount, 1); + break; + default: + UA_assert(false); + break; + } + + /* Add a delayed callback to remove the channel when the currently + * scheduled jobs have completed */ + entry->cleanupCallback.callback = (UA_ApplicationCallback)removeSecureChannelCallback; + entry->cleanupCallback.application = NULL; + entry->cleanupCallback.data = entry; + entry->cleanupCallback.nextTime = UA_DateTime_nowMonotonic() + 1; + entry->cleanupCallback.interval = 0; /* Remove the structure */ + UA_Timer_addTimerEntry(&server->timer, &entry->cleanupCallback, NULL); +} + +void +UA_Server_deleteSecureChannels(UA_Server *server) { + channel_entry *entry, *temp; + TAILQ_FOREACH_SAFE(entry, &server->channels, pointers, temp) + removeSecureChannel(server, entry, UA_DIAGNOSTICEVENT_CLOSE); +} + +/* remove channels that were not renewed or who have no connection attached */ +void +UA_Server_cleanupTimedOutSecureChannels(UA_Server *server, + UA_DateTime nowMonotonic) { + channel_entry *entry, *temp; + TAILQ_FOREACH_SAFE(entry, &server->channels, pointers, temp) { + /* The channel was closed internally */ + if(entry->channel.state == UA_SECURECHANNELSTATE_CLOSED || + !entry->channel.connection) { + removeSecureChannel(server, entry, UA_DIAGNOSTICEVENT_CLOSE); + continue; + } + + /* Is the SecurityToken already created? */ + if(entry->channel.securityToken.createdAt == 0) { + /* No -> channel is still in progress of being opened, do not remove */ + continue; + } + + /* Has the SecurityToken timed out? */ + UA_DateTime timeout = + entry->channel.securityToken.createdAt + + (UA_DateTime)(entry->channel.securityToken.revisedLifetime * UA_DATETIME_MSEC); + + /* There is a new token. But it has not been used by the client so far. + * Do the rollover now instead of shutting the channel down. + * + * Part 4, 5.5.2 says: Servers shall use the existing SecurityToken to + * secure outgoing Messages until the SecurityToken expires or the + * Server receives a Message secured with a new SecurityToken.*/ + if(timeout < nowMonotonic && + entry->channel.renewState == UA_SECURECHANNELRENEWSTATE_NEWTOKEN_SERVER) { + /* Compare with the rollover in checkSymHeader */ + entry->channel.renewState = UA_SECURECHANNELRENEWSTATE_NORMAL; + entry->channel.securityToken = entry->channel.altSecurityToken; + UA_ChannelSecurityToken_init(&entry->channel.altSecurityToken); + UA_SecureChannel_generateLocalKeys(&entry->channel); + generateRemoteKeys(&entry->channel); + + /* Use the timeout of the new SecurityToken */ + timeout = entry->channel.securityToken.createdAt + + (UA_DateTime)(entry->channel.securityToken.revisedLifetime * UA_DATETIME_MSEC); + } + + if(timeout < nowMonotonic) { + UA_LOG_INFO_CHANNEL(&server->config.logger, &entry->channel, + "SecureChannel has timed out"); + removeSecureChannel(server, entry, UA_DIAGNOSTICEVENT_TIMEOUT); + } + } +} + +/* remove the first channel that has no session attached */ +static UA_Boolean +purgeFirstChannelWithoutSession(UA_Server *server) { + channel_entry *entry; + TAILQ_FOREACH(entry, &server->channels, pointers) { + if(SLIST_FIRST(&entry->channel.sessions)) + continue; + UA_LOG_INFO_CHANNEL(&server->config.logger, &entry->channel, + "Channel was purged since maxSecureChannels was " + "reached and channel had no session attached"); + removeSecureChannel(server, entry, UA_DIAGNOSTICEVENT_PURGE); + return true; + } + return false; +} + +UA_StatusCode +UA_Server_createSecureChannel(UA_Server *server, UA_Connection *connection) { + /* connection already has a channel attached. */ + if(connection->channel != NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Check if there exists a free SC, otherwise try to purge one SC without a + * session the purge has been introduced to pass CTT, it is not clear what + * strategy is expected here */ + if(server->serverStats.scs.currentChannelCount >= server->config.maxSecureChannels && + !purgeFirstChannelWithoutSession(server)) + return UA_STATUSCODE_BADOUTOFMEMORY; + + channel_entry *entry = (channel_entry *)UA_malloc(sizeof(channel_entry)); + if(!entry) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Channel state is closed (0) */ + /* TODO: Use the connection config from the correct network layer */ + UA_SecureChannel_init(&entry->channel, &server->config.networkLayers[0].localConnectionConfig); + entry->channel.certificateVerification = &server->config.certificateVerification; + entry->channel.processOPNHeader = UA_Server_configSecureChannel; + + TAILQ_INSERT_TAIL(&server->channels, entry, pointers); + UA_Connection_attachSecureChannel(connection, &entry->channel); + UA_atomic_addSize(&server->serverStats.scs.currentChannelCount, 1); + UA_atomic_addSize(&server->serverStats.scs.cumulatedChannelCount, 1); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_configSecureChannel(void *application, UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader) { + /* Iterate over available endpoints and choose the correct one */ + UA_SecurityPolicy *securityPolicy = NULL; + UA_Server *const server = (UA_Server *const) application; + for(size_t i = 0; i < server->config.securityPoliciesSize; ++i) { + UA_SecurityPolicy *policy = &server->config.securityPolicies[i]; + if(!UA_ByteString_equal(&asymHeader->securityPolicyUri, &policy->policyUri)) + continue; + + UA_StatusCode retval = policy->asymmetricModule. + compareCertificateThumbprint(policy, &asymHeader->receiverCertificateThumbprint); + if(retval != UA_STATUSCODE_GOOD) + continue; + + /* We found the correct policy (except for security mode). The endpoint + * needs to be selected by the client / server to match the security + * mode in the endpoint for the session. */ + securityPolicy = policy; + break; + } + + if(!securityPolicy) + return UA_STATUSCODE_BADSECURITYPOLICYREJECTED; + + /* Create the channel context and parse the sender (remote) certificate used for the + * secureChannel. */ + UA_StatusCode retval = + UA_SecureChannel_setSecurityPolicy(channel, securityPolicy, + &asymHeader->senderCertificate); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + channel->securityToken.tokenId = server->lastTokenId++; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_SecureChannelManager_open(UA_Server *server, UA_SecureChannel *channel, + const UA_OpenSecureChannelRequest *request, + UA_OpenSecureChannelResponse *response) { + if(channel->state != UA_SECURECHANNELSTATE_ACK_SENT) { + UA_LOG_ERROR_CHANNEL(&server->config.logger, channel, + "Called open on already open or closed channel"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + if(request->securityMode != UA_MESSAGESECURITYMODE_NONE && + UA_ByteString_equal(&channel->securityPolicy->policyUri, &UA_SECURITY_POLICY_NONE_URI)) { + return UA_STATUSCODE_BADSECURITYMODEREJECTED; + } + + channel->securityMode = request->securityMode; + channel->securityToken.channelId = server->lastChannelId++; + channel->securityToken.createdAt = UA_DateTime_nowMonotonic(); + + /* Set the lifetime. Lifetime 0 -> set the maximum possible */ + channel->securityToken.revisedLifetime = + (request->requestedLifetime > server->config.maxSecurityTokenLifetime) ? + server->config.maxSecurityTokenLifetime : request->requestedLifetime; + if(channel->securityToken.revisedLifetime == 0) + channel->securityToken.revisedLifetime = server->config.maxSecurityTokenLifetime; + + UA_StatusCode retval = UA_ByteString_copy(&request->clientNonce, &channel->remoteNonce); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Generate the nonce. The syymmetric encryption keys are generated when the + * first symmetric message is received */ + retval = UA_SecureChannel_generateLocalNonce(channel); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the response. The token will be revolved to the new token when the + * first symmetric messages is received. */ + response->securityToken = channel->securityToken; + response->securityToken.createdAt = UA_DateTime_now(); /* Only for sending */ + response->responseHeader.timestamp = response->securityToken.createdAt; + response->responseHeader.requestHandle = request->requestHeader.requestHandle; + retval = UA_ByteString_copy(&channel->localNonce, &response->serverNonce); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* The channel is open */ + channel->state = UA_SECURECHANNELSTATE_OPEN; + + /* For the first revolve */ + channel->renewState = UA_SECURECHANNELRENEWSTATE_NEWTOKEN_SERVER; + channel->altSecurityToken = channel->securityToken; + channel->securityToken.tokenId = 0; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_SecureChannelManager_renew(UA_Server *server, UA_SecureChannel *channel, + const UA_OpenSecureChannelRequest *request, + UA_OpenSecureChannelResponse *response) { + if(channel->state != UA_SECURECHANNELSTATE_OPEN) { + UA_LOG_ERROR_CHANNEL(&server->config.logger, channel, + "Called renew on channel which is not open"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Check whether the nonce was reused */ + if(channel->securityMode != UA_MESSAGESECURITYMODE_NONE && + UA_ByteString_equal(&channel->remoteNonce, &request->clientNonce)) { + UA_LOG_ERROR_CHANNEL(&server->config.logger, channel, + "The client reused the last nonce"); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + /* Create a new SecurityToken. Will be switched over when the first message + * is received. */ + channel->altSecurityToken = channel->securityToken; + channel->altSecurityToken.tokenId = server->lastTokenId++; + channel->altSecurityToken.createdAt = UA_DateTime_nowMonotonic(); + channel->altSecurityToken.revisedLifetime = + (request->requestedLifetime > server->config.maxSecurityTokenLifetime) ? + server->config.maxSecurityTokenLifetime : request->requestedLifetime; + if(channel->altSecurityToken.revisedLifetime == 0) /* lifetime 0 -> return the max lifetime */ + channel->altSecurityToken.revisedLifetime = server->config.maxSecurityTokenLifetime; + + /* Replace the nonces */ + UA_ByteString_clear(&channel->remoteNonce); + UA_StatusCode retval = UA_ByteString_copy(&request->clientNonce, &channel->remoteNonce); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_SecureChannel_generateLocalNonce(channel); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the response */ + response->securityToken = channel->altSecurityToken; + response->securityToken.createdAt = UA_DateTime_now(); /* Only for sending */ + response->responseHeader.requestHandle = request->requestHeader.requestHandle; + retval = UA_ByteString_copy(&channel->localNonce, &response->serverNonce); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + channel->renewState = UA_SECURECHANNELRENEWSTATE_NEWTOKEN_SERVER; + return UA_STATUSCODE_GOOD; +} + +void +UA_Server_closeSecureChannel(UA_Server *server, UA_SecureChannel *channel, + UA_DiagnosticEvent event) { + removeSecureChannel(server, container_of(channel, channel_entry, channel), event); +} + +void +Service_OpenSecureChannel(UA_Server *server, UA_SecureChannel *channel, + const UA_OpenSecureChannelRequest *request, + UA_OpenSecureChannelResponse *response) { + if(request->requestType == UA_SECURITYTOKENREQUESTTYPE_RENEW) { + /* Renew the channel */ + response->responseHeader.serviceResult = + UA_SecureChannelManager_renew(server, channel, request, response); + + /* Logging */ + if(response->responseHeader.serviceResult == UA_STATUSCODE_GOOD) { + UA_Float lifetime = (UA_Float)response->securityToken.revisedLifetime / 1000; + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, "SecureChannel renewed " + "with a revised lifetime of %.2fs", lifetime); + } else { + UA_LOG_DEBUG_CHANNEL(&server->config.logger, channel, + "Renewing SecureChannel failed"); + } + return; + } + + /* Must be ISSUE or RENEW */ + if(request->requestType != UA_SECURITYTOKENREQUESTTYPE_ISSUE) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + return; + } + + /* Open the channel */ + response->responseHeader.serviceResult = + UA_SecureChannelManager_open(server, channel, request, response); + + /* Logging */ + if(response->responseHeader.serviceResult == UA_STATUSCODE_GOOD) { + UA_Float lifetime = (UA_Float)response->securityToken.revisedLifetime / 1000; + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "SecureChannel opened with SecurityPolicy %.*s " + "and a revised lifetime of %.2fs", + (int)channel->securityPolicy->policyUri.length, + channel->securityPolicy->policyUri.data, lifetime); + } else { + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, + "Opening a SecureChannel failed"); + } +} + +/* The server does not send a CloseSecureChannel response */ +void +Service_CloseSecureChannel(UA_Server *server, UA_SecureChannel *channel) { + UA_LOG_INFO_CHANNEL(&server->config.logger, channel, "CloseSecureChannel"); + removeSecureChannel(server, container_of(channel, channel_entry, channel), + UA_DIAGNOSTICEVENT_CLOSE); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_nodemanagement.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2014-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Julian Grothoff + * Copyright 2016 (c) LEvertz + * Copyright 2016 (c) Lorenz Haas + * Copyright 2017 (c) frax2222 + * Copyright 2017-2018 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Christian von Arnim + * Copyright 2017 (c) Henrik Norrman + * Copyright 2021 (c) Fraunhofer IOSB (Author: Andreas Ebner) + */ + + +/*********************/ +/* Edit Node Context */ +/*********************/ + +UA_StatusCode +UA_Server_getNodeContext(UA_Server *server, UA_NodeId nodeId, + void **nodeContext) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = getNodeContext(server, nodeId, nodeContext); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +getNodeContext(UA_Server *server, UA_NodeId nodeId, + void **nodeContext) { + const UA_Node *node = UA_NODESTORE_GET(server, &nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + *nodeContext = node->head.context; + UA_NODESTORE_RELEASE(server, node); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setDeconstructedNode(UA_Server *server, UA_Session *session, + UA_NodeHead *head, void *context) { + head->constructed = false; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setConstructedNodeContext(UA_Server *server, UA_Session *session, + UA_NodeHead *head, void *context) { + head->context = context; + head->constructed = true; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +editNodeContext(UA_Server *server, UA_Session* session, + UA_NodeHead *head, void *context) { + head->context = context; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_setNodeContext(UA_Server *server, UA_NodeId nodeId, + void *nodeContext) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback)editNodeContext, nodeContext); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/**********************/ +/* Consistency Checks */ +/**********************/ + +#define UA_PARENT_REFERENCES_COUNT 2 + +const UA_NodeId parentReferences[UA_PARENT_REFERENCES_COUNT] = { + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASSUBTYPE}}, + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASCOMPONENT}} +}; + +static void +logAddNode(const UA_Logger *logger, UA_Session *session, + const UA_NodeId *nodeId, const char *msg) { + UA_LOG_NODEID_INFO(nodeId, + UA_LOG_INFO_SESSION(logger, session, "AddNode (%.*s): %s", + (int)nodeIdStr.length, nodeIdStr.data, msg)); +} + +/* Check if the requested parent node exists, has the right node class and is + * referenced with an allowed (hierarchical) reference type. For "type" nodes, + * only hasSubType references are allowed. */ +static UA_StatusCode +checkParentReference(UA_Server *server, UA_Session *session, const UA_NodeHead *head, + const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId) { + /* Objects do not need a parent (e.g. mandatory/optional modellingrules) */ + /* Also, there are some variables which do not have parents, e.g. EnumStrings, EnumValues */ + if((head->nodeClass == UA_NODECLASS_OBJECT || head->nodeClass == UA_NODECLASS_VARIABLE) && + UA_NodeId_isNull(parentNodeId) && UA_NodeId_isNull(referenceTypeId)) + return UA_STATUSCODE_GOOD; + + /* See if the parent exists */ + const UA_Node *parent = UA_NODESTORE_GET(server, parentNodeId); + if(!parent) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Parent node not found"); + return UA_STATUSCODE_BADPARENTNODEIDINVALID; + } + + UA_NodeClass parentNodeClass = parent->head.nodeClass; + UA_NODESTORE_RELEASE(server, parent); + + /* Check the referencetype exists */ + const UA_Node *referenceType = UA_NODESTORE_GET(server, referenceTypeId); + if(!referenceType) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Reference type to the parent not found"); + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + } + + /* Check if the referencetype is a reference type node */ + if(referenceType->head.nodeClass != UA_NODECLASS_REFERENCETYPE) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Reference type to the parent is not a ReferenceTypeNode"); + UA_NODESTORE_RELEASE(server, referenceType); + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + } + + /* Check that the reference type is not abstract */ + UA_Boolean referenceTypeIsAbstract = referenceType->referenceTypeNode.isAbstract; + UA_NODESTORE_RELEASE(server, referenceType); + if(referenceTypeIsAbstract == true) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Abstract reference type to the parent not allowed"); + return UA_STATUSCODE_BADREFERENCENOTALLOWED; + } + + /* Check hassubtype relation for type nodes */ + if(head->nodeClass == UA_NODECLASS_DATATYPE || + head->nodeClass == UA_NODECLASS_VARIABLETYPE || + head->nodeClass == UA_NODECLASS_OBJECTTYPE || + head->nodeClass == UA_NODECLASS_REFERENCETYPE) { + /* Type needs hassubtype reference to the supertype */ + if(referenceType->referenceTypeNode.referenceTypeIndex != + UA_REFERENCETYPEINDEX_HASSUBTYPE) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Type nodes need to have a HasSubType reference to the parent"); + return UA_STATUSCODE_BADREFERENCENOTALLOWED; + } + /* Supertype needs to be of the same node type */ + if(parentNodeClass != head->nodeClass) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Type nodes needs to be of the same node " + "type as their parent"); + return UA_STATUSCODE_BADPARENTNODEIDINVALID; + } + return UA_STATUSCODE_GOOD; + } + + /* Test if the referencetype is hierarchical */ + const UA_NodeId hierarchRefs = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES); + if(!isNodeInTree_singleRef(server, referenceTypeId, &hierarchRefs, + UA_REFERENCETYPEINDEX_HASSUBTYPE)) { + logAddNode(&server->config.logger, session, &head->nodeId, + "Reference type to the parent is not hierarchical"); + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setDefaultValue(UA_Server *server, const UA_VariableNode *node) { + /* Get the DataType */ + UA_StatusCode res = UA_STATUSCODE_GOOD; + const UA_DataType *type = UA_Server_findDataType(server, &node->dataType); + if(!type) { + /* No description for the DataType found. It is possible that an + * abstract DataType is used, e.g. UInteger. Browse to see if there is a + * non-abstract subtype that can be used for the default value. + * + * Look up and downwards in the hierarchy. Some data types (e.g. + * UtcTime) are derived from a non-abstract data type. This is then used + * for the actual value, Use the first match. */ + UA_ReferenceTypeSet refs = UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASSUBTYPE); + UA_ExpandedNodeId *typeCandidates = NULL; + size_t typeCandidatesSize = 0; + res = browseRecursive(server, 1, &node->dataType, + UA_BROWSEDIRECTION_BOTH, &refs, + UA_NODECLASS_DATATYPE, false, + &typeCandidatesSize, &typeCandidates); + if(res != UA_STATUSCODE_GOOD) + return res; + + for(size_t i = 0; i < typeCandidatesSize; i++) { + /* Skip BaseDataType (Variant). This is the root of the DataType + * hierarchy. Variables of BaseDataType can be empty. */ + if(UA_NodeId_equal(&UA_TYPES[UA_TYPES_VARIANT].typeId, + &typeCandidates[i].nodeId)) + continue; + type = UA_Server_findDataType(server, &typeCandidates[i].nodeId); + if(type) + break; + } + + UA_Array_delete(typeCandidates, typeCandidatesSize, + &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + if(!type) + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Set up the value with the default content */ + UA_Variant val; + UA_Variant_init(&val); + if(node->valueRank < 0) { + /* Set a scalar */ + void *data = UA_new(type); + if(!data) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_Variant_setScalar(&val, data, type); + } else if(node->valueRank == 0) { + /* Use an empty array of one dimension */ + UA_Variant_setArray(&val, NULL, 0, type); + } else { + /* Write an array that matches the ArrayDimensions */ + res = UA_Array_copy(node->arrayDimensions, node->arrayDimensionsSize, + (void**)&val.arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]); + if(res != UA_STATUSCODE_GOOD) + return res; + val.arrayDimensionsSize = node->arrayDimensionsSize; + + /* No length restriction in the ArrayDimension -> use length 1 */ + size_t size = 1; + for(size_t i = 0; i < val.arrayDimensionsSize; i++) { + if(val.arrayDimensions[i] == 0) + val.arrayDimensions[i] = 1; + size *= val.arrayDimensions[i]; + } + + /* Create the content array */ + void *data = UA_Array_new(size, type); + if(!data) { + UA_Variant_clear(&val); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + val.data = data; + val.arrayLength = size; + val.type = type; + } + + /* Write the value */ + res = writeAttribute(server, &server->adminSession, &node->head.nodeId, + UA_ATTRIBUTEID_VALUE, &val, &UA_TYPES[UA_TYPES_VARIANT]); + + /* Clean up */ + UA_Variant_clear(&val); + return res; +} + +static UA_StatusCode +typeCheckVariableNode(UA_Server *server, UA_Session *session, + const UA_VariableNode *node, + const UA_VariableTypeNode *vt) { + /* Check the datatype against the vt */ + if(!compatibleDataTypes(server, &node->dataType, &vt->dataType)) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The value of is incompatible with " + "the datatype of the VariableType"); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Check valueRank against array dimensions */ + if(!compatibleValueRankArrayDimensions(server, session, node->valueRank, + node->arrayDimensionsSize)) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The value rank of is incompatible with its array dimensions"); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Check valueRank against the vt */ + if(!compatibleValueRanks(node->valueRank, vt->valueRank)) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The value rank is incompatible " + "with the value rank of the VariableType"); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Check array dimensions against the vt */ + if(!compatibleArrayDimensions(vt->arrayDimensionsSize, vt->arrayDimensions, + node->arrayDimensionsSize, node->arrayDimensions)) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The array dimensions are incompatible with the " + "array dimensions of the VariableType"); + return UA_STATUSCODE_BADTYPEMISMATCH; + } + + /* Typecheck the value */ + + /* The value might come from a datasource, so we perform a + * regular read. */ + UA_DataValue value; + UA_DataValue_init(&value); + UA_StatusCode retval = readValueAttribute(server, session, node, &value); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Only BaseDataType (Variant) can have empty values. Create default content + * otherwise that matches the constraints. */ + if(!value.hasValue || !value.value.type) { + if(!UA_NodeId_equal(&node->dataType, &UA_TYPES[UA_TYPES_VARIANT].typeId)) { + /* Warn if that is configured */ + if(!server->bootstrapNS0 && + server->config.allowEmptyVariables != UA_RULEHANDLING_ACCEPT) + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The value is empty. But this is only allowed for BaseDataType. " + "Create a matching default value."); + + /* Abort if that is configured */ + if(server->config.allowEmptyVariables == UA_RULEHANDLING_ABORT) + retval = UA_STATUSCODE_BADTYPEMISMATCH; + + /* Try to generate a default value if that is configured */ + if(server->config.allowEmptyVariables == UA_RULEHANDLING_DEFAULT) { + retval = setDefaultValue(server, node); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Could not create a default value " + "with StatusCode %s", (int)nodeIdStr.length, + nodeIdStr.data, UA_StatusCode_name(retval))); + } + + /* Reread the current value for compat tests below */ + UA_DataValue_clear(&value); + retval = readValueAttribute(server, session, node, &value); + } + } + + if(retval != UA_STATUSCODE_GOOD) { + UA_DataValue_clear(&value); + return retval; + } + } + + /* Perform the value typecheck. If this fails, write the current value + * again. The write-service tries to convert to the correct type... */ + if(!compatibleValue(server, session, &node->dataType, node->valueRank, + node->arrayDimensionsSize, node->arrayDimensions, + &value.value, NULL)) { + retval = writeValueAttribute(server, session, &node->head.nodeId, &value.value); + if(retval != UA_STATUSCODE_GOOD) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The value is incompatible with the variable definition"); + } + } + + UA_DataValue_clear(&value); + return retval; +} + +/********************/ +/* Instantiate Node */ +/********************/ + +static const UA_NodeId baseDataVariableType = + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_BASEDATAVARIABLETYPE}}; +static const UA_NodeId baseObjectType = + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_BASEOBJECTTYPE}}; +static const UA_NodeId hasTypeDefinition = + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASTYPEDEFINITION}}; + +/* Use attributes from the variable type wherever required. Reload the node if + * changes were made. */ +static UA_StatusCode +useVariableTypeAttributes(UA_Server *server, UA_Session *session, + const UA_VariableNode **node_ptr, + const UA_VariableTypeNode *vt) { + const UA_VariableNode *node = *node_ptr; + UA_Boolean modified = false; + + /* If no value is set, see if the vt provides one and copy it. This needs to + * be done before copying the datatype from the vt, as setting the datatype + * triggers a typecheck. */ + UA_DataValue orig; + UA_DataValue_init(&orig); + UA_StatusCode retval = readValueAttribute(server, session, node, &orig); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + if(orig.value.type) { + /* A value is present */ + UA_DataValue_clear(&orig); + } else { + UA_DataValue v; + UA_DataValue_init(&v); + retval = readValueAttribute(server, session, (const UA_VariableNode*)vt, &v); + if(retval == UA_STATUSCODE_GOOD && v.hasValue) { + retval = writeValueAttribute(server, session, &node->head.nodeId, + &v.value); + modified = true; + } + UA_DataValue_clear(&v); + + if(retval != UA_STATUSCODE_GOOD) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "The default content of the VariableType could " + "not be used. This may happen if the VariableNode " + "makes additional restrictions."); + retval = UA_STATUSCODE_GOOD; + } + } + + /* If no datatype is given, use the datatype of the vt */ + if(UA_NodeId_isNull(&node->dataType)) { + logAddNode(&server->config.logger, session, &node->head.nodeId, + "No datatype given; Copy the datatype attribute " + "from the TypeDefinition"); + retval = writeAttribute(server, session, &node->head.nodeId, + UA_ATTRIBUTEID_DATATYPE, &vt->dataType, + &UA_TYPES[UA_TYPES_NODEID]); + modified = true; + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* Use the ArrayDimensions of the vt */ + if(node->arrayDimensionsSize == 0 && vt->arrayDimensionsSize > 0) { + UA_Variant v; + UA_Variant_init(&v); + UA_Variant_setArray(&v, vt->arrayDimensions, vt->arrayDimensionsSize, + &UA_TYPES[UA_TYPES_UINT32]); + retval = writeAttribute(server, session, &node->head.nodeId, + UA_ATTRIBUTEID_ARRAYDIMENSIONS, &v, + &UA_TYPES[UA_TYPES_VARIANT]); + modified = true; + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* If the node was modified, update the pointer to the new version */ + if(modified) { + const UA_Node *updated = UA_NODESTORE_GET(server, &node->head.nodeId); + if(!updated) + return UA_STATUSCODE_BADINTERNALERROR; + UA_NODESTORE_RELEASE(server, (const UA_Node*)node); + *node_ptr = (const UA_VariableNode*)updated; + } + + return retval; +} + +/* Search for an instance of "browseName" in node searchInstance. Used during + * copyChildNodes to find overwritable/mergable nodes. Does not touch + * outInstanceNodeId if no child is found. */ +static UA_StatusCode +findChildByBrowsename(UA_Server *server, UA_Session *session, + const UA_NodeId *searchInstance, + const UA_QualifiedName *browseName, + UA_NodeId *outInstanceNodeId) { + UA_BrowseDescription bd; + UA_BrowseDescription_init(&bd); + bd.nodeId = *searchInstance; + bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_AGGREGATES); + bd.includeSubtypes = true; + bd.browseDirection = UA_BROWSEDIRECTION_FORWARD; + bd.nodeClassMask = UA_NODECLASS_OBJECT | UA_NODECLASS_VARIABLE | UA_NODECLASS_METHOD; + bd.resultMask = UA_BROWSERESULTMASK_BROWSENAME; + + UA_BrowseResult br; + UA_BrowseResult_init(&br); + UA_UInt32 maxrefs = 0; + Operation_Browse(server, session, &maxrefs, &bd, &br); + if(br.statusCode != UA_STATUSCODE_GOOD) + return br.statusCode; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t i = 0; i < br.referencesSize; ++i) { + UA_ReferenceDescription *rd = &br.references[i]; + if(rd->browseName.namespaceIndex == browseName->namespaceIndex && + UA_String_equal(&rd->browseName.name, &browseName->name)) { + retval = UA_NodeId_copy(&rd->nodeId.nodeId, outInstanceNodeId); + break; + } + } + + UA_BrowseResult_clear(&br); + return retval; +} + +static const UA_NodeId mandatoryId = + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_MODELLINGRULE_MANDATORY}}; + +static UA_Boolean +isMandatoryChild(UA_Server *server, UA_Session *session, + const UA_NodeId *childNodeId) { + /* Get the child */ + const UA_Node *child = UA_NODESTORE_GET(server, childNodeId); + if(!child) + return false; + + /* Look for the reference making the child mandatory */ + for(size_t i = 0; i < child->head.referencesSize; ++i) { + UA_NodeReferenceKind *refs = &child->head.references[i]; + if(refs->referenceTypeIndex != UA_REFERENCETYPEINDEX_HASMODELLINGRULE) + continue; + if(refs->isInverse) + continue; + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &refs->queueHead, queuePointers) { + if(UA_NodeId_equal(&mandatoryId, &target->targetId.nodeId)) { + UA_NODESTORE_RELEASE(server, child); + return true; + } + } + } + + UA_NODESTORE_RELEASE(server, child); + return false; +} + +static UA_StatusCode +copyAllChildren(UA_Server *server, UA_Session *session, + const UA_NodeId *source, const UA_NodeId *destination); + +static UA_StatusCode +recursiveTypeCheckAddChildren(UA_Server *server, UA_Session *session, + const UA_Node **node, const UA_Node *type); + +static void +Operation_addReference(UA_Server *server, UA_Session *session, void *context, + const UA_AddReferencesItem *item, UA_StatusCode *retval); + +static UA_StatusCode +copyChild(UA_Server *server, UA_Session *session, + const UA_NodeId *destinationNodeId, + const UA_ReferenceDescription *rd) { + UA_assert(session); + + /* Is there an existing child with the browsename? */ + UA_NodeId existingChild = UA_NODEID_NULL; + UA_StatusCode retval = findChildByBrowsename(server, session, destinationNodeId, + &rd->browseName, &existingChild); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Have a child with that browseName. Deep-copy missing members. */ + if(!UA_NodeId_isNull(&existingChild)) { + if(rd->nodeClass == UA_NODECLASS_VARIABLE || + rd->nodeClass == UA_NODECLASS_OBJECT) + retval = copyAllChildren(server, session, &rd->nodeId.nodeId, &existingChild); + UA_NodeId_clear(&existingChild); + return retval; + } + + /* Is the child mandatory? If not, ask callback whether child should be instantiated. + * If not, skip. */ + if(!isMandatoryChild(server, session, &rd->nodeId.nodeId)) { + if(!server->config.nodeLifecycle.createOptionalChild) + return UA_STATUSCODE_GOOD; + + UA_UNLOCK(server->serviceMutex); + UA_Boolean createChild = + server->config.nodeLifecycle.createOptionalChild(server, + &session->sessionId, + session->sessionHandle, + &rd->nodeId.nodeId, + destinationNodeId, + &rd->referenceTypeId); + UA_LOCK(server->serviceMutex); + if(!createChild) + return UA_STATUSCODE_GOOD; + } + + /* Child is a method -> create a reference */ + if(rd->nodeClass == UA_NODECLASS_METHOD) { + UA_AddReferencesItem newItem; + UA_AddReferencesItem_init(&newItem); + newItem.sourceNodeId = *destinationNodeId; + newItem.referenceTypeId = rd->referenceTypeId; + newItem.isForward = true; + newItem.targetNodeId = rd->nodeId; + newItem.targetNodeClass = UA_NODECLASS_METHOD; + Operation_addReference(server, session, NULL, &newItem, &retval); + return retval; + } + + /* Child is a variable or object */ + if(rd->nodeClass == UA_NODECLASS_VARIABLE || + rd->nodeClass == UA_NODECLASS_OBJECT) { + /* Make a copy of the node */ + UA_Node *node; + retval = UA_NODESTORE_GETCOPY(server, &rd->nodeId.nodeId, &node); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Remove the context of the copied node */ + node->head.context = NULL; + node->head.constructed = false; + + /* Reset the NodeId (random numeric id will be assigned in the nodestore) */ + UA_NodeId_clear(&node->head.nodeId); + node->head.nodeId.namespaceIndex = destinationNodeId->namespaceIndex; + + if (server->config.nodeLifecycle.generateChildNodeId) { + UA_UNLOCK(server->serviceMutex); + retval = server->config.nodeLifecycle. + generateChildNodeId(server, &session->sessionId, session->sessionHandle, + &rd->nodeId.nodeId, destinationNodeId, + &rd->referenceTypeId, &node->head.nodeId); + UA_LOCK(server->serviceMutex); + if(retval != UA_STATUSCODE_GOOD) { + UA_NODESTORE_DELETE(server, node); + return retval; + } + } + + /* Remove references, they are re-created from scratch in addnode_finish */ + /* TODO: Be more clever in removing references that are re-added during + * addnode_finish. That way, we can call addnode_finish also on children that were + * manually added by the user during addnode_begin and addnode_finish. */ + /* For now we keep all the modelling rule references and delete all others */ + UA_ReferenceTypeSet reftypes_modellingrule = + UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASMODELLINGRULE); + UA_Node_deleteReferencesSubset(node, &reftypes_modellingrule); + + /* Add the node to the nodestore */ + UA_NodeId newNodeId; + retval = UA_NODESTORE_INSERT(server, node, &newNodeId); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Add the node references */ + retval = AddNode_addRefs(server, session, &newNodeId, destinationNodeId, + &rd->referenceTypeId, &rd->typeDefinition.nodeId); + if(retval != UA_STATUSCODE_GOOD) { + UA_NODESTORE_REMOVE(server, &newNodeId); + return retval; + } + + /* For the new child, recursively copy the members of the original. No + * typechecking is performed here. Assuming that the original is + * consistent. */ + retval = copyAllChildren(server, session, &rd->nodeId.nodeId, &newNodeId); + } + + return retval; +} + +/* Copy any children of Node sourceNodeId to another node destinationNodeId. */ +static UA_StatusCode +copyAllChildren(UA_Server *server, UA_Session *session, + const UA_NodeId *source, const UA_NodeId *destination) { + /* Browse to get all children of the source */ + UA_BrowseDescription bd; + UA_BrowseDescription_init(&bd); + bd.nodeId = *source; + bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_AGGREGATES); + bd.includeSubtypes = true; + bd.browseDirection = UA_BROWSEDIRECTION_FORWARD; + bd.nodeClassMask = UA_NODECLASS_OBJECT | UA_NODECLASS_VARIABLE | UA_NODECLASS_METHOD; + bd.resultMask = UA_BROWSERESULTMASK_REFERENCETYPEID | UA_BROWSERESULTMASK_NODECLASS | + UA_BROWSERESULTMASK_BROWSENAME | UA_BROWSERESULTMASK_TYPEDEFINITION; + + UA_BrowseResult br; + UA_BrowseResult_init(&br); + UA_UInt32 maxrefs = 0; + Operation_Browse(server, session, &maxrefs, &bd, &br); + if(br.statusCode != UA_STATUSCODE_GOOD) + return br.statusCode; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t i = 0; i < br.referencesSize; ++i) { + UA_ReferenceDescription *rd = &br.references[i]; + retval = copyChild(server, session, destination, rd); + if(retval != UA_STATUSCODE_GOOD) + break; + } + + UA_BrowseResult_clear(&br); + return retval; +} + +static UA_StatusCode +addTypeChildren(UA_Server *server, UA_Session *session, + const UA_NodeHead *head, const UA_NodeHead *typeHead) { + /* Get the hierarchy of the type and all its supertypes */ + UA_NodeId *hierarchy = NULL; + size_t hierarchySize = 0; + UA_StatusCode retval = getParentTypeAndInterfaceHierarchy(server, &typeHead->nodeId, + &hierarchy, &hierarchySize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + UA_assert(hierarchySize < 1000); + + /* Copy members of the type and supertypes (and instantiate them) */ + for(size_t i = 0; i < hierarchySize; ++i) { + retval = copyAllChildren(server, session, &hierarchy[i], &head->nodeId); + if(retval != UA_STATUSCODE_GOOD) + break; + } + + UA_Array_delete(hierarchy, hierarchySize, &UA_TYPES[UA_TYPES_NODEID]); + return retval; +} + +static UA_StatusCode +addInterfaceChildren(UA_Server *server, UA_Session *session, + const UA_NodeHead *head) { + /* Get the hierarchy of the type and all its supertypes */ + UA_NodeId *hierarchy = NULL; + size_t hierarchySize = 0; + UA_StatusCode retval = getInterfaceHierarchy(server, &head->nodeId, + &hierarchy, &hierarchySize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + UA_assert(hierarchySize < 1000); + + /* Copy members of the type and supertypes (and instantiate them) */ + for(size_t i = 0; i < hierarchySize; ++i) { + retval = copyAllChildren(server, session, &hierarchy[i], &head->nodeId); + if(retval != UA_STATUSCODE_GOOD) + break; + } + + UA_Array_delete(hierarchy, hierarchySize, &UA_TYPES[UA_TYPES_NODEID]); + return retval; +} + +static UA_StatusCode +addRef(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, + const UA_NodeId *referenceTypeId, const UA_NodeId *parentNodeId, + UA_Boolean forward) { + UA_AddReferencesItem ref_item; + UA_AddReferencesItem_init(&ref_item); + ref_item.sourceNodeId = *nodeId; + ref_item.referenceTypeId = *referenceTypeId; + ref_item.isForward = forward; + ref_item.targetNodeId.nodeId = *parentNodeId; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + Operation_addReference(server, session, NULL, &ref_item, &retval); + return retval; +} + +/************/ +/* Add Node */ +/************/ + +static const UA_NodeId hasSubtype = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASSUBTYPE}}; + +UA_StatusCode +AddNode_addRefs(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, + const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, + const UA_NodeId *typeDefinitionId) { + /* Get the node */ + const UA_Node *type = NULL; + const UA_Node *node = UA_NODESTORE_GET(server, nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + + /* Use the typeDefinition as parent for type-nodes */ + const UA_NodeHead *head = &node->head; + if(head->nodeClass == UA_NODECLASS_VARIABLETYPE || + head->nodeClass == UA_NODECLASS_OBJECTTYPE || + head->nodeClass == UA_NODECLASS_REFERENCETYPE || + head->nodeClass == UA_NODECLASS_DATATYPE) { + if(UA_NodeId_equal(referenceTypeId, &UA_NODEID_NULL)) + referenceTypeId = &hasSubtype; + const UA_Node *parentNode = UA_NODESTORE_GET(server, parentNodeId); + if(parentNode) { + if(parentNode->head.nodeClass == head->nodeClass) + typeDefinitionId = parentNodeId; + UA_NODESTORE_RELEASE(server, parentNode); + } + } + + UA_StatusCode retval; + /* Make sure newly created node does not have itself as parent */ + if(UA_NodeId_equal(nodeId, parentNodeId)) { + logAddNode(&server->config.logger, session, nodeId, + "A node cannot have itself as parent"); + retval = UA_STATUSCODE_BADINVALIDARGUMENT; + goto cleanup; + } + + + /* Check parent reference. Objects may have no parent. */ + retval = checkParentReference(server, session, head, parentNodeId, referenceTypeId); + if(retval != UA_STATUSCODE_GOOD) { + logAddNode(&server->config.logger, session, nodeId, + "The parent reference for is invalid"); + goto cleanup; + } + + /* Replace empty typeDefinition with the most permissive default */ + if((head->nodeClass == UA_NODECLASS_VARIABLE || + head->nodeClass == UA_NODECLASS_OBJECT) && + UA_NodeId_isNull(typeDefinitionId)) { + logAddNode(&server->config.logger, session, nodeId, + "No TypeDefinition. Use the default " + "TypeDefinition for the Variable/Object"); + if(head->nodeClass == UA_NODECLASS_VARIABLE) + typeDefinitionId = &baseDataVariableType; + else + typeDefinitionId = &baseObjectType; + } + + /* Get the node type. There must be a typedefinition for variables, objects + * and type-nodes. See the above checks. */ + if(!UA_NodeId_isNull(typeDefinitionId)) { + /* Get the type node */ + type = UA_NODESTORE_GET(server, typeDefinitionId); + if(!type) { + logAddNode(&server->config.logger, session, nodeId, "Node type not found"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + + UA_Boolean typeOk = false; + const UA_NodeHead *typeHead = &type->head; + switch(head->nodeClass) { + case UA_NODECLASS_DATATYPE: + typeOk = typeHead->nodeClass == UA_NODECLASS_DATATYPE; + break; + case UA_NODECLASS_METHOD: + typeOk = typeHead->nodeClass == UA_NODECLASS_METHOD; + break; + case UA_NODECLASS_OBJECT: + case UA_NODECLASS_OBJECTTYPE: + typeOk = typeHead->nodeClass == UA_NODECLASS_OBJECTTYPE; + break; + case UA_NODECLASS_REFERENCETYPE: + typeOk = typeHead->nodeClass == UA_NODECLASS_REFERENCETYPE; + break; + case UA_NODECLASS_VARIABLE: + case UA_NODECLASS_VARIABLETYPE: + typeOk = typeHead->nodeClass == UA_NODECLASS_VARIABLETYPE; + break; + case UA_NODECLASS_VIEW: + typeOk = typeHead->nodeClass == UA_NODECLASS_VIEW; + break; + default: + typeOk = false; + } + if(!typeOk) { + logAddNode(&server->config.logger, session, nodeId, + "Type does not match the NodeClass"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + + /* See if the type has the correct node class. For type-nodes, we know + * that type has the same nodeClass from checkParentReference. */ + if(head->nodeClass == UA_NODECLASS_VARIABLE && + type->variableTypeNode.isAbstract) { + /* Get subtypes of the parent reference types */ + UA_ReferenceTypeSet refTypes1, refTypes2; + retval |= referenceTypeIndices(server, &parentReferences[0], &refTypes1, true); + retval |= referenceTypeIndices(server, &parentReferences[1], &refTypes2, true); + UA_ReferenceTypeSet refTypes = UA_ReferenceTypeSet_union(refTypes1, refTypes2); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Abstract variable is allowed if parent is a children of a + * base data variable. An abstract variable may be part of an + * object type which again is below BaseObjectType */ + const UA_NodeId variableTypes = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE); + const UA_NodeId objectTypes = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEOBJECTTYPE); + if(!isNodeInTree(server, parentNodeId, &variableTypes, &refTypes) && + !isNodeInTree(server, parentNodeId, &objectTypes, &refTypes)) { + logAddNode(&server->config.logger, session, nodeId, + "Type of variable node must be a " + "VariableType and not cannot be abstract"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + } + + if(head->nodeClass == UA_NODECLASS_OBJECT && + type->objectTypeNode.isAbstract) { + /* Get subtypes of the parent reference types */ + UA_ReferenceTypeSet refTypes1, refTypes2; + retval |= referenceTypeIndices(server, &parentReferences[0], &refTypes1, true); + retval |= referenceTypeIndices(server, &parentReferences[1], &refTypes2, true); + UA_ReferenceTypeSet refTypes = UA_ReferenceTypeSet_union(refTypes1, refTypes2); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + + /* Object node created of an abstract ObjectType. Only allowed if + * within BaseObjectType folder or if it's an event (subType of + * BaseEventType) */ + const UA_NodeId objectTypes = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEOBJECTTYPE); + UA_Boolean isInBaseObjectType = + isNodeInTree(server, parentNodeId, &objectTypes, &refTypes); + + const UA_NodeId eventTypes = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEEVENTTYPE); + UA_Boolean isInBaseEventType = + isNodeInTree_singleRef(server, &type->head.nodeId, &eventTypes, + UA_REFERENCETYPEINDEX_HASSUBTYPE); + + if(!isInBaseObjectType && + !(isInBaseEventType && UA_NodeId_isNull(parentNodeId))) { + logAddNode(&server->config.logger, session, nodeId, + "Type of ObjectNode must be ObjectType and not be abstract"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + } + } + + /* Add reference to the parent */ + if(!UA_NodeId_isNull(parentNodeId)) { + if(UA_NodeId_isNull(referenceTypeId)) { + logAddNode(&server->config.logger, session, nodeId, + "Reference to parent cannot be null"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + + retval = addRef(server, session, &head->nodeId, referenceTypeId, + parentNodeId, false); + if(retval != UA_STATUSCODE_GOOD) { + logAddNode(&server->config.logger, session, nodeId, + "Adding reference to parent failed"); + goto cleanup; + } + } + + /* Add a hasTypeDefinition reference */ + if(head->nodeClass == UA_NODECLASS_VARIABLE || + head->nodeClass == UA_NODECLASS_OBJECT) { + UA_assert(type != NULL); /* see above */ + retval = addRef(server, session, &head->nodeId, &hasTypeDefinition, &type->head.nodeId, true); + if(retval != UA_STATUSCODE_GOOD) { + logAddNode(&server->config.logger, session, nodeId, + "Adding a reference to the type definition failed"); + } + } + + cleanup: + UA_NODESTORE_RELEASE(server, node); + if(type) + UA_NODESTORE_RELEASE(server, type); + return retval; +} + +/* Create the node and add it to the nodestore. But don't typecheck and add + * references so far */ +UA_StatusCode +AddNode_raw(UA_Server *server, UA_Session *session, void *nodeContext, + const UA_AddNodesItem *item, UA_NodeId *outNewNodeId) { + /* Do not check access for server */ + if(session != &server->adminSession && server->config.accessControl.allowAddNode) { + UA_UNLOCK(server->serviceMutex) + if (!server->config.accessControl.allowAddNode(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle, item)) { + UA_LOCK(server->serviceMutex); + return UA_STATUSCODE_BADUSERACCESSDENIED; + } + UA_LOCK(server->serviceMutex); + } + + /* Check the namespaceindex */ + if(item->requestedNewNodeId.nodeId.namespaceIndex >= server->namespacesSize) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode: Namespace invalid"); + return UA_STATUSCODE_BADNODEIDINVALID; + } + + if(item->nodeAttributes.encoding != UA_EXTENSIONOBJECT_DECODED && + item->nodeAttributes.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode: Node attributes invalid"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Create a node */ + UA_Node *node = UA_NODESTORE_NEW(server, item->nodeClass); + if(!node) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode: Node could not create a node " + "in the nodestore"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_NodeId tmpOutId = UA_NODEID_NULL; + /* Fill the node attributes */ + node->head.context = nodeContext; + UA_StatusCode retval = UA_NodeId_copy(&item->requestedNewNodeId.nodeId, &node->head.nodeId); + if(retval != UA_STATUSCODE_GOOD) + goto create_error; + + retval = UA_QualifiedName_copy(&item->browseName, &node->head.browseName); + if(retval != UA_STATUSCODE_GOOD) + goto create_error; + + retval = UA_Node_setAttributes(node, item->nodeAttributes.content.decoded.data, + item->nodeAttributes.content.decoded.type); + if(retval != UA_STATUSCODE_GOOD) + goto create_error; + + /* Add the node to the nodestore */ + if(!outNewNodeId) + outNewNodeId = &tmpOutId; + retval = UA_NODESTORE_INSERT(server, node, outNewNodeId); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode: Node could not add the new node " + "to the nodestore with error code %s", + UA_StatusCode_name(retval)); + return retval; + } + + if(outNewNodeId == &tmpOutId) + UA_NodeId_clear(&tmpOutId); + + return UA_STATUSCODE_GOOD; + +create_error: + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode: Node could not create a node " + "with error code %s", UA_StatusCode_name(retval)); + UA_NODESTORE_DELETE(server, node); + return retval; +} + +static UA_StatusCode +findDefaultInstanceBrowseNameNode(UA_Server *server, UA_NodeId startingNode, + UA_NodeId *foundId) { + UA_NodeId_init(foundId); + UA_RelativePathElement rpe; + UA_RelativePathElement_init(&rpe); + rpe.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY); + rpe.targetName = UA_QUALIFIEDNAME(0, "DefaultInstanceBrowseName"); + UA_BrowsePath bp; + UA_BrowsePath_init(&bp); + bp.startingNode = startingNode; + bp.relativePath.elementsSize = 1; + bp.relativePath.elements = &rpe; + UA_BrowsePathResult bpr = translateBrowsePathToNodeIds(server, &bp); + UA_StatusCode retval = bpr.statusCode; + if(retval == UA_STATUSCODE_GOOD && bpr.targetsSize > 0) + retval = UA_NodeId_copy(&bpr.targets[0].targetId.nodeId, foundId); + UA_BrowsePathResult_clear(&bpr); + return retval; +} + +/* Check if we got a valid browse name for the new node. For object nodes the + * BrowseName may only be null if the parent type has a + * 'DefaultInstanceBrowseName' property. */ +static UA_StatusCode +checkSetBrowseName(UA_Server *server, UA_Session *session, UA_AddNodesItem *item) { + /* If the object node already has a browse name we are done here. */ + if(!UA_QualifiedName_isNull(&item->browseName)) + return UA_STATUSCODE_GOOD; + + /* Nodes other than Objects must have a BrowseName */ + if(item->nodeClass != UA_NODECLASS_OBJECT) + return UA_STATUSCODE_BADBROWSENAMEINVALID; + + /* At this point we have an object with an empty browse name. Check the type + * node if it has a DefaultInstanceBrowseName property. */ + UA_NodeId defaultBrowseNameNode; + UA_StatusCode retval = + findDefaultInstanceBrowseNameNode(server, item->typeDefinition.nodeId, + &defaultBrowseNameNode); + if(retval != UA_STATUSCODE_GOOD) + return UA_STATUSCODE_BADBROWSENAMEINVALID; + + UA_Variant defaultBrowseName; + retval = readWithReadValue(server, &defaultBrowseNameNode, + UA_ATTRIBUTEID_VALUE, &defaultBrowseName); + UA_NodeId_clear(&defaultBrowseNameNode); + if(retval != UA_STATUSCODE_GOOD) + return UA_STATUSCODE_BADBROWSENAMEINVALID; + + if(UA_Variant_hasScalarType(&defaultBrowseName, &UA_TYPES[UA_TYPES_QUALIFIEDNAME])) { + item->browseName = *(UA_QualifiedName*)defaultBrowseName.data; + UA_QualifiedName_init((UA_QualifiedName*)defaultBrowseName.data); + } else { + retval = UA_STATUSCODE_BADBROWSENAMEINVALID; + } + + UA_Variant_clear(&defaultBrowseName); + return retval; +} + +/* Prepare the node, then add it to the nodestore */ +static UA_StatusCode +Operation_addNode_begin(UA_Server *server, UA_Session *session, void *nodeContext, + const UA_AddNodesItem *item, const UA_NodeId *parentNodeId, + const UA_NodeId *referenceTypeId, UA_NodeId *outNewNodeId) { + /* Create a temporary NodeId if none is returned */ + UA_NodeId newId; + if(!outNewNodeId) { + UA_NodeId_init(&newId); + outNewNodeId = &newId; + } + + /* Set the BrowsenName before adding to the Nodestore. The BrowseName is + * immutable afterwards. */ + UA_Boolean noBrowseName = UA_QualifiedName_isNull(&item->browseName); + UA_StatusCode retval = checkSetBrowseName(server, session, (UA_AddNodesItem*)(uintptr_t)item); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Create the node and add it to the nodestore */ + retval = AddNode_raw(server, session, nodeContext, item, outNewNodeId); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Typecheck and add references to parent and type definition */ + retval = AddNode_addRefs(server, session, outNewNodeId, parentNodeId, + referenceTypeId, &item->typeDefinition.nodeId); + if(retval != UA_STATUSCODE_GOOD) + deleteNode(server, *outNewNodeId, true); + + if(outNewNodeId == &newId) + UA_NodeId_clear(&newId); + + cleanup: + if(noBrowseName) + UA_QualifiedName_clear((UA_QualifiedName*)(uintptr_t)&item->browseName); + return retval; +} + +static UA_StatusCode +recursiveTypeCheckAddChildren(UA_Server *server, UA_Session *session, + const UA_Node **nodeptr, const UA_Node *type) { + UA_assert(type != NULL); + UA_StatusCode retval = UA_STATUSCODE_GOOD; + const UA_Node *node = *nodeptr; + + /* Use attributes from the type. The value and value constraints are the + * same for the variable and variabletype attribute structs. */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE || + node->head.nodeClass == UA_NODECLASS_VARIABLETYPE) { + retval = useVariableTypeAttributes(server, session, + (const UA_VariableNode**)nodeptr, + &type->variableTypeNode); + node = *nodeptr; /* If the node was replaced */ + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Using attributes for from " + "the variable type failed with error code %s", + (int)nodeIdStr.length, nodeIdStr.data, + UA_StatusCode_name(retval))); + return retval; + } + + /* Check NodeClass for 'hasSubtype'. UA_NODECLASS_VARIABLE not allowed + * to have subtype */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE) { + for(size_t i = 0; i < node->head.referencesSize; i++) { + if(node->head.references[i].referenceTypeIndex == + UA_REFERENCETYPEINDEX_HASSUBTYPE) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): VariableType not allowed to have HasSubType", + (int)nodeIdStr.length, nodeIdStr.data)); + return UA_STATUSCODE_BADREFERENCENOTALLOWED; + } + } + } + + /* Check if all attributes hold the constraints of the type now. The initial + * attributes must type-check. The constructor might change the attributes + * again. Then, the changes are type-checked by the normal write service. */ + retval = typeCheckVariableNode(server, session, &node->variableNode, + &type->variableTypeNode); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Type-checking " + "failed with error code %s", (int)nodeIdStr.length, + nodeIdStr.data, UA_StatusCode_name(retval))); + return retval; + } + } + + /* Add (mandatory) child nodes from the type definition */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE || + node->head.nodeClass == UA_NODECLASS_OBJECT) { + retval = addTypeChildren(server, session, &node->head, &type->head); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Adding child nodes " + "failed with error code %s", (int)nodeIdStr.length, + nodeIdStr.data, UA_StatusCode_name(retval))); + return retval; + } + } + + /* Add (mandatory) child nodes from the direct HasInterface reference */ + if(node->head.nodeClass == UA_NODECLASS_OBJECT) { + retval = addInterfaceChildren(server, session, &node->head); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Adding child nodes " + "interface failed with error code %s", + (int)nodeIdStr.length, nodeIdStr.data, + UA_StatusCode_name(retval))); + return retval; + } + } + + return UA_STATUSCODE_GOOD; +} + +/* Construct children first */ +static UA_StatusCode +recursiveCallConstructors(UA_Server *server, UA_Session *session, + const UA_NodeHead *head, const UA_Node *type) { + if(head->constructed) + return UA_STATUSCODE_GOOD; + + /* Construct the children */ + UA_BrowseDescription bd; + UA_BrowseDescription_init(&bd); + bd.nodeId = head->nodeId; + bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_AGGREGATES); + bd.includeSubtypes = true; + bd.browseDirection = UA_BROWSEDIRECTION_FORWARD; + + UA_BrowseResult br; + UA_BrowseResult_init(&br); + UA_UInt32 maxrefs = 0; + Operation_Browse(server, session, &maxrefs, &bd, &br); + if(br.statusCode != UA_STATUSCODE_GOOD) + return br.statusCode; + + /* Call the constructor for every unconstructed child node */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + for(size_t i = 0; i < br.referencesSize; ++i) { + UA_ReferenceDescription *rd = &br.references[i]; + const UA_Node *target = UA_NODESTORE_GET(server, &rd->nodeId.nodeId); + if(!target) + continue; + if(target->head.constructed) { + UA_NODESTORE_RELEASE(server, target); + continue; + } + + const UA_Node *targetType = NULL; + if(target->head.nodeClass == UA_NODECLASS_VARIABLE || + target->head.nodeClass == UA_NODECLASS_OBJECT) { + targetType = getNodeType(server, &target->head); + if(!targetType) { + UA_NODESTORE_RELEASE(server, target); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + break; + } + } + retval = recursiveCallConstructors(server, session, &target->head, targetType); + UA_NODESTORE_RELEASE(server, target); + if(targetType) + UA_NODESTORE_RELEASE(server, targetType); + if(retval != UA_STATUSCODE_GOOD) + break; + } + + UA_BrowseResult_clear(&br); + + /* If a child could not be constructed or the node is already constructed */ + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Call the global constructor */ + void *context = head->context; + if(server->config.nodeLifecycle.constructor) { + UA_UNLOCK(server->serviceMutex); + retval = server->config.nodeLifecycle.constructor(server, &session->sessionId, + session->sessionHandle, + &head->nodeId, &context); + UA_LOCK(server->serviceMutex); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* Call the local (per-type) constructor */ + const UA_NodeTypeLifecycle *lifecycle = NULL; + if(type && head->nodeClass == UA_NODECLASS_OBJECT) + lifecycle = &type->objectTypeNode.lifecycle; + else if(type && head->nodeClass == UA_NODECLASS_VARIABLE) + lifecycle = &type->variableTypeNode.lifecycle; + if(lifecycle && lifecycle->constructor) { + UA_UNLOCK(server->serviceMutex) + retval = lifecycle->constructor(server, &session->sessionId, + session->sessionHandle, &type->head.nodeId, + type->head.context, &head->nodeId, &context); + UA_LOCK(server->serviceMutex); + if(retval != UA_STATUSCODE_GOOD) + goto global_destructor; + } + + /* Set the context *and* mark the node as constructed */ + retval = UA_Server_editNode(server, &server->adminSession, &head->nodeId, + (UA_EditNodeCallback)setConstructedNodeContext, context); + if(retval != UA_STATUSCODE_GOOD) + goto local_destructor; + + /* All good, return */ + return retval; + + /* Fail. Call the destructors. */ + local_destructor: + if(lifecycle && lifecycle->destructor) { + UA_UNLOCK(server->serviceMutex); + lifecycle->destructor(server, &session->sessionId, session->sessionHandle, + &type->head.nodeId, type->head.context, &head->nodeId, + &context); + UA_LOCK(server->serviceMutex) + } + + global_destructor: + if(server->config.nodeLifecycle.destructor) { + UA_UNLOCK(server->serviceMutex); + server->config.nodeLifecycle.destructor(server, &session->sessionId, + session->sessionHandle, + &head->nodeId, context); + UA_LOCK(server->serviceMutex); + } + return retval; +} + +/* Add new ReferenceType to the subtypes bitfield */ +static UA_StatusCode +addReferenceTypeSubtype(UA_Server *server, UA_Session *session, + UA_Node *node, void *context) { + node->referenceTypeNode.subTypes = + UA_ReferenceTypeSet_union(node->referenceTypeNode.subTypes, + *(UA_ReferenceTypeSet*)context); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setReferenceTypeSubtypes(UA_Server *server, const UA_ReferenceTypeNode *node) { + /* Get the ReferenceTypes upwards in the hierarchy */ + size_t parentsSize = 0; + UA_ExpandedNodeId *parents = NULL; + UA_ReferenceTypeSet reftypes_subtype = UA_REFTYPESET(UA_REFERENCETYPEINDEX_HASSUBTYPE); + UA_StatusCode res = + browseRecursive(server, 1, &node->head.nodeId, UA_BROWSEDIRECTION_INVERSE, + &reftypes_subtype, UA_NODECLASS_UNSPECIFIED, + false, &parentsSize, &parents); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Add the ReferenceTypeIndex of this node */ + const UA_ReferenceTypeSet *newRefSet = &node->subTypes; + for(size_t i = 0; i < parentsSize; i++) { + UA_Server_editNode(server, &server->adminSession, &parents[i].nodeId, + addReferenceTypeSubtype, (void*)(uintptr_t)newRefSet); + } + + UA_Array_delete(parents, parentsSize, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +setVariableNodeDynamic(UA_Server *server, UA_Session *session, + UA_Node *node, const void *_) { + (void)_; /* unused */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE) + ((UA_VariableNode*)node)->isDynamic = true; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +checkSetIsDynamicVariable(UA_Server *server, UA_Session *session, + const UA_NodeId *nodeId) { + /* Get all hierarchical reference types */ + UA_ReferenceTypeSet reftypes_hierarchical; + UA_ReferenceTypeSet_init(&reftypes_hierarchical); + UA_NodeId hierarchicalRefs = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES); + UA_StatusCode res = + referenceTypeIndices(server, &hierarchicalRefs, &reftypes_hierarchical, true); + if(res != UA_STATUSCODE_GOOD) + return res; + + /* Is the variable under the server object? */ + UA_NodeId serverNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER); + if(isNodeInTree(server, nodeId, &serverNodeId, &reftypes_hierarchical)) + return UA_STATUSCODE_GOOD; + + /* Is the variable in the type hierarchy? */ + UA_NodeId typesNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_TYPESFOLDER); + if(isNodeInTree(server, nodeId, &typesNodeId, &reftypes_hierarchical)) + return UA_STATUSCODE_GOOD; + + /* Is the variable a property of a method node (InputArguments / + * OutputArguments)? */ + UA_BrowseDescription bd; + UA_BrowseDescription_init(&bd); + bd.nodeId = *nodeId; + bd.browseDirection = UA_BROWSEDIRECTION_INVERSE; + bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY); + bd.includeSubtypes = false; + bd.nodeClassMask = UA_NODECLASS_METHOD; + UA_BrowseResult br; + UA_BrowseResult_init(&br); + UA_UInt32 maxrefs = 0; + Operation_Browse(server, session, &maxrefs, &bd, &br); + UA_Boolean hasParentMethod = (br.referencesSize > 0); + UA_BrowseResult_clear(&br); + if(hasParentMethod) + return UA_STATUSCODE_GOOD; + + /* Set the variable to "dynamic" */ + UA_Server_editNode(server, session, nodeId, + (UA_EditNodeCallback)setVariableNodeDynamic, NULL); + + return UA_STATUSCODE_GOOD; +} + +/* Children, references, type-checking, constructors. */ +UA_StatusCode +AddNode_finish(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId) { + /* Get the node */ + const UA_Node *node = UA_NODESTORE_GET(server, nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + + const UA_Node *type = NULL; + const UA_NodeHead *head = &node->head; + + /* Set the ReferenceTypesSet of subtypes in the ReferenceTypeNode */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(node->head.nodeClass == UA_NODECLASS_REFERENCETYPE) { + retval = setReferenceTypeSubtypes(server, &node->referenceTypeNode); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Instantiate variables and objects */ + if(head->nodeClass == UA_NODECLASS_VARIABLE || + head->nodeClass == UA_NODECLASS_VARIABLETYPE || + head->nodeClass == UA_NODECLASS_OBJECT) { + /* Get the type node */ + type = getNodeType(server, head); + if(!type) { + if(server->bootstrapNS0) + goto constructor; + logAddNode(&server->config.logger, session, &head->nodeId, + "Node type not found"); + retval = UA_STATUSCODE_BADTYPEDEFINITIONINVALID; + goto cleanup; + } + + retval = recursiveTypeCheckAddChildren(server, session, &node, type); + head = &node->head; /* Pointer might have changed */ + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Set variables to dynamic (source and server timestamps are meaningful) if + * they fulfill some conditions */ + if(node->head.nodeClass == UA_NODECLASS_VARIABLE) { + retval = checkSetIsDynamicVariable(server, session, nodeId); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + } + + /* Call the constructor(s) */ + constructor: + retval = recursiveCallConstructors(server, session, head, type); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, + "AddNode (%.*s): Calling the node constructor(s) " + "failed with status code %s", (int)nodeIdStr.length, + nodeIdStr.data, UA_StatusCode_name(retval))); + } + + cleanup: + if(type) + UA_NODESTORE_RELEASE(server, type); + if(retval != UA_STATUSCODE_GOOD) { + deleteNode(server, head->nodeId, true); + } + UA_NODESTORE_RELEASE(server, node); + return retval; +} + +static void +Operation_addNode(UA_Server *server, UA_Session *session, void *nodeContext, + const UA_AddNodesItem *item, UA_AddNodesResult *result) { + result->statusCode = + Operation_addNode_begin(server, session, nodeContext, item, &item->parentNodeId.nodeId, + &item->referenceTypeId, &result->addedNodeId); + if(result->statusCode != UA_STATUSCODE_GOOD) + return; + + /* AddNodes_finish */ + result->statusCode = AddNode_finish(server, session, &result->addedNodeId); + + /* If finishing failed, the node was deleted */ + if(result->statusCode != UA_STATUSCODE_GOOD) + UA_NodeId_clear(&result->addedNodeId); +} + +void +Service_AddNodes(UA_Server *server, UA_Session *session, + const UA_AddNodesRequest *request, + UA_AddNodesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, "Processing AddNodesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxNodesPerNodeManagement != 0 && + request->nodesToAddSize > server->config.maxNodesPerNodeManagement) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_addNode, NULL, + &request->nodesToAddSize, &UA_TYPES[UA_TYPES_ADDNODESITEM], + &response->resultsSize, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +UA_StatusCode +addNode(UA_Server *server, const UA_NodeClass nodeClass, const UA_NodeId *requestedNewNodeId, + const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, + const UA_QualifiedName browseName, const UA_NodeId *typeDefinition, + const UA_NodeAttributes *attr, const UA_DataType *attributeType, + void *nodeContext, UA_NodeId *outNewNodeId) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Create the AddNodesItem */ + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.nodeClass = nodeClass; + item.requestedNewNodeId.nodeId = *requestedNewNodeId; + item.browseName = browseName; + item.parentNodeId.nodeId = *parentNodeId; + item.referenceTypeId = *referenceTypeId; + item.typeDefinition.nodeId = *typeDefinition; + UA_ExtensionObject_setValueNoDelete(&item.nodeAttributes, + (void*)(uintptr_t)attr, attributeType); + + /* Call the normal addnodes service */ + UA_AddNodesResult result; + UA_AddNodesResult_init(&result); + Operation_addNode(server, &server->adminSession, nodeContext, &item, &result); + if(outNewNodeId) + *outNewNodeId = result.addedNodeId; + else + UA_NodeId_clear(&result.addedNodeId); + return result.statusCode; +} + +UA_StatusCode +__UA_Server_addNode(UA_Server *server, const UA_NodeClass nodeClass, + const UA_NodeId *requestedNewNodeId, + const UA_NodeId *parentNodeId, + const UA_NodeId *referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId *typeDefinition, + const UA_NodeAttributes *attr, + const UA_DataType *attributeType, + void *nodeContext, UA_NodeId *outNewNodeId) { + UA_LOCK(server->serviceMutex) + UA_StatusCode reval = + addNode(server, nodeClass, requestedNewNodeId, parentNodeId, + referenceTypeId, browseName, typeDefinition, attr, + attributeType, nodeContext, outNewNodeId); + UA_UNLOCK(server->serviceMutex); + return reval; +} + +UA_StatusCode +UA_Server_addNode_begin(UA_Server *server, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, const void *attr, + const UA_DataType *attributeType, void *nodeContext, + UA_NodeId *outNewNodeId) { + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.nodeClass = nodeClass; + item.requestedNewNodeId.nodeId = requestedNewNodeId; + item.browseName = browseName; + item.typeDefinition.nodeId = typeDefinition; + UA_ExtensionObject_setValueNoDelete(&item.nodeAttributes, + (void*)(uintptr_t)attr, attributeType); + + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = + Operation_addNode_begin(server, &server->adminSession, nodeContext, &item, + &parentNodeId, &referenceTypeId, outNewNodeId); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +UA_Server_addNode_finish(UA_Server *server, const UA_NodeId nodeId) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = AddNode_finish(server, &server->adminSession, &nodeId); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/****************/ +/* Delete Nodes */ +/****************/ + +static void +Operation_deleteReference(UA_Server *server, UA_Session *session, void *context, + const UA_DeleteReferencesItem *item, UA_StatusCode *retval); + +/* Remove references to this node (in the other nodes) */ +static void +removeIncomingReferences(UA_Server *server, UA_Session *session, const UA_NodeHead *head) { + UA_DeleteReferencesItem item; + UA_DeleteReferencesItem_init(&item); + item.targetNodeId.nodeId = head->nodeId; + item.deleteBidirectional = false; + UA_StatusCode dummy; + for(size_t i = 0; i < head->referencesSize; ++i) { + UA_NodeReferenceKind *refs = &head->references[i]; + item.isForward = refs->isInverse; + item.referenceTypeId = *UA_NODESTORE_GETREFERENCETYPEID(server, refs->referenceTypeIndex); + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &refs->queueHead, queuePointers) { + item.sourceNodeId = target->targetId.nodeId; + Operation_deleteReference(server, session, NULL, &item, &dummy); + } + } +} + +/* A node can only be deleted if it has at most one incoming hierarchical */ +static UA_Boolean +multipleHierarchicalRefs(const UA_NodeHead *head, const UA_ReferenceTypeSet *refSet, + RefTree *refTree) { + for(size_t i = 0; i < head->referencesSize; i++) { + const UA_NodeReferenceKind *k = &head->references[i]; + if(!k->isInverse) + continue; + if(!UA_ReferenceTypeSet_contains(refSet, k->referenceTypeIndex)) + continue; + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &k->queueHead, queuePointers) { + if(!RefTree_containsNodeId(refTree, &target->targetId.nodeId)){ + return true; + } + } + } + return false; +} + +static void +deconstructRefTree(UA_Server *server, UA_Session *session, + UA_ReferenceTypeSet *hierarchRefsSet, const UA_NodeHead *head, + RefTree *refTree) { + //Deconstruct the nodes based on the RefTree entries, parent nodes first + for(size_t i = 0; i < refTree->size; i++) { + const UA_Node *member = UA_NODESTORE_GET(server, &refTree->targets[i].nodeId); + if(!member) + continue; + UA_NODESTORE_RELEASE(server, member); + + /* Call the type-level destructor */ + void *context = member->head.context; /* No longer needed after this function */ + if(member->head.nodeClass == UA_NODECLASS_OBJECT || + member->head.nodeClass == UA_NODECLASS_VARIABLE) { + const UA_Node *type = getNodeType(server, &member->head); + if(type) { + const UA_NodeTypeLifecycle *lifecycle; + if(member->head.nodeClass == UA_NODECLASS_OBJECT) + lifecycle = &type->objectTypeNode.lifecycle; + else + lifecycle = &type->variableTypeNode.lifecycle; + if(lifecycle->destructor) { + UA_UNLOCK(server->serviceMutex); + lifecycle->destructor(server, + &session->sessionId, session->sessionHandle, + &type->head.nodeId, type->head.context, + &member->head.nodeId, &context); + UA_LOCK(server->serviceMutex); + } + UA_NODESTORE_RELEASE(server, type); + } + } + + /* Call the global destructor */ + if(server->config.nodeLifecycle.destructor) { + UA_UNLOCK(server->serviceMutex); + server->config.nodeLifecycle.destructor(server, &session->sessionId, + session->sessionHandle, + &member->head.nodeId, context); + UA_LOCK(server->serviceMutex); + } + + /* Set the constructed flag to false */ + UA_Server_editNode(server, &server->adminSession, &member->head.nodeId, + (UA_EditNodeCallback)setDeconstructedNode, context); + } +} + +/* + * The processNodeLayer function searches all children's of the head node and adds the + * children node to the RefTree if all incoming references sources are contained in the + * RefTree (No external references to this node --> node can be deleted) + */ +static UA_StatusCode +processNodeLayer(UA_Server *server, UA_Session *session, RefTree *refTree, + const UA_ReferenceTypeSet *hierarchRefsSet, const UA_NodeHead *head){ + + for(size_t i = 0; i < head->referencesSize; ++i) { + UA_NodeReferenceKind *refs = &head->references[i]; + //check if the nodeID is hierarchical + if(!UA_ReferenceTypeSet_contains(hierarchRefsSet, refs->referenceTypeIndex)) + continue; + UA_ReferenceTarget *target; + TAILQ_FOREACH(target, &refs->queueHead, queuePointers) { + const UA_Node *child = UA_NODESTORE_GET(server, &target->targetId.nodeId); + if(!child) + continue; + /* Only delete child nodes that have no other parent */ + if(!multipleHierarchicalRefs(&child->head, hierarchRefsSet, refTree)){ + UA_Boolean contained; + UA_StatusCode addResult = RefTree_addNodeId(refTree, &child->head.nodeId, &contained); + if(addResult != UA_STATUSCODE_GOOD){ + return addResult; + } + } + UA_NODESTORE_RELEASE(server, child); + } + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +findSetOfSingleRefChilds(UA_Server *server, UA_Session *session, + const UA_ReferenceTypeSet *hierarchRefsSet, + const UA_NodeHead *head, UA_Boolean removeTargetRefs, RefTree *refTree) { + UA_UInt32 currentRefTreePosition = 0; + + UA_StatusCode addResult = RefTree_addNodeId(refTree, &head->nodeId, NULL); + if(addResult != UA_STATUSCODE_GOOD){ + return addResult; + } + + while (currentRefTreePosition != refTree->size){ + const UA_Node *member = UA_NODESTORE_GET(server, &refTree->targets[currentRefTreePosition++].nodeId); + if(!member) + continue; + processNodeLayer(server, session, refTree, hierarchRefsSet, &member->head); + UA_NODESTORE_RELEASE(server, member); + } + return UA_STATUSCODE_GOOD; +} + +static void +deleteNodeTree(UA_Server *server, UA_Session *session, + const UA_ReferenceTypeSet *hierarchRefsSet, + const UA_NodeHead *head, UA_Boolean removeTargetRefs, RefTree *refTree) { + //Delete the nodes based on the RefTree entries + for(size_t i = refTree->size; i > 0; --i) { + const UA_Node *member = UA_NODESTORE_GET(server, &refTree->targets[i-1].nodeId); + if(!member) + continue; + UA_NODESTORE_RELEASE(server, member); + if(removeTargetRefs) + removeIncomingReferences(server, session, &member->head); + UA_NODESTORE_REMOVE(server, &member->head.nodeId); + } +} + +static void +deleteNodeOperation(UA_Server *server, UA_Session *session, void *context, + const UA_DeleteNodesItem *item, UA_StatusCode *result) { + /* Do not check access for server */ + if(session != &server->adminSession && server->config.accessControl.allowDeleteNode) { + UA_UNLOCK(server->serviceMutex); + if( !server->config.accessControl.allowDeleteNode(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle, item)) { + UA_LOCK(server->serviceMutex); + *result = UA_STATUSCODE_BADUSERACCESSDENIED; + return; + } + UA_LOCK(server->serviceMutex); + } + + const UA_Node *node = UA_NODESTORE_GET(server, &item->nodeId); + if(!node) { + *result = UA_STATUSCODE_BADNODEIDUNKNOWN; + return; + } + + if(UA_Node_hasSubTypeOrInstances(&node->head)) { + UA_LOG_NODEID_INFO(&node->head.nodeId, + UA_LOG_INFO_SESSION(&server->config.logger, session, "DeleteNode (%.*s): " + "Cannot delete a type node with active instances or " + "subtypes", (int)nodeIdStr.length, nodeIdStr.data)); + UA_NODESTORE_RELEASE(server, node); + *result = UA_STATUSCODE_BADINTERNALERROR; + return; + } + + /* TODO: Check if the information model consistency is violated */ + /* TODO: Check if the node is a mandatory child of a parent */ + + /* A node can be referenced with hierarchical references from several + * parents in the information model. (But not in a circular way.) The + * hierarchical references are checked to see if a node can be deleted. + * Getting the type hierarchy can fail in case of low RAM. In that case the + * nodes are always deleted. */ + UA_ReferenceTypeSet hierarchRefsSet; + UA_NodeId hr = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES); + referenceTypeIndices(server, &hr, &hierarchRefsSet, true); + + /* The list of childs is needed for the deconstructing and deleting phase. + * Within the processNodeLayer we generate a RefTree based set of childs + * which can be deleted beside the parent node */ + RefTree refTree; + UA_StatusCode retval = RefTree_init(&refTree); + if(retval != UA_STATUSCODE_GOOD) + return; + retval = findSetOfSingleRefChilds(server, session, &hierarchRefsSet, &node->head, + item->deleteTargetReferences, &refTree); + if(retval != UA_STATUSCODE_GOOD){ + UA_LOG_WARNING_SESSION(&server->config.logger, session, + "DeleteNode: Incomplete lookup of nodes to delete"); + return; + } + deconstructRefTree(server, session, &hierarchRefsSet, + &node->head, &refTree); + deleteNodeTree(server, session, &hierarchRefsSet, &node->head, + item->deleteTargetReferences, &refTree); + + UA_NODESTORE_RELEASE(server, node); + RefTree_clear(&refTree); +} + +void +Service_DeleteNodes(UA_Server *server, UA_Session *session, + const UA_DeleteNodesRequest *request, + UA_DeleteNodesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing DeleteNodesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxNodesPerNodeManagement != 0 && + request->nodesToDeleteSize > server->config.maxNodesPerNodeManagement) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)deleteNodeOperation, + NULL, &request->nodesToDeleteSize, + &UA_TYPES[UA_TYPES_DELETENODESITEM], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_StatusCode +UA_Server_deleteNode(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean deleteReferences) { + UA_LOCK(server->serviceMutex) + UA_StatusCode retval = deleteNode(server, nodeId, deleteReferences); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +UA_StatusCode +deleteNode(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean deleteReferences) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_DeleteNodesItem item; + item.deleteTargetReferences = deleteReferences; + item.nodeId = nodeId; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + deleteNodeOperation(server, &server->adminSession, NULL, &item, &retval); + return retval; +} + +/******************/ +/* Add References */ +/******************/ + +struct AddNodeInfo { + UA_Byte refTypeIndex; + UA_Boolean isForward; + const UA_ExpandedNodeId *targetNodeId; + UA_UInt32 targetBrowseNameHash; +}; + +static UA_StatusCode +addOneWayReference(UA_Server *server, UA_Session *session, UA_Node *node, + const struct AddNodeInfo *info) { + return UA_Node_addReference(node, info->refTypeIndex, info->isForward, + info->targetNodeId, info->targetBrowseNameHash); +} + +static UA_StatusCode +deleteOneWayReference(UA_Server *server, UA_Session *session, UA_Node *node, + const UA_DeleteReferencesItem *item) { + const UA_Node *refType = UA_NODESTORE_GET(server, &item->referenceTypeId); + if(!refType) + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + if(refType->head.nodeClass != UA_NODECLASS_REFERENCETYPE) { + UA_NODESTORE_RELEASE(server, refType); + return UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + } + UA_Byte refTypeIndex = refType->referenceTypeNode.referenceTypeIndex; + UA_NODESTORE_RELEASE(server, refType); + return UA_Node_deleteReference(node, refTypeIndex, item->isForward, &item->targetNodeId); +} + +static void +Operation_addReference(UA_Server *server, UA_Session *session, void *context, + const UA_AddReferencesItem *item, UA_StatusCode *retval) { + (void)context; + UA_assert(session); + + /* Check access rights */ + if(session != &server->adminSession && server->config.accessControl.allowAddReference) { + UA_UNLOCK(server->serviceMutex); + if (!server->config.accessControl. + allowAddReference(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle, item)) { + UA_LOCK(server->serviceMutex); + *retval = UA_STATUSCODE_BADUSERACCESSDENIED; + return; + } + UA_LOCK(server->serviceMutex); + } + + /* TODO: Currently no expandednodeids are allowed */ + if(item->targetServerUri.length > 0) { + *retval = UA_STATUSCODE_BADNOTIMPLEMENTED; + return; + } + + /* Check the ReferenceType and get the index */ + const UA_Node *refType = UA_NODESTORE_GET(server, &item->referenceTypeId); + if(!refType) { + *retval = UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + return; + } + if(refType->head.nodeClass != UA_NODECLASS_REFERENCETYPE) { + UA_NODESTORE_RELEASE(server, refType); + *retval = UA_STATUSCODE_BADREFERENCETYPEIDINVALID; + return; + } + UA_Byte refTypeIndex = refType->referenceTypeNode.referenceTypeIndex; + UA_NODESTORE_RELEASE(server, refType); + + /* Get the source and target node BrowseName hash */ + const UA_Node *targetNode = UA_NODESTORE_GET(server, &item->targetNodeId.nodeId); + if(!targetNode) { + *retval = UA_STATUSCODE_BADTARGETNODEIDINVALID; + return; + } + UA_UInt32 targetNameHash = UA_QualifiedName_hash(&targetNode->head.browseName); + UA_NODESTORE_RELEASE(server, targetNode); + + const UA_Node *sourceNode = UA_NODESTORE_GET(server, &item->sourceNodeId); + if(!sourceNode) { + *retval = UA_STATUSCODE_BADSOURCENODEIDINVALID; + return; + } + UA_UInt32 sourceNameHash = UA_QualifiedName_hash(&sourceNode->head.browseName); + UA_NODESTORE_RELEASE(server, sourceNode); + + /* Compute the BrowseName hash and release the target */ + struct AddNodeInfo info; + info.refTypeIndex = refTypeIndex; + info.targetNodeId = &item->targetNodeId; + info.isForward = item->isForward; + info.targetBrowseNameHash = targetNameHash; + + /* Add the first direction */ + *retval = UA_Server_editNode(server, session, &item->sourceNodeId, + (UA_EditNodeCallback)addOneWayReference, &info); + UA_Boolean firstExisted = false; + if(*retval == UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED) { + *retval = UA_STATUSCODE_GOOD; + firstExisted = true; + } + if(*retval != UA_STATUSCODE_GOOD) + return; + + /* Add the second direction */ + UA_ExpandedNodeId target2; + UA_ExpandedNodeId_init(&target2); + target2.nodeId = item->sourceNodeId; + info.targetNodeId = &target2; + info.isForward = !info.isForward; + info.targetBrowseNameHash = sourceNameHash; + *retval = UA_Server_editNode(server, session, &item->targetNodeId.nodeId, + (UA_EditNodeCallback)addOneWayReference, &info); + + /* Second direction existed already */ + if(*retval == UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED) { + /* Calculate common duplicate reference not allowed result and set bad + * result if BOTH directions already existed */ + if(firstExisted) { + *retval = UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED; + return; + } + *retval = UA_STATUSCODE_GOOD; + } + + /* Remove first direction if the second direction failed */ + if(*retval != UA_STATUSCODE_GOOD && !firstExisted) { + UA_DeleteReferencesItem deleteItem; + deleteItem.sourceNodeId = item->sourceNodeId; + deleteItem.referenceTypeId = item->referenceTypeId; + deleteItem.isForward = item->isForward; + deleteItem.targetNodeId = item->targetNodeId; + deleteItem.deleteBidirectional = false; + /* Ignore status code */ + UA_Server_editNode(server, session, &item->sourceNodeId, + (UA_EditNodeCallback)deleteOneWayReference, &deleteItem); + } +} + +void +Service_AddReferences(UA_Server *server, UA_Session *session, + const UA_AddReferencesRequest *request, + UA_AddReferencesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing AddReferencesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_assert(session); + + if(server->config.maxNodesPerNodeManagement != 0 && + request->referencesToAddSize > server->config.maxNodesPerNodeManagement) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_addReference, + NULL, &request->referencesToAddSize, + &UA_TYPES[UA_TYPES_ADDREFERENCESITEM], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_StatusCode +UA_Server_addReference(UA_Server *server, const UA_NodeId sourceId, + const UA_NodeId refTypeId, + const UA_ExpandedNodeId targetId, + UA_Boolean isForward) { + UA_AddReferencesItem item; + UA_AddReferencesItem_init(&item); + item.sourceNodeId = sourceId; + item.referenceTypeId = refTypeId; + item.isForward = isForward; + item.targetNodeId = targetId; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_LOCK(server->serviceMutex); + Operation_addReference(server, &server->adminSession, NULL, &item, &retval); + UA_UNLOCK(server->serviceMutex) + return retval; +} + +/*********************/ +/* Delete References */ +/*********************/ + +static void +Operation_deleteReference(UA_Server *server, UA_Session *session, void *context, + const UA_DeleteReferencesItem *item, UA_StatusCode *retval) { + /* Do not check access for server */ + if(session != &server->adminSession && server->config.accessControl.allowDeleteReference) { + UA_UNLOCK(server->serviceMutex); + if (!server->config.accessControl. + allowDeleteReference(server, &server->config.accessControl, + &session->sessionId, session->sessionHandle, item)){ + UA_LOCK(server->serviceMutex); + *retval = UA_STATUSCODE_BADUSERACCESSDENIED; + return; + } + UA_LOCK(server->serviceMutex) + } + + // TODO: Check consistency constraints, remove the references. + *retval = UA_Server_editNode(server, session, &item->sourceNodeId, + (UA_EditNodeCallback)deleteOneWayReference, + /* cast away const qualifier because callback uses it anyway */ + (UA_DeleteReferencesItem *)(uintptr_t)item); + if(*retval != UA_STATUSCODE_GOOD) + return; + + if(!item->deleteBidirectional || item->targetNodeId.serverIndex != 0) + return; + + UA_DeleteReferencesItem secondItem; + UA_DeleteReferencesItem_init(&secondItem); + secondItem.isForward = !item->isForward; + secondItem.sourceNodeId = item->targetNodeId.nodeId; + secondItem.targetNodeId.nodeId = item->sourceNodeId; + secondItem.referenceTypeId = item->referenceTypeId; + *retval = UA_Server_editNode(server, session, &secondItem.sourceNodeId, + (UA_EditNodeCallback)deleteOneWayReference, + &secondItem); +} + +void +Service_DeleteReferences(UA_Server *server, UA_Session *session, + const UA_DeleteReferencesRequest *request, + UA_DeleteReferencesResponse *response) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Processing DeleteReferencesRequest"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(server->config.maxNodesPerNodeManagement != 0 && + request->referencesToDeleteSize > server->config.maxNodesPerNodeManagement) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYOPERATIONS; + return; + } + + response->responseHeader.serviceResult = + UA_Server_processServiceOperations(server, session, + (UA_ServiceOperation)Operation_deleteReference, + NULL, &request->referencesToDeleteSize, + &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM], + &response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_StatusCode +UA_Server_deleteReference(UA_Server *server, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_ExpandedNodeId targetNodeId, + UA_Boolean deleteBidirectional) { + UA_DeleteReferencesItem item; + item.sourceNodeId = sourceNodeId; + item.referenceTypeId = referenceTypeId; + item.isForward = isForward; + item.targetNodeId = targetNodeId; + item.deleteBidirectional = deleteBidirectional; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_LOCK(server->serviceMutex); + Operation_deleteReference(server, &server->adminSession, NULL, &item, &retval); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/**********************/ +/* Set Value Callback */ +/**********************/ + +static UA_StatusCode +setValueCallback(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_ValueCallback *callback) { + if(node->head.nodeClass != UA_NODECLASS_VARIABLE) + return UA_STATUSCODE_BADNODECLASSINVALID; + node->value.data.callback = *callback; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_setVariableNode_valueCallback(UA_Server *server, + const UA_NodeId nodeId, + const UA_ValueCallback callback) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback)setValueCallback, + /* cast away const because callback uses const anyway */ + (UA_ValueCallback *)(uintptr_t) &callback); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/***************************************************/ +/* Special Handling of Variables with Data Sources */ +/***************************************************/ + +UA_StatusCode +UA_Server_addDataSourceVariableNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, const UA_NodeId typeDefinition, + const UA_VariableAttributes attr, const UA_DataSource dataSource, + void *nodeContext, UA_NodeId *outNewNodeId) { + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.nodeClass = UA_NODECLASS_VARIABLE; + item.requestedNewNodeId.nodeId = requestedNewNodeId; + item.browseName = browseName; + UA_ExpandedNodeId typeDefinitionId; + UA_ExpandedNodeId_init(&typeDefinitionId); + typeDefinitionId.nodeId = typeDefinition; + item.typeDefinition = typeDefinitionId; + UA_ExtensionObject_setValueNoDelete(&item.nodeAttributes, (void*)(uintptr_t)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); + UA_NodeId newNodeId; + if(!outNewNodeId) { + newNodeId = UA_NODEID_NULL; + outNewNodeId = &newNodeId; + } + + UA_LOCK(server->serviceMutex); + /* Create the node and add it to the nodestore */ + UA_StatusCode retval = AddNode_raw(server, &server->adminSession, nodeContext, + &item, outNewNodeId); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Set the data source */ + retval = setVariableNode_dataSource(server, *outNewNodeId, dataSource); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Typecheck and add references to parent and type definition */ + retval = AddNode_addRefs(server, &server->adminSession, outNewNodeId, &parentNodeId, + &referenceTypeId, &typeDefinition); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Call the constructors */ + retval = AddNode_finish(server, &server->adminSession, outNewNodeId); + + cleanup: + UA_UNLOCK(server->serviceMutex); + if(outNewNodeId == &newNodeId) + UA_NodeId_clear(&newNodeId); + + return retval; +} + +static UA_StatusCode +setDataSource(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_DataSource *dataSource) { + if(node->head.nodeClass != UA_NODECLASS_VARIABLE) + return UA_STATUSCODE_BADNODECLASSINVALID; + if(node->valueSource == UA_VALUESOURCE_DATA) + UA_DataValue_clear(&node->value.data.value); + node->value.dataSource = *dataSource; + node->valueSource = UA_VALUESOURCE_DATASOURCE; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId, + const UA_DataSource dataSource) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + return UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback)setDataSource, + /* casting away const because callback casts it back anyway */ + (UA_DataSource *) (uintptr_t)&dataSource); +} + +UA_StatusCode +UA_Server_setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId, + const UA_DataSource dataSource) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = setVariableNode_dataSource(server, nodeId, dataSource); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/******************************/ +/* Set External Value Source */ +/******************************/ +static UA_StatusCode +setExternalValueSource(UA_Server *server, UA_Session *session, + UA_VariableNode *node, const UA_ValueBackend *externalValueSource) { + if(node->head.nodeClass != UA_NODECLASS_VARIABLE) + return UA_STATUSCODE_BADNODECLASSINVALID; + node->valueBackend.backendType = UA_VALUEBACKENDTYPE_EXTERNAL; + node->valueBackend.backend.external.value = externalValueSource->backend.external.value; + node->valueBackend.backend.external.callback.notificationRead = externalValueSource->backend.external.callback.notificationRead; + node->valueBackend.backend.external.callback.userWrite = externalValueSource->backend.external.callback.userWrite; + return UA_STATUSCODE_GOOD; +} + +/**********************/ +/* Set Value Backend */ +/**********************/ + +UA_StatusCode +UA_Server_setVariableNode_valueBackend(UA_Server *server, const UA_NodeId nodeId, + const UA_ValueBackend valueBackend){ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + UA_LOCK(server->serviceMutex); + switch(valueBackend.backendType){ + case UA_VALUEBACKENDTYPE_NONE: + return UA_STATUSCODE_BADCONFIGURATIONERROR; + case UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK: + retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback) setValueCallback, + /* cast away const because callback uses const anyway */ + (UA_ValueCallback *)(uintptr_t) &valueBackend.backend.dataSource); + break; + case UA_VALUEBACKENDTYPE_INTERNAL: + break; + case UA_VALUEBACKENDTYPE_EXTERNAL: + retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback) setExternalValueSource, + /* cast away const because callback uses const anyway */ + (UA_ValueCallback *)(uintptr_t) &valueBackend); + break; + } + + + // UA_StatusCode retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + // (UA_EditNodeCallback)setValueCallback, + /* cast away const because callback uses const anyway */ + // (UA_ValueCallback *)(uintptr_t) &callback); + + + UA_UNLOCK(server->serviceMutex); + return retval; +} + + +/************************************/ +/* Special Handling of Method Nodes */ +/************************************/ + +#ifdef UA_ENABLE_METHODCALLS + +static const UA_NodeId hasproperty = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_HASPROPERTY}}; +static const UA_NodeId propertytype = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_PROPERTYTYPE}}; + +static UA_StatusCode +UA_Server_addMethodNodeEx_finish(UA_Server *server, const UA_NodeId nodeId, UA_MethodCallback method, + const size_t inputArgumentsSize, const UA_Argument *inputArguments, + const UA_NodeId inputArgumentsRequestedNewNodeId, + UA_NodeId *inputArgumentsOutNewNodeId, + const size_t outputArgumentsSize, const UA_Argument *outputArguments, + const UA_NodeId outputArgumentsRequestedNewNodeId, + UA_NodeId *outputArgumentsOutNewNodeId) { + /* Browse to see which argument nodes exist */ + UA_BrowseDescription bd; + UA_BrowseDescription_init(&bd); + bd.nodeId = nodeId; + bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY); + bd.includeSubtypes = false; + bd.browseDirection = UA_BROWSEDIRECTION_FORWARD; + bd.nodeClassMask = UA_NODECLASS_VARIABLE; + bd.resultMask = UA_BROWSERESULTMASK_BROWSENAME; + + UA_BrowseResult br; + UA_BrowseResult_init(&br); + UA_UInt32 maxrefs = 0; + Operation_Browse(server, &server->adminSession, &maxrefs, &bd, &br); + + UA_StatusCode retval = br.statusCode; + if(retval != UA_STATUSCODE_GOOD) { + deleteNode(server, nodeId, true); + UA_BrowseResult_clear(&br); + return retval; + } + + /* Filter out the argument nodes */ + UA_NodeId inputArgsId = UA_NODEID_NULL; + UA_NodeId outputArgsId = UA_NODEID_NULL; + const UA_QualifiedName inputArgsName = UA_QUALIFIEDNAME(0, "InputArguments"); + const UA_QualifiedName outputArgsName = UA_QUALIFIEDNAME(0, "OutputArguments"); + for(size_t i = 0; i < br.referencesSize; i++) { + UA_ReferenceDescription *rd = &br.references[i]; + if(rd->browseName.namespaceIndex == 0 && + UA_String_equal(&rd->browseName.name, &inputArgsName.name)) + inputArgsId = rd->nodeId.nodeId; + else if(rd->browseName.namespaceIndex == 0 && + UA_String_equal(&rd->browseName.name, &outputArgsName.name)) + outputArgsId = rd->nodeId.nodeId; + } + + /* Add the Input Arguments VariableNode */ + if(inputArgumentsSize > 0 && UA_NodeId_isNull(&inputArgsId)) { + UA_VariableAttributes attr = UA_VariableAttributes_default; + char *name = "InputArguments"; + attr.displayName = UA_LOCALIZEDTEXT("", name); + attr.dataType = UA_TYPES[UA_TYPES_ARGUMENT].typeId; + attr.valueRank = UA_VALUERANK_ONE_DIMENSION; + UA_UInt32 inputArgsSize32 = (UA_UInt32)inputArgumentsSize; + attr.arrayDimensions = &inputArgsSize32; + attr.arrayDimensionsSize = 1; + UA_Variant_setArray(&attr.value, (void *)(uintptr_t)inputArguments, + inputArgumentsSize, &UA_TYPES[UA_TYPES_ARGUMENT]); + retval = addNode(server, UA_NODECLASS_VARIABLE, &inputArgumentsRequestedNewNodeId, + &nodeId, &hasproperty, UA_QUALIFIEDNAME(0, name), + &propertytype, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], + NULL, &inputArgsId); + if(retval != UA_STATUSCODE_GOOD) + goto error; + } + + /* Add the Output Arguments VariableNode */ + if(outputArgumentsSize > 0 && UA_NodeId_isNull(&outputArgsId)) { + UA_VariableAttributes attr = UA_VariableAttributes_default; + char *name = "OutputArguments"; + attr.displayName = UA_LOCALIZEDTEXT("", name); + attr.dataType = UA_TYPES[UA_TYPES_ARGUMENT].typeId; + attr.valueRank = UA_VALUERANK_ONE_DIMENSION; + UA_UInt32 outputArgsSize32 = (UA_UInt32)outputArgumentsSize; + attr.arrayDimensions = &outputArgsSize32; + attr.arrayDimensionsSize = 1; + UA_Variant_setArray(&attr.value, (void *)(uintptr_t)outputArguments, + outputArgumentsSize, &UA_TYPES[UA_TYPES_ARGUMENT]); + retval = addNode(server, UA_NODECLASS_VARIABLE, &outputArgumentsRequestedNewNodeId, + &nodeId, &hasproperty, UA_QUALIFIEDNAME(0, name), + &propertytype, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], + NULL, &outputArgsId); + if(retval != UA_STATUSCODE_GOOD) + goto error; + } + + retval = setMethodNode_callback(server, nodeId, method); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + /* Call finish to add the parent reference */ + retval = AddNode_finish(server, &server->adminSession, &nodeId); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + if(inputArgumentsOutNewNodeId != NULL) { + UA_NodeId_copy(&inputArgsId, inputArgumentsOutNewNodeId); + } + if(outputArgumentsOutNewNodeId != NULL) { + UA_NodeId_copy(&outputArgsId, outputArgumentsOutNewNodeId); + } + UA_BrowseResult_clear(&br); + return retval; + +error: + deleteNode(server, nodeId, true); + deleteNode(server, inputArgsId, true); + deleteNode(server, outputArgsId, true); + UA_BrowseResult_clear(&br); + return retval; +} + +UA_StatusCode +UA_Server_addMethodNode_finish(UA_Server *server, const UA_NodeId nodeId, + UA_MethodCallback method, + size_t inputArgumentsSize, const UA_Argument* inputArguments, + size_t outputArgumentsSize, const UA_Argument* outputArguments) { + UA_LOCK(server->serviceMutex) + UA_StatusCode retval = UA_Server_addMethodNodeEx_finish(server, nodeId, method, + inputArgumentsSize, inputArguments, UA_NODEID_NULL, NULL, + outputArgumentsSize, outputArguments, UA_NODEID_NULL, NULL); + UA_UNLOCK(server->serviceMutex) + return retval; +} + +UA_StatusCode +UA_Server_addMethodNodeEx(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_MethodAttributes attr, UA_MethodCallback method, + size_t inputArgumentsSize, const UA_Argument *inputArguments, + const UA_NodeId inputArgumentsRequestedNewNodeId, + UA_NodeId *inputArgumentsOutNewNodeId, + size_t outputArgumentsSize, const UA_Argument *outputArguments, + const UA_NodeId outputArgumentsRequestedNewNodeId, + UA_NodeId *outputArgumentsOutNewNodeId, + void *nodeContext, UA_NodeId *outNewNodeId) { + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.nodeClass = UA_NODECLASS_METHOD; + item.requestedNewNodeId.nodeId = requestedNewNodeId; + item.browseName = browseName; + UA_ExtensionObject_setValueNoDelete(&item.nodeAttributes, (void*)(uintptr_t)&attr, + &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); + UA_NodeId newId; + if(!outNewNodeId) { + UA_NodeId_init(&newId); + outNewNodeId = &newId; + } + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = Operation_addNode_begin(server, &server->adminSession, + nodeContext, &item, &parentNodeId, + &referenceTypeId, outNewNodeId); + if(retval != UA_STATUSCODE_GOOD) { + UA_UNLOCK(server->serviceMutex); + return retval; + } + + retval = UA_Server_addMethodNodeEx_finish(server, *outNewNodeId, method, + inputArgumentsSize, inputArguments, + inputArgumentsRequestedNewNodeId, + inputArgumentsOutNewNodeId, + outputArgumentsSize, outputArguments, + outputArgumentsRequestedNewNodeId, + outputArgumentsOutNewNodeId); + UA_UNLOCK(server->serviceMutex); + if(outNewNodeId == &newId) + UA_NodeId_clear(&newId); + return retval; +} + +static UA_StatusCode +editMethodCallback(UA_Server *server, UA_Session* session, + UA_Node *node, UA_MethodCallback methodCallback) { + if(node->head.nodeClass != UA_NODECLASS_METHOD) + return UA_STATUSCODE_BADNODECLASSINVALID; + node->methodNode.method = methodCallback; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +setMethodNode_callback(UA_Server *server, + const UA_NodeId methodNodeId, + UA_MethodCallback methodCallback) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + return UA_Server_editNode(server, &server->adminSession, &methodNodeId, + (UA_EditNodeCallback)editMethodCallback, + (void*)(uintptr_t)methodCallback); +} + +UA_StatusCode +UA_Server_setMethodNode_callback(UA_Server *server, + const UA_NodeId methodNodeId, + UA_MethodCallback methodCallback) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retVal = setMethodNode_callback(server, methodNodeId, methodCallback); + UA_UNLOCK(server->serviceMutex); + return retVal; +} + +#endif + +/************************/ +/* Lifecycle Management */ +/************************/ + +void UA_EXPORT +UA_Server_setAdminSessionContext(UA_Server *server, + void *context) { + server->adminSession.sessionHandle = context; +} + +static UA_StatusCode +setNodeTypeLifecycle(UA_Server *server, UA_Session *session, + UA_Node *node, UA_NodeTypeLifecycle *lifecycle) { + if(node->head.nodeClass == UA_NODECLASS_OBJECTTYPE) { + node->objectTypeNode.lifecycle = *lifecycle; + } else if(node->head.nodeClass == UA_NODECLASS_VARIABLETYPE) { + node->variableTypeNode.lifecycle = *lifecycle; + } else { + return UA_STATUSCODE_BADNODECLASSINVALID; + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Server_setNodeTypeLifecycle(UA_Server *server, UA_NodeId nodeId, + UA_NodeTypeLifecycle lifecycle) { + UA_LOCK(server->serviceMutex); + UA_StatusCode retval = UA_Server_editNode(server, &server->adminSession, &nodeId, + (UA_EditNodeCallback)setNodeTypeLifecycle, + &lifecycle); + UA_UNLOCK(server->serviceMutex); + return retval; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_services_discovery_multicast.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + */ + + +#if defined(UA_ENABLE_DISCOVERY) && defined(UA_ENABLE_DISCOVERY_MULTICAST) + +#if UA_MULTITHREADING >= 200 + +static void * +multicastWorkerLoop(UA_Server *server) { + struct timeval next_sleep = {.tv_sec = 0, .tv_usec = 0}; + volatile UA_Boolean *running = &server->discoveryManager.mdnsRunning; + fd_set fds; + + while(*running) { + FD_ZERO(&fds); + UA_fd_set(server->discoveryManager.mdnsSocket, &fds); + select(server->discoveryManager.mdnsSocket + 1, &fds, 0, 0, &next_sleep); + + if(!*running) + break; + + unsigned short retVal = + mdnsd_step(server->discoveryManager.mdnsDaemon, server->discoveryManager.mdnsSocket, + FD_ISSET(server->discoveryManager.mdnsSocket, &fds), true, &next_sleep); + if(retVal == 1) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast error: Can not read from socket. %s", errno_str)); + break; + } else if (retVal == 2) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast error: Can not write to socket. %s", errno_str)); + break; + } + } + return NULL; +} + +static UA_StatusCode +multicastListenStart(UA_Server* server) { + int err = pthread_create(&server->discoveryManager.mdnsThread, NULL, + (void* (*)(void*))multicastWorkerLoop, server); + if(err != 0) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast error: Can not create multicast thread."); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +multicastListenStop(UA_Server* server) { + mdnsd_shutdown(server->discoveryManager.mdnsDaemon); + // wake up select + if (write(server->discoveryManager.mdnsSocket, "\0", 1)) { + // TODO: if makes no sense here? + } // TODO: move to arch? + if (pthread_join(server->discoveryManager.mdnsThread, NULL)) { + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, "Multicast error: Can not stop thread."); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +# endif /* UA_MULTITHREADING */ + +static UA_StatusCode +addMdnsRecordForNetworkLayer(UA_Server *server, const UA_String *appName, + const UA_ServerNetworkLayer* nl) { + UA_String hostname = UA_STRING_NULL; + UA_UInt16 port = 4840; + UA_String path = UA_STRING_NULL; + UA_StatusCode retval = UA_parseEndpointUrl(&nl->discoveryUrl, &hostname, + &port, &path); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Server url is invalid: %.*s", + (int)nl->discoveryUrl.length, nl->discoveryUrl.data); + return retval; + } + + retval = UA_Discovery_addRecord(server, appName, &hostname, port, + &path, UA_DISCOVERY_TCP, true, + server->config.mdnsConfig.serverCapabilities, + server->config.mdnsConfig.serverCapabilitiesSize, + true); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Cannot add mDNS Record: %s", + UA_StatusCode_name(retval)); + return retval; + } + return UA_STATUSCODE_GOOD; +} + +void startMulticastDiscoveryServer(UA_Server *server) { + UA_String *appName = &server->config.mdnsConfig.mdnsServerName; + for(size_t i = 0; i < server->config.networkLayersSize; i++) + addMdnsRecordForNetworkLayer(server, appName, &server->config.networkLayers[i]); + + /* find any other server on the net */ + UA_Discovery_multicastQuery(server); + +#if UA_MULTITHREADING >= 200 + multicastListenStart(server); +# endif +} + +void +stopMulticastDiscoveryServer(UA_Server *server) { + if (!server->discoveryManager.mdnsDaemon) + return; + + for (size_t i=0; i<server->config.networkLayersSize; i++) { + + UA_String hostname = UA_STRING_NULL; + UA_String path = UA_STRING_NULL; + UA_UInt16 port = 0; + + UA_StatusCode retval = UA_parseEndpointUrl(&server->config.networkLayers[i].discoveryUrl, &hostname, + &port, &path); + + if (retval != UA_STATUSCODE_GOOD) + continue; + + UA_Discovery_removeRecord(server, &server->config.mdnsConfig.mdnsServerName, + &hostname, port, true); + + } + +#if UA_MULTITHREADING >= 200 + multicastListenStop(server); +# else + // send out last package with TTL = 0 + iterateMulticastDiscoveryServer(server, NULL, false); +# endif +} + +/* All filter criteria must be fulfilled in the list entry. The comparison is case + * insensitive. + * @returns true if the entry matches the filter. False if the filter does not match. + * */ +static UA_Boolean +entryMatchesCapabilityFilter(size_t serverCapabilityFilterSize, UA_String *serverCapabilityFilter, + serverOnNetwork_list_entry* current) { + // if the entry has less capabilities defined than the filter, there's no match + if (serverCapabilityFilterSize > current->serverOnNetwork.serverCapabilitiesSize) + return UA_FALSE; + for(size_t i = 0; i < serverCapabilityFilterSize; i++) { + UA_Boolean capabilityFound = UA_FALSE; + for(size_t j = 0; j < current->serverOnNetwork.serverCapabilitiesSize; j++) { + if(UA_String_equal_ignorecase(&serverCapabilityFilter[i], + ¤t->serverOnNetwork.serverCapabilities[j])) { + capabilityFound = UA_TRUE; + break; + } + } + if (!capabilityFound) + return UA_FALSE; // entry does not match capability + } + return UA_TRUE; +} + +void Service_FindServersOnNetwork(UA_Server *server, UA_Session *session, + const UA_FindServersOnNetworkRequest *request, + UA_FindServersOnNetworkResponse *response) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if (!server->config.mdnsEnabled) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTIMPLEMENTED; + return; + } + + /* Set LastCounterResetTime */ + UA_DateTime_copy(&server->discoveryManager.serverOnNetworkRecordIdLastReset, + &response->lastCounterResetTime); + + /* Compute the max number of records to return */ + UA_UInt32 recordCount = 0; + if(request->startingRecordId < server->discoveryManager.serverOnNetworkRecordIdCounter) + recordCount = server->discoveryManager.serverOnNetworkRecordIdCounter - + request->startingRecordId; + if(request->maxRecordsToReturn && recordCount > request->maxRecordsToReturn) + recordCount = UA_MIN(recordCount, request->maxRecordsToReturn); + if(recordCount == 0) { + response->serversSize = 0; + return; + } + + /* Iterate over all records and add to filtered list */ + UA_UInt32 filteredCount = 0; + UA_STACKARRAY(UA_ServerOnNetwork*, filtered, recordCount); + serverOnNetwork_list_entry* current; + LIST_FOREACH(current, &server->discoveryManager.serverOnNetwork, pointers) { + if(filteredCount >= recordCount) + break; + if(current->serverOnNetwork.recordId < request->startingRecordId) + continue; + if(!entryMatchesCapabilityFilter(request->serverCapabilityFilterSize, + request->serverCapabilityFilter, current)) + continue; + filtered[filteredCount++] = ¤t->serverOnNetwork; + } + + if(filteredCount == 0) + return; + + /* Allocate the array for the response */ + response->servers = + (UA_ServerOnNetwork*)UA_malloc(sizeof(UA_ServerOnNetwork)*filteredCount); + if(!response->servers) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return; + } + response->serversSize = filteredCount; + + /* Copy the server names */ + for(size_t i = 0; i < filteredCount; i++) + UA_ServerOnNetwork_copy(filtered[i], &response->servers[filteredCount-i-1]); +} + +void +UA_Server_updateMdnsForDiscoveryUrl(UA_Server *server, const UA_String *serverName, + const UA_MdnsDiscoveryConfiguration *mdnsConfig, + const UA_String *discoveryUrl, + UA_Boolean isOnline, UA_Boolean updateTxt) { + UA_String hostname = UA_STRING_NULL; + UA_UInt16 port = 4840; + UA_String path = UA_STRING_NULL; + UA_StatusCode retval = UA_parseEndpointUrl(discoveryUrl, &hostname, &port, &path); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_NETWORK, + "Server url invalid: %.*s", + (int)discoveryUrl->length, discoveryUrl->data); + return; + } + + if(!isOnline) { + UA_StatusCode removeRetval = + UA_Discovery_removeRecord(server, serverName, &hostname, + port, updateTxt); + if(removeRetval != UA_STATUSCODE_GOOD) + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Could not remove mDNS record for hostname %.*s.", + (int)serverName->length, serverName->data); + return; + } + + UA_String *capabilities = NULL; + size_t capabilitiesSize = 0; + if(mdnsConfig) { + capabilities = mdnsConfig->serverCapabilities; + capabilitiesSize = mdnsConfig->serverCapabilitiesSize; + } + + UA_StatusCode addRetval = + UA_Discovery_addRecord(server, serverName, &hostname, + port, &path, UA_DISCOVERY_TCP, updateTxt, + capabilities, capabilitiesSize, + false); + if(addRetval != UA_STATUSCODE_GOOD) + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Could not add mDNS record for hostname %.*s.", + (int)serverName->length, serverName->data); +} + +void +UA_Server_setServerOnNetworkCallback(UA_Server *server, + UA_Server_serverOnNetworkCallback cb, + void* data) { + UA_LOCK(server->serviceMutex); + server->discoveryManager.serverOnNetworkCallback = cb; + server->discoveryManager.serverOnNetworkCallbackData = data; + UA_UNLOCK(server->serviceMutex); +} + +static void +UA_Discovery_multicastConflict(char *name, int type, void *arg) { + // cppcheck-suppress unreadVariable + UA_Server *server = (UA_Server*) arg; + UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS name conflict detected: " + "'%s' for type %d", name, type); +} + +/* Create a service domain with the format [servername]-[hostname]._opcua-tcp._tcp.local. */ +static void +createFullServiceDomain(char *outServiceDomain, size_t maxLen, + const UA_String *servername, const UA_String *hostname) { + size_t hostnameLen = hostname->length; + size_t servernameLen = servername->length; + + maxLen -= 24; /* the length we have remaining before the opc ua postfix and + * the trailing zero */ + + /* Can we use hostname and servername with full length? */ + if(hostnameLen + servernameLen + 1 > maxLen) { + if(servernameLen + 2 > maxLen) { + servernameLen = maxLen; + hostnameLen = 0; + } else { + hostnameLen = maxLen - servernameLen - 1; + } + } + + size_t offset = 0; + if (hostnameLen > 0) { + UA_snprintf(outServiceDomain, maxLen + 1, "%.*s-%.*s", + (int) servernameLen, (char *) servername->data, + (int) hostnameLen, (char *) hostname->data); + offset = servernameLen + hostnameLen + 1; + //replace all dots with minus. Otherwise mDNS is not valid + for (size_t i=servernameLen+1; i<offset; i++) { + if (outServiceDomain[i] == '.') + outServiceDomain[i] = '-'; + } + } + else { + UA_snprintf(outServiceDomain, maxLen + 1, "%.*s", + (int) servernameLen, (char *) servername->data); + offset = servernameLen; + } + UA_snprintf(&outServiceDomain[offset], 24, "._opcua-tcp._tcp.local."); +} + +/* Check if mDNS already has an entry for given hostname and port combination */ +static UA_Boolean +UA_Discovery_recordExists(UA_Server* server, const char* fullServiceDomain, + unsigned short port, const UA_DiscoveryProtocol protocol) { + // [servername]-[hostname]._opcua-tcp._tcp.local. 86400 IN SRV 0 5 port [hostname]. + mdns_record_t *r = mdnsd_get_published(server->discoveryManager.mdnsDaemon, fullServiceDomain); + while(r) { + const mdns_answer_t *data = mdnsd_record_data(r); + if(data->type == QTYPE_SRV && (port == 0 || data->srv.port == port)) + return true; + r = mdnsd_record_next(r); + } + return false; +} + +static int +discovery_multicastQueryAnswer(mdns_answer_t *a, void *arg) { + UA_Server *server = (UA_Server*) arg; + if(a->type != QTYPE_PTR) + return 0; + + if(a->rdname == NULL) + return 0; + + /* Skip, if we already know about this server */ + UA_Boolean exists = + UA_Discovery_recordExists(server, a->rdname, 0, UA_DISCOVERY_TCP); + if(exists == true) + return 0; + + if(mdnsd_has_query(server->discoveryManager.mdnsDaemon, a->rdname)) + return 0; + + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "mDNS send query for: %s SRV&TXT %s", a->name, a->rdname); + + mdnsd_query(server->discoveryManager.mdnsDaemon, a->rdname, QTYPE_SRV, + discovery_multicastQueryAnswer, server); + mdnsd_query(server->discoveryManager.mdnsDaemon, a->rdname, QTYPE_TXT, + discovery_multicastQueryAnswer, server); + return 0; +} + +UA_StatusCode +UA_Discovery_multicastQuery(UA_Server* server) { + mdnsd_query(server->discoveryManager.mdnsDaemon, "_opcua-tcp._tcp.local.", + QTYPE_PTR,discovery_multicastQueryAnswer, server); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Discovery_addRecord(UA_Server *server, const UA_String *servername, + const UA_String *hostname, UA_UInt16 port, + const UA_String *path, const UA_DiscoveryProtocol protocol, + UA_Boolean createTxt, const UA_String* capabilites, + const size_t capabilitiesSize, + UA_Boolean isSelf) { + // we assume that the hostname is not an IP address, but a valid domain name + // It is required by the OPC UA spec (see Part 12, DiscoveryURL to DNS SRV mapping) + // to always use the hostname instead of the IP address + + if(capabilitiesSize > 0 && !capabilites) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + size_t hostnameLen = hostname->length; + size_t servernameLen = servername->length; + if(hostnameLen == 0 || servernameLen == 0) + return UA_STATUSCODE_BADOUTOFRANGE; + + // use a limit for the hostname length to make sure full string fits into 63 + // chars (limited by DNS spec) + if(hostnameLen+servernameLen + 1 > 63) { // include dash between servername-hostname + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: Combination of hostname+servername exceeds " + "maximum of 62 chars. It will be truncated."); + } else if(hostnameLen > 63) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: Hostname length exceeds maximum of 63 chars. " + "It will be truncated."); + } + + if(!server->discoveryManager.mdnsMainSrvAdded) { + mdns_record_t *r = + mdnsd_shared(server->discoveryManager.mdnsDaemon, "_services._dns-sd._udp.local.", + QTYPE_PTR, 600); + mdnsd_set_host(server->discoveryManager.mdnsDaemon, r, "_opcua-tcp._tcp.local."); + server->discoveryManager.mdnsMainSrvAdded = true; + } + + // [servername]-[hostname]._opcua-tcp._tcp.local. + char fullServiceDomain[63+24]; + createFullServiceDomain(fullServiceDomain, 63+24, servername, hostname); + + UA_Boolean exists = UA_Discovery_recordExists(server, fullServiceDomain, port, protocol); + if(exists == true) + return UA_STATUSCODE_GOOD; + + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: add record for domain: %s", fullServiceDomain); + + + if (isSelf && server->discoveryManager.selfFqdnMdnsRecord.length == 0) { + server->discoveryManager.selfFqdnMdnsRecord = UA_STRING_ALLOC(fullServiceDomain); + if (!server->discoveryManager.selfFqdnMdnsRecord.data) + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + + struct serverOnNetwork_list_entry *listEntry; + // The servername is servername + hostname. It is the same which we get through mDNS and therefore we need to match servername + UA_StatusCode retval = UA_DiscoveryManager_addEntryToServersOnNetwork(server, fullServiceDomain, fullServiceDomain, + UA_MIN(63, (servernameLen+hostnameLen)+1), &listEntry); + if (retval != UA_STATUSCODE_GOOD && retval != UA_STATUSCODE_BADALREADYEXISTS) + return retval; + + // If entry is already in list, skip initialization of capabilities and txt+srv + if (retval != UA_STATUSCODE_BADALREADYEXISTS) { + // if capabilitiesSize is 0, then add default cap 'NA' + listEntry->serverOnNetwork.serverCapabilitiesSize = UA_MAX(1, capabilitiesSize); + listEntry->serverOnNetwork.serverCapabilities = + (UA_String *) UA_Array_new(listEntry->serverOnNetwork.serverCapabilitiesSize, &UA_TYPES[UA_TYPES_STRING]); + if (!listEntry->serverOnNetwork.serverCapabilities) + return UA_STATUSCODE_BADOUTOFMEMORY; + if (capabilitiesSize == 0) { + UA_String na; + na.length = 2; + na.data = (UA_Byte *) (uintptr_t) "NA"; + UA_String_copy(&na, &listEntry->serverOnNetwork.serverCapabilities[0]); + } else { + for (size_t i = 0; i < capabilitiesSize; i++) { + UA_String_copy(&capabilites[i], &listEntry->serverOnNetwork.serverCapabilities[i]); + } + } + + listEntry->txtSet = true; + + UA_STACKARRAY(char, newUrl, 10 + hostnameLen + 8 + path->length + 1); + UA_snprintf(newUrl, 10 + hostnameLen + 8 + path->length + 1, "opc.tcp://%.*s:%d%s%.*s", (int) hostnameLen, + hostname->data, port, path->length > 0 ? "/" : "", (int) path->length, path->data); + listEntry->serverOnNetwork.discoveryUrl = UA_String_fromChars(newUrl); + listEntry->srvSet = true; + } + + // _services._dns-sd._udp.local. PTR _opcua-tcp._tcp.local + + // check if there is already a PTR entry for the given service. + + // _opcua-tcp._tcp.local. PTR [servername]-[hostname]._opcua-tcp._tcp.local. + mdns_record_t *r = mdns_find_record(server->discoveryManager.mdnsDaemon, QTYPE_PTR, + "_opcua-tcp._tcp.local.", fullServiceDomain); + if(!r) { + r = mdnsd_shared(server->discoveryManager.mdnsDaemon, "_opcua-tcp._tcp.local.", QTYPE_PTR, 600); + mdnsd_set_host(server->discoveryManager.mdnsDaemon, r, fullServiceDomain); + } + + /* The first 63 characters of the hostname (or less) */ + size_t maxHostnameLen = UA_MIN(hostnameLen, 63); + char localDomain[65]; + memcpy(localDomain, hostname->data, maxHostnameLen); + localDomain[maxHostnameLen] = '.'; + localDomain[maxHostnameLen+1] = '\0'; + + // [servername]-[hostname]._opcua-tcp._tcp.local. 86400 IN SRV 0 5 port [hostname]. + r = mdnsd_unique(server->discoveryManager.mdnsDaemon, fullServiceDomain, QTYPE_SRV, 600, + UA_Discovery_multicastConflict, server); + mdnsd_set_srv(server->discoveryManager.mdnsDaemon, r, 0, 0, port, localDomain); + + // A/AAAA record for all ip addresses. + // [servername]-[hostname]._opcua-tcp._tcp.local. A [ip]. + // [hostname]. A [ip]. + mdns_set_address_record(server, fullServiceDomain, localDomain); + + // TXT record: [servername]-[hostname]._opcua-tcp._tcp.local. TXT path=/ caps=NA,DA,... + UA_STACKARRAY(char, pathChars, path->length + 1); + if(createTxt) { + if(path->length > 0) + memcpy(pathChars, path->data, path->length); + pathChars[path->length] = 0; + mdns_create_txt(server, fullServiceDomain, pathChars, capabilites, + capabilitiesSize, UA_Discovery_multicastConflict); + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Discovery_removeRecord(UA_Server *server, const UA_String *servername, + const UA_String *hostname, UA_UInt16 port, + UA_Boolean removeTxt) { + // use a limit for the hostname length to make sure full string fits into 63 + // chars (limited by DNS spec) + size_t hostnameLen = hostname->length; + size_t servernameLen = servername->length; + if(hostnameLen == 0 || servernameLen == 0) + return UA_STATUSCODE_BADOUTOFRANGE; + + if(hostnameLen+servernameLen+1 > 63) { // include dash between servername-hostname + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: Combination of hostname+servername exceeds " + "maximum of 62 chars. It will be truncated."); + } + + // [servername]-[hostname]._opcua-tcp._tcp.local. + char fullServiceDomain[63 + 24]; + createFullServiceDomain(fullServiceDomain, 63+24, servername, hostname); + + UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: remove record for domain: %s", fullServiceDomain); + + UA_StatusCode retval = UA_DiscoveryManager_removeEntryFromServersOnNetwork( + server, fullServiceDomain, fullServiceDomain, UA_MIN(63, (servernameLen+hostnameLen)+1)); + if (retval != UA_STATUSCODE_GOOD) + return retval; + + // _opcua-tcp._tcp.local. PTR [servername]-[hostname]._opcua-tcp._tcp.local. + mdns_record_t *r = mdns_find_record(server->discoveryManager.mdnsDaemon, QTYPE_PTR, + "_opcua-tcp._tcp.local.", fullServiceDomain); + if(!r) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: could not remove record. " + "PTR Record not found for domain: %s", fullServiceDomain); + return UA_STATUSCODE_BADNOTHINGTODO; + } + mdnsd_done(server->discoveryManager.mdnsDaemon, r); + + // looks for [servername]-[hostname]._opcua-tcp._tcp.local. 86400 IN SRV 0 5 port hostname.local. + // and TXT record: [servername]-[hostname]._opcua-tcp._tcp.local. TXT path=/ caps=NA,DA,... + // and A record: [servername]-[hostname]._opcua-tcp._tcp.local. A [ip] + mdns_record_t *r2 = mdnsd_get_published(server->discoveryManager.mdnsDaemon, fullServiceDomain); + if(!r2) { + UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast DNS: could not remove record. Record not " + "found for domain: %s", fullServiceDomain); + return UA_STATUSCODE_BADNOTHINGTODO; + } + + while(r2) { + const mdns_answer_t *data = mdnsd_record_data(r2); + mdns_record_t *next = mdnsd_record_next(r2); + if((removeTxt && data->type == QTYPE_TXT) || + (removeTxt && data->type == QTYPE_A) || + data->srv.port == port) { + mdnsd_done(server->discoveryManager.mdnsDaemon, r2); + } + r2 = next; + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +iterateMulticastDiscoveryServer(UA_Server* server, UA_DateTime *nextRepeat, + UA_Boolean processIn) { + struct timeval next_sleep = { 0, 0 }; + unsigned short retval = mdnsd_step(server->discoveryManager.mdnsDaemon, + (int)server->discoveryManager.mdnsSocket, + processIn, true, &next_sleep); + if(retval == 1) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast error: Can not read from socket. %s", errno_str)); + return UA_STATUSCODE_BADNOCOMMUNICATION; + } else if(retval == 2) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_DEBUG(&server->config.logger, UA_LOGCATEGORY_SERVER, + "Multicast error: Can not write to socket. %s", errno_str)); + return UA_STATUSCODE_BADNOCOMMUNICATION; + } + + if(nextRepeat) + *nextRepeat = UA_DateTime_now() + + (UA_DateTime)((next_sleep.tv_sec * UA_DATETIME_SEC) + + (next_sleep.tv_usec * UA_DATETIME_USEC)); + return UA_STATUSCODE_GOOD; +} + +#endif /* defined(UA_ENABLE_DISCOVERY) && defined(UA_ENABLE_DISCOVERY_MULTICAST) */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015 (c) hfaham + * Copyright 2015-2017 (c) Florian Palm + * Copyright 2017-2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2015 (c) Holger Jeromin + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016 (c) TorbenD + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2016 (c) Lykurg + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Kalycito Infotech Private Limited + */ + + + +/********************/ +/* Client Lifecycle */ +/********************/ + +static void +UA_Client_init(UA_Client* client) { + UA_SecureChannel_init(&client->channel, &client->config.localConnectionConfig); + client->connectStatus = UA_STATUSCODE_GOOD; + UA_Timer_init(&client->timer); + notifyClientState(client); +} + +UA_Client UA_EXPORT * +UA_Client_newWithConfig(const UA_ClientConfig *config) { + if(!config) + return NULL; + UA_Client *client = (UA_Client*)UA_malloc(sizeof(UA_Client)); + if(!client) + return NULL; + memset(client, 0, sizeof(UA_Client)); + client->config = *config; + UA_Client_init(client); + return client; +} + +static void +UA_ClientConfig_clear(UA_ClientConfig *config) { + UA_ApplicationDescription_clear(&config->clientDescription); + + UA_ExtensionObject_clear(&config->userIdentityToken); + UA_String_clear(&config->securityPolicyUri); + + UA_EndpointDescription_clear(&config->endpoint); + UA_UserTokenPolicy_clear(&config->userTokenPolicy); + + if(config->certificateVerification.clear) + config->certificateVerification.clear(&config->certificateVerification); + + /* Delete the SecurityPolicies */ + if(config->securityPolicies == 0) + return; + for(size_t i = 0; i < config->securityPoliciesSize; i++) + config->securityPolicies[i].clear(&config->securityPolicies[i]); + UA_free(config->securityPolicies); + config->securityPolicies = 0; + + /* Logger */ + if(config->logger.clear) + config->logger.clear(config->logger.context); + config->logger.log = NULL; + config->logger.clear = NULL; +} + +static void +UA_Client_clear(UA_Client *client) { + /* Delete the async service calls with BADHSUTDOWN */ + UA_Client_AsyncService_removeAll(client, UA_STATUSCODE_BADSHUTDOWN); + + UA_Client_disconnect(client); + UA_String_clear(&client->endpointUrl); + + UA_String_clear(&client->remoteNonce); + UA_String_clear(&client->localNonce); + + /* Delete the subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_Client_Subscriptions_clean(client); +#endif + + /* Delete the timed work */ + UA_Timer_clear(&client->timer); +} + +void +UA_Client_delete(UA_Client* client) { + UA_Client_clear(client); + UA_ClientConfig_clear(&client->config); + UA_free(client); +} + +void +UA_Client_getState(UA_Client *client, UA_SecureChannelState *channelState, + UA_SessionState *sessionState, UA_StatusCode *connectStatus) { + if(channelState) + *channelState = client->channel.state; + if(sessionState) + *sessionState = client->sessionState; + if(connectStatus) + *connectStatus = client->connectStatus; +} + +UA_ClientConfig * +UA_Client_getConfig(UA_Client *client) { + if(!client) + return NULL; + return &client->config; +} + +#if UA_LOGLEVEL <= 300 +static const char *channelStateTexts[9] = { + "Fresh", "HELSent", "HELReceived", "ACKSent", + "AckReceived", "OPNSent", "Open", "Closing", "Closed"}; +static const char *sessionStateTexts[6] = + {"Closed", "CreateRequested", "Created", + "ActivateRequested", "Activated", "Closing"}; +#endif + +void +notifyClientState(UA_Client *client) { + if(client->connectStatus == client->oldConnectStatus && + client->channel.state == client->oldChannelState && + client->sessionState == client->oldSessionState) + return; + +#if UA_LOGLEVEL <= 300 + UA_Boolean info = (client->connectStatus != UA_STATUSCODE_GOOD); + if(client->oldChannelState != client->channel.state) + info |= (client->channel.state == UA_SECURECHANNELSTATE_OPEN || + client->channel.state == UA_SECURECHANNELSTATE_CLOSED); + if(client->oldSessionState != client->sessionState) + info |= (client->sessionState == UA_SESSIONSTATE_CREATED || + client->sessionState == UA_SESSIONSTATE_ACTIVATED || + client->sessionState == UA_SESSIONSTATE_CLOSED); + + const char *channelStateText = channelStateTexts[client->channel.state]; + const char *sessionStateText = sessionStateTexts[client->sessionState]; + const char *connectStatusText = UA_StatusCode_name(client->connectStatus); + + if(info) + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Client Status: ChannelState: %s, SessionState: %s, ConnectStatus: %s", + channelStateText, sessionStateText, connectStatusText); + else + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Client Status: ChannelState: %s, SessionState: %s, ConnectStatus: %s", + channelStateText, sessionStateText, connectStatusText); +#endif + + client->oldConnectStatus = client->connectStatus; + client->oldChannelState = client->channel.state; + client->oldSessionState = client->sessionState; + + if(client->config.stateCallback) + client->config.stateCallback(client, client->channel.state, + client->sessionState, client->connectStatus); +} + +/****************/ +/* Raw Services */ +/****************/ + +/* For synchronous service calls. Execute async responses with a callback. When + * the response with the correct requestId turns up, return it via the + * SyncResponseDescription pointer. */ +typedef struct { + UA_Client *client; + UA_Boolean received; + UA_UInt32 requestId; + void *response; + const UA_DataType *responseType; +} SyncResponseDescription; + +/* For both synchronous and asynchronous service calls */ +static UA_StatusCode +sendSymmetricServiceRequest(UA_Client *client, const void *request, + const UA_DataType *requestType, UA_UInt32 *requestId) { + /* Renew SecureChannel if necessary */ + UA_Client_renewSecureChannel(client); + if(client->connectStatus != UA_STATUSCODE_GOOD) + return client->connectStatus; + + /* Adjusting the request header. The const attribute is violated, but we + * only touch the following members: */ + UA_RequestHeader *rr = (UA_RequestHeader*)(uintptr_t)request; + UA_NodeId oldToken = rr->authenticationToken; /* Put back in place later */ + rr->authenticationToken = client->authenticationToken; + rr->timestamp = UA_DateTime_now(); + rr->requestHandle = ++client->requestHandle; + UA_UInt32 rqId = ++client->requestId; + +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_DEBUG_CHANNEL(&client->config.logger, &client->channel, + "Sending request with RequestId %u of type %s", + (unsigned)rqId, requestType->typeName); +#else + UA_LOG_DEBUG_CHANNEL(&client->config.logger, &client->channel, + "Sending request with RequestId %u of type %" PRIi16, + (unsigned)rqId, requestType->binaryEncodingId.identifier.numeric); +#endif + + /* Send the message */ + UA_StatusCode retval = + UA_SecureChannel_sendSymmetricMessage(&client->channel, rqId, + UA_MESSAGETYPE_MSG, rr, requestType); + rr->authenticationToken = oldToken; /* Set the original token */ + + *requestId = rqId; + return retval; +} + +static const UA_NodeId +serviceFaultId = {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_SERVICEFAULT_ENCODING_DEFAULTBINARY}}; + +/* Look for the async callback in the linked list, execute and delete it */ +static UA_StatusCode +processAsyncResponse(UA_Client *client, UA_UInt32 requestId, const UA_NodeId *responseTypeId, + const UA_ByteString *responseMessage, size_t *offset) { + /* Find the callback */ + AsyncServiceCall *ac; + LIST_FOREACH(ac, &client->asyncServiceCalls, pointers) { + if(ac->requestId == requestId) + break; + } + + /* Part 6, 6.7.6: After the security validation is complete the receiver + * shall verify the RequestId and the SequenceNumber. If these checks fail a + * Bad_SecurityChecksFailed error is reported. The RequestId only needs to + * be verified by the Client since only the Client knows if it is valid or + * not.*/ + if(!ac) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Dequeue ac. We might disconnect (remove all ac) in the callback. */ + LIST_REMOVE(ac, pointers); + + /* Verify the type of the response */ + UA_Response response; + const UA_DataType *responseType = ac->responseType; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(!UA_NodeId_equal(responseTypeId, &ac->responseType->binaryEncodingId)) { + UA_init(&response, ac->responseType); + if(UA_NodeId_equal(responseTypeId, &serviceFaultId)) { + /* Decode as a ServiceFault, i.e. only the response header */ + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received a ServiceFault response"); + responseType = &UA_TYPES[UA_TYPES_SERVICEFAULT]; + } else { + /* Close the connection */ + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Reply contains the wrong service response"); + retval = UA_STATUSCODE_BADCOMMUNICATIONERROR; + goto process; + } + } + + /* Decode the response */ + retval = UA_decodeBinary(responseMessage, offset, &response, responseType, + client->config.customDataTypes); + + process: + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Could not decode the response with id %u due to %s", + requestId, UA_StatusCode_name(retval)); + response.responseHeader.serviceResult = retval; + } else if(response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + /* Decode as a ServiceFault, i.e. only the response header */ + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "The ServiceResult has the StatusCode %s", + UA_StatusCode_name(response.responseHeader.serviceResult)); + } + + /* Call the callback */ + if(ac->callback) + ac->callback(client, ac->userdata, requestId, &response); + UA_clear(&response, ac->responseType); + + /* Remove the callback */ + UA_free(ac); + return retval; +} + +/* Processes the received service response. Either with an async callback or by + * decoding the message and returning it "upwards" in the + * SyncResponseDescription. */ +static UA_StatusCode +processServiceResponse(void *application, UA_SecureChannel *channel, + UA_MessageType messageType, UA_UInt32 requestId, + UA_ByteString *message) { + SyncResponseDescription *rd = (SyncResponseDescription*)application; + + /* Process ACK response */ + switch(messageType) { + case UA_MESSAGETYPE_ACK: + processACKResponse(rd->client, message); + return UA_STATUSCODE_GOOD; + case UA_MESSAGETYPE_OPN: + processOPNResponse(rd->client, message); + return UA_STATUSCODE_GOOD; + case UA_MESSAGETYPE_ERR: + processERRResponse(rd->client, message); + return UA_STATUSCODE_GOOD; + case UA_MESSAGETYPE_MSG: + /* Continue below */ + break; + default: + UA_LOG_TRACE_CHANNEL(&rd->client->config.logger, channel, "Invalid message type"); + channel->state = UA_SECURECHANNELSTATE_CLOSING; + return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID; + } + + /* Decode the data type identifier of the response */ + size_t offset = 0; + UA_NodeId responseId; + UA_StatusCode retval = UA_NodeId_decodeBinary(message, &offset, &responseId); + if(retval != UA_STATUSCODE_GOOD) + goto finish; + + /* Got an asynchronous response. Don't expected a synchronous response + * (responseType NULL) or the id does not match. */ + if(!rd->responseType || requestId != rd->requestId) { + retval = processAsyncResponse(rd->client, requestId, &responseId, message, &offset); + goto finish; + } + + /* Got the synchronous response */ + rd->received = true; + + /* Check that the response type matches */ + if(!UA_NodeId_equal(&responseId, &rd->responseType->binaryEncodingId)) { + if(UA_NodeId_equal(&responseId, &serviceFaultId)) { + UA_init(rd->response, rd->responseType); + retval = UA_decodeBinary(message, &offset, rd->response, + &UA_TYPES[UA_TYPES_SERVICEFAULT], + rd->client->config.customDataTypes); + if(retval != UA_STATUSCODE_GOOD) + ((UA_ResponseHeader*)rd->response)->serviceResult = retval; + UA_LOG_INFO(&rd->client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received a ServiceFault response with StatusCode %s", + UA_StatusCode_name(((UA_ResponseHeader*)rd->response)->serviceResult)); + } else { + /* Close the connection */ + UA_LOG_ERROR(&rd->client->config.logger, UA_LOGCATEGORY_CLIENT, + "Reply contains the wrong service response"); + retval = UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + goto finish; + } + +#ifdef UA_ENABLE_TYPEDESCRIPTION + UA_LOG_DEBUG(&rd->client->config.logger, UA_LOGCATEGORY_CLIENT, + "Decode a message of type %s", rd->responseType->typeName); +#else + UA_LOG_DEBUG(&rd->client->config.logger, UA_LOGCATEGORY_CLIENT, + "Decode a message of type %" PRIu32, responseId.identifier.numeric); +#endif + + /* Decode the response */ + retval = UA_decodeBinary(message, &offset, rd->response, rd->responseType, + rd->client->config.customDataTypes); + +finish: + UA_NodeId_clear(&responseId); + if(retval != UA_STATUSCODE_GOOD) { + if(retval == UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED) + retval = UA_STATUSCODE_BADRESPONSETOOLARGE; + UA_LOG_INFO(&rd->client->config.logger, UA_LOGCATEGORY_CLIENT, + "Error receiving the response with status code %s", + UA_StatusCode_name(retval)); + + if(rd->response) { + UA_ResponseHeader *respHeader = (UA_ResponseHeader*)rd->response; + respHeader->serviceResult = retval; + } + } + + return retval; +} + +/* Receive and process messages until a synchronous message arrives or the + * timout finishes */ +static UA_StatusCode +receiveResponse(UA_Client *client, void *response, const UA_DataType *responseType, + UA_UInt32 timeout, const UA_UInt32 *synchronousRequestId) { + /* Prepare the response and the structure we give into processServiceResponse */ + SyncResponseDescription rd = { client, false, 0, response, responseType }; + + /* Return upon receiving the synchronized response. All other responses are + * processed with a callback "in the background". */ + if(synchronousRequestId) + rd.requestId = *synchronousRequestId; + + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_DateTime maxDate = now + ((UA_DateTime)timeout * UA_DATETIME_MSEC); + UA_StatusCode retval = UA_STATUSCODE_GOOD; + do { + if(maxDate < now) + return UA_STATUSCODE_GOODNONCRITICALTIMEOUT; + UA_UInt32 timeout2 = (UA_UInt32)((maxDate - now) / UA_DATETIME_MSEC); + retval = UA_SecureChannel_receive(&client->channel, &rd, processServiceResponse, timeout2); + if(retval == UA_STATUSCODE_GOODNONCRITICALTIMEOUT) + break; + if(retval != UA_STATUSCODE_GOOD || + client->channel.state == UA_SECURECHANNELSTATE_CLOSING) { + UA_LOG_WARNING_CHANNEL(&client->config.logger, &client->channel, + "Receiving the response failed with StatusCode %s", + UA_StatusCode_name(retval)); + closeSecureChannel(client); + retval = UA_STATUSCODE_BADCONNECTIONCLOSED; + break; + } + now = UA_DateTime_nowMonotonic(); + } while(!rd.received && responseType); /* Return if we don't wait for an async response */ + + return retval; +} + +UA_StatusCode +receiveResponseAsync(UA_Client *client, UA_UInt32 timeout) { + UA_StatusCode res = receiveResponse(client, NULL, NULL, timeout, NULL); + return (res != UA_STATUSCODE_GOODNONCRITICALTIMEOUT) ? res : UA_STATUSCODE_GOOD; +} + +void +__UA_Client_Service(UA_Client *client, const void *request, + const UA_DataType *requestType, void *response, + const UA_DataType *responseType) { + /* Initialize. Response is valied in case of aborting. */ + UA_init(response, responseType); + + if(client->channel.state != UA_SECURECHANNELSTATE_OPEN) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "SecureChannel must be connected before sending requests"); + UA_ResponseHeader *respHeader = (UA_ResponseHeader*)response; + respHeader->serviceResult = UA_STATUSCODE_BADCONNECTIONCLOSED; + return; + } + + /* Send the request */ + UA_UInt32 requestId; + UA_StatusCode retval = sendSymmetricServiceRequest(client, request, requestType, &requestId); + + UA_ResponseHeader *respHeader = (UA_ResponseHeader*)response; + if(retval == UA_STATUSCODE_GOOD) { + /* Retrieve the response */ + retval = receiveResponse(client, response, responseType, client->config.timeout, &requestId); + } else if(retval == UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED) { + respHeader->serviceResult = UA_STATUSCODE_BADREQUESTTOOLARGE; + return; + } + + /* In synchronous service, if we have don't have a reply we need to close + * the connection. For all other error cases, receiveResponse has already + * closed the channel. */ + if(retval == UA_STATUSCODE_GOODNONCRITICALTIMEOUT || + client->channel.state == UA_SECURECHANNELSTATE_CLOSING) { + closeSecureChannel(client); + retval = UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + if(retval != UA_STATUSCODE_GOOD) + respHeader->serviceResult = retval; + + notifyClientState(client); +} + +void +UA_Client_AsyncService_cancel(UA_Client *client, AsyncServiceCall *ac, + UA_StatusCode statusCode) { + /* Create an empty response with the statuscode */ + UA_Response response; + UA_init(&response, ac->responseType); + response.responseHeader.serviceResult = statusCode; + + if(ac->callback) + ac->callback(client, ac->userdata, ac->requestId, &response); + + /* Clean up the response. Users might move data into it. For whatever reasons. */ + UA_clear(&response, ac->responseType); +} + +void UA_Client_AsyncService_removeAll(UA_Client *client, UA_StatusCode statusCode) { + AsyncServiceCall *ac, *ac_tmp; + LIST_FOREACH_SAFE(ac, &client->asyncServiceCalls, pointers, ac_tmp) { + LIST_REMOVE(ac, pointers); + UA_Client_AsyncService_cancel(client, ac, statusCode); + UA_free(ac); + } +} + +UA_StatusCode +__UA_Client_AsyncServiceEx(UA_Client *client, const void *request, + const UA_DataType *requestType, + UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, + void *userdata, UA_UInt32 *requestId, + UA_UInt32 timeout) { + if(client->channel.state != UA_SECURECHANNELSTATE_OPEN) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "SecureChannel must be connected before sending requests"); + return UA_STATUSCODE_BADSERVERNOTCONNECTED; + } + + /* Prepare the entry for the linked list */ + AsyncServiceCall *ac = (AsyncServiceCall*)UA_malloc(sizeof(AsyncServiceCall)); + if(!ac) + return UA_STATUSCODE_BADOUTOFMEMORY; + ac->callback = callback; + ac->responseType = responseType; + ac->userdata = userdata; + ac->timeout = timeout; + + /* Call the service and set the requestId */ + UA_StatusCode retval = sendSymmetricServiceRequest(client, request, requestType, &ac->requestId); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(ac); + closeSecureChannel(client); + notifyClientState(client); + return retval; + } + + ac->start = UA_DateTime_nowMonotonic(); + + /* Store the entry for async processing */ + LIST_INSERT_HEAD(&client->asyncServiceCalls, ac, pointers); + if(requestId) + *requestId = ac->requestId; + + notifyClientState(client); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +__UA_Client_AsyncService(UA_Client *client, const void *request, + const UA_DataType *requestType, + UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_AsyncServiceEx(client, request, requestType, callback, responseType, + userdata, requestId, client->config.timeout); +} + +UA_StatusCode +UA_Client_sendAsyncRequest(UA_Client *client, const void *request, + const UA_DataType *requestType, + UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, void *userdata, + UA_UInt32 *requestId) { + return __UA_Client_AsyncService(client, request, requestType, callback, + responseType, userdata, requestId); +} + +UA_StatusCode UA_EXPORT +UA_Client_addTimedCallback(UA_Client *client, UA_ClientCallback callback, + void *data, UA_DateTime date, UA_UInt64 *callbackId) { + return UA_Timer_addTimedCallback(&client->timer, (UA_ApplicationCallback)callback, + client, data, date, callbackId); +} + +UA_StatusCode +UA_Client_addRepeatedCallback(UA_Client *client, UA_ClientCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId) { + return UA_Timer_addRepeatedCallback(&client->timer, (UA_ApplicationCallback)callback, + client, data, interval_ms, callbackId); +} + +UA_StatusCode +UA_Client_changeRepeatedCallbackInterval(UA_Client *client, UA_UInt64 callbackId, + UA_Double interval_ms) { + return UA_Timer_changeRepeatedCallbackInterval(&client->timer, callbackId, interval_ms); +} + +void +UA_Client_removeCallback(UA_Client *client, UA_UInt64 callbackId) { + UA_Timer_removeCallback(&client->timer, callbackId); +} + +static void +asyncServiceTimeoutCheck(UA_Client *client) { + AsyncServiceCall *ac, *ac_tmp; + UA_DateTime now = UA_DateTime_nowMonotonic(); + LIST_FOREACH_SAFE(ac, &client->asyncServiceCalls, pointers, ac_tmp) { + if(!ac->timeout) + continue; + if(ac->start + (UA_DateTime)(ac->timeout * UA_DATETIME_MSEC) <= now) { + LIST_REMOVE(ac, pointers); + UA_Client_AsyncService_cancel(client, ac, UA_STATUSCODE_BADTIMEOUT); + UA_free(ac); + } + } +} + +static void +backgroundConnectivityCallback(UA_Client *client, void *userdata, + UA_UInt32 requestId, const UA_ReadResponse *response) { + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADTIMEOUT) { + if(client->config.inactivityCallback) + client->config.inactivityCallback(client); + } + client->pendingConnectivityCheck = false; + client->lastConnectivityCheck = UA_DateTime_nowMonotonic(); +} + +static void +UA_Client_backgroundConnectivity(UA_Client *client) { + if(!client->config.connectivityCheckInterval) + return; + + if(client->pendingConnectivityCheck) + return; + + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_DateTime nextDate = client->lastConnectivityCheck + + (UA_DateTime)(client->config.connectivityCheckInterval * UA_DATETIME_MSEC); + if(now <= nextDate) + return; + + /* Prepare the request */ + UA_ReadValueId rvid; + UA_ReadValueId_init(&rvid); + rvid.attributeId = UA_ATTRIBUTEID_VALUE; + rvid.nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS_STATE); + UA_ReadRequest request; + UA_ReadRequest_init(&request); + request.nodesToRead = &rvid; + request.nodesToReadSize = 1; + UA_StatusCode retval = + __UA_Client_AsyncService(client, &request, &UA_TYPES[UA_TYPES_READREQUEST], + (UA_ClientAsyncServiceCallback)backgroundConnectivityCallback, + &UA_TYPES[UA_TYPES_READRESPONSE], NULL, NULL); + if(retval == UA_STATUSCODE_GOOD) + client->pendingConnectivityCheck = true; +} + +static void +clientExecuteRepeatedCallback(void *executionApplication, UA_ApplicationCallback cb, + void *callbackApplication, void *data) { + cb(callbackApplication, data); +} + +UA_StatusCode +UA_Client_run_iterate(UA_Client *client, UA_UInt32 timeout) { + /* Process timed (repeated) jobs */ + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_Timer_process(&client->timer, now, + (UA_TimerExecutionCallback)clientExecuteRepeatedCallback, client); + + /* Make sure we have an open channel */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if((client->noSession && client->channel.state != UA_SECURECHANNELSTATE_OPEN) || + client->sessionState < UA_SESSIONSTATE_ACTIVATED) { + retval = connectIterate(client, timeout); + notifyClientState(client); + return retval; + } + + /* Renew Secure Channel */ + UA_Client_renewSecureChannel(client); + if(client->connectStatus != UA_STATUSCODE_GOOD) + return client->connectStatus; + + /* Feed the server PublishRequests for the Subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + UA_Client_Subscriptions_backgroundPublish(client); +#endif + + /* Send read requests from time to time to test the connectivity */ + UA_Client_backgroundConnectivity(client); + + /* Listen on the network for the given timeout */ + retval = receiveResponse(client, NULL, NULL, timeout, NULL); + if(retval == UA_STATUSCODE_GOODNONCRITICALTIMEOUT) + retval = UA_STATUSCODE_GOOD; + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_CHANNEL(&client->config.logger, &client->channel, + "Could not receive with StatusCode %s", + UA_StatusCode_name(retval)); + } + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* The inactivity check must be done after receiveServiceResponse*/ + UA_Client_Subscriptions_backgroundPublishInactivityCheck(client); +#endif + + /* Did async services time out? Process callbacks with an error code */ + asyncServiceTimeoutCheck(client); + + /* Log and notify user if the client state has changed */ + notifyClientState(client); + + return client->connectStatus; +} + +const UA_DataType * +UA_Client_findDataType(UA_Client *client, const UA_NodeId *typeId) { + return UA_findDataTypeWithCustom(typeId, client->config.customDataTypes); +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client_connect.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017-2019 (c) Fraunhofer IOSB (Author: Mark Giraud) + */ + + + +#define UA_MINMESSAGESIZE 8192 +#define UA_SESSION_LOCALNONCELENGTH 32 +#define MAX_DATA_SIZE 4096 + +static void closeSession(UA_Client *client); +static UA_StatusCode createSessionAsync(UA_Client *client); + +static UA_SecurityPolicy * +getSecurityPolicy(UA_Client *client, UA_String policyUri) { + for(size_t i = 0; i < client->config.securityPoliciesSize; i++) { + if(UA_String_equal(&policyUri, &client->config.securityPolicies[i].policyUri)) + return &client->config.securityPolicies[i]; + } + return NULL; +} + +static UA_Boolean +endpointUnconfigured(UA_Client *client) { + UA_Byte test = 0; + UA_Byte *pos = (UA_Byte*)&client->config.endpoint; + for(size_t i = 0; i < sizeof(UA_EndpointDescription); i++) + test = test | pos[i]; + pos = (UA_Byte*)&client->config.userTokenPolicy; + for(size_t i = 0; i < sizeof(UA_UserTokenPolicy); i++) + test = test | pos[i]; + return (test == 0); +} + +#ifdef UA_ENABLE_ENCRYPTION + +/* Function to create a signature using remote certificate and nonce */ +static UA_StatusCode +signActivateSessionRequest(UA_Client *client, UA_SecureChannel *channel, + UA_ActivateSessionRequest *request) { + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + UA_SignatureData *sd = &request->clientSignature; + + /* Prepare the signature */ + size_t signatureSize = sp->certificateSigningAlgorithm. + getLocalSignatureSize(sp, channel->channelContext); + UA_StatusCode retval = UA_String_copy(&sp->certificateSigningAlgorithm.uri, + &sd->algorithm); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_ByteString_allocBuffer(&sd->signature, signatureSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Allocate a temporary buffer */ + size_t dataToSignSize = channel->remoteCertificate.length + client->remoteNonce.length; + if(dataToSignSize > MAX_DATA_SIZE) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString dataToSign; + retval = UA_ByteString_allocBuffer(&dataToSign, dataToSignSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; /* sd->signature is cleaned up with the response */ + + /* Sign the signature */ + memcpy(dataToSign.data, channel->remoteCertificate.data, + channel->remoteCertificate.length); + memcpy(dataToSign.data + channel->remoteCertificate.length, + client->remoteNonce.data, client->remoteNonce.length); + retval = sp->certificateSigningAlgorithm.sign(sp, channel->channelContext, + &dataToSign, &sd->signature); + + /* Clean up */ + UA_ByteString_clear(&dataToSign); + return retval; +} + +static UA_StatusCode +encryptUserIdentityToken(UA_Client *client, const UA_String *userTokenSecurityPolicy, + UA_ExtensionObject *userIdentityToken) { + UA_IssuedIdentityToken *iit = NULL; + UA_UserNameIdentityToken *unit = NULL; + UA_ByteString *tokenData; + if(userIdentityToken->content.decoded.type == &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]) { + iit = (UA_IssuedIdentityToken*)userIdentityToken->content.decoded.data; + tokenData = &iit->tokenData; + } else if(userIdentityToken->content.decoded.type == &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]) { + unit = (UA_UserNameIdentityToken*)userIdentityToken->content.decoded.data; + tokenData = &unit->password; + } else { + return UA_STATUSCODE_GOOD; + } + + /* No encryption */ + const UA_String none = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#None"); + if(userTokenSecurityPolicy->length == 0 || + UA_String_equal(userTokenSecurityPolicy, &none)) { + return UA_STATUSCODE_GOOD; + } + + UA_SecurityPolicy *sp = getSecurityPolicy(client, *userTokenSecurityPolicy); + if(!sp) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_NETWORK, + "Could not find the required SecurityPolicy for the UserToken"); + return UA_STATUSCODE_BADSECURITYPOLICYREJECTED; + } + + /* Create a temp channel context */ + + void *channelContext; + UA_StatusCode retval = sp->channelModule. + newContext(sp, &client->config.endpoint.serverCertificate, &channelContext); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_NETWORK, + "Could not instantiate the SecurityPolicy for the UserToken"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Compute the encrypted length (at least one byte padding) */ + size_t plainTextBlockSize = sp->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemotePlainTextBlockSize(sp, channelContext); + UA_UInt32 length = (UA_UInt32)(tokenData->length + client->remoteNonce.length); + UA_UInt32 totalLength = length + 4; /* Including the length field */ + size_t blocks = totalLength / plainTextBlockSize; + if(totalLength % plainTextBlockSize != 0) + blocks++; + size_t overHead = + UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(sp, channelContext, + blocks * plainTextBlockSize); + + /* Allocate memory for encryption overhead */ + UA_ByteString encrypted; + retval = UA_ByteString_allocBuffer(&encrypted, (blocks * plainTextBlockSize) + overHead); + if(retval != UA_STATUSCODE_GOOD) { + sp->channelModule.deleteContext(channelContext); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_Byte *pos = encrypted.data; + const UA_Byte *end = &encrypted.data[encrypted.length]; + UA_UInt32_encodeBinary(&length, &pos, end); + memcpy(pos, tokenData->data, tokenData->length); + memcpy(&pos[tokenData->length], client->remoteNonce.data, client->remoteNonce.length); + + /* Add padding + * + * 7.36.2.2 Legacy Encrypted Token Secret Format: A Client should not add any + * padding after the secret. If a Client adds padding then all bytes shall + * be zero. A Server shall check for padding added by Clients and ensure + * that all padding bytes are zeros. */ + size_t paddedLength = plainTextBlockSize * blocks; + for(size_t i = totalLength; i < paddedLength; i++) + encrypted.data[i] = 0; + encrypted.length = paddedLength; + + retval = sp->asymmetricModule.cryptoModule.encryptionAlgorithm. + encrypt(sp, channelContext, &encrypted); + encrypted.length = (blocks * plainTextBlockSize) + overHead; + + if(iit) { + retval |= UA_String_copy(&sp->asymmetricModule.cryptoModule.encryptionAlgorithm.uri, + &iit->encryptionAlgorithm); + } else { + retval |= UA_String_copy(&sp->asymmetricModule.cryptoModule.encryptionAlgorithm.uri, + &unit->encryptionAlgorithm); + } + + UA_ByteString_clear(tokenData); + *tokenData = encrypted; + + /* Delete the temp channel context */ + sp->channelModule.deleteContext(channelContext); + + return retval; +} + +/* Function to verify the signature corresponds to ClientNonce + * using the local certificate */ +static UA_StatusCode +checkCreateSessionSignature(UA_Client *client, const UA_SecureChannel *channel, + const UA_CreateSessionResponse *response) { + if(channel->securityMode != UA_MESSAGESECURITYMODE_SIGN && + channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) + return UA_STATUSCODE_GOOD; + + if(!channel->securityPolicy) + return UA_STATUSCODE_BADINTERNALERROR; + + const UA_SecurityPolicy *sp = channel->securityPolicy; + const UA_ByteString *lc = &sp->localCertificate; + + size_t dataToVerifySize = lc->length + client->localNonce.length; + UA_ByteString dataToVerify = UA_BYTESTRING_NULL; + UA_StatusCode retval = UA_ByteString_allocBuffer(&dataToVerify, dataToVerifySize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + memcpy(dataToVerify.data, lc->data, lc->length); + memcpy(dataToVerify.data + lc->length, + client->localNonce.data, client->localNonce.length); + + retval = sp->certificateSigningAlgorithm.verify(sp, channel->channelContext, &dataToVerify, + &response->serverSignature.signature); + UA_ByteString_clear(&dataToVerify); + return retval; +} + +#endif + +/***********************/ +/* Open the Connection */ +/***********************/ + +void +processERRResponse(UA_Client *client, const UA_ByteString *chunk) { + client->channel.state = UA_SECURECHANNELSTATE_CLOSING; + + size_t offset = 0; + UA_TcpErrorMessage errMessage; + UA_StatusCode res = UA_TcpErrorMessage_decodeBinary(chunk, &offset, &errMessage); + if(res != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR_CHANNEL(&client->config.logger, &client->channel, + "Received an ERR response that could not be decoded with StatusCode %s", + UA_StatusCode_name(res)); + client->connectStatus = res; + return; + } + + UA_LOG_ERROR_CHANNEL(&client->config.logger, &client->channel, + "Received an ERR response with StatusCode %s and the following reason: %.*s", + UA_StatusCode_name(errMessage.error), (int)errMessage.reason.length, errMessage.reason.data); + client->connectStatus = errMessage.error; + UA_TcpErrorMessage_clear(&errMessage); +} + +void +processACKResponse(UA_Client *client, const UA_ByteString *chunk) { + UA_SecureChannel *channel = &client->channel; + if(channel->state != UA_SECURECHANNELSTATE_HEL_SENT) { + UA_LOG_ERROR_CHANNEL(&client->config.logger, channel, + "Expected an ACK response"); + channel->state = UA_SECURECHANNELSTATE_CLOSING; + return; + } + + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_NETWORK, "Received ACK message"); + + /* Decode the message */ + size_t offset = 0; + UA_TcpAcknowledgeMessage ackMessage; + client->connectStatus = UA_TcpAcknowledgeMessage_decodeBinary(chunk, &offset, &ackMessage); + if(client->connectStatus != UA_STATUSCODE_GOOD) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_NETWORK, + "Decoding ACK message failed"); + closeSecureChannel(client); + return; + } + + client->connectStatus = + UA_SecureChannel_processHELACK(channel, &ackMessage); + if(client->connectStatus != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_NETWORK, + "Processing the ACK message failed with StatusCode %s", + UA_StatusCode_name(client->connectStatus)); + closeSecureChannel(client); + return; + } + + client->channel.state = UA_SECURECHANNELSTATE_ACK_RECEIVED; +} + +static UA_StatusCode +sendHELMessage(UA_Client *client) { + /* Get a buffer */ + UA_ByteString message; + UA_Connection *conn = &client->connection; + UA_StatusCode retval = conn->getSendBuffer(conn, UA_MINMESSAGESIZE, &message); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Prepare the HEL message and encode at offset 8 */ + UA_TcpHelloMessage hello; + hello.protocolVersion = 0; + hello.receiveBufferSize = client->config.localConnectionConfig.recvBufferSize; + hello.sendBufferSize = client->config.localConnectionConfig.sendBufferSize; + hello.maxMessageSize = client->config.localConnectionConfig.localMaxMessageSize; + hello.maxChunkCount = client->config.localConnectionConfig.localMaxChunkCount; + hello.endpointUrl = client->endpointUrl; + + UA_Byte *bufPos = &message.data[8]; /* skip the header */ + const UA_Byte *bufEnd = &message.data[message.length]; + client->connectStatus = UA_TcpHelloMessage_encodeBinary(&hello, &bufPos, bufEnd); + + /* Encode the message header at offset 0 */ + UA_TcpMessageHeader messageHeader; + messageHeader.messageTypeAndChunkType = UA_CHUNKTYPE_FINAL + UA_MESSAGETYPE_HEL; + messageHeader.messageSize = (UA_UInt32) ((uintptr_t)bufPos - (uintptr_t)message.data); + bufPos = message.data; + retval = UA_TcpMessageHeader_encodeBinary(&messageHeader, &bufPos, bufEnd); + if(retval != UA_STATUSCODE_GOOD) { + conn->releaseSendBuffer(conn, &message); + return retval; + } + + /* Send the HEL message */ + message.length = messageHeader.messageSize; + retval = conn->send(conn, &message); + if(retval == UA_STATUSCODE_GOOD) { + client->channel.state = UA_SECURECHANNELSTATE_HEL_SENT; + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_NETWORK, "Sent HEL message"); + } else { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_NETWORK, "Sending HEL failed"); + } + return retval; +} + +void +processOPNResponse(UA_Client *client, const UA_ByteString *message) { + /* Is the content of the expected type? */ + size_t offset = 0; + UA_NodeId responseId; + UA_NodeId expectedId = + UA_NODEID_NUMERIC(0, UA_NS0ID_OPENSECURECHANNELRESPONSE_ENCODING_DEFAULTBINARY); + UA_StatusCode retval = UA_NodeId_decodeBinary(message, &offset, &responseId); + if(retval != UA_STATUSCODE_GOOD) { + closeSecureChannel(client); + return; + } + + if(!UA_NodeId_equal(&responseId, &expectedId)) { + UA_NodeId_clear(&responseId); + closeSecureChannel(client); + return; + } + + /* Decode the response */ + UA_OpenSecureChannelResponse response; + retval = UA_OpenSecureChannelResponse_decodeBinary(message, &offset, &response); + if(retval != UA_STATUSCODE_GOOD) { + closeSecureChannel(client); + return; + } + + /* Check whether the nonce was reused */ + if(client->channel.securityMode != UA_MESSAGESECURITYMODE_NONE && + UA_ByteString_equal(&client->channel.remoteNonce, + &response.serverNonce)) { + UA_LOG_ERROR_CHANNEL(&client->config.logger, &client->channel, + "The server reused the last nonce"); + client->connectStatus = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + closeSecureChannel(client); + return; + } + + /* Response.securityToken.revisedLifetime is UInt32 we need to cast it to + * DateTime=Int64 we take 75% of lifetime to start renewing as described in + * standard */ + client->nextChannelRenewal = UA_DateTime_nowMonotonic() + + (UA_DateTime) (response.securityToken.revisedLifetime + * (UA_Double) UA_DATETIME_MSEC * 0.75); + + /* Move the nonce out of the response */ + UA_ByteString_clear(&client->channel.remoteNonce); + client->channel.remoteNonce = response.serverNonce; + UA_ByteString_init(&response.serverNonce); + UA_ResponseHeader_clear(&response.responseHeader); + + /* Replace the token. Keep the current token as the old token. Messages + * might still arrive for the old token. */ + client->channel.altSecurityToken = client->channel.securityToken; + client->channel.securityToken = response.securityToken; + client->channel.renewState = UA_SECURECHANNELRENEWSTATE_NEWTOKEN_CLIENT; + + /* Compute the new local keys. The remote keys are updated when a message + * with the new SecurityToken is received. */ + retval = UA_SecureChannel_generateLocalKeys(&client->channel); + if(retval != UA_STATUSCODE_GOOD) { + closeSecureChannel(client); + return; + } + + UA_Float lifetime = (UA_Float)response.securityToken.revisedLifetime / 1000; + UA_Boolean renew = (client->channel.state == UA_SECURECHANNELSTATE_OPEN); + if(renew) { + UA_LOG_INFO_CHANNEL(&client->config.logger, &client->channel, "SecureChannel " + "renewed with a revised lifetime of %.2fs", lifetime); + } else { + UA_LOG_INFO_CHANNEL(&client->config.logger, &client->channel, + "SecureChannel opened with SecurityPolicy %.*s " + "and a revised lifetime of %.2fs", + (int)client->channel.securityPolicy->policyUri.length, + client->channel.securityPolicy->policyUri.data, lifetime); + } + + client->channel.state = UA_SECURECHANNELSTATE_OPEN; +} + +/* OPN messges to renew the channel are sent asynchronous */ +static UA_StatusCode +sendOPNAsync(UA_Client *client, UA_Boolean renew) { + UA_Connection *conn = &client->connection; + if(conn->state != UA_CONNECTIONSTATE_ESTABLISHED) { + closeSecureChannel(client); + return UA_STATUSCODE_BADNOTCONNECTED; + } + + UA_StatusCode retval = UA_SecureChannel_generateLocalNonce(&client->channel); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Prepare the OpenSecureChannelRequest */ + UA_OpenSecureChannelRequest opnSecRq; + UA_OpenSecureChannelRequest_init(&opnSecRq); + opnSecRq.requestHeader.timestamp = UA_DateTime_now(); + opnSecRq.requestHeader.authenticationToken = client->authenticationToken; + opnSecRq.securityMode = client->channel.securityMode; + opnSecRq.clientNonce = client->channel.localNonce; + opnSecRq.requestedLifetime = client->config.secureChannelLifeTime; + if(renew) { + opnSecRq.requestType = UA_SECURITYTOKENREQUESTTYPE_RENEW; + UA_LOG_DEBUG_CHANNEL(&client->config.logger, &client->channel, + "Requesting to renew the SecureChannel"); + } else { + opnSecRq.requestType = UA_SECURITYTOKENREQUESTTYPE_ISSUE; + UA_LOG_DEBUG_CHANNEL(&client->config.logger, &client->channel, + "Requesting to open a SecureChannel"); + } + + /* Prepare the entry for the linked list */ + UA_UInt32 requestId = ++client->requestId; + + /* Send the OPN message */ + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_SECURECHANNEL, + "Requesting to open a SecureChannel"); + retval = + UA_SecureChannel_sendAsymmetricOPNMessage(&client->channel, requestId, &opnSecRq, + &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); + if(retval != UA_STATUSCODE_GOOD) { + client->connectStatus = retval; + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_SECURECHANNEL, + "Sending OPN message failed with error %s", + UA_StatusCode_name(retval)); + closeSecureChannel(client); + return retval; + } + + client->channel.renewState = UA_SECURECHANNELRENEWSTATE_SENT; + if(client->channel.state < UA_SECURECHANNELSTATE_OPN_SENT) + client->channel.state = UA_SECURECHANNELSTATE_OPN_SENT; + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_SECURECHANNEL, "OPN message sent"); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Client_renewSecureChannel(UA_Client *client) { + /* Check if OPN has been sent or the SecureChannel is still valid */ + if(client->channel.state != UA_SECURECHANNELSTATE_OPEN || + client->channel.renewState == UA_SECURECHANNELRENEWSTATE_SENT || + client->nextChannelRenewal > UA_DateTime_nowMonotonic()) + return UA_STATUSCODE_GOODCALLAGAIN; + sendOPNAsync(client, true); + return client->connectStatus; +} + +static void +responseActivateSession(UA_Client *client, void *userdata, UA_UInt32 requestId, + void *response) { + UA_ActivateSessionResponse *activateResponse = + (UA_ActivateSessionResponse *)response; + if(activateResponse->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "ActivateSession failed with error code %s", + UA_StatusCode_name(activateResponse->responseHeader.serviceResult)); + if(activateResponse->responseHeader.serviceResult == UA_STATUSCODE_BADSESSIONIDINVALID || + activateResponse->responseHeader.serviceResult == UA_STATUSCODE_BADSESSIONCLOSED) { + /* The session is lost. Create a new one. */ + closeSession(client); + createSessionAsync(client); + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Session cannot be activated. Create a new Session."); + } else { + /* Something else is wrong. Give up. */ + client->connectStatus = activateResponse->responseHeader.serviceResult; + } + return; + } + + client->sessionState = UA_SESSIONSTATE_ACTIVATED; + notifyClientState(client); +} + +static UA_StatusCode +activateSessionAsync(UA_Client *client) { + UA_ActivateSessionRequest request; + UA_ActivateSessionRequest_init(&request); + request.requestHeader.requestHandle = ++client->requestHandle; + request.requestHeader.timestamp = UA_DateTime_now (); + request.requestHeader.timeoutHint = 600000; + UA_StatusCode retval = + UA_ExtensionObject_copy(&client->config.userIdentityToken, &request.userIdentityToken); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* If not token is set, use anonymous */ + if(request.userIdentityToken.encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY) { + UA_AnonymousIdentityToken *t = UA_AnonymousIdentityToken_new(); + if(!t) { + UA_ActivateSessionRequest_clear(&request); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + request.userIdentityToken.content.decoded.data = t; + request.userIdentityToken.content.decoded.type = &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]; + request.userIdentityToken.encoding = UA_EXTENSIONOBJECT_DECODED; + } + + /* Set the policy-Id from the endpoint. Every IdentityToken starts with a + * string. */ + retval = UA_String_copy(&client->config.userTokenPolicy.policyId, + (UA_String*)request.userIdentityToken.content.decoded.data); + +#ifdef UA_ENABLE_ENCRYPTION + /* Encrypt the UserIdentityToken */ + const UA_String *userTokenPolicy = &client->channel.securityPolicy->policyUri; + if(client->config.userTokenPolicy.securityPolicyUri.length > 0) + userTokenPolicy = &client->config.userTokenPolicy.securityPolicyUri; + retval |= encryptUserIdentityToken(client, userTokenPolicy, &request.userIdentityToken); + retval |= signActivateSessionRequest(client, &client->channel, &request); +#endif + + if(retval == UA_STATUSCODE_GOOD) + retval = UA_Client_sendAsyncRequest(client, &request, + &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST], + (UA_ClientAsyncServiceCallback) responseActivateSession, + &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE], NULL, NULL); + UA_ActivateSessionRequest_clear(&request); + client->sessionState = UA_SESSIONSTATE_ACTIVATE_REQUESTED; + return retval; +} + +/* Combination of UA_Client_getEndpointsInternal and getEndpoints */ +static void +responseGetEndpoints(UA_Client *client, void *userdata, UA_UInt32 requestId, + void *response) { + client->endpointsHandshake = false; + + UA_GetEndpointsResponse *resp = (UA_GetEndpointsResponse*)response; + /* GetEndpoints not possible. Fail the connection */ + if(resp->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + client->connectStatus = resp->responseHeader.serviceResult; + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "GetEndpointRequest failed with error code %s", + UA_StatusCode_name(client->connectStatus)); + UA_GetEndpointsResponse_clear(resp); + return; + } + + UA_Boolean endpointFound = false; + UA_Boolean tokenFound = false; + const UA_String binaryTransport = UA_STRING("http://opcfoundation.org/UA-Profile/" + "Transport/uatcp-uasc-uabinary"); + + // TODO: compare endpoint information with client->endpointUri + UA_EndpointDescription* endpointArray = resp->endpoints; + size_t endpointArraySize = resp->endpointsSize; + for(size_t i = 0; i < endpointArraySize; ++i) { + UA_EndpointDescription* endpoint = &endpointArray[i]; + /* Look out for binary transport endpoints. + * Note: Siemens returns empty ProfileUrl, we will accept it as binary. */ + if(endpoint->transportProfileUri.length != 0 && + !UA_String_equal (&endpoint->transportProfileUri, &binaryTransport)) + continue; + + /* Valid SecurityMode? */ + if(endpoint->securityMode < 1 || endpoint->securityMode > 3) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting endpoint %lu: invalid security mode", + (long unsigned)i); + continue; + } + + /* Selected SecurityMode? */ + if(client->config.securityMode > 0 && + client->config.securityMode != endpoint->securityMode) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting endpoint %lu: security mode doesn't match", + (long unsigned)i); + continue; + } + + /* Matching SecurityPolicy? */ + if(client->config.securityPolicyUri.length > 0 && + !UA_String_equal(&client->config.securityPolicyUri, + &endpoint->securityPolicyUri)) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting endpoint %lu: security policy doesn't match", + (long unsigned)i); + continue; + } + + /* SecurityPolicy available? */ + if(!getSecurityPolicy(client, endpoint->securityPolicyUri)) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting endpoint %lu: security policy not available", + (long unsigned)i); + continue; + } + + endpointFound = true; + + /* Look for a user token policy with an anonymous token */ + for(size_t j = 0; j < endpoint->userIdentityTokensSize; ++j) { + UA_UserTokenPolicy* tokenPolicy = &endpoint->userIdentityTokens[j]; + const UA_DataType *tokenType = client->config.userIdentityToken.content.decoded.type; + + /* Usertokens also have a security policy... */ + if(tokenPolicy->tokenType != UA_USERTOKENTYPE_ANONYMOUS && + tokenPolicy->securityPolicyUri.length > 0 && + !getSecurityPolicy(client, tokenPolicy->securityPolicyUri)) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu in endpoint %lu: " + "security policy '%.*s' not available", (long unsigned)j, (long unsigned)i, + (int)tokenPolicy->securityPolicyUri.length, + tokenPolicy->securityPolicyUri.data); + continue; + } + + if(tokenPolicy->tokenType > 3) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu in endpoint %lu: invalid token type", + (long unsigned)j, (long unsigned)i); + continue; + } + + if(tokenPolicy->tokenType == UA_USERTOKENTYPE_ANONYMOUS && + tokenType != &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN] && + tokenType != NULL) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu (anonymous) in endpoint %lu: " + "configuration doesn't match", (long unsigned)j, (long unsigned)i); + continue; + } + if(tokenPolicy->tokenType == UA_USERTOKENTYPE_USERNAME && + tokenType != &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu (username) in endpoint %lu: " + "configuration doesn't match", (long unsigned)j, (long unsigned)i); + continue; + } + if(tokenPolicy->tokenType == UA_USERTOKENTYPE_CERTIFICATE && + tokenType != &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu (certificate) in endpoint %lu: " + "configuration doesn't match", (long unsigned)j, (long unsigned)i); + continue; + } + if(tokenPolicy->tokenType == UA_USERTOKENTYPE_ISSUEDTOKEN && + tokenType != &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Rejecting UserTokenPolicy %lu (token) in endpoint %lu: " + "configuration doesn't match", (long unsigned)j, (long unsigned)i); + continue; + } + + /* Endpoint with matching usertokenpolicy found */ + +#if UA_LOGLEVEL <= 300 + const char *securityModeNames[3] = {"None", "Sign", "SignAndEncrypt"}; + const char *userTokenTypeNames[4] = {"Anonymous", "UserName", + "Certificate", "IssuedToken"}; + UA_String *securityPolicyUri = &tokenPolicy->securityPolicyUri; + if(securityPolicyUri->length == 0) + securityPolicyUri = &endpoint->securityPolicyUri; + + /* Log the selected endpoint */ + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Selected Endpoint %.*s with SecurityMode %s and SecurityPolicy %.*s", + (int)endpoint->endpointUrl.length, endpoint->endpointUrl.data, + securityModeNames[endpoint->securityMode - 1], + (int)endpoint->securityPolicyUri.length, + endpoint->securityPolicyUri.data); + + /* Log the selected UserTokenPolicy */ + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Selected UserTokenPolicy %.*s with UserTokenType %s and SecurityPolicy %.*s", + (int)tokenPolicy->policyId.length, tokenPolicy->policyId.data, + userTokenTypeNames[tokenPolicy->tokenType], + (int)securityPolicyUri->length, securityPolicyUri->data); +#endif + + /* Move to the client config */ + tokenFound = true; + UA_EndpointDescription_clear(&client->config.endpoint); + client->config.endpoint = *endpoint; + UA_EndpointDescription_init(endpoint); + UA_UserTokenPolicy_clear(&client->config.userTokenPolicy); + client->config.userTokenPolicy = *tokenPolicy; + UA_UserTokenPolicy_init(tokenPolicy); + + break; + } + + if(tokenFound) + break; + } + + if(!endpointFound) { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "No suitable endpoint found"); + client->connectStatus = UA_STATUSCODE_BADINTERNALERROR; + } else if(!tokenFound) { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "No suitable UserTokenPolicy found for the possible endpoints"); + client->connectStatus = UA_STATUSCODE_BADINTERNALERROR; + } + + /* Close the SecureChannel if a different SecurityPolicy is defined by the Endpoint */ + if(client->config.endpoint.securityMode != client->channel.securityMode || + !UA_String_equal(&client->config.endpoint.securityPolicyUri, + &client->channel.securityPolicy->policyUri)) + closeSecureChannel(client); +} + +static UA_StatusCode +requestGetEndpoints(UA_Client *client) { + UA_GetEndpointsRequest request; + UA_GetEndpointsRequest_init(&request); + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + request.endpointUrl = client->endpointUrl; + client->connectStatus = + UA_Client_sendAsyncRequest(client, &request, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST], + (UA_ClientAsyncServiceCallback) responseGetEndpoints, + &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE], NULL, NULL); + if(client->connectStatus == UA_STATUSCODE_GOOD) + client->endpointsHandshake = true; + return client->connectStatus; +} + +static void +responseSessionCallback(UA_Client *client, void *userdata, + UA_UInt32 requestId, void *response) { + UA_CreateSessionResponse *sessionResponse = (UA_CreateSessionResponse*)response; + UA_StatusCode res = sessionResponse->responseHeader.serviceResult; + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + +#ifdef UA_ENABLE_ENCRYPTION + if(client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGN || + client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + /* Verify the session response was created with the same certificate as + * the SecureChannel */ + if(!UA_ByteString_equal(&sessionResponse->serverCertificate, + &client->channel.remoteCertificate)) { + res = UA_STATUSCODE_BADCERTIFICATEINVALID; + goto cleanup; + } + + /* Verify the client signature */ + res = checkCreateSessionSignature(client, &client->channel, sessionResponse); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + } +#endif + + /* Copy nonce and AuthenticationToken */ + UA_ByteString_clear(&client->remoteNonce); + UA_NodeId_clear(&client->authenticationToken); + res |= UA_ByteString_copy(&sessionResponse->serverNonce, &client->remoteNonce); + res |= UA_NodeId_copy(&sessionResponse->authenticationToken, &client->authenticationToken); + if(res != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Activate the new Session */ + client->sessionState = UA_SESSIONSTATE_CREATED; + + cleanup: + client->connectStatus = res; + if(client->connectStatus != UA_STATUSCODE_GOOD) + client->sessionState = UA_SESSIONSTATE_CLOSED; +} + +static UA_StatusCode +createSessionAsync(UA_Client *client) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGN || + client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + if(client->localNonce.length != UA_SESSION_LOCALNONCELENGTH) { + UA_ByteString_clear(&client->localNonce); + retval = UA_ByteString_allocBuffer(&client->localNonce, + UA_SESSION_LOCALNONCELENGTH); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + retval = client->channel.securityPolicy->symmetricModule. + generateNonce(client->channel.securityPolicy, &client->localNonce); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + UA_CreateSessionRequest request; + UA_CreateSessionRequest_init(&request); + request.requestHeader.requestHandle = ++client->requestHandle; + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + UA_ByteString_copy(&client->localNonce, &request.clientNonce); + request.requestedSessionTimeout = client->config.requestedSessionTimeout; + request.maxResponseMessageSize = UA_INT32_MAX; + UA_String_copy(&client->config.endpoint.endpointUrl, &request.endpointUrl); + UA_ApplicationDescription_copy(&client->config.clientDescription, + &request.clientDescription); + + if(client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGN || + client->channel.securityMode == UA_MESSAGESECURITYMODE_SIGNANDENCRYPT) { + UA_ByteString_copy(&client->channel.securityPolicy->localCertificate, + &request.clientCertificate); + } + + retval = UA_Client_sendAsyncRequest(client, &request, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST], + (UA_ClientAsyncServiceCallback)responseSessionCallback, + &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE], NULL, NULL); + UA_CreateSessionRequest_clear(&request); + + if(retval == UA_STATUSCODE_GOOD) + client->sessionState = UA_SESSIONSTATE_CREATE_REQUESTED; + + client->connectStatus = retval; + return client->connectStatus; +} + +static UA_StatusCode +initConnect(UA_Client *client); + +UA_StatusCode +connectIterate(UA_Client *client, UA_UInt32 timeout) { + UA_LOG_TRACE(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Client connect iterate"); + + /* Already connected */ + if(client->sessionState == UA_SESSIONSTATE_ACTIVATED) + return UA_STATUSCODE_GOOD; + + /* Could not connect */ + if(client->connectStatus != UA_STATUSCODE_GOOD) + return client->connectStatus; + + /* The connection was already closed */ + if(client->channel.state == UA_SECURECHANNELSTATE_CLOSING) { + client->connectStatus = UA_STATUSCODE_BADCONNECTIONCLOSED; + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + /* The connection is closed. Reset the SecureChannel and open a new TCP + * connection */ + if(client->connection.state == UA_CONNECTIONSTATE_CLOSED) + return initConnect(client); + + /* Poll the connection status */ + if(client->connection.state == UA_CONNECTIONSTATE_OPENING) { + client->connectStatus = + client->config.pollConnectionFunc(&client->connection, timeout, + &client->config.logger); + return client->connectStatus; + } + + /* Attach the connection to the SecureChannel */ + if(!client->channel.connection) + UA_Connection_attachSecureChannel(&client->connection, &client->channel); + + /* Set the SecurityPolicy */ + if(!client->channel.securityPolicy) { + client->channel.securityMode = client->config.endpoint.securityMode; + if(client->channel.securityMode == UA_MESSAGESECURITYMODE_INVALID) + client->channel.securityMode = UA_MESSAGESECURITYMODE_NONE; + + UA_SecurityPolicy *sp = NULL; + if(client->config.endpoint.securityPolicyUri.length == 0) { + sp = getSecurityPolicy(client, + UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#None")); + } else { + sp = getSecurityPolicy(client, client->config.endpoint.securityPolicyUri); + } + if(!sp) { + client->connectStatus = UA_STATUSCODE_BADINTERNALERROR; + return client->connectStatus; + } + + client->connectStatus = + UA_SecureChannel_setSecurityPolicy(&client->channel, sp, + &client->config.endpoint.serverCertificate); + if(client->connectStatus != UA_STATUSCODE_GOOD) + return client->connectStatus; + } + + /* Open the SecureChannel */ + switch(client->channel.state) { + case UA_SECURECHANNELSTATE_FRESH: + client->connectStatus = sendHELMessage(client); + if(client->connectStatus == UA_STATUSCODE_GOOD) { + client->channel.state = UA_SECURECHANNELSTATE_HEL_SENT; + } else { + client->connection.close(&client->connection); + client->connection.free(&client->connection); + } + return client->connectStatus; + case UA_SECURECHANNELSTATE_ACK_RECEIVED: + client->connectStatus = sendOPNAsync(client, false); + return client->connectStatus; + case UA_SECURECHANNELSTATE_HEL_SENT: + case UA_SECURECHANNELSTATE_OPN_SENT: + client->connectStatus = receiveResponseAsync(client, timeout); + return client->connectStatus; + default: + break; + } + + /* Have a SecureChannel but no session */ + if(client->noSession) + return client->connectStatus; + + /* Create and Activate the Session */ + switch(client->sessionState) { + case UA_SESSIONSTATE_CLOSED: + if(!endpointUnconfigured(client)) { + createSessionAsync(client); + return client->connectStatus; + } + if(!client->endpointsHandshake) { + requestGetEndpoints(client); + return client->connectStatus; + } + receiveResponseAsync(client, timeout); + return client->connectStatus; + case UA_SESSIONSTATE_CREATE_REQUESTED: + case UA_SESSIONSTATE_ACTIVATE_REQUESTED: + receiveResponseAsync(client, timeout); + return client->connectStatus; + case UA_SESSIONSTATE_CREATED: + activateSessionAsync(client); + return client->connectStatus; + default: + break; + } + + return client->connectStatus; +} + +/* The local ApplicationURI has to match the certificates of the + * SecurityPolicies */ +static void +verifyClientApplicationURI(const UA_Client *client) { +#if defined(UA_ENABLE_ENCRYPTION) && (UA_LOGLEVEL <= 400) + for(size_t i = 0; i < client->config.securityPoliciesSize; i++) { + UA_SecurityPolicy *sp = &client->config.securityPolicies[i]; + UA_StatusCode retval = + client->config.certificateVerification. + verifyApplicationURI(client->config.certificateVerification.context, + &sp->localCertificate, + &client->config.clientDescription.applicationUri); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "The configured ApplicationURI does not match the URI " + "specified in the certificate for the SecurityPolicy %.*s", + (int)sp->policyUri.length, sp->policyUri.data); + } + } +#endif +} + +static UA_StatusCode +client_configure_securechannel(void *application, UA_SecureChannel *channel, + const UA_AsymmetricAlgorithmSecurityHeader *asymHeader) { + // TODO: Verify if certificate is the same as configured in the client endpoint config + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +initConnect(UA_Client *client) { + if(client->connection.state > UA_CONNECTIONSTATE_CLOSED) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Client already connected"); + return UA_STATUSCODE_GOOD; + } + + if(client->config.initConnectionFunc == NULL) { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Client connection not configured"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Consistency check the client's own ApplicationURI */ + verifyClientApplicationURI(client); + + /* Reset the connect status */ + client->connectStatus = UA_STATUSCODE_GOOD; + client->channel.renewState = UA_SECURECHANNELRENEWSTATE_NORMAL; + client->endpointsHandshake = false; + + /* Initialize the SecureChannel */ + UA_SecureChannel_init(&client->channel, &client->config.localConnectionConfig); + client->channel.certificateVerification = &client->config.certificateVerification; + client->channel.processOPNHeader = client_configure_securechannel; + + if(client->connection.free) + client->connection.free(&client->connection); + + /* Initialize the TCP connection */ + client->connection = + client->config.initConnectionFunc(client->config.localConnectionConfig, + client->endpointUrl, client->config.timeout, + &client->config.logger); + if(client->connection.state != UA_CONNECTIONSTATE_OPENING) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Could not open a TCP connection to %.*s", + (int)client->endpointUrl.length, client->endpointUrl.data); + client->connectStatus = UA_STATUSCODE_BADCONNECTIONCLOSED; + closeSecureChannel(client); + } + + return client->connectStatus; +} + +UA_StatusCode +UA_Client_connectAsync(UA_Client *client, const char *endpointUrl) { + /* Set the endpoint URL the client connects to */ + UA_String_clear(&client->endpointUrl); + client->endpointUrl = UA_STRING_ALLOC(endpointUrl); + + /* Open a Session when possible */ + client->noSession = false; + + /* Connect Async */ + return initConnect(client); +} + +UA_StatusCode +UA_Client_connectSecureChannelAsync(UA_Client *client, const char *endpointUrl) { + /* Set the endpoint URL the client connects to */ + UA_String_clear(&client->endpointUrl); + client->endpointUrl = UA_STRING_ALLOC(endpointUrl); + + /* Don't open a Session */ + client->noSession = true; + + /* Connect Async */ + return initConnect(client); +} + +static UA_StatusCode +connectSync(UA_Client *client) { + UA_DateTime now = UA_DateTime_nowMonotonic(); + UA_DateTime maxDate = now + ((UA_DateTime)client->config.timeout * UA_DATETIME_MSEC); + + UA_StatusCode retval = initConnect(client); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + while(retval == UA_STATUSCODE_GOOD) { + if(client->sessionState == UA_SESSIONSTATE_ACTIVATED) + break; + if(client->noSession && client->channel.state == UA_SECURECHANNELSTATE_OPEN) + break; + now = UA_DateTime_nowMonotonic(); + if(maxDate < now) + return UA_STATUSCODE_BADTIMEOUT; + retval = UA_Client_run_iterate(client, + (UA_UInt32)((maxDate - now) / UA_DATETIME_MSEC)); + } + + return retval; +} + +UA_StatusCode +UA_Client_connect(UA_Client *client, const char *endpointUrl) { + /* Set the endpoint URL the client connects to */ + UA_String_clear(&client->endpointUrl); + client->endpointUrl = UA_STRING_ALLOC(endpointUrl); + + /* Open a Session when possible */ + client->noSession = false; + + /* Connect Synchronous */ + return connectSync(client); +} + +UA_StatusCode +UA_Client_connectSecureChannel(UA_Client *client, const char *endpointUrl) { + /* Set the endpoint URL the client connects to */ + UA_String_clear(&client->endpointUrl); + client->endpointUrl = UA_STRING_ALLOC(endpointUrl); + + /* Don't open a Session */ + client->noSession = true; + + /* Connect Synchronous */ + return connectSync(client); +} + +/************************/ +/* Close the Connection */ +/************************/ + +void +closeSecureChannel(UA_Client *client) { + /* Send CLO if the SecureChannel is open */ + if(client->channel.state == UA_SECURECHANNELSTATE_OPEN) { + UA_CloseSecureChannelRequest request; + UA_CloseSecureChannelRequest_init(&request); + request.requestHeader.requestHandle = ++client->requestHandle; + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + request.requestHeader.authenticationToken = client->authenticationToken; + UA_SecureChannel_sendSymmetricMessage(&client->channel, ++client->requestId, + UA_MESSAGETYPE_CLO, &request, + &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); + } + + /* Clean up */ + client->channel.renewState = UA_SECURECHANNELRENEWSTATE_NORMAL; + UA_SecureChannel_close(&client->channel); + if(client->connection.free) + client->connection.free(&client->connection); + + /* Set the Session to "Created" if it was "Activated" */ + if(client->sessionState > UA_SESSIONSTATE_CREATED) + client->sessionState = UA_SESSIONSTATE_CREATED; +} + +static void +sendCloseSession(UA_Client *client) { + /* Set before sending the message to prevent recursion */ + client->sessionState = UA_SESSIONSTATE_CLOSING; + + UA_CloseSessionRequest request; + UA_CloseSessionRequest_init(&request); + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + request.deleteSubscriptions = true; + UA_CloseSessionResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST], + &response, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); + UA_CloseSessionRequest_clear(&request); + UA_CloseSessionResponse_clear(&response); +} + +static void +closeSession(UA_Client *client) { + /* Is a session established? */ + if(client->sessionState == UA_SESSIONSTATE_ACTIVATED) + sendCloseSession(client); + + UA_NodeId_clear(&client->authenticationToken); + client->requestHandle = 0; + client->sessionState = UA_SESSIONSTATE_CLOSED; + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* We need to clean up the subscriptions */ + UA_Client_Subscriptions_clean(client); +#endif + + /* Reset so the next async connect creates a session by default */ + client->noSession = false; + + /* Delete outstanding async services */ + UA_Client_AsyncService_removeAll(client, UA_STATUSCODE_BADSESSIONCLOSED); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + client->currentlyOutStandingPublishRequests = 0; +#endif +} + +static void +closeSessionCallback(UA_Client *client, void *userdata, + UA_UInt32 requestId, void *response) { + closeSession(client); + closeSecureChannel(client); + notifyClientState(client); +} + +UA_StatusCode UA_EXPORT +UA_Client_disconnectAsync(UA_Client *client) { + /* Set before sending the message to prevent recursion */ + client->sessionState = UA_SESSIONSTATE_CLOSING; + + UA_CloseSessionRequest request; + UA_CloseSessionRequest_init(&request); + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + request.deleteSubscriptions = true; + UA_StatusCode res = + UA_Client_sendAsyncRequest(client, &request, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST], + (UA_ClientAsyncServiceCallback)closeSessionCallback, + &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE], NULL, NULL); + notifyClientState(client); + return res; +} + +UA_StatusCode +UA_Client_disconnectSecureChannel(UA_Client *client) { + closeSecureChannel(client); + notifyClientState(client); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Client_disconnect(UA_Client *client) { + closeSession(client); + closeSecureChannel(client); + notifyClientState(client); + return UA_STATUSCODE_GOOD; +} + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client_discovery.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +/* Gets a list of endpoints. Memory is allocated for endpointDescription array */ +static UA_StatusCode +UA_Client_getEndpointsInternal(UA_Client *client, const UA_String endpointUrl, + size_t *endpointDescriptionsSize, + UA_EndpointDescription **endpointDescriptions) { + UA_GetEndpointsRequest request; + UA_GetEndpointsRequest_init(&request); + request.requestHeader.timestamp = UA_DateTime_now(); + request.requestHeader.timeoutHint = 10000; + // assume the endpointurl outlives the service call + request.endpointUrl = endpointUrl; + + UA_GetEndpointsResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST], + &response, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); + + if(response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_StatusCode retval = response.responseHeader.serviceResult; + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "GetEndpointRequest failed with error code %s", + UA_StatusCode_name(retval)); + UA_GetEndpointsResponse_clear(&response); + return retval; + } + *endpointDescriptions = response.endpoints; + *endpointDescriptionsSize = response.endpointsSize; + response.endpoints = NULL; + response.endpointsSize = 0; + UA_GetEndpointsResponse_clear(&response); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Client_getEndpoints(UA_Client *client, const char *serverUrl, + size_t* endpointDescriptionsSize, + UA_EndpointDescription** endpointDescriptions) { + UA_Boolean connected = (client->channel.state == UA_SECURECHANNELSTATE_OPEN); + /* Client is already connected to a different server */ + if(connected && strncmp((const char*)client->config.endpoint.endpointUrl.data, serverUrl, + client->config.endpoint.endpointUrl.length) != 0) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval; + const UA_String url = UA_STRING((char*)(uintptr_t)serverUrl); + if(!connected) { + retval = UA_Client_connectSecureChannel(client, serverUrl); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + retval = UA_Client_getEndpointsInternal(client, url, endpointDescriptionsSize, + endpointDescriptions); + + if(!connected) + UA_Client_disconnect(client); + return retval; +} + +UA_StatusCode +UA_Client_findServers(UA_Client *client, const char *serverUrl, + size_t serverUrisSize, UA_String *serverUris, + size_t localeIdsSize, UA_String *localeIds, + size_t *registeredServersSize, + UA_ApplicationDescription **registeredServers) { + UA_Boolean connected = (client->channel.state == UA_SECURECHANNELSTATE_OPEN); + /* Client is already connected to a different server */ + if(connected && strncmp((const char*)client->config.endpoint.endpointUrl.data, serverUrl, + client->config.endpoint.endpointUrl.length) != 0) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval; + if(!connected) { + retval = UA_Client_connectSecureChannel(client, serverUrl); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* Prepare the request */ + UA_FindServersRequest request; + UA_FindServersRequest_init(&request); + request.serverUrisSize = serverUrisSize; + request.serverUris = serverUris; + request.localeIdsSize = localeIdsSize; + request.localeIds = localeIds; + + /* Send the request */ + UA_FindServersResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST], + &response, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); + + /* Process the response */ + retval = response.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + *registeredServersSize = response.serversSize; + *registeredServers = response.servers; + response.serversSize = 0; + response.servers = NULL; + } else { + *registeredServersSize = 0; + *registeredServers = NULL; + } + + /* Clean up */ + UA_FindServersResponse_clear(&response); + if(!connected) + UA_Client_disconnect(client); + return retval; +} + +#ifdef UA_ENABLE_DISCOVERY + +UA_StatusCode +UA_Client_findServersOnNetwork(UA_Client *client, const char *serverUrl, + UA_UInt32 startingRecordId, UA_UInt32 maxRecordsToReturn, + size_t serverCapabilityFilterSize, UA_String *serverCapabilityFilter, + size_t *serverOnNetworkSize, UA_ServerOnNetwork **serverOnNetwork) { + UA_Boolean connected = (client->channel.state == UA_SECURECHANNELSTATE_OPEN); + /* Client is already connected to a different server */ + if(connected && strncmp((const char*)client->config.endpoint.endpointUrl.data, serverUrl, + client->config.endpoint.endpointUrl.length) != 0) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval; + if(!connected) { + retval = UA_Client_connectSecureChannel(client, serverUrl); + if(retval != UA_STATUSCODE_GOOD) + return retval; + } + + /* Prepare the request */ + UA_FindServersOnNetworkRequest request; + UA_FindServersOnNetworkRequest_init(&request); + request.startingRecordId = startingRecordId; + request.maxRecordsToReturn = maxRecordsToReturn; + request.serverCapabilityFilterSize = serverCapabilityFilterSize; + request.serverCapabilityFilter = serverCapabilityFilter; + + /* Send the request */ + UA_FindServersOnNetworkResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_FINDSERVERSONNETWORKREQUEST], + &response, &UA_TYPES[UA_TYPES_FINDSERVERSONNETWORKRESPONSE]); + + /* Process the response */ + retval = response.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + *serverOnNetworkSize = response.serversSize; + *serverOnNetwork = response.servers; + response.serversSize = 0; + response.servers = NULL; + } else { + *serverOnNetworkSize = 0; + *serverOnNetwork = NULL; + } + + /* Clean up */ + UA_FindServersOnNetworkResponse_clear(&response); + if(!connected) + UA_Client_disconnect(client); + return retval; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client_highlevel.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Florian Palm + * Copyright 2016 (c) Chris Iatrou + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Fabian Arndt + * Copyright 2018 (c) Peter Rustler, basyskom GmbH + */ + + + +UA_StatusCode +UA_Client_NamespaceGetIndex(UA_Client *client, UA_String *namespaceUri, + UA_UInt16 *namespaceIndex) { + UA_ReadRequest request; + UA_ReadRequest_init(&request); + UA_ReadValueId id; + UA_ReadValueId_init(&id); + id.attributeId = UA_ATTRIBUTEID_VALUE; + id.nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_NAMESPACEARRAY); + request.nodesToRead = &id; + request.nodesToReadSize = 1; + + UA_ReadResponse response = UA_Client_Service_read(client, request); + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) + retval = response.responseHeader.serviceResult; + else if(response.resultsSize != 1 || !response.results[0].hasValue) + retval = UA_STATUSCODE_BADNODEATTRIBUTESINVALID; + else if(response.results[0].value.type != &UA_TYPES[UA_TYPES_STRING]) + retval = UA_STATUSCODE_BADTYPEMISMATCH; + + if(retval != UA_STATUSCODE_GOOD) { + UA_ReadResponse_clear(&response); + return retval; + } + + retval = UA_STATUSCODE_BADNOTFOUND; + UA_String *ns = (UA_String *)response.results[0].value.data; + for(size_t i = 0; i < response.results[0].value.arrayLength; ++i) { + if(UA_String_equal(namespaceUri, &ns[i])) { + *namespaceIndex = (UA_UInt16)i; + retval = UA_STATUSCODE_GOOD; + break; + } + } + + UA_ReadResponse_clear(&response); + return retval; +} + +UA_StatusCode +UA_Client_forEachChildNodeCall(UA_Client *client, UA_NodeId parentNodeId, + UA_NodeIteratorCallback callback, void *handle) { + UA_BrowseRequest bReq; + UA_BrowseRequest_init(&bReq); + bReq.requestedMaxReferencesPerNode = 0; + bReq.nodesToBrowse = UA_BrowseDescription_new(); + bReq.nodesToBrowseSize = 1; + UA_NodeId_copy(&parentNodeId, &bReq.nodesToBrowse[0].nodeId); + bReq.nodesToBrowse[0].resultMask = UA_BROWSERESULTMASK_ALL; //return everything + bReq.nodesToBrowse[0].browseDirection = UA_BROWSEDIRECTION_BOTH; + + UA_BrowseResponse bResp = UA_Client_Service_browse(client, bReq); + + UA_StatusCode retval = bResp.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + for(size_t i = 0; i < bResp.resultsSize; ++i) { + for(size_t j = 0; j < bResp.results[i].referencesSize; ++j) { + UA_ReferenceDescription *ref = &bResp.results[i].references[j]; + retval |= callback(ref->nodeId.nodeId, !ref->isForward, + ref->referenceTypeId, handle); + } + } + } + + UA_BrowseRequest_clear(&bReq); + UA_BrowseResponse_clear(&bResp); + return retval; +} + +/*******************/ +/* Node Management */ +/*******************/ + +UA_StatusCode +UA_Client_addReference(UA_Client *client, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_String targetServerUri, + const UA_ExpandedNodeId targetNodeId, + UA_NodeClass targetNodeClass) { + UA_AddReferencesItem item; + UA_AddReferencesItem_init(&item); + item.sourceNodeId = sourceNodeId; + item.referenceTypeId = referenceTypeId; + item.isForward = isForward; + item.targetServerUri = targetServerUri; + item.targetNodeId = targetNodeId; + item.targetNodeClass = targetNodeClass; + UA_AddReferencesRequest request; + UA_AddReferencesRequest_init(&request); + request.referencesToAdd = &item; + request.referencesToAddSize = 1; + UA_AddReferencesResponse response = UA_Client_Service_addReferences(client, request); + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_AddReferencesResponse_clear(&response); + return retval; + } + if(response.resultsSize != 1) { + UA_AddReferencesResponse_clear(&response); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + retval = response.results[0]; + UA_AddReferencesResponse_clear(&response); + return retval; +} + +UA_StatusCode +UA_Client_deleteReference(UA_Client *client, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_ExpandedNodeId targetNodeId, + UA_Boolean deleteBidirectional) { + UA_DeleteReferencesItem item; + UA_DeleteReferencesItem_init(&item); + item.sourceNodeId = sourceNodeId; + item.referenceTypeId = referenceTypeId; + item.isForward = isForward; + item.targetNodeId = targetNodeId; + item.deleteBidirectional = deleteBidirectional; + UA_DeleteReferencesRequest request; + UA_DeleteReferencesRequest_init(&request); + request.referencesToDelete = &item; + request.referencesToDeleteSize = 1; + UA_DeleteReferencesResponse response = UA_Client_Service_deleteReferences(client, request); + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_DeleteReferencesResponse_clear(&response); + return retval; + } + if(response.resultsSize != 1) { + UA_DeleteReferencesResponse_clear(&response); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + retval = response.results[0]; + UA_DeleteReferencesResponse_clear(&response); + return retval; +} + +UA_StatusCode +UA_Client_deleteNode(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean deleteTargetReferences) { + UA_DeleteNodesItem item; + UA_DeleteNodesItem_init(&item); + item.nodeId = nodeId; + item.deleteTargetReferences = deleteTargetReferences; + UA_DeleteNodesRequest request; + UA_DeleteNodesRequest_init(&request); + request.nodesToDelete = &item; + request.nodesToDeleteSize = 1; + UA_DeleteNodesResponse response = UA_Client_Service_deleteNodes(client, request); + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_DeleteNodesResponse_clear(&response); + return retval; + } + if(response.resultsSize != 1) { + UA_DeleteNodesResponse_clear(&response); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + retval = response.results[0]; + UA_DeleteNodesResponse_clear(&response); + return retval; +} + +UA_StatusCode +__UA_Client_addNode(UA_Client *client, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, const UA_NodeAttributes *attr, + const UA_DataType *attributeType, UA_NodeId *outNewNodeId) { + UA_AddNodesRequest request; + UA_AddNodesRequest_init(&request); + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.parentNodeId.nodeId = parentNodeId; + item.referenceTypeId = referenceTypeId; + item.requestedNewNodeId.nodeId = requestedNewNodeId; + item.browseName = browseName; + item.nodeClass = nodeClass; + item.typeDefinition.nodeId = typeDefinition; + item.nodeAttributes.encoding = UA_EXTENSIONOBJECT_DECODED_NODELETE; + item.nodeAttributes.content.decoded.type = attributeType; + item.nodeAttributes.content.decoded.data = (void*)(uintptr_t)attr; // hack. is not written into. + request.nodesToAdd = &item; + request.nodesToAddSize = 1; + UA_AddNodesResponse response = UA_Client_Service_addNodes(client, request); + + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_AddNodesResponse_clear(&response); + return retval; + } + + if(response.resultsSize != 1) { + UA_AddNodesResponse_clear(&response); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + + /* Move the id of the created node */ + retval = response.results[0].statusCode; + if(retval == UA_STATUSCODE_GOOD && outNewNodeId) { + *outNewNodeId = response.results[0].addedNodeId; + UA_NodeId_init(&response.results[0].addedNodeId); + } + + UA_AddNodesResponse_clear(&response); + return retval; +} + +/********/ +/* Call */ +/********/ + +#ifdef UA_ENABLE_METHODCALLS + +UA_StatusCode +UA_Client_call(UA_Client *client, const UA_NodeId objectId, + const UA_NodeId methodId, size_t inputSize, + const UA_Variant *input, size_t *outputSize, + UA_Variant **output) { + /* Set up the request */ + UA_CallRequest request; + UA_CallRequest_init(&request); + UA_CallMethodRequest item; + UA_CallMethodRequest_init(&item); + item.methodId = methodId; + item.objectId = objectId; + item.inputArguments = (UA_Variant *)(void*)(uintptr_t)input; // cast const... + item.inputArgumentsSize = inputSize; + request.methodsToCall = &item; + request.methodsToCallSize = 1; + + /* Call the service */ + UA_CallResponse response = UA_Client_Service_call(client, request); + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + if(response.resultsSize == 1) + retval = response.results[0].statusCode; + else + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + if(retval != UA_STATUSCODE_GOOD) { + UA_CallResponse_clear(&response); + return retval; + } + + /* Move the output arguments */ + if(output != NULL && outputSize != NULL) { + *output = response.results[0].outputArguments; + *outputSize = response.results[0].outputArgumentsSize; + response.results[0].outputArguments = NULL; + response.results[0].outputArgumentsSize = 0; + } + UA_CallResponse_clear(&response); + return retval; +} + +#endif + +/********************/ +/* Write Attributes */ +/********************/ + +UA_StatusCode +__UA_Client_writeAttribute(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, const void *in, + const UA_DataType *inDataType) { + if(!in) + return UA_STATUSCODE_BADTYPEMISMATCH; + + UA_WriteValue wValue; + UA_WriteValue_init(&wValue); + wValue.nodeId = *nodeId; + wValue.attributeId = attributeId; + if(attributeId == UA_ATTRIBUTEID_VALUE) + wValue.value.value = *(const UA_Variant*)in; + else + /* hack. is never written into. */ + UA_Variant_setScalar(&wValue.value.value, (void*)(uintptr_t)in, inDataType); + wValue.value.hasValue = true; + UA_WriteRequest wReq; + UA_WriteRequest_init(&wReq); + wReq.nodesToWrite = &wValue; + wReq.nodesToWriteSize = 1; + + UA_WriteResponse wResp = UA_Client_Service_write(client, wReq); + + UA_StatusCode retval = wResp.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + if(wResp.resultsSize == 1) + retval = wResp.results[0]; + else + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + + UA_WriteResponse_clear(&wResp); + return retval; +} + +UA_StatusCode +UA_Client_writeArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId, + size_t newArrayDimensionsSize, + const UA_UInt32 *newArrayDimensions) { + if(!newArrayDimensions) + return UA_STATUSCODE_BADTYPEMISMATCH; + + UA_WriteValue wValue; + UA_WriteValue_init(&wValue); + wValue.nodeId = nodeId; + wValue.attributeId = UA_ATTRIBUTEID_ARRAYDIMENSIONS; + UA_Variant_setArray(&wValue.value.value, (void*)(uintptr_t)newArrayDimensions, + newArrayDimensionsSize, &UA_TYPES[UA_TYPES_UINT32]); + wValue.value.hasValue = true; + UA_WriteRequest wReq; + UA_WriteRequest_init(&wReq); + wReq.nodesToWrite = &wValue; + wReq.nodesToWriteSize = 1; + + UA_WriteResponse wResp = UA_Client_Service_write(client, wReq); + + UA_StatusCode retval = wResp.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + if(wResp.resultsSize == 1) + retval = wResp.results[0]; + else + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + UA_WriteResponse_clear(&wResp); + return retval; +} + +/*******************/ +/* Read Attributes */ +/*******************/ + +UA_StatusCode +__UA_Client_readAttribute(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, void *out, + const UA_DataType *outDataType) { + UA_ReadValueId item; + UA_ReadValueId_init(&item); + item.nodeId = *nodeId; + item.attributeId = attributeId; + UA_ReadRequest request; + UA_ReadRequest_init(&request); + request.nodesToRead = &item; + request.nodesToReadSize = 1; + UA_ReadResponse response = UA_Client_Service_read(client, request); + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval == UA_STATUSCODE_GOOD) { + if(response.resultsSize == 1) + retval = response.results[0].status; + else + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + if(retval != UA_STATUSCODE_GOOD) { + UA_ReadResponse_clear(&response); + return retval; + } + + /* Set the StatusCode */ + UA_DataValue *res = response.results; + if(res->hasStatus) + retval = res->status; + + /* Return early of no value is given */ + if(!res->hasValue) { + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + UA_ReadResponse_clear(&response); + return retval; + } + + /* Copy value into out */ + if(attributeId == UA_ATTRIBUTEID_VALUE) { + memcpy(out, &res->value, sizeof(UA_Variant)); + UA_Variant_init(&res->value); + } else if(attributeId == UA_ATTRIBUTEID_NODECLASS) { + memcpy(out, (UA_NodeClass*)res->value.data, sizeof(UA_NodeClass)); + } else if(UA_Variant_isScalar(&res->value) && + res->value.type == outDataType) { + memcpy(out, res->value.data, res->value.type->memSize); + UA_free(res->value.data); + res->value.data = NULL; + } else { + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + + UA_ReadResponse_clear(&response); + return retval; +} + +static UA_StatusCode +processReadArrayDimensionsResult(UA_ReadResponse *response, + UA_UInt32 **outArrayDimensions, + size_t *outArrayDimensionsSize) { + UA_StatusCode retval = response->responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) + return retval; + + if(response->resultsSize != 1) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + + retval = response->results[0].status; + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_DataValue *res = &response->results[0]; + if(!res->hasValue || + UA_Variant_isScalar(&res->value) || + res->value.type != &UA_TYPES[UA_TYPES_UINT32]) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + + /* Move results */ + *outArrayDimensions = (UA_UInt32*)res->value.data; + *outArrayDimensionsSize = res->value.arrayLength; + res->value.data = NULL; + res->value.arrayLength = 0; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Client_readArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId, + size_t *outArrayDimensionsSize, + UA_UInt32 **outArrayDimensions) { + UA_ReadValueId item; + UA_ReadValueId_init(&item); + item.nodeId = nodeId; + item.attributeId = UA_ATTRIBUTEID_ARRAYDIMENSIONS; + UA_ReadRequest request; + UA_ReadRequest_init(&request); + request.nodesToRead = &item; + request.nodesToReadSize = 1; + + UA_ReadResponse response = UA_Client_Service_read(client, request); + UA_StatusCode retval = processReadArrayDimensionsResult(&response, outArrayDimensions, + outArrayDimensionsSize); + UA_ReadResponse_clear(&response); + return retval; +} + +/*********************/ +/* Historical Access */ +/*********************/ +#ifdef UA_ENABLE_HISTORIZING +static UA_HistoryReadResponse +__UA_Client_HistoryRead(UA_Client *client, const UA_NodeId *nodeId, + UA_ExtensionObject* details, UA_String indexRange, + UA_TimestampsToReturn timestampsToReturn, + UA_ByteString continuationPoint, UA_Boolean releaseConti) { + + UA_HistoryReadValueId item; + UA_HistoryReadValueId_init(&item); + + item.nodeId = *nodeId; + item.indexRange = indexRange; + item.continuationPoint = continuationPoint; + item.dataEncoding = UA_QUALIFIEDNAME(0, "Default Binary"); + + UA_HistoryReadRequest request; + UA_HistoryReadRequest_init(&request); + + request.nodesToRead = &item; + request.nodesToReadSize = 1; + request.timestampsToReturn = timestampsToReturn; // Defaults to Source + request.releaseContinuationPoints = releaseConti; // No values are returned, if true + + /* Build ReadDetails */ + request.historyReadDetails = *details; + + return UA_Client_Service_historyRead(client, request); +} + +static UA_StatusCode +__UA_Client_HistoryRead_service(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_ExtensionObject *details, UA_String indexRange, + UA_TimestampsToReturn timestampsToReturn, + void *callbackContext) { + + UA_ByteString continuationPoint = UA_BYTESTRING_NULL; + UA_Boolean continuationAvail = false; + UA_Boolean fetchMore = false; + UA_StatusCode retval = UA_STATUSCODE_GOOD; + + do { + /* We release the continuation point, if no more data is requested by the user */ + UA_Boolean cleanup = !fetchMore && continuationAvail; + UA_HistoryReadResponse response = + __UA_Client_HistoryRead(client, nodeId, details, indexRange, timestampsToReturn, continuationPoint, cleanup); + + if (cleanup) { + retval = response.responseHeader.serviceResult; +cleanup: UA_HistoryReadResponse_clear(&response); + UA_ByteString_clear(&continuationPoint); + return retval; + } + + retval = response.responseHeader.serviceResult; + if (retval == UA_STATUSCODE_GOOD) { + if (response.resultsSize == 1) + retval = response.results[0].statusCode; + else + retval = UA_STATUSCODE_BADUNEXPECTEDERROR; + } + if (retval != UA_STATUSCODE_GOOD) + goto cleanup; + + UA_HistoryReadResult *res = response.results; + + /* Clear old and check / store new continuation point */ + UA_ByteString_clear(&continuationPoint); + UA_ByteString_copy(&res->continuationPoint, &continuationPoint); + continuationAvail = !UA_ByteString_equal(&continuationPoint, &UA_BYTESTRING_NULL); + + /* Client callback with possibility to request further values */ + fetchMore = callback(client, nodeId, continuationAvail, &res->historyData, callbackContext); + + /* Regular cleanup */ + UA_HistoryReadResponse_clear(&response); + } while (continuationAvail); + + return retval; +} + +#ifdef UA_ENABLE_EXPERIMENTAL_HISTORIZING +UA_StatusCode +UA_Client_HistoryRead_events(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, const UA_EventFilter filter, UA_UInt32 numValuesPerNode, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext) { + + UA_ReadEventDetails details; + UA_ReadEventDetails_init(&details); + details.filter = filter; + + // At least two of the following parameters must be set + details.numValuesPerNode = numValuesPerNode; // 0 = return all / max server is capable of + details.startTime = startTime; + details.endTime = endTime; + + UA_ExtensionObject detailsExtensionObject; + UA_ExtensionObject_init(&detailsExtensionObject); + detailsExtensionObject.content.decoded.type = &UA_TYPES[UA_TYPES_READEVENTDETAILS]; + detailsExtensionObject.content.decoded.data = &details; + detailsExtensionObject.encoding = UA_EXTENSIONOBJECT_DECODED; + + return __UA_Client_HistoryRead_service(client, nodeId, callback, &detailsExtensionObject, + indexRange, timestampsToReturn, callbackContext); +} +#endif // UA_ENABLE_EXPERIMENTAL_HISTORIZING + +static UA_StatusCode +__UA_Client_HistoryRead_service_rawMod(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime,UA_DateTime endTime, + UA_String indexRange, UA_Boolean returnBounds, UA_UInt32 numValuesPerNode, + UA_Boolean readModified, UA_TimestampsToReturn timestampsToReturn, + void *callbackContext) { + + UA_ReadRawModifiedDetails details; + UA_ReadRawModifiedDetails_init(&details); + details.isReadModified = readModified; // Return only modified values + details.returnBounds = returnBounds; // Return values pre / post given range + + // At least two of the following parameters must be set + details.numValuesPerNode = numValuesPerNode; // 0 = return all / max server is capable of + details.startTime = startTime; + details.endTime = endTime; + + UA_ExtensionObject detailsExtensionObject; + UA_ExtensionObject_init(&detailsExtensionObject); + detailsExtensionObject.content.decoded.type = &UA_TYPES[UA_TYPES_READRAWMODIFIEDDETAILS]; + detailsExtensionObject.content.decoded.data = &details; + detailsExtensionObject.encoding = UA_EXTENSIONOBJECT_DECODED; + + return __UA_Client_HistoryRead_service(client, nodeId, callback, + &detailsExtensionObject, indexRange, + timestampsToReturn, callbackContext); +} + +UA_StatusCode +UA_Client_HistoryRead_raw(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, UA_Boolean returnBounds, UA_UInt32 numValuesPerNode, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext) { + + return __UA_Client_HistoryRead_service_rawMod(client, nodeId, callback, startTime, endTime, indexRange, returnBounds, + numValuesPerNode, false, timestampsToReturn, callbackContext); +} + +#ifdef UA_ENABLE_EXPERIMENTAL_HISTORIZING +UA_StatusCode +UA_Client_HistoryRead_modified(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, UA_Boolean returnBounds, UA_UInt32 maxItems, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext) { + + return __UA_Client_HistoryRead_service_rawMod(client, nodeId, callback, startTime, endTime, indexRange, returnBounds, + maxItems, true, timestampsToReturn, callbackContext); +} +#endif // UA_ENABLE_EXPERIMENTAL_HISTORIZING + +static UA_HistoryUpdateResponse +__UA_Client_HistoryUpdate(UA_Client *client, + void *details, + size_t typeId) +{ + UA_HistoryUpdateRequest request; + UA_HistoryUpdateRequest_init(&request); + + UA_ExtensionObject extension; + UA_ExtensionObject_init(&extension); + request.historyUpdateDetailsSize = 1; + request.historyUpdateDetails = &extension; + + extension.encoding = UA_EXTENSIONOBJECT_DECODED; + extension.content.decoded.type = &UA_TYPES[typeId]; + extension.content.decoded.data = details; + + UA_HistoryUpdateResponse response; + response = UA_Client_Service_historyUpdate(client, request); + return response; +} + +static UA_StatusCode +__UA_Client_HistoryUpdate_updateData(UA_Client *client, + const UA_NodeId *nodeId, + UA_PerformUpdateType type, + UA_DataValue *value) +{ + UA_StatusCode ret = UA_STATUSCODE_GOOD; + UA_UpdateDataDetails details; + UA_UpdateDataDetails_init(&details); + + details.performInsertReplace = type; + details.updateValuesSize = 1; + details.updateValues = value; + UA_NodeId_copy(nodeId, &details.nodeId); + + UA_HistoryUpdateResponse response; + response = __UA_Client_HistoryUpdate(client, &details, UA_TYPES_UPDATEDATADETAILS); + if (response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + ret = response.responseHeader.serviceResult; + goto cleanup; + } + if (response.resultsSize != 1 || response.results[0].operationResultsSize != 1) { + ret = UA_STATUSCODE_BADUNEXPECTEDERROR; + goto cleanup; + } + if (response.results[0].statusCode != UA_STATUSCODE_GOOD) { + ret = response.results[0].statusCode; + goto cleanup; + } + ret = response.results[0].operationResults[0]; +cleanup: + UA_HistoryUpdateResponse_clear(&response); + UA_NodeId_clear(&details.nodeId); + return ret; +} + +UA_StatusCode +UA_Client_HistoryUpdate_insert(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value) +{ + return __UA_Client_HistoryUpdate_updateData(client, + nodeId, + UA_PERFORMUPDATETYPE_INSERT, + value); +} + +UA_StatusCode +UA_Client_HistoryUpdate_replace(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value) +{ + return __UA_Client_HistoryUpdate_updateData(client, + nodeId, + UA_PERFORMUPDATETYPE_REPLACE, + value); +} + +UA_StatusCode +UA_Client_HistoryUpdate_update(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value) +{ + return __UA_Client_HistoryUpdate_updateData(client, + nodeId, + UA_PERFORMUPDATETYPE_UPDATE, + value); +} + +UA_StatusCode +UA_Client_HistoryUpdate_deleteRaw(UA_Client *client, + const UA_NodeId *nodeId, + UA_DateTime startTimestamp, + UA_DateTime endTimestamp) +{ + UA_StatusCode ret = UA_STATUSCODE_GOOD; + + UA_DeleteRawModifiedDetails details; + UA_DeleteRawModifiedDetails_init(&details); + + details.isDeleteModified = false; + details.startTime = startTimestamp; + details.endTime = endTimestamp; + UA_NodeId_copy(nodeId, &details.nodeId); + + UA_HistoryUpdateResponse response; + response = __UA_Client_HistoryUpdate(client, &details, UA_TYPES_DELETERAWMODIFIEDDETAILS); + if (response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + ret = response.responseHeader.serviceResult; + goto cleanup; + } + if (response.resultsSize != 1) { + ret = UA_STATUSCODE_BADUNEXPECTEDERROR; + goto cleanup; + } + + ret = response.results[0].statusCode; + +cleanup: + UA_HistoryUpdateResponse_clear(&response); + UA_NodeId_clear(&details.nodeId); + return ret; +} +#endif // UA_ENABLE_HISTORIZING + +/* Async Functions */ + +typedef struct { + UA_AttributeId attributeId; + const UA_DataType *outDataType; +} AsyncReadData; + +static CustomCallback * +UA_Client_findCustomCallback(UA_Client *client, UA_UInt32 requestId) { + CustomCallback *cc; + LIST_FOREACH(cc, &client->customCallbacks, pointers) { + if(cc->callbackId == requestId) + break; + } + return cc; +} + +static +void ValueAttributeRead(UA_Client *client, void *userdata, + UA_UInt32 requestId, void *response) { + if(!response) + return; + + /* Find the callback for the response */ + CustomCallback *cc = UA_Client_findCustomCallback(client, requestId); + if(!cc) + return; + + UA_ReadResponse *rr = (UA_ReadResponse *) response; + UA_DataValue *res = rr->results; + UA_Boolean done = false; + AsyncReadData *data = (AsyncReadData *)cc->clientData; + if(rr->resultsSize == 1 && res != NULL && res->hasValue) { + if(data->attributeId == UA_ATTRIBUTEID_VALUE) { + /* Call directly with the variant */ + cc->userCallback(client, cc->userData, requestId, &res->value); + done = true; + } else if(UA_Variant_isScalar(&res->value) && + res->value.type == data->outDataType) { + /* Unpack the value */ + cc->userCallback(client, cc->userData, requestId, res->value.data); + done = true; + } + } + + /* Could not process, delete the callback anyway */ + if(!done) + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Cannot process the response to the async read " + "request %" PRIu32, requestId); + + UA_free(cc->clientData); + LIST_REMOVE(cc, pointers); + UA_free(cc); +} + +/*Read Attributes*/ +UA_StatusCode +__UA_Client_readAttribute_async(UA_Client *client, + const UA_NodeId *nodeId, UA_AttributeId attributeId, + const UA_DataType *outDataType, UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + UA_ReadValueId item; + UA_ReadValueId_init(&item); + item.nodeId = *nodeId; + item.attributeId = attributeId; + UA_ReadRequest request; + UA_ReadRequest_init(&request); + request.nodesToRead = &item; + request.nodesToReadSize = 1; + + CustomCallback *cc = (CustomCallback*) UA_malloc(sizeof(CustomCallback)); + if (!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + memset(cc, 0, sizeof(CustomCallback)); + cc->userCallback = callback; + cc->userData = userdata; + + cc->clientData = UA_malloc(sizeof(AsyncReadData)); + if(!cc->clientData) { + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + AsyncReadData *rd = (AsyncReadData *)cc->clientData; + rd->attributeId = attributeId; + rd->outDataType = outDataType; + + __UA_Client_AsyncService(client, &request, &UA_TYPES[UA_TYPES_READREQUEST], + ValueAttributeRead, &UA_TYPES[UA_TYPES_READRESPONSE], NULL, + &cc->callbackId); + + LIST_INSERT_HEAD(&client->customCallbacks, cc, pointers); + if (reqId != NULL) + *reqId = cc->callbackId; + + return UA_STATUSCODE_GOOD; +} + +/*Write Attributes*/ +UA_StatusCode __UA_Client_writeAttribute_async(UA_Client *client, + const UA_NodeId *nodeId, UA_AttributeId attributeId, const void *in, + const UA_DataType *inDataType, UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + if (!in) + return UA_STATUSCODE_BADTYPEMISMATCH; + + UA_WriteValue wValue; + UA_WriteValue_init(&wValue); + wValue.nodeId = *nodeId; + wValue.attributeId = attributeId; + if (attributeId == UA_ATTRIBUTEID_VALUE) + wValue.value.value = *(const UA_Variant*) in; + else + /* hack. is never written into. */ + UA_Variant_setScalar(&wValue.value.value, (void*) (uintptr_t) in, + inDataType); + wValue.value.hasValue = true; + UA_WriteRequest wReq; + UA_WriteRequest_init(&wReq); + wReq.nodesToWrite = &wValue; + wReq.nodesToWriteSize = 1; + + return __UA_Client_AsyncService(client, &wReq, + &UA_TYPES[UA_TYPES_WRITEREQUEST], callback, + &UA_TYPES[UA_TYPES_WRITERESPONSE], userdata, reqId); +} + +/*Node Management*/ + +UA_StatusCode UA_EXPORT +__UA_Client_addNode_async(UA_Client *client, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, const UA_NodeAttributes *attr, + const UA_DataType *attributeType, UA_NodeId *outNewNodeId, + UA_ClientAsyncServiceCallback callback, void *userdata, + UA_UInt32 *reqId) { + UA_AddNodesRequest request; + UA_AddNodesRequest_init(&request); + UA_AddNodesItem item; + UA_AddNodesItem_init(&item); + item.parentNodeId.nodeId = parentNodeId; + item.referenceTypeId = referenceTypeId; + item.requestedNewNodeId.nodeId = requestedNewNodeId; + item.browseName = browseName; + item.nodeClass = nodeClass; + item.typeDefinition.nodeId = typeDefinition; + item.nodeAttributes.encoding = UA_EXTENSIONOBJECT_DECODED_NODELETE; + item.nodeAttributes.content.decoded.type = attributeType; + item.nodeAttributes.content.decoded.data = (void*) (uintptr_t) attr; // hack. is not written into. + request.nodesToAdd = &item; + request.nodesToAddSize = 1; + + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_ADDNODESREQUEST], callback, + &UA_TYPES[UA_TYPES_ADDNODESRESPONSE], userdata, reqId); + +} + +/* Misc Highlevel Functions */ +#ifdef UA_ENABLE_METHODCALLS +UA_StatusCode __UA_Client_call_async(UA_Client *client, + const UA_NodeId objectId, const UA_NodeId methodId, size_t inputSize, + const UA_Variant *input, UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + + UA_CallRequest request; + UA_CallRequest_init(&request); + UA_CallMethodRequest item; + UA_CallMethodRequest_init(&item); + item.methodId = methodId; + item.objectId = objectId; + item.inputArguments = (UA_Variant *) (void*) (uintptr_t) input; // cast const... + item.inputArgumentsSize = inputSize; + request.methodsToCall = &item; + request.methodsToCallSize = 1; + + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_CALLREQUEST], callback, + &UA_TYPES[UA_TYPES_CALLRESPONSE], userdata, reqId); +} +#endif + +UA_StatusCode __UA_Client_translateBrowsePathsToNodeIds_async(UA_Client *client, + char *paths[], UA_UInt32 ids[], size_t pathSize, + UA_ClientAsyncServiceCallback callback, void *userdata, + UA_UInt32 *reqId) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +UA_StatusCode +UA_Cient_translateBrowsePathsToNodeIds_async(UA_Client *client, char **paths, + UA_UInt32 *ids, size_t pathSize, + UA_ClientAsyncTranslateCallback callback, + void *userdata, UA_UInt32 *reqId) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/client/ua_client_subscriptions.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2016 (c) Sten Grüner + * Copyright 2017-2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2016-2017 (c) Florian Palm + * Copyright 2017 (c) Frank Meerkötter + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +/*****************/ +/* Subscriptions */ +/*****************/ + +static void +UA_Client_MonitoredItem_remove(UA_Client *client, UA_Client_Subscription *sub, + UA_Client_MonitoredItem *mon); + +static void +__Subscriptions_create_handler(UA_Client *client, void *data, UA_UInt32 requestId, void *r) { + UA_Client_Subscription *newSub = NULL; + UA_CreateSubscriptionResponse *response = (UA_CreateSubscriptionResponse *)r; + CustomCallback *cc = (CustomCallback *)data; + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + if(cc->clientData) + UA_free(cc->clientData); + goto cleanup; + } + + /* Prepare the internal representation */ + newSub = (UA_Client_Subscription *)cc->clientData; + newSub->subscriptionId = response->subscriptionId; + newSub->sequenceNumber = 0; + newSub->lastActivity = UA_DateTime_nowMonotonic(); + newSub->publishingInterval = response->revisedPublishingInterval; + newSub->maxKeepAliveCount = response->revisedMaxKeepAliveCount; + LIST_INIT(&newSub->monitoredItems); + LIST_INSERT_HEAD(&client->subscriptions, newSub, listEntry); + +cleanup: + if(cc->isAsync) { + if(cc->userCallback) + cc->userCallback(client, cc->userData, requestId, response); + UA_free(cc); + } +} + +UA_CreateSubscriptionResponse +UA_Client_Subscriptions_create(UA_Client *client, + const UA_CreateSubscriptionRequest request, + void *subscriptionContext, + UA_Client_StatusChangeNotificationCallback statusChangeCallback, + UA_Client_DeleteSubscriptionCallback deleteCallback) { + UA_CreateSubscriptionResponse response; + UA_CreateSubscriptionResponse_init(&response); + + CustomCallback cc; + memset(&cc, 0, sizeof(CustomCallback)); +#ifdef __clang_analyzer__ + cc.isAsync = false; +#endif + + UA_Client_Subscription *sub = (UA_Client_Subscription *) + UA_malloc(sizeof(UA_Client_Subscription)); + if(!sub) { + response.responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY; + return response; + } + sub->context = subscriptionContext; + sub->statusChangeCallback = statusChangeCallback; + sub->deleteCallback = deleteCallback; + cc.clientData = sub; + + /* Send the request as a synchronous service call */ + __UA_Client_Service(client, + &request, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST], + &response, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); + + __Subscriptions_create_handler(client, &cc, 0, &response); + + return response; +} + +UA_StatusCode +UA_Client_Subscriptions_create_async(UA_Client *client, const UA_CreateSubscriptionRequest request, + void *subscriptionContext, + UA_Client_StatusChangeNotificationCallback statusChangeCallback, + UA_Client_DeleteSubscriptionCallback deleteCallback, + UA_ClientAsyncServiceCallback createCallback, void *userdata, + UA_UInt32 *requestId) { + CustomCallback *cc = (CustomCallback *)UA_calloc(1, sizeof(CustomCallback)); + if(!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + cc->isAsync = true; + cc->userCallback = createCallback; + cc->userData = userdata; + + UA_Client_Subscription *sub = (UA_Client_Subscription *) + UA_malloc(sizeof(UA_Client_Subscription)); + if(!sub) { + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + sub->context = subscriptionContext; + sub->statusChangeCallback = statusChangeCallback; + sub->deleteCallback = deleteCallback; + cc->clientData = sub; + + /* Send the request as asynchronous service call */ + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST], + __Subscriptions_create_handler, + &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE], + cc, requestId); +} + +static UA_Client_Subscription * +findSubscription(const UA_Client *client, UA_UInt32 subscriptionId) { + UA_Client_Subscription *sub = NULL; + LIST_FOREACH(sub, &client->subscriptions, listEntry) { + if(sub->subscriptionId == subscriptionId) + break; + } + return sub; +} + +static void +__Subscriptions_modify_handler(UA_Client *client, void *data, UA_UInt32 requestId, void *r) { + UA_ModifySubscriptionResponse *response = (UA_ModifySubscriptionResponse *)r; + CustomCallback *cc = (CustomCallback *)data; + UA_Client_Subscription *sub = (UA_Client_Subscription *)cc->clientData; + + sub->publishingInterval = response->revisedPublishingInterval; + sub->maxKeepAliveCount = response->revisedMaxKeepAliveCount; + + if(cc->isAsync) { + if(cc->userCallback) + cc->userCallback(client, cc->userData, requestId, response); + UA_free(cc); + } +} + +UA_ModifySubscriptionResponse +UA_Client_Subscriptions_modify(UA_Client *client, const UA_ModifySubscriptionRequest request) { + UA_ModifySubscriptionResponse response; + UA_ModifySubscriptionResponse_init(&response); + + /* Find the internal representation */ + UA_Client_Subscription *sub = findSubscription(client, request.subscriptionId); + if(!sub) { + response.responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return response; + } + + /* Call the service */ + __UA_Client_Service(client, + &request, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST], + &response, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); + + /* Adjust the internal representation */ + sub->publishingInterval = response.revisedPublishingInterval; + sub->maxKeepAliveCount = response.revisedMaxKeepAliveCount; + return response; +} + +UA_StatusCode +UA_Client_Subscriptions_modify_async(UA_Client *client, + const UA_ModifySubscriptionRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + /* Find the internal representation */ + UA_Client_Subscription *sub = findSubscription(client, request.subscriptionId); + if(!sub) + return UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + + CustomCallback *cc = (CustomCallback *)UA_calloc(1, sizeof(CustomCallback)); + if(!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + + cc->isAsync = true; + cc->clientData = sub; + cc->userData = userdata; + cc->userCallback = callback; + + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST], + __Subscriptions_modify_handler, + &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE], + cc, requestId); +} + +static void +UA_Client_Subscription_deleteInternal(UA_Client *client, UA_Client_Subscription *sub) { + /* Remove the MonitoredItems */ + UA_Client_MonitoredItem *mon, *mon_tmp; + LIST_FOREACH_SAFE(mon, &sub->monitoredItems, listEntry, mon_tmp) + UA_Client_MonitoredItem_remove(client, sub, mon); + + /* Call the delete callback */ + if(sub->deleteCallback) + sub->deleteCallback(client, sub->subscriptionId, sub->context); + + /* Remove */ + LIST_REMOVE(sub, listEntry); + UA_free(sub); +} + +typedef struct { + UA_DeleteSubscriptionsRequest *request; + UA_Client_Subscription **subs; +} Subscriptions_DeleteData; + +static void +__Subscriptions_DeleteData_free(Subscriptions_DeleteData *data) { + if(!data) + return; + if(data->subs) + UA_free(data->subs); + if(data->request) + UA_delete(data->request, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); + UA_free(data); +} + +static UA_INLINE void +__Subscriptions_delete_prepare(UA_Client *client, Subscriptions_DeleteData *data) { + /* temporary remove the subscriptions from the list */ + for(size_t i = 0; i < data->request->subscriptionIdsSize; i++) { + data->subs[i] = findSubscription(client, data->request->subscriptionIds[i]); + if(data->subs[i]) + LIST_REMOVE(data->subs[i], listEntry); + } +} + +static void +__Subscriptions_delete_handler(UA_Client *client, void *data, UA_UInt32 requestId, void *r) { + UA_DeleteSubscriptionsResponse *response = (UA_DeleteSubscriptionsResponse *)r; + CustomCallback *cc = (CustomCallback *)data; + Subscriptions_DeleteData *delData = (Subscriptions_DeleteData *)cc->clientData; + UA_DeleteSubscriptionsRequest *request = delData->request; + UA_Client_Subscription **subs = delData->subs; + + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) + goto cleanup; + + if(request->subscriptionIdsSize != response->resultsSize) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + goto cleanup; + } + + /* Loop over the removed subscriptions and remove internally */ + for(size_t i = 0; i < request->subscriptionIdsSize; i++) { + if(response->results[i] != UA_STATUSCODE_GOOD && + response->results[i] != UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID) { + /* Something was wrong, reinsert the subscription in the list */ + if(subs[i]) + LIST_INSERT_HEAD(&client->subscriptions, subs[i], listEntry); + continue; + } + + if(!subs[i]) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "No internal representation of subscription %" PRIu32, + delData->request->subscriptionIds[i]); + continue; + } + + LIST_INSERT_HEAD(&client->subscriptions, subs[i], listEntry); + UA_Client_Subscription_deleteInternal(client, subs[i]); + } + +cleanup: + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + for(size_t i = 0; i < request->subscriptionIdsSize; i++) { + if(subs[i]) { + LIST_INSERT_HEAD(&client->subscriptions, subs[i], listEntry); + } + } + } + + if(cc->isAsync) { + if(cc->userCallback) + cc->userCallback(client, cc->userData, requestId, response); + __Subscriptions_DeleteData_free(delData); + UA_free(cc); + } +} + +UA_StatusCode +UA_Client_Subscriptions_delete_async(UA_Client *client, + const UA_DeleteSubscriptionsRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + CustomCallback *cc = (CustomCallback *)UA_calloc(1, sizeof(CustomCallback)); + if(!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + + Subscriptions_DeleteData *data = (Subscriptions_DeleteData *) + UA_calloc(1, sizeof(Subscriptions_DeleteData)); + if(!data) { + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + cc->clientData = data; + + data->subs = (UA_Client_Subscription **) + UA_calloc(request.subscriptionIdsSize, sizeof(UA_Client_Subscription *)); + if(!data->subs) + goto cleanup; + + data->request = UA_DeleteSubscriptionsRequest_new(); + if(!data->request) + goto cleanup; + UA_DeleteSubscriptionsRequest_copy(&request, data->request); + + __Subscriptions_delete_prepare(client, data); + cc->isAsync = true; + cc->userCallback = callback; + cc->userData = userdata; + + return __UA_Client_AsyncService(client, &request, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST], + __Subscriptions_delete_handler, + &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE], + cc, requestId); +cleanup: + __Subscriptions_DeleteData_free(data); + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; +} + +UA_DeleteSubscriptionsResponse +UA_Client_Subscriptions_delete(UA_Client *client, + const UA_DeleteSubscriptionsRequest request) { + UA_STACKARRAY(UA_Client_Subscription *, subs, request.subscriptionIdsSize); + memset(subs, 0, sizeof(void *) * request.subscriptionIdsSize); + + CustomCallback cc; + memset(&cc, 0, sizeof(CustomCallback)); +#ifdef __clang_analyzer__ + cc.isAsync = false; +#endif + + Subscriptions_DeleteData data; + cc.clientData = &data; + data.request = (UA_DeleteSubscriptionsRequest *)(uintptr_t)&request; + data.subs = subs; + + __Subscriptions_delete_prepare(client, &data); + + /* Send the request */ + UA_DeleteSubscriptionsResponse response; + + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST], + &response, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); + + __Subscriptions_delete_handler(client, &cc, 0, &response); + return response; +} + +UA_StatusCode +UA_Client_Subscriptions_deleteSingle(UA_Client *client, UA_UInt32 subscriptionId) { + UA_DeleteSubscriptionsRequest request; + UA_DeleteSubscriptionsRequest_init(&request); + request.subscriptionIds = &subscriptionId; + request.subscriptionIdsSize = 1; + + UA_DeleteSubscriptionsResponse response = + UA_Client_Subscriptions_delete(client, request); + + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_DeleteSubscriptionsResponse_clear(&response); + return retval; + } + + if(response.resultsSize != 1) { + UA_DeleteSubscriptionsResponse_clear(&response); + return UA_STATUSCODE_BADINTERNALERROR; + } + + retval = response.results[0]; + UA_DeleteSubscriptionsResponse_clear(&response); + return retval; +} + +/******************/ +/* MonitoredItems */ +/******************/ + +static void +UA_Client_MonitoredItem_remove(UA_Client *client, UA_Client_Subscription *sub, + UA_Client_MonitoredItem *mon) { + // NOLINTNEXTLINE + LIST_REMOVE(mon, listEntry); + if(mon->deleteCallback) + mon->deleteCallback(client, sub->subscriptionId, sub->context, + mon->monitoredItemId, mon->context); + UA_free(mon); +} + +typedef struct { + UA_Client_Subscription *sub; + + UA_Client_MonitoredItem **mis; + void **contexts; + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks; + void **handlingCallbacks; + + UA_CreateMonitoredItemsRequest *request; +} MonitoredItems_CreateData; + +static void +MonitoredItems_CreateData_deleteItems(UA_Client_MonitoredItem **mis, + MonitoredItems_CreateData *data, UA_Client *client) { + bool hasCallbacks = (data->deleteCallbacks && data->contexts); + for(size_t i = 0; i < data->request->itemsToCreateSize; i++) { + if(!mis[i]) + continue; + UA_free(mis[i]); + mis[i] = NULL; + if(hasCallbacks && data->deleteCallbacks[i]) { + if(data->sub) + data->deleteCallbacks[i](client, data->sub->subscriptionId, + data->sub->context, 0, data->contexts[i]); + else + data->deleteCallbacks[i](client, 0, NULL, 0, data->contexts[i]); + } + } +} + +static void +__MonitoredItems_create_handler(UA_Client *client, CustomCallback *cc, UA_UInt32 requestId, + UA_CreateMonitoredItemsResponse *response) { + MonitoredItems_CreateData *data = (MonitoredItems_CreateData *)cc->clientData; + + // introduce local pointers to the variables/parameters in the CreateData + // to keep the code completely intact + UA_CreateMonitoredItemsRequest *request = data->request; + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks = data->deleteCallbacks; + UA_Client_Subscription *sub = data->sub; + void **contexts = data->contexts; + UA_Client_MonitoredItem **mis = data->mis; + void **handlingCallbacks = data->handlingCallbacks; + + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) + return; + + if(response->resultsSize != request->itemsToCreateSize) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + return; + } + + /* Add internally */ + for(size_t i = 0; i < request->itemsToCreateSize; i++) { + if(response->results[i].statusCode != UA_STATUSCODE_GOOD) { + if(deleteCallbacks[i]) + deleteCallbacks[i](client, sub->subscriptionId, sub->context, 0, contexts[i]); + UA_free(mis[i]); + mis[i] = NULL; + continue; + } + + UA_assert(mis[i] != NULL); + UA_Client_MonitoredItem *newMon = mis[i]; + newMon->clientHandle = request->itemsToCreate[i].requestedParameters.clientHandle; + newMon->monitoredItemId = response->results[i].monitoredItemId; + newMon->context = contexts[i]; + newMon->deleteCallback = deleteCallbacks[i]; + newMon->handler.dataChangeCallback = + (UA_Client_DataChangeNotificationCallback)(uintptr_t)handlingCallbacks[i]; + newMon->isEventMonitoredItem = + (request->itemsToCreate[i].itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER); + LIST_INSERT_HEAD(&sub->monitoredItems, newMon, listEntry); + + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Subscription %" PRIu32 " | Added a MonitoredItem with handle %" PRIu32, + sub->subscriptionId, newMon->clientHandle); + mis[i] = NULL; + } +} + +static void +__MonitoredItems_create_async_handler(UA_Client *client, void *d, + UA_UInt32 requestId, void *r) { + UA_CreateMonitoredItemsResponse *response = (UA_CreateMonitoredItemsResponse *)r; + CustomCallback *cc = (CustomCallback *)d; + MonitoredItems_CreateData *data = (MonitoredItems_CreateData *)cc->clientData; + + __MonitoredItems_create_handler(client, cc, requestId, response); + MonitoredItems_CreateData_deleteItems(data->mis, data, client); + if(cc->userCallback) + cc->userCallback(client, cc->userData, requestId, response); + UA_free(cc); + if(data->mis) + UA_free(data->mis); + if(data->request) + UA_CreateMonitoredItemsRequest_delete(data->request); + UA_free(data); +} + +static UA_StatusCode +MonitoredItems_CreateData_prepare(UA_Client_MonitoredItem **mis, + MonitoredItems_CreateData *data, UA_Client *client) { + /* Allocate the memory for internal representations */ + for(size_t i = 0; i < data->request->itemsToCreateSize; i++) { + mis[i] = (UA_Client_MonitoredItem *)UA_malloc(sizeof(UA_Client_MonitoredItem)); + if(!mis[i]) + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Set the clientHandle */ + for(size_t i = 0; i < data->request->itemsToCreateSize; i++) + data->request->itemsToCreate[i].requestedParameters.clientHandle = + ++(client->monitoredItemHandles); + + return UA_STATUSCODE_GOOD; +} + +static void +__UA_Client_MonitoredItems_create(UA_Client *client, + const UA_CreateMonitoredItemsRequest *request, + void **contexts, void **handlingCallbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_CreateMonitoredItemsResponse *response) { + UA_CreateMonitoredItemsResponse_init(response); + + if(!request->itemsToCreateSize) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + return; + } + + /* Get the subscription */ + UA_Client_Subscription *sub = findSubscription(client, request->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return; + } + + size_t itemsToCreateSize = request->itemsToCreateSize; + UA_STACKARRAY(UA_Client_MonitoredItem *, mis, itemsToCreateSize); + memset(mis, 0, sizeof(void *) * itemsToCreateSize); + + MonitoredItems_CreateData data; + memset(&data, 0, sizeof(MonitoredItems_CreateData)); + data.request = (UA_CreateMonitoredItemsRequest *)(uintptr_t)request; + data.contexts = contexts; + data.handlingCallbacks = handlingCallbacks; + data.deleteCallbacks = deleteCallbacks; + data.mis = mis; + data.sub = sub; + + CustomCallback cc; + memset(&cc, 0, sizeof(CustomCallback)); +#ifdef __clang_analyzer__ + cc.isAsync = false; +#endif + cc.clientData = &data; + + UA_StatusCode retval = MonitoredItems_CreateData_prepare(mis, &data, client); + if(retval != UA_STATUSCODE_GOOD) { + response->responseHeader.serviceResult = retval; + MonitoredItems_CreateData_deleteItems(mis, &data, client); + return; + } + + /* Call the service */ + __UA_Client_Service(client, request, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST], + response, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); + + __MonitoredItems_create_handler(client, &cc, 0, response); + MonitoredItems_CreateData_deleteItems(mis, &data, client); + + for(size_t i = 0; i < itemsToCreateSize; i++) + UA_assert(mis[i] == NULL); +} + +static UA_StatusCode +__UA_Client_MonitoredItems_createDataChanges_async(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, + void **contexts, void **callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_ClientAsyncServiceCallback createCallback, + void *userdata, UA_UInt32 *requestId) { + UA_Client_Subscription *sub = findSubscription(client, request.subscriptionId); + if(!sub) + return UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + + CustomCallback *cc = (CustomCallback *)UA_calloc(1, sizeof(CustomCallback)); + if(!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + + MonitoredItems_CreateData *data = (MonitoredItems_CreateData *) + UA_calloc(1, sizeof(MonitoredItems_CreateData)); + if(!data) { + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + data->sub = sub; + cc->userCallback = createCallback; + cc->userData = userdata; + cc->isAsync = true; + cc->clientData = data; + + /* Create a big array that holds the monitored items and parameters */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + void **array = (void **)UA_calloc(4 * request.itemsToCreateSize, sizeof(void *)); + if(!array) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } + data->mis = (UA_Client_MonitoredItem **)array; + data->contexts = (void **) + ((uintptr_t)array + (sizeof(void *) * request.itemsToCreateSize)); + memcpy(data->contexts, contexts, request.itemsToCreateSize * sizeof(void *)); + data->deleteCallbacks = (UA_Client_DeleteMonitoredItemCallback *) + ((uintptr_t)array + (2 * request.itemsToCreateSize * sizeof(void *))); + memcpy(data->deleteCallbacks, deleteCallbacks, + request.itemsToCreateSize * sizeof(UA_Client_DeleteMonitoredItemCallback)); + data->handlingCallbacks = (void **) + ((uintptr_t)array + (3 * request.itemsToCreateSize * sizeof(void *))); + memcpy(data->handlingCallbacks, callbacks, request.itemsToCreateSize * sizeof(void *)); + + data->request = UA_CreateMonitoredItemsRequest_new(); + if(!data->request) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } + retval = UA_CreateMonitoredItemsRequest_copy(&request, data->request); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + retval = MonitoredItems_CreateData_prepare(data->mis, data, client); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + return __UA_Client_AsyncService(client, data->request, + &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST], + __MonitoredItems_create_async_handler, + &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE], + cc, requestId); +cleanup: + MonitoredItems_CreateData_deleteItems(data->mis, data, client); + if(data->mis) + UA_free(data->mis); + if(data->request) + UA_CreateMonitoredItemsRequest_delete(data->request); + UA_free(data); + UA_free(cc); + return retval; +} + +UA_CreateMonitoredItemsResponse +UA_Client_MonitoredItems_createDataChanges(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, + void **contexts, + UA_Client_DataChangeNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks) { + UA_CreateMonitoredItemsResponse response; + __UA_Client_MonitoredItems_create(client, &request, contexts, + (void**)(uintptr_t)callbacks, deleteCallbacks, &response); + return response; +} + +UA_StatusCode +UA_Client_MonitoredItems_createDataChanges_async(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, + void **contexts, + UA_Client_DataChangeNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_ClientAsyncServiceCallback createCallback, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_MonitoredItems_createDataChanges_async(client, request, contexts, + (void **)(uintptr_t)callbacks, + deleteCallbacks, createCallback, + userdata, requestId); +} + +UA_MonitoredItemCreateResult +UA_Client_MonitoredItems_createDataChange(UA_Client *client, UA_UInt32 subscriptionId, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, void *context, + UA_Client_DataChangeNotificationCallback callback, + UA_Client_DeleteMonitoredItemCallback deleteCallback) { + UA_CreateMonitoredItemsRequest request; + UA_CreateMonitoredItemsRequest_init(&request); + request.subscriptionId = subscriptionId; + request.timestampsToReturn = timestampsToReturn; + request.itemsToCreate = (UA_MonitoredItemCreateRequest*)(uintptr_t)&item; + request.itemsToCreateSize = 1; + UA_CreateMonitoredItemsResponse response = + UA_Client_MonitoredItems_createDataChanges(client, request, &context, + &callback, &deleteCallback); + UA_MonitoredItemCreateResult result; + UA_MonitoredItemCreateResult_init(&result); + if(response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) + result.statusCode = response.responseHeader.serviceResult; + + if(result.statusCode == UA_STATUSCODE_GOOD && + response.resultsSize != 1) + result.statusCode = UA_STATUSCODE_BADINTERNALERROR; + + if(result.statusCode == UA_STATUSCODE_GOOD) + UA_MonitoredItemCreateResult_copy(&response.results[0] , &result); + UA_CreateMonitoredItemsResponse_clear(&response); + return result; +} + +UA_CreateMonitoredItemsResponse +UA_Client_MonitoredItems_createEvents(UA_Client *client, const UA_CreateMonitoredItemsRequest request, + void **contexts, UA_Client_EventNotificationCallback *callback, + UA_Client_DeleteMonitoredItemCallback *deleteCallback) { + UA_CreateMonitoredItemsResponse response; + __UA_Client_MonitoredItems_create(client, &request, contexts, + (void**)(uintptr_t)callback, deleteCallback, &response); + return response; +} + +/* Monitor the EventNotifier attribute only */ +UA_StatusCode +UA_Client_MonitoredItems_createEvents_async(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, + void **contexts, + UA_Client_EventNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_ClientAsyncServiceCallback createCallback, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_MonitoredItems_createDataChanges_async(client, request, contexts, + (void **)(uintptr_t)callbacks, + deleteCallbacks, createCallback, + userdata, requestId); +} + +UA_MonitoredItemCreateResult +UA_Client_MonitoredItems_createEvent(UA_Client *client, UA_UInt32 subscriptionId, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, void *context, + UA_Client_EventNotificationCallback callback, + UA_Client_DeleteMonitoredItemCallback deleteCallback) { + UA_CreateMonitoredItemsRequest request; + UA_CreateMonitoredItemsRequest_init(&request); + request.subscriptionId = subscriptionId; + request.timestampsToReturn = timestampsToReturn; + request.itemsToCreate = (UA_MonitoredItemCreateRequest*)(uintptr_t)&item; + request.itemsToCreateSize = 1; + UA_CreateMonitoredItemsResponse response = + UA_Client_MonitoredItems_createEvents(client, request, &context, + &callback, &deleteCallback); + UA_StatusCode retval = response.responseHeader.serviceResult; + UA_MonitoredItemCreateResult result; + UA_MonitoredItemCreateResult_init(&result); + if(retval != UA_STATUSCODE_GOOD) { + UA_CreateMonitoredItemsResponse_clear(&response); + result.statusCode = retval; + return result; + } + UA_MonitoredItemCreateResult_copy(response.results , &result); + UA_CreateMonitoredItemsResponse_clear(&response); + return result; +} + +static void +__MonitoredItems_delete_handler(UA_Client *client, void *d, UA_UInt32 requestId, void *r) { + UA_Client_Subscription *sub = NULL; + UA_DeleteMonitoredItemsResponse *response = (UA_DeleteMonitoredItemsResponse *)r; + CustomCallback *cc = (CustomCallback *)d; + UA_DeleteMonitoredItemsRequest *request = + (UA_DeleteMonitoredItemsRequest *)cc->clientData; + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) + goto cleanup; + + sub = findSubscription(client, request->subscriptionId); + if(!sub) { + UA_LOG_INFO(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "No internal representation of subscription %" PRIu32, + request->subscriptionId); + goto cleanup; + } + + /* Loop over deleted MonitoredItems */ + for(size_t i = 0; i < response->resultsSize; i++) { + if(response->results[i] != UA_STATUSCODE_GOOD && + response->results[i] != UA_STATUSCODE_BADMONITOREDITEMIDINVALID) { + continue; + } + +#ifndef __clang_analyzer__ + /* Delete the internal representation */ + UA_Client_MonitoredItem *mon; + LIST_FOREACH(mon, &sub->monitoredItems, listEntry) { + // NOLINTNEXTLINE + if(mon->monitoredItemId == request->monitoredItemIds[i]) { + UA_Client_MonitoredItem_remove(client, sub, mon); + break; + } + } +#endif + } +cleanup: + if(cc->isAsync) { + if(cc->userCallback) + cc->userCallback(client, cc->userData, requestId, response); + UA_DeleteMonitoredItemsRequest_delete(request); + UA_free(cc); + } +} + +UA_DeleteMonitoredItemsResponse +UA_Client_MonitoredItems_delete(UA_Client *client, + const UA_DeleteMonitoredItemsRequest request) { + /* Send the request */ + UA_DeleteMonitoredItemsResponse response; + CustomCallback cc; + memset(&cc, 0, sizeof(CustomCallback)); +#ifdef __clang_analyzer__ + cc.isAsync = false; +#endif + cc.clientData = (void *)(uintptr_t)&request; + + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST], + &response, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); + + __MonitoredItems_delete_handler(client, &cc, 0, &response); + return response; +} + +UA_StatusCode +UA_Client_MonitoredItems_delete_async(UA_Client *client, + const UA_DeleteMonitoredItemsRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + /* Send the request */ + CustomCallback *cc = (CustomCallback *)UA_calloc(1, sizeof(CustomCallback)); + if(!cc) + return UA_STATUSCODE_BADOUTOFMEMORY; + + UA_DeleteMonitoredItemsRequest *req_copy = UA_DeleteMonitoredItemsRequest_new(); + if(!req_copy) { + UA_free(cc); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + UA_DeleteMonitoredItemsRequest_copy(&request, req_copy); + cc->isAsync = true; + cc->clientData = req_copy; + cc->userCallback = callback; + cc->userData = userdata; + + return __UA_Client_AsyncService( + client, &request, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST], + __MonitoredItems_delete_handler, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE], + cc, requestId); +} + +UA_StatusCode +UA_Client_MonitoredItems_deleteSingle(UA_Client *client, UA_UInt32 subscriptionId, + UA_UInt32 monitoredItemId) { + UA_DeleteMonitoredItemsRequest request; + UA_DeleteMonitoredItemsRequest_init(&request); + request.subscriptionId = subscriptionId; + request.monitoredItemIds = &monitoredItemId; + request.monitoredItemIdsSize = 1; + + UA_DeleteMonitoredItemsResponse response = + UA_Client_MonitoredItems_delete(client, request); + + UA_StatusCode retval = response.responseHeader.serviceResult; + if(retval != UA_STATUSCODE_GOOD) { + UA_DeleteMonitoredItemsResponse_clear(&response); + return retval; + } + + if(response.resultsSize != 1) { + UA_DeleteMonitoredItemsResponse_clear(&response); + return UA_STATUSCODE_BADINTERNALERROR; + } + + retval = response.results[0]; + UA_DeleteMonitoredItemsResponse_clear(&response); + return retval; +} + +UA_ModifyMonitoredItemsResponse +UA_Client_MonitoredItems_modify(UA_Client *client, + const UA_ModifyMonitoredItemsRequest request) { + UA_ModifyMonitoredItemsResponse response; + + UA_Client_Subscription *sub = 0; + LIST_FOREACH(sub, &client->subscriptions, listEntry) { + if (sub->subscriptionId == request.subscriptionId) + break; + } + + if (!sub) { + UA_ModifyMonitoredItemsResponse_init(&response); + response.responseHeader.serviceResult = UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID; + return response; + } + + UA_ModifyMonitoredItemsRequest modifiedRequest; + UA_ModifyMonitoredItemsRequest_copy(&request, &modifiedRequest); + + for (size_t i = 0; i < modifiedRequest.itemsToModifySize; ++i) { + UA_Client_MonitoredItem *mon = 0; + LIST_FOREACH(mon, &sub->monitoredItems, listEntry) { + if(mon->monitoredItemId == modifiedRequest.itemsToModify[i].monitoredItemId) { + modifiedRequest.itemsToModify[i].requestedParameters.clientHandle = mon->clientHandle; + break; + } + } + } + + __UA_Client_Service(client, + &modifiedRequest, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST], + &response, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); + + UA_ModifyMonitoredItemsRequest_clear(&modifiedRequest); + return response; +} + +/*************************************/ +/* Async Processing of Notifications */ +/*************************************/ + +/* Assume the request is already initialized */ +UA_StatusCode +UA_Client_preparePublishRequest(UA_Client *client, UA_PublishRequest *request) { + /* Count acks */ + UA_Client_NotificationsAckNumber *ack; + LIST_FOREACH(ack, &client->pendingNotificationsAcks, listEntry) + ++request->subscriptionAcknowledgementsSize; + + /* Create the array. Returns a sentinel pointer if the length is zero. */ + request->subscriptionAcknowledgements = (UA_SubscriptionAcknowledgement*) + UA_Array_new(request->subscriptionAcknowledgementsSize, + &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); + if(!request->subscriptionAcknowledgements) { + request->subscriptionAcknowledgementsSize = 0; + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + size_t i = 0; + UA_Client_NotificationsAckNumber *ack_tmp; + LIST_FOREACH_SAFE(ack, &client->pendingNotificationsAcks, listEntry, ack_tmp) { + request->subscriptionAcknowledgements[i].sequenceNumber = ack->subAck.sequenceNumber; + request->subscriptionAcknowledgements[i].subscriptionId = ack->subAck.subscriptionId; + ++i; + LIST_REMOVE(ack, listEntry); + UA_free(ack); + } + return UA_STATUSCODE_GOOD; +} + +/* According to OPC Unified Architecture, Part 4 5.13.1.1 i) */ +/* The value 0 is never used for the sequence number */ +static UA_UInt32 +UA_Client_Subscriptions_nextSequenceNumber(UA_UInt32 sequenceNumber) { + UA_UInt32 nextSequenceNumber = sequenceNumber + 1; + if(nextSequenceNumber == 0) + nextSequenceNumber = 1; + return nextSequenceNumber; +} + +static void +processDataChangeNotification(UA_Client *client, UA_Client_Subscription *sub, + UA_DataChangeNotification *dataChangeNotification) { + for(size_t j = 0; j < dataChangeNotification->monitoredItemsSize; ++j) { + UA_MonitoredItemNotification *min = &dataChangeNotification->monitoredItems[j]; + + /* Find the MonitoredItem */ + UA_Client_MonitoredItem *mon; + LIST_FOREACH(mon, &sub->monitoredItems, listEntry) { + if(mon->clientHandle == min->clientHandle) + break; + } + + if(!mon) { + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Could not process a notification with clienthandle %" PRIu32 + " on subscription %" PRIu32, min->clientHandle, sub->subscriptionId); + continue; + } + + if(mon->isEventMonitoredItem) { + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "MonitoredItem is configured for Events. But received a " + "DataChangeNotification."); + continue; + } + + mon->handler.dataChangeCallback(client, sub->subscriptionId, sub->context, + mon->monitoredItemId, mon->context, + &min->value); + } +} + +static void +processEventNotification(UA_Client *client, UA_Client_Subscription *sub, + UA_EventNotificationList *eventNotificationList) { + for(size_t j = 0; j < eventNotificationList->eventsSize; ++j) { + UA_EventFieldList *eventFieldList = &eventNotificationList->events[j]; + + /* Find the MonitoredItem */ + UA_Client_MonitoredItem *mon; + LIST_FOREACH(mon, &sub->monitoredItems, listEntry) { + if(mon->clientHandle == eventFieldList->clientHandle) + break; + } + + if(!mon) { + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Could not process a notification with clienthandle %" PRIu32 + " on subscription %" PRIu32, eventFieldList->clientHandle, + sub->subscriptionId); + continue; + } + + if(!mon->isEventMonitoredItem) { + UA_LOG_DEBUG(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "MonitoredItem is configured for DataChanges. But received a " + "EventNotification."); + continue; + } + + mon->handler.eventCallback(client, sub->subscriptionId, sub->context, + mon->monitoredItemId, mon->context, + eventFieldList->eventFieldsSize, + eventFieldList->eventFields); + } +} + +static void +processNotificationMessage(UA_Client *client, UA_Client_Subscription *sub, + UA_ExtensionObject *msg) { + if(msg->encoding != UA_EXTENSIONOBJECT_DECODED) + return; + + /* Handle DataChangeNotification */ + if(msg->content.decoded.type == &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]) { + UA_DataChangeNotification *dataChangeNotification = + (UA_DataChangeNotification *)msg->content.decoded.data; + processDataChangeNotification(client, sub, dataChangeNotification); + return; + } + + /* Handle EventNotification */ + if(msg->content.decoded.type == &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]) { + UA_EventNotificationList *eventNotificationList = + (UA_EventNotificationList *)msg->content.decoded.data; + processEventNotification(client, sub, eventNotificationList); + return; + } + + /* Handle StatusChangeNotification */ + if(msg->content.decoded.type == &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]) { + if(sub->statusChangeCallback) { + sub->statusChangeCallback(client, sub->subscriptionId, sub->context, + (UA_StatusChangeNotification*)msg->content.decoded.data); + } else { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Dropped a StatusChangeNotification since no callback is registered"); + } + return; + } + + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Unknown notification message type"); +} + +static void +UA_Client_Subscriptions_processPublishResponse(UA_Client *client, UA_PublishRequest *request, + UA_PublishResponse *response) { + UA_NotificationMessage *msg = &response->notificationMessage; + + client->currentlyOutStandingPublishRequests--; + + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS) { + if(client->config.outStandingPublishRequests > 1) { + client->config.outStandingPublishRequests--; + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Too many publishrequest, reduce outStandingPublishRequests to %" PRId16, + client->config.outStandingPublishRequests); + } else { + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Too many publishrequest when outStandingPublishRequests = 1"); + UA_Client_Subscriptions_deleteSingle(client, response->subscriptionId); + } + return; + } + + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADSHUTDOWN) + return; + + if(!LIST_FIRST(&client->subscriptions)) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOSUBSCRIPTION; + return; + } + + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADSESSIONCLOSED) { + if(client->sessionState != UA_SESSIONSTATE_ACTIVATED) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received Publish Response with code %s", + UA_StatusCode_name(response->responseHeader.serviceResult)); + UA_Client_Subscription* sub = findSubscription(client, response->subscriptionId); + if (sub != NULL) + UA_Client_Subscription_deleteInternal(client, sub); + } + return; + } + + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADSESSIONIDINVALID) { + UA_Client_disconnect(client); /* TODO: This should be handled before the process callback */ + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received BadSessionIdInvalid"); + return; + } + + if(response->responseHeader.serviceResult == UA_STATUSCODE_BADTIMEOUT) { + if (client->config.inactivityCallback) + client->config.inactivityCallback(client); + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received Timeout for Publish Response"); + return; + } + + if(response->responseHeader.serviceResult != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received Publish Response with code %s", + UA_StatusCode_name(response->responseHeader.serviceResult)); + return; + } + + UA_Client_Subscription *sub = findSubscription(client, response->subscriptionId); + if(!sub) { + response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Received Publish Response for a non-existant subscription"); + return; + } + + sub->lastActivity = UA_DateTime_nowMonotonic(); + + /* Detect missing message - OPC Unified Architecture, Part 4 5.13.1.1 e) */ + if(UA_Client_Subscriptions_nextSequenceNumber(sub->sequenceNumber) != msg->sequenceNumber) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Invalid subscription sequence number: expected %" PRIu32 " but got %" PRIu32, + UA_Client_Subscriptions_nextSequenceNumber(sub->sequenceNumber), + msg->sequenceNumber); + /* This is an error. But we do not abort the connection. Some server + * SDKs misbehave from time to time and send out-of-order sequence + * numbers. (Probably some multi-threading synchronization issue.) */ + /* UA_Client_disconnect(client); + return; */ + } + /* According to f), a keep-alive message contains no notifications and has the sequence number + * of the next NotificationMessage that is to be sent => More than one consecutive keep-alive + * message or a NotificationMessage following a keep-alive message will share the same sequence + * number. */ + if (msg->notificationDataSize) + sub->sequenceNumber = msg->sequenceNumber; + + /* Process the notification messages */ + for(size_t k = 0; k < msg->notificationDataSize; ++k) + processNotificationMessage(client, sub, &msg->notificationData[k]); + + /* Add to the list of pending acks */ + for(size_t i = 0; i < response->availableSequenceNumbersSize; i++) { + if(response->availableSequenceNumbers[i] != msg->sequenceNumber) + continue; + UA_Client_NotificationsAckNumber *tmpAck = (UA_Client_NotificationsAckNumber*) + UA_malloc(sizeof(UA_Client_NotificationsAckNumber)); + if(!tmpAck) { + UA_LOG_WARNING(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Not enough memory to store the acknowledgement for a publish " + "message on subscription %" PRIu32, sub->subscriptionId); + break; + } + tmpAck->subAck.sequenceNumber = msg->sequenceNumber; + tmpAck->subAck.subscriptionId = sub->subscriptionId; + LIST_INSERT_HEAD(&client->pendingNotificationsAcks, tmpAck, listEntry); + break; + } +} + +static void +processPublishResponseAsync(UA_Client *client, void *userdata, UA_UInt32 requestId, + void *response) { + UA_PublishRequest *req = (UA_PublishRequest*)userdata; + UA_PublishResponse *res = (UA_PublishResponse*)response; + + /* Process the response */ + UA_Client_Subscriptions_processPublishResponse(client, req, res); + + /* Delete the cached request */ + UA_PublishRequest_delete(req); + + /* Fill up the outstanding publish requests */ + UA_Client_Subscriptions_backgroundPublish(client); +} + +void +UA_Client_Subscriptions_clean(UA_Client *client) { + UA_Client_NotificationsAckNumber *n, *tmp; + LIST_FOREACH_SAFE(n, &client->pendingNotificationsAcks, listEntry, tmp) { + LIST_REMOVE(n, listEntry); + UA_free(n); + } + + UA_Client_Subscription *sub, *tmps; + LIST_FOREACH_SAFE(sub, &client->subscriptions, listEntry, tmps) + UA_Client_Subscription_deleteInternal(client, sub); /* force local removal */ + + client->monitoredItemHandles = 0; +} + +void +UA_Client_Subscriptions_backgroundPublishInactivityCheck(UA_Client *client) { + if(client->sessionState < UA_SESSIONSTATE_ACTIVATED) + return; + + /* Is the lack of responses the client's fault? */ + if(client->currentlyOutStandingPublishRequests == 0) + return; + + UA_Client_Subscription *sub; + LIST_FOREACH(sub, &client->subscriptions, listEntry) { + UA_DateTime maxSilence = (UA_DateTime) + ((sub->publishingInterval * sub->maxKeepAliveCount) + + client->config.timeout) * UA_DATETIME_MSEC; + if(maxSilence + sub->lastActivity < UA_DateTime_nowMonotonic()) { + /* Reset activity */ + sub->lastActivity = UA_DateTime_nowMonotonic(); + + if(client->config.subscriptionInactivityCallback) + client->config.subscriptionInactivityCallback(client, sub->subscriptionId, + sub->context); + UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_CLIENT, + "Inactivity for Subscription %" PRIu32 ".", sub->subscriptionId); + } + } +} + +void +UA_Client_Subscriptions_backgroundPublish(UA_Client *client) { + if(client->sessionState < UA_SESSIONSTATE_ACTIVATED) + return; + + /* The session must have at least one subscription */ + if(!LIST_FIRST(&client->subscriptions)) + return; + + while(client->currentlyOutStandingPublishRequests < client->config.outStandingPublishRequests) { + UA_PublishRequest *request = UA_PublishRequest_new(); + if(!request) + return; + + request->requestHeader.timeoutHint=60000; + UA_StatusCode retval = UA_Client_preparePublishRequest(client, request); + if(retval != UA_STATUSCODE_GOOD) { + UA_PublishRequest_delete(request); + return; + } + + UA_UInt32 requestId; + client->currentlyOutStandingPublishRequests++; + + /* Disable the timeout, it is treat in + * UA_Client_Subscriptions_backgroundPublishInactivityCheck */ + retval = __UA_Client_AsyncServiceEx(client, request, &UA_TYPES[UA_TYPES_PUBLISHREQUEST], + processPublishResponseAsync, + &UA_TYPES[UA_TYPES_PUBLISHRESPONSE], + (void*)request, &requestId, 0); + if(retval != UA_STATUSCODE_GOOD) { + UA_PublishRequest_delete(request); + return; + } + } +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/libc_time.c" ***********************************/ + +/* Originally released by the musl project (http://www.musl-libc.org/) under the + * MIT license. Taken from the file /src/time/__secs_to_tm.c */ + +#include <limits.h> + +/* 2000-03-01 (mod 400 year, immediately after feb29 */ +#define LEAPOCH (946684800LL + 86400*(31+29)) + +#define DAYS_PER_400Y (365*400 + 97) +#define DAYS_PER_100Y (365*100 + 24) +#define DAYS_PER_4Y (365*4 + 1) + +int __secs_to_tm(long long t, struct mytm *tm) { + long long days, secs, years; + int remdays, remsecs, remyears; + int qc_cycles, c_cycles, q_cycles; + int months; + static const char days_in_month[] = {31,30,31,30,31,31,30,31,30,31,31,29}; + + /* Reject time_t values whose year would overflow int */ + if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL) + return -1; + + secs = t - LEAPOCH; + days = secs / 86400LL; + remsecs = (int)(secs % 86400); + if (remsecs < 0) { + remsecs += 86400; + --days; + } + + qc_cycles = (int)(days / DAYS_PER_400Y); + remdays = (int)(days % DAYS_PER_400Y); + if (remdays < 0) { + remdays += DAYS_PER_400Y; + --qc_cycles; + } + + c_cycles = remdays / DAYS_PER_100Y; + if (c_cycles == 4) --c_cycles; + remdays -= c_cycles * DAYS_PER_100Y; + + q_cycles = remdays / DAYS_PER_4Y; + if (q_cycles == 25) --q_cycles; + remdays -= q_cycles * DAYS_PER_4Y; + + remyears = remdays / 365; + if (remyears == 4) --remyears; + remdays -= remyears * 365; + + years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles; + + for (months=0; days_in_month[months] <= remdays; ++months) + remdays -= days_in_month[months]; + + if (years+100 > INT_MAX || years+100 < INT_MIN) + return -1; + + tm->tm_year = (int)(years + 100); + tm->tm_mon = months + 2; + if (tm->tm_mon >= 12) { + tm->tm_mon -=12; + ++tm->tm_year; + } + tm->tm_mday = remdays + 1; + tm->tm_hour = remsecs / 3600; + tm->tm_min = remsecs / 60 % 60; + tm->tm_sec = remsecs % 60; + + return 0; +} + +static const int secs_through_month[] = + {0, 31*86400, 59*86400, 90*86400, + 120*86400, 151*86400, 181*86400, 212*86400, + 243*86400, 273*86400, 304*86400, 334*86400 }; + +static int +__month_to_secs(int month, int is_leap) { + int t = secs_through_month[month]; + if (is_leap && month >= 2) + t+=86400; + return t; +} + +static long long +__year_to_secs(const long long year, int *is_leap) { + int cycles, centuries, leaps, rem; + int is_leap_val = 0; + if (!is_leap) { + is_leap = &is_leap_val; + } + cycles = (int)((year-100) / 400); + rem = (int)((year-100) % 400); + if (rem < 0) { + cycles--; + rem += 400; + } + if (!rem) { + *is_leap = 1; + centuries = 0; + leaps = 0; + } else { + if (rem >= 200) { + if (rem >= 300) centuries = 3, rem -= 300; + else centuries = 2, rem -= 200; + } else { + if (rem >= 100) centuries = 1, rem -= 100; + else centuries = 0; + } + if (!rem) { + *is_leap = 0; + leaps = 0; + } else { + leaps = (rem / (int)4U); + rem %= (int)4U; + *is_leap = !rem; + } + } + + leaps += 97*cycles + 24*centuries - *is_leap; + + return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400; +} + +long long __tm_to_secs(const struct mytm *tm) { + int is_leap; + long long year = tm->tm_year; + int month = tm->tm_mon; + if (month >= 12 || month < 0) { + int adj = month / 12; + month %= 12; + if (month < 0) { + adj--; + month += 12; + } + year += adj; + } + long long t = __year_to_secs(year, &is_leap); + t += __month_to_secs(month, is_leap); + t += 86400LL * (tm->tm_mday-1); + t += 3600LL * tm->tm_hour; + t += 60LL * tm->tm_min; + t += tm->tm_sec; + return t; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/pcg_basic.c" ***********************************/ + +/* + * PCG Random Number Generation for C. + * + * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For additional information about the PCG random number generation scheme, + * including its license and other licensing options, visit + * + * http://www.pcg-random.org + */ + + +void pcg32_srandom_r(pcg32_random_t* rng, uint64_t initial_state, uint64_t initseq) { + rng->state = 0U; + rng->inc = (initseq << 1u) | 1u; + pcg32_random_r(rng); + rng->state += initial_state; + pcg32_random_r(rng); +} + +uint32_t pcg32_random_r(pcg32_random_t* rng) { + uint64_t oldstate = rng->state; + rng->state = oldstate * 6364136223846793005ULL + rng->inc; + uint32_t xorshifted = (uint32_t)(((oldstate >> 18u) ^ oldstate) >> 27u); + uint32_t rot = (uint32_t)(oldstate >> 59u); + return (xorshifted >> rot) | (xorshifted << ((~rot + 1u) & 31)); /* was (xorshifted >> rot) | (xorshifted << ((-rot) & 31)) */ +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/base64.c" ***********************************/ + +/* + * Base64 encoding: Copyright (c) 2005-2011, Jouni Malinen <j@w1.fi> + * This software may be distributed under the terms of the BSD license. + * + * Base64 decoding: Copyright (c) 2016, polfosol + * Posted at https://stackoverflow.com/a/37109258 under the CC-BY-SA Creative + * Commons license. + */ + + +static const unsigned char base64_table[65] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +unsigned char * +UA_base64(const unsigned char *src, size_t len, size_t *out_len) { + if(len == 0) { + *out_len = 0; + return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL; + } + + size_t olen = 4*((len + 2) / 3); /* 3-byte blocks to 4-byte */ + if(olen < len) + return NULL; /* integer overflow */ + + unsigned char *out = (unsigned char*)UA_malloc(olen); + if(!out) + return NULL; + + const unsigned char *end = src + len; + const unsigned char *in = src; + unsigned char *pos = out; + while(end - in >= 3) { + *pos++ = base64_table[in[0] >> 2]; + *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)]; + *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)]; + *pos++ = base64_table[in[2] & 0x3f]; + in += 3; + } + + if(end - in) { + *pos++ = base64_table[in[0] >> 2]; + if(end - in == 1) { + *pos++ = base64_table[(in[0] & 0x03) << 4]; + *pos++ = '='; + } else { + *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)]; + *pos++ = base64_table[(in[1] & 0x0f) << 2]; + } + *pos++ = '='; + } + + *out_len = (size_t)(pos - out); + return out; +} + +static const uint32_t from_b64[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 63, 62, 62, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, + 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51}; + +unsigned char * +UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) { + // we need a minimum length + if(len <= 2) { + *out_len = 0; + return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL; + } + + const unsigned char *p = src; + size_t pad1 = len % 4 || p[len - 1] == '='; + size_t pad2 = pad1 && (len % 4 > 2 || p[len - 2] != '='); + const size_t last = (len - pad1) / 4 << 2; + + unsigned char *str = (unsigned char*)UA_malloc(last / 4 * 3 + pad1 + pad2); + if(!str) + return NULL; + + unsigned char *pos = str; + for(size_t i = 0; i < last; i += 4) { + uint32_t n = from_b64[p[i]] << 18 | from_b64[p[i + 1]] << 12 | + from_b64[p[i + 2]] << 6 | from_b64[p[i + 3]]; + *pos++ = (unsigned char)(n >> 16); + *pos++ = (unsigned char)(n >> 8 & 0xFF); + *pos++ = (unsigned char)(n & 0xFF); + } + + if(pad1) { + if (last + 1 >= len) { + UA_free(str); + *out_len = 0; + return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL; + } + uint32_t n = from_b64[p[last]] << 18 | from_b64[p[last + 1]] << 12; + *pos++ = (unsigned char)(n >> 16); + if(pad2) { + if (last + 2 >= len) { + UA_free(str); + *out_len = 0; + return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL; + } + n |= from_b64[p[last + 2]] << 6; + *pos++ = (unsigned char)(n >> 8 & 0xFF); + } + } + + *out_len = (uintptr_t)(pos - str); + return str; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/aa_tree.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + +#include <stddef.h> + +#if !defined(_MSC_VER) || _MSC_VER >= 1800 +# include <inttypes.h> +#elif !defined(uintptr_t) + /* Workaround missing standard includes in older Visual Studio */ +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +typedef _W64 unsigned int uintptr_t; +# else +typedef unsigned __int64 uintptr_t; +# endif +#endif + +#define aa_entry_container(head, entry) \ + ((void*)((uintptr_t)entry - head->entry_offset)) +#define aa_entry_key(head, entry) \ + ((const void*)((uintptr_t)entry + head->key_offset - head->entry_offset)) +#define aa_container_entry(head, container) \ + ((struct aa_entry*)((uintptr_t)container + head->entry_offset)) +#define aa_container_key(head, container) \ + ((const void*)((uintptr_t)container + head->key_offset)) + +void +aa_init(struct aa_head *head, + enum aa_cmp (*cmp)(const void*, const void*), + unsigned int entry_offset, unsigned int key_offset) { + head->root = NULL; + head->cmp = cmp; + head->entry_offset = entry_offset; + head->key_offset = key_offset; +} + +static struct aa_entry * +_aa_skew(struct aa_entry *n) { + if(!n) + return NULL; + if(n->left && n->level == n->left->level) { + struct aa_entry *l = n->left; + n->left = l->right; + l->right = n; + return l; + } + return n; +} + +static struct aa_entry * +_aa_split(struct aa_entry *n) { + if(!n) + return NULL; + if(n->right && n->right->right && + n->right->right->level == n->level) { + struct aa_entry *r = n->right; + n->right = r->left; + r->left = n; + r->level++; + return r; + } + return n; +} + +static struct aa_entry * +_aa_fixup(struct aa_entry *n) { + unsigned int should_be = 0; + if(n->left) + should_be = n->left->level; + if(n->right && n->right->level < should_be) + should_be = n->right->level; + should_be++; + if(should_be < n->level) + n->level = should_be; + if(n->right && n->right->level > should_be) + n->right->level = should_be; + n = _aa_skew(n); + n->right = _aa_skew(n->right); + if(n->right) + n->right->right = _aa_skew(n->right->right); + n = _aa_split(n); + n->right = _aa_split(n->right); + return n; +} + +static struct aa_entry * +_aa_insert(struct aa_head *h, struct aa_entry *n, void *elem) { + if(!n) { + struct aa_entry *e = aa_container_entry(h, elem); + e->left = NULL; + e->right = NULL; + e->level = 1; + return e; + } + const void *n_key = aa_entry_key(h, n); + const void *key = aa_container_key(h, elem); + enum aa_cmp eq = h->cmp(key, n_key); + if(eq == AA_CMP_EQ) + eq = (key > n_key) ? AA_CMP_MORE : AA_CMP_LESS; + if(eq == AA_CMP_LESS) + n->left = _aa_insert(h, n->left, elem); + else + n->right = _aa_insert(h, n->right, elem); + return _aa_split(_aa_skew(n)); +} + +void +aa_insert(struct aa_head *h, void *elem) { + h->root = _aa_insert(h, h->root, elem); +} + +static struct aa_entry * +_aa_find(const struct aa_head *h, struct aa_entry *n, const void *key) { + if(!n) + return NULL; + enum aa_cmp eq = h->cmp(key, aa_entry_key(h, n)); + if(eq == AA_CMP_EQ) + return n; + if(eq == AA_CMP_LESS) + return _aa_find(h, n->left, key); + return _aa_find(h, n->right, key); +} + +void * +aa_find(const struct aa_head *h, const void *key) { + struct aa_entry *n = _aa_find(h, h->root, key); + if(!n) + return NULL; + return aa_entry_container(h, n); +} + +static struct aa_entry * +unlink_succ(struct aa_entry *n, struct aa_entry **succ) { + if(!n->left) { + *succ = n; + return n->right; + } + n->left = unlink_succ(n->left, succ); + return _aa_fixup(n); +} + +static struct aa_entry * +unlink_pred(struct aa_entry *n, struct aa_entry **pred) { + if(!n->right) { + *pred = n; + return n->left; + } + n->right = unlink_pred(n->right, pred); + return _aa_fixup(n); +} + +static struct aa_entry * +_aa_remove(struct aa_head *h, struct aa_entry *n, void *elem) { + if(!n) + return NULL; + const void *n_key = aa_entry_key(h, n); + const void *key = aa_container_key(h, elem); + if(n_key != key) { + enum aa_cmp eq = h->cmp(key, n_key); + if(eq == AA_CMP_EQ) + eq = (key > n_key) ? AA_CMP_MORE : AA_CMP_LESS; + if(eq == AA_CMP_LESS) + n->left = _aa_remove(h, n->left, elem); + else + n->right = _aa_remove(h, n->right, elem); + } else { + if(!n->left && !n->right) + return NULL; + struct aa_entry *replace = NULL; + if(!n->left) + n->right = unlink_succ(n->right, &replace); + else + n->left = unlink_pred(n->left, &replace); + replace->left = n->left; + replace->right = n->right; + replace->level = n->level; + n = replace; + } + return _aa_fixup(n); +} + +void +aa_remove(struct aa_head *head, void *elem) { + head->root = _aa_remove(head, head->root, elem); +} + +void * +aa_min(const struct aa_head *head) { + struct aa_entry *e = head->root; + if(!e) + return NULL; + while(e->left) + e = e->left; + return aa_entry_container(head, e); +} + +void * +aa_max(const struct aa_head *head) { + struct aa_entry *e = head->root; + if(!e) + return NULL; + while(e->right) + e = e->right; + return aa_entry_container(head, e); +} + +void * +aa_next(const struct aa_head *head, const void *elem) { + struct aa_entry *e = aa_container_entry(head, elem); + if(e->right) { + e = e->right; + while(e->left) + e = e->left; + return aa_entry_container(head, e); + } + struct aa_entry *next = NULL; + struct aa_entry *n = head->root; + const void *key = aa_container_key(head, elem); + while(n && n != e) { + const void *n_key = aa_entry_key(head, n); + enum aa_cmp eq = head->cmp(key, n_key); + if(eq == AA_CMP_EQ) + eq = (key > n_key) ? AA_CMP_MORE : AA_CMP_LESS; + if(eq == AA_CMP_MORE) { + n = n->right; + } else { + next = n; + n = n->left; + } + } + return (next) ? aa_entry_container(head, next) : NULL; +} + +void * +aa_prev(const struct aa_head *head, const void *elem) { + struct aa_entry *e = aa_container_entry(head, elem); + if(e->left) { + e = e->left; + while(e->right) + e = e->right; + return aa_entry_container(head, e); + } + struct aa_entry *prev = NULL; + struct aa_entry *n = head->root; + const void *key = aa_container_key(head, elem); + while(n && n != e) { + const void *n_key = aa_entry_key(head, n); + enum aa_cmp eq = head->cmp(key, n_key); + if(eq == AA_CMP_EQ) + eq = (key > n_key) ? AA_CMP_MORE : AA_CMP_LESS; + if(eq == AA_CMP_MORE) { + prev = n; + n = n->right; + } else { + n = n->left; + } + } + return (prev) ? aa_entry_container(head, prev) : NULL; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/pubsub/ua_pubsub_config.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2020 Yannick Wallerer, Siemens AG + * Copyright (c) 2020 Thomas Fischer, Siemens AG + */ + + +#ifdef UA_ENABLE_PUBSUB +#ifdef UA_ENABLE_PUBSUB_ETH_UADP +#endif +#endif + + + + +#ifdef UA_ENABLE_PUBSUB_FILE_CONFIG + +/* Function prototypes: */ + +static UA_StatusCode +UA_PubSubManager_createPubSubConnection(UA_Server *server, const UA_PubSubConnectionDataType *const connectionParameters, + const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent); + +static UA_StatusCode +UA_PubSubManager_createWriterGroup(UA_Server *server, const UA_WriterGroupDataType *const writerGroupParameters, + const UA_NodeId connectionIdent, const UA_UInt32 pdsCount, + const UA_NodeId *pdsIdent); + +static UA_StatusCode +UA_PubSubManager_createDataSetWriter(UA_Server *server, const UA_DataSetWriterDataType *const dataSetWriterParameters, + const UA_NodeId writerGroupIdent, const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent); + +static UA_StatusCode +UA_PubSubManager_createReaderGroup(UA_Server *server, const UA_ReaderGroupDataType *const readerGroupParameters, + const UA_NodeId connectionIdent); + +static UA_StatusCode +UA_PubSubManager_createDataSetReader(UA_Server *server, const UA_DataSetReaderDataType *const dataSetReaderParameters, + const UA_NodeId readerGroupIdent); + +static UA_StatusCode +UA_PubSubManager_createPublishedDataSet(UA_Server *server, const UA_PublishedDataSetDataType *const publishedDataSetParameters, + UA_NodeId *publishedDataSetIdent); + +static UA_StatusCode +UA_PubSubManager_createDataSetFields(UA_Server *server, const UA_NodeId *const publishedDataSetIdent, + const UA_PublishedDataSetDataType *const publishedDataSetParameters); + +static UA_StatusCode +UA_PubSubManager_generatePubSubConfigurationDataType(const UA_Server *server, + UA_PubSubConfigurationDataType *pubSubConfiguration); + +/* Function implementations: */ + +/* UA_PubSubManager_extractPubSubConfigFromDecodedObject() */ +/** + * @brief gets PubSub Configuration from an encoded ByteString + * + * @param src [in] Decoded source object of type ExtensionObject + * @param dst [out] Pointer on PubSub Configuration + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_extractPubSubConfigFromDecodedObject(const UA_ExtensionObject *const src, UA_PubSubConfigurationDataType **dst) { + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + + *dst = NULL; + UA_UABinaryFileDataType *binFile; + if((src->encoding == UA_EXTENSIONOBJECT_DECODED) && + UA_NodeId_equal(&src->content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_UABINARYFILEDATATYPE].typeId)) { + binFile = (UA_UABinaryFileDataType*)src->content.decoded.data; + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_extractPubSubConfigFromDecodedObject] Reading extensionObject failed"); + statusCode = UA_STATUSCODE_BADINVALIDARGUMENT; + goto cleanup; + } + + if(binFile->body.arrayLength != 0 || binFile->body.arrayDimensionsSize != 0) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_extractPubSubConfigFromDecodedObject] Loading multiple configurations is not supported"); + statusCode = UA_STATUSCODE_BADNOTIMPLEMENTED; + goto cleanup; + } + + if(UA_NodeId_equal(&binFile->body.type->typeId, &UA_TYPES[UA_TYPES_PUBSUBCONFIGURATIONDATATYPE].typeId)) { + *dst = (UA_PubSubConfigurationDataType*)binFile->body.data; + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_extractPubSubConfigFromDecodedObject] Invalid datatype encoded in the binary file"); + statusCode = UA_STATUSCODE_BADTYPEMISMATCH; + goto cleanup; + } + +cleanup: + + return statusCode; +} + +/* UA_PubSubManager_updatePubSubConfig() */ +/** + * @brief Configures a PubSub Server with given PubSubConfigurationDataType object + * + * @param server [bi] Server object + * @param configurationParameters [in] PubSub Configuration parameters + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_updatePubSubConfig(UA_Server* server, const UA_PubSubConfigurationDataType *const configurationParameters) { + if(server == NULL || configurationParameters == NULL) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_updatePubSubConfig] Invalid argument"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_PubSubManager_delete(server, &(server->pubSubManager)); + + /* Configuration of Published DataSets: */ + UA_UInt32 pdsCount = (UA_UInt32)configurationParameters->publishedDataSetsSize; + UA_NodeId *publishedDataSetIdent = (UA_NodeId*)UA_calloc(pdsCount, sizeof(UA_NodeId)); + if(publishedDataSetIdent == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + for(UA_UInt32 pdsIndex = 0; pdsIndex < pdsCount; pdsIndex++) { + statusCode = UA_PubSubManager_createPublishedDataSet(server, &configurationParameters->publishedDataSets[pdsIndex], + &publishedDataSetIdent[pdsIndex]); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_updatePubSubConfig] PDS creation failed"); + UA_free(publishedDataSetIdent); + return statusCode; + } + } + + /* Configuration of PubSub Connections: */ + if(configurationParameters->connectionsSize < 1) { + UA_LOG_WARNING(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_updatePubSubConfig] no connection in UA_PubSubConfigurationDataType"); + UA_free(publishedDataSetIdent); + return UA_STATUSCODE_GOOD; + } + + for(UA_UInt32 conIndex = 0; + conIndex < configurationParameters->connectionsSize && statusCode == UA_STATUSCODE_GOOD; + conIndex++) + { + statusCode = UA_PubSubManager_createPubSubConnection(server, &configurationParameters->connections[conIndex], + pdsCount, publishedDataSetIdent); + } + + UA_free(publishedDataSetIdent); + return statusCode; +} + +/* UA_PubSubManager_setConnectionPublisherId() */ +/** + * @brief Function called by UA_PubSubManager_createPubSubConnection to set the PublisherId of a certain connection. + * + * @param src [in] PubSubConnection parameters + * @param dst [out] PubSubConfiguration + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_setConnectionPublisherId(const UA_PubSubConnectionDataType *src, UA_PubSubConnectionConfig *dst) { + if(UA_NodeId_equal(&src->publisherId.type->typeId, &UA_TYPES[UA_TYPES_STRING].typeId)) { + dst->publisherIdType = UA_PUBSUB_PUBLISHERID_STRING; + dst->publisherId.string = *(UA_String*)src->publisherId.data; + } else if(UA_NodeId_equal(&src->publisherId.type->typeId, &UA_TYPES[UA_TYPES_BYTE].typeId) || + UA_NodeId_equal(&src->publisherId.type->typeId, &UA_TYPES[UA_TYPES_UINT16].typeId) || + UA_NodeId_equal(&src->publisherId.type->typeId, &UA_TYPES[UA_TYPES_UINT32].typeId)) { + dst->publisherIdType = UA_PUBSUB_PUBLISHERID_NUMERIC; + dst->publisherId.numeric = *(UA_UInt32*)src->publisherId.data; + } else if(UA_NodeId_equal(&src->publisherId.type->typeId, &UA_TYPES[UA_TYPES_UINT64].typeId)) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setConnectionPublisherId] PublisherId is UInt64 (not implemented); Recommended dataType for PublisherId: UInt32"); + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_setConnectionPublisherId] PublisherId is not valid."); + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_createComponentsForConnection() */ +/** + * @brief Function called by UA_PubSubManager_createPubSubConnection to create all WriterGroups and ReaderGroups + * that belong to a certain connection. + * + * @param server [bi] + * @param connectionParameters [in] + * @param connectionIdent [in] + * @param pdsCount [in] + * @param pdsIdent [in] + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_createComponentsForConnection(UA_Server *server, const UA_PubSubConnectionDataType *const connectionParameters, + UA_NodeId connectionIdent, + const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + /* WriterGroups configuration */ + for(UA_UInt32 wGroupIndex=0; + wGroupIndex < connectionParameters->writerGroupsSize; + wGroupIndex++) + { + retVal = UA_PubSubManager_createWriterGroup(server, &connectionParameters->writerGroups[wGroupIndex], + connectionIdent, pdsCount, pdsIdent); + if(retVal == UA_STATUSCODE_GOOD) { + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createComponentsForConnection] Error occured during %d.WriterGroup Creation", wGroupIndex+1); + return retVal; + } + } + + /* ReaderGroups configuration */ + for(UA_UInt32 rGroupIndex=0; + rGroupIndex < connectionParameters->readerGroupsSize; + rGroupIndex++) + { + retVal = UA_PubSubManager_createReaderGroup(server, &connectionParameters->readerGroups[rGroupIndex], connectionIdent); + if(retVal == UA_STATUSCODE_GOOD) { + + retVal |= UA_PubSubConnection_regist(server, &connectionIdent); + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createComponentsForConnection] Error occured during %d.ReaderGroup Creation", rGroupIndex+1); + return retVal; + } + } + return retVal; +} + +/** + * @brief Checks if transportLayer for the specified transportProfileUri exists. + * + * @param server [bi] Server object that shall be configured + * @param transportProfileUri [in] String that specifies the transport protocol + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_Boolean +UA_PubSubManager_transportLayerExists(UA_Server *server, UA_String transportProfileUri) { + UA_Boolean tlExists= UA_FALSE; + for(UA_UInt32 tlIndex=0; tlIndex < server->config.pubsubTransportLayersSize; tlIndex++) { + if(UA_String_equal(&server->config.pubsubTransportLayers[tlIndex].transportProfileUri, &transportProfileUri)) { + tlExists = UA_TRUE; + break; + } + } + return tlExists; +} + +/** + * @brief Creates transportlayer for specified transport protocol if this layer doesn't exist yet. + * + * @param server [bi] Server object that shall be configured + * @param transportProfileUri [in] String that specifies the transport protocol + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_createTransportLayer(UA_Server *server, const UA_String transportProfileUri) { + if(UA_PubSubManager_transportLayerExists(server, transportProfileUri)) { + return UA_STATUSCODE_GOOD; + } + + UA_ServerConfig *config = UA_Server_getConfig(server); + UA_PubSubTransportLayer tl; + + do { + UA_String strUDP = UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"); + if(UA_String_equal(&transportProfileUri, &strUDP)) { + tl = UA_PubSubTransportLayerUDPMP(); + break; + } + + #ifdef UA_ENABLE_PUBSUB_ETH_UADP + UA_String strETH = UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-eth-uadp"); + if(UA_String_equal(&transportProfileUri, &strETH)) { + tl = UA_PubSubTransportLayerEthernet(); + break; + } + #endif + + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createTransportLayer] invalid transportProfileUri"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } while(0); + + if(config->pubsubTransportLayersSize > 0) { + config->pubsubTransportLayers = (UA_PubSubTransportLayer *) UA_realloc(config->pubsubTransportLayers, + (config->pubsubTransportLayersSize + 1) * sizeof(UA_PubSubTransportLayer)); + } else { + config->pubsubTransportLayers = (UA_PubSubTransportLayer *) UA_calloc(1, sizeof(UA_PubSubTransportLayer)); + } + + if(config->pubsubTransportLayers == NULL) { + UA_Server_delete(server); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + config->pubsubTransportLayers[config->pubsubTransportLayersSize] = tl; + config->pubsubTransportLayersSize++; + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_createPubSubConnection() */ +/** + * @brief Creates PubSubConnection configuration from PubSubConnectionDataType object + * + * @param server [bi] Server object that shall be configured + * @param connectionParameters [in] PubSub connection configuration + * @param pdsCount [in] Number of published DataSets + * @param pdsIdent [in] Array of NodeIds of the published DataSets + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_createPubSubConnection(UA_Server *server, const UA_PubSubConnectionDataType *const connectionParameters, + const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent) { + UA_PubSubConnectionConfig config; + memset(&config, 0, sizeof(UA_PubSubConnectionConfig)); + + config.name = connectionParameters->name; + config.enabled = connectionParameters->enabled; + config.transportProfileUri = connectionParameters->transportProfileUri; + config.connectionPropertiesSize = connectionParameters->connectionPropertiesSize; + if(config.connectionPropertiesSize > 0) { + config.connectionProperties = connectionParameters->connectionProperties; + } + + UA_StatusCode statusCode = UA_PubSubManager_setConnectionPublisherId(connectionParameters, &config); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createPubSubConnection] Setting PublisherId failed"); + return statusCode; + } + + if(connectionParameters->address.encoding == UA_EXTENSIONOBJECT_DECODED) { + UA_Variant_setScalar(&(config.address), + connectionParameters->address.content.decoded.data, + connectionParameters->address.content.decoded.type); + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createPubSubConnection] Reading connection address failed"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + if(connectionParameters->transportSettings.encoding == UA_EXTENSIONOBJECT_DECODED) { + UA_Variant_setScalar(&(config.connectionTransportSettings), + connectionParameters->transportSettings.content.decoded.data, + connectionParameters->transportSettings.content.decoded.type); + } else { + UA_LOG_WARNING(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createPubSubConnection] TransportSettings can not be read"); + } + + statusCode = UA_PubSubManager_createTransportLayer(server, connectionParameters->transportProfileUri); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createPubSubConnection] Creating transportLayer failed"); + return statusCode; + } + + /* Load connection config into server: */ + UA_NodeId connectionIdent; + statusCode = UA_Server_addPubSubConnection(server, &config, &connectionIdent); + if(statusCode == UA_STATUSCODE_GOOD) { + /* Configuration of all Components that belong to this connection: */ + statusCode = UA_PubSubManager_createComponentsForConnection(server, connectionParameters, connectionIdent, pdsCount, pdsIdent); + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createPubSubConnection] Connection creation failed"); + } + + return statusCode; +} + +/* UA_PubSubManager_setWriterGroupEncodingType() */ +/** + * @brief Function called by UA_PubSubManager_createWriterGroup to configure the messageSettings of a writerGroup. + * + * @param writerGroupParameters [in] + * @param config [bi] + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_setWriterGroupEncodingType(const UA_WriterGroupDataType *writerGroupParameters, + UA_WriterGroupConfig *config) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(writerGroupParameters->messageSettings.encoding == UA_EXTENSIONOBJECT_DECODED) { + if(UA_NodeId_equal(&writerGroupParameters->messageSettings.content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE].typeId)) { + config->encodingMimeType = UA_PUBSUB_ENCODING_UADP; + } else if(writerGroupParameters->messageSettings.content.decoded.type->typeId.identifier.numeric == + UA_NS0ID_JSONWRITERGROUPMESSAGEDATATYPE) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setWriterGroupEncodingType] encoding type: JSON (not implemented!)"); + retVal = UA_STATUSCODE_BADNOTIMPLEMENTED; + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setWriterGroupEncodingType] invalid message encoding type"); + retVal = UA_STATUSCODE_BADINVALIDARGUMENT; + } + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setWriterGroupEncodingType] getting message type information failed"); + retVal = UA_STATUSCODE_BADINVALIDARGUMENT; + } + return retVal; +} + +/* UA_PubSubManager_createWriterGroup() */ +/** + * @brief Creates WriterGroup configuration from WriterGroup object + * + * @param server [bi] Server object that shall be configured + * @param writerGroupParameters [in] WriterGroup configuration + * @param connectionIdent [in] NodeId of the PubSub connection, the WriterGroup belongs to + * @param pdsCount [in] Number of published DataSets + * @param pdsIdent [in] Array of NodeIds of the published DataSets + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_createWriterGroup(UA_Server *server, const UA_WriterGroupDataType *const writerGroupParameters, + const UA_NodeId connectionIdent, + const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent) { + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + UA_WriterGroupConfig config; + + memset(&config, 0, sizeof(UA_WriterGroupConfig)); + + config.name = writerGroupParameters->name; + config.enabled = writerGroupParameters->enabled; + config.writerGroupId = writerGroupParameters->writerGroupId; + config.publishingInterval = writerGroupParameters->publishingInterval; + config.keepAliveTime = writerGroupParameters->keepAliveTime; + config.priority = writerGroupParameters->priority; + config.securityMode = writerGroupParameters->securityMode; + + config.transportSettings = writerGroupParameters->transportSettings; + config.messageSettings = writerGroupParameters->messageSettings; + config.groupPropertiesSize = writerGroupParameters->groupPropertiesSize; + if(config.groupPropertiesSize > 0) { + config.groupProperties = writerGroupParameters->groupProperties; + } + + config.maxEncapsulatedDataSetMessageCount = 255; /* non std parameter */ + + statusCode = UA_PubSubManager_setWriterGroupEncodingType(writerGroupParameters, &config); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createWriterGroup] Setting message settings failed"); + return statusCode; + } + + /* Load config into server: */ + UA_NodeId writerGroupIdent; + statusCode = UA_Server_addWriterGroup(server, connectionIdent, &config, &writerGroupIdent); + UA_Server_setWriterGroupOperational(server, writerGroupIdent); + if(statusCode == UA_STATUSCODE_GOOD) { + /* Configuration of all DataSetWriters that belong to this WriterGroup */ + for(UA_UInt32 dsWriterIndex=0; + dsWriterIndex < writerGroupParameters->dataSetWritersSize && statusCode == UA_STATUSCODE_GOOD; + dsWriterIndex++) + { + statusCode = UA_PubSubManager_createDataSetWriter(server, &writerGroupParameters->dataSetWriters[dsWriterIndex], + writerGroupIdent, pdsCount, pdsIdent); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createWriterGroup] DataSetWriter Creation failed."); + } + } + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createWriterGroup] Adding WriterGroup to server failed: 0x%x", statusCode); + } + + return statusCode; +} + +/* UA_PubSubManager_addDataSetWriterWithPdsReference() */ +/** + * @brief Function called by UA_PubSubManager_createDataSetWriter. It searches for a PublishedDataSet that is referenced by + * the DataSetWriter. If a related PDS is found, the DSWriter will be added to the server, + * otherwise, no DSWriter will be added. + * + * @param server [bi] UA_Server object that shall be configured + * @param writerGroupIdent [in] NodeId of writerGroup, the DataSetWriter belongs to + * @param dsWriterConfig [in] WriterGroup configuration + * @param pdsCount [in] Number of published DataSets + * @param pdsIdent [in] Array of NodeIds of the published DataSets + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_addDataSetWriterWithPdsReference(UA_Server *server, const UA_NodeId writerGroupIdent, + const UA_DataSetWriterConfig *dsWriterConfig, + const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent) { + UA_NodeId dataSetWriterIdent; + UA_PublishedDataSetConfig pdsConfig; + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + UA_Boolean pdsFound = UA_FALSE; + + for(UA_UInt32 pdsIndex = 0; + pdsIndex < pdsCount && retVal == UA_STATUSCODE_GOOD; + pdsIndex++) + { + retVal = UA_Server_getPublishedDataSetConfig(server, pdsIdent[pdsIndex], &pdsConfig); + /* members of pdsConfig must be deleted manually */ + if(retVal == UA_STATUSCODE_GOOD) { + if(dsWriterConfig->dataSetName.length == pdsConfig.name.length && + 0 == strncmp((const char *)dsWriterConfig->dataSetName.data, (const char *)pdsConfig.name.data, + dsWriterConfig->dataSetName.length)) + { + /* DSWriter will only be created, if a matching PDS is found: */ + retVal = UA_Server_addDataSetWriter(server, writerGroupIdent, pdsIdent[pdsIndex], + dsWriterConfig, &dataSetWriterIdent); + if(retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_addDataSetWriterWithPdsReference] Adding DataSetWriter failed"); + } else { + pdsFound = UA_TRUE; + } + } + + UA_PublishedDataSetConfig_clear(&pdsConfig); + if(pdsFound) + break; /* break loop if corresponding publishedDataSet was found */ + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_addDataSetWriterWithPdsReference] Getting pdsConfig from NodeId failed."); + } + } + + if(!pdsFound) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_addDataSetWriterWithPdsReference] No matching DataSet found; no DataSetWriter created"); + } + + return retVal; +} + +/* UA_PubSubManager_createDataSetWriter() */ +/** + * @brief Creates DataSetWriter configuration from DataSetWriter object + * + * @param server [bi] UA_Server object that shall be configured + * @param dataSetWriterParameters [in] DataSetWriter Configuration + * @param writerGroupIdent [in] NodeId of writerGroup, the DataSetWriter belongs to + * @param pdsCount [in] Number of published DataSets + * @param pdsIdent [in] Array of NodeIds of the published DataSets + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_createDataSetWriter(UA_Server *server, const UA_DataSetWriterDataType *const dataSetWriterParameters, + const UA_NodeId writerGroupIdent, const UA_UInt32 pdsCount, const UA_NodeId *pdsIdent) { + UA_DataSetWriterConfig config; + memset(&config, 0, sizeof(UA_DataSetWriterConfig)); + + config.name = dataSetWriterParameters->name; + config.dataSetWriterId = dataSetWriterParameters->dataSetWriterId; + config.keyFrameCount = dataSetWriterParameters->keyFrameCount; + config.dataSetFieldContentMask = dataSetWriterParameters->dataSetFieldContentMask; + config.messageSettings = dataSetWriterParameters->messageSettings; + config.dataSetName = dataSetWriterParameters->dataSetName; + config.dataSetWriterPropertiesSize = dataSetWriterParameters->dataSetWriterPropertiesSize; + if(config.dataSetWriterPropertiesSize > 0) { + config.dataSetWriterProperties = dataSetWriterParameters->dataSetWriterProperties; + } + + UA_StatusCode statusCode = UA_PubSubManager_addDataSetWriterWithPdsReference(server, writerGroupIdent, + &config, pdsCount, pdsIdent); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createDataSetWriter] Referencing related PDS failed"); + } + + return statusCode; +} + +/* UA_PubSubManager_createReaderGroup() */ +/** + * @brief Creates ReaderGroup configuration from ReaderGroup object + * + * @param server [bi] UA_Server object that shall be configured + * @param readerGroupParameters [in] ReaderGroup configuration + * @param connectionIdent [in] NodeId of the PubSub connection, the ReaderGroup belongs to + * + * @return UA_StatusCode + */ +static UA_StatusCode +UA_PubSubManager_createReaderGroup(UA_Server *server, const UA_ReaderGroupDataType *const readerGroupParameters, + const UA_NodeId connectionIdent) { + UA_ReaderGroupConfig config; + + memset(&config, 0, sizeof(UA_ReaderGroupConfig)); + + config.name = readerGroupParameters->name; + config.securityParameters.securityMode = readerGroupParameters->securityMode; + + UA_NodeId readerGroupIdent; + + UA_StatusCode statusCode = UA_Server_addReaderGroup(server, connectionIdent, &config, &readerGroupIdent); + if(statusCode == UA_STATUSCODE_GOOD) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createReaderGroup] ReaderGroup successfully added."); + for(UA_UInt32 dsReaderIndex=0; + dsReaderIndex < readerGroupParameters->dataSetReadersSize && statusCode == UA_STATUSCODE_GOOD; + dsReaderIndex++) + { + statusCode = UA_PubSubManager_createDataSetReader(server, &readerGroupParameters->dataSetReaders[dsReaderIndex], readerGroupIdent); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createReaderGroup] Creating DataSetReader failed"); + } + } + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createReaderGroup] Adding ReaderGroup to server failed: 0x%x", statusCode); + } + + if(statusCode == UA_STATUSCODE_GOOD) + UA_Server_setReaderGroupOperational(server, readerGroupIdent); + + return statusCode; +} + + +/* UA_PubSubManager_addSubscribedDataSet() */ +/** + * @brief Creates TargetVariables or SubscribedDataSetMirror for a given DataSetReader + * + * @param server [bi] UA_Server object that shall be configured + * @param dsReaderIdent [in] NodeId of the DataSetReader the SubscribedDataSet belongs to + * @param dataSetReaderParameters [in] Configuration Parameters of the DataSetReader + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_addSubscribedDataSet(UA_Server *server, const UA_NodeId dsReaderIdent, + const UA_ExtensionObject *const subscribedDataSet) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + if(UA_NodeId_equal(&subscribedDataSet->content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_TARGETVARIABLESDATATYPE].typeId)) { + UA_TargetVariablesDataType *tmpTargetVars = + (UA_TargetVariablesDataType*)subscribedDataSet->content.decoded.data; + UA_FieldTargetVariable *targetVars = + (UA_FieldTargetVariable *)UA_calloc(tmpTargetVars->targetVariablesSize, sizeof(UA_FieldTargetVariable)); + memset(targetVars, 0, sizeof(UA_FieldTargetVariable)); + + for(size_t index = 0; index < tmpTargetVars->targetVariablesSize; index++) { + UA_FieldTargetDataType_copy(&tmpTargetVars->targetVariables[index] ,&targetVars[index].targetVariable); + } + + retVal = UA_Server_DataSetReader_createTargetVariables(server, dsReaderIdent, tmpTargetVars->targetVariablesSize, targetVars); + if(retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_addSubscribedDataSet] create TargetVariables failed"); + } + + for(size_t index = 0; index < tmpTargetVars->targetVariablesSize; index++) { + UA_FieldTargetDataType_clear(&targetVars[index].targetVariable); + } + + UA_free(targetVars); + return retVal; + } + + if(UA_NodeId_equal(&subscribedDataSet->content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_SUBSCRIBEDDATASETMIRRORDATATYPE].typeId)) { + + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_addSubscribedDataSet] DataSetMirror is currently not supported"); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_addSubscribedDataSet] Invalid Type of SubscribedDataSet"); + return UA_STATUSCODE_BADINTERNALERROR; +} + +/* UA_PubSubManager_createDataSetReader() */ +/** + * @brief Creates DataSetReader configuration from DataSetReader object + * + * @param server [bi] UA_Server object that shall be configured + * @param dataSetReaderParameters [in] DataSetReader configuration + * @param writerGroupIdent [in] NodeId of readerGroupParameters, the DataSetReader belongs to + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_createDataSetReader(UA_Server *server, const UA_DataSetReaderDataType *const dataSetReaderParameters, + const UA_NodeId readerGroupIdent) { + UA_DataSetReaderConfig config; + memset(&config, 0, sizeof(UA_DataSetReaderConfig)); + + config.name = dataSetReaderParameters->name; + config.publisherId = dataSetReaderParameters->publisherId; + config.writerGroupId = dataSetReaderParameters->writerGroupId; + config.dataSetWriterId = dataSetReaderParameters->dataSetWriterId; + config.dataSetMetaData = dataSetReaderParameters->dataSetMetaData; + config.dataSetFieldContentMask = dataSetReaderParameters->dataSetFieldContentMask; + config.messageReceiveTimeout = dataSetReaderParameters->messageReceiveTimeout; + config.messageSettings = dataSetReaderParameters->messageSettings; + + UA_NodeId dsReaderIdent; + UA_StatusCode statusCode = UA_Server_addDataSetReader (server, readerGroupIdent, &config, &dsReaderIdent); + if(statusCode == UA_STATUSCODE_GOOD) { + statusCode = UA_PubSubManager_addSubscribedDataSet(server, dsReaderIdent, &dataSetReaderParameters->subscribedDataSet); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createDataSetReader] create subscribedDataSet failed"); + } + } + + return statusCode; +} + +/* UA_PubSubManager_setPublishedDataSetType() */ +/** + * @brief Determines whether PublishedDataSet is of type PublishedItems or PublishedEvents. + * (PublishedEvents are currently not supported!) + * + * @param publishedDataSetParameters [in] PublishedDataSet parameters + * @param config [bi] PublishedDataSet configuration object + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_setPublishedDataSetType(const UA_PublishedDataSetDataType *const publishedDataSetParameters, + UA_PublishedDataSetConfig *config) { + if(publishedDataSetParameters->dataSetSource.encoding != UA_EXTENSIONOBJECT_DECODED) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + if(UA_NodeId_equal(&publishedDataSetParameters->dataSetSource.content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_PUBLISHEDDATAITEMSDATATYPE].typeId)) { + config->publishedDataSetType = UA_PUBSUB_DATASET_PUBLISHEDITEMS; + } else if(UA_NodeId_equal(&publishedDataSetParameters->dataSetSource.content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_PUBLISHEDEVENTSDATATYPE].typeId)) { + /* config.publishedDataSetType = UA_PUBSUB_DATASET_PUBLISHEDEVENTS; */ + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setPublishedDataSetType] Published events not supported."); + retVal = UA_STATUSCODE_BADNOTIMPLEMENTED; + } else { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_setPublishedDataSetType] Invalid DataSetSourceDataType."); + retVal = UA_STATUSCODE_BADINTERNALERROR; + } + + return retVal; +} + +/* UA_PubSubManager_createPublishedDataSet() */ +/** + * @brief Creates PublishedDataSetConfig object from PublishedDataSet object + * + * @param server [bi] UA_Server object that shall be configured + * @param publishedDataSetParameters [in] publishedDataSet configuration + * @param publishedDataSetIdent [out] NodeId of the publishedDataSet + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_createPublishedDataSet(UA_Server *server, const UA_PublishedDataSetDataType *const publishedDataSetParameters, + UA_NodeId *publishedDataSetIdent) { + UA_PublishedDataSetConfig config; + memset(&config, 0, sizeof(UA_PublishedDataSetConfig)); + + config.name = publishedDataSetParameters->name; + UA_StatusCode statusCode = UA_PubSubManager_setPublishedDataSetType(publishedDataSetParameters, &config); + if(statusCode != UA_STATUSCODE_GOOD) { + return statusCode; + } + + statusCode = UA_Server_addPublishedDataSet(server, &config, publishedDataSetIdent).addResult; + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createPublishedDataSet] Adding PublishedDataSet failed."); + return statusCode; + } + + /* DataSetField configuration for this publishedDataSet: */ + statusCode = UA_PubSubManager_createDataSetFields(server, publishedDataSetIdent, publishedDataSetParameters); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createPublishedDataSet] Creating DataSetFieldConfig failed."); + } + + return statusCode; +} + +/* UA_PubSubManager_addDataSetFieldVariables */ +/** + * @brief Adds DataSetField Variables bound to a certain PublishedDataSet. + * This method does NOT check, whether the PublishedDataSet actually contains Variables instead of Events! + * + * @param server [bi] UA_Server object that shall be configured + * @param publishedDataSetIdent [in] NodeId of the publishedDataSet, the DataSetField belongs to + * @param publishedDataSetParameters [in] publishedDataSet configuration + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_addDataSetFieldVariables(UA_Server *server, const UA_NodeId *publishedDataSetIdent, + const UA_PublishedDataSetDataType *const publishedDataSetParameters) { + UA_PublishedDataItemsDataType *publishedDataItems = + (UA_PublishedDataItemsDataType *)publishedDataSetParameters->dataSetSource.content.decoded.data; + if(publishedDataItems->publishedDataSize != publishedDataSetParameters->dataSetMetaData.fieldsSize){ + return UA_STATUSCODE_BADINTERNALERROR; + } + + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + for(UA_Int32 dsFieldIndex = 0; + dsFieldIndex < (UA_Int32)publishedDataItems->publishedDataSize && statusCode == UA_STATUSCODE_GOOD; + dsFieldIndex++) + { + UA_DataSetFieldConfig fieldConfig; + memset(&fieldConfig, 0, sizeof(UA_DataSetFieldConfig)); + fieldConfig.dataSetFieldType = UA_PUBSUB_DATASETFIELD_VARIABLE; + fieldConfig.field.variable.configurationVersion = publishedDataSetParameters->dataSetMetaData.configurationVersion; + fieldConfig.field.variable.fieldNameAlias = publishedDataSetParameters->dataSetMetaData.fields[dsFieldIndex].name; + fieldConfig.field.variable.promotedField = publishedDataSetParameters->dataSetMetaData. + fields[dsFieldIndex].fieldFlags & 0x0001; + fieldConfig.field.variable.publishParameters = publishedDataItems->publishedData[dsFieldIndex]; + + UA_NodeId fieldIdent; + statusCode = UA_Server_addDataSetField(server, *publishedDataSetIdent, &fieldConfig, &fieldIdent).result; + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_addDataSetFieldVariables] Adding DataSetField Variable failed."); + } + } + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_createDataSetFields() */ +/** + * @brief Checks if PublishedDataSet contains event or variable fields and calls the corresponding method + * to add these fields to the server. + * + * @param server [bi] UA_Server object that shall be configured + * @param publishedDataSetIdent [in] NodeId of the publishedDataSet, the DataSetFields belongs to + * @param publishedDataSetParameters [in] publishedDataSet configuration + * + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_createDataSetFields(UA_Server *server, const UA_NodeId *const publishedDataSetIdent, + const UA_PublishedDataSetDataType *const publishedDataSetParameters) { + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + + if(publishedDataSetParameters->dataSetSource.encoding != UA_EXTENSIONOBJECT_DECODED) { + statusCode = UA_STATUSCODE_BADINTERNALERROR; + goto cleanup; + } + + if(UA_NodeId_equal(&publishedDataSetParameters->dataSetSource.content.decoded.type->typeId, + &UA_TYPES[UA_TYPES_PUBLISHEDDATAITEMSDATATYPE].typeId)) { + statusCode = UA_PubSubManager_addDataSetFieldVariables(server, publishedDataSetIdent, publishedDataSetParameters); + goto cleanup; + } + + if(publishedDataSetParameters->dataSetSource.content.decoded.type->typeId.identifier.numeric == + UA_NS0ID_PUBLISHEDEVENTSDATATYPE) { + /* This is a placeholder; TODO: Implement Routine for adding Event DataSetFields */ + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_createDataSetFields] Published events not supported."); + statusCode = UA_STATUSCODE_BADNOTIMPLEMENTED; + goto cleanup; + } + + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_createDataSetFields] Invalid DataSetSourceDataType."); + statusCode = UA_STATUSCODE_BADINTERNALERROR; + +cleanup: + return statusCode; +} + +/* UA_PubSubManager_loadPubSubConfigFromByteString() */ +/** + * @brief Decodes the information from the ByteString. If the decoded content is a PubSubConfiguration object + * it will overwrite the current PubSub configuration from the server. + * + * @param server [bi] Pointer to Server object that shall be configured + * @param buffer [in] Relative path and name of the file that contains the PubSub configuration + * + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode +UA_PubSubManager_loadPubSubConfigFromByteString(UA_Server *server, const UA_ByteString buffer) { + UA_StatusCode statusCode; + UA_ExtensionObject decodedFile; + memset(&decodedFile, 0, sizeof(UA_ExtensionObject)); /* Prevents valgrind errors in case of invalid filename */ + + size_t offset = 0; + statusCode = UA_ExtensionObject_decodeBinary(&buffer, &offset, &decodedFile); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_decodeBinFile] decoding UA_Binary failed"); + goto cleanup; + } + + UA_PubSubConfigurationDataType *pubSubConfig; + statusCode = UA_PubSubManager_extractPubSubConfigFromDecodedObject(&decodedFile, &pubSubConfig); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_loadPubSubConfigFromByteString] Extracting PubSub Configuration failed"); + goto cleanup; + } + + statusCode = UA_PubSubManager_updatePubSubConfig(server, pubSubConfig); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_loadPubSubConfigFromByteString] Loading PubSub configuration into server failed"); + goto cleanup; + } + +cleanup: + UA_ExtensionObject_clear(&decodedFile); + return statusCode; +} + +/* UA_PubSubManager_encodePubSubConfiguration() */ +/** + * @brief Encodes a PubSubConfigurationDataType object as ByteString using the UA Binary Data Encoding. + * @param configurationParameters [in] + * @param buffer [out] + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_encodePubSubConfiguration(UA_PubSubConfigurationDataType *configurationParameters, + UA_ByteString *buffer) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + UA_UABinaryFileDataType binFile; + memset(&binFile, 0, sizeof(UA_UABinaryFileDataType)); + /*Perhaps, additional initializations of binFile are necessary here.*/ + + UA_Variant_setScalar(&binFile.body, configurationParameters, &UA_TYPES[UA_TYPES_PUBSUBCONFIGURATIONDATATYPE]); + + UA_ExtensionObject container; + memset(&container, 0, sizeof(UA_ExtensionObject)); + container.encoding = UA_EXTENSIONOBJECT_DECODED; + container.content.decoded.type = &UA_TYPES[UA_TYPES_UABINARYFILEDATATYPE]; + container.content.decoded.data = &binFile; + + size_t fileSize = UA_ExtensionObject_calcSizeBinary(&container); + buffer->data = (UA_Byte*)UA_calloc(fileSize, sizeof(UA_Byte)); + if(buffer->data == NULL) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_encodePubSubConfiguration] Allocating buffer failed"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + buffer->length = fileSize; + + UA_Byte *bufferPos = buffer->data; + retVal = UA_ExtensionObject_encodeBinary(&container, &bufferPos, bufferPos + fileSize); + if(retVal != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "[UA_PubSubManager_encodePubSubConfiguration] Encoding failed"); + } + + return retVal; +} + +/* UA_PubSubManager_generatePublishedDataSetDataType() */ +/** + * @brief Generates a PublishedDataSetDataType object from a PublishedDataSet. + * @param dst [out] PublishedDataSetDataType + * @param src [in] PublishedDataSet + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generatePublishedDataSetDataType(UA_PublishedDataSetDataType *dst, + const UA_PublishedDataSet *src) { + if(src->config.publishedDataSetType != UA_PUBSUB_DATASET_PUBLISHEDITEMS) { + return UA_STATUSCODE_BADNOTIMPLEMENTED; + } + + memset(dst, 0, sizeof(UA_PublishedDataSetDataType)); + + UA_PublishedDataItemsDataType *tmp = UA_PublishedDataItemsDataType_new(); + UA_String_copy(&src->config.name, &dst->name); + dst->dataSetMetaData.fieldsSize = src->fieldSize; + + size_t index = 0; + tmp->publishedDataSize = src->fieldSize; + tmp->publishedData = (UA_PublishedVariableDataType*)UA_Array_new(tmp->publishedDataSize, &UA_TYPES[UA_TYPES_PUBLISHEDVARIABLEDATATYPE]); + if(tmp->publishedData == NULL) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Allocation memory failed"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + dst->dataSetMetaData.fields = (UA_FieldMetaData*)UA_Array_new(dst->dataSetMetaData.fieldsSize, &UA_TYPES[UA_TYPES_FIELDMETADATA]); + if(dst->dataSetMetaData.fields == NULL) { + UA_free(tmp->publishedData); + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Allocation memory failed"); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_DataSetField *dsf, *dsf_tmp = NULL; + TAILQ_FOREACH_SAFE(dsf ,&src->fields, listEntry, dsf_tmp) { + UA_String_copy(&dsf->config.field.variable.fieldNameAlias, &dst->dataSetMetaData.fields[index].name); + UA_PublishedVariableDataType_copy(&dsf->config.field.variable.publishParameters, &tmp->publishedData[index]); + UA_ConfigurationVersionDataType_copy(&dsf->config.field.variable.configurationVersion, &dst->dataSetMetaData.configurationVersion); + dst->dataSetMetaData.fields[index].fieldFlags = dsf->config.field.variable.promotedField; + index++; + } + + dst->dataSetSource.encoding = UA_EXTENSIONOBJECT_DECODED; + dst->dataSetSource.content.decoded.data = tmp; + dst->dataSetSource.content.decoded.type = &UA_TYPES[UA_TYPES_PUBLISHEDDATAITEMSDATATYPE]; + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_generateDataSetWriterDataType() */ +/** + * @brief Generates a DataSetWriterDataType object from a DataSetWriter. + * @param dst [out] DataSetWriterDataType + * @param src [in] DataSetWriter + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generateDataSetWriterDataType(UA_DataSetWriterDataType *dst, + const UA_DataSetWriter *src) { + size_t index; + + memset(dst, 0, sizeof(UA_DataSetWriterDataType)); + + UA_String_copy(&src->config.name, &dst->name); + dst->dataSetWriterId = src->config.dataSetWriterId; + dst->keyFrameCount = src->config.keyFrameCount; + dst->dataSetFieldContentMask = src->config.dataSetFieldContentMask; + UA_ExtensionObject_copy(&src->config.messageSettings, &dst->messageSettings); + UA_String_copy(&src->config.dataSetName, &dst->dataSetName); + + dst->dataSetWriterPropertiesSize = src->config.dataSetWriterPropertiesSize; + for(index = 0; index < src->config.dataSetWriterPropertiesSize; index++) { + UA_KeyValuePair_copy(&src->config.dataSetWriterProperties[index], &dst->dataSetWriterProperties[index]); + } + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_generateWriterGroupDataType() */ +/** + * @brief Generates a WriterGroupDataType object from a WriterGroup. + * @param dst [out] WriterGroupDataType + * @param src [in] WriterGroup + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generateWriterGroupDataType(UA_WriterGroupDataType *dst, + const UA_WriterGroup *src) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + size_t index = 0; + memset(dst, 0, sizeof(UA_WriterGroupDataType)); + + UA_String_copy(&src->config.name, &dst->name); + dst->enabled = src->config.enabled; + dst->writerGroupId = src->config.writerGroupId; + dst->publishingInterval = src->config.publishingInterval; + dst->keepAliveTime = src->config.keepAliveTime; + dst->priority = src->config.priority; + dst->securityMode = src->config.securityMode; + + + UA_ExtensionObject_copy(&src->config.transportSettings, &dst->transportSettings); + UA_ExtensionObject_copy(&src->config.messageSettings, &dst->messageSettings); + + dst->groupPropertiesSize = src->config.groupPropertiesSize; + dst->groupProperties = (UA_KeyValuePair*)UA_Array_new(dst->groupPropertiesSize, &UA_TYPES[UA_TYPES_KEYVALUEPAIR]); + for(index = 0; index < dst->groupPropertiesSize; index++) { + UA_KeyValuePair_copy(&src->config.groupProperties[index], &dst->groupProperties[index]); + } + + dst->dataSetWriters = (UA_DataSetWriterDataType*)UA_calloc(src->writersCount, sizeof(UA_DataSetWriterDataType)); + if(dst->dataSetWriters == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + dst->dataSetWritersSize = src->writersCount; + + UA_DataSetWriter *dsw, *dsw_tmp = NULL; + size_t dsWriterIndex = 0; + LIST_FOREACH_SAFE(dsw ,&src->writers, listEntry, dsw_tmp) { + retVal = UA_PubSubManager_generateDataSetWriterDataType(&dst->dataSetWriters[dsWriterIndex], dsw); + if(retVal != UA_STATUSCODE_GOOD) { + break; + } + + dsWriterIndex++; + } + + return retVal; +} + +/* UA_PubSubManager_generateDataSetReaderDataType() */ +/** + * @brief Generates a DataSetReaderDataType object from a DataSetReader. + * @param dst [out] DataSetReaderDataType + * @param src [in] DataSetReader + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generateDataSetReaderDataType(UA_DataSetReaderDataType *dst, + UA_DataSetReader *src) { + UA_StatusCode retVal; + + memset(dst, 0 , sizeof(UA_DataSetReaderDataType)); + retVal = UA_String_copy(&src->config.name, &dst->name); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + UA_Variant_copy(&src->config.publisherId, &dst->publisherId); + dst->writerGroupId = src->config.writerGroupId; + dst->dataSetWriterId = src->config.dataSetWriterId; + UA_DataSetMetaDataType_copy(&src->config.dataSetMetaData, &dst->dataSetMetaData); + dst->dataSetFieldContentMask = src->config.dataSetFieldContentMask; + dst->messageReceiveTimeout = src->config.messageReceiveTimeout; + UA_ExtensionObject_copy(&src->config.messageSettings, &dst->messageSettings); + dst->subscribedDataSet.encoding = UA_EXTENSIONOBJECT_DECODED; + dst->subscribedDataSet.content.decoded.type = &UA_TYPES[UA_TYPES_TARGETVARIABLESDATATYPE]; + dst->subscribedDataSet.content.decoded.data = (void*)UA_TargetVariablesDataType_new(); + UA_TargetVariablesDataType *tmpTarget = UA_TargetVariablesDataType_new(); + tmpTarget->targetVariablesSize = src->config.subscribedDataSet.subscribedDataSetTarget.targetVariablesSize; + tmpTarget->targetVariables = (UA_FieldTargetDataType *)UA_calloc(tmpTarget->targetVariablesSize, sizeof(UA_FieldTargetDataType)); + for(size_t index = 0; index < tmpTarget->targetVariablesSize; index++) { + UA_FieldTargetDataType_copy(&src->config.subscribedDataSet.subscribedDataSetTarget.targetVariables[index].targetVariable, &tmpTarget->targetVariables[index]); + } + + retVal = UA_copy(tmpTarget, + dst->subscribedDataSet.content.decoded.data, + &UA_TYPES[UA_TYPES_TARGETVARIABLESDATATYPE]); + + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_generateReaderGroupDataType() */ +/** + * @brief Generates a ReaderGroupDataType object from a ReaderGroup. + * @param dst [out] ReaderGroupDataType + * @param src [in] ReaderGroup + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generateReaderGroupDataType(UA_ReaderGroupDataType *dst, + const UA_ReaderGroup *src) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + + memset(dst, 0, sizeof(UA_ReaderGroupDataType)); + + UA_String_copy(&src->config.name, &dst->name); + dst->dataSetReaders = (UA_DataSetReaderDataType*)UA_calloc(src->readersCount, sizeof(UA_DataSetReaderDataType)); + if(dst->dataSetReaders == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + dst->dataSetReadersSize = src->readersCount; + size_t dsReaderIndex = 0; + UA_DataSetReader *dsr, *dsr_tmp = NULL; + LIST_FOREACH_SAFE(dsr ,&src->readers, listEntry, dsr_tmp) { + retVal = UA_PubSubManager_generateDataSetReaderDataType(&dst->dataSetReaders[dsReaderIndex], dsr); + if(retVal != UA_STATUSCODE_GOOD) { + break; + } + + dsReaderIndex++; + } + + return retVal; +} + +/* UA_PubSubManager_generatePubSubConnectionDataType() */ +/** + * @brief Generates a PubSubConnectionDataType object from a PubSubConnection. + * @param dst [out] PubSubConnectionDataType + * @param src [in] PubSubConnection + * @return UA_STATUSCODE_GOOD on success + */ +static UA_StatusCode +UA_PubSubManager_generatePubSubConnectionDataType(UA_PubSubConnectionDataType *dst, + const UA_PubSubConnection *src) { + UA_StatusCode retVal = UA_STATUSCODE_GOOD; + size_t index; + memset(dst, 0, sizeof(UA_PubSubConnectionDataType)); + + UA_String_copy(&src->config->name, &dst->name); + UA_String_copy(&src->config->transportProfileUri, &dst->transportProfileUri); + dst->enabled = src->config->enabled; + + dst->connectionPropertiesSize = src->config->connectionPropertiesSize; + for(index = 0; index < src->config->connectionPropertiesSize; index++) { + UA_KeyValuePair_copy(&src->config->connectionProperties[index], &dst->connectionProperties[index]); + } + + if(src->config->publisherIdType == UA_PUBSUB_PUBLISHERID_NUMERIC) { + UA_Variant_setScalarCopy(&dst->publisherId, &src->config->publisherId.numeric, &UA_TYPES[UA_TYPES_UINT32]); + } else if(src->config->publisherIdType == UA_PUBSUB_PUBLISHERID_STRING) { + UA_Variant_setScalarCopy(&dst->publisherId, &src->config->publisherId.string, &UA_TYPES[UA_TYPES_STRING]); + } + + /* Possibly, array size and dimensions of src->config->address and src->config->connectionTransportSettings + should be checked beforehand. */ + dst->address.encoding = UA_EXTENSIONOBJECT_DECODED; + dst->address.content.decoded.type = src->config->address.type; + retVal = UA_Array_copy(src->config->address.data, 1, &dst->address.content.decoded.data, src->config->address.type); + if(retVal != UA_STATUSCODE_GOOD) + return retVal; + + if(src->config->connectionTransportSettings.data) { + + dst->transportSettings.encoding = UA_EXTENSIONOBJECT_DECODED; + dst->transportSettings.content.decoded.type = src->config->connectionTransportSettings.type; + retVal = UA_Array_copy(src->config->connectionTransportSettings.data, + 1, + &dst->transportSettings.content.decoded.data, + src->config->connectionTransportSettings.type); + + if(retVal != UA_STATUSCODE_GOOD) { + return retVal; + } + } + + dst->writerGroups = (UA_WriterGroupDataType*)UA_calloc(src->writerGroupsSize, sizeof(UA_WriterGroupDataType)); + if(dst->writerGroups == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + dst->writerGroupsSize = src->writerGroupsSize; + UA_WriterGroup *wg, *wg_tmp = NULL; + size_t wgIndex = 0; + LIST_FOREACH_SAFE(wg ,&src->writerGroups, listEntry, wg_tmp) { + retVal = UA_PubSubManager_generateWriterGroupDataType(&dst->writerGroups[wgIndex], wg); + if(retVal != UA_STATUSCODE_GOOD) { + return retVal; + } + + wgIndex++; + } + + dst->readerGroups = (UA_ReaderGroupDataType*)UA_calloc(src->readerGroupsSize, sizeof(UA_ReaderGroupDataType)); + if(dst->readerGroups == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + dst->readerGroupsSize = src->readerGroupsSize; + UA_ReaderGroup *rg = NULL; + size_t rgIndex = 0; + LIST_FOREACH(rg, &src->readerGroups, listEntry) { + retVal = UA_PubSubManager_generateReaderGroupDataType(&dst->readerGroups[rgIndex], rg); + if(retVal != UA_STATUSCODE_GOOD) { + return retVal; + } + + rgIndex++; + } + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_generatePubSubConfigurationDataType() */ +/** + * @brief Generates a PubSubConfigurationDataType object from the current server configuration. + * + * @param server [in] server, that contains the PubSub configuration + * @param pubSubConfiguration [out] target object + * + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode +UA_PubSubManager_generatePubSubConfigurationDataType(const UA_Server* server, + UA_PubSubConfigurationDataType *pubSubConfiguration) { + UA_StatusCode statusCode = UA_STATUSCODE_GOOD; + UA_PubSubManager manager = server->pubSubManager; + memset(pubSubConfiguration, 0, sizeof(UA_PubSubConfigurationDataType)); + + pubSubConfiguration->publishedDataSets = (UA_PublishedDataSetDataType*)UA_calloc(manager.publishedDataSetsSize, + sizeof(UA_PublishedDataSetDataType)); + if(pubSubConfiguration->publishedDataSets == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + pubSubConfiguration->publishedDataSetsSize = manager.publishedDataSetsSize; + + UA_PublishedDataSet *pds; + UA_UInt32 pdsIndex = 0; + TAILQ_FOREACH(pds, &manager.publishedDataSets, listEntry) { + statusCode = UA_PubSubManager_generatePublishedDataSetDataType(&pubSubConfiguration->publishedDataSets[pdsIndex], + pds); + + pdsIndex++; + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_generatePubSubConfigurationDataType] retrieving PublishedDataSet configuration failed"); + return statusCode; + } + } + + pubSubConfiguration->connections = (UA_PubSubConnectionDataType*)UA_calloc(manager.connectionsSize, + sizeof(UA_PubSubConnectionDataType)); + if(pubSubConfiguration->connections == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + pubSubConfiguration->connectionsSize = manager.connectionsSize; + UA_UInt32 connectionIndex = 0; + UA_PubSubConnection *connection; + TAILQ_FOREACH(connection, &manager.connections, listEntry) { + statusCode = UA_PubSubManager_generatePubSubConnectionDataType(&pubSubConfiguration->connections[connectionIndex], + connection); + connectionIndex++; + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "[UA_PubSubManager_generatePubSubConfigurationDataType] retrieving PubSubConnection configuration failed"); + return statusCode; + } + } + + return UA_STATUSCODE_GOOD; +} + +/* UA_PubSubManager_getEncodedPubSubConfiguration() */ +/** + * @brief Saves the current PubSub configuration of a server in a byteString. + * + * @param server [in] Pointer to server object, that contains the PubSubConfiguration + * @param buffer [out] Pointer to a byteString object + * + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode +UA_PubSubManager_getEncodedPubSubConfiguration(UA_Server *server, UA_ByteString *buffer) { + UA_StatusCode statusCode; + UA_PubSubConfigurationDataType config; + memset(&config, 0, sizeof(UA_PubSubConfigurationDataType)); + + statusCode = UA_PubSubManager_generatePubSubConfigurationDataType(server, &config); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "retrieving PubSub configuration from server failed"); + goto cleanup; + } + + statusCode = UA_PubSubManager_encodePubSubConfiguration(&config, buffer); + if(statusCode != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "encoding PubSub configuration failed"); + goto cleanup; + } + + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Saving PubSub config was successful"); + +cleanup: + UA_PubSubConfigurationDataType_clear(&config); + + return statusCode; +} + +#endif /* UA_ENABLE_PUBSUB_FILE_CONFIG */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/namespace0_generated.c" ***********************************/ + +/* WARNING: This is a generated file. + * Any manual changes will be overwritten. */ + + + +/* HasAddIn - ns=0;i=17604 */ + +static UA_StatusCode function_namespace0_generated_0_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "AddInOf"); +attr.displayName = UA_LOCALIZEDTEXT("", "HasAddIn"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 17604LU), +UA_NODEID_NUMERIC(ns[0], 32LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "HasAddIn"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_0_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 17604LU) +); +} + +/* ExpandedNodeId - ns=0;i=18 */ + +static UA_StatusCode function_namespace0_generated_1_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ExpandedNodeId"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 18LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ExpandedNodeId"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_1_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 18LU) +); +} + +/* StatusCode - ns=0;i=19 */ + +static UA_StatusCode function_namespace0_generated_2_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "StatusCode"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 19LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "StatusCode"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_2_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 19LU) +); +} + +/* ByteString - ns=0;i=15 */ + +static UA_StatusCode function_namespace0_generated_3_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ByteString"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 15LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ByteString"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_3_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 15LU) +); +} + +/* Image - ns=0;i=30 */ + +static UA_StatusCode function_namespace0_generated_4_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Image"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 30LU), +UA_NODEID_NUMERIC(ns[0], 15LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Image"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_4_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 30LU) +); +} + +/* DataValue - ns=0;i=23 */ + +static UA_StatusCode function_namespace0_generated_5_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "DataValue"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 23LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataValue"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_5_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 23LU) +); +} + +/* Structure - ns=0;i=22 */ + +static UA_StatusCode function_namespace0_generated_6_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Structure"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Structure"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_6_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 22LU) +); +} + +/* Union - ns=0;i=12756 */ + +static UA_StatusCode function_namespace0_generated_7_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Union"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 12756LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Union"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_7_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 12756LU) +); +} + +/* BuildInfo - ns=0;i=338 */ + +static UA_StatusCode function_namespace0_generated_8_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "BuildInfo"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 338LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "BuildInfo"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_8_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 338LU) +); +} + +/* ServerStatusDataType - ns=0;i=862 */ + +static UA_StatusCode function_namespace0_generated_9_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerStatusDataType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 862LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerStatusDataType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_9_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 862LU) +); +} + +/* Range - ns=0;i=884 */ + +static UA_StatusCode function_namespace0_generated_10_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Range"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 884LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Range"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_10_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 884LU) +); +} + +/* EUInformation - ns=0;i=887 */ + +static UA_StatusCode function_namespace0_generated_11_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "EUInformation"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 887LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "EUInformation"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_11_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 887LU) +); +} + +/* EnumValueType - ns=0;i=7594 */ + +static UA_StatusCode function_namespace0_generated_12_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "EnumValueType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 7594LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "EnumValueType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_12_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7594LU) +); +} + +/* ServerDiagnosticsSummaryDataType - ns=0;i=859 */ + +static UA_StatusCode function_namespace0_generated_13_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerDiagnosticsSummaryDataType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 859LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerDiagnosticsSummaryDataType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_13_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 859LU) +); +} + +/* SignedSoftwareCertificate - ns=0;i=344 */ + +static UA_StatusCode function_namespace0_generated_14_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "SignedSoftwareCertificate"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 344LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "SignedSoftwareCertificate"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_14_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 344LU) +); +} + +/* Argument - ns=0;i=296 */ + +static UA_StatusCode function_namespace0_generated_15_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Argument"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 296LU), +UA_NODEID_NUMERIC(ns[0], 22LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Argument"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_15_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 296LU) +); +} + +/* LocalizedText - ns=0;i=21 */ + +static UA_StatusCode function_namespace0_generated_16_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "LocalizedText"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 21LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "LocalizedText"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_16_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 21LU) +); +} + +/* QualifiedName - ns=0;i=20 */ + +static UA_StatusCode function_namespace0_generated_17_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "QualifiedName"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 20LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "QualifiedName"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_17_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 20LU) +); +} + +/* Number - ns=0;i=26 */ + +static UA_StatusCode function_namespace0_generated_18_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Number"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Number"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_18_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 26LU) +); +} + +/* Decimal - ns=0;i=50 */ + +static UA_StatusCode function_namespace0_generated_19_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Decimal"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 50LU), +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Decimal"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_19_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 50LU) +); +} + +/* UInteger - ns=0;i=28 */ + +static UA_StatusCode function_namespace0_generated_20_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "UInteger"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 28LU), +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "UInteger"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_20_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 28LU) +); +} + +/* UInt16 - ns=0;i=5 */ + +static UA_StatusCode function_namespace0_generated_21_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "UInt16"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 5LU), +UA_NODEID_NUMERIC(ns[0], 28LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "UInt16"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_21_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 5LU) +); +} + +/* UInt32 - ns=0;i=7 */ + +static UA_StatusCode function_namespace0_generated_22_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "UInt32"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 7LU), +UA_NODEID_NUMERIC(ns[0], 28LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "UInt32"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_22_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7LU) +); +} + +/* UInt64 - ns=0;i=9 */ + +static UA_StatusCode function_namespace0_generated_23_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "UInt64"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 9LU), +UA_NODEID_NUMERIC(ns[0], 28LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "UInt64"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_23_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 9LU) +); +} + +/* Byte - ns=0;i=3 */ + +static UA_StatusCode function_namespace0_generated_24_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Byte"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 3LU), +UA_NODEID_NUMERIC(ns[0], 28LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Byte"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_24_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3LU) +); +} + +/* Integer - ns=0;i=27 */ + +static UA_StatusCode function_namespace0_generated_25_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Integer"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 27LU), +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Integer"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_25_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 27LU) +); +} + +/* SByte - ns=0;i=2 */ + +static UA_StatusCode function_namespace0_generated_26_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "SByte"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 2LU), +UA_NODEID_NUMERIC(ns[0], 27LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "SByte"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_26_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2LU) +); +} + +/* Int64 - ns=0;i=8 */ + +static UA_StatusCode function_namespace0_generated_27_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Int64"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 8LU), +UA_NODEID_NUMERIC(ns[0], 27LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Int64"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_27_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 8LU) +); +} + +/* Int32 - ns=0;i=6 */ + +static UA_StatusCode function_namespace0_generated_28_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Int32"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 6LU), +UA_NODEID_NUMERIC(ns[0], 27LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Int32"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_28_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 6LU) +); +} + +/* Int16 - ns=0;i=4 */ + +static UA_StatusCode function_namespace0_generated_29_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Int16"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 4LU), +UA_NODEID_NUMERIC(ns[0], 27LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Int16"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_29_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 4LU) +); +} + +/* Float - ns=0;i=10 */ + +static UA_StatusCode function_namespace0_generated_30_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Float"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 10LU), +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Float"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_30_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 10LU) +); +} + +/* Double - ns=0;i=11 */ + +static UA_StatusCode function_namespace0_generated_31_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Double"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 11LU), +UA_NODEID_NUMERIC(ns[0], 26LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Double"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_31_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11LU) +); +} + +/* Duration - ns=0;i=290 */ + +static UA_StatusCode function_namespace0_generated_32_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Duration"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 290LU), +UA_NODEID_NUMERIC(ns[0], 11LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Duration"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_32_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 290LU) +); +} + +/* DiagnosticInfo - ns=0;i=25 */ + +static UA_StatusCode function_namespace0_generated_33_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "DiagnosticInfo"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 25LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DiagnosticInfo"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_33_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 25LU) +); +} + +/* Enumeration - ns=0;i=29 */ + +static UA_StatusCode function_namespace0_generated_34_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Enumeration"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 29LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Enumeration"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_34_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 29LU) +); +} + +/* AxisScaleEnumeration - ns=0;i=12077 */ + +static UA_StatusCode function_namespace0_generated_35_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "AxisScaleEnumeration"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 12077LU), +UA_NODEID_NUMERIC(ns[0], 29LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "AxisScaleEnumeration"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_35_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 12077LU) +); +} + +/* EnumStrings - ns=0;i=12078 */ + +static UA_StatusCode function_namespace0_generated_36_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +UA_LocalizedText variablenode_ns_0_i_12078_variant_DataContents[3]; +variablenode_ns_0_i_12078_variant_DataContents[0] = UA_LOCALIZEDTEXT("", "Linear"); +variablenode_ns_0_i_12078_variant_DataContents[1] = UA_LOCALIZEDTEXT("", "Log"); +variablenode_ns_0_i_12078_variant_DataContents[2] = UA_LOCALIZEDTEXT("", "Ln"); +UA_Variant_setArray(&attr.value, &variablenode_ns_0_i_12078_variant_DataContents, (UA_Int32) 3, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumStrings"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 12078LU), +UA_NODEID_NUMERIC(ns[0], 12077LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnumStrings"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_36_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 12078LU) +); +} + +/* NamingRuleType - ns=0;i=120 */ + +static UA_StatusCode function_namespace0_generated_37_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "NamingRuleType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 120LU), +UA_NODEID_NUMERIC(ns[0], 29LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "NamingRuleType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_37_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 120LU) +); +} + +/* EnumValues - ns=0;i=12169 */ + +static UA_StatusCode function_namespace0_generated_38_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7594LU); +UA_EnumValueType variablenode_ns_0_i_12169_variant_DataContents[3]; + +UA_init(&variablenode_ns_0_i_12169_variant_DataContents[0], &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +variablenode_ns_0_i_12169_variant_DataContents[0].value = (UA_Int64) 1; +variablenode_ns_0_i_12169_variant_DataContents[0].displayName = UA_LOCALIZEDTEXT("", "Mandatory"); +variablenode_ns_0_i_12169_variant_DataContents[0].description = UA_LOCALIZEDTEXT("", "The BrowseName must appear in all instances of the type."); + +UA_init(&variablenode_ns_0_i_12169_variant_DataContents[1], &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +variablenode_ns_0_i_12169_variant_DataContents[1].value = (UA_Int64) 2; +variablenode_ns_0_i_12169_variant_DataContents[1].displayName = UA_LOCALIZEDTEXT("", "Optional"); +variablenode_ns_0_i_12169_variant_DataContents[1].description = UA_LOCALIZEDTEXT("", "The BrowseName may appear in an instance of the type."); + +UA_init(&variablenode_ns_0_i_12169_variant_DataContents[2], &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +variablenode_ns_0_i_12169_variant_DataContents[2].value = (UA_Int64) 3; +variablenode_ns_0_i_12169_variant_DataContents[2].displayName = UA_LOCALIZEDTEXT("", "Constraint"); +variablenode_ns_0_i_12169_variant_DataContents[2].description = UA_LOCALIZEDTEXT("", "The modelling rule defines a constraint and the BrowseName is not used in an instance of the type."); +UA_Variant_setArray(&attr.value, &variablenode_ns_0_i_12169_variant_DataContents, (UA_Int32) 3, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumValues"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 12169LU), +UA_NODEID_NUMERIC(ns[0], 120LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnumValues"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); + + + +return retVal; +} + +static UA_StatusCode function_namespace0_generated_38_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 12169LU) +); +} + +/* RedundancySupport - ns=0;i=851 */ + +static UA_StatusCode function_namespace0_generated_39_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "RedundancySupport"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 851LU), +UA_NODEID_NUMERIC(ns[0], 29LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "RedundancySupport"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_39_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 851LU) +); +} + +/* EnumStrings - ns=0;i=7611 */ + +static UA_StatusCode function_namespace0_generated_40_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +UA_LocalizedText variablenode_ns_0_i_7611_variant_DataContents[6]; +variablenode_ns_0_i_7611_variant_DataContents[0] = UA_LOCALIZEDTEXT("", "None"); +variablenode_ns_0_i_7611_variant_DataContents[1] = UA_LOCALIZEDTEXT("", "Cold"); +variablenode_ns_0_i_7611_variant_DataContents[2] = UA_LOCALIZEDTEXT("", "Warm"); +variablenode_ns_0_i_7611_variant_DataContents[3] = UA_LOCALIZEDTEXT("", "Hot"); +variablenode_ns_0_i_7611_variant_DataContents[4] = UA_LOCALIZEDTEXT("", "Transparent"); +variablenode_ns_0_i_7611_variant_DataContents[5] = UA_LOCALIZEDTEXT("", "HotAndMirrored"); +UA_Variant_setArray(&attr.value, &variablenode_ns_0_i_7611_variant_DataContents, (UA_Int32) 6, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumStrings"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 7611LU), +UA_NODEID_NUMERIC(ns[0], 851LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnumStrings"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_40_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7611LU) +); +} + +/* ServerState - ns=0;i=852 */ + +static UA_StatusCode function_namespace0_generated_41_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerState"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 852LU), +UA_NODEID_NUMERIC(ns[0], 29LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerState"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_41_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 852LU) +); +} + +/* HasHistoricalConfiguration - ns=0;i=56 */ + +static UA_StatusCode function_namespace0_generated_42_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "HistoricalConfigurationOf"); +attr.displayName = UA_LOCALIZEDTEXT("", "HasHistoricalConfiguration"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 56LU), +UA_NODEID_NUMERIC(ns[0], 44LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "HasHistoricalConfiguration"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_42_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 56LU) +); +} + +/* HasEffect - ns=0;i=54 */ + +static UA_StatusCode function_namespace0_generated_43_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "MayBeEffectedBy"); +attr.displayName = UA_LOCALIZEDTEXT("", "HasEffect"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 54LU), +UA_NODEID_NUMERIC(ns[0], 32LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "HasEffect"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_43_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 54LU) +); +} + +/* ToState - ns=0;i=52 */ + +static UA_StatusCode function_namespace0_generated_44_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "FromTransition"); +attr.displayName = UA_LOCALIZEDTEXT("", "ToState"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 52LU), +UA_NODEID_NUMERIC(ns[0], 32LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ToState"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_44_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 52LU) +); +} + +/* HasCause - ns=0;i=53 */ + +static UA_StatusCode function_namespace0_generated_45_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "MayBeCausedBy"); +attr.displayName = UA_LOCALIZEDTEXT("", "HasCause"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 53LU), +UA_NODEID_NUMERIC(ns[0], 32LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "HasCause"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_45_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 53LU) +); +} + +/* FromState - ns=0;i=51 */ + +static UA_StatusCode function_namespace0_generated_46_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ReferenceTypeAttributes attr = UA_ReferenceTypeAttributes_default; +attr.inverseName = UA_LOCALIZEDTEXT("", "ToTransition"); +attr.displayName = UA_LOCALIZEDTEXT("", "FromState"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_REFERENCETYPE, +UA_NODEID_NUMERIC(ns[0], 51LU), +UA_NODEID_NUMERIC(ns[0], 32LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "FromState"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_46_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 51LU) +); +} + +/* String - ns=0;i=12 */ + +static UA_StatusCode function_namespace0_generated_47_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "String"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 12LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "String"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_47_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 12LU) +); +} + +/* LocaleId - ns=0;i=295 */ + +static UA_StatusCode function_namespace0_generated_48_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "LocaleId"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 295LU), +UA_NODEID_NUMERIC(ns[0], 12LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "LocaleId"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_48_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 295LU) +); +} + +/* DateTime - ns=0;i=13 */ + +static UA_StatusCode function_namespace0_generated_49_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "DateTime"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 13LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DateTime"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_49_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 13LU) +); +} + +/* UtcTime - ns=0;i=294 */ + +static UA_StatusCode function_namespace0_generated_50_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "UtcTime"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 294LU), +UA_NODEID_NUMERIC(ns[0], 13LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "UtcTime"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_50_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 294LU) +); +} + +/* NodeId - ns=0;i=17 */ + +static UA_StatusCode function_namespace0_generated_51_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "NodeId"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 17LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "NodeId"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_51_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 17LU) +); +} + +/* Boolean - ns=0;i=1 */ + +static UA_StatusCode function_namespace0_generated_52_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Boolean"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 1LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Boolean"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_52_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 1LU) +); +} + +/* XmlElement - ns=0;i=16 */ + +static UA_StatusCode function_namespace0_generated_53_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "XmlElement"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 16LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "XmlElement"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_53_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 16LU) +); +} + +/* Guid - ns=0;i=14 */ + +static UA_StatusCode function_namespace0_generated_54_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_DataTypeAttributes attr = UA_DataTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Guid"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_DATATYPE, +UA_NODEID_NUMERIC(ns[0], 14LU), +UA_NODEID_NUMERIC(ns[0], 24LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "Guid"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_54_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 14LU) +); +} + +/* ServerDiagnosticsType - ns=0;i=2020 */ + +static UA_StatusCode function_namespace0_generated_55_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerDiagnosticsType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 2020LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerDiagnosticsType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_55_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2020LU) +); +} + +/* Default Binary - ns=0;i=3062 */ + +static UA_StatusCode function_namespace0_generated_56_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default Binary"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 3062LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default Binary"), +UA_NODEID_NUMERIC(ns[0], 58LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_56_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3062LU) +); +} + +/* Default XML - ns=0;i=3063 */ + +static UA_StatusCode function_namespace0_generated_57_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default XML"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 3063LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default XML"), +UA_NODEID_NUMERIC(ns[0], 58LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_57_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3063LU) +); +} + +/* ServerStatusType - ns=0;i=2138 */ + +static UA_StatusCode function_namespace0_generated_58_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 862LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerStatusType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2138LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerStatusType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_58_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2138LU) +); +} + +/* VendorServerInfoType - ns=0;i=2033 */ + +static UA_StatusCode function_namespace0_generated_59_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "VendorServerInfoType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 2033LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "VendorServerInfoType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_59_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2033LU) +); +} + +/* DataTypeDescriptionType - ns=0;i=69 */ + +static UA_StatusCode function_namespace0_generated_60_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeDescriptionType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 69LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeDescriptionType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_60_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 69LU) +); +} + +/* DictionaryFragment - ns=0;i=105 */ + +static UA_StatusCode function_namespace0_generated_61_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 15LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DictionaryFragment"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 105LU), +UA_NODEID_NUMERIC(ns[0], 69LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "DictionaryFragment"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_61_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 105LU) +); +} + +/* DataTypeVersion - ns=0;i=104 */ + +static UA_StatusCode function_namespace0_generated_62_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeVersion"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 104LU), +UA_NODEID_NUMERIC(ns[0], 69LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeVersion"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_62_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 104LU) +); +} + +/* DataTypeDictionaryType - ns=0;i=72 */ + +static UA_StatusCode function_namespace0_generated_63_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 15LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeDictionaryType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 72LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeDictionaryType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_63_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 72LU) +); +} + +/* NamespaceUri - ns=0;i=107 */ + +static UA_StatusCode function_namespace0_generated_64_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "NamespaceUri"); +#ifdef UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS +attr.description = UA_LOCALIZEDTEXT("", "A URI that uniquely identifies the dictionary."); +#endif +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 107LU), +UA_NODEID_NUMERIC(ns[0], 72LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "NamespaceUri"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_64_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 107LU) +); +} + +/* DataTypeVersion - ns=0;i=106 */ + +static UA_StatusCode function_namespace0_generated_65_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeVersion"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 106LU), +UA_NODEID_NUMERIC(ns[0], 72LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeVersion"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_65_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 106LU) +); +} + +/* DataTypeSystemType - ns=0;i=75 */ + +static UA_StatusCode function_namespace0_generated_66_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeSystemType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 75LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeSystemType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_66_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 75LU) +); +} + +/* OPC Binary - ns=0;i=93 */ + +static UA_StatusCode function_namespace0_generated_67_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "OPC Binary"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 93LU), +UA_NODEID_NUMERIC(ns[0], 90LU), +UA_NODEID_NUMERIC(ns[0], 35LU), +UA_QUALIFIEDNAME(ns[0], "OPC Binary"), +UA_NODEID_NUMERIC(ns[0], 75LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_67_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 93LU) +); +} + +/* Opc.Ua - ns=0;i=7617 */ + +static UA_StatusCode function_namespace0_generated_68_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 15LU); +UA_ByteString *variablenode_ns_0_i_7617_variant_DataContents = UA_ByteString_new(); +if (!variablenode_ns_0_i_7617_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_ByteString_init(variablenode_ns_0_i_7617_variant_DataContents); +*variablenode_ns_0_i_7617_variant_DataContents = UA_BYTESTRING_NULL; +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_7617_variant_DataContents, &UA_TYPES[UA_TYPES_BYTESTRING]); +attr.displayName = UA_LOCALIZEDTEXT("", "Opc.Ua"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 7617LU), +UA_NODEID_NUMERIC(ns[0], 93LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "Opc.Ua"), +UA_NODEID_NUMERIC(ns[0], 72LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +variablenode_ns_0_i_7617_variant_DataContents->data = NULL; +variablenode_ns_0_i_7617_variant_DataContents->length = 0; +UA_ByteString_delete(variablenode_ns_0_i_7617_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_68_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7617LU) +); +} + +/* Argument - ns=0;i=7650 */ + +static UA_StatusCode function_namespace0_generated_69_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +UA_String *variablenode_ns_0_i_7650_variant_DataContents = UA_String_new(); +if (!variablenode_ns_0_i_7650_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_String_init(variablenode_ns_0_i_7650_variant_DataContents); +*variablenode_ns_0_i_7650_variant_DataContents = UA_STRING_ALLOC("Argument"); +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_7650_variant_DataContents, &UA_TYPES[UA_TYPES_STRING]); +attr.displayName = UA_LOCALIZEDTEXT("", "Argument"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 7650LU), +UA_NODEID_NUMERIC(ns[0], 7617LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "Argument"), +UA_NODEID_NUMERIC(ns[0], 69LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_String_delete(variablenode_ns_0_i_7650_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_69_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7650LU) +); +} + +/* EnumValueType - ns=0;i=7656 */ + +static UA_StatusCode function_namespace0_generated_70_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +UA_String *variablenode_ns_0_i_7656_variant_DataContents = UA_String_new(); +if (!variablenode_ns_0_i_7656_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_String_init(variablenode_ns_0_i_7656_variant_DataContents); +*variablenode_ns_0_i_7656_variant_DataContents = UA_STRING_ALLOC("EnumValueType"); +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_7656_variant_DataContents, &UA_TYPES[UA_TYPES_STRING]); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumValueType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 7656LU), +UA_NODEID_NUMERIC(ns[0], 7617LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "EnumValueType"), +UA_NODEID_NUMERIC(ns[0], 69LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_String_delete(variablenode_ns_0_i_7656_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_70_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 7656LU) +); +} + +/* XML Schema - ns=0;i=92 */ + +static UA_StatusCode function_namespace0_generated_71_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "XML Schema"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 92LU), +UA_NODEID_NUMERIC(ns[0], 90LU), +UA_NODEID_NUMERIC(ns[0], 35LU), +UA_QUALIFIEDNAME(ns[0], "XML Schema"), +UA_NODEID_NUMERIC(ns[0], 75LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_71_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 92LU) +); +} + +/* DataTypeEncodingType - ns=0;i=76 */ + +static UA_StatusCode function_namespace0_generated_72_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "DataTypeEncodingType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 76LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataTypeEncodingType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_72_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 76LU) +); +} + +/* Default JSON - ns=0;i=15375 */ + +static UA_StatusCode function_namespace0_generated_73_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default JSON"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 15375LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default JSON"), +UA_NODEID_NUMERIC(ns[0], 76LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 15375LU), UA_NODEID_NUMERIC(ns[0], 38LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 884LU), false); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_73_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 15375LU) +); +} + +/* Default JSON - ns=0;i=15376 */ + +static UA_StatusCode function_namespace0_generated_74_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default JSON"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 15376LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default JSON"), +UA_NODEID_NUMERIC(ns[0], 76LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 15376LU), UA_NODEID_NUMERIC(ns[0], 38LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 887LU), false); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_74_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 15376LU) +); +} + +/* Default Binary - ns=0;i=8251 */ + +static UA_StatusCode function_namespace0_generated_75_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default Binary"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 8251LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default Binary"), +UA_NODEID_NUMERIC(ns[0], 76LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 8251LU), UA_NODEID_NUMERIC(ns[0], 38LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 7594LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 8251LU), UA_NODEID_NUMERIC(ns[0], 39LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 7656LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_75_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 8251LU) +); +} + +/* Default Binary - ns=0;i=298 */ + +static UA_StatusCode function_namespace0_generated_76_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Default Binary"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 298LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Default Binary"), +UA_NODEID_NUMERIC(ns[0], 76LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 298LU), UA_NODEID_NUMERIC(ns[0], 38LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 296LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 298LU), UA_NODEID_NUMERIC(ns[0], 39LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 7650LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_76_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 298LU) +); +} + +/* ModellingRuleType - ns=0;i=77 */ + +static UA_StatusCode function_namespace0_generated_77_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ModellingRuleType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 77LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ModellingRuleType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_77_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 77LU) +); +} + +/* Mandatory - ns=0;i=78 */ + +static UA_StatusCode function_namespace0_generated_78_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Mandatory"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 78LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Mandatory"), +UA_NODEID_NUMERIC(ns[0], 77LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 78LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 7611LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 78LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 12078LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 78LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 12169LU), false); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_78_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 78LU) +); +} + +/* NamingRule - ns=0;i=112 */ + +static UA_StatusCode function_namespace0_generated_79_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 120LU); +UA_Int32 *variablenode_ns_0_i_112_variant_DataContents = UA_Int32_new(); +if (!variablenode_ns_0_i_112_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int32_init(variablenode_ns_0_i_112_variant_DataContents); +*variablenode_ns_0_i_112_variant_DataContents = (UA_Int32) 1; +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_112_variant_DataContents, &UA_TYPES[UA_TYPES_INT32]); +attr.displayName = UA_LOCALIZEDTEXT("", "NamingRule"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 112LU), +UA_NODEID_NUMERIC(ns[0], 78LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "NamingRule"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int32_delete(variablenode_ns_0_i_112_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_79_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 112LU) +); +} + +/* NamingRule - ns=0;i=111 */ + +static UA_StatusCode function_namespace0_generated_80_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 120LU); +UA_Int32 *variablenode_ns_0_i_111_variant_DataContents = UA_Int32_new(); +if (!variablenode_ns_0_i_111_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int32_init(variablenode_ns_0_i_111_variant_DataContents); +*variablenode_ns_0_i_111_variant_DataContents = (UA_Int32) 1; +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_111_variant_DataContents, &UA_TYPES[UA_TYPES_INT32]); +attr.displayName = UA_LOCALIZEDTEXT("", "NamingRule"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 111LU), +UA_NODEID_NUMERIC(ns[0], 77LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "NamingRule"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int32_delete(variablenode_ns_0_i_111_variant_DataContents); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 111LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_80_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 111LU) +); +} + +/* Optional - ns=0;i=80 */ + +static UA_StatusCode function_namespace0_generated_81_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "Optional"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 80LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_NODEID_NUMERIC(ns[0], 0LU), +UA_QUALIFIEDNAME(ns[0], "Optional"), +UA_NODEID_NUMERIC(ns[0], 77LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 80LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 104LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 80LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 105LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 80LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 107LU), false); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 80LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 106LU), false); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_81_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 80LU) +); +} + +/* NamingRule - ns=0;i=113 */ + +static UA_StatusCode function_namespace0_generated_82_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 120LU); +UA_Int32 *variablenode_ns_0_i_113_variant_DataContents = UA_Int32_new(); +if (!variablenode_ns_0_i_113_variant_DataContents) return UA_STATUSCODE_BADOUTOFMEMORY; +UA_Int32_init(variablenode_ns_0_i_113_variant_DataContents); +*variablenode_ns_0_i_113_variant_DataContents = (UA_Int32) 2; +UA_Variant_setScalar(&attr.value, variablenode_ns_0_i_113_variant_DataContents, &UA_TYPES[UA_TYPES_INT32]); +attr.displayName = UA_LOCALIZEDTEXT("", "NamingRule"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 113LU), +UA_NODEID_NUMERIC(ns[0], 80LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "NamingRule"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +UA_Int32_delete(variablenode_ns_0_i_113_variant_DataContents); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_82_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 113LU) +); +} + +/* ServerDiagnosticsSummaryType - ns=0;i=2150 */ + +static UA_StatusCode function_namespace0_generated_83_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 859LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerDiagnosticsSummaryType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerDiagnosticsSummaryType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_83_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2150LU) +); +} + +/* PublishingIntervalCount - ns=0;i=2159 */ + +static UA_StatusCode function_namespace0_generated_84_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "PublishingIntervalCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2159LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "PublishingIntervalCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2159LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_84_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2159LU) +); +} + +/* SecurityRejectedSessionCount - ns=0;i=2154 */ + +static UA_StatusCode function_namespace0_generated_85_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SecurityRejectedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2154LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SecurityRejectedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2154LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_85_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2154LU) +); +} + +/* SecurityRejectedRequestsCount - ns=0;i=2162 */ + +static UA_StatusCode function_namespace0_generated_86_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SecurityRejectedRequestsCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2162LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SecurityRejectedRequestsCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2162LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_86_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2162LU) +); +} + +/* RejectedRequestsCount - ns=0;i=2163 */ + +static UA_StatusCode function_namespace0_generated_87_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RejectedRequestsCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2163LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "RejectedRequestsCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2163LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_87_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2163LU) +); +} + +/* RejectedSessionCount - ns=0;i=2155 */ + +static UA_StatusCode function_namespace0_generated_88_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RejectedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2155LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "RejectedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2155LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_88_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2155LU) +); +} + +/* CumulatedSubscriptionCount - ns=0;i=2161 */ + +static UA_StatusCode function_namespace0_generated_89_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CumulatedSubscriptionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2161LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CumulatedSubscriptionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2161LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_89_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2161LU) +); +} + +/* CumulatedSessionCount - ns=0;i=2153 */ + +static UA_StatusCode function_namespace0_generated_90_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CumulatedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2153LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CumulatedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2153LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_90_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2153LU) +); +} + +/* CurrentSessionCount - ns=0;i=2152 */ + +static UA_StatusCode function_namespace0_generated_91_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CurrentSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2152LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CurrentSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2152LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_91_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2152LU) +); +} + +/* ServerViewCount - ns=0;i=2151 */ + +static UA_StatusCode function_namespace0_generated_92_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerViewCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2151LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerViewCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2151LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_92_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2151LU) +); +} + +/* SessionTimeoutCount - ns=0;i=2156 */ + +static UA_StatusCode function_namespace0_generated_93_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SessionTimeoutCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2156LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SessionTimeoutCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2156LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_93_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2156LU) +); +} + +/* CurrentSubscriptionCount - ns=0;i=2160 */ + +static UA_StatusCode function_namespace0_generated_94_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CurrentSubscriptionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2160LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CurrentSubscriptionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2160LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_94_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2160LU) +); +} + +/* SessionAbortCount - ns=0;i=2157 */ + +static UA_StatusCode function_namespace0_generated_95_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SessionAbortCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2157LU), +UA_NODEID_NUMERIC(ns[0], 2150LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SessionAbortCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2157LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_95_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2157LU) +); +} + +/* ServerRedundancyType - ns=0;i=2034 */ + +static UA_StatusCode function_namespace0_generated_96_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerRedundancyType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 2034LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerRedundancyType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_96_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2034LU) +); +} + +/* RedundancySupport - ns=0;i=2035 */ + +static UA_StatusCode function_namespace0_generated_97_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 851LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RedundancySupport"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2035LU), +UA_NODEID_NUMERIC(ns[0], 2034LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "RedundancySupport"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2035LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_97_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2035LU) +); +} + +/* BuildInfoType - ns=0;i=3051 */ + +static UA_StatusCode function_namespace0_generated_98_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 338LU); +attr.displayName = UA_LOCALIZEDTEXT("", "BuildInfoType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 3051LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "BuildInfoType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_98_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3051LU) +); +} + +/* DataItemType - ns=0;i=2365 */ + +static UA_StatusCode function_namespace0_generated_99_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.valueRank = -2; +/* DataType inherited */ +attr.dataType = UA_NODEID_NUMERIC(ns[0], 24LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DataItemType"); +#ifdef UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS +attr.description = UA_LOCALIZEDTEXT("", "A variable that contains live automation data."); +#endif +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2365LU), +UA_NODEID_NUMERIC(ns[0], 63LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DataItemType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_99_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2365LU) +); +} + +/* ValuePrecision - ns=0;i=2367 */ + +static UA_StatusCode function_namespace0_generated_100_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 11LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ValuePrecision"); +#ifdef UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS +attr.description = UA_LOCALIZEDTEXT("", "The maximum precision that the server can maintain for the item based on restrictions in the target environment."); +#endif +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2367LU), +UA_NODEID_NUMERIC(ns[0], 2365LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "ValuePrecision"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2367LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_100_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2367LU) +); +} + +/* Definition - ns=0;i=2366 */ + +static UA_StatusCode function_namespace0_generated_101_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "Definition"); +#ifdef UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS +attr.description = UA_LOCALIZEDTEXT("", "A vendor-specific, human readable string that specifies how the value of this DataItem is calculated."); +#endif +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2366LU), +UA_NODEID_NUMERIC(ns[0], 2365LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "Definition"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2366LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_101_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2366LU) +); +} + +/* AnalogItemType - ns=0;i=2368 */ + +static UA_StatusCode function_namespace0_generated_102_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.valueRank = -2; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 26LU); +attr.displayName = UA_LOCALIZEDTEXT("", "AnalogItemType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2368LU), +UA_NODEID_NUMERIC(ns[0], 2365LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "AnalogItemType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_102_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2368LU) +); +} + +/* EngineeringUnits - ns=0;i=2371 */ + +static UA_StatusCode function_namespace0_generated_103_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 887LU); +attr.displayName = UA_LOCALIZEDTEXT("", "EngineeringUnits"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2371LU), +UA_NODEID_NUMERIC(ns[0], 2368LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EngineeringUnits"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2371LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_103_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2371LU) +); +} + +/* InstrumentRange - ns=0;i=2370 */ + +static UA_StatusCode function_namespace0_generated_104_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 884LU); +attr.displayName = UA_LOCALIZEDTEXT("", "InstrumentRange"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2370LU), +UA_NODEID_NUMERIC(ns[0], 2368LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "InstrumentRange"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2370LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_104_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2370LU) +); +} + +/* EURange - ns=0;i=2369 */ + +static UA_StatusCode function_namespace0_generated_105_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 3; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 884LU); +attr.displayName = UA_LOCALIZEDTEXT("", "EURange"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2369LU), +UA_NODEID_NUMERIC(ns[0], 2368LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EURange"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2369LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_105_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2369LU) +); +} + +/* DiscreteItemType - ns=0;i=2372 */ + +static UA_StatusCode function_namespace0_generated_106_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.isAbstract = true; +attr.valueRank = -2; +/* DataType inherited */ +attr.dataType = UA_NODEID_NUMERIC(ns[0], 24LU); +attr.displayName = UA_LOCALIZEDTEXT("", "DiscreteItemType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2372LU), +UA_NODEID_NUMERIC(ns[0], 2365LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "DiscreteItemType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_106_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2372LU) +); +} + +/* TwoStateDiscreteType - ns=0;i=2373 */ + +static UA_StatusCode function_namespace0_generated_107_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.valueRank = -2; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 1LU); +attr.displayName = UA_LOCALIZEDTEXT("", "TwoStateDiscreteType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2373LU), +UA_NODEID_NUMERIC(ns[0], 2372LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "TwoStateDiscreteType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_107_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2373LU) +); +} + +/* TrueState - ns=0;i=2375 */ + +static UA_StatusCode function_namespace0_generated_108_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +attr.displayName = UA_LOCALIZEDTEXT("", "TrueState"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2375LU), +UA_NODEID_NUMERIC(ns[0], 2373LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "TrueState"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2375LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_108_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2375LU) +); +} + +/* FalseState - ns=0;i=2374 */ + +static UA_StatusCode function_namespace0_generated_109_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +attr.displayName = UA_LOCALIZEDTEXT("", "FalseState"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2374LU), +UA_NODEID_NUMERIC(ns[0], 2373LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "FalseState"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2374LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_109_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2374LU) +); +} + +/* MultiStateDiscreteType - ns=0;i=2376 */ + +static UA_StatusCode function_namespace0_generated_110_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.valueRank = -2; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 28LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MultiStateDiscreteType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 2376LU), +UA_NODEID_NUMERIC(ns[0], 2372LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "MultiStateDiscreteType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_110_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2376LU) +); +} + +/* EnumStrings - ns=0;i=2377 */ + +static UA_StatusCode function_namespace0_generated_111_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumStrings"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2377LU), +UA_NODEID_NUMERIC(ns[0], 2376LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnumStrings"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2377LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_111_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2377LU) +); +} + +/* MultiStateValueDiscreteType - ns=0;i=11238 */ + +static UA_StatusCode function_namespace0_generated_112_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableTypeAttributes attr = UA_VariableTypeAttributes_default; +attr.valueRank = -2; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 26LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MultiStateValueDiscreteType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLETYPE, +UA_NODEID_NUMERIC(ns[0], 11238LU), +UA_NODEID_NUMERIC(ns[0], 2372LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "MultiStateValueDiscreteType"), +UA_NODEID_NUMERIC(ns[0], 0LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_112_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11238LU) +); +} + +/* ValueAsText - ns=0;i=11461 */ + +static UA_StatusCode function_namespace0_generated_113_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ValueAsText"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11461LU), +UA_NODEID_NUMERIC(ns[0], 11238LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "ValueAsText"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11461LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_113_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11461LU) +); +} + +/* EnumValues - ns=0;i=11241 */ + +static UA_StatusCode function_namespace0_generated_114_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7594LU); +attr.displayName = UA_LOCALIZEDTEXT("", "EnumValues"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11241LU), +UA_NODEID_NUMERIC(ns[0], 11238LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnumValues"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11241LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_114_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11241LU) +); +} + +/* ServerType - ns=0;i=2004 */ + +static UA_StatusCode function_namespace0_generated_115_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 2004LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_115_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2004LU) +); +} + +/* Server - ns=0;i=2253 */ + +static UA_StatusCode function_namespace0_generated_116_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.eventNotifier = true; +attr.displayName = UA_LOCALIZEDTEXT("", "Server"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 85LU), +UA_NODEID_NUMERIC(ns[0], 35LU), +UA_QUALIFIEDNAME(ns[0], "Server"), +UA_NODEID_NUMERIC(ns[0], 2004LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_116_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2253LU) +); +} + +/* Auditing - ns=0;i=2994 */ + +static UA_StatusCode function_namespace0_generated_117_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 1LU); +attr.displayName = UA_LOCALIZEDTEXT("", "Auditing"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2994LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "Auditing"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_117_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2994LU) +); +} + +/* GetMonitoredItems - ns=0;i=11492 */ + +static UA_StatusCode function_namespace0_generated_118_begin(UA_Server *server, UA_UInt16* ns) { +#ifdef UA_ENABLE_METHODCALLS +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_MethodAttributes attr = UA_MethodAttributes_default; +attr.executable = true; +attr.userExecutable = true; +attr.displayName = UA_LOCALIZEDTEXT("", "GetMonitoredItems"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_METHOD, +UA_NODEID_NUMERIC(ns[0], 11492LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "GetMonitoredItems"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_METHODATTRIBUTES],NULL, NULL); +return retVal; +#else +return UA_STATUSCODE_GOOD; +#endif /* UA_ENABLE_METHODCALLS */ +} + +static UA_StatusCode function_namespace0_generated_118_finish(UA_Server *server, UA_UInt16* ns) { +#ifdef UA_ENABLE_METHODCALLS +return UA_Server_addMethodNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11492LU) +, NULL, 0, NULL, 0, NULL); +#else +return UA_STATUSCODE_GOOD; +#endif /* UA_ENABLE_METHODCALLS */ +} + +/* OutputArguments - ns=0;i=11494 */ + +static UA_StatusCode function_namespace0_generated_119_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 296LU); +UA_Argument variablenode_ns_0_i_11494_variant_DataContents[2]; + +UA_init(&variablenode_ns_0_i_11494_variant_DataContents[0], &UA_TYPES[UA_TYPES_ARGUMENT]); +variablenode_ns_0_i_11494_variant_DataContents[0].name = UA_STRING("ServerHandles"); +variablenode_ns_0_i_11494_variant_DataContents[0].dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +variablenode_ns_0_i_11494_variant_DataContents[0].valueRank = (UA_Int32) 1; +UA_STACKARRAY(UA_UInt32, variablenode_ns_0_i_11494_variant_DataContents0_arrayDimensions, 1); +UA_init(variablenode_ns_0_i_11494_variant_DataContents0_arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]); +variablenode_ns_0_i_11494_variant_DataContents0_arrayDimensions[0] = (UA_UInt32) 0; +variablenode_ns_0_i_11494_variant_DataContents[0].arrayDimensionsSize = 1; +variablenode_ns_0_i_11494_variant_DataContents[0].arrayDimensions = variablenode_ns_0_i_11494_variant_DataContents0_arrayDimensions; + +UA_init(&variablenode_ns_0_i_11494_variant_DataContents[1], &UA_TYPES[UA_TYPES_ARGUMENT]); +variablenode_ns_0_i_11494_variant_DataContents[1].name = UA_STRING("ClientHandles"); +variablenode_ns_0_i_11494_variant_DataContents[1].dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +variablenode_ns_0_i_11494_variant_DataContents[1].valueRank = (UA_Int32) 1; +UA_STACKARRAY(UA_UInt32, variablenode_ns_0_i_11494_variant_DataContents1_arrayDimensions, 1); +UA_init(variablenode_ns_0_i_11494_variant_DataContents1_arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]); +variablenode_ns_0_i_11494_variant_DataContents1_arrayDimensions[0] = (UA_UInt32) 0; +variablenode_ns_0_i_11494_variant_DataContents[1].arrayDimensionsSize = 1; +variablenode_ns_0_i_11494_variant_DataContents[1].arrayDimensions = variablenode_ns_0_i_11494_variant_DataContents1_arrayDimensions; +UA_Variant_setArray(&attr.value, &variablenode_ns_0_i_11494_variant_DataContents, (UA_Int32) 2, &UA_TYPES[UA_TYPES_ARGUMENT]); +attr.displayName = UA_LOCALIZEDTEXT("", "OutputArguments"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11494LU), +UA_NODEID_NUMERIC(ns[0], 11492LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "OutputArguments"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); + + +return retVal; +} + +static UA_StatusCode function_namespace0_generated_119_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11494LU) +); +} + +/* InputArguments - ns=0;i=11493 */ + +static UA_StatusCode function_namespace0_generated_120_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 296LU); +UA_Argument variablenode_ns_0_i_11493_variant_DataContents[1]; + +UA_init(&variablenode_ns_0_i_11493_variant_DataContents[0], &UA_TYPES[UA_TYPES_ARGUMENT]); +variablenode_ns_0_i_11493_variant_DataContents[0].name = UA_STRING("SubscriptionId"); +variablenode_ns_0_i_11493_variant_DataContents[0].dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +variablenode_ns_0_i_11493_variant_DataContents[0].valueRank = (UA_Int32) -1; +UA_Variant_setArray(&attr.value, &variablenode_ns_0_i_11493_variant_DataContents, (UA_Int32) 1, &UA_TYPES[UA_TYPES_ARGUMENT]); +attr.displayName = UA_LOCALIZEDTEXT("", "InputArguments"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11493LU), +UA_NODEID_NUMERIC(ns[0], 11492LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "InputArguments"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); + +return retVal; +} + +static UA_StatusCode function_namespace0_generated_120_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11493LU) +); +} + +/* ServerStatus - ns=0;i=2256 */ + +static UA_StatusCode function_namespace0_generated_121_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 862LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerStatus"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerStatus"), +UA_NODEID_NUMERIC(ns[0], 2138LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_121_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2256LU) +); +} + +/* BuildInfo - ns=0;i=2260 */ + +static UA_StatusCode function_namespace0_generated_122_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 338LU); +attr.displayName = UA_LOCALIZEDTEXT("", "BuildInfo"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "BuildInfo"), +UA_NODEID_NUMERIC(ns[0], 3051LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_122_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2260LU) +); +} + +/* BuildDate - ns=0;i=2266 */ + +static UA_StatusCode function_namespace0_generated_123_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 294LU); +attr.displayName = UA_LOCALIZEDTEXT("", "BuildDate"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2266LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "BuildDate"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_123_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2266LU) +); +} + +/* BuildNumber - ns=0;i=2265 */ + +static UA_StatusCode function_namespace0_generated_124_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "BuildNumber"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2265LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "BuildNumber"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_124_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2265LU) +); +} + +/* SoftwareVersion - ns=0;i=2264 */ + +static UA_StatusCode function_namespace0_generated_125_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SoftwareVersion"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2264LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SoftwareVersion"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_125_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2264LU) +); +} + +/* ManufacturerName - ns=0;i=2263 */ + +static UA_StatusCode function_namespace0_generated_126_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ManufacturerName"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2263LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ManufacturerName"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_126_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2263LU) +); +} + +/* ProductUri - ns=0;i=2262 */ + +static UA_StatusCode function_namespace0_generated_127_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ProductUri"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2262LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ProductUri"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_127_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2262LU) +); +} + +/* ProductName - ns=0;i=2261 */ + +static UA_StatusCode function_namespace0_generated_128_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ProductName"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2261LU), +UA_NODEID_NUMERIC(ns[0], 2260LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ProductName"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_128_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2261LU) +); +} + +/* ShutdownReason - ns=0;i=2993 */ + +static UA_StatusCode function_namespace0_generated_129_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 21LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ShutdownReason"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2993LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ShutdownReason"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_129_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2993LU) +); +} + +/* State - ns=0;i=2259 */ + +static UA_StatusCode function_namespace0_generated_130_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 852LU); +attr.displayName = UA_LOCALIZEDTEXT("", "State"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2259LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "State"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_130_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2259LU) +); +} + +/* CurrentTime - ns=0;i=2258 */ + +static UA_StatusCode function_namespace0_generated_131_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 294LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CurrentTime"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2258LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CurrentTime"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_131_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2258LU) +); +} + +/* StartTime - ns=0;i=2257 */ + +static UA_StatusCode function_namespace0_generated_132_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 294LU); +attr.displayName = UA_LOCALIZEDTEXT("", "StartTime"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2257LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "StartTime"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_132_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2257LU) +); +} + +/* SecondsTillShutdown - ns=0;i=2992 */ + +static UA_StatusCode function_namespace0_generated_133_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SecondsTillShutdown"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2992LU), +UA_NODEID_NUMERIC(ns[0], 2256LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SecondsTillShutdown"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_133_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2992LU) +); +} + +/* ServerDiagnostics - ns=0;i=2274 */ + +static UA_StatusCode function_namespace0_generated_134_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerDiagnostics"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2274LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerDiagnostics"), +UA_NODEID_NUMERIC(ns[0], 2020LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_134_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2274LU) +); +} + +/* ServerDiagnosticsSummary - ns=0;i=2275 */ + +static UA_StatusCode function_namespace0_generated_135_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 859LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerDiagnosticsSummary"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 2274LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerDiagnosticsSummary"), +UA_NODEID_NUMERIC(ns[0], 2150LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_135_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2275LU) +); +} + +/* SecurityRejectedRequestsCount - ns=0;i=2287 */ + +static UA_StatusCode function_namespace0_generated_136_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SecurityRejectedRequestsCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2287LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SecurityRejectedRequestsCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_136_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2287LU) +); +} + +/* CumulatedSubscriptionCount - ns=0;i=2286 */ + +static UA_StatusCode function_namespace0_generated_137_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CumulatedSubscriptionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2286LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CumulatedSubscriptionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_137_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2286LU) +); +} + +/* CurrentSubscriptionCount - ns=0;i=2285 */ + +static UA_StatusCode function_namespace0_generated_138_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CurrentSubscriptionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2285LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CurrentSubscriptionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_138_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2285LU) +); +} + +/* PublishingIntervalCount - ns=0;i=2284 */ + +static UA_StatusCode function_namespace0_generated_139_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "PublishingIntervalCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2284LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "PublishingIntervalCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_139_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2284LU) +); +} + +/* SessionAbortCount - ns=0;i=2282 */ + +static UA_StatusCode function_namespace0_generated_140_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SessionAbortCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2282LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SessionAbortCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_140_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2282LU) +); +} + +/* SessionTimeoutCount - ns=0;i=2281 */ + +static UA_StatusCode function_namespace0_generated_141_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SessionTimeoutCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2281LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SessionTimeoutCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_141_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2281LU) +); +} + +/* RejectedSessionCount - ns=0;i=3705 */ + +static UA_StatusCode function_namespace0_generated_142_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RejectedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 3705LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "RejectedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_142_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3705LU) +); +} + +/* RejectedRequestsCount - ns=0;i=2288 */ + +static UA_StatusCode function_namespace0_generated_143_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RejectedRequestsCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2288LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "RejectedRequestsCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_143_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2288LU) +); +} + +/* ServerViewCount - ns=0;i=2276 */ + +static UA_StatusCode function_namespace0_generated_144_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerViewCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2276LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerViewCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_144_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2276LU) +); +} + +/* CurrentSessionCount - ns=0;i=2277 */ + +static UA_StatusCode function_namespace0_generated_145_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CurrentSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2277LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CurrentSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_145_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2277LU) +); +} + +/* CumulatedSessionCount - ns=0;i=2278 */ + +static UA_StatusCode function_namespace0_generated_146_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "CumulatedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2278LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "CumulatedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_146_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2278LU) +); +} + +/* SecurityRejectedSessionCount - ns=0;i=2279 */ + +static UA_StatusCode function_namespace0_generated_147_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SecurityRejectedSessionCount"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2279LU), +UA_NODEID_NUMERIC(ns[0], 2275LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "SecurityRejectedSessionCount"), +UA_NODEID_NUMERIC(ns[0], 63LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_147_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2279LU) +); +} + +/* EnabledFlag - ns=0;i=2294 */ + +static UA_StatusCode function_namespace0_generated_148_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 3; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 1LU); +attr.displayName = UA_LOCALIZEDTEXT("", "EnabledFlag"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2294LU), +UA_NODEID_NUMERIC(ns[0], 2274LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "EnabledFlag"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_148_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2294LU) +); +} + +/* VendorServerInfo - ns=0;i=2295 */ + +static UA_StatusCode function_namespace0_generated_149_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "VendorServerInfo"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2295LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "VendorServerInfo"), +UA_NODEID_NUMERIC(ns[0], 2033LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_149_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2295LU) +); +} + +/* NamespaceArray - ns=0;i=2255 */ + +static UA_StatusCode function_namespace0_generated_150_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "NamespaceArray"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2255LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "NamespaceArray"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_150_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2255LU) +); +} + +/* ServerArray - ns=0;i=2254 */ + +static UA_StatusCode function_namespace0_generated_151_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerArray"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2254LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "ServerArray"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_151_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2254LU) +); +} + +/* ServiceLevel - ns=0;i=2267 */ + +static UA_StatusCode function_namespace0_generated_152_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 1000.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 3LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServiceLevel"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2267LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "ServiceLevel"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_152_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2267LU) +); +} + +/* ServerRedundancy - ns=0;i=2296 */ + +static UA_StatusCode function_namespace0_generated_153_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerRedundancy"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2296LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerRedundancy"), +UA_NODEID_NUMERIC(ns[0], 2034LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_153_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2296LU) +); +} + +/* RedundancySupport - ns=0;i=3709 */ + +static UA_StatusCode function_namespace0_generated_154_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 851LU); +attr.displayName = UA_LOCALIZEDTEXT("", "RedundancySupport"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 3709LU), +UA_NODEID_NUMERIC(ns[0], 2296LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "RedundancySupport"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_154_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3709LU) +); +} + +/* VendorServerInfo - ns=0;i=2011 */ + +static UA_StatusCode function_namespace0_generated_155_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "VendorServerInfo"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2011LU), +UA_NODEID_NUMERIC(ns[0], 2004LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "VendorServerInfo"), +UA_NODEID_NUMERIC(ns[0], 2033LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 2011LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 78LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_155_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2011LU) +); +} + +/* InterfaceTypes - ns=0;i=17708 */ + +static UA_StatusCode function_namespace0_generated_156_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "InterfaceTypes"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 17708LU), +UA_NODEID_NUMERIC(ns[0], 86LU), +UA_NODEID_NUMERIC(ns[0], 35LU), +UA_QUALIFIEDNAME(ns[0], "InterfaceTypes"), +UA_NODEID_NUMERIC(ns[0], 61LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_156_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 17708LU) +); +} + +/* BaseInterfaceType - ns=0;i=17602 */ + +static UA_StatusCode function_namespace0_generated_157_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.isAbstract = true; +attr.displayName = UA_LOCALIZEDTEXT("", "BaseInterfaceType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 17602LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "BaseInterfaceType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 17602LU), UA_NODEID_NUMERIC(ns[0], 35LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 17708LU), false); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_157_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 17602LU) +); +} + +/* OperationLimitsType - ns=0;i=11564 */ + +static UA_StatusCode function_namespace0_generated_158_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "OperationLimitsType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 61LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "OperationLimitsType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_158_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11564LU) +); +} + +/* MaxNodesPerWrite - ns=0;i=11567 */ + +static UA_StatusCode function_namespace0_generated_159_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerWrite"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11567LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerWrite"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11567LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_159_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11567LU) +); +} + +/* MaxNodesPerRead - ns=0;i=11565 */ + +static UA_StatusCode function_namespace0_generated_160_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerRead"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11565LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerRead"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11565LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_160_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11565LU) +); +} + +/* MaxNodesPerMethodCall - ns=0;i=11569 */ + +static UA_StatusCode function_namespace0_generated_161_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerMethodCall"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11569LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerMethodCall"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11569LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_161_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11569LU) +); +} + +/* MaxNodesPerRegisterNodes - ns=0;i=11571 */ + +static UA_StatusCode function_namespace0_generated_162_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerRegisterNodes"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11571LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerRegisterNodes"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11571LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_162_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11571LU) +); +} + +/* MaxNodesPerBrowse - ns=0;i=11570 */ + +static UA_StatusCode function_namespace0_generated_163_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerBrowse"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11570LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerBrowse"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11570LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_163_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11570LU) +); +} + +/* MaxNodesPerNodeManagement - ns=0;i=11573 */ + +static UA_StatusCode function_namespace0_generated_164_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerNodeManagement"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11573LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerNodeManagement"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11573LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_164_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11573LU) +); +} + +/* MaxNodesPerTranslateBrowsePathsToNodeIds - ns=0;i=11572 */ + +static UA_StatusCode function_namespace0_generated_165_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerTranslateBrowsePathsToNodeIds"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11572LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerTranslateBrowsePathsToNodeIds"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11572LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_165_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11572LU) +); +} + +/* MaxMonitoredItemsPerCall - ns=0;i=11574 */ + +static UA_StatusCode function_namespace0_generated_166_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxMonitoredItemsPerCall"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11574LU), +UA_NODEID_NUMERIC(ns[0], 11564LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxMonitoredItemsPerCall"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11574LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_166_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11574LU) +); +} + +/* ServerCapabilitiesType - ns=0;i=2013 */ + +static UA_StatusCode function_namespace0_generated_167_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectTypeAttributes attr = UA_ObjectTypeAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerCapabilitiesType"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECTTYPE, +UA_NODEID_NUMERIC(ns[0], 2013LU), +UA_NODEID_NUMERIC(ns[0], 58LU), +UA_NODEID_NUMERIC(ns[0], 45LU), +UA_QUALIFIEDNAME(ns[0], "ServerCapabilitiesType"), + UA_NODEID_NULL, +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_167_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2013LU) +); +} + +/* OperationLimits - ns=0;i=11551 */ + +static UA_StatusCode function_namespace0_generated_168_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "OperationLimits"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 11551LU), +UA_NODEID_NUMERIC(ns[0], 2013LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "OperationLimits"), +UA_NODEID_NUMERIC(ns[0], 11564LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +retVal |= UA_Server_addReference(server, UA_NODEID_NUMERIC(ns[0], 11551LU), UA_NODEID_NUMERIC(ns[0], 37LU), UA_EXPANDEDNODEID_NUMERIC(ns[0], 80LU), true); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_168_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11551LU) +); +} + +/* ServerCapabilities - ns=0;i=2268 */ + +static UA_StatusCode function_namespace0_generated_169_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ServerCapabilities"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 2253LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ServerCapabilities"), +UA_NODEID_NUMERIC(ns[0], 2013LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_169_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2268LU) +); +} + +/* ServerProfileArray - ns=0;i=2269 */ + +static UA_StatusCode function_namespace0_generated_170_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 12LU); +attr.displayName = UA_LOCALIZEDTEXT("", "ServerProfileArray"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2269LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "ServerProfileArray"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_170_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2269LU) +); +} + +/* AggregateFunctions - ns=0;i=2997 */ + +static UA_StatusCode function_namespace0_generated_171_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "AggregateFunctions"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2997LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "AggregateFunctions"), +UA_NODEID_NUMERIC(ns[0], 61LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_171_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2997LU) +); +} + +/* ModellingRules - ns=0;i=2996 */ + +static UA_StatusCode function_namespace0_generated_172_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "ModellingRules"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 2996LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "ModellingRules"), +UA_NODEID_NUMERIC(ns[0], 61LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_172_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2996LU) +); +} + +/* OperationLimits - ns=0;i=11704 */ + +static UA_StatusCode function_namespace0_generated_173_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_ObjectAttributes attr = UA_ObjectAttributes_default; +attr.displayName = UA_LOCALIZEDTEXT("", "OperationLimits"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_OBJECT, +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 47LU), +UA_QUALIFIEDNAME(ns[0], "OperationLimits"), +UA_NODEID_NUMERIC(ns[0], 11564LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_173_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11704LU) +); +} + +/* MaxNodesPerWrite - ns=0;i=11707 */ + +static UA_StatusCode function_namespace0_generated_174_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerWrite"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11707LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerWrite"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_174_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11707LU) +); +} + +/* MaxNodesPerRead - ns=0;i=11705 */ + +static UA_StatusCode function_namespace0_generated_175_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerRead"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11705LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerRead"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_175_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11705LU) +); +} + +/* MaxMonitoredItemsPerCall - ns=0;i=11714 */ + +static UA_StatusCode function_namespace0_generated_176_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxMonitoredItemsPerCall"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11714LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxMonitoredItemsPerCall"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_176_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11714LU) +); +} + +/* MaxNodesPerRegisterNodes - ns=0;i=11711 */ + +static UA_StatusCode function_namespace0_generated_177_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerRegisterNodes"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11711LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerRegisterNodes"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_177_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11711LU) +); +} + +/* MaxNodesPerBrowse - ns=0;i=11710 */ + +static UA_StatusCode function_namespace0_generated_178_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerBrowse"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11710LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerBrowse"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_178_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11710LU) +); +} + +/* MaxNodesPerNodeManagement - ns=0;i=11713 */ + +static UA_StatusCode function_namespace0_generated_179_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerNodeManagement"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11713LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerNodeManagement"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_179_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11713LU) +); +} + +/* MaxNodesPerTranslateBrowsePathsToNodeIds - ns=0;i=11712 */ + +static UA_StatusCode function_namespace0_generated_180_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerTranslateBrowsePathsToNodeIds"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11712LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerTranslateBrowsePathsToNodeIds"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_180_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11712LU) +); +} + +/* MaxNodesPerMethodCall - ns=0;i=11709 */ + +static UA_StatusCode function_namespace0_generated_181_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 7LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxNodesPerMethodCall"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 11709LU), +UA_NODEID_NUMERIC(ns[0], 11704LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxNodesPerMethodCall"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_181_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 11709LU) +); +} + +/* SoftwareCertificates - ns=0;i=3704 */ + +static UA_StatusCode function_namespace0_generated_182_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 344LU); +attr.displayName = UA_LOCALIZEDTEXT("", "SoftwareCertificates"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 3704LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "SoftwareCertificates"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_182_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 3704LU) +); +} + +/* MinSupportedSampleRate - ns=0;i=2272 */ + +static UA_StatusCode function_namespace0_generated_183_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 290LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MinSupportedSampleRate"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2272LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MinSupportedSampleRate"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_183_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2272LU) +); +} + +/* LocaleIdArray - ns=0;i=2271 */ + +static UA_StatusCode function_namespace0_generated_184_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +attr.valueRank = 1; +attr.arrayDimensionsSize = 1; +UA_UInt32 arrayDimensions[1]; +arrayDimensions[0] = 0; +attr.arrayDimensions = &arrayDimensions[0]; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 295LU); +attr.displayName = UA_LOCALIZEDTEXT("", "LocaleIdArray"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2271LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "LocaleIdArray"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_184_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2271LU) +); +} + +/* MaxQueryContinuationPoints - ns=0;i=2736 */ + +static UA_StatusCode function_namespace0_generated_185_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 5LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxQueryContinuationPoints"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2736LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxQueryContinuationPoints"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_185_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2736LU) +); +} + +/* MaxHistoryContinuationPoints - ns=0;i=2737 */ + +static UA_StatusCode function_namespace0_generated_186_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 5LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxHistoryContinuationPoints"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2737LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxHistoryContinuationPoints"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_186_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2737LU) +); +} + +/* MaxBrowseContinuationPoints - ns=0;i=2735 */ + +static UA_StatusCode function_namespace0_generated_187_begin(UA_Server *server, UA_UInt16* ns) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +UA_VariableAttributes attr = UA_VariableAttributes_default; +attr.minimumSamplingInterval = 0.000000; +attr.userAccessLevel = 1; +attr.accessLevel = 1; +/* Value rank inherited */ +attr.valueRank = -1; +attr.dataType = UA_NODEID_NUMERIC(ns[0], 5LU); +attr.displayName = UA_LOCALIZEDTEXT("", "MaxBrowseContinuationPoints"); +retVal |= UA_Server_addNode_begin(server, UA_NODECLASS_VARIABLE, +UA_NODEID_NUMERIC(ns[0], 2735LU), +UA_NODEID_NUMERIC(ns[0], 2268LU), +UA_NODEID_NUMERIC(ns[0], 46LU), +UA_QUALIFIEDNAME(ns[0], "MaxBrowseContinuationPoints"), +UA_NODEID_NUMERIC(ns[0], 68LU), +(const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],NULL, NULL); +return retVal; +} + +static UA_StatusCode function_namespace0_generated_187_finish(UA_Server *server, UA_UInt16* ns) { +return UA_Server_addNode_finish(server, +UA_NODEID_NUMERIC(ns[0], 2735LU) +); +} + +UA_StatusCode namespace0_generated(UA_Server *server) { +UA_StatusCode retVal = UA_STATUSCODE_GOOD; +/* Use namespace ids generated by the server */ +UA_UInt16 ns[1]; +ns[0] = UA_Server_addNamespace(server, "http://opcfoundation.org/UA/"); + +/* Load custom datatype definitions into the server */ +bool dummy = ( +!(retVal = function_namespace0_generated_0_begin(server, ns)) +&& !(retVal = function_namespace0_generated_0_finish(server, ns)) +&& !(retVal = function_namespace0_generated_1_begin(server, ns)) +&& !(retVal = function_namespace0_generated_2_begin(server, ns)) +&& !(retVal = function_namespace0_generated_3_begin(server, ns)) +&& !(retVal = function_namespace0_generated_4_begin(server, ns)) +&& !(retVal = function_namespace0_generated_5_begin(server, ns)) +&& !(retVal = function_namespace0_generated_6_begin(server, ns)) +&& !(retVal = function_namespace0_generated_7_begin(server, ns)) +&& !(retVal = function_namespace0_generated_8_begin(server, ns)) +&& !(retVal = function_namespace0_generated_9_begin(server, ns)) +&& !(retVal = function_namespace0_generated_10_begin(server, ns)) +&& !(retVal = function_namespace0_generated_11_begin(server, ns)) +&& !(retVal = function_namespace0_generated_12_begin(server, ns)) +&& !(retVal = function_namespace0_generated_13_begin(server, ns)) +&& !(retVal = function_namespace0_generated_14_begin(server, ns)) +&& !(retVal = function_namespace0_generated_15_begin(server, ns)) +&& !(retVal = function_namespace0_generated_16_begin(server, ns)) +&& !(retVal = function_namespace0_generated_17_begin(server, ns)) +&& !(retVal = function_namespace0_generated_18_begin(server, ns)) +&& !(retVal = function_namespace0_generated_19_begin(server, ns)) +&& !(retVal = function_namespace0_generated_20_begin(server, ns)) +&& !(retVal = function_namespace0_generated_21_begin(server, ns)) +&& !(retVal = function_namespace0_generated_22_begin(server, ns)) +&& !(retVal = function_namespace0_generated_23_begin(server, ns)) +&& !(retVal = function_namespace0_generated_24_begin(server, ns)) +&& !(retVal = function_namespace0_generated_25_begin(server, ns)) +&& !(retVal = function_namespace0_generated_26_begin(server, ns)) +&& !(retVal = function_namespace0_generated_27_begin(server, ns)) +&& !(retVal = function_namespace0_generated_28_begin(server, ns)) +&& !(retVal = function_namespace0_generated_29_begin(server, ns)) +&& !(retVal = function_namespace0_generated_30_begin(server, ns)) +&& !(retVal = function_namespace0_generated_31_begin(server, ns)) +&& !(retVal = function_namespace0_generated_32_begin(server, ns)) +&& !(retVal = function_namespace0_generated_33_begin(server, ns)) +&& !(retVal = function_namespace0_generated_34_begin(server, ns)) +&& !(retVal = function_namespace0_generated_35_begin(server, ns)) +&& !(retVal = function_namespace0_generated_36_begin(server, ns)) +&& !(retVal = function_namespace0_generated_37_begin(server, ns)) +&& !(retVal = function_namespace0_generated_38_begin(server, ns)) +&& !(retVal = function_namespace0_generated_39_begin(server, ns)) +&& !(retVal = function_namespace0_generated_40_begin(server, ns)) +&& !(retVal = function_namespace0_generated_41_begin(server, ns)) +&& !(retVal = function_namespace0_generated_42_begin(server, ns)) +&& !(retVal = function_namespace0_generated_42_finish(server, ns)) +&& !(retVal = function_namespace0_generated_43_begin(server, ns)) +&& !(retVal = function_namespace0_generated_43_finish(server, ns)) +&& !(retVal = function_namespace0_generated_44_begin(server, ns)) +&& !(retVal = function_namespace0_generated_44_finish(server, ns)) +&& !(retVal = function_namespace0_generated_45_begin(server, ns)) +&& !(retVal = function_namespace0_generated_45_finish(server, ns)) +&& !(retVal = function_namespace0_generated_46_begin(server, ns)) +&& !(retVal = function_namespace0_generated_46_finish(server, ns)) +&& !(retVal = function_namespace0_generated_47_begin(server, ns)) +&& !(retVal = function_namespace0_generated_48_begin(server, ns)) +&& !(retVal = function_namespace0_generated_49_begin(server, ns)) +&& !(retVal = function_namespace0_generated_50_begin(server, ns)) +&& !(retVal = function_namespace0_generated_51_begin(server, ns)) +&& !(retVal = function_namespace0_generated_52_begin(server, ns)) +&& !(retVal = function_namespace0_generated_53_begin(server, ns)) +&& !(retVal = function_namespace0_generated_54_begin(server, ns)) +&& !(retVal = function_namespace0_generated_55_begin(server, ns)) +&& !(retVal = function_namespace0_generated_56_begin(server, ns)) +&& !(retVal = function_namespace0_generated_57_begin(server, ns)) +&& !(retVal = function_namespace0_generated_58_begin(server, ns)) +&& !(retVal = function_namespace0_generated_59_begin(server, ns)) +&& !(retVal = function_namespace0_generated_60_begin(server, ns)) +&& !(retVal = function_namespace0_generated_61_begin(server, ns)) +&& !(retVal = function_namespace0_generated_62_begin(server, ns)) +&& !(retVal = function_namespace0_generated_63_begin(server, ns)) +&& !(retVal = function_namespace0_generated_64_begin(server, ns)) +&& !(retVal = function_namespace0_generated_65_begin(server, ns)) +&& !(retVal = function_namespace0_generated_66_begin(server, ns)) +&& !(retVal = function_namespace0_generated_67_begin(server, ns)) +&& !(retVal = function_namespace0_generated_68_begin(server, ns)) +&& !(retVal = function_namespace0_generated_69_begin(server, ns)) +&& !(retVal = function_namespace0_generated_70_begin(server, ns)) +&& !(retVal = function_namespace0_generated_71_begin(server, ns)) +&& !(retVal = function_namespace0_generated_72_begin(server, ns)) +&& !(retVal = function_namespace0_generated_73_begin(server, ns)) +&& !(retVal = function_namespace0_generated_74_begin(server, ns)) +&& !(retVal = function_namespace0_generated_75_begin(server, ns)) +&& !(retVal = function_namespace0_generated_76_begin(server, ns)) +&& !(retVal = function_namespace0_generated_77_begin(server, ns)) +&& !(retVal = function_namespace0_generated_78_begin(server, ns)) +&& !(retVal = function_namespace0_generated_79_begin(server, ns)) +&& !(retVal = function_namespace0_generated_80_begin(server, ns)) +&& !(retVal = function_namespace0_generated_81_begin(server, ns)) +&& !(retVal = function_namespace0_generated_82_begin(server, ns)) +&& !(retVal = function_namespace0_generated_83_begin(server, ns)) +&& !(retVal = function_namespace0_generated_84_begin(server, ns)) +&& !(retVal = function_namespace0_generated_85_begin(server, ns)) +&& !(retVal = function_namespace0_generated_86_begin(server, ns)) +&& !(retVal = function_namespace0_generated_87_begin(server, ns)) +&& !(retVal = function_namespace0_generated_88_begin(server, ns)) +&& !(retVal = function_namespace0_generated_89_begin(server, ns)) +&& !(retVal = function_namespace0_generated_90_begin(server, ns)) +&& !(retVal = function_namespace0_generated_91_begin(server, ns)) +&& !(retVal = function_namespace0_generated_92_begin(server, ns)) +&& !(retVal = function_namespace0_generated_93_begin(server, ns)) +&& !(retVal = function_namespace0_generated_94_begin(server, ns)) +&& !(retVal = function_namespace0_generated_95_begin(server, ns)) +&& !(retVal = function_namespace0_generated_96_begin(server, ns)) +&& !(retVal = function_namespace0_generated_97_begin(server, ns)) +&& !(retVal = function_namespace0_generated_98_begin(server, ns)) +&& !(retVal = function_namespace0_generated_99_begin(server, ns)) +&& !(retVal = function_namespace0_generated_100_begin(server, ns)) +&& !(retVal = function_namespace0_generated_101_begin(server, ns)) +&& !(retVal = function_namespace0_generated_102_begin(server, ns)) +&& !(retVal = function_namespace0_generated_103_begin(server, ns)) +&& !(retVal = function_namespace0_generated_104_begin(server, ns)) +&& !(retVal = function_namespace0_generated_105_begin(server, ns)) +&& !(retVal = function_namespace0_generated_106_begin(server, ns)) +&& !(retVal = function_namespace0_generated_107_begin(server, ns)) +&& !(retVal = function_namespace0_generated_108_begin(server, ns)) +&& !(retVal = function_namespace0_generated_109_begin(server, ns)) +&& !(retVal = function_namespace0_generated_110_begin(server, ns)) +&& !(retVal = function_namespace0_generated_111_begin(server, ns)) +&& !(retVal = function_namespace0_generated_112_begin(server, ns)) +&& !(retVal = function_namespace0_generated_113_begin(server, ns)) +&& !(retVal = function_namespace0_generated_114_begin(server, ns)) +&& !(retVal = function_namespace0_generated_115_begin(server, ns)) +&& !(retVal = function_namespace0_generated_116_begin(server, ns)) +&& !(retVal = function_namespace0_generated_117_begin(server, ns)) +&& !(retVal = function_namespace0_generated_118_begin(server, ns)) +&& !(retVal = function_namespace0_generated_119_begin(server, ns)) +&& !(retVal = function_namespace0_generated_120_begin(server, ns)) +&& !(retVal = function_namespace0_generated_121_begin(server, ns)) +&& !(retVal = function_namespace0_generated_122_begin(server, ns)) +&& !(retVal = function_namespace0_generated_123_begin(server, ns)) +&& !(retVal = function_namespace0_generated_124_begin(server, ns)) +&& !(retVal = function_namespace0_generated_125_begin(server, ns)) +&& !(retVal = function_namespace0_generated_126_begin(server, ns)) +&& !(retVal = function_namespace0_generated_127_begin(server, ns)) +&& !(retVal = function_namespace0_generated_128_begin(server, ns)) +&& !(retVal = function_namespace0_generated_129_begin(server, ns)) +&& !(retVal = function_namespace0_generated_130_begin(server, ns)) +&& !(retVal = function_namespace0_generated_131_begin(server, ns)) +&& !(retVal = function_namespace0_generated_132_begin(server, ns)) +&& !(retVal = function_namespace0_generated_133_begin(server, ns)) +&& !(retVal = function_namespace0_generated_134_begin(server, ns)) +&& !(retVal = function_namespace0_generated_135_begin(server, ns)) +&& !(retVal = function_namespace0_generated_136_begin(server, ns)) +&& !(retVal = function_namespace0_generated_137_begin(server, ns)) +&& !(retVal = function_namespace0_generated_138_begin(server, ns)) +&& !(retVal = function_namespace0_generated_139_begin(server, ns)) +&& !(retVal = function_namespace0_generated_140_begin(server, ns)) +&& !(retVal = function_namespace0_generated_141_begin(server, ns)) +&& !(retVal = function_namespace0_generated_142_begin(server, ns)) +&& !(retVal = function_namespace0_generated_143_begin(server, ns)) +&& !(retVal = function_namespace0_generated_144_begin(server, ns)) +&& !(retVal = function_namespace0_generated_145_begin(server, ns)) +&& !(retVal = function_namespace0_generated_146_begin(server, ns)) +&& !(retVal = function_namespace0_generated_147_begin(server, ns)) +&& !(retVal = function_namespace0_generated_148_begin(server, ns)) +&& !(retVal = function_namespace0_generated_149_begin(server, ns)) +&& !(retVal = function_namespace0_generated_150_begin(server, ns)) +&& !(retVal = function_namespace0_generated_151_begin(server, ns)) +&& !(retVal = function_namespace0_generated_152_begin(server, ns)) +&& !(retVal = function_namespace0_generated_153_begin(server, ns)) +&& !(retVal = function_namespace0_generated_154_begin(server, ns)) +&& !(retVal = function_namespace0_generated_155_begin(server, ns)) +&& !(retVal = function_namespace0_generated_156_begin(server, ns)) +&& !(retVal = function_namespace0_generated_157_begin(server, ns)) +&& !(retVal = function_namespace0_generated_158_begin(server, ns)) +&& !(retVal = function_namespace0_generated_159_begin(server, ns)) +&& !(retVal = function_namespace0_generated_160_begin(server, ns)) +&& !(retVal = function_namespace0_generated_161_begin(server, ns)) +&& !(retVal = function_namespace0_generated_162_begin(server, ns)) +&& !(retVal = function_namespace0_generated_163_begin(server, ns)) +&& !(retVal = function_namespace0_generated_164_begin(server, ns)) +&& !(retVal = function_namespace0_generated_165_begin(server, ns)) +&& !(retVal = function_namespace0_generated_166_begin(server, ns)) +&& !(retVal = function_namespace0_generated_167_begin(server, ns)) +&& !(retVal = function_namespace0_generated_168_begin(server, ns)) +&& !(retVal = function_namespace0_generated_169_begin(server, ns)) +&& !(retVal = function_namespace0_generated_170_begin(server, ns)) +&& !(retVal = function_namespace0_generated_171_begin(server, ns)) +&& !(retVal = function_namespace0_generated_172_begin(server, ns)) +&& !(retVal = function_namespace0_generated_173_begin(server, ns)) +&& !(retVal = function_namespace0_generated_174_begin(server, ns)) +&& !(retVal = function_namespace0_generated_175_begin(server, ns)) +&& !(retVal = function_namespace0_generated_176_begin(server, ns)) +&& !(retVal = function_namespace0_generated_177_begin(server, ns)) +&& !(retVal = function_namespace0_generated_178_begin(server, ns)) +&& !(retVal = function_namespace0_generated_179_begin(server, ns)) +&& !(retVal = function_namespace0_generated_180_begin(server, ns)) +&& !(retVal = function_namespace0_generated_181_begin(server, ns)) +&& !(retVal = function_namespace0_generated_182_begin(server, ns)) +&& !(retVal = function_namespace0_generated_183_begin(server, ns)) +&& !(retVal = function_namespace0_generated_184_begin(server, ns)) +&& !(retVal = function_namespace0_generated_185_begin(server, ns)) +&& !(retVal = function_namespace0_generated_186_begin(server, ns)) +&& !(retVal = function_namespace0_generated_187_begin(server, ns)) +&& !(retVal = function_namespace0_generated_187_finish(server, ns)) +&& !(retVal = function_namespace0_generated_186_finish(server, ns)) +&& !(retVal = function_namespace0_generated_185_finish(server, ns)) +&& !(retVal = function_namespace0_generated_184_finish(server, ns)) +&& !(retVal = function_namespace0_generated_183_finish(server, ns)) +&& !(retVal = function_namespace0_generated_182_finish(server, ns)) +&& !(retVal = function_namespace0_generated_181_finish(server, ns)) +&& !(retVal = function_namespace0_generated_180_finish(server, ns)) +&& !(retVal = function_namespace0_generated_179_finish(server, ns)) +&& !(retVal = function_namespace0_generated_178_finish(server, ns)) +&& !(retVal = function_namespace0_generated_177_finish(server, ns)) +&& !(retVal = function_namespace0_generated_176_finish(server, ns)) +&& !(retVal = function_namespace0_generated_175_finish(server, ns)) +&& !(retVal = function_namespace0_generated_174_finish(server, ns)) +&& !(retVal = function_namespace0_generated_173_finish(server, ns)) +&& !(retVal = function_namespace0_generated_172_finish(server, ns)) +&& !(retVal = function_namespace0_generated_171_finish(server, ns)) +&& !(retVal = function_namespace0_generated_170_finish(server, ns)) +&& !(retVal = function_namespace0_generated_169_finish(server, ns)) +&& !(retVal = function_namespace0_generated_168_finish(server, ns)) +&& !(retVal = function_namespace0_generated_167_finish(server, ns)) +&& !(retVal = function_namespace0_generated_166_finish(server, ns)) +&& !(retVal = function_namespace0_generated_165_finish(server, ns)) +&& !(retVal = function_namespace0_generated_164_finish(server, ns)) +&& !(retVal = function_namespace0_generated_163_finish(server, ns)) +&& !(retVal = function_namespace0_generated_162_finish(server, ns)) +&& !(retVal = function_namespace0_generated_161_finish(server, ns)) +&& !(retVal = function_namespace0_generated_160_finish(server, ns)) +&& !(retVal = function_namespace0_generated_159_finish(server, ns)) +&& !(retVal = function_namespace0_generated_158_finish(server, ns)) +&& !(retVal = function_namespace0_generated_157_finish(server, ns)) +&& !(retVal = function_namespace0_generated_156_finish(server, ns)) +&& !(retVal = function_namespace0_generated_155_finish(server, ns)) +&& !(retVal = function_namespace0_generated_154_finish(server, ns)) +&& !(retVal = function_namespace0_generated_153_finish(server, ns)) +&& !(retVal = function_namespace0_generated_152_finish(server, ns)) +&& !(retVal = function_namespace0_generated_151_finish(server, ns)) +&& !(retVal = function_namespace0_generated_150_finish(server, ns)) +&& !(retVal = function_namespace0_generated_149_finish(server, ns)) +&& !(retVal = function_namespace0_generated_148_finish(server, ns)) +&& !(retVal = function_namespace0_generated_147_finish(server, ns)) +&& !(retVal = function_namespace0_generated_146_finish(server, ns)) +&& !(retVal = function_namespace0_generated_145_finish(server, ns)) +&& !(retVal = function_namespace0_generated_144_finish(server, ns)) +&& !(retVal = function_namespace0_generated_143_finish(server, ns)) +&& !(retVal = function_namespace0_generated_142_finish(server, ns)) +&& !(retVal = function_namespace0_generated_141_finish(server, ns)) +&& !(retVal = function_namespace0_generated_140_finish(server, ns)) +&& !(retVal = function_namespace0_generated_139_finish(server, ns)) +&& !(retVal = function_namespace0_generated_138_finish(server, ns)) +&& !(retVal = function_namespace0_generated_137_finish(server, ns)) +&& !(retVal = function_namespace0_generated_136_finish(server, ns)) +&& !(retVal = function_namespace0_generated_135_finish(server, ns)) +&& !(retVal = function_namespace0_generated_134_finish(server, ns)) +&& !(retVal = function_namespace0_generated_133_finish(server, ns)) +&& !(retVal = function_namespace0_generated_132_finish(server, ns)) +&& !(retVal = function_namespace0_generated_131_finish(server, ns)) +&& !(retVal = function_namespace0_generated_130_finish(server, ns)) +&& !(retVal = function_namespace0_generated_129_finish(server, ns)) +&& !(retVal = function_namespace0_generated_128_finish(server, ns)) +&& !(retVal = function_namespace0_generated_127_finish(server, ns)) +&& !(retVal = function_namespace0_generated_126_finish(server, ns)) +&& !(retVal = function_namespace0_generated_125_finish(server, ns)) +&& !(retVal = function_namespace0_generated_124_finish(server, ns)) +&& !(retVal = function_namespace0_generated_123_finish(server, ns)) +&& !(retVal = function_namespace0_generated_122_finish(server, ns)) +&& !(retVal = function_namespace0_generated_121_finish(server, ns)) +&& !(retVal = function_namespace0_generated_120_finish(server, ns)) +&& !(retVal = function_namespace0_generated_119_finish(server, ns)) +&& !(retVal = function_namespace0_generated_118_finish(server, ns)) +&& !(retVal = function_namespace0_generated_117_finish(server, ns)) +&& !(retVal = function_namespace0_generated_116_finish(server, ns)) +&& !(retVal = function_namespace0_generated_115_finish(server, ns)) +&& !(retVal = function_namespace0_generated_114_finish(server, ns)) +&& !(retVal = function_namespace0_generated_113_finish(server, ns)) +&& !(retVal = function_namespace0_generated_112_finish(server, ns)) +&& !(retVal = function_namespace0_generated_111_finish(server, ns)) +&& !(retVal = function_namespace0_generated_110_finish(server, ns)) +&& !(retVal = function_namespace0_generated_109_finish(server, ns)) +&& !(retVal = function_namespace0_generated_108_finish(server, ns)) +&& !(retVal = function_namespace0_generated_107_finish(server, ns)) +&& !(retVal = function_namespace0_generated_106_finish(server, ns)) +&& !(retVal = function_namespace0_generated_105_finish(server, ns)) +&& !(retVal = function_namespace0_generated_104_finish(server, ns)) +&& !(retVal = function_namespace0_generated_103_finish(server, ns)) +&& !(retVal = function_namespace0_generated_102_finish(server, ns)) +&& !(retVal = function_namespace0_generated_101_finish(server, ns)) +&& !(retVal = function_namespace0_generated_100_finish(server, ns)) +&& !(retVal = function_namespace0_generated_99_finish(server, ns)) +&& !(retVal = function_namespace0_generated_98_finish(server, ns)) +&& !(retVal = function_namespace0_generated_97_finish(server, ns)) +&& !(retVal = function_namespace0_generated_96_finish(server, ns)) +&& !(retVal = function_namespace0_generated_95_finish(server, ns)) +&& !(retVal = function_namespace0_generated_94_finish(server, ns)) +&& !(retVal = function_namespace0_generated_93_finish(server, ns)) +&& !(retVal = function_namespace0_generated_92_finish(server, ns)) +&& !(retVal = function_namespace0_generated_91_finish(server, ns)) +&& !(retVal = function_namespace0_generated_90_finish(server, ns)) +&& !(retVal = function_namespace0_generated_89_finish(server, ns)) +&& !(retVal = function_namespace0_generated_88_finish(server, ns)) +&& !(retVal = function_namespace0_generated_87_finish(server, ns)) +&& !(retVal = function_namespace0_generated_86_finish(server, ns)) +&& !(retVal = function_namespace0_generated_85_finish(server, ns)) +&& !(retVal = function_namespace0_generated_84_finish(server, ns)) +&& !(retVal = function_namespace0_generated_83_finish(server, ns)) +&& !(retVal = function_namespace0_generated_82_finish(server, ns)) +&& !(retVal = function_namespace0_generated_81_finish(server, ns)) +&& !(retVal = function_namespace0_generated_80_finish(server, ns)) +&& !(retVal = function_namespace0_generated_79_finish(server, ns)) +&& !(retVal = function_namespace0_generated_78_finish(server, ns)) +&& !(retVal = function_namespace0_generated_77_finish(server, ns)) +&& !(retVal = function_namespace0_generated_76_finish(server, ns)) +&& !(retVal = function_namespace0_generated_75_finish(server, ns)) +&& !(retVal = function_namespace0_generated_74_finish(server, ns)) +&& !(retVal = function_namespace0_generated_73_finish(server, ns)) +&& !(retVal = function_namespace0_generated_72_finish(server, ns)) +&& !(retVal = function_namespace0_generated_71_finish(server, ns)) +&& !(retVal = function_namespace0_generated_70_finish(server, ns)) +&& !(retVal = function_namespace0_generated_69_finish(server, ns)) +&& !(retVal = function_namespace0_generated_68_finish(server, ns)) +&& !(retVal = function_namespace0_generated_67_finish(server, ns)) +&& !(retVal = function_namespace0_generated_66_finish(server, ns)) +&& !(retVal = function_namespace0_generated_65_finish(server, ns)) +&& !(retVal = function_namespace0_generated_64_finish(server, ns)) +&& !(retVal = function_namespace0_generated_63_finish(server, ns)) +&& !(retVal = function_namespace0_generated_62_finish(server, ns)) +&& !(retVal = function_namespace0_generated_61_finish(server, ns)) +&& !(retVal = function_namespace0_generated_60_finish(server, ns)) +&& !(retVal = function_namespace0_generated_59_finish(server, ns)) +&& !(retVal = function_namespace0_generated_58_finish(server, ns)) +&& !(retVal = function_namespace0_generated_57_finish(server, ns)) +&& !(retVal = function_namespace0_generated_56_finish(server, ns)) +&& !(retVal = function_namespace0_generated_55_finish(server, ns)) +&& !(retVal = function_namespace0_generated_54_finish(server, ns)) +&& !(retVal = function_namespace0_generated_53_finish(server, ns)) +&& !(retVal = function_namespace0_generated_52_finish(server, ns)) +&& !(retVal = function_namespace0_generated_51_finish(server, ns)) +&& !(retVal = function_namespace0_generated_50_finish(server, ns)) +&& !(retVal = function_namespace0_generated_49_finish(server, ns)) +&& !(retVal = function_namespace0_generated_48_finish(server, ns)) +&& !(retVal = function_namespace0_generated_47_finish(server, ns)) +&& !(retVal = function_namespace0_generated_41_finish(server, ns)) +&& !(retVal = function_namespace0_generated_40_finish(server, ns)) +&& !(retVal = function_namespace0_generated_39_finish(server, ns)) +&& !(retVal = function_namespace0_generated_38_finish(server, ns)) +&& !(retVal = function_namespace0_generated_37_finish(server, ns)) +&& !(retVal = function_namespace0_generated_36_finish(server, ns)) +&& !(retVal = function_namespace0_generated_35_finish(server, ns)) +&& !(retVal = function_namespace0_generated_34_finish(server, ns)) +&& !(retVal = function_namespace0_generated_33_finish(server, ns)) +&& !(retVal = function_namespace0_generated_32_finish(server, ns)) +&& !(retVal = function_namespace0_generated_31_finish(server, ns)) +&& !(retVal = function_namespace0_generated_30_finish(server, ns)) +&& !(retVal = function_namespace0_generated_29_finish(server, ns)) +&& !(retVal = function_namespace0_generated_28_finish(server, ns)) +&& !(retVal = function_namespace0_generated_27_finish(server, ns)) +&& !(retVal = function_namespace0_generated_26_finish(server, ns)) +&& !(retVal = function_namespace0_generated_25_finish(server, ns)) +&& !(retVal = function_namespace0_generated_24_finish(server, ns)) +&& !(retVal = function_namespace0_generated_23_finish(server, ns)) +&& !(retVal = function_namespace0_generated_22_finish(server, ns)) +&& !(retVal = function_namespace0_generated_21_finish(server, ns)) +&& !(retVal = function_namespace0_generated_20_finish(server, ns)) +&& !(retVal = function_namespace0_generated_19_finish(server, ns)) +&& !(retVal = function_namespace0_generated_18_finish(server, ns)) +&& !(retVal = function_namespace0_generated_17_finish(server, ns)) +&& !(retVal = function_namespace0_generated_16_finish(server, ns)) +&& !(retVal = function_namespace0_generated_15_finish(server, ns)) +&& !(retVal = function_namespace0_generated_14_finish(server, ns)) +&& !(retVal = function_namespace0_generated_13_finish(server, ns)) +&& !(retVal = function_namespace0_generated_12_finish(server, ns)) +&& !(retVal = function_namespace0_generated_11_finish(server, ns)) +&& !(retVal = function_namespace0_generated_10_finish(server, ns)) +&& !(retVal = function_namespace0_generated_9_finish(server, ns)) +&& !(retVal = function_namespace0_generated_8_finish(server, ns)) +&& !(retVal = function_namespace0_generated_7_finish(server, ns)) +&& !(retVal = function_namespace0_generated_6_finish(server, ns)) +&& !(retVal = function_namespace0_generated_5_finish(server, ns)) +&& !(retVal = function_namespace0_generated_4_finish(server, ns)) +&& !(retVal = function_namespace0_generated_3_finish(server, ns)) +&& !(retVal = function_namespace0_generated_2_finish(server, ns)) +&& !(retVal = function_namespace0_generated_1_finish(server, ns)) +); (void)(dummy); +return retVal; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/ua_types_lex.c" ***********************************/ + +/* Generated by re2c 1.1.1 */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * + */ + + +/* Lexing and parsing of builtin data types. These are helper functions that not + * required by the SDK internally. But they are useful for users who want to use + * standard-specified humand readable encodings for NodeIds, etc. + * + * This compilation unit uses the re2c lexer generator. The final C source is + * generated with the following script: + * + * re2c -i --no-generation-date ua_types_lex.re > ua_types_lex.c + * + * In order that users of the SDK don't need to install re2c, always commit a + * recent ua_types_lex.c if changes are made to the lexer. */ + +#define YYCURSOR pos +#define YYMARKER context.marker +#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of + * \0 when the input ends*/ +#define YYSKIP() ++YYCURSOR; +#define YYBACKUP() YYMARKER = YYCURSOR +#define YYRESTORE() YYCURSOR = YYMARKER +#define YYSTAGP(t) t = YYCURSOR +#define YYSTAGN(t) t = NULL + +typedef struct { + const char *marker; + const char *yyt1;const char *yyt2;const char *yyt3;const char *yyt4;const char *yyt5; +} LexContext; + + + +static UA_StatusCode +parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) { + size_t len = (size_t)(e - s); + if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-') + return UA_STATUSCODE_BADINTERNALERROR; + + UA_UInt32 tmp; + if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data1 = tmp; + + if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data2 = (UA_UInt16)tmp; + + if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data3 = (UA_UInt16)tmp; + + if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data4[0] = (UA_Byte)tmp; + + if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data4[1] = (UA_Byte)tmp; + + for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) { + if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2) + return UA_STATUSCODE_BADINTERNALERROR; + guid->data4[pos] = (UA_Byte)tmp; + } + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Guid_parse(UA_Guid *guid, const UA_String str) { + UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length); + if(res != UA_STATUSCODE_GOOD) + *guid = UA_GUID_NULL; + return res; +} + +static UA_StatusCode +parse_nodeid_body(UA_NodeId *id, const char *body, const char *end) { + size_t len = (size_t)(end - (body+2)); + UA_StatusCode res = UA_STATUSCODE_GOOD; + switch(*body) { + case 'i': { + if(UA_readNumber((const UA_Byte*)body+2, len, &id->identifier.numeric) != len) + return UA_STATUSCODE_BADINTERNALERROR; + id->identifierType = UA_NODEIDTYPE_NUMERIC; + break; + } + case 's': { + UA_String tmpstr; + tmpstr.data = (UA_Byte*)(uintptr_t)body+2; + tmpstr.length = len; + res = UA_String_copy(&tmpstr, &id->identifier.string); + if(res != UA_STATUSCODE_GOOD) + break; + id->identifierType = UA_NODEIDTYPE_STRING; + break; + } + case 'g': + res = parse_guid(&id->identifier.guid, (const UA_Byte*)body+2, (const UA_Byte*)end); + if(res == UA_STATUSCODE_GOOD) + id->identifierType = UA_NODEIDTYPE_GUID; + break; + case 'b': + id->identifier.byteString.data = + UA_unbase64((const unsigned char*)body+2, len, + &id->identifier.byteString.length); + if(!id->identifier.byteString.data && len > 0) + return UA_STATUSCODE_BADINTERNALERROR; + id->identifierType = UA_NODEIDTYPE_BYTESTRING; + break; + default: + return UA_STATUSCODE_BADINTERNALERROR; + } + return res; +} + +static UA_StatusCode +parse_nodeid(UA_NodeId *id, const char *pos, const char *end) { + *id = UA_NODEID_NULL; /* Reset the NodeId */ + LexContext context; + memset(&context, 0, sizeof(LexContext)); + const char *ns = NULL, *nse= NULL; + + +{ + char yych; + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + case 's': + YYSTAGN (context.yyt1); + YYSTAGN (context.yyt2); + goto yy4; + case 'n': goto yy5; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { (void)pos; return UA_STATUSCODE_BADINTERNALERROR; } +yy4: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy6; + default: goto yy3; + } +yy5: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case 's': goto yy8; + default: goto yy3; + } +yy6: + YYSKIP (); + ns = context.yyt1; + nse = context.yyt2; + { + (void)pos; // Get rid of a dead store clang-analyzer warning + if(ns) { + UA_UInt32 tmp; + size_t len = (size_t)(nse - ns); + if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len) + return UA_STATUSCODE_BADINTERNALERROR; + id->namespaceIndex = (UA_UInt16)tmp; + } + + // From the current position until the end + return parse_nodeid_body(id, &pos[-2], end); + } +yy8: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy10; + default: goto yy9; + } +yy9: + YYRESTORE (); + goto yy3; +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + YYSTAGP (context.yyt1); + goto yy11; + default: goto yy9; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + case ';': + YYSTAGP (context.yyt2); + goto yy13; + default: goto yy9; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + case 's': goto yy14; + default: goto yy9; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy6; + default: goto yy9; + } +} + +} + +UA_StatusCode +UA_NodeId_parse(UA_NodeId *id, const UA_String str) { + UA_StatusCode res = + parse_nodeid(id, (const char*)str.data, (const char*)str.data+str.length); + if(res != UA_STATUSCODE_GOOD) + UA_NodeId_clear(id); + return res; +} + +static UA_StatusCode +parse_expandednodeid(UA_ExpandedNodeId *id, const char *pos, const char *end) { + *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */ + LexContext context; + memset(&context, 0, sizeof(LexContext)); + const char *svr = NULL, *svre = NULL, *nsu = NULL, *ns = NULL, *body = NULL; + + +{ + char yych; + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + YYSTAGN (context.yyt1); + YYSTAGN (context.yyt2); + YYSTAGN (context.yyt3); + YYSTAGP (context.yyt4); + YYSTAGN (context.yyt5); + goto yy19; + case 'n': + YYSTAGN (context.yyt1); + YYSTAGN (context.yyt2); + goto yy20; + case 's': + YYSTAGN (context.yyt1); + YYSTAGN (context.yyt2); + YYSTAGN (context.yyt3); + YYSTAGP (context.yyt4); + YYSTAGN (context.yyt5); + goto yy21; + default: goto yy17; + } +yy17: + YYSKIP (); +yy18: + { (void)pos; return UA_STATUSCODE_BADINTERNALERROR; } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy22; + default: goto yy18; + } +yy20: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case 's': goto yy24; + default: goto yy18; + } +yy21: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy22; + case 'v': goto yy26; + default: goto yy18; + } +yy22: + YYSKIP (); + svr = context.yyt1; + svre = context.yyt2; + ns = context.yyt3; + nsu = context.yyt5; + body = context.yyt4; + { + (void)pos; // Get rid of a dead store clang-analyzer warning + if(svr) { + size_t len = (size_t)((svre) - svr); + if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len) + return UA_STATUSCODE_BADINTERNALERROR; + } + + if(nsu) { + size_t len = (size_t)((body-1) - nsu); + UA_String nsuri; + nsuri.data = (UA_Byte*)(uintptr_t)nsu; + nsuri.length = len; + UA_StatusCode res = UA_String_copy(&nsuri, &id->namespaceUri); + if(res != UA_STATUSCODE_GOOD) + return res; + } else if(ns) { + UA_UInt32 tmp; + size_t len = (size_t)((body-1) - ns); + if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len) + return UA_STATUSCODE_BADINTERNALERROR; + id->nodeId.namespaceIndex = (UA_UInt16)tmp; + } + + // From the current position until the end + return parse_nodeid_body(&id->nodeId, &pos[-2], end); + } +yy24: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy27; + case 'u': goto yy28; + default: goto yy25; + } +yy25: + YYRESTORE (); + goto yy18; +yy26: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 'r': goto yy29; + default: goto yy25; + } +yy27: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + YYSTAGP (context.yyt3); + goto yy30; + default: goto yy25; + } +yy28: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy32; + default: goto yy25; + } +yy29: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy33; + default: goto yy25; + } +yy30: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy30; + case ';': goto yy34; + default: goto yy25; + } +yy32: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '\n': goto yy25; + case ';': + YYSTAGP (context.yyt5); + goto yy37; + default: + YYSTAGP (context.yyt5); + goto yy35; + } +yy33: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + YYSTAGP (context.yyt1); + goto yy38; + default: goto yy25; + } +yy34: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + case 's': + YYSTAGP (context.yyt4); + YYSTAGN (context.yyt5); + goto yy40; + default: goto yy25; + } +yy35: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '\n': goto yy25; + case ';': goto yy37; + default: goto yy35; + } +yy37: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + case 's': + YYSTAGN (context.yyt3); + YYSTAGP (context.yyt4); + goto yy40; + default: goto yy25; + } +yy38: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy38; + case ';': + YYSTAGP (context.yyt2); + goto yy41; + default: goto yy25; + } +yy40: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '=': goto yy22; + default: goto yy25; + } +yy41: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 'b': + case 'g': + case 'i': + case 's': + YYSTAGN (context.yyt3); + YYSTAGP (context.yyt4); + YYSTAGN (context.yyt5); + goto yy40; + case 'n': goto yy42; + default: goto yy25; + } +yy42: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 's': goto yy24; + default: goto yy25; + } +} + +} + +UA_StatusCode +UA_ExpandedNodeId_parse(UA_ExpandedNodeId *id, const UA_String str) { + UA_StatusCode res = + parse_expandednodeid(id, (const char*)str.data, (const char*)str.data+str.length); + if(res != UA_STATUSCODE_GOOD) + UA_ExpandedNodeId_clear(id); + return res; +} + +static UA_StatusCode +relativepath_addelem(UA_RelativePath *rp, UA_RelativePathElement *el) { + /* Allocate memory */ + UA_RelativePathElement *newArray = (UA_RelativePathElement*) + UA_realloc(rp->elements, sizeof(UA_RelativePathElement) * (rp->elementsSize + 1)); + if(!newArray) + return UA_STATUSCODE_BADOUTOFMEMORY; + rp->elements = newArray; + + /* Move to the target */ + rp->elements[rp->elementsSize] = *el; + rp->elementsSize++; + return UA_STATUSCODE_GOOD; +} + +/* Parse name string with '&' as the escape character */ +static UA_StatusCode +parse_refpath_qn_name(UA_QualifiedName *qn, const char **pos, const char *end) { + /* Allocate the max length the name can have */ + size_t maxlen = (size_t)(end - *pos); + if(maxlen == 0) { + qn->name.data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL; + return UA_STATUSCODE_GOOD; + } + char *name = (char*)UA_malloc(maxlen); + if(!name) + return UA_STATUSCODE_BADOUTOFMEMORY; + + size_t index = 0; + for(; *pos < end; (*pos)++) { + char c = **pos; + /* Unescaped special characer: The end of the QualifiedName */ + if(c == '/' || c == '.' || c == '<' || c == '>' || + c == ':' || c == '#' || c == '!') + break; + + /* Escaped character */ + if(c == '&') { + (*pos)++; + if(*pos >= end || + (**pos != '/' && **pos != '.' && **pos != '<' && **pos != '>' && + **pos != ':' && **pos != '#' && **pos != '!' && **pos != '&')) { + UA_free(name); + return UA_STATUSCODE_BADINTERNALERROR; + } + c = **pos; + } + + /* Unescaped normal character */ + name[index] = c; + index++; + } + + if(index > 0) { + qn->name.data = (UA_Byte*)name; + qn->name.length = index; + } else { + qn->name.data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL; + UA_free(name); + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +parse_refpath_qn(UA_QualifiedName *qn, const char *pos, const char *end) { + LexContext context; + memset(&context, 0, sizeof(LexContext)); + const char *ns = NULL, *nse = NULL; + UA_QualifiedName_init(qn); + + +{ + char yych; + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + YYSTAGP (context.yyt1); + goto yy47; + default: goto yy45; + } +yy45: + YYSKIP (); +yy46: + { pos--; goto parse_qn_name; } +yy47: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': goto yy49; + default: goto yy46; + } +yy48: + YYSKIP (); + yych = YYPEEK (); +yy49: + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy48; + case ':': + YYSTAGP (context.yyt2); + goto yy51; + default: goto yy50; + } +yy50: + YYRESTORE (); + goto yy46; +yy51: + YYSKIP (); + ns = context.yyt1; + nse = context.yyt2; + { + UA_UInt32 tmp; + size_t len = (size_t)(nse - ns); + if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len) + return UA_STATUSCODE_BADINTERNALERROR; + qn->namespaceIndex = (UA_UInt16)tmp; + goto parse_qn_name; + } +} + + + parse_qn_name: + return parse_refpath_qn_name(qn, &pos, end); +} + +/* List of well-known ReferenceTypes that don't require lookup in the server */ + +typedef struct { + char *browseName; + UA_UInt32 identifier; +} RefTypeNames; + +#define KNOWNREFTYPES 17 +static const RefTypeNames knownRefTypes[KNOWNREFTYPES] = { + {"References", UA_NS0ID_REFERENCES}, + {"HierachicalReferences", UA_NS0ID_HIERARCHICALREFERENCES}, + {"NonHierachicalReferences", UA_NS0ID_NONHIERARCHICALREFERENCES}, + {"HasChild", UA_NS0ID_HASCHILD}, + {"Aggregates", UA_NS0ID_AGGREGATES}, + {"HasComponent", UA_NS0ID_HASCOMPONENT}, + {"HasProperty", UA_NS0ID_HASPROPERTY}, + {"HasOrderedComponent", UA_NS0ID_HASORDEREDCOMPONENT}, + {"HasSubtype", UA_NS0ID_HASSUBTYPE}, + {"Organizes", UA_NS0ID_ORGANIZES}, + {"HasModellingRule", UA_NS0ID_HASMODELLINGRULE}, + {"HasTypeDefinition", UA_NS0ID_HASTYPEDEFINITION}, + {"HasEncoding", UA_NS0ID_HASENCODING}, + {"GeneratesEvent", UA_NS0ID_GENERATESEVENT}, + {"AlwaysGeneratesEvent", UA_NS0ID_ALWAYSGENERATESEVENT}, + {"HasEventSource", UA_NS0ID_HASEVENTSOURCE}, + {"HasNotifier", UA_NS0ID_HASNOTIFIER} +}; + +static UA_StatusCode +lookup_reftype(UA_NodeId *refTypeId, UA_QualifiedName *qn) { + if(qn->namespaceIndex != 0) + return UA_STATUSCODE_BADNOTFOUND; + + for(size_t i = 0; i < KNOWNREFTYPES; i++) { + UA_String tmp = UA_STRING(knownRefTypes[i].browseName); + if(UA_String_equal(&qn->name, &tmp)) { + *refTypeId = UA_NODEID_NUMERIC(0, knownRefTypes[i].identifier); + return UA_STATUSCODE_GOOD; + } + } + + return UA_STATUSCODE_BADNOTFOUND; +} + +static UA_StatusCode +parse_relativepath(UA_RelativePath *rp, const char *pos, const char *end) { + LexContext context; + memset(&context, 0, sizeof(LexContext)); + const char *begin = NULL, *finish = NULL; + UA_StatusCode res = UA_STATUSCODE_GOOD; + UA_RelativePath_init(rp); /* Reset the BrowsePath */ + + /* Add one element to the path in every iteration */ + UA_RelativePathElement current; + loop: + UA_RelativePathElement_init(¤t); + current.includeSubtypes = true; /* Follow subtypes by default */ + + /* Get the ReferenceType and its modifiers */ + +{ + char yych; + unsigned int yyaccept = 0; + yych = YYPEEK (); + switch (yych) { + case 0x00: goto yy55; + case '.': goto yy59; + case '/': goto yy61; + case '<': goto yy63; + default: goto yy57; + } +yy55: + YYSKIP (); + { (void)pos; return UA_STATUSCODE_GOOD; } +yy57: + YYSKIP (); +yy58: + { (void)pos; return UA_STATUSCODE_BADINTERNALERROR; } +yy59: + YYSKIP (); + { + current.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_AGGREGATES); + goto reftype_target; + } +yy61: + YYSKIP (); + { + current.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES); + goto reftype_target; + } +yy63: + yyaccept = 0; + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: + case '>': goto yy58; + case '&': + YYSTAGP (context.yyt1); + goto yy67; + default: + YYSTAGP (context.yyt1); + goto yy64; + } +yy64: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: goto yy66; + case '&': goto yy67; + case '>': + YYSTAGP (context.yyt2); + goto yy69; + default: goto yy64; + } +yy66: + YYRESTORE (); + if (yyaccept == 0) { + goto yy58; + } else { + goto yy70; + } +yy67: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: goto yy66; + case '&': goto yy67; + case '>': + YYSTAGP (context.yyt2); + goto yy71; + default: goto yy64; + } +yy69: + YYSKIP (); +yy70: + begin = context.yyt1; + finish = context.yyt2; + { + for(; begin < finish; begin++) { + if(*begin== '#') + current.includeSubtypes = false; + else if(*begin == '!') + current.isInverse = true; + else + break; + } + UA_QualifiedName refqn; + res |= parse_refpath_qn(&refqn, begin, finish); + res |= lookup_reftype(¤t.referenceTypeId, &refqn); + UA_QualifiedName_clear(&refqn); + goto reftype_target; + } +yy71: + yyaccept = 1; + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: goto yy70; + case '&': goto yy67; + case '>': + YYSTAGP (context.yyt2); + goto yy69; + default: goto yy64; + } +} + + + /* Get the TargetName component */ + reftype_target: + if(res != UA_STATUSCODE_GOOD) + return res; + + +{ + char yych; + yych = YYPEEK (); + switch (yych) { + case 0x00: + case '.': + case '/': + case '<': goto yy74; + case '&': + YYSTAGP (context.yyt1); + goto yy79; + default: + YYSTAGP (context.yyt1); + goto yy76; + } +yy74: + YYSKIP (); + { pos--; goto add_element; } +yy76: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: + case '.': + case '/': + case '<': goto yy78; + case '&': goto yy79; + default: goto yy76; + } +yy78: + begin = context.yyt1; + { + res = parse_refpath_qn(¤t.targetName, begin, pos); + goto add_element; + } +yy79: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case 0x00: goto yy78; + case '&': goto yy79; + default: goto yy76; + } +} + + + /* Add the current element to the path and continue to the next element */ + add_element: + res |= relativepath_addelem(rp, ¤t); + if(res != UA_STATUSCODE_GOOD) { + UA_RelativePathElement_clear(¤t); + return res; + } + goto loop; +} + +UA_StatusCode +UA_RelativePath_parse(UA_RelativePath *rp, const UA_String str) { + UA_StatusCode res = + parse_relativepath(rp, (const char*)str.data, (const char*)str.data+str.length); + if(res != UA_STATUSCODE_GOOD) + UA_RelativePath_clear(rp); + return res; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_subscription.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Chris Iatrou + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2017-2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2015 (c) Joakim L. Gilje + * Copyright 2016-2017 (c) Florian Palm + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Ari Breitkreuz, fortiss GmbH + * Copyright 2017 (c) Mattias Bornhager + * Copyright 2018 (c) Hilscher Gesellschaft für Systemautomation mbH (Author: Martin Lang) + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +#define UA_MAX_RETRANSMISSIONQUEUESIZE 256 + +UA_Subscription * +UA_Subscription_new() { + /* Allocate the memory */ + UA_Subscription *newSub = (UA_Subscription*)UA_calloc(1, sizeof(UA_Subscription)); + if(!newSub) + return NULL; + + /* The first publish response is sent immediately */ + newSub->state = UA_SUBSCRIPTIONSTATE_NORMAL; + + /* Even if the first publish response is a keepalive the sequence number is 1. + * This can happen by a subscription without a monitored item (see CTT test scripts). */ + newSub->nextSequenceNumber = 1; + + TAILQ_INIT(&newSub->retransmissionQueue); + TAILQ_INIT(&newSub->notificationQueue); + return newSub; +} + +void +UA_Subscription_delete(UA_Server *server, UA_Subscription *sub) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Unregister the publish callback */ + Subscription_unregisterPublishCallback(server, sub); + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, sub, "Subscription deleted"); + + /* Detach from the session if necessary */ + if(sub->session) + UA_Session_detachSubscription(server, sub->session, sub); + + /* Remove from the server if not previously registered */ + if(sub->serverListEntry.le_prev) { + LIST_REMOVE(sub, serverListEntry); + UA_assert(server->subscriptionsSize > 0); + server->subscriptionsSize--; + } + + /* Delete monitored Items */ + UA_assert(server->monitoredItemsSize >= sub->monitoredItemsSize); + UA_MonitoredItem *mon, *tmp_mon; + LIST_FOREACH_SAFE(mon, &sub->monitoredItems, listEntry, tmp_mon) { + UA_MonitoredItem_delete(server, mon); + } + UA_assert(sub->monitoredItemsSize == 0); + + /* Delete Retransmission Queue */ + UA_NotificationMessageEntry *nme, *nme_tmp; + TAILQ_FOREACH_SAFE(nme, &sub->retransmissionQueue, listEntry, nme_tmp) { + TAILQ_REMOVE(&sub->retransmissionQueue, nme, listEntry); + UA_NotificationMessage_clear(&nme->message); + UA_free(nme); + if(sub->session) + --sub->session->totalRetransmissionQueueSize; + --sub->retransmissionQueueSize; + } + UA_assert(sub->retransmissionQueueSize == 0); + + /* Add a delayed callback to remove the Subscription when the current jobs + * have completed. Pointers to the subscription may still exist upwards in + * the call stack. */ + sub->delayedFreePointers.callback = NULL; + sub->delayedFreePointers.application = server; + sub->delayedFreePointers.data = NULL; + sub->delayedFreePointers.nextTime = UA_DateTime_nowMonotonic() + 1; + sub->delayedFreePointers.interval = 0; /* Remove the structure */ + UA_Timer_addTimerEntry(&server->timer, &sub->delayedFreePointers, NULL); +} + +UA_MonitoredItem * +UA_Subscription_getMonitoredItem(UA_Subscription *sub, UA_UInt32 monitoredItemId) { + UA_MonitoredItem *mon; + LIST_FOREACH(mon, &sub->monitoredItems, listEntry) { + if(mon->monitoredItemId == monitoredItemId) + break; + } + return mon; +} + +static void +removeOldestRetransmissionMessageFromSub(UA_Subscription *sub) { + UA_NotificationMessageEntry *oldestEntry = + TAILQ_LAST(&sub->retransmissionQueue, ListOfNotificationMessages); + TAILQ_REMOVE(&sub->retransmissionQueue, oldestEntry, listEntry); + UA_NotificationMessage_clear(&oldestEntry->message); + UA_free(oldestEntry); + --sub->retransmissionQueueSize; + if(sub->session) + --sub->session->totalRetransmissionQueueSize; +} + +static void +removeOldestRetransmissionMessageFromSession(UA_Session *session) { + UA_NotificationMessageEntry *oldestEntry = NULL; + UA_Subscription *oldestSub = NULL; + UA_Subscription *sub; + TAILQ_FOREACH(sub, &session->subscriptions, sessionListEntry) { + UA_NotificationMessageEntry *first = + TAILQ_LAST(&sub->retransmissionQueue, ListOfNotificationMessages); + if(!first) + continue; + if(!oldestEntry || oldestEntry->message.publishTime > first->message.publishTime) { + oldestEntry = first; + oldestSub = sub; + } + } + UA_assert(oldestEntry); + UA_assert(oldestSub); + + removeOldestRetransmissionMessageFromSub(oldestSub); +} + +static void +UA_Subscription_addRetransmissionMessage(UA_Server *server, UA_Subscription *sub, + UA_NotificationMessageEntry *entry) { + /* Release the oldest entry if there is not enough space */ + UA_Session *session = sub->session; + if(sub->retransmissionQueueSize >= UA_MAX_RETRANSMISSIONQUEUESIZE) { + removeOldestRetransmissionMessageFromSub(sub); + } else if(session && server->config.maxRetransmissionQueueSize > 0 && + session->totalRetransmissionQueueSize >= server->config.maxRetransmissionQueueSize) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "Retransmission queue overflow"); + removeOldestRetransmissionMessageFromSession(sub->session); + } + + /* Add entry */ + TAILQ_INSERT_TAIL(&sub->retransmissionQueue, entry, listEntry); + ++sub->retransmissionQueueSize; + if(session) + ++session->totalRetransmissionQueueSize; +} + +UA_StatusCode +UA_Subscription_removeRetransmissionMessage(UA_Subscription *sub, UA_UInt32 sequenceNumber) { + /* Find the retransmission message */ + UA_NotificationMessageEntry *entry; + TAILQ_FOREACH(entry, &sub->retransmissionQueue, listEntry) { + if(entry->message.sequenceNumber == sequenceNumber) + break; + } + if(!entry) + return UA_STATUSCODE_BADSEQUENCENUMBERUNKNOWN; + + /* Remove the retransmission message */ + TAILQ_REMOVE(&sub->retransmissionQueue, entry, listEntry); + --sub->retransmissionQueueSize; + UA_NotificationMessage_clear(&entry->message); + UA_free(entry); + + if(sub->session) + --sub->session->totalRetransmissionQueueSize; + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +prepareNotificationMessage(UA_Server *server, UA_Subscription *sub, + UA_NotificationMessage *message, size_t notifications) { + UA_assert(notifications > 0); + + /* Allocate an ExtensionObject for Event- and DataChange-Notifications. Also + * there can be StatusChange-Notifications. The standard says in Part 4, + * 7.2.1: + * + * If a Subscription contains MonitoredItems for events and data, this array + * should have not more than 2 elements. */ + message->notificationData = (UA_ExtensionObject*) + UA_Array_new(2, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); + if(!message->notificationData) + return UA_STATUSCODE_BADOUTOFMEMORY; + message->notificationDataSize = 2; + + /* Pre-allocate DataChangeNotifications */ + size_t notificationDataIdx = 0; + UA_DataChangeNotification *dcn = NULL; + size_t dcnPos = 0; /* How many DataChangeNotifications were moved into the list? */ + if(sub->dataChangeNotifications > 0) { + dcn = UA_DataChangeNotification_new(); + if(!dcn) { + UA_NotificationMessage_clear(message); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + UA_ExtensionObject_setValue(message->notificationData, dcn, + &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); + size_t dcnSize = sub->dataChangeNotifications; + if(dcnSize > notifications) + dcnSize = notifications; + dcn->monitoredItems = (UA_MonitoredItemNotification*) + UA_Array_new(dcnSize, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); + if(!dcn->monitoredItems) { + UA_NotificationMessage_clear(message); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + dcn->monitoredItemsSize = dcnSize; + notificationDataIdx++; + } + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_EventNotificationList *enl = NULL; + size_t enlPos = 0; /* How many EventNotifications were moved into the list? */ + if(sub->eventNotifications > 0) { + enl = UA_EventNotificationList_new(); + if(!enl) { + UA_NotificationMessage_clear(message); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + UA_ExtensionObject_setValue(&message->notificationData[notificationDataIdx], + enl, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); + size_t enlSize = sub->eventNotifications; + if(enlSize > notifications) + enlSize = notifications; + enl->events = (UA_EventFieldList*) + UA_Array_new(enlSize, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); + if(!enl->events) { + UA_NotificationMessage_clear(message); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + enl->eventsSize = enlSize; + notificationDataIdx++; + } +#endif + + UA_assert(notificationDataIdx > 0); + message->notificationDataSize = notificationDataIdx; + + /* <-- The point of no return --> */ + + size_t totalNotifications = 0; /* How many notifications were moved to the response overall? */ + UA_Notification *notification, *notification_tmp; + TAILQ_FOREACH_SAFE(notification, &sub->notificationQueue, globalEntry, notification_tmp) { + if(totalNotifications >= notifications) + break; + + /* Move the content to the response */ + switch(notification->mon->itemToMonitor.attributeId) { +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + case UA_ATTRIBUTEID_EVENTNOTIFIER: + UA_assert(enl != NULL); /* Have at least one event notification */ + enl->events[enlPos] = notification->data.event; + UA_EventFieldList_init(¬ification->data.event); + enlPos++; + break; +#endif + default: + UA_assert(dcn != NULL); /* Have at least one change notification */ + dcn->monitoredItems[dcnPos] = notification->data.dataChange; + UA_DataValue_init(¬ification->data.dataChange.value); + dcnPos++; + break; + } + + /* If there are Notifications *before this one* in the MonitoredItem- + * local queue, remove all of them. These are earlier Notifications that + * are non-reporting. And we don't want them to show up after the + * current Notification has been sent out. */ + UA_Notification *prev; + while((prev = TAILQ_PREV(notification, NotificationQueue, listEntry))) + UA_Notification_delete(server, prev); + + /* Delete the notification, remove from the queues and decrease the counters */ + UA_Notification_delete(server, notification); + + totalNotifications++; + } + + /* Set sizes */ + if(dcn) { + dcn->monitoredItemsSize = dcnPos; + if(dcnPos == 0) { + UA_free(dcn->monitoredItems); + dcn->monitoredItems = NULL; + } + } + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(enl) { + enl->eventsSize = enlPos; + if(enlPos == 0) { + UA_free(enl->events); + enl->events = NULL; + } + } +#endif + + return UA_STATUSCODE_GOOD; +} + +/* According to OPC Unified Architecture, Part 4 5.13.1.1 i) The value 0 is + * never used for the sequence number */ +static UA_UInt32 +UA_Subscription_nextSequenceNumber(UA_UInt32 sequenceNumber) { + UA_UInt32 nextSequenceNumber = sequenceNumber + 1; + if(nextSequenceNumber == 0) + nextSequenceNumber = 1; + return nextSequenceNumber; +} + +static void +publishCallback(UA_Server *server, UA_Subscription *sub) { + UA_LOCK(server->serviceMutex); + sub->readyNotifications = sub->notificationQueueSize; + UA_Subscription_publish(server, sub); + UA_UNLOCK(server->serviceMutex); +} + +static void +sendStatusChangeDelete(UA_Server *server, UA_Subscription *sub, + UA_PublishResponseEntry *pre) { + /* Cannot send out the StatusChange because no response is queued. + * Delete the Subscription without sending the StatusChange. */ + if(!pre) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Cannot send the StatusChange notification. " + "Removing the subscription."); + UA_Subscription_delete(server, sub); + return; + } + + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Sending out a StatusChange " + "notification and removing the subscription"); + + /* Populate the response */ + UA_PublishResponse *response = &pre->response; + + UA_StatusChangeNotification scn; + UA_StatusChangeNotification_init(&scn); + scn.status = sub->statusChange; + + UA_ExtensionObject notificationData; + UA_ExtensionObject_setValue(¬ificationData, &scn, + &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); + + response->responseHeader.timestamp = UA_DateTime_now(); + response->notificationMessage.notificationData = ¬ificationData; + response->notificationMessage.notificationDataSize = 1; + response->subscriptionId = sub->subscriptionId; + response->notificationMessage.publishTime = response->responseHeader.timestamp; + response->notificationMessage.sequenceNumber = sub->nextSequenceNumber; + + /* Send the response */ + UA_assert(sub->session); /* Otherwise pre is NULL */ + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Sending out a publish response"); + sendResponse(server, sub->session, sub->session->header.channel, pre->requestId, + (UA_Response *)response, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); + + /* Clean up */ + response->notificationMessage.notificationData = NULL; + response->notificationMessage.notificationDataSize = 0; + UA_PublishResponse_clear(&pre->response); + UA_free(pre); + + /* Delete the subscription */ + UA_Subscription_delete(server, sub); +} + +void +UA_Subscription_publish(UA_Server *server, UA_Subscription *sub) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, "Publish Callback"); + UA_assert(sub); + + /* Dequeue a response */ + UA_PublishResponseEntry *pre = NULL; + if(sub->session) + pre = UA_Session_dequeuePublishReq(sub->session); + + /* Update the LifetimeCounter */ + if(pre) { + sub->currentLifetimeCount = 0; + } else { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "The publish queue is empty"); + ++sub->currentLifetimeCount; + if(sub->currentLifetimeCount > sub->lifeTimeCount) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "End of subscription lifetime"); + /* Set the StatusChange to delete the subscription. */ + sub->statusChange = UA_STATUSCODE_BADTIMEOUT; + } + } + + /* Send a StatusChange notification if possible and delete the + * Subscription */ + if(sub->statusChange != UA_STATUSCODE_GOOD) { + sendStatusChangeDelete(server, sub, pre); + return; + } + + /* If there are several late publish responses... */ + if(sub->readyNotifications > sub->notificationQueueSize) + sub->readyNotifications = sub->notificationQueueSize; + + /* Count the available notifications */ + UA_UInt32 notifications = (sub->publishingEnabled) ? sub->readyNotifications : 0; + UA_Boolean moreNotifications = false; + if(notifications > sub->notificationsPerPublish) { + notifications = sub->notificationsPerPublish; + moreNotifications = true; + } + + /* Return if no notifications and no keepalive */ + if(notifications == 0) { + ++sub->currentKeepAliveCount; + if(sub->currentKeepAliveCount < sub->maxKeepAliveCount) { + if(pre) + UA_Session_queuePublishReq(sub->session, pre, true); /* Re-enqueue */ + return; + } + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, "Sending a KeepAlive"); + } + + /* We want to send a response, but cannot. Either because there is no queued + * response or because the Subscription is detached from a Session or because + * the SecureChannel for the Session is closed. */ + if(!pre || !sub->session || !sub->session->header.channel) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Want to send a publish response but can't. " + "The subscription is late."); + sub->state = UA_SUBSCRIPTIONSTATE_LATE; + if(pre) + UA_Session_queuePublishReq(sub->session, pre, true); /* Re-enqueue */ + return; + } + + UA_assert(sub->session); /* Otherwise pre is NULL */ + + /* Prepare the response */ + UA_PublishResponse *response = &pre->response; + UA_NotificationMessage *message = &response->notificationMessage; + UA_NotificationMessageEntry *retransmission = NULL; + if(notifications > 0) { + if(server->config.enableRetransmissionQueue) { + /* Allocate the retransmission entry */ + retransmission = (UA_NotificationMessageEntry*) + UA_malloc(sizeof(UA_NotificationMessageEntry)); + if(!retransmission) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "Could not allocate memory for retransmission. " + "The subscription is late."); + sub->state = UA_SUBSCRIPTIONSTATE_LATE; + UA_Session_queuePublishReq(sub->session, pre, true); /* Re-enqueue */ + return; + } + } + + /* Prepare the response */ + UA_StatusCode retval = prepareNotificationMessage(server, sub, message, notifications); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "Could not prepare the notification message. " + "The subscription is late."); + /* If the retransmission queue is enabled a retransmission message is allocated */ + if(retransmission) + UA_free(retransmission); + sub->state = UA_SUBSCRIPTIONSTATE_LATE; + UA_Session_queuePublishReq(sub->session, pre, true); /* Re-enqueue */ + return; + } + } + + /* <-- The point of no return --> */ + + /* Adjust the number of ready notifications */ + UA_assert(sub->readyNotifications >= notifications); + sub->readyNotifications -= notifications; + + /* Set up the response */ + response->responseHeader.timestamp = UA_DateTime_now(); + response->subscriptionId = sub->subscriptionId; + response->moreNotifications = moreNotifications; + message->publishTime = response->responseHeader.timestamp; + + /* Set sequence number to message. Started at 1 which is given during + * creating a new subscription. The 1 is required for initial publish + * response with or without an monitored item. */ + message->sequenceNumber = sub->nextSequenceNumber; + + if(notifications > 0) { + /* If the retransmission queue is enabled a retransmission message is + * allocated */ + if(retransmission) { + /* Put the notification message into the retransmission queue. This + * needs to be done here, so that the message itself is included in + * the available sequence numbers for acknowledgement. */ + retransmission->message = response->notificationMessage; + UA_Subscription_addRetransmissionMessage(server, sub, retransmission); + } + /* Only if a notification was created, the sequence number must be + * increased. For a keepalive the sequence number can be reused. */ + sub->nextSequenceNumber = UA_Subscription_nextSequenceNumber(sub->nextSequenceNumber); + } + + /* Get the available sequence numbers from the retransmission queue */ + UA_assert(sub->retransmissionQueueSize <= UA_MAX_RETRANSMISSIONQUEUESIZE); + UA_UInt32 seqNumbers[UA_MAX_RETRANSMISSIONQUEUESIZE]; + response->availableSequenceNumbers = seqNumbers; + response->availableSequenceNumbersSize = sub->retransmissionQueueSize; + size_t i = 0; + UA_NotificationMessageEntry *nme; + TAILQ_FOREACH(nme, &sub->retransmissionQueue, listEntry) { + response->availableSequenceNumbers[i] = nme->message.sequenceNumber; + ++i; + } + UA_assert(i == sub->retransmissionQueueSize); + + /* Send the response */ + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, "Sending out a publish response " + "with %" PRIu32 " notifications", notifications); + sendResponse(server, sub->session, sub->session->header.channel, pre->requestId, + (UA_Response*)response, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); + + /* Reset subscription state to normal */ + sub->state = UA_SUBSCRIPTIONSTATE_NORMAL; + sub->currentKeepAliveCount = 0; + + /* Free the response */ + if(retransmission) + /* NotificationMessage was moved into retransmission queue */ + UA_NotificationMessage_init(&response->notificationMessage); + response->availableSequenceNumbers = NULL; + response->availableSequenceNumbersSize = 0; + UA_PublishResponse_clear(&pre->response); + UA_free(pre); + + /* Repeat sending responses if there are more notifications to send */ + if(moreNotifications) + UA_Subscription_publish(server, sub); +} + +UA_Boolean +UA_Session_reachedPublishReqLimit(UA_Server *server, UA_Session *session) { + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Reached number of publish request limit"); + + /* Dequeue a response */ + UA_PublishResponseEntry *pre = UA_Session_dequeuePublishReq(session); + + /* Cannot publish without a response */ + if(!pre) { + UA_LOG_FATAL_SESSION(&server->config.logger, session, "No publish requests available"); + return false; + } + + /* <-- The point of no return --> */ + + UA_PublishResponse *response = &pre->response; + UA_NotificationMessage *message = &response->notificationMessage; + + /* Set up the response. Note that this response has no related subscription id */ + response->responseHeader.timestamp = UA_DateTime_now(); + response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS; + response->subscriptionId = 0; + response->moreNotifications = false; + message->publishTime = response->responseHeader.timestamp; + message->sequenceNumber = 0; + response->availableSequenceNumbersSize = 0; + + /* Send the response */ + UA_LOG_DEBUG_SESSION(&server->config.logger, session, + "Sending out a publish response triggered by too many publish requests"); + sendResponse(server, session, session->header.channel, pre->requestId, + (UA_Response*)response, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); + + /* Free the response */ + UA_Array_delete(response->results, response->resultsSize, &UA_TYPES[UA_TYPES_UINT32]); + UA_free(pre); /* no need for UA_PublishResponse_clear */ + + return true; +} + +UA_StatusCode +Subscription_registerPublishCallback(UA_Server *server, UA_Subscription *sub) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Register subscription publishing callback"); + UA_LOCK_ASSERT(server->serviceMutex, 1); + + if(sub->publishCallbackId > 0) + return UA_STATUSCODE_GOOD; + + UA_StatusCode retval = + addRepeatedCallback(server, (UA_ServerCallback)publishCallback, + sub, sub->publishingInterval, &sub->publishCallbackId); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + UA_assert(sub->publishCallbackId > 0); + return UA_STATUSCODE_GOOD; +} + +void +Subscription_unregisterPublishCallback(UA_Server *server, UA_Subscription *sub) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "Unregister subscription publishing callback"); + + if(sub->publishCallbackId == 0) + return; + + removeCallback(server, sub->publishCallbackId); + sub->publishCallbackId = 0; +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_subscription_monitoreditem.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Ari Breitkreuz, fortiss GmbH + * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart (for VDW and umati) + */ + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +/****************/ +/* Notification */ +/****************/ + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + +static const UA_NodeId simpleOverflowEventType = + {0, UA_NODEIDTYPE_NUMERIC, {UA_NS0ID_SIMPLEOVERFLOWEVENTTYPE}}; + +/* The specification states in Part 4 5.12.1.5 that an EventQueueOverflowEvent + * "is generated when the first Event has to be discarded [...] without + * discarding any other event". So only generate one for all deleted events. */ +static UA_StatusCode +createEventOverflowNotification(UA_Server *server, UA_Subscription *sub, + UA_MonitoredItem *mon) { + /* Avoid creating two adjacent overflow events */ + UA_Notification *indicator = NULL; + if(mon->parameters.discardOldest) { + indicator = TAILQ_FIRST(&mon->queue); + UA_assert(indicator); /* must exist */ + if(indicator->isOverflowEvent) + return UA_STATUSCODE_GOOD; + } else { + indicator = TAILQ_LAST(&mon->queue, NotificationQueue); + UA_assert(indicator); /* must exist */ + /* Skip the last element. It is the recently added notification that + * shall be kept. We know it is not an OverflowEvent. */ + UA_Notification *before = TAILQ_PREV(indicator, NotificationQueue, listEntry); + if(before && before->isOverflowEvent) + return UA_STATUSCODE_GOOD; + } + + /* A Notification is inserted into the queue which includes only the + * NodeId of the OverflowEventType. */ + + /* Allocate the notification */ + UA_Notification *overflowNotification = UA_Notification_new(); + if(!overflowNotification) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Set the notification fields */ + overflowNotification->isOverflowEvent = true; + overflowNotification->mon = mon; + overflowNotification->data.event.eventFields = UA_Variant_new(); + if(!overflowNotification->data.event.eventFields) { + UA_free(overflowNotification); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + overflowNotification->data.event.eventFieldsSize = 1; + UA_StatusCode retval = + UA_Variant_setScalarCopy(overflowNotification->data.event.eventFields, + &simpleOverflowEventType, &UA_TYPES[UA_TYPES_NODEID]); + if(retval != UA_STATUSCODE_GOOD) { + UA_Notification_delete(server, overflowNotification); + return retval; + } + + /* Insert before the removed notification. This is either first in the + * queue (if the oldest notification was removed) or before the new event + * that remains the last element of the queue. + * + * Ensure that the following is consistent with UA_Notification_enqueueMon + * and UA_Notification_enqueueSub! */ + TAILQ_INSERT_BEFORE(indicator, overflowNotification, listEntry); + ++mon->eventOverflows; + ++mon->queueSize; + + /* Test for consistency */ + UA_assert(mon->queueSize >= mon->eventOverflows); + UA_assert(mon->eventOverflows <= mon->queueSize - mon->eventOverflows + 1); + + if(TAILQ_NEXT(indicator, globalEntry) != UA_SUBSCRIPTION_QUEUE_SENTINEL) { + /* Insert just before the indicator */ + TAILQ_INSERT_BEFORE(indicator, overflowNotification, globalEntry); + } else { + /* The indicator was not reporting or not added yet. */ + if(!mon->parameters.discardOldest) { + /* Add last to the per-Subscription queue */ + TAILQ_INSERT_TAIL(&mon->subscription->notificationQueue, + overflowNotification, globalEntry); + } else { + /* Find the oldest reported element. Add before that. */ + while(indicator) { + indicator = TAILQ_PREV(indicator, NotificationQueue, listEntry); + if(!indicator) { + TAILQ_INSERT_TAIL(&mon->subscription->notificationQueue, + overflowNotification, globalEntry); + break; + } + if(TAILQ_NEXT(indicator, globalEntry) != UA_SUBSCRIPTION_QUEUE_SENTINEL) { + TAILQ_INSERT_BEFORE(indicator, overflowNotification, globalEntry); + break; + } + } + } + } + ++sub->notificationQueueSize; + ++sub->eventNotifications; + return UA_STATUSCODE_GOOD; +} + +#endif + +/* Set the InfoBits that a datachange notification was removed */ +static void +setOverflowInfoBits(UA_MonitoredItem *mon) { + /* Only for queues with more than one element */ + if(mon->parameters.queueSize == 1) + return; + + UA_Notification *indicator = NULL; + if(mon->parameters.discardOldest) { + indicator = TAILQ_FIRST(&mon->queue); + } else { + indicator = TAILQ_LAST(&mon->queue, NotificationQueue); + } + UA_assert(indicator); /* must exist */ + + indicator->data.dataChange.value.hasStatus = true; + indicator->data.dataChange.value.status |= + (UA_STATUSCODE_INFOTYPE_DATAVALUE | UA_STATUSCODE_INFOBITS_OVERFLOW); +} + +UA_Notification * +UA_Notification_new(void) { + UA_Notification *n = (UA_Notification*)UA_calloc(1, sizeof(UA_Notification)); + if(n) { + /* Set the sentinel for a notification that is not enqueued */ + TAILQ_NEXT(n, globalEntry) = UA_SUBSCRIPTION_QUEUE_SENTINEL; + TAILQ_NEXT(n, listEntry) = UA_SUBSCRIPTION_QUEUE_SENTINEL; + } + return n; +} + +void +UA_Notification_delete(UA_Server *server, UA_Notification *n) { + UA_assert(n != UA_SUBSCRIPTION_QUEUE_SENTINEL); + if(n->mon != NULL) + { + UA_Notification_dequeueMon(server, n); + UA_Notification_dequeueSub(n); + switch(n->mon->itemToMonitor.attributeId) { +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + case UA_ATTRIBUTEID_EVENTNOTIFIER: + UA_EventFieldList_clear(&n->data.event); + break; +#endif + default: + UA_MonitoredItemNotification_clear(&n->data.dataChange); + break; + } + } + UA_free(n); +} + +void +UA_Notification_enqueueMon(UA_Server *server, UA_Notification *n) { + UA_MonitoredItem *mon = n->mon; + UA_assert(mon); + UA_assert(TAILQ_NEXT(n, listEntry) == UA_SUBSCRIPTION_QUEUE_SENTINEL); + + /* Add to the MonitoredItem */ + TAILQ_INSERT_TAIL(&mon->queue, n, listEntry); + ++mon->queueSize; + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(n->isOverflowEvent) + ++mon->eventOverflows; +#endif + + /* Test for consistency */ + UA_assert(mon->queueSize >= mon->eventOverflows); + UA_assert(mon->eventOverflows <= mon->queueSize - mon->eventOverflows + 1); + + /* Ensure enough space is available in the MonitoredItem. Do this only after + * adding the new Notification. */ + UA_MonitoredItem_ensureQueueSpace(server, mon); +} + +void +UA_Notification_enqueueSub(UA_Notification *n) { + UA_MonitoredItem *mon = n->mon; + UA_assert(mon); + + UA_Subscription *sub = mon->subscription; + UA_assert(sub); + + UA_assert(TAILQ_NEXT(n, globalEntry) == UA_SUBSCRIPTION_QUEUE_SENTINEL); + + /* Add to the subscription if reporting is enabled */ + TAILQ_INSERT_TAIL(&sub->notificationQueue, n, globalEntry); + ++sub->notificationQueueSize; + + switch(mon->itemToMonitor.attributeId) { +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + case UA_ATTRIBUTEID_EVENTNOTIFIER: + ++sub->eventNotifications; + break; +#endif + default: + ++sub->dataChangeNotifications; + break; + } +} + +void +UA_Notification_enqueueAndTrigger(UA_Server *server, UA_Notification *n) { + UA_MonitoredItem *mon = n->mon; + if(mon->monitoringMode == UA_MONITORINGMODE_REPORTING) + UA_Notification_enqueueSub(n); + UA_Notification_enqueueMon(server, n); + + UA_Subscription *sub = mon->subscription; + for(size_t i = mon->triggeringLinksSize - 1; i < mon->triggeringLinksSize; i--) { + /* Get the triggered MonitoredItem. Remove if it doesn't exist. */ + UA_MonitoredItem *triggeredMon = + UA_Subscription_getMonitoredItem(sub, mon->triggeringLinks[i]); + if(!triggeredMon) { + UA_MonitoredItem_removeLink(sub, mon, mon->triggeringLinks[i]); + continue; + } + + /* Get the latest sampled Notification from that MonitoredItem. Report + * it if not already done so. */ + UA_Notification *n2 = TAILQ_LAST(&triggeredMon->queue, NotificationQueue); + if(!n2) { + /* No Notification ready in the target MonitoredItem. This can happen, + * for example, if all samples from the target MonitoredItem are already + * sent out. Add sample "out of sync". */ + monitoredItem_sampleCallback(server, triggeredMon); + n2 = TAILQ_LAST(&triggeredMon->queue, NotificationQueue); + } + if(n2 && TAILQ_NEXT(n2, globalEntry) == UA_SUBSCRIPTION_QUEUE_SENTINEL) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %u triggers MonitoredItem %u", + mon->monitoredItemId, triggeredMon->monitoredItemId); + UA_Notification_enqueueSub(n2); + } else { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %u triggers MonitoredItem %u, " + "but no Notification awaits reporting", + mon->monitoredItemId, triggeredMon->monitoredItemId); + } + } +} + +void +UA_Notification_dequeueMon(UA_Server *server, UA_Notification *n) { + UA_MonitoredItem *mon = n->mon; + UA_assert(mon); + + if(TAILQ_NEXT(n, listEntry) == UA_SUBSCRIPTION_QUEUE_SENTINEL) + return; + + /* Remove from the MonitoredItem queue */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(n->isOverflowEvent) + --mon->eventOverflows; +#endif + + TAILQ_REMOVE(&mon->queue, n, listEntry); + --mon->queueSize; + + /* Test for consistency */ + UA_assert(mon->queueSize >= mon->eventOverflows); + UA_assert(mon->eventOverflows <= mon->queueSize - mon->eventOverflows + 1); + + /* Reset the sentintel */ + TAILQ_NEXT(n, listEntry) = UA_SUBSCRIPTION_QUEUE_SENTINEL; +} + +void +UA_Notification_dequeueSub(UA_Notification *n) { + if(TAILQ_NEXT(n, globalEntry) == UA_SUBSCRIPTION_QUEUE_SENTINEL) + return; + + UA_MonitoredItem *mon = n->mon; + UA_assert(mon); + UA_Subscription *sub = mon->subscription; + UA_assert(sub); + + switch(mon->itemToMonitor.attributeId) { +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + case UA_ATTRIBUTEID_EVENTNOTIFIER: + --sub->eventNotifications; + break; +#endif + default: + --sub->dataChangeNotifications; + break; + } + + TAILQ_REMOVE(&sub->notificationQueue, n, globalEntry); + --sub->notificationQueueSize; + + /* Reset the sentinel */ + TAILQ_NEXT(n, globalEntry) = UA_SUBSCRIPTION_QUEUE_SENTINEL; +} + +/*****************/ +/* MonitoredItem */ +/*****************/ + +void +UA_MonitoredItem_init(UA_MonitoredItem *mon) { + memset(mon, 0, sizeof(UA_MonitoredItem)); + TAILQ_INIT(&mon->queue); +} + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS +static UA_StatusCode +addMonitoredItemNodeCallback(UA_Server *server, UA_Session *session, + UA_Node *node, void *data) { + if(node->head.nodeClass != UA_NODECLASS_OBJECT) + return UA_STATUSCODE_BADNODECLASSINVALID; + UA_MonitoredItem *mon = (UA_MonitoredItem*)data; + UA_ObjectNode *on = &node->objectNode; + mon->next = on->monitoredItemQueue; + on->monitoredItemQueue = mon; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +removeMonitoredItemNodeCallback(UA_Server *server, UA_Session *session, + UA_Node *node, void *data) { + if(node->head.nodeClass != UA_NODECLASS_OBJECT) + return UA_STATUSCODE_BADINVALIDARGUMENT; + UA_ObjectNode *on = &node->objectNode; + UA_MonitoredItem *remove = (UA_MonitoredItem*)data; + + if(!on->monitoredItemQueue) + return UA_STATUSCODE_GOOD; + + /* Edge case that it's the first element */ + if(on->monitoredItemQueue == remove) { + on->monitoredItemQueue = remove->next; + return UA_STATUSCODE_GOOD; + } + + UA_MonitoredItem *prev = on->monitoredItemQueue; + UA_MonitoredItem *entry = prev->next; + for(; entry != NULL; prev = entry, entry = entry->next) { + if(entry == remove) { + prev->next = entry->next; + return UA_STATUSCODE_GOOD; + } + } + + return UA_STATUSCODE_BADNOTFOUND; +} +#endif + +UA_StatusCode +UA_Server_registerMonitoredItem(UA_Server *server, UA_MonitoredItem *mon) { + UA_Subscription *sub = mon->subscription; + UA_Session *session = &server->adminSession; + if(sub) + session = sub->session; + + /* Attach to the Node */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(sub && mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) { + UA_StatusCode res = UA_Server_editNode(server, NULL, &mon->itemToMonitor.nodeId, + addMonitoredItemNodeCallback, mon); + if(res != UA_STATUSCODE_GOOD) + return res; + } +#endif + + /* Register in Subscription and Server */ + if(sub) { + mon->monitoredItemId = ++sub->lastMonitoredItemId; + mon->subscription = sub; + sub->monitoredItemsSize++; + LIST_INSERT_HEAD(&sub->monitoredItems, mon, listEntry); + } else { + mon->monitoredItemId = ++server->lastLocalMonitoredItemId; + LIST_INSERT_HEAD(&server->localMonitoredItems, mon, listEntry); + } + server->monitoredItemsSize++; + + /* Register the MonitoredItem in userland */ + if(server->config.monitoredItemRegisterCallback) { + void *targetContext = NULL; + getNodeContext(server, mon->itemToMonitor.nodeId, &targetContext); + UA_UNLOCK(server->serviceMutex); + server->config.monitoredItemRegisterCallback(server, &session->sessionId, + session->sessionHandle, + &mon->itemToMonitor.nodeId, targetContext, + mon->itemToMonitor.attributeId, false); + UA_LOCK(server->serviceMutex); + } + + mon->registered = true; + return UA_STATUSCODE_GOOD; +} + +static void +UA_Server_unregisterMonitoredItem(UA_Server *server, UA_MonitoredItem *mon) { + UA_Subscription *sub = mon->subscription; + UA_Session *session = &server->adminSession; + if(sub) + session = sub->session; + + UA_LOG_INFO_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | Deleting the MonitoredItem", + mon->monitoredItemId); + + /* Deregister MonitoredItem in userland */ + if(server->config.monitoredItemRegisterCallback) { + void *targetContext = NULL; + getNodeContext(server, mon->itemToMonitor.nodeId, &targetContext); + UA_UNLOCK(server->serviceMutex); + server->config.monitoredItemRegisterCallback(server, + session ? &session->sessionId : NULL, + session ? session->sessionHandle : NULL, + &mon->itemToMonitor.nodeId, targetContext, + mon->itemToMonitor.attributeId, true); + UA_LOCK(server->serviceMutex); + } + + /* Remove from the node */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(sub && mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) { + UA_Server_editNode(server, session, &mon->itemToMonitor.nodeId, + removeMonitoredItemNodeCallback, mon); + } +#endif + + /* Deregister in Subscription and server */ + if(sub) + sub->monitoredItemsSize--; + LIST_REMOVE(mon, listEntry); /* Also for LocalMonitoredItems */ + server->monitoredItemsSize--; + + mon->registered = false; +} + +void +UA_MonitoredItem_delete(UA_Server *server, UA_MonitoredItem *mon) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Deregister in Server and Subscription */ + if(mon->registered) + UA_Server_unregisterMonitoredItem(server, mon); + + /* Remove the sampling callback */ + UA_MonitoredItem_unregisterSampleCallback(server, mon); + + /* Remove the TriggeringLinks */ + if(mon->triggeringLinksSize > 0) { + UA_free(mon->triggeringLinks); + mon->triggeringLinks = NULL; + mon->triggeringLinksSize = 0; + } + + /* Remove the queued notifications attached to the subscription */ + UA_Notification *notification, *notification_tmp; + TAILQ_FOREACH_SAFE(notification, &mon->queue, listEntry, notification_tmp) { + UA_Notification_delete(server, notification); + } + + /* Remove the settings */ + UA_ReadValueId_clear(&mon->itemToMonitor); + UA_MonitoringParameters_clear(&mon->parameters); + + /* Remove the last samples */ + UA_ByteString_clear(&mon->lastSampledValue); + UA_DataValue_clear(&mon->lastValue); + + /* Add a delayed callback to remove the MonitoredItem when the current jobs + * have completed. This is needed to allow that a local MonitoredItem can + * remove itself in the callback. */ + mon->delayedFreePointers.callback = NULL; + mon->delayedFreePointers.application = server; + mon->delayedFreePointers.data = NULL; + mon->delayedFreePointers.nextTime = UA_DateTime_nowMonotonic() + 1; + mon->delayedFreePointers.interval = 0; + UA_Timer_addTimerEntry(&server->timer, &mon->delayedFreePointers, NULL); +} + +void +UA_MonitoredItem_ensureQueueSpace(UA_Server *server, UA_MonitoredItem *mon) { + /* There can be only one EventOverflow more than normal entries. Because + * EventOverflows are never adjacent. */ + UA_assert(mon->queueSize >= mon->eventOverflows); + UA_assert(mon->eventOverflows <= mon->queueSize - mon->eventOverflows + 1); + + /* Nothing to do */ + if(mon->queueSize - mon->eventOverflows <= mon->parameters.queueSize) + return; + + /* Remove notifications until the required queue size is reached */ + UA_Subscription *sub = mon->subscription; + UA_Boolean reporting = false; + size_t remove = mon->queueSize - mon->eventOverflows - mon->parameters.queueSize; + while(remove > 0) { + /* The minimum queue size (without EventOverflows) is 1. At least two + * notifications that are not EventOverflows are in the queue. */ + UA_assert(mon->queueSize - mon->eventOverflows >= 2); + + /* Select the next notification to delete. Skip over overflow events. */ + UA_Notification *del = NULL; + if(mon->parameters.discardOldest) { + /* Remove the oldest */ + del = TAILQ_FIRST(&mon->queue); +#if defined(UA_ENABLE_SUBSCRIPTIONS_EVENTS) && !defined(__clang_analyzer__) + while(del->isOverflowEvent) + del = TAILQ_NEXT(del, listEntry); /* skip overflow events */ +#endif + } else { + /* Remove the second newest (to keep the up-to-date notification). + * The last entry is not an OverflowEvent -- we just added it. */ + del = TAILQ_LAST(&mon->queue, NotificationQueue); + del = TAILQ_PREV(del, NotificationQueue, listEntry); +#if defined(UA_ENABLE_SUBSCRIPTIONS_EVENTS) && !defined(__clang_analyzer__) + while(del->isOverflowEvent) + del = TAILQ_PREV(del, NotificationQueue, listEntry); /* skip overflow events */ +#endif + } + + UA_assert(del); /* There must have been one entry that can be deleted */ + + /* Only create OverflowEvents (and set InfoBits) if the notification + * that is removed is reported */ + if(TAILQ_NEXT(del, globalEntry) != UA_SUBSCRIPTION_QUEUE_SENTINEL) + reporting = true; + + /* Move the entry after del in the per-MonitoredItem queue right after + * del in the per-Subscription queue. So we don't starve MonitoredItems + * with a high sampling interval in the Subscription queue by always + * removing their first appearance in the per-Subscription queue. + * + * With MonitoringMode == SAMPLING, the Notifications are not (all) in + * the per-Subscription queue. Don't reinsert in that case. + * + * For the reinsertion to work, first insert into the per-Subscription + * queue. */ + if(TAILQ_NEXT(del, globalEntry) != UA_SUBSCRIPTION_QUEUE_SENTINEL) { + UA_Notification *after_del = TAILQ_NEXT(del, listEntry); + UA_assert(after_del); /* There must be one remaining element after del */ + if(TAILQ_NEXT(after_del, globalEntry) != UA_SUBSCRIPTION_QUEUE_SENTINEL) { + TAILQ_REMOVE(&sub->notificationQueue, after_del, globalEntry); + TAILQ_INSERT_AFTER(&sub->notificationQueue, del, after_del, globalEntry); + } + } + + remove--; + + /* Delete the notification and remove it from the queues */ + UA_Notification_delete(server, del); + + /* Assertions to help Clang's scan-analyzer */ + UA_assert(del != TAILQ_FIRST(&mon->queue)); + UA_assert(del != TAILQ_LAST(&mon->queue, NotificationQueue)); + UA_assert(del != TAILQ_PREV(TAILQ_LAST(&mon->queue, NotificationQueue), + NotificationQueue, listEntry)); + } + + /* Leave an entry to indicate that notifications were removed */ + if(reporting) { +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) + createEventOverflowNotification(server, sub, mon); + else +#endif + setOverflowInfoBits(mon); + } +} + +UA_StatusCode +UA_MonitoredItem_registerSampleCallback(UA_Server *server, UA_MonitoredItem *mon) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + if(mon->sampleCallbackIsRegistered) + return UA_STATUSCODE_GOOD; + + /* Only DataChange MonitoredItems have a callback with a sampling interval */ + if(mon->itemToMonitor.attributeId == UA_ATTRIBUTEID_EVENTNOTIFIER) + return UA_STATUSCODE_GOOD; + + UA_StatusCode retval = + addRepeatedCallback(server, (UA_ServerCallback)UA_MonitoredItem_sampleCallback, + mon, mon->parameters.samplingInterval, &mon->sampleCallbackId); + if(retval == UA_STATUSCODE_GOOD) + mon->sampleCallbackIsRegistered = true; + return retval; +} + +void +UA_MonitoredItem_unregisterSampleCallback(UA_Server *server, UA_MonitoredItem *mon) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + if(!mon->sampleCallbackIsRegistered) + return; + + removeCallback(server, mon->sampleCallbackId); + mon->sampleCallbackIsRegistered = false; +} + +UA_StatusCode +UA_MonitoredItem_removeLink(UA_Subscription *sub, UA_MonitoredItem *mon, UA_UInt32 linkId) { + /* Find the index */ + size_t i = 0; + for(; i < mon->triggeringLinksSize; i++) { + if(mon->triggeringLinks[i] == linkId) + break; + } + + /* Not existing / already removed */ + if(i == mon->triggeringLinksSize) + return UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + + /* Remove the link */ + mon->triggeringLinksSize--; + if(mon->triggeringLinksSize == 0) { + UA_free(mon->triggeringLinks); + mon->triggeringLinks = NULL; + } else { + mon->triggeringLinks[i] = mon->triggeringLinks[mon->triggeringLinksSize]; + UA_UInt32 *tmpLinks = (UA_UInt32*) + UA_realloc(mon->triggeringLinks, mon->triggeringLinksSize * sizeof(UA_UInt32)); + if(tmpLinks) + mon->triggeringLinks = tmpLinks; + } + + /* Does the target MonitoredItem exist? This is stupid, but the CTT wants us + * to to this. We don't auto-remove links together with the target + * MonitoredItem. Links to removed MonitoredItems are removed when the link + * triggers and the target no longer exists. */ + UA_MonitoredItem *mon2 = UA_Subscription_getMonitoredItem(sub, linkId); + if(!mon2) + return UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_MonitoredItem_addLink(UA_Subscription *sub, UA_MonitoredItem *mon, UA_UInt32 linkId) { + /* Does the target MonitoredItem exist? */ + UA_MonitoredItem *mon2 = UA_Subscription_getMonitoredItem(sub, linkId); + if(!mon2) + return UA_STATUSCODE_BADMONITOREDITEMIDINVALID; + + /* Does the link already exist? */ + for(size_t i = 0 ; i < mon->triggeringLinksSize; i++) { + if(mon->triggeringLinks[i] == linkId) + return UA_STATUSCODE_GOOD; + } + + /* Allocate the memory */ + UA_UInt32 *tmpLinkIds = (UA_UInt32*) + UA_realloc(mon->triggeringLinks, (mon->triggeringLinksSize + 1) * sizeof(UA_UInt32)); + if(!tmpLinkIds) + return UA_STATUSCODE_BADOUTOFMEMORY; + mon->triggeringLinks = tmpLinkIds; + + /* Add the link */ + mon->triggeringLinks[mon->triggeringLinksSize] = linkId; + mon->triggeringLinksSize++; + return UA_STATUSCODE_GOOD; +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/src/server/ua_subscription_datachange.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Ari Breitkreuz, fortiss GmbH + * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Fabian Arndt, Root-Core + */ + + +#ifdef UA_ENABLE_SUBSCRIPTIONS /* conditional compilation */ + +#define UA_VALUENCODING_MAXSTACK 512 + +/* Convert to double first. We might loose differences for large Int64 that + * cannot be precisely expressed as double. */ +static UA_Boolean +outOfDeadBand(const void *data1, const void *data2, + const UA_DataType *type, const UA_Double deadband) { + UA_Double v; + if(type == &UA_TYPES[UA_TYPES_BOOLEAN]) { + v = (UA_Double)*(const UA_Boolean*)data1 - (UA_Double)*(const UA_Boolean*)data2; + } else if(type == &UA_TYPES[UA_TYPES_SBYTE]) { + v = (UA_Double)*(const UA_SByte*)data1 - (UA_Double)*(const UA_SByte*)data2; + } else if(type == &UA_TYPES[UA_TYPES_BYTE]) { + v = (UA_Double)*(const UA_Byte*)data1 - (UA_Double)*(const UA_Byte*)data2; + } else if(type == &UA_TYPES[UA_TYPES_INT16]) { + v = (UA_Double)*(const UA_Int16*)data1 - (UA_Double)*(const UA_Int16*)data2; + } else if(type == &UA_TYPES[UA_TYPES_UINT16]) { + v = (UA_Double)*(const UA_UInt16*)data1 - (UA_Double)*(const UA_UInt16*)data2; + } else if(type == &UA_TYPES[UA_TYPES_INT32]) { + v = (UA_Double)*(const UA_Int32*)data1 - (UA_Double)*(const UA_Int32*)data2; + } else if(type == &UA_TYPES[UA_TYPES_UINT32]) { + v = (UA_Double)*(const UA_UInt32*)data1 - (UA_Double)*(const UA_UInt32*)data2; + } else if(type == &UA_TYPES[UA_TYPES_INT64]) { + v = (UA_Double)*(const UA_Int64*)data1 - (UA_Double)*(const UA_Int64*)data2; + } else if(type == &UA_TYPES[UA_TYPES_UINT64]) { + v = (UA_Double)*(const UA_UInt64*)data1 - (UA_Double)*(const UA_UInt64*)data2; + } else if(type == &UA_TYPES[UA_TYPES_FLOAT]) { + v = (UA_Double)*(const UA_Float*)data1 - (UA_Double)*(const UA_Float*)data2; + } else if(type == &UA_TYPES[UA_TYPES_DOUBLE]) { + v = (UA_Double)*(const UA_Double*)data1 - (UA_Double)*(const UA_Double*)data2; + } else { + return false; + } + if(v < 0.0) + v = -v; + return (v > deadband); +} + +static UA_Boolean +updateNeededForFilteredValue(const UA_Variant *value, const UA_Variant *oldValue, + const UA_Double deadbandValue) { + if(value->arrayLength != oldValue->arrayLength) + return true; + + if(value->type != oldValue->type) + return true; + + size_t length = 1; + if(!UA_Variant_isScalar(value)) + length = value->arrayLength; + uintptr_t data = (uintptr_t)value->data; + for(size_t i = 0; i < length; ++i) { + if(outOfDeadBand((const void*)data, oldValue->data, value->type, deadbandValue)) + return true; + data += value->type->memSize; + } + + return false; +} + +/* When a change is detected, encoding contains the heap-allocated binary + * encoded value. The default for changed is false. */ +static UA_StatusCode +detectValueChangeWithFilter(UA_Server *server, UA_Session *session, UA_MonitoredItem *mon, + UA_DataValue *value, UA_ByteString *encoding, + UA_Boolean *changed) { + if(!value->value.type) { + *changed = UA_ByteString_equal(encoding, &mon->lastSampledValue); + return UA_STATUSCODE_GOOD; + } + + /* Test absolute deadband */ + if(UA_DataType_isNumeric(value->value.type) && + mon->parameters.filter.content.decoded.type == &UA_TYPES[UA_TYPES_DATACHANGEFILTER]) { + UA_DataChangeFilter *filter = (UA_DataChangeFilter*) + mon->parameters.filter.content.decoded.data; + if(filter->deadbandType == UA_DEADBANDTYPE_ABSOLUTE && + (filter->trigger == UA_DATACHANGETRIGGER_STATUSVALUE || + filter->trigger == UA_DATACHANGETRIGGER_STATUSVALUETIMESTAMP)) { + *changed = updateNeededForFilteredValue(&value->value, + &mon->lastValue.value, + filter->deadbandValue); + return UA_STATUSCODE_GOOD; + } + } + + /* Stack-allocate some memory for the value encoding. We might heap-allocate + * more memory if needed. This is just enough for scalars and small + * structures. */ + UA_Byte stackValueEncoding[UA_VALUENCODING_MAXSTACK]; + UA_ByteString valueEncoding; + valueEncoding.data = stackValueEncoding; + valueEncoding.length = UA_VALUENCODING_MAXSTACK; + UA_Byte *bufPos = stackValueEncoding; + const UA_Byte *bufEnd = &stackValueEncoding[UA_VALUENCODING_MAXSTACK]; + + /* Encode the value */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + size_t binsize = 0; + if(mon->lastSampledValue.length <= UA_VALUENCODING_MAXSTACK) { + /* Encode without using calcSizeBinary first. This will fail with + * UA_STATUSCODE_BADENCODINGERROR once the end of the buffer is + * reached. */ + retval = UA_encodeBinary(value, &UA_TYPES[UA_TYPES_DATAVALUE], + &bufPos, &bufEnd, NULL, NULL); + if(retval == UA_STATUSCODE_BADENCODINGERROR) + goto encodeOnHeap; /* The buffer was not large enough */ + } else { + /* Allocate a fitting buffer on the heap. This requires us to iterate + * twice over the value (calcSizeBinary and encodeBinary) */ + encodeOnHeap: + binsize = UA_calcSizeBinary(value, &UA_TYPES[UA_TYPES_DATAVALUE]); + if(binsize == 0) { + retval = UA_STATUSCODE_BADENCODINGERROR; + goto cleanup; + } + retval = UA_ByteString_allocBuffer(&valueEncoding, binsize); + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + bufPos = valueEncoding.data; + bufEnd = &valueEncoding.data[valueEncoding.length]; + retval = UA_encodeBinary(value, &UA_TYPES[UA_TYPES_DATAVALUE], + &bufPos, &bufEnd, NULL, NULL); + } + if(retval != UA_STATUSCODE_GOOD) + goto cleanup; + + /* Has the value changed? */ + valueEncoding.length = (uintptr_t)bufPos - (uintptr_t)valueEncoding.data; + *changed = !UA_String_equal(&valueEncoding, &mon->lastSampledValue); + + /* Change detected */ + if(*changed) { + /* Move the heap-allocated encoding to the output and return */ + if(valueEncoding.data != stackValueEncoding) { + *encoding = valueEncoding; + return UA_STATUSCODE_GOOD; + } + /* Copy stack-allocated encoding to the output */ + retval = UA_ByteString_copy(&valueEncoding, encoding); + } + + cleanup: + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_ERROR_SUBSCRIPTION(&server->config.logger, mon->subscription, + "MonitoredItem %" PRIi32 " | " + "Encoding the value failed with StatusCode %s", + mon->monitoredItemId, UA_StatusCode_name(retval)); + } + if(valueEncoding.data != stackValueEncoding) + UA_ByteString_clear(&valueEncoding); + return retval; +} + +/* Has this sample changed from the last one? The method may allocate additional + * space for the encoding buffer. Detect the change in encoding->data. */ +static UA_StatusCode +detectValueChange(UA_Server *server, UA_Session *session, UA_MonitoredItem *mon, + UA_DataValue value, UA_ByteString *encoding, UA_Boolean *changed) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + /* Default trigger is statusvalue */ + UA_DataChangeTrigger trigger = UA_DATACHANGETRIGGER_STATUSVALUE; + if(mon->parameters.filter.content.decoded.type == &UA_TYPES[UA_TYPES_DATACHANGEFILTER]) + trigger = ((UA_DataChangeFilter*) + mon->parameters.filter.content.decoded.data)->trigger; + + /* Apply Filter */ + if(trigger == UA_DATACHANGETRIGGER_STATUS) + value.hasValue = false; + + value.hasServerTimestamp = false; + value.hasServerPicoseconds = false; + if(trigger < UA_DATACHANGETRIGGER_STATUSVALUETIMESTAMP) { + value.hasSourceTimestamp = false; + value.hasSourcePicoseconds = false; + } + + /* Detect the value change */ + return detectValueChangeWithFilter(server, session, mon, &value, encoding, changed); +} + +UA_StatusCode +UA_MonitoredItem_createDataChangeNotification(UA_Server *server, UA_Subscription *sub, + UA_MonitoredItem *mon, + const UA_DataValue *value) { + /* Allocate a new notification */ + UA_Notification *newNotification = UA_Notification_new(); + if(!newNotification) + return UA_STATUSCODE_BADOUTOFMEMORY; + + /* Prepare the notification */ + newNotification->mon = mon; + newNotification->data.dataChange.clientHandle = mon->parameters.clientHandle; + UA_StatusCode retval = UA_DataValue_copy(value, &newNotification->data.dataChange.value); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(newNotification); + return retval; + } + + /* Enqueue the notification */ + UA_Notification_enqueueAndTrigger(server, newNotification); + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "Enqueued a new notification", mon->monitoredItemId); + return UA_STATUSCODE_GOOD; +} + +/* Moves the value to the MonitoredItem if successful */ +static UA_StatusCode +sampleCallbackWithValue(UA_Server *server, UA_Session *session, + UA_Subscription *sub, UA_MonitoredItem *mon, + UA_DataValue *value) { + UA_assert(mon->itemToMonitor.attributeId != UA_ATTRIBUTEID_EVENTNOTIFIER); + + /* Contains heap-allocated binary encoding of the value if a change was detected */ + UA_ByteString binValueEncoding = UA_BYTESTRING_NULL; + + /* Has the value changed with the filter applied? Allocates memory in + * binValueEncoding if necessary. The value structure is edited internally. + * So we don't give a pointer argument and make a shallow copy instead. */ + UA_Boolean changed = false; + UA_StatusCode retval = detectValueChange(server, session, mon, *value, + &binValueEncoding, &changed); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "Value change detection failed with StatusCode %s", + mon->monitoredItemId, UA_StatusCode_name(retval)); + UA_DataValue_clear(value); + return retval; + } + + /* No change detected */ + if(!changed) { + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "The value has not changed", mon->monitoredItemId); + UA_DataValue_clear(value); + return UA_STATUSCODE_GOOD; + } + + /* The MonitoredItem is attached to a subscription (not server-local). + * Prepare a notification and enqueue it. */ + if(sub) { + retval = UA_MonitoredItem_createDataChangeNotification(server, sub, mon, value); + if(retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear(&binValueEncoding); + UA_DataValue_clear(value); + return retval; + } + } + + /* <-- Point of no return --> */ + + /* Store the encoding for comparison */ + UA_ByteString_clear(&mon->lastSampledValue); + mon->lastSampledValue = binValueEncoding; + + /* Move/store the value for filter comparison and TransferSubscription */ + UA_DataValue_clear(&mon->lastValue); + mon->lastValue = *value; + + /* Call the local callback if the MonitoredItem is not attached to a + * subscription. Do this at the very end. Because the callback might delete + * the subscription. */ + if(!sub) { + UA_LocalMonitoredItem *localMon = (UA_LocalMonitoredItem*) mon; + void *nodeContext = NULL; + getNodeContext(server, mon->itemToMonitor.nodeId, &nodeContext); + UA_UNLOCK(server->serviceMutex); + localMon->callback.dataChangeCallback(server, + mon->monitoredItemId, localMon->context, + &mon->itemToMonitor.nodeId, nodeContext, + mon->itemToMonitor.attributeId, value); + UA_LOCK(server->serviceMutex); + } + + return UA_STATUSCODE_GOOD; +} + +void +UA_MonitoredItem_sampleCallback(UA_Server *server, UA_MonitoredItem *monitoredItem) { + UA_LOCK(server->serviceMutex); + monitoredItem_sampleCallback(server, monitoredItem); + UA_UNLOCK(server->serviceMutex); +} + +void +monitoredItem_sampleCallback(UA_Server *server, UA_MonitoredItem *monitoredItem) { + UA_LOCK_ASSERT(server->serviceMutex, 1); + + UA_Subscription *sub = monitoredItem->subscription; + UA_Session *session = &server->adminSession; + if(sub) + session = sub->session; + + UA_LOG_DEBUG_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "Sample callback called", monitoredItem->monitoredItemId); + + UA_assert(monitoredItem->itemToMonitor.attributeId != UA_ATTRIBUTEID_EVENTNOTIFIER); + + /* Get the node */ + const UA_Node *node = UA_NODESTORE_GET(server, &monitoredItem->itemToMonitor.nodeId); + + /* Sample the value. The sample can still point into the node. */ + UA_DataValue value; + UA_DataValue_init(&value); + if(node) { + ReadWithNode(node, server, session, monitoredItem->timestampsToReturn, + &monitoredItem->itemToMonitor, &value); + } else { + value.hasStatus = true; + value.status = UA_STATUSCODE_BADNODEIDUNKNOWN; + } + + /* Operate on the sample. Don't touch value after this. */ + UA_StatusCode retval = sampleCallbackWithValue(server, session, sub, + monitoredItem, &value); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING_SUBSCRIPTION(&server->config.logger, sub, + "MonitoredItem %" PRIi32 " | " + "Sampling returned the statuscode %s", + monitoredItem->monitoredItemId, + UA_StatusCode_name(retval)); + } + + if(node) + UA_NODESTORE_RELEASE(server, node); +} + +#endif /* UA_ENABLE_SUBSCRIPTIONS */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/securitypolicy_openssl_common.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + * + */ + + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + +#include <openssl/x509.h> +#include <openssl/evp.h> + +_UA_BEGIN_DECLS + +void saveDataToFile(const char *fileName, const UA_ByteString *str); +void UA_Openssl_Init(void); + +UA_StatusCode +UA_copyCertificate(UA_ByteString *dst, const UA_ByteString *src); + +UA_StatusCode +UA_OpenSSL_RSA_PKCS1_V15_SHA256_Verify(const UA_ByteString *msg, + X509 *publicKeyX509, + const UA_ByteString *signature); +UA_StatusCode +UA_Openssl_X509_GetCertificateThumbprint(const UA_ByteString *certficate, + UA_ByteString *pThumbprint, + bool bThumbPrint); +UA_StatusCode +UA_Openssl_RSA_Oaep_Decrypt(UA_ByteString *data, + EVP_PKEY *privateKey); +UA_StatusCode +UA_Openssl_RSA_OAEP_Encrypt(UA_ByteString *data, /* The data that is encrypted. + The encrypted data will overwrite + the data that was supplied. */ + size_t paddingSize, X509 *publicX509); + +UA_StatusCode +UA_Openssl_Random_Key_PSHA256_Derive(const UA_ByteString *secret, + const UA_ByteString *seed, + UA_ByteString *out); + +UA_StatusCode +UA_Openssl_RSA_Public_GetKeyLength(X509 *publicKeyX509, UA_Int32 *keyLen); + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_SHA256_Sign(const UA_ByteString *data, + EVP_PKEY *privateKey, + UA_ByteString *outSignature); + +UA_StatusCode +UA_OpenSSL_HMAC_SHA256_Verify(const UA_ByteString *message, + const UA_ByteString *key, + const UA_ByteString *signature); + +UA_StatusCode +UA_OpenSSL_HMAC_SHA256_Sign(const UA_ByteString *message, + const UA_ByteString *key, + UA_ByteString *signature); + +UA_StatusCode +UA_OpenSSL_AES_256_CBC_Decrypt(const UA_ByteString *iv, + const UA_ByteString *key, + UA_ByteString *data /* [in/out]*/); + +UA_StatusCode +UA_OpenSSL_AES_256_CBC_Encrypt(const UA_ByteString *iv, + const UA_ByteString *key, + UA_ByteString *data /* [in/out]*/); + +UA_StatusCode +UA_OpenSSL_X509_compare(const UA_ByteString *cert, const X509 *b); + +UA_StatusCode +UA_Openssl_RSA_Private_GetKeyLength(EVP_PKEY *privateKey, + UA_Int32 *keyLen) ; + +UA_StatusCode +UA_OpenSSL_RSA_PKCS1_V15_SHA1_Verify(const UA_ByteString *msg, + X509 *publicKeyX509, + const UA_ByteString *signature); + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_SHA1_Sign(const UA_ByteString *message, + EVP_PKEY *privateKey, + UA_ByteString *outSignature); +UA_StatusCode +UA_Openssl_Random_Key_PSHA1_Derive(const UA_ByteString *secret, + const UA_ByteString *seed, + UA_ByteString *out); +UA_StatusCode +UA_OpenSSL_HMAC_SHA1_Verify(const UA_ByteString *message, + const UA_ByteString *key, + const UA_ByteString *signature); + +UA_StatusCode +UA_OpenSSL_HMAC_SHA1_Sign(const UA_ByteString *message, + const UA_ByteString *key, + UA_ByteString *signature); + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_Decrypt(UA_ByteString *data, + EVP_PKEY *privateKey); + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_Encrypt(UA_ByteString *data, + size_t paddingSize, + X509 *publicX509); + +UA_StatusCode +UA_OpenSSL_AES_128_CBC_Decrypt(const UA_ByteString *iv, + const UA_ByteString *key, + UA_ByteString *data /* [in/out]*/); + +UA_StatusCode +UA_OpenSSL_AES_128_CBC_Encrypt(const UA_ByteString *iv, + const UA_ByteString *key, + UA_ByteString *data /* [in/out]*/); + +EVP_PKEY * +UA_OpenSSL_LoadPrivateKey(const UA_ByteString *privateKey); + +X509 * +UA_OpenSSL_LoadCertificate(const UA_ByteString *certificate); + +X509 * +UA_OpenSSL_LoadDerCertificate(const UA_ByteString *certificate); + +X509 * +UA_OpenSSL_LoadPemCertificate(const UA_ByteString *certificate); + +UA_StatusCode +UA_OpenSSL_LoadLocalCertificate(const UA_ByteString *certificate, UA_ByteString *target); + +_UA_END_DECLS + +#endif /* UA_ENABLE_ENCRYPTION_OPENSSL */ + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/securitypolicy_openssl_common.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + */ + +/* +modification history +-------------------- +01feb20,lan written +*/ + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + +#include <openssl/rsa.h> +#include <openssl/evp.h> +#include <openssl/err.h> +#include <openssl/sha.h> +#include <openssl/x509.h> +#include <openssl/hmac.h> +#include <openssl/aes.h> +#include <openssl/pem.h> + + +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL +#define get_pkey_rsa(evp) EVP_PKEY_get0_RSA(evp) +#else +#define get_pkey_rsa(evp) ((evp)->pkey.rsa) +#endif + +#define SHA1_DIGEST_LENGTH 20 /* 160 bits */ + +/** P_SHA256 Context */ +typedef struct UA_Openssl_P_SHA256_Ctx_ { + size_t seedLen; + size_t secretLen; + UA_Byte A[32]; /* 32 bytes of SHA256 output */ + /* + char seed[seedLen]; + char secret[secretLen]; */ +} UA_Openssl_P_SHA256_Ctx; + +#define UA_Openssl_P_SHA256_SEED(ctx) ((ctx)->A+32) +#define UA_Openssl_P_SHA256_SECRET(ctx) ((ctx)->A+32+(ctx)->seedLen) + +/** P_SHA1 Context */ +typedef struct UA_Openssl_P_SHA1_Ctx_ { + size_t seedLen; + size_t secretLen; + UA_Byte A[SHA1_DIGEST_LENGTH]; /* 20 bytes of SHA1 output */ + /* + char seed[seedLen]; + char secret[secretLen]; */ +} UA_Openssl_P_SHA1_Ctx; + +#define UA_Openssl_P_SHA1_SEED(ctx) ((ctx)->A + SHA1_DIGEST_LENGTH) +#define UA_Openssl_P_SHA1_SECRET(ctx) ((ctx)->A + SHA1_DIGEST_LENGTH +(ctx)->seedLen) + +void +UA_Openssl_Init (void) { + /* VxWorks7 has initialized the openssl. */ +#ifndef __VXWORKS__ + static UA_Int16 bInit = 0; + if (bInit == 1) + return; +#if defined(OPENSSL_API_COMPAT) && (OPENSSL_API_COMPAT < 0x10100000L) + /* only needed, if OpenSSL < V1.1 */ + OpenSSL_add_all_algorithms (); + ERR_load_crypto_strings (); +#endif + bInit = 1; +#endif +} + +/* UA_copyCertificate - allocalte the buffer, copy the certificate and + * add a NULL to the end + */ + +UA_StatusCode +UA_copyCertificate (UA_ByteString * dst, + const UA_ByteString * src) { + UA_StatusCode retval = UA_ByteString_allocBuffer (dst, src->length + 1); + if (retval != UA_STATUSCODE_GOOD) + return retval; + (void) memcpy (dst->data, src->data, src->length); + dst->data[dst->length - 1] = '\0'; + dst->length--; + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_OpenSSL_RSA_Public_Verify (const UA_ByteString * message, + const EVP_MD * evpMd, + X509 * publicKeyX509, + UA_Int16 padding, + const UA_ByteString * signature + ) { + EVP_MD_CTX * mdctx = NULL; + int opensslRet; + EVP_PKEY_CTX * evpKeyCtx; + EVP_PKEY * evpPublicKey = NULL; + UA_StatusCode ret; + + mdctx = EVP_MD_CTX_create (); + if (mdctx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + evpPublicKey = X509_get_pubkey (publicKeyX509); + if (evpPublicKey == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + + opensslRet = EVP_DigestVerifyInit (mdctx, &evpKeyCtx, evpMd, NULL, + evpPublicKey); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + EVP_PKEY_CTX_set_rsa_padding (evpKeyCtx, padding); + opensslRet = EVP_DigestVerifyUpdate (mdctx, message->data, message->length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + opensslRet = EVP_DigestVerifyFinal(mdctx, signature->data, signature->length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + + ret = UA_STATUSCODE_GOOD; +errout: + if (evpPublicKey != NULL) { + EVP_PKEY_free (evpPublicKey); + } + if (mdctx != NULL) { + EVP_MD_CTX_destroy (mdctx); + } + return ret; +} + +UA_StatusCode +UA_OpenSSL_RSA_PKCS1_V15_SHA256_Verify (const UA_ByteString * msg, + X509 * publicKeyX509, + const UA_ByteString * signature + ) { + return UA_OpenSSL_RSA_Public_Verify (msg, EVP_sha256(), publicKeyX509, + NID_sha256, signature); +} + +/* Get certificate thumbprint, and allocate the buffer. */ + +UA_StatusCode +UA_Openssl_X509_GetCertificateThumbprint (const UA_ByteString * certficate, + UA_ByteString * pThumbprint, + bool bThumbPrint) { + if (bThumbPrint) { + pThumbprint->length = SHA_DIGEST_LENGTH; + UA_StatusCode ret = UA_ByteString_allocBuffer (pThumbprint, pThumbprint->length); + if (ret != UA_STATUSCODE_GOOD) { + return ret; + } + } + else { + if (pThumbprint->length != SHA_DIGEST_LENGTH) { + return UA_STATUSCODE_BADINTERNALERROR; + } + } + X509 * x509Certificate = UA_OpenSSL_LoadCertificate(certficate); + + if (x509Certificate == NULL) { + if (bThumbPrint) { + UA_ByteString_clear (pThumbprint); + } + return UA_STATUSCODE_BADINTERNALERROR; + } + + if (X509_digest (x509Certificate, EVP_sha1(), pThumbprint->data, NULL) + != 1) { + if (bThumbPrint) { + UA_ByteString_clear (pThumbprint); + } + return UA_STATUSCODE_BADINTERNALERROR; + } + X509_free(x509Certificate); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_Openssl_RSA_Private_Decrypt (UA_ByteString * data, + EVP_PKEY * privateKey, + UA_Int16 padding) { + if (data == NULL || privateKey == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + if (privateKey == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_Int32 keySize = RSA_size(get_pkey_rsa(privateKey)); + size_t cipherOffset = 0; + size_t outOffset = 0; + unsigned char buf[2048]; + UA_Int32 decryptedBytes; + + while (cipherOffset < data->length) { + decryptedBytes = RSA_private_decrypt (keySize, + data->data + cipherOffset, /* what to decrypt */ + buf, /* where to decrypt */ + get_pkey_rsa(privateKey), /* private key */ + padding + ); + if (decryptedBytes < 0) { + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + memcpy(data->data + outOffset, buf, (size_t) decryptedBytes); + cipherOffset += (size_t) keySize; + outOffset += (size_t) decryptedBytes; + } + data->length = outOffset; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Openssl_RSA_Oaep_Decrypt (UA_ByteString * data, + EVP_PKEY * privateKey) { + return UA_Openssl_RSA_Private_Decrypt (data, privateKey, + RSA_PKCS1_OAEP_PADDING); +} + +static UA_StatusCode +UA_Openssl_RSA_Public_Encrypt (const UA_ByteString * message, + X509 * publicX509, + UA_Int16 padding, + size_t paddingSize, + UA_ByteString * encrypted) { + EVP_PKEY_CTX * ctx = NULL; + EVP_PKEY * evpPublicKey = NULL; + int opensslRet; + UA_StatusCode ret; + size_t encryptedTextLen = 0; + size_t dataPos = 0; + size_t encryptedPos = 0; + size_t bytesToEncrypt = 0; + size_t encryptedBlockSize = 0; + RSA * rsa = NULL; + size_t keySize = 0; + + evpPublicKey = X509_get_pubkey (publicX509); + if (evpPublicKey == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + ctx = EVP_PKEY_CTX_new (evpPublicKey, NULL); + if (ctx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + opensslRet = EVP_PKEY_encrypt_init (ctx); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + opensslRet = EVP_PKEY_CTX_set_rsa_padding (ctx, padding); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + + /* get the encrypted block size */ + rsa = get_pkey_rsa (evpPublicKey); + keySize = (size_t) RSA_size (rsa); + if (keySize == 0) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + + switch (padding) { + case RSA_PKCS1_OAEP_PADDING: + case RSA_PKCS1_PADDING: + if (keySize <= paddingSize) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + encryptedBlockSize = keySize - paddingSize; + break; + default: + ret = UA_STATUSCODE_BADNOTSUPPORTED; + goto errout; + break; + } + + /* encrypt in reverse order so that [data] may alias [encrypted] */ + + dataPos = message->length; + encryptedPos = ((dataPos - 1) / encryptedBlockSize + 1) * keySize; + bytesToEncrypt = (dataPos - 1) % encryptedBlockSize + 1; + encryptedTextLen = encryptedPos; + + while (dataPos > 0) { + size_t outlen = keySize; + encryptedPos -= keySize; + dataPos -= bytesToEncrypt; + opensslRet = EVP_PKEY_encrypt (ctx, encrypted->data + encryptedPos, &outlen, + message->data + dataPos, bytesToEncrypt); + + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + bytesToEncrypt = encryptedBlockSize; + } + encrypted->length = encryptedTextLen; + + ret = UA_STATUSCODE_GOOD; +errout: + if (evpPublicKey != NULL) { + EVP_PKEY_free (evpPublicKey); + } + if (ctx != NULL) { + EVP_PKEY_CTX_free (ctx); + } + return ret; +} + +UA_StatusCode +UA_Openssl_RSA_OAEP_Encrypt (UA_ByteString * data, + size_t paddingSize, + X509 * publicX509) { + UA_ByteString message; + UA_StatusCode ret; + + ret = UA_ByteString_copy (data, &message); + if (ret != UA_STATUSCODE_GOOD) { + return ret; + } + ret = UA_Openssl_RSA_Public_Encrypt (&message, publicX509, + RSA_PKCS1_OAEP_PADDING, + paddingSize, + data); + UA_ByteString_clear (&message); + return ret; +} + +static UA_Openssl_P_SHA256_Ctx * +P_SHA256_Ctx_Create (const UA_ByteString * secret, + const UA_ByteString * seed) { + size_t size = (UA_Int32)sizeof (UA_Openssl_P_SHA256_Ctx) + secret->length + + seed->length; + UA_Openssl_P_SHA256_Ctx * ctx = (UA_Openssl_P_SHA256_Ctx *) UA_malloc (size); + if (ctx == NULL) { + return NULL; + } + ctx->secretLen = secret->length; + ctx->seedLen = seed->length; + (void) memcpy (UA_Openssl_P_SHA256_SEED(ctx), seed->data, seed->length); + (void) memcpy (UA_Openssl_P_SHA256_SECRET(ctx), secret->data, secret->length); + /* A(0) = seed + A(n) = HMAC_HASH(secret, A(n-1)) */ + + if (HMAC (EVP_sha256(), secret->data, (int) secret->length, seed->data, + seed->length, ctx->A, NULL) == NULL) { + UA_free (ctx); + return NULL; + } + + return ctx; +} + +static UA_StatusCode +P_SHA256_Hash_Generate (UA_Openssl_P_SHA256_Ctx * ctx, + UA_Byte * pHas + ) { + /* Calculate P_SHA256(n) = HMAC_SHA256(secret, A(n)+seed) */ + if (HMAC (EVP_sha256(),UA_Openssl_P_SHA256_SECRET(ctx), (int) ctx->secretLen, + ctx->A, sizeof (ctx->A) + ctx->seedLen, pHas, NULL) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Calculate A(n) = HMAC_SHA256(secret, A(n-1)) */ + if (HMAC (EVP_sha256(),UA_Openssl_P_SHA256_SECRET(ctx), (int) ctx->secretLen, + ctx->A, sizeof (ctx->A), ctx->A, NULL) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Openssl_Random_Key_PSHA256_Derive (const UA_ByteString * secret, + const UA_ByteString * seed, + UA_ByteString * out) { + size_t keyLen = out->length; + size_t iter = keyLen/32 + ((keyLen%32)?1:0); + size_t bufferLen = iter * 32; + size_t i; + UA_StatusCode st; + + UA_Byte * pBuffer = (UA_Byte *) UA_malloc (bufferLen); + if (pBuffer == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_Openssl_P_SHA256_Ctx * ctx = P_SHA256_Ctx_Create (secret, seed); + if (ctx == NULL) { + UA_free (pBuffer); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + for (i = 0; i < iter; i++) { + st = P_SHA256_Hash_Generate (ctx, pBuffer + (i * 32)); + if (st != UA_STATUSCODE_GOOD) { + UA_free (pBuffer); + UA_free (ctx); + return st; + } + } + + (void) memcpy (out->data, pBuffer, keyLen); + UA_free (pBuffer); + UA_free (ctx); + return UA_STATUSCODE_GOOD; +} + +/* return the key bytes */ +UA_StatusCode +UA_Openssl_RSA_Public_GetKeyLength (X509 * publicKeyX509, + UA_Int32 * keyLen) { + EVP_PKEY * evpKey = X509_get_pubkey (publicKeyX509); + if (evpKey == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + RSA * rsa = get_pkey_rsa (evpKey); + *keyLen = RSA_size(rsa); + EVP_PKEY_free (evpKey); + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Openssl_RSA_Private_GetKeyLength (EVP_PKEY * privateKey, + UA_Int32 * keyLen) { + if (privateKey == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + *keyLen = RSA_size(get_pkey_rsa(privateKey)); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_Openssl_RSA_Private_Sign (const UA_ByteString * message, + EVP_PKEY * privateKey, + const EVP_MD * evpMd, + UA_Int16 padding, + UA_ByteString * outSignature) { + EVP_MD_CTX * mdctx = NULL; + int opensslRet; + EVP_PKEY_CTX * evpKeyCtx; + UA_StatusCode ret; + + mdctx = EVP_MD_CTX_create (); + if (mdctx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + + if (privateKey == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + opensslRet = EVP_DigestSignInit (mdctx, &evpKeyCtx, evpMd, NULL, privateKey); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + EVP_PKEY_CTX_set_rsa_padding (evpKeyCtx, padding); + + opensslRet = EVP_DigestSignUpdate (mdctx, message->data, message->length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + opensslRet = EVP_DigestSignFinal (mdctx, outSignature->data, &outSignature->length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + + ret = UA_STATUSCODE_GOOD; +errout: + if (mdctx != NULL) { + EVP_MD_CTX_destroy (mdctx); + } + return ret; +} + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_SHA256_Sign (const UA_ByteString * message, + EVP_PKEY * privateKey, + UA_ByteString * outSignature) { + return UA_Openssl_RSA_Private_Sign (message, privateKey, EVP_sha256(), + NID_sha256, outSignature); +} + +UA_StatusCode +UA_OpenSSL_HMAC_SHA256_Verify (const UA_ByteString * message, + const UA_ByteString * key, + const UA_ByteString * signature + ) { + unsigned char buf[SHA256_DIGEST_LENGTH] = {0}; + UA_ByteString mac = {SHA256_DIGEST_LENGTH, buf}; + + if (HMAC (EVP_sha256(), key->data, (int) key->length, message->data, message->length, + mac.data, (unsigned int *) &mac.length) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + if (UA_ByteString_equal (signature, &mac)) { + return UA_STATUSCODE_GOOD; + } + else { + return UA_STATUSCODE_BADINTERNALERROR; + } +} + +UA_StatusCode +UA_OpenSSL_HMAC_SHA256_Sign (const UA_ByteString * message, + const UA_ByteString * key, + UA_ByteString * signature + ) { + if (HMAC (EVP_sha256(), key->data, (int) key->length, message->data, + message->length, + signature->data, (unsigned int *) &(signature->length)) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_OpenSSL_Decrypt (const UA_ByteString * iv, + const UA_ByteString * key, + const EVP_CIPHER * cipherAlg, + UA_ByteString * data /* [in/out]*/) { + UA_ByteString ivCopy = {0, NULL}; + UA_ByteString cipherTxt = {0, NULL}; + EVP_CIPHER_CTX * ctx = NULL; + UA_StatusCode ret; + int opensslRet; + int outLen; + int tmpLen; + + /* copy the IV because the AES_cbc_encrypt function overwrites it. */ + + ret = UA_ByteString_copy (iv, &ivCopy); + if (ret != UA_STATUSCODE_GOOD) { + goto errout; + } + + ret = UA_ByteString_copy (data, &cipherTxt); + if (ret != UA_STATUSCODE_GOOD) { + goto errout; + } + + ctx = EVP_CIPHER_CTX_new (); + if (ctx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + + /* call EVP_* to decrypt */ + + opensslRet = EVP_DecryptInit_ex (ctx, cipherAlg, NULL, key->data, ivCopy.data); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + /* EVP_DecryptFinal() will return an error code if padding is enabled + * and the final block is not correctly formatted. + */ + EVP_CIPHER_CTX_set_padding (ctx, 0); + opensslRet = EVP_DecryptUpdate (ctx, data->data, &outLen, + cipherTxt.data, (int) cipherTxt.length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + opensslRet = EVP_DecryptFinal_ex (ctx, data->data + outLen, &tmpLen); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + outLen += tmpLen; + data->length = (size_t) outLen; + ret = UA_STATUSCODE_GOOD; + +errout: + UA_ByteString_clear (&ivCopy); + UA_ByteString_clear (&cipherTxt); + if (ctx != NULL) { + EVP_CIPHER_CTX_free(ctx); + } + return ret; +} + +static UA_StatusCode +UA_OpenSSL_Encrypt (const UA_ByteString * iv, + const UA_ByteString * key, + const EVP_CIPHER * cipherAlg, + UA_ByteString * data /* [in/out]*/ + ) { + + UA_ByteString ivCopy = {0, NULL}; + UA_ByteString plainTxt = {0, NULL}; + EVP_CIPHER_CTX * ctx = NULL; + UA_StatusCode ret; + int opensslRet; + int outLen; + int tmpLen; + + /* copy the IV because the AES_cbc_encrypt function overwrites it. */ + + ret = UA_ByteString_copy (iv, &ivCopy); + if (ret != UA_STATUSCODE_GOOD) { + goto errout; + } + + ret = UA_ByteString_copy (data, &plainTxt); + if (ret != UA_STATUSCODE_GOOD) { + goto errout; + } + + ctx = EVP_CIPHER_CTX_new (); + if (ctx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto errout; + } + + /* call EVP_* to encrypt */ + + opensslRet = EVP_EncryptInit_ex (ctx, cipherAlg, NULL, key->data, ivCopy.data); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + opensslRet = EVP_EncryptUpdate (ctx, data->data, &outLen, + plainTxt.data, (int) plainTxt.length); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + /* + * Buffer passed to EVP_EncryptFinal() must be after data just + * encrypted to avoid overwriting it. + */ + opensslRet = EVP_EncryptFinal_ex(ctx, data->data + outLen, &tmpLen); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + outLen += tmpLen; + data->length = (size_t) outLen; + ret = UA_STATUSCODE_GOOD; + +errout: + UA_ByteString_clear (&ivCopy); + UA_ByteString_clear (&plainTxt); + if (ctx != NULL) { + EVP_CIPHER_CTX_free(ctx); + } + return ret; +} + +UA_StatusCode +UA_OpenSSL_AES_256_CBC_Decrypt (const UA_ByteString * iv, + const UA_ByteString * key, + UA_ByteString * data /* [in/out]*/ + ) { + return UA_OpenSSL_Decrypt (iv, key, EVP_aes_256_cbc (), data); +} + +UA_StatusCode +UA_OpenSSL_AES_256_CBC_Encrypt (const UA_ByteString * iv, + const UA_ByteString * key, + UA_ByteString * data /* [in/out]*/ + ) { + return UA_OpenSSL_Encrypt (iv, key, EVP_aes_256_cbc (), data); +} + +UA_StatusCode +UA_OpenSSL_X509_compare (const UA_ByteString * cert, + const X509 * bcert) { + X509 * acert = UA_OpenSSL_LoadCertificate(cert); + if (acert == NULL) { + return UA_STATUSCODE_BADCERTIFICATEINVALID; + } + int opensslRet = X509_cmp (acert, bcert); + X509_free (acert); + + if (opensslRet == 0) + return UA_STATUSCODE_GOOD; + return UA_STATUSCODE_UNCERTAINSUBNORMAL; +} + +UA_StatusCode +UA_OpenSSL_RSA_PKCS1_V15_SHA1_Verify (const UA_ByteString * msg, + X509 * publicKeyX509, + const UA_ByteString * signature) { + return UA_OpenSSL_RSA_Public_Verify (msg, EVP_sha1(), publicKeyX509, + NID_sha1, signature); +} + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_SHA1_Sign (const UA_ByteString * message, + EVP_PKEY * privateKey, + UA_ByteString * outSignature) { + return UA_Openssl_RSA_Private_Sign (message, privateKey, EVP_sha1(), + NID_sha1, outSignature); +} + +static UA_Openssl_P_SHA1_Ctx * +P_SHA1_Ctx_Create (const UA_ByteString * secret, + const UA_ByteString * seed) { + size_t size = (UA_Int32)sizeof (UA_Openssl_P_SHA1_Ctx) + secret->length + + seed->length; + UA_Openssl_P_SHA1_Ctx * ctx = (UA_Openssl_P_SHA1_Ctx *) UA_malloc (size); + if (ctx == NULL) { + return NULL; + } + + ctx->secretLen = secret->length; + ctx->seedLen = seed->length; + (void) memcpy (UA_Openssl_P_SHA1_SEED(ctx), seed->data, seed->length); + (void) memcpy (UA_Openssl_P_SHA1_SECRET(ctx), secret->data, secret->length); + /* A(0) = seed + A(n) = HMAC_HASH(secret, A(n-1)) */ + + if (HMAC (EVP_sha1(), secret->data, (int) secret->length, seed->data, + seed->length, ctx->A, NULL) == NULL) { + UA_free (ctx); + return NULL; + } + + return ctx; +} + +static UA_StatusCode +P_SHA1_Hash_Generate (UA_Openssl_P_SHA1_Ctx * ctx, + UA_Byte * pHas + ) { + /* Calculate P_SHA1(n) = HMAC_SHA1(secret, A(n)+seed) */ + if (HMAC (EVP_sha1 (), UA_Openssl_P_SHA1_SECRET(ctx), (int) ctx->secretLen, + ctx->A, sizeof (ctx->A) + ctx->seedLen, pHas, NULL) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Calculate A(n) = HMAC_SHA1(secret, A(n-1)) */ + if (HMAC (EVP_sha1(), UA_Openssl_P_SHA1_SECRET(ctx), (int) ctx->secretLen, + ctx->A, sizeof (ctx->A), ctx->A, NULL) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Openssl_Random_Key_PSHA1_Derive (const UA_ByteString * secret, + const UA_ByteString * seed, + UA_ByteString * out) { + size_t keyLen = out->length; + size_t iter = keyLen / SHA1_DIGEST_LENGTH + ((keyLen % SHA1_DIGEST_LENGTH)?1:0); + size_t bufferLen = iter * SHA1_DIGEST_LENGTH; + UA_Byte * pBuffer = (UA_Byte *) UA_malloc (bufferLen); + if (pBuffer == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_Openssl_P_SHA1_Ctx * ctx = P_SHA1_Ctx_Create (secret, seed); + if (ctx == NULL) { + UA_free (pBuffer); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + size_t i; + UA_StatusCode st; + + for (i = 0; i < iter; i++) { + st = P_SHA1_Hash_Generate (ctx, pBuffer + (i * SHA1_DIGEST_LENGTH)); + if (st != UA_STATUSCODE_GOOD) { + UA_free (pBuffer); + UA_free (ctx); + return st; + } + } + + (void) memcpy (out->data, pBuffer, keyLen); + UA_free (pBuffer); + UA_free (ctx); + + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_OpenSSL_HMAC_SHA1_Verify (const UA_ByteString * message, + const UA_ByteString * key, + const UA_ByteString * signature + ) { + unsigned char buf[SHA1_DIGEST_LENGTH] = {0}; + UA_ByteString mac = {SHA1_DIGEST_LENGTH, buf}; + + if(HMAC (EVP_sha1(), key->data, (int) key->length, message->data, message->length, + mac.data, (unsigned int *) &mac.length) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + if (UA_ByteString_equal (signature, &mac)) { + return UA_STATUSCODE_GOOD; + } + else { + return UA_STATUSCODE_BADINTERNALERROR; + } +} + +UA_StatusCode +UA_OpenSSL_HMAC_SHA1_Sign (const UA_ByteString * message, + const UA_ByteString * key, + UA_ByteString * signature + ) { + if (HMAC (EVP_sha1(), key->data, (int) key->length, message->data, + message->length, + signature->data, (unsigned int *) &(signature->length)) == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_Decrypt (UA_ByteString * data, + EVP_PKEY * privateKey) { + return UA_Openssl_RSA_Private_Decrypt (data, privateKey, + RSA_PKCS1_PADDING); +} + +UA_StatusCode +UA_Openssl_RSA_PKCS1_V15_Encrypt (UA_ByteString * data, + size_t paddingSize, + X509 * publicX509) { + UA_ByteString message; + UA_StatusCode ret = UA_ByteString_copy (data, &message); + if (ret != UA_STATUSCODE_GOOD) { + return ret; + } + ret = UA_Openssl_RSA_Public_Encrypt (&message, publicX509, + RSA_PKCS1_PADDING, + paddingSize, + data); + UA_ByteString_clear (&message); + return ret; +} + +UA_StatusCode +UA_OpenSSL_AES_128_CBC_Decrypt (const UA_ByteString * iv, + const UA_ByteString * key, + UA_ByteString * data /* [in/out]*/ + ) { + return UA_OpenSSL_Decrypt (iv, key, EVP_aes_128_cbc (), data); +} + +UA_StatusCode +UA_OpenSSL_AES_128_CBC_Encrypt (const UA_ByteString * iv, + const UA_ByteString * key, + UA_ByteString * data /* [in/out]*/ + ) { + return UA_OpenSSL_Encrypt (iv, key, EVP_aes_128_cbc (), data); +} + +EVP_PKEY * +UA_OpenSSL_LoadPrivateKey(const UA_ByteString *privateKey) { + const unsigned char * pkData = privateKey->data; + long len = (long) privateKey->length; + + EVP_PKEY *result = NULL; + + if (len > 1 && pkData[0] == 0x30 && pkData[1] == 0x82) { // Magic number for DER encoded keys + result = d2i_PrivateKey(EVP_PKEY_RSA, NULL, + &pkData, len); + } else { + BIO *bio = NULL; +#if OPENSSL_VERSION_NUMBER < 0x1000207fL + bio = BIO_new_mem_buf((void *) privateKey->data, (int) privateKey->length); +#else + bio = BIO_new_mem_buf((const void *) privateKey->data, (int) privateKey->length); +#endif + result = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL); + BIO_free(bio); + } + + return result; +} + +X509 * +UA_OpenSSL_LoadCertificate(const UA_ByteString *certificate) { + X509 * result = NULL; + const unsigned char *pData = certificate->data; + + if (certificate->length > 1 && pData[0] == 0x30 && pData[1] == 0x82) { // Magic number for DER encoded files + result = UA_OpenSSL_LoadDerCertificate(certificate); + } else { + result = UA_OpenSSL_LoadPemCertificate(certificate); + } + + return result; +} + +X509 * +UA_OpenSSL_LoadDerCertificate(const UA_ByteString *certificate) { + const unsigned char *pData = certificate->data; + return d2i_X509(NULL, &pData, (long) certificate->length); +} + +X509 * +UA_OpenSSL_LoadPemCertificate(const UA_ByteString *certificate) { + X509 * result = NULL; + + BIO* bio = NULL; +#if OPENSSL_VERSION_NUMBER < 0x1000207fL + bio = BIO_new_mem_buf((void *) certificate->data, (int) certificate->length); +#else + bio = BIO_new_mem_buf((const void *) certificate->data, (int) certificate->length); +#endif + result = PEM_read_bio_X509(bio, NULL, NULL, NULL); + BIO_free(bio); + + return result; +} + +UA_StatusCode +UA_OpenSSL_LoadLocalCertificate(const UA_ByteString *certificate, UA_ByteString *target) { + X509 *cert = UA_OpenSSL_LoadCertificate(certificate); + + if (!cert) { + UA_ByteString_init(target); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + unsigned char *derData = NULL; + int length = i2d_X509(cert, &derData); + X509_free(cert); + + if (length > 0) { + UA_ByteString temp; + temp.length = (size_t) length; + temp.data = derData; + UA_ByteString_copy(&temp, target); + OPENSSL_free(derData); + return UA_STATUSCODE_GOOD; + } else { + UA_ByteString_init(target); + } + + return UA_STATUSCODE_BADINVALIDARGUMENT; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/ua_openssl_basic128rsa15.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + */ + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + + +#include <openssl/x509.h> +#include <openssl/rand.h> +#include <openssl/evp.h> + +#define UA_SHA1_LENGTH 20 +#define UA_SECURITYPOLICY_BASIC128RSA15_RSAPADDING_LEN 11 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_KEY_LENGTH 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_SIGNING_KEY_LENGTH 16 +#define UA_SHA1_LENGTH 20 + +typedef struct { + EVP_PKEY * localPrivateKey; + UA_ByteString localCertThumbprint; + const UA_Logger * logger; +} Policy_Context_Basic128Rsa15; + +typedef struct { + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + Policy_Context_Basic128Rsa15 * policyContext; + UA_ByteString remoteCertificate; + X509 * remoteCertificateX509; +} Channel_Context_Basic128Rsa15; + +static UA_StatusCode +UA_Policy_Basic128Rsa15_New_Context (UA_SecurityPolicy * securityPolicy, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + Policy_Context_Basic128Rsa15 * context = (Policy_Context_Basic128Rsa15 *) + UA_malloc (sizeof (Policy_Context_Basic128Rsa15)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + context->localPrivateKey = UA_OpenSSL_LoadPrivateKey(&localPrivateKey); + + if (!context->localPrivateKey) { + UA_free(context); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval = UA_Openssl_X509_GetCertificateThumbprint ( + &securityPolicy->localCertificate, + &context->localCertThumbprint, true + ); + if (retval != UA_STATUSCODE_GOOD) { + EVP_PKEY_free(context->localPrivateKey); + UA_free (context); + return retval; + } + + context->logger = logger; + securityPolicy->policyContext = context; + + return UA_STATUSCODE_GOOD; +} + +static void +UA_Policy_Basic128Rsa15_Clear_Context (UA_SecurityPolicy *policy) { + if (policy == NULL) { + return; + } + UA_ByteString_clear(&policy->localCertificate); + + Policy_Context_Basic128Rsa15 * ctx = (Policy_Context_Basic128Rsa15 *) policy->policyContext; + if (ctx == NULL) { + return; + } + + /* delete all allocated members in the context */ + + EVP_PKEY_free(ctx->localPrivateKey); + UA_ByteString_clear(&ctx->localCertThumbprint); + UA_free (ctx); + + return; +} + +/* create the channel context */ + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_New_Context (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * remoteCertificate, + void ** channelContext) { + if (securityPolicy == NULL || remoteCertificate == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + Channel_Context_Basic128Rsa15 * context = (Channel_Context_Basic128Rsa15 *) + UA_malloc (sizeof (Channel_Context_Basic128Rsa15)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_ByteString_init(&context->localSymSigningKey); + UA_ByteString_init(&context->localSymEncryptingKey); + UA_ByteString_init(&context->localSymIv); + UA_ByteString_init(&context->remoteSymSigningKey); + UA_ByteString_init(&context->remoteSymEncryptingKey); + UA_ByteString_init(&context->remoteSymIv); + + UA_StatusCode retval = UA_copyCertificate (&context->remoteCertificate, + remoteCertificate); + if (retval != UA_STATUSCODE_GOOD) { + UA_free (context); + return retval; + } + + /* decode to X509 */ + context->remoteCertificateX509 = UA_OpenSSL_LoadCertificate(&context->remoteCertificate); + if (context->remoteCertificateX509 == NULL) { + UA_ByteString_clear (&context->remoteCertificate); + UA_free (context); + return UA_STATUSCODE_BADCERTIFICATECHAININCOMPLETE; + } + + context->policyContext = (Policy_Context_Basic128Rsa15 *) + (securityPolicy->policyContext); + + *channelContext = context; + + UA_LOG_INFO (securityPolicy->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The Basic128Rsa15 security policy channel with openssl is created."); + + return UA_STATUSCODE_GOOD; +} + +/* delete the channel context */ + +static void +UA_ChannelModule_Basic128Rsa15_Delete_Context (void * channelContext) { + if (channelContext != NULL) { + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) + channelContext; + X509_free (cc->remoteCertificateX509); + UA_ByteString_clear (&cc->remoteCertificate); + UA_ByteString_clear (&cc->localSymSigningKey); + UA_ByteString_clear (&cc->localSymEncryptingKey); + UA_ByteString_clear (&cc->localSymIv); + UA_ByteString_clear (&cc->remoteSymSigningKey); + UA_ByteString_clear (&cc->remoteSymEncryptingKey); + UA_ByteString_clear (&cc->remoteSymIv); + UA_LOG_INFO (cc->policyContext->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The Basic128Rsa15 security policy channel with openssl is deleted."); + + UA_free (cc); + } +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setLocalSymSigningKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setLocalSymEncryptingKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setLocalSymIv (void * channelContext, + const UA_ByteString * iv) { + if (iv == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setRemoteSymSigningKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setRemoteSymEncryptingKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_setRemoteSymIv (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(key, &cc->remoteSymIv); +} + +static UA_StatusCode +UA_ChannelModule_Basic128Rsa15_compareCertificate (const void * channelContext, + const UA_ByteString * certificate) { + if(channelContext == NULL || certificate == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic128Rsa15 * cc = + (const Channel_Context_Basic128Rsa15 *) channelContext; + return UA_OpenSSL_X509_compare (certificate, cc->remoteCertificateX509); +} + +static UA_StatusCode +UA_Asy_Basic128Rsa15_compareCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificateThumbprint) { + if (securityPolicy == NULL || certificateThumbprint == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + Policy_Context_Basic128Rsa15 *pc = (Policy_Context_Basic128Rsa15 *) + securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) { + return UA_STATUSCODE_BADCERTIFICATEINVALID; + } + return UA_STATUSCODE_GOOD; +} + +/* Generates a thumbprint for the specified certificate */ + +static UA_StatusCode +UA_Asy_Basic128Rsa15_makeCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificate, + UA_ByteString * thumbprint) { + return UA_Openssl_X509_GetCertificateThumbprint (certificate, + thumbprint, false); +} + +static size_t +UA_AsySig_Basic128Rsa15_getRemoteSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic128Rsa15 * cc = (const Channel_Context_Basic128Rsa15 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen; +} + +static size_t +UA_AsySig_Basic128Rsa15_getLocalSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Policy_Context_Basic128Rsa15 * pc = + (Policy_Context_Basic128Rsa15 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + + return (size_t) keyLen; +} + +static UA_StatusCode +UA_AsySig_Basic128Rsa15_Verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || message == NULL || signature == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_StatusCode retval = UA_OpenSSL_RSA_PKCS1_V15_SHA1_Verify (message, + cc->remoteCertificateX509, signature); + + return retval; +} + +static UA_StatusCode +UA_AsySig_Basic128Rsa15_Sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Policy_Context_Basic128Rsa15 * pc = + (Policy_Context_Basic128Rsa15 *) securityPolicy->policyContext; + return UA_Openssl_RSA_PKCS1_V15_SHA1_Sign (message, pc->localPrivateKey, + signature); +} + +static size_t +UA_AsymEn_Basic128Rsa15_getRemotePlainTextBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic128Rsa15 * cc = (const Channel_Context_Basic128Rsa15 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen - UA_SECURITYPOLICY_BASIC128RSA15_RSAPADDING_LEN; +} + +static size_t +UA_AsymEn_Basic128Rsa15_getRemoteBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic128Rsa15 * cc = (const Channel_Context_Basic128Rsa15 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen; +} + +static size_t +UA_AsymEn_Basic128Rsa15_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + const Channel_Context_Basic128Rsa15 * cc = (const Channel_Context_Basic128Rsa15 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen * 8; +} + +static size_t +UA_AsymEn_Basic128Rsa15_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Policy_Context_Basic128Rsa15 * pc = + (Policy_Context_Basic128Rsa15 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + + return (size_t) keyLen * 8; +} + +static UA_StatusCode +UA_AsymEn_Basic128Rsa15_Decrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || data == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + UA_StatusCode ret = UA_Openssl_RSA_PKCS1_V15_Decrypt (data, + cc->policyContext->localPrivateKey); + return ret; +} + +static UA_StatusCode +UA_AsymEn_Basic128Rsa15_Encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || + data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + return UA_Openssl_RSA_PKCS1_V15_Encrypt (data, + UA_SECURITYPOLICY_BASIC128RSA15_RSAPADDING_LEN, + cc->remoteCertificateX509); +} + +static UA_StatusCode +UA_Sym_Basic128Rsa15_generateNonce (const UA_SecurityPolicy * sp, + UA_ByteString * out) { + UA_Int32 rc = RAND_bytes(out->data, (int) out->length); + if (rc != 1) { + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_Sym_Basic128Rsa15_generateKey (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * secret, + const UA_ByteString * seed, + UA_ByteString * out) { + return UA_Openssl_Random_Key_PSHA1_Derive (secret, seed, out); +} + +static size_t +UA_SymEn_Basic128Rsa15_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 16 bytes 128 bits */ + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic128Rsa15_getBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymEn_Basic128Rsa15_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic128Rsa15_getPlainTextBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +UA_SymEn_Basic128Rsa15_Encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + return UA_OpenSSL_AES_128_CBC_Encrypt (&cc->localSymIv, &cc->localSymEncryptingKey, data); +} + +static UA_StatusCode +UA_SymEn_Basic128Rsa15_Decrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + return UA_OpenSSL_AES_128_CBC_Decrypt (&cc->remoteSymIv, &cc->remoteSymEncryptingKey, data); +} + +static size_t +UA_SymSig_Basic128Rsa15_getKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +UA_SymSig_Basic128Rsa15_getSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SHA1_LENGTH; +} + +static UA_StatusCode +UA_SymSig_Basic128Rsa15_Verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + return UA_OpenSSL_HMAC_SHA1_Verify (message, + &cc->remoteSymSigningKey, + signature); +} + +static UA_StatusCode +UA_SymSig_Basic128Rsa15_Sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic128Rsa15 * cc = (Channel_Context_Basic128Rsa15 *) channelContext; + return UA_OpenSSL_HMAC_SHA1_Sign (message, &cc->localSymSigningKey, signature); +} + +/* the main entry of Basic128Rsa15 */ + +UA_StatusCode +UA_SecurityPolicy_Basic128Rsa15 (UA_SecurityPolicy * policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + + UA_SecurityPolicyAsymmetricModule * const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule * const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule * const channelModule = &policy->channelModule; + UA_StatusCode retval; + + UA_LOG_INFO (logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The Basic128Rsa15 security policy with openssl is added."); + + UA_Openssl_Init (); + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15\0"); + + /* set ChannelModule context */ + + channelModule->newContext = UA_ChannelModule_Basic128Rsa15_New_Context; + channelModule->deleteContext = UA_ChannelModule_Basic128Rsa15_Delete_Context; + + channelModule->setLocalSymSigningKey = UA_ChannelModule_Basic128Rsa15_setLocalSymSigningKey; + channelModule->setLocalSymEncryptingKey = UA_ChannelModule_Basic128Rsa15_setLocalSymEncryptingKey; + channelModule->setLocalSymIv = UA_ChannelModule_Basic128Rsa15_setLocalSymIv; + channelModule->setRemoteSymSigningKey = UA_ChannelModule_Basic128Rsa15_setRemoteSymSigningKey; + channelModule->setRemoteSymEncryptingKey = UA_ChannelModule_Basic128Rsa15_setRemoteSymEncryptingKey; + channelModule->setRemoteSymIv = UA_ChannelModule_Basic128Rsa15_setRemoteSymIv; + channelModule->compareCertificate = UA_ChannelModule_Basic128Rsa15_compareCertificate; + + retval = UA_OpenSSL_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* asymmetricModule */ + + asymmetricModule->compareCertificateThumbprint = UA_Asy_Basic128Rsa15_compareCertificateThumbprint; + asymmetricModule->makeCertificateThumbprint = UA_Asy_Basic128Rsa15_makeCertificateThumbprint; + + /* AsymmetricModule - signature algorithm */ + + UA_SecurityPolicySignatureAlgorithm * asySigAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asySigAlgorithm->uri = UA_STRING("http://www.w3.org/2000/09/xmldsig#rsa-sha1\0"); + asySigAlgorithm->getRemoteSignatureSize = UA_AsySig_Basic128Rsa15_getRemoteSignatureSize; + asySigAlgorithm->getLocalSignatureSize = UA_AsySig_Basic128Rsa15_getLocalSignatureSize; + asySigAlgorithm->getLocalKeyLength = NULL; + asySigAlgorithm->getRemoteKeyLength = NULL; + asySigAlgorithm->verify = UA_AsySig_Basic128Rsa15_Verify; + asySigAlgorithm->sign = UA_AsySig_Basic128Rsa15_Sign; + + /* AsymmetricModule encryption algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * asymEncryAlg = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asymEncryAlg->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-1_5\0"); + asymEncryAlg->getRemotePlainTextBlockSize = UA_AsymEn_Basic128Rsa15_getRemotePlainTextBlockSize; + asymEncryAlg->getRemoteBlockSize = UA_AsymEn_Basic128Rsa15_getRemoteBlockSize; + asymEncryAlg->getRemoteKeyLength = UA_AsymEn_Basic128Rsa15_getRemoteKeyLength; + asymEncryAlg->getLocalKeyLength = UA_AsymEn_Basic128Rsa15_getLocalKeyLength; + asymEncryAlg->getLocalPlainTextBlockSize = NULL; + asymEncryAlg->getLocalBlockSize = NULL; + asymEncryAlg->decrypt = UA_AsymEn_Basic128Rsa15_Decrypt; + asymEncryAlg->encrypt = UA_AsymEn_Basic128Rsa15_Encrypt; + + /* SymmetricModule */ + + symmetricModule->secureChannelNonceLength = 16; /* 128 bits*/ + symmetricModule->generateNonce = UA_Sym_Basic128Rsa15_generateNonce; + symmetricModule->generateKey = UA_Sym_Basic128Rsa15_generateKey; + + /* Symmetric encryption Algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * symEncryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + symEncryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes128-cbc\0"); + symEncryptionAlgorithm->getLocalKeyLength = UA_SymEn_Basic128Rsa15_getLocalKeyLength; + symEncryptionAlgorithm->getLocalBlockSize = UA_SymEn_Basic128Rsa15_getBlockSize; + symEncryptionAlgorithm->getRemoteKeyLength = UA_SymEn_Basic128Rsa15_getRemoteKeyLength; + symEncryptionAlgorithm->getRemoteBlockSize = UA_SymEn_Basic128Rsa15_getBlockSize; + symEncryptionAlgorithm->getLocalPlainTextBlockSize = UA_SymEn_Basic128Rsa15_getPlainTextBlockSize; + symEncryptionAlgorithm->getRemotePlainTextBlockSize = UA_SymEn_Basic128Rsa15_getPlainTextBlockSize; + symEncryptionAlgorithm->decrypt = UA_SymEn_Basic128Rsa15_Decrypt; + symEncryptionAlgorithm->encrypt = UA_SymEn_Basic128Rsa15_Encrypt; + + /* Symmetric signature Algorithm */ + + UA_SecurityPolicySignatureAlgorithm * symSignatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + symSignatureAlgorithm->uri = UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + symSignatureAlgorithm->getLocalKeyLength = UA_SymSig_Basic128Rsa15_getKeyLength; + symSignatureAlgorithm->getRemoteKeyLength = UA_SymSig_Basic128Rsa15_getKeyLength; + symSignatureAlgorithm->getRemoteSignatureSize = UA_SymSig_Basic128Rsa15_getSignatureSize; + symSignatureAlgorithm->getLocalSignatureSize = UA_SymSig_Basic128Rsa15_getSignatureSize; + + symSignatureAlgorithm->verify = UA_SymSig_Basic128Rsa15_Verify; + symSignatureAlgorithm->sign = UA_SymSig_Basic128Rsa15_Sign; + + /* set the policy context */ + + retval = UA_Policy_Basic128Rsa15_New_Context (policy, localPrivateKey, logger); + if (retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear (&policy->localCertificate); + return retval; + } + policy->clear = UA_Policy_Basic128Rsa15_Clear_Context; + + /* Use the same signature algorithm as the asymmetric component for + certificate signing (see standard) */ + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + return UA_STATUSCODE_GOOD; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/ua_openssl_basic256.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + */ + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + + +#include <openssl/x509.h> +#include <openssl/rand.h> + +#define UA_SECURITYPOLICY_BASIC256SHA1_RSAPADDING_LEN 42 +#define UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256_SYM_SIGNING_KEY_LENGTH 24 +#define UA_SHA1_LENGTH 20 + +typedef struct { + EVP_PKEY * localPrivateKey; + UA_ByteString localCertThumbprint; + const UA_Logger * logger; +} Policy_Context_Basic256; + +typedef struct { + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + Policy_Context_Basic256 * policyContext; + UA_ByteString remoteCertificate; + X509 * remoteCertificateX509; +} Channel_Context_Basic256; + +static UA_StatusCode +UA_Policy_Basic256_New_Context (UA_SecurityPolicy * securityPolicy, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + Policy_Context_Basic256 * context = (Policy_Context_Basic256 *) + UA_malloc (sizeof (Policy_Context_Basic256)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + context->localPrivateKey = UA_OpenSSL_LoadPrivateKey(&localPrivateKey); + + if (!context->localPrivateKey) { + UA_free (context); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval = UA_Openssl_X509_GetCertificateThumbprint ( + &securityPolicy->localCertificate, + &context->localCertThumbprint, true + ); + if (retval != UA_STATUSCODE_GOOD) { + EVP_PKEY_free(context->localPrivateKey); + UA_free (context); + return retval; + } + + context->logger = logger; + securityPolicy->policyContext = context; + + return UA_STATUSCODE_GOOD; +} + +static void +UA_Policy_Basic256_Clear_Context (UA_SecurityPolicy *policy) { + if (policy == NULL) { + return; + } + UA_ByteString_clear(&policy->localCertificate); + + Policy_Context_Basic256 * ctx = (Policy_Context_Basic256 *) policy->policyContext; + if (ctx == NULL) { + return; + } + + /* delete all allocated members in the context */ + + EVP_PKEY_free(ctx->localPrivateKey); + UA_ByteString_clear(&ctx->localCertThumbprint); + UA_free (ctx); + + return; +} + +/* create the channel context */ + +static UA_StatusCode +UA_ChannelModule_Basic256_New_Context (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * remoteCertificate, + void ** channelContext) { + if (securityPolicy == NULL || remoteCertificate == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + Channel_Context_Basic256 * context = (Channel_Context_Basic256 *) + UA_malloc (sizeof (Channel_Context_Basic256)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_ByteString_init(&context->localSymSigningKey); + UA_ByteString_init(&context->localSymEncryptingKey); + UA_ByteString_init(&context->localSymIv); + UA_ByteString_init(&context->remoteSymSigningKey); + UA_ByteString_init(&context->remoteSymEncryptingKey); + UA_ByteString_init(&context->remoteSymIv); + + UA_StatusCode retval = UA_copyCertificate (&context->remoteCertificate, + remoteCertificate); + if (retval != UA_STATUSCODE_GOOD) { + UA_free (context); + return retval; + } + + /* decode to X509 */ + context->remoteCertificateX509 = UA_OpenSSL_LoadCertificate(&context->remoteCertificate); + if (context->remoteCertificateX509 == NULL) { + UA_ByteString_clear (&context->remoteCertificate); + UA_free (context); + return UA_STATUSCODE_BADCERTIFICATECHAININCOMPLETE; + } + + context->policyContext = (Policy_Context_Basic256 *) + (securityPolicy->policyContext); + + *channelContext = context; + + UA_LOG_INFO (securityPolicy->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256 security policy channel with openssl is created."); + + return UA_STATUSCODE_GOOD; +} + +/* delete the channel context */ + +static void +UA_ChannelModule_Basic256_Delete_Context (void * channelContext) { + if (channelContext != NULL) { + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) + channelContext; + X509_free (cc->remoteCertificateX509); + UA_ByteString_clear (&cc->remoteCertificate); + UA_ByteString_clear (&cc->localSymSigningKey); + UA_ByteString_clear (&cc->localSymEncryptingKey); + UA_ByteString_clear (&cc->localSymIv); + UA_ByteString_clear (&cc->remoteSymSigningKey); + UA_ByteString_clear (&cc->remoteSymEncryptingKey); + UA_ByteString_clear (&cc->remoteSymIv); + UA_LOG_INFO (cc->policyContext->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256 security policy channel with openssl is deleted."); + + UA_free (cc); + } +} + +/* Compares the supplied certificate with the certificate + * in the endpoint context + */ + +static UA_StatusCode +UA_Asy_Basic256_compareCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificateThumbprint) { + if (securityPolicy == NULL || certificateThumbprint == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + Policy_Context_Basic256 *pc = (Policy_Context_Basic256 *) + securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) { + return UA_STATUSCODE_BADCERTIFICATEINVALID; + } + return UA_STATUSCODE_GOOD; +} + +/* Generates a thumbprint for the specified certificate */ + +static UA_StatusCode +UA_Asy_Basic256_makeCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificate, + UA_ByteString * thumbprint) { + return UA_Openssl_X509_GetCertificateThumbprint (certificate, + thumbprint, false); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setLocalSymSigningKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setLocalSymEncryptingKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setLocalSymIv (void * channelContext, + const UA_ByteString * iv) { + if (iv == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setRemoteSymSigningKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setRemoteSymEncryptingKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_setRemoteSymIv (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(key, &cc->remoteSymIv); +} + +static UA_StatusCode +UA_ChannelModule_Basic256_compareCertificate (const void * channelContext, + const UA_ByteString * certificate) { + if(channelContext == NULL || certificate == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic256 * cc = + (const Channel_Context_Basic256 *) channelContext; + return UA_OpenSSL_X509_compare (certificate, cc->remoteCertificateX509); +} + +static size_t +UA_AsySig_Basic256_getRemoteSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic256 * cc = (const Channel_Context_Basic256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen; +} + +static size_t +UA_AsySig_Basic256_getLocalSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Policy_Context_Basic256 * pc = + (Policy_Context_Basic256 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + + return (size_t) keyLen; +} + +static UA_StatusCode +UA_AsySig_Basic256_Verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || message == NULL || signature == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_StatusCode retval = UA_OpenSSL_RSA_PKCS1_V15_SHA1_Verify (message, + cc->remoteCertificateX509, signature); + + return retval; +} + +static UA_StatusCode +UA_AsySig_Basic256_Sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Policy_Context_Basic256 * pc = + (Policy_Context_Basic256 *) securityPolicy->policyContext; + return UA_Openssl_RSA_PKCS1_V15_SHA1_Sign (message, pc->localPrivateKey, + signature); +} + +static size_t +UA_AsymEn_Basic256_getRemotePlainTextBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic256 * cc = (const Channel_Context_Basic256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen - UA_SECURITYPOLICY_BASIC256SHA1_RSAPADDING_LEN; +} + +static size_t +UA_AsymEn_Basic256_getRemoteBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + const Channel_Context_Basic256 * cc = (const Channel_Context_Basic256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen; +} + +static size_t +UA_AsymEn_Basic256_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + const Channel_Context_Basic256 * cc = (const Channel_Context_Basic256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen * 8; +} + +static size_t +UA_AsymEn_Basic256_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Policy_Context_Basic256 * pc = + (Policy_Context_Basic256 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + + return (size_t) keyLen * 8; +} + +static UA_StatusCode +UA_AsymEn_Basic256_Decrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || data == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + UA_StatusCode ret = UA_Openssl_RSA_Oaep_Decrypt (data, + cc->policyContext->localPrivateKey); + return ret; +} + +static UA_StatusCode +UA_AsymEn_Basic256_Encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || + data == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + return UA_Openssl_RSA_OAEP_Encrypt (data, UA_SECURITYPOLICY_BASIC256SHA1_RSAPADDING_LEN, + cc->remoteCertificateX509); +} + +static UA_StatusCode +UA_Sym_Basic256_generateNonce (const UA_SecurityPolicy * sp, + UA_ByteString * out) { + UA_Int32 rc = RAND_bytes(out->data, (int) out->length); + if (rc != 1) { + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_Sym_Basic256_generateKey (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * secret, + const UA_ByteString * seed, + UA_ByteString * out) { + return UA_Openssl_Random_Key_PSHA1_Derive (secret, seed, out); +} + +static size_t +UA_SymEn_Basic256_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic256_getBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymEn_Basic256_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic256_getPlainTextBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +UA_SymEn_Basic256_Encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + return UA_OpenSSL_AES_256_CBC_Encrypt (&cc->localSymIv, &cc->localSymEncryptingKey, data); +} + +static UA_StatusCode +UA_SymEn_Basic256_Decrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + return UA_OpenSSL_AES_256_CBC_Decrypt (&cc->remoteSymIv, &cc->remoteSymEncryptingKey, data); +} + +static size_t +UA_SymSig_Basic256_getKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +UA_SymSig_Basic256_getSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SHA1_LENGTH; +} + +static UA_StatusCode +UA_SymSig_Basic256_Verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + return UA_OpenSSL_HMAC_SHA1_Verify (message, + &cc->remoteSymSigningKey, + signature); +} + +static UA_StatusCode +UA_SymSig_Basic256_Sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic256 * cc = (Channel_Context_Basic256 *) channelContext; + return UA_OpenSSL_HMAC_SHA1_Sign (message, &cc->localSymSigningKey, signature); +} + +/* the main entry of Basic256 */ + +UA_StatusCode +UA_SecurityPolicy_Basic256 (UA_SecurityPolicy * policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + UA_SecurityPolicyAsymmetricModule * const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule * const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule * const channelModule = &policy->channelModule; + UA_StatusCode retval; + + UA_LOG_INFO (logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256 security policy with openssl is added."); + + UA_Openssl_Init (); + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic256\0"); + + /* set ChannelModule context */ + + channelModule->newContext = UA_ChannelModule_Basic256_New_Context; + channelModule->deleteContext = UA_ChannelModule_Basic256_Delete_Context; + + channelModule->setLocalSymSigningKey = UA_ChannelModule_Basic256_setLocalSymSigningKey; + channelModule->setLocalSymEncryptingKey = UA_ChannelModule_Basic256_setLocalSymEncryptingKey; + channelModule->setLocalSymIv = UA_ChannelModule_Basic256_setLocalSymIv; + channelModule->setRemoteSymSigningKey = UA_ChannelModule_Basic256_setRemoteSymSigningKey; + channelModule->setRemoteSymEncryptingKey = UA_ChannelModule_Basic256_setRemoteSymEncryptingKey; + channelModule->setRemoteSymIv = UA_ChannelModule_Basic256_setRemoteSymIv; + channelModule->compareCertificate = UA_ChannelModule_Basic256_compareCertificate; + + retval = UA_OpenSSL_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* asymmetricModule */ + + asymmetricModule->compareCertificateThumbprint = UA_Asy_Basic256_compareCertificateThumbprint; + asymmetricModule->makeCertificateThumbprint = UA_Asy_Basic256_makeCertificateThumbprint; + + /* AsymmetricModule - signature algorithm */ + + UA_SecurityPolicySignatureAlgorithm * asySigAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asySigAlgorithm->uri = UA_STRING("http://www.w3.org/2000/09/xmldsig#rsa-sha1\0"); + asySigAlgorithm->getRemoteSignatureSize = UA_AsySig_Basic256_getRemoteSignatureSize; + asySigAlgorithm->getLocalSignatureSize = UA_AsySig_Basic256_getLocalSignatureSize; + asySigAlgorithm->verify = UA_AsySig_Basic256_Verify; + asySigAlgorithm->sign = UA_AsySig_Basic256_Sign; + asySigAlgorithm->getLocalKeyLength = NULL; + asySigAlgorithm->getRemoteKeyLength = NULL; + + /* AsymmetricModule encryption algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * asymEncryAlg = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asymEncryAlg->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asymEncryAlg->getRemotePlainTextBlockSize = UA_AsymEn_Basic256_getRemotePlainTextBlockSize; + asymEncryAlg->getRemoteBlockSize = UA_AsymEn_Basic256_getRemoteBlockSize; + asymEncryAlg->getRemoteKeyLength = UA_AsymEn_Basic256_getRemoteKeyLength; + asymEncryAlg->getLocalKeyLength = UA_AsymEn_Basic256_getLocalKeyLength; + asymEncryAlg->getLocalPlainTextBlockSize = NULL; + asymEncryAlg->getLocalBlockSize = NULL; + asymEncryAlg->decrypt = UA_AsymEn_Basic256_Decrypt; + asymEncryAlg->encrypt = UA_AsymEn_Basic256_Encrypt; + + /* SymmetricModule */ + + symmetricModule->secureChannelNonceLength = 32; + symmetricModule->generateNonce = UA_Sym_Basic256_generateNonce; + symmetricModule->generateKey = UA_Sym_Basic256_generateKey; + + /* Symmetric encryption Algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * symEncryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + symEncryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes256-cbc\0"); + symEncryptionAlgorithm->getLocalKeyLength = UA_SymEn_Basic256_getLocalKeyLength; + symEncryptionAlgorithm->getLocalBlockSize = UA_SymEn_Basic256_getBlockSize; + symEncryptionAlgorithm->getRemoteKeyLength = UA_SymEn_Basic256_getRemoteKeyLength; + symEncryptionAlgorithm->getRemoteBlockSize = UA_SymEn_Basic256_getBlockSize; + symEncryptionAlgorithm->getLocalPlainTextBlockSize = UA_SymEn_Basic256_getPlainTextBlockSize; + symEncryptionAlgorithm->getRemotePlainTextBlockSize = UA_SymEn_Basic256_getPlainTextBlockSize; + symEncryptionAlgorithm->decrypt = UA_SymEn_Basic256_Decrypt; + symEncryptionAlgorithm->encrypt = UA_SymEn_Basic256_Encrypt; + + /* Symmetric signature Algorithm */ + + UA_SecurityPolicySignatureAlgorithm * symSignatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + symSignatureAlgorithm->uri = UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + symSignatureAlgorithm->getLocalKeyLength = UA_SymSig_Basic256_getKeyLength; + symSignatureAlgorithm->getRemoteKeyLength = UA_SymSig_Basic256_getKeyLength; + symSignatureAlgorithm->getRemoteSignatureSize = UA_SymSig_Basic256_getSignatureSize; + symSignatureAlgorithm->getLocalSignatureSize = UA_SymSig_Basic256_getSignatureSize; + symSignatureAlgorithm->verify = UA_SymSig_Basic256_Verify; + symSignatureAlgorithm->sign = UA_SymSig_Basic256_Sign; + + /* set the policy context */ + + retval = UA_Policy_Basic256_New_Context (policy, localPrivateKey, logger); + if (retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear (&policy->localCertificate); + return retval; + } + policy->clear = UA_Policy_Basic256_Clear_Context; + + /* Use the same signature algorithm as the asymmetric component for + certificate signing (see standard) */ + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + return UA_STATUSCODE_GOOD; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/ua_openssl_basic256sha256.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + */ + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + + +#include <openssl/hmac.h> +#include <openssl/sha.h> +#include <openssl/rsa.h> +#include <openssl/x509.h> +#include <openssl/rand.h> +#include <openssl/rsa.h> + +#define UA_SHA256_LENGTH 32 /* 256 bit */ +#define UA_SECURITYPOLICY_BASIC256SHA256_RSAPADDING_LEN 42 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_SIGNING_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256SHA256_MINASYMKEYLENGTH 256 +#define UA_SECURITYPOLICY_BASIC256SHA256_MAXASYMKEYLENGTH 512 + +typedef struct { + EVP_PKEY * localPrivateKey; + UA_ByteString localCertThumbprint; + const UA_Logger * logger; +} Policy_Context_Basic256Sha256; + +typedef struct { + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + Policy_Context_Basic256Sha256 * policyContext; + UA_ByteString remoteCertificate; + X509 * remoteCertificateX509; /* X509 */ +} Channel_Context_Basic256Sha256; + +/* create the policy context */ + +static UA_StatusCode +UA_Policy_New_Context (UA_SecurityPolicy * securityPolicy, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + Policy_Context_Basic256Sha256 * context = (Policy_Context_Basic256Sha256 *) + UA_malloc (sizeof (Policy_Context_Basic256Sha256)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + context->localPrivateKey = UA_OpenSSL_LoadPrivateKey(&localPrivateKey); + + if (!context->localPrivateKey) { + UA_free (context); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval = UA_Openssl_X509_GetCertificateThumbprint ( + &securityPolicy->localCertificate, + &context->localCertThumbprint, true + ); + if (retval != UA_STATUSCODE_GOOD) { + EVP_PKEY_free(context->localPrivateKey); + UA_free (context); + return retval; + } + + context->logger = logger; + securityPolicy->policyContext = context; + + return UA_STATUSCODE_GOOD; +} + +/* clear the policy context */ + +static void +UA_Policy_Clear_Context (UA_SecurityPolicy *policy) { + if (policy == NULL) + return; + + UA_ByteString_clear(&policy->localCertificate); + + /* delete all allocated members in the context */ + + Policy_Context_Basic256Sha256 * pc = (Policy_Context_Basic256Sha256 *) + policy->policyContext; + EVP_PKEY_free(pc->localPrivateKey); + UA_ByteString_clear(&pc->localCertThumbprint); + UA_free (pc); + return; +} + +/* create the channel context */ + +static UA_StatusCode +UA_ChannelModule_New_Context (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * remoteCertificate, + void ** channelContext) { + if (securityPolicy == NULL || remoteCertificate == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + Channel_Context_Basic256Sha256 * context = (Channel_Context_Basic256Sha256 *) + UA_malloc (sizeof (Channel_Context_Basic256Sha256)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_ByteString_init(&context->localSymSigningKey); + UA_ByteString_init(&context->localSymEncryptingKey); + UA_ByteString_init(&context->localSymIv); + UA_ByteString_init(&context->remoteSymSigningKey); + UA_ByteString_init(&context->remoteSymEncryptingKey); + UA_ByteString_init(&context->remoteSymIv); + + UA_StatusCode retval = UA_copyCertificate (&context->remoteCertificate, + remoteCertificate); + if (retval != UA_STATUSCODE_GOOD) { + UA_free (context); + return retval; + } + + /* decode to X509 */ + context->remoteCertificateX509 = UA_OpenSSL_LoadCertificate(&context->remoteCertificate); + if (context->remoteCertificateX509 == NULL) { + UA_ByteString_clear (&context->remoteCertificate); + UA_free (context); + } + + context->policyContext = (Policy_Context_Basic256Sha256 *) + (securityPolicy->policyContext); + + *channelContext = context; + + UA_LOG_INFO (securityPolicy->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256sha256 security policy channel with openssl is created."); + + return UA_STATUSCODE_GOOD; +} + +/* delete the channel context */ + +static void +UA_ChannelModule_Delete_Context (void * channelContext) { + if (channelContext != NULL) { + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) + channelContext; + X509_free (cc->remoteCertificateX509); + UA_ByteString_clear (&cc->remoteCertificate); + UA_ByteString_clear (&cc->localSymSigningKey); + UA_ByteString_clear (&cc->localSymEncryptingKey); + UA_ByteString_clear (&cc->localSymIv); + UA_ByteString_clear (&cc->remoteSymSigningKey); + UA_ByteString_clear (&cc->remoteSymEncryptingKey); + UA_ByteString_clear (&cc->remoteSymIv); + + UA_LOG_INFO (cc->policyContext->logger, + UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256sha256 security policy channel with openssl is deleted."); + UA_free (cc); + } +} + +/* Verifies the signature of the message using the provided keys in the context. + * AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 + */ + +static UA_StatusCode +UA_AsySig_Basic256Sha256_Verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || message == NULL || signature == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) + channelContext; + UA_StatusCode retval = UA_OpenSSL_RSA_PKCS1_V15_SHA256_Verify (message, + cc->remoteCertificateX509, signature); + + return retval; +} + +/* Compares the supplied certificate with the certificate + * in the endpoint context + */ + +static UA_StatusCode +UA_compareCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificateThumbprint) { + if (securityPolicy == NULL || certificateThumbprint == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + Policy_Context_Basic256Sha256 *pc = (Policy_Context_Basic256Sha256 *) + securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + return UA_STATUSCODE_GOOD; +} + +/* Generates a thumbprint for the specified certificate */ + +static UA_StatusCode +UA_makeCertificateThumbprint (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * certificate, + UA_ByteString * thumbprint) { + return UA_Openssl_X509_GetCertificateThumbprint (certificate, + thumbprint, false); +} + +static UA_StatusCode +UA_Asym_Basic256Sha256_Decrypt (const UA_SecurityPolicy *securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) + channelContext; + UA_StatusCode ret = UA_Openssl_RSA_Oaep_Decrypt (data, + cc->policyContext->localPrivateKey); + return ret; +} + +static size_t +UA_Asym_Basic256Sha256_getRemoteSignatureSize ( + const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Basic256Sha256 * cc = (const Channel_Context_Basic256Sha256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + UA_assert (keyLen == 256); /* 256 bytes 2048 bit */ + return (size_t) keyLen; +} + +static size_t +UA_AsySig_Basic256Sha256_getLocalSignatureSize (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Policy_Context_Basic256Sha256 * pc = + (Policy_Context_Basic256Sha256 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + UA_assert (keyLen == 256); /* 256 bytes 2048 bits */ + + return (size_t) keyLen; +} + +static size_t +UA_AsymEn_Basic256Sha256_getRemotePlainTextBlockSize (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Basic256Sha256 * cc = (const Channel_Context_Basic256Sha256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen - UA_SECURITYPOLICY_BASIC256SHA256_RSAPADDING_LEN; +} + +static size_t +UA_AsymEn_Basic256Sha256_getRemoteBlockSize (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Basic256Sha256 * cc = (const Channel_Context_Basic256Sha256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen; +} + +static size_t +UA_AsymEn_Basic256Sha256_getRemoteKeyLength (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Basic256Sha256 * cc = (const Channel_Context_Basic256Sha256 *) channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength (cc->remoteCertificateX509, &keyLen); + return (size_t) keyLen * 8; +} + +static UA_StatusCode +UA_Sym_Basic256Sha256_generateNonce (const UA_SecurityPolicy * sp, + UA_ByteString * out) { + UA_Int32 rc = RAND_bytes(out->data, (int) out->length); + if (rc != 1) { + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_GOOD; +} + +static size_t +UA_SymEn_Basic256Sha256_getLocalKeyLength (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic256Sha256_getLocalBlockSize ( + const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymSig_Basic256Sha256_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_SIGNING_KEY_LENGTH; +} + +static UA_StatusCode +UA_Sym_Basic256Sha256_generateKey (const UA_SecurityPolicy * securityPolicy, + const UA_ByteString * secret, + const UA_ByteString * seed, + UA_ByteString * out) { + return UA_Openssl_Random_Key_PSHA256_Derive (secret, seed, out); +} + +static UA_StatusCode +UA_ChannelModule_Basic256Sha256_setLocalSymSigningKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_setLocalSymEncryptingKey (void * channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_setLocalSymIv (void * channelContext, + const UA_ByteString * iv) { + if (iv == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static size_t +UA_SymEn_Basic256Sha256_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Basic256Sha256_getRemoteBlockSize (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymSig_Basic256Sha256_getRemoteKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_SIGNING_KEY_LENGTH; +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_setRemoteSymSigningKey (void *channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_setRemoteSymEncryptingKey (void *channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_setRemoteSymIv (void *channelContext, + const UA_ByteString * key) { + if (key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(key, &cc->remoteSymIv); +} + +static UA_StatusCode +UA_AsySig_Basic256Sha256_sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Policy_Context_Basic256Sha256 * pc = + (Policy_Context_Basic256Sha256 *) securityPolicy->policyContext; + return UA_Openssl_RSA_PKCS1_V15_SHA256_Sign (message, pc->localPrivateKey, + signature); +} + +static UA_StatusCode +UA_AsymEn_Basic256Sha256_encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if (securityPolicy == NULL || channelContext == NULL || + data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + return UA_Openssl_RSA_OAEP_Encrypt (data, UA_SECURITYPOLICY_BASIC256SHA256_RSAPADDING_LEN, + cc->remoteCertificateX509); +} + +static size_t +UA_SymSig_Basic256Sha256_getRemoteSignatureSize (const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA256_LENGTH; +} + +static UA_StatusCode +UA_SymSig_Basic256Sha256_verify (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + const UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + return UA_OpenSSL_HMAC_SHA256_Verify (message, + &cc->remoteSymSigningKey, + signature); +} + +static UA_StatusCode +UA_SymSig_Basic256Sha256_sign (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + const UA_ByteString * message, + UA_ByteString * signature) { + if (securityPolicy == NULL || channelContext == NULL || + message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + return UA_OpenSSL_HMAC_SHA256_Sign (message, &cc->localSymSigningKey, signature); +} + +static size_t +UA_SymSig_Basic256Sha256_getLocalSignatureSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SHA256_LENGTH; +} + +static UA_StatusCode +UA_SymEn_Basic256Sha256_decrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + return UA_OpenSSL_AES_256_CBC_Decrypt (&cc->remoteSymIv, &cc->remoteSymEncryptingKey, data); +} + +static UA_StatusCode +UA_SymEn_Basic256Sha256_encrypt (const UA_SecurityPolicy * securityPolicy, + void * channelContext, + UA_ByteString * data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Basic256Sha256 * cc = (Channel_Context_Basic256Sha256 *) channelContext; + return UA_OpenSSL_AES_256_CBC_Encrypt (&cc->localSymIv, &cc->localSymEncryptingKey, data); +} + +static UA_StatusCode +UA_ChannelM_Basic256Sha256_compareCertificate (const void *channelContext, + const UA_ByteString *certificate) { + if(channelContext == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Basic256Sha256 * cc = + (const Channel_Context_Basic256Sha256 *) channelContext; + return UA_OpenSSL_X509_compare (certificate, cc->remoteCertificateX509); +} + +static size_t +UA_SymEn_Basic256Sha256_getLocalPlainTextBlockSize (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static size_t +UA_AsymEn_Basic256Sha256_getLocalKeyLength (const UA_SecurityPolicy * securityPolicy, + const void * channelContext) { + if (securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Policy_Context_Basic256Sha256 * pc = + (Policy_Context_Basic256Sha256 *) securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength (pc->localPrivateKey, &keyLen); + UA_assert (keyLen == 256); /* 256 bytes 2048 bits */ + + return (size_t) keyLen * 8; +} + +/* the main entry of Basic256Sha256 */ + +UA_StatusCode +UA_SecurityPolicy_Basic256Sha256(UA_SecurityPolicy * policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger * logger) { + + UA_SecurityPolicyAsymmetricModule * const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule * const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule * const channelModule = &policy->channelModule; + UA_StatusCode retval; + + UA_LOG_INFO (logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The basic256sha256 security policy with openssl is added."); + + UA_Openssl_Init (); + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256\0"); + + /* set ChannelModule context */ + + channelModule->newContext = UA_ChannelModule_New_Context; + channelModule->deleteContext = UA_ChannelModule_Delete_Context; + channelModule->setLocalSymSigningKey = UA_ChannelModule_Basic256Sha256_setLocalSymSigningKey; + channelModule->setLocalSymEncryptingKey = UA_ChannelM_Basic256Sha256_setLocalSymEncryptingKey; + channelModule->setLocalSymIv = UA_ChannelM_Basic256Sha256_setLocalSymIv; + channelModule->setRemoteSymSigningKey = UA_ChannelM_Basic256Sha256_setRemoteSymSigningKey; + channelModule->setRemoteSymEncryptingKey = UA_ChannelM_Basic256Sha256_setRemoteSymEncryptingKey; + channelModule->setRemoteSymIv = UA_ChannelM_Basic256Sha256_setRemoteSymIv; + channelModule->compareCertificate = UA_ChannelM_Basic256Sha256_compareCertificate; + + retval = UA_OpenSSL_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule - signature algorithm */ + + UA_SecurityPolicySignatureAlgorithm * asySigAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asySigAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\0"); + asySigAlgorithm->verify = UA_AsySig_Basic256Sha256_Verify; + asySigAlgorithm->getRemoteSignatureSize = UA_Asym_Basic256Sha256_getRemoteSignatureSize; + asySigAlgorithm->getLocalSignatureSize = UA_AsySig_Basic256Sha256_getLocalSignatureSize; + asySigAlgorithm->sign = UA_AsySig_Basic256Sha256_sign; + asySigAlgorithm->getLocalKeyLength = NULL; + asySigAlgorithm->getRemoteKeyLength = NULL; + + /* AsymmetricModule encryption algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * asymEncryAlg = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asymEncryAlg->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asymEncryAlg->decrypt = UA_Asym_Basic256Sha256_Decrypt; + asymEncryAlg->getRemotePlainTextBlockSize = + UA_AsymEn_Basic256Sha256_getRemotePlainTextBlockSize; + asymEncryAlg->getRemoteBlockSize = UA_AsymEn_Basic256Sha256_getRemoteBlockSize; + asymEncryAlg->getRemoteKeyLength = UA_AsymEn_Basic256Sha256_getRemoteKeyLength; + asymEncryAlg->encrypt = UA_AsymEn_Basic256Sha256_encrypt; + asymEncryAlg->getLocalKeyLength = UA_AsymEn_Basic256Sha256_getLocalKeyLength; + asymEncryAlg->getLocalPlainTextBlockSize = NULL; + asymEncryAlg->getLocalBlockSize = NULL; + + /* asymmetricModule */ + + asymmetricModule->compareCertificateThumbprint = UA_compareCertificateThumbprint; + asymmetricModule->makeCertificateThumbprint = UA_makeCertificateThumbprint; + + /* SymmetricModule */ + + symmetricModule->secureChannelNonceLength = 32; + symmetricModule->generateNonce = UA_Sym_Basic256Sha256_generateNonce; + symmetricModule->generateKey = UA_Sym_Basic256Sha256_generateKey; + + /* Symmetric encryption Algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm * symEncryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + symEncryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes256-cbc\0"); + symEncryptionAlgorithm->getLocalKeyLength = UA_SymEn_Basic256Sha256_getLocalKeyLength; + symEncryptionAlgorithm->getLocalBlockSize = UA_SymEn_Basic256Sha256_getLocalBlockSize; + symEncryptionAlgorithm->getRemoteKeyLength = UA_SymEn_Basic256Sha256_getRemoteKeyLength; + symEncryptionAlgorithm->getRemoteBlockSize = UA_SymEn_Basic256Sha256_getRemoteBlockSize; + symEncryptionAlgorithm->decrypt = UA_SymEn_Basic256Sha256_decrypt; + symEncryptionAlgorithm->encrypt = UA_SymEn_Basic256Sha256_encrypt; + symEncryptionAlgorithm->getLocalPlainTextBlockSize = + UA_SymEn_Basic256Sha256_getLocalPlainTextBlockSize; + + /* Symmetric signature Algorithm */ + + UA_SecurityPolicySignatureAlgorithm * symSignatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + symSignatureAlgorithm->uri = UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha2-256\0"); + symSignatureAlgorithm->getLocalKeyLength = UA_SymSig_Basic256Sha256_getLocalKeyLength; + symSignatureAlgorithm->getRemoteKeyLength = UA_SymSig_Basic256Sha256_getRemoteKeyLength; + symSignatureAlgorithm->getRemoteSignatureSize = + UA_SymSig_Basic256Sha256_getRemoteSignatureSize; + symSignatureAlgorithm->verify = UA_SymSig_Basic256Sha256_verify; + symSignatureAlgorithm->sign = UA_SymSig_Basic256Sha256_sign; + symSignatureAlgorithm->getLocalSignatureSize = UA_SymSig_Basic256Sha256_getLocalSignatureSize; + + retval = UA_Policy_New_Context (policy, localPrivateKey, logger); + if (retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear (&policy->localCertificate); + return retval; + } + policy->clear = UA_Policy_Clear_Context; + + /* Use the same signature algorithm as the asymmetric component for + certificate signing (see standard) */ + + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + return UA_STATUSCODE_GOOD; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/ua_openssl_aes128sha256rsaoaep.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Wind River Systems, Inc. + */ + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL + + +#include <openssl/hmac.h> +#include <openssl/sha.h> +#include <openssl/rsa.h> +#include <openssl/x509.h> +#include <openssl/rand.h> +#include <openssl/rsa.h> + +#define UA_SHA256_LENGTH 32 /* 256 bit */ +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_RSAPADDING_LEN 42 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_SIGNING_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_KEY_LENGTH 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MINASYMKEYLENGTH 256 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MAXASYMKEYLENGTH 512 + +typedef struct { + EVP_PKEY *localPrivateKey; + UA_ByteString localCertThumbprint; + const UA_Logger *logger; +} Policy_Context_Aes128Sha256RsaOaep; + +typedef struct { + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + Policy_Context_Aes128Sha256RsaOaep *policyContext; + UA_ByteString remoteCertificate; + X509 *remoteCertificateX509; /* X509 */ +} Channel_Context_Aes128Sha256RsaOaep; + +/* create the policy context */ + +static UA_StatusCode +UA_Policy_Aes128Sha256RsaOaep_New_Context(UA_SecurityPolicy *securityPolicy, + const UA_ByteString localPrivateKey, + const UA_Logger *logger) { + Policy_Context_Aes128Sha256RsaOaep *context = + (Policy_Context_Aes128Sha256RsaOaep *)UA_malloc( + sizeof(Policy_Context_Aes128Sha256RsaOaep)); + if(context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + context->localPrivateKey = UA_OpenSSL_LoadPrivateKey(&localPrivateKey); + if (!context->localPrivateKey) { + UA_free(context); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + UA_StatusCode retval = UA_Openssl_X509_GetCertificateThumbprint( + &securityPolicy->localCertificate, &context->localCertThumbprint, true); + if(retval != UA_STATUSCODE_GOOD) { + EVP_PKEY_free(context->localPrivateKey); + UA_free(context); + return retval; + } + + context->logger = logger; + securityPolicy->policyContext = context; + + return UA_STATUSCODE_GOOD; +} + +/* clear the policy context */ + +static void +UA_Policy_Aes128Sha256RsaOaep_Clear_Context(UA_SecurityPolicy *policy) { + if(policy == NULL) + return; + + UA_ByteString_clear(&policy->localCertificate); + + /* delete all allocated members in the context */ + + Policy_Context_Aes128Sha256RsaOaep *pc = + (Policy_Context_Aes128Sha256RsaOaep *)policy->policyContext; + if (pc == NULL) { + return; + } + + EVP_PKEY_free(pc->localPrivateKey); + UA_ByteString_clear(&pc->localCertThumbprint); + UA_free(pc); + + return; +} + +/* create the channel context */ + +static UA_StatusCode +UA_ChannelModule_Aes128Sha256RsaOaep_New_Context(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **channelContext) { + if(securityPolicy == NULL || remoteCertificate == NULL || channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + Channel_Context_Aes128Sha256RsaOaep *context = + (Channel_Context_Aes128Sha256RsaOaep *)UA_malloc( + sizeof(Channel_Context_Aes128Sha256RsaOaep)); + if(context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_ByteString_init(&context->localSymSigningKey); + UA_ByteString_init(&context->localSymEncryptingKey); + UA_ByteString_init(&context->localSymIv); + UA_ByteString_init(&context->remoteSymSigningKey); + UA_ByteString_init(&context->remoteSymEncryptingKey); + UA_ByteString_init(&context->remoteSymIv); + + UA_StatusCode retval = + UA_copyCertificate(&context->remoteCertificate, remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(context); + return retval; + } + + /* decode to X509 */ + context->remoteCertificateX509 = UA_OpenSSL_LoadCertificate(&context->remoteCertificate); + if (context->remoteCertificateX509 == NULL) { + UA_ByteString_clear (&context->remoteCertificate); + UA_free (context); + return UA_STATUSCODE_BADCERTIFICATECHAININCOMPLETE; + } + + context->policyContext = + (Policy_Context_Aes128Sha256RsaOaep *)(securityPolicy->policyContext); + + *channelContext = context; + + UA_LOG_INFO( + securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The Aes128Sha256RsaOaep security policy channel with openssl is created."); + + return UA_STATUSCODE_GOOD; +} + +/* delete the channel context */ + +static void +UA_ChannelModule_Aes128Sha256RsaOaep_Delete_Context(void *channelContext) { + if(channelContext != NULL) { + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + X509_free(cc->remoteCertificateX509); + UA_ByteString_clear(&cc->remoteCertificate); + UA_ByteString_clear(&cc->localSymSigningKey); + UA_ByteString_clear(&cc->localSymEncryptingKey); + UA_ByteString_clear(&cc->localSymIv); + UA_ByteString_clear(&cc->remoteSymSigningKey); + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + UA_ByteString_clear(&cc->remoteSymIv); + + UA_LOG_INFO( + cc->policyContext->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The Aes128Sha256RsaOaep security policy channel with openssl is deleted."); + UA_free(cc); + } +} + +/* Verifies the signature of the message using the provided keys in the context. + * AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 + */ + +static UA_StatusCode +UA_AsySig_Aes128Sha256RsaOaep_Verify(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || + channelContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_StatusCode retval = UA_OpenSSL_RSA_PKCS1_V15_SHA256_Verify( + message, cc->remoteCertificateX509, signature); + + return retval; +} + +/* Compares the supplied certificate with the certificate + * in the endpoint context + */ + +static UA_StatusCode +UA_compareCertificateThumbprint_Aes128Sha256RsaOaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + if(securityPolicy == NULL || certificateThumbprint == NULL) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + Policy_Context_Aes128Sha256RsaOaep *pc = + (Policy_Context_Aes128Sha256RsaOaep *)securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + return UA_STATUSCODE_GOOD; +} + +/* Generates a thumbprint for the specified certificate */ + +static UA_StatusCode +UA_makeCertificateThumbprint_Aes128Sha256RsaOaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + return UA_Openssl_X509_GetCertificateThumbprint(certificate, thumbprint, false); +} + +static UA_StatusCode +UA_Asym_Aes128Sha256RsaOaep_Decrypt(const UA_SecurityPolicy *securityPolicy, + void *channelContext, UA_ByteString *data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_StatusCode ret = + UA_Openssl_RSA_Oaep_Decrypt(data, cc->policyContext->localPrivateKey); + return ret; +} + +static size_t +UA_Asym_Aes128Sha256RsaOaep_getRemoteSignatureSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Aes128Sha256RsaOaep *cc = + (const Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength(cc->remoteCertificateX509, &keyLen); + UA_assert(keyLen == 256); /* 256 bytes 2048 bit */ + return (size_t)keyLen; +} + +static size_t +UA_AsySig_Aes128Sha256RsaOaep_getLocalSignatureSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Policy_Context_Aes128Sha256RsaOaep *pc = + (Policy_Context_Aes128Sha256RsaOaep *)securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength(pc->localPrivateKey, &keyLen); + UA_assert(keyLen == 256); /* 256 bytes 2048 bits */ + + return (size_t)keyLen; +} + +static size_t +UA_AsymEn_Aes128Sha256RsaOaep_getRemotePlainTextBlockSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Aes128Sha256RsaOaep *cc = + (const Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength(cc->remoteCertificateX509, &keyLen); + return (size_t)keyLen - UA_SECURITYPOLICY_AES128SHA256RSAOAEP_RSAPADDING_LEN; +} + +static size_t +UA_AsymEn_Aes128Sha256RsaOaep_getRemoteBlockSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Aes128Sha256RsaOaep *cc = + (const Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength(cc->remoteCertificateX509, &keyLen); + return (size_t)keyLen; +} + +static size_t +UA_AsymEn_Aes128Sha256RsaOaep_getRemoteKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Aes128Sha256RsaOaep *cc = + (const Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Public_GetKeyLength(cc->remoteCertificateX509, &keyLen); + return (size_t)keyLen * 8; +} + +static UA_StatusCode +UA_Sym_Aes128Sha256RsaOaep_generateNonce(const UA_SecurityPolicy *sp, + UA_ByteString *out) { + UA_Int32 rc = RAND_bytes(out->data, (int)out->length); + if(rc != 1) { + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + return UA_STATUSCODE_GOOD; +} + +static size_t +UA_SymEn_Aes128Sha256RsaOaep_getLocalKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Aes128Sha256RsaOaep_getLocalBlockSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymSig_Aes128Sha256RsaOaep_getLocalKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_SIGNING_KEY_LENGTH; +} + +static UA_StatusCode +UA_Sym_Aes128Sha256RsaOaep_generateKey(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, + const UA_ByteString *seed, UA_ByteString *out) { + return UA_Openssl_Random_Key_PSHA256_Derive(secret, seed, out); +} + +static UA_StatusCode +UA_ChannelModule_Aes128Sha256RsaOaep_setLocalSymSigningKey(void *channelContext, + const UA_ByteString *key) { + if(key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_setLocalSymEncryptingKey(void *channelContext, + const UA_ByteString *key) { + if(key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_setLocalSymIv(void *channelContext, + const UA_ByteString *iv) { + if(iv == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static size_t +UA_SymEn_Aes128Sha256RsaOaep_getRemoteKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_KEY_LENGTH; +} + +static size_t +UA_SymEn_Aes128Sha256RsaOaep_getRemoteBlockSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +UA_SymSig_Aes128Sha256RsaOaep_getRemoteKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + /* 32 bytes 256 bits */ + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_SIGNING_KEY_LENGTH; +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymSigningKey(void *channelContext, + const UA_ByteString *key) { + if(key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymEncryptingKey(void *channelContext, + const UA_ByteString *key) { + if(key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymIv(void *channelContext, + const UA_ByteString *key) { + if(key == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(key, &cc->remoteSymIv); +} + +static UA_StatusCode +UA_AsySig_Aes128Sha256RsaOaep_sign(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || channelContext == NULL || message == NULL || + signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Policy_Context_Aes128Sha256RsaOaep *pc = + (Policy_Context_Aes128Sha256RsaOaep *)securityPolicy->policyContext; + return UA_Openssl_RSA_PKCS1_V15_SHA256_Sign(message, pc->localPrivateKey, signature); +} + +static UA_StatusCode +UA_AsymEn_Aes128Sha256RsaOaep_encrypt(const UA_SecurityPolicy *securityPolicy, + void *channelContext, UA_ByteString *data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_Openssl_RSA_OAEP_Encrypt( + data, UA_SECURITYPOLICY_AES128SHA256RSAOAEP_RSAPADDING_LEN, + cc->remoteCertificateX509); +} + +static size_t +UA_SymSig_Aes128Sha256RsaOaep_getRemoteSignatureSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA256_LENGTH; +} + +static UA_StatusCode +UA_SymSig_Aes128Sha256RsaOaep_verify(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || channelContext == NULL || message == NULL || + signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_OpenSSL_HMAC_SHA256_Verify(message, &cc->remoteSymSigningKey, signature); +} + +static UA_StatusCode +UA_SymSig_Aes128Sha256RsaOaep_sign(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || channelContext == NULL || message == NULL || + signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_OpenSSL_HMAC_SHA256_Sign(message, &cc->localSymSigningKey, signature); +} + +static size_t +UA_SymSig_Aes128Sha256RsaOaep_getLocalSignatureSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA256_LENGTH; +} + +static UA_StatusCode +UA_SymEn_Aes128Sha256RsaOaep_decrypt(const UA_SecurityPolicy *securityPolicy, + void *channelContext, UA_ByteString *data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_OpenSSL_AES_128_CBC_Decrypt(&cc->remoteSymIv, &cc->remoteSymEncryptingKey, + data); +} + +static UA_StatusCode +UA_SymEn_Aes128Sha256RsaOaep_encrypt(const UA_SecurityPolicy *securityPolicy, + void *channelContext, UA_ByteString *data) { + if(securityPolicy == NULL || channelContext == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Channel_Context_Aes128Sha256RsaOaep *cc = + (Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_OpenSSL_AES_128_CBC_Encrypt(&cc->localSymIv, &cc->localSymEncryptingKey, + data); +} + +static UA_StatusCode +UA_ChannelM_Aes128Sha256RsaOaep_compareCertificate(const void *channelContext, + const UA_ByteString *certificate) { + if(channelContext == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const Channel_Context_Aes128Sha256RsaOaep *cc = + (const Channel_Context_Aes128Sha256RsaOaep *)channelContext; + return UA_OpenSSL_X509_compare(certificate, cc->remoteCertificateX509); +} + +static size_t +UA_SymEn_Aes128Sha256RsaOaep_getLocalPlainTextBlockSize(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static size_t +UA_AsymEn_Aes128Sha256RsaOaep_getLocalKeyLength(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + if(securityPolicy == NULL || channelContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Policy_Context_Aes128Sha256RsaOaep *pc = + (Policy_Context_Aes128Sha256RsaOaep *)securityPolicy->policyContext; + UA_Int32 keyLen = 0; + UA_Openssl_RSA_Private_GetKeyLength(pc->localPrivateKey, &keyLen); + UA_assert(keyLen == 256); /* 256 bytes 2048 bits */ + + return (size_t)keyLen * 8; +} + +/* the main entry of Aes128Sha256RsaOaep */ + +UA_StatusCode +UA_SecurityPolicy_Aes128Sha256RsaOaep(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger *logger) { + + UA_SecurityPolicyAsymmetricModule *const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule *const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule *const channelModule = &policy->channelModule; + UA_StatusCode retval; + + UA_LOG_INFO(logger, UA_LOGCATEGORY_SECURITYPOLICY, + "The Aes128Sha256RsaOaep security policy with openssl is added."); + + UA_Openssl_Init(); + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + policy->policyUri = + UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep\0"); + + /* set ChannelModule context */ + + channelModule->newContext = UA_ChannelModule_Aes128Sha256RsaOaep_New_Context; + channelModule->deleteContext = UA_ChannelModule_Aes128Sha256RsaOaep_Delete_Context; + channelModule->setLocalSymSigningKey = + UA_ChannelModule_Aes128Sha256RsaOaep_setLocalSymSigningKey; + channelModule->setLocalSymEncryptingKey = + UA_ChannelM_Aes128Sha256RsaOaep_setLocalSymEncryptingKey; + channelModule->setLocalSymIv = UA_ChannelM_Aes128Sha256RsaOaep_setLocalSymIv; + channelModule->setRemoteSymSigningKey = + UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymSigningKey; + channelModule->setRemoteSymEncryptingKey = + UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymEncryptingKey; + channelModule->setRemoteSymIv = UA_ChannelM_Aes128Sha256RsaOaep_setRemoteSymIv; + channelModule->compareCertificate = + UA_ChannelM_Aes128Sha256RsaOaep_compareCertificate; + + /* Copy the certificate and add a NULL to the end */ + + retval = UA_copyCertificate(&policy->localCertificate, &localCertificate); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule - signature algorithm */ + + UA_SecurityPolicySignatureAlgorithm *asySigAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asySigAlgorithm->uri = + UA_STRING("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\0"); + asySigAlgorithm->verify = UA_AsySig_Aes128Sha256RsaOaep_Verify; + asySigAlgorithm->getRemoteSignatureSize = + UA_Asym_Aes128Sha256RsaOaep_getRemoteSignatureSize; + asySigAlgorithm->getLocalSignatureSize = + UA_AsySig_Aes128Sha256RsaOaep_getLocalSignatureSize; + asySigAlgorithm->sign = UA_AsySig_Aes128Sha256RsaOaep_sign; + asySigAlgorithm->getLocalKeyLength = NULL; + asySigAlgorithm->getRemoteKeyLength = NULL; + + /* AsymmetricModule encryption algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm *asymEncryAlg = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asymEncryAlg->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asymEncryAlg->decrypt = UA_Asym_Aes128Sha256RsaOaep_Decrypt; + asymEncryAlg->getRemotePlainTextBlockSize = + UA_AsymEn_Aes128Sha256RsaOaep_getRemotePlainTextBlockSize; + asymEncryAlg->getRemoteBlockSize = UA_AsymEn_Aes128Sha256RsaOaep_getRemoteBlockSize; + asymEncryAlg->getRemoteKeyLength = UA_AsymEn_Aes128Sha256RsaOaep_getRemoteKeyLength; + asymEncryAlg->encrypt = UA_AsymEn_Aes128Sha256RsaOaep_encrypt; + asymEncryAlg->getLocalKeyLength = UA_AsymEn_Aes128Sha256RsaOaep_getLocalKeyLength; + asymEncryAlg->getLocalPlainTextBlockSize = NULL; + asymEncryAlg->getLocalBlockSize = NULL; + + /* asymmetricModule */ + + asymmetricModule->compareCertificateThumbprint = + UA_compareCertificateThumbprint_Aes128Sha256RsaOaep; + asymmetricModule->makeCertificateThumbprint = + UA_makeCertificateThumbprint_Aes128Sha256RsaOaep; + + /* SymmetricModule */ + + symmetricModule->secureChannelNonceLength = 32; + symmetricModule->generateNonce = UA_Sym_Aes128Sha256RsaOaep_generateNonce; + symmetricModule->generateKey = UA_Sym_Aes128Sha256RsaOaep_generateKey; + + /* Symmetric encryption Algorithm */ + + UA_SecurityPolicyEncryptionAlgorithm *symEncryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + symEncryptionAlgorithm->uri = + UA_STRING("http://www.w3.org/2001/04/xmlenc#aes128-cbc\0"); + symEncryptionAlgorithm->getLocalKeyLength = + UA_SymEn_Aes128Sha256RsaOaep_getLocalKeyLength; + symEncryptionAlgorithm->getLocalBlockSize = + UA_SymEn_Aes128Sha256RsaOaep_getLocalBlockSize; + symEncryptionAlgorithm->getRemoteKeyLength = + UA_SymEn_Aes128Sha256RsaOaep_getRemoteKeyLength; + symEncryptionAlgorithm->getRemoteBlockSize = + UA_SymEn_Aes128Sha256RsaOaep_getRemoteBlockSize; + symEncryptionAlgorithm->decrypt = UA_SymEn_Aes128Sha256RsaOaep_decrypt; + symEncryptionAlgorithm->encrypt = UA_SymEn_Aes128Sha256RsaOaep_encrypt; + symEncryptionAlgorithm->getLocalPlainTextBlockSize = + UA_SymEn_Aes128Sha256RsaOaep_getLocalPlainTextBlockSize; + + /* Symmetric signature Algorithm */ + + UA_SecurityPolicySignatureAlgorithm *symSignatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + symSignatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha2-256\0"); + symSignatureAlgorithm->getLocalKeyLength = + UA_SymSig_Aes128Sha256RsaOaep_getLocalKeyLength; + symSignatureAlgorithm->getRemoteKeyLength = + UA_SymSig_Aes128Sha256RsaOaep_getRemoteKeyLength; + symSignatureAlgorithm->getRemoteSignatureSize = + UA_SymSig_Aes128Sha256RsaOaep_getRemoteSignatureSize; + symSignatureAlgorithm->verify = UA_SymSig_Aes128Sha256RsaOaep_verify; + symSignatureAlgorithm->sign = UA_SymSig_Aes128Sha256RsaOaep_sign; + symSignatureAlgorithm->getLocalSignatureSize = + UA_SymSig_Aes128Sha256RsaOaep_getLocalSignatureSize; + + retval = UA_Policy_Aes128Sha256RsaOaep_New_Context(policy, localPrivateKey, logger); + if(retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear(&policy->localCertificate); + return retval; + } + policy->clear = UA_Policy_Aes128Sha256RsaOaep_Clear_Context; + + /* Use the same signature algorithm as the asymmetric component for + certificate signing (see standard) */ + + policy->certificateSigningAlgorithm = + policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + return UA_STATUSCODE_GOOD; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/openssl/ua_pki_openssl.c" ***********************************/ + +/* 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 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + + */ + + + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL +#include <openssl/x509.h> +#include <openssl/x509_vfy.h> +#include <openssl/x509v3.h> +#include <openssl/pem.h> + +/* Find binary substring. Taken and adjusted from + * http://tungchingkai.blogspot.com/2011/07/binary-strstr.html */ + +static const unsigned char * +bstrchr(const unsigned char *s, const unsigned char ch, size_t l) { + /* find first occurrence of c in char s[] for length l*/ + /* handle special case */ + if(l == 0) + return (NULL); + + for(; *s != ch; ++s, --l) + if(l == 0) + return (NULL); + return s; +} + +static const unsigned char * +UA_Bstrstr(const unsigned char *s1, size_t l1, const unsigned char *s2, size_t l2) { + /* find first occurrence of s2[] in s1[] for length l1*/ + const unsigned char *ss1 = s1; + const unsigned char *ss2 = s2; + /* handle special case */ + if(l1 == 0) + return (NULL); + if(l2 == 0) + return s1; + + /* match prefix */ + for (; (s1 = bstrchr(s1, *s2, (uintptr_t)ss1-(uintptr_t)s1+(uintptr_t)l1)) != NULL && + (uintptr_t)ss1-(uintptr_t)s1+(uintptr_t)l1 != 0; ++s1) { + + /* match rest of prefix */ + const unsigned char *sc1, *sc2; + for (sc1 = s1, sc2 = s2; ;) + if (++sc2 >= ss2+l2) + return s1; + else if (*++sc1 != *sc2) + break; + } + return NULL; +} + +typedef struct { + /* + * If the folders are defined, we use them to reload the certificates during + * runtime + */ + + UA_String trustListFolder; + UA_String issuerListFolder; + UA_String revocationListFolder; + + STACK_OF(X509) * skIssue; + STACK_OF(X509) * skTrusted; + STACK_OF(X509_CRL) * skCrls; /* Revocation list*/ +} CertContext; + +static UA_StatusCode +UA_CertContext_sk_Init (CertContext * context) { + context->skTrusted = sk_X509_new_null(); + context->skIssue = sk_X509_new_null(); + context->skCrls = sk_X509_CRL_new_null(); + if (context->skTrusted == NULL || context->skIssue == NULL || + context->skCrls == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + return UA_STATUSCODE_GOOD; +} + +static void +UA_CertContext_sk_free (CertContext * context) { + sk_X509_pop_free (context->skTrusted, X509_free); + sk_X509_pop_free (context->skIssue, X509_free); + sk_X509_CRL_pop_free (context->skCrls, X509_CRL_free); +} + +static UA_StatusCode +UA_CertContext_Init (CertContext * context) { + (void) memset (context, 0, sizeof (CertContext)); + UA_ByteString_init (&context->trustListFolder); + UA_ByteString_init (&context->issuerListFolder); + UA_ByteString_init (&context->revocationListFolder); + return UA_CertContext_sk_Init (context); +} + +static void +UA_CertificateVerification_clear (UA_CertificateVerification * cv) { + if (cv == NULL) { + return ; + } + CertContext * context = (CertContext *) cv->context; + if (context == NULL) { + return; + } + UA_ByteString_clear (&context->trustListFolder); + UA_ByteString_clear (&context->issuerListFolder); + UA_ByteString_clear (&context->revocationListFolder); + + UA_CertContext_sk_free (context); + UA_free (context); + + cv->context = NULL; + + return; +} + +static UA_StatusCode +UA_skTrusted_Cert2X509 (const UA_ByteString * certificateTrustList, + size_t certificateTrustListSize, + CertContext * ctx) { + size_t i; + + for (i = 0; i < certificateTrustListSize; i++) { + X509 * x509 = UA_OpenSSL_LoadCertificate(&certificateTrustList[i]); + + if (x509 == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + sk_X509_push (ctx->skTrusted, x509); + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_skIssuer_Cert2X509 (const UA_ByteString * certificateIssuerList, + size_t certificateIssuerListSize, + CertContext * ctx) { + size_t i; + + for (i = 0; i < certificateIssuerListSize; i++) { + X509 * x509 = UA_OpenSSL_LoadCertificate(&certificateIssuerList[i]); + + if (x509 == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + sk_X509_push (ctx->skIssue, x509); + } + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_skCrls_Cert2X509 (const UA_ByteString * certificateRevocationList, + size_t certificateRevocationListSize, + CertContext * ctx) { + size_t i; + const unsigned char * pData; + + for (i = 0; i < certificateRevocationListSize; i++) { + pData = certificateRevocationList[i].data; + X509_CRL * crl = NULL; + + if (certificateRevocationList[i].length > 1 && pData[0] == 0x30 && pData[1] == 0x82) { // Magic number for DER encoded files + crl = d2i_X509_CRL (NULL, &pData, (long) certificateRevocationList[i].length); + } else { + BIO* bio = NULL; + +#if OPENSSL_VERSION_NUMBER < 0x1000207fL + bio = BIO_new_mem_buf((void *) certificateRevocationList[i].data, + (int) certificateRevocationList[i].length); +#else + bio = BIO_new_mem_buf((const void *) certificateRevocationList[i].data, + (int) certificateRevocationList[i].length); +#endif + crl = PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL); + BIO_free(bio); + } + + if (crl == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + sk_X509_CRL_push (ctx->skCrls, crl); + } + + return UA_STATUSCODE_GOOD; +} + +#ifdef __linux__ +#include <dirent.h> + +static int UA_Certificate_Filter_der_pem (const struct dirent * entry) { + /* ignore hidden files */ + if (entry->d_name[0] == '.') return 0; + + /* check file extension */ + const char *pszFind = strrchr(entry->d_name, '.'); + if (pszFind == 0) + return 0; + pszFind++; + if (strcmp (pszFind, "der") == 0 || strcmp (pszFind, "pem") == 0) + return 1; + + return 0; +} + +static int UA_Certificate_Filter_crl (const struct dirent * entry) { + + /* ignore hidden files */ + if (entry->d_name[0] == '.') return 0; + + /* check file extension */ + const char *pszFind = strrchr(entry->d_name, '.'); + if (pszFind == 0) + return 0; + pszFind++; + if (strcmp (pszFind, "crl") == 0) + return 1; + + return 0; +} + +static UA_StatusCode +UA_BuildFullPath (const char * path, + const char * fileName, + size_t fullPathBufferLength, + char * fullPath) { + size_t pathLen = strlen (path); + size_t fileNameLen = strlen (fileName); + if ((pathLen + fileNameLen + 2) > fullPathBufferLength) { + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + strcpy (fullPath, path); + strcat (fullPath, "/"); + strcat (fullPath, fileName); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_loadCertFromFile (const char * fileName, + UA_ByteString * cert) { + + FILE * fp = fopen(fileName, "rb"); + + if (fp == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + fseek(fp, 0, SEEK_END); + cert->length = (size_t) ftell(fp); + if (UA_ByteString_allocBuffer (cert, cert->length) != UA_STATUSCODE_GOOD) { + fclose (fp); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + fseek(fp, 0, SEEK_SET); + size_t readLen = fread (cert->data, 1, cert->length, fp); + if (readLen != cert->length) { + UA_ByteString_clear (cert); + cert->length = 0; + fclose (fp); + return UA_STATUSCODE_BADINTERNALERROR; + } + fclose (fp); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_ReloadCertFromFolder (CertContext * ctx) { + UA_StatusCode ret; + struct dirent ** dirlist = NULL; + int i; + int numCertificates; + char certFile[PATH_MAX]; + UA_ByteString strCert; + char folderPath[PATH_MAX]; + + UA_ByteString_init (&strCert); + + if (ctx->trustListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the trust-list"); + + sk_X509_pop_free (ctx->skTrusted, X509_free); + ctx->skTrusted = sk_X509_new_null(); + if (ctx->skTrusted == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + (void) memcpy (folderPath, ctx->trustListFolder.data, + ctx->trustListFolder.length); + folderPath[ctx->trustListFolder.length] = 0; + numCertificates = scandir(folderPath, &dirlist, + UA_Certificate_Filter_der_pem, + alphasort); + for (i = 0; i < numCertificates; i++) { + if (UA_BuildFullPath (folderPath, dirlist[i]->d_name, + PATH_MAX, certFile) != UA_STATUSCODE_GOOD) { + continue; + } + ret = UA_loadCertFromFile (certFile, &strCert); + if (ret != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load the certificate file %s", certFile); + continue; /* continue or return ? */ + } + if (UA_skTrusted_Cert2X509 (&strCert, 1, ctx) != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to decode the certificate file %s", certFile); + UA_ByteString_clear (&strCert); + continue; /* continue or return ? */ + } + UA_ByteString_clear (&strCert); + } + } + + if (ctx->issuerListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the issuer-list"); + + sk_X509_pop_free (ctx->skIssue, X509_free); + ctx->skIssue = sk_X509_new_null(); + if (ctx->skIssue == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + memcpy (folderPath, ctx->issuerListFolder.data, ctx->issuerListFolder.length); + folderPath[ctx->issuerListFolder.length] = 0; + numCertificates = scandir(folderPath, &dirlist, + UA_Certificate_Filter_der_pem, + alphasort); + for (i = 0; i < numCertificates; i++) { + if (UA_BuildFullPath (folderPath, dirlist[i]->d_name, + PATH_MAX, certFile) != UA_STATUSCODE_GOOD) { + continue; + } + ret = UA_loadCertFromFile (certFile, &strCert); + if (ret != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load the certificate file %s", certFile); + continue; /* continue or return ? */ + } + if (UA_skIssuer_Cert2X509 (&strCert, 1, ctx) != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to decode the certificate file %s", certFile); + UA_ByteString_clear (&strCert); + continue; /* continue or return ? */ + } + UA_ByteString_clear (&strCert); + } + } + + if (ctx->revocationListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the revocation-list"); + + sk_X509_CRL_pop_free (ctx->skCrls, X509_CRL_free); + ctx->skCrls = sk_X509_CRL_new_null(); + if (ctx->skCrls == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + memcpy (folderPath, ctx->revocationListFolder.data, ctx->revocationListFolder.length); + folderPath[ctx->revocationListFolder.length] = 0; + numCertificates = scandir(folderPath, &dirlist, + UA_Certificate_Filter_crl, + alphasort); + for (i = 0; i < numCertificates; i++) { + if (UA_BuildFullPath (folderPath, dirlist[i]->d_name, + PATH_MAX, certFile) != UA_STATUSCODE_GOOD) { + continue; + } + ret = UA_loadCertFromFile (certFile, &strCert); + if (ret != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load the revocation file %s", certFile); + continue; /* continue or return ? */ + } + if (UA_skCrls_Cert2X509 (&strCert, 1, ctx) != UA_STATUSCODE_GOOD) { + UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to decode the revocation file %s", certFile); + UA_ByteString_clear (&strCert); + continue; /* continue or return ? */ + } + UA_ByteString_clear (&strCert); + } + } + + ret = UA_STATUSCODE_GOOD; + return ret; +} + +#endif /* end of __linux__ */ + +static UA_StatusCode +UA_X509_Store_CTX_Error_To_UAError (int opensslErr) { + UA_StatusCode ret; + + switch (opensslErr) { + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CRL_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + ret = UA_STATUSCODE_BADCERTIFICATETIMEINVALID; + break; + case X509_V_ERR_CERT_REVOKED: + ret = UA_STATUSCODE_BADCERTIFICATEREVOKED; + break; + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + ret = UA_STATUSCODE_BADCERTIFICATEUNTRUSTED; + break; + case X509_V_ERR_CERT_SIGNATURE_FAILURE: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + ret = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + break; + case X509_V_ERR_UNABLE_TO_GET_CRL: + ret = UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN; + break; + default: + ret = UA_STATUSCODE_BADCERTIFICATEINVALID; + break; + } + return ret; + } + +static UA_StatusCode +UA_CertificateVerification_Verify (void * verificationContext, + const UA_ByteString * certificate) { + X509_STORE_CTX* storeCtx; + X509_STORE* store; + CertContext * ctx; + UA_StatusCode ret; + int opensslRet; + X509 * certificateX509 = NULL; + + if (verificationContext == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + ctx = (CertContext *) verificationContext; + + store = X509_STORE_new(); + storeCtx = X509_STORE_CTX_new(); + + if (store == NULL || storeCtx == NULL) { + ret = UA_STATUSCODE_BADOUTOFMEMORY; + goto cleanup; + } +#ifdef __linux__ + ret = UA_ReloadCertFromFolder (ctx); + if (ret != UA_STATUSCODE_GOOD) { + goto cleanup; + } +#endif + + certificateX509 = UA_OpenSSL_LoadCertificate(certificate); + if (certificateX509 == NULL) { + ret = UA_STATUSCODE_BADCERTIFICATEINVALID; + goto cleanup; + } + + X509_STORE_set_flags(store, 0); + opensslRet = X509_STORE_CTX_init (storeCtx, store, certificateX509, + ctx->skIssue); + if (opensslRet != 1) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto cleanup; + } +#if OPENSSL_API_COMPAT < 0x10100000L + (void) X509_STORE_CTX_trusted_stack (storeCtx, ctx->skTrusted); +#else + (void) X509_STORE_CTX_set0_trusted_stack (storeCtx, ctx->skTrusted); +#endif + + /* Set crls to ctx */ + if (sk_X509_CRL_num (ctx->skCrls) > 0) { + X509_STORE_CTX_set0_crls (storeCtx, ctx->skCrls); + } + + /* Set flag to check if the certificate has an invalid signature */ + X509_STORE_CTX_set_flags (storeCtx, X509_V_FLAG_CHECK_SS_SIGNATURE); + +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL + if (X509_STORE_CTX_get_check_issued (storeCtx) (storeCtx,certificateX509, certificateX509) != 1) { + X509_STORE_CTX_set_flags (storeCtx, X509_V_FLAG_CRL_CHECK); + } +#else + if (storeCtx->check_issued(storeCtx,certificateX509, certificateX509) != 1) { + X509_STORE_CTX_set_flags (storeCtx, X509_V_FLAG_CRL_CHECK); + } +#endif + + /* This condition will check whether the certificate is a User certificate or a CA certificate. + * If the KU_KEY_CERT_SIGN and KU_CRL_SIGN of key_usage are set, then the certificate shall be + * condidered as CA Certificate and cannot be used to establish a connection. Refer the test case + * CTT/Security/Security Certificate Validation/029.js for more details */ + uint32_t val = X509_get_key_usage(certificateX509); + if((val & KU_KEY_CERT_SIGN) && + (val & KU_CRL_SIGN)) { + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + } + + opensslRet = X509_verify_cert (storeCtx); + if (opensslRet == 1) { + ret = UA_STATUSCODE_GOOD; + + /* Check if the not trusted certificate has a CRL file. If there is no CRL file available for the corresponding + * parent certificate then return status code UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN. Refer the test + * case CTT/Security/Security Certificate Validation/002.js */ +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL + if (X509_STORE_CTX_get_check_issued (storeCtx) (storeCtx,certificateX509, certificateX509) != 1) { +#else + if (storeCtx->check_issued(storeCtx,certificateX509, certificateX509) != 1) { +#endif + /* Free X509_STORE_CTX and reuse it for certification verification */ + if (storeCtx != NULL) { + X509_STORE_CTX_free(storeCtx); + } + + /* Initialised X509_STORE_CTX sructure*/ + storeCtx = X509_STORE_CTX_new(); + + /* Sets up X509_STORE_CTX structure for a subsequent verification operation */ + X509_STORE_set_flags(store, 0); + X509_STORE_CTX_init (storeCtx, store, certificateX509,ctx->skIssue); + + /* Set trust list to ctx */ + (void) X509_STORE_CTX_trusted_stack (storeCtx, ctx->skTrusted); + + /* Set crls to ctx */ + X509_STORE_CTX_set0_crls (storeCtx, ctx->skCrls); + + /* Set flags for CRL check */ + X509_STORE_CTX_set_flags (storeCtx, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); + + opensslRet = X509_verify_cert (storeCtx); + if (opensslRet != 1) { + opensslRet = X509_STORE_CTX_get_error (storeCtx); + if (opensslRet == X509_V_ERR_UNABLE_TO_GET_CRL) { + ret = UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN; + } + } + } + } + else { + opensslRet = X509_STORE_CTX_get_error (storeCtx); + + /* Check the issued certificate of a CA that is not trusted but available */ + if(opensslRet == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN){ + int trusted_cert_len = sk_X509_num(ctx->skTrusted); + int cmpVal; + X509 *trusted_cert; + const ASN1_OCTET_STRING *trusted_cert_keyid; + const ASN1_OCTET_STRING *remote_cert_keyid; + + for (int i = 0; i < trusted_cert_len; i++) { + trusted_cert = sk_X509_value(ctx->skTrusted, i); + + /* Fetch the Subject key identifier of the certificate in trust list */ + trusted_cert_keyid = X509_get0_subject_key_id(trusted_cert); + + /* Fetch the Subject key identifier of the remote certificate */ + remote_cert_keyid = X509_get0_subject_key_id(certificateX509); + + /* Check remote certificate is present in the trust list */ + cmpVal = ASN1_OCTET_STRING_cmp(trusted_cert_keyid, remote_cert_keyid); + if (cmpVal == 0){ + ret = UA_STATUSCODE_GOOD; + goto cleanup; + } + } + } + + /* Return expected OPCUA error code */ + ret = UA_X509_Store_CTX_Error_To_UAError (opensslRet); + } +cleanup: + if (store != NULL) { + X509_STORE_free (store); + } + if (storeCtx != NULL) { + X509_STORE_CTX_free (storeCtx); + } + if (certificateX509 != NULL) { + X509_free (certificateX509); + } + return ret; +} + +static UA_StatusCode +UA_VerifyCertificateAllowAll (void * verificationContext, + const UA_ByteString * certificate) { + (void) verificationContext; + (void) certificate; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +UA_CertificateVerification_VerifyApplicationURI (void * verificationContext, + const UA_ByteString * certificate, + const UA_String * applicationURI) { + (void) verificationContext; + + const unsigned char * pData; + X509 * certificateX509; + UA_String subjectURI; + GENERAL_NAMES * pNames; + int i; + UA_StatusCode ret; + + pData = certificate->data; + if (pData == NULL) { + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + certificateX509 = UA_OpenSSL_LoadCertificate(certificate); + if (certificateX509 == NULL) { + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + pNames = (GENERAL_NAMES *) X509_get_ext_d2i(certificateX509, NID_subject_alt_name, + NULL, NULL); + if (pNames == NULL) { + X509_free (certificateX509); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + for (i = 0; i < sk_GENERAL_NAME_num (pNames); i++) { + GENERAL_NAME * value = sk_GENERAL_NAME_value (pNames, i); + if (value->type == GEN_URI) { + subjectURI.length = (size_t) (value->d.ia5->length); + subjectURI.data = (UA_Byte *) UA_malloc (subjectURI.length); + if (subjectURI.data == NULL) { + X509_free (certificateX509); + sk_GENERAL_NAME_pop_free(pNames, GENERAL_NAME_free); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + (void) memcpy (subjectURI.data, value->d.ia5->data, subjectURI.length); + break; + } + + } + + ret = UA_STATUSCODE_GOOD; + if (UA_Bstrstr (subjectURI.data, subjectURI.length, + applicationURI->data, applicationURI->length) == NULL) { + ret = UA_STATUSCODE_BADCERTIFICATEURIINVALID; + } + + X509_free (certificateX509); + sk_GENERAL_NAME_pop_free(pNames, GENERAL_NAME_free); + UA_String_clear (&subjectURI); + return ret; +} + +/* main entry */ + +UA_StatusCode +UA_CertificateVerification_Trustlist(UA_CertificateVerification * cv, + const UA_ByteString * certificateTrustList, + size_t certificateTrustListSize, + const UA_ByteString * certificateIssuerList, + size_t certificateIssuerListSize, + const UA_ByteString * certificateRevocationList, + size_t certificateRevocationListSize) { + UA_StatusCode ret; + + if (cv == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + CertContext * context = (CertContext *) UA_malloc (sizeof (CertContext)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + ret = UA_CertContext_Init (context); + if (ret != UA_STATUSCODE_GOOD) { + return ret; + } + + cv->verifyApplicationURI = UA_CertificateVerification_VerifyApplicationURI; + cv->clear = UA_CertificateVerification_clear; + cv->context = context; + if (certificateTrustListSize > 0) + cv->verifyCertificate = UA_CertificateVerification_Verify; + else + cv->verifyCertificate = UA_VerifyCertificateAllowAll; + + if (certificateTrustListSize > 0) { + if (UA_skTrusted_Cert2X509 (certificateTrustList, certificateTrustListSize, + context) != UA_STATUSCODE_GOOD) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + } + + if (certificateIssuerListSize > 0) { + if (UA_skIssuer_Cert2X509 (certificateIssuerList, certificateIssuerListSize, + context) != UA_STATUSCODE_GOOD) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + } + + if (certificateRevocationListSize > 0) { + if (UA_skCrls_Cert2X509 (certificateRevocationList, certificateRevocationListSize, + context) != UA_STATUSCODE_GOOD) { + ret = UA_STATUSCODE_BADINTERNALERROR; + goto errout; + } + } + + return UA_STATUSCODE_GOOD; + +errout: + UA_CertificateVerification_clear (cv); + return ret; +} + +#ifdef __linux__ /* Linux only so far */ +UA_StatusCode +UA_CertificateVerification_CertFolders(UA_CertificateVerification * cv, + const char * trustListFolder, + const char * issuerListFolder, + const char * revocationListFolder) { + UA_StatusCode ret; + if (cv == NULL) { + return UA_STATUSCODE_BADINTERNALERROR; + } + + CertContext * context = (CertContext *) UA_malloc (sizeof (CertContext)); + if (context == NULL) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + ret = UA_CertContext_Init (context); + if (ret != UA_STATUSCODE_GOOD) { + return ret; + } + + cv->verifyApplicationURI = UA_CertificateVerification_VerifyApplicationURI; + cv->clear = UA_CertificateVerification_clear; + cv->context = context; + cv->verifyCertificate = UA_CertificateVerification_Verify; + + /* Only set the folder paths. They will be reloaded during runtime. */ + + context->trustListFolder = UA_STRING_ALLOC(trustListFolder); + context->issuerListFolder = UA_STRING_ALLOC(issuerListFolder); + context->revocationListFolder = UA_STRING_ALLOC(revocationListFolder); + + return UA_STATUSCODE_GOOD; +} +#endif + +#endif /* end of UA_ENABLE_ENCRYPTION_OPENSSL */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/securitypolicy_mbedtls_common.h" ***********************************/ + +/* 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 2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + +#include <mbedtls/md.h> +#include <mbedtls/x509_crt.h> +#include <mbedtls/ctr_drbg.h> + +#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) +#define MBEDTLS_ENTROPY_POLL_METHOD mbedtls_platform_entropy_poll +#else +// MBEDTLS_ENTROPY_HARDWARE_ALT should be defined if your hardware does not supportd platform entropy +#define MBEDTLS_ENTROPY_POLL_METHOD mbedtls_hardware_poll +#endif + +#define UA_SHA1_LENGTH 20 + +_UA_BEGIN_DECLS + +void +swapBuffers(UA_ByteString *const bufA, UA_ByteString *const bufB); + +void +mbedtls_hmac(mbedtls_md_context_t *context, const UA_ByteString *key, + const UA_ByteString *in, unsigned char *out); + +UA_StatusCode +mbedtls_generateKey(mbedtls_md_context_t *context, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out); + +UA_StatusCode +mbedtls_verifySig_sha1(mbedtls_x509_crt *certificate, const UA_ByteString *message, + const UA_ByteString *signature); + +UA_StatusCode +mbedtls_sign_sha1(mbedtls_pk_context *localPrivateKey, + mbedtls_ctr_drbg_context *drbgContext, + const UA_ByteString *message, + UA_ByteString *signature); + +UA_StatusCode +mbedtls_thumbprint_sha1(const UA_ByteString *certificate, + UA_ByteString *thumbprint); + +/* Set the hashing scheme before calling + * E.g. mbedtls_rsa_set_padding(context, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1); */ +UA_StatusCode +mbedtls_encrypt_rsaOaep(mbedtls_rsa_context *context, + mbedtls_ctr_drbg_context *drbgContext, + UA_ByteString *data, const size_t plainTextBlockSize); + +UA_StatusCode +mbedtls_decrypt_rsaOaep(mbedtls_pk_context *localPrivateKey, + mbedtls_ctr_drbg_context *drbgContext, + UA_ByteString *data); + +int UA_mbedTLS_LoadPrivateKey(const UA_ByteString *key, mbedtls_pk_context *target); + +UA_StatusCode UA_mbedTLS_LoadLocalCertificate(const UA_ByteString *certData, UA_ByteString *target); + +UA_ByteString UA_mbedTLS_CopyDataFormatAware(const UA_ByteString *data); + +_UA_END_DECLS + +#endif + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/securitypolicy_mbedtls_common.c" ***********************************/ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + + +#include <mbedtls/aes.h> +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/entropy.h> +#include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> +#include <mbedtls/md.h> +#include <mbedtls/sha1.h> +#include <mbedtls/version.h> +#include <mbedtls/x509_crt.h> + +void +swapBuffers(UA_ByteString *const bufA, UA_ByteString *const bufB) { + UA_ByteString tmp = *bufA; + *bufA = *bufB; + *bufB = tmp; +} + +void +mbedtls_hmac(mbedtls_md_context_t *context, const UA_ByteString *key, + const UA_ByteString *in, unsigned char *out) { + mbedtls_md_hmac_starts(context, key->data, key->length); + mbedtls_md_hmac_update(context, in->data, in->length); + mbedtls_md_hmac_finish(context, out); +} + +UA_StatusCode +mbedtls_generateKey(mbedtls_md_context_t *context, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out) { + size_t hashLen = (size_t)mbedtls_md_get_size(context->md_info); + + UA_ByteString A_and_seed; + UA_ByteString_allocBuffer(&A_and_seed, hashLen + seed->length); + memcpy(A_and_seed.data + hashLen, seed->data, seed->length); + + UA_ByteString ANext_and_seed; + UA_ByteString_allocBuffer(&ANext_and_seed, hashLen + seed->length); + memcpy(ANext_and_seed.data + hashLen, seed->data, seed->length); + + UA_ByteString A = { + hashLen, + A_and_seed.data + }; + + UA_ByteString ANext = { + hashLen, + ANext_and_seed.data + }; + + mbedtls_hmac(context, secret, seed, A.data); + + UA_StatusCode retval = 0; + for(size_t offset = 0; offset < out->length; offset += hashLen) { + UA_ByteString outSegment = { + hashLen, + out->data + offset + }; + UA_Boolean bufferAllocated = UA_FALSE; + // Not enough room in out buffer to write the hash. + if(offset + hashLen > out->length) { + outSegment.data = NULL; + outSegment.length = 0; + retval = UA_ByteString_allocBuffer(&outSegment, hashLen); + if(retval != UA_STATUSCODE_GOOD) { + UA_ByteString_clear(&A_and_seed); + UA_ByteString_clear(&ANext_and_seed); + return retval; + } + bufferAllocated = UA_TRUE; + } + + mbedtls_hmac(context, secret, &A_and_seed, outSegment.data); + mbedtls_hmac(context, secret, &A, ANext.data); + + if(retval != UA_STATUSCODE_GOOD) { + if(bufferAllocated) + UA_ByteString_clear(&outSegment); + UA_ByteString_clear(&A_and_seed); + UA_ByteString_clear(&ANext_and_seed); + return retval; + } + + if(bufferAllocated) { + memcpy(out->data + offset, outSegment.data, out->length - offset); + UA_ByteString_clear(&outSegment); + } + + swapBuffers(&ANext_and_seed, &A_and_seed); + swapBuffers(&ANext, &A); + } + + UA_ByteString_clear(&A_and_seed); + UA_ByteString_clear(&ANext_and_seed); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +mbedtls_verifySig_sha1(mbedtls_x509_crt *certificate, const UA_ByteString *message, + const UA_ByteString *signature) { + /* Compute the sha1 hash */ + unsigned char hash[UA_SHA1_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + mbedtls_sha1_ret(message->data, message->length, hash); +#else + mbedtls_sha1(message->data, message->length, hash); +#endif + + /* Set the RSA settings */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(certificate->pk); + if(!rsaContext) + return UA_STATUSCODE_BADINTERNALERROR; + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, 0); + + /* Verify */ + int mbedErr = mbedtls_pk_verify(&certificate->pk, + MBEDTLS_MD_SHA1, hash, UA_SHA1_LENGTH, + signature->data, signature->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +mbedtls_sign_sha1(mbedtls_pk_context *localPrivateKey, + mbedtls_ctr_drbg_context *drbgContext, + const UA_ByteString *message, + UA_ByteString *signature) { + unsigned char hash[UA_SHA1_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + mbedtls_sha1_ret(message->data, message->length, hash); +#else + mbedtls_sha1(message->data, message->length, hash); +#endif + + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(*localPrivateKey); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, 0); + + size_t sigLen = 0; + int mbedErr = mbedtls_pk_sign(localPrivateKey, MBEDTLS_MD_SHA1, hash, + UA_SHA1_LENGTH, signature->data, &sigLen, + mbedtls_ctr_drbg_random, drbgContext); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +mbedtls_thumbprint_sha1(const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + if(UA_ByteString_equal(certificate, &UA_BYTESTRING_NULL)) + return UA_STATUSCODE_BADINTERNALERROR; + + if(thumbprint->length != UA_SHA1_LENGTH) + return UA_STATUSCODE_BADINTERNALERROR; + + /* The certificate thumbprint is always a 20 bit sha1 hash, see Part 4 of the Specification. */ +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + mbedtls_sha1_ret(certificate->data, certificate->length, thumbprint->data); +#else + mbedtls_sha1(certificate->data, certificate->length, thumbprint->data); +#endif + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +mbedtls_encrypt_rsaOaep(mbedtls_rsa_context *context, + mbedtls_ctr_drbg_context *drbgContext, + UA_ByteString *data, const size_t plainTextBlockSize) { + if(data->length % plainTextBlockSize != 0) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t max_blocks = data->length / plainTextBlockSize; + + UA_ByteString encrypted; + UA_StatusCode retval = UA_ByteString_allocBuffer(&encrypted, max_blocks * context->len); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + size_t lenDataToEncrypt = data->length; + size_t inOffset = 0; + size_t offset = 0; + const unsigned char *label = NULL; + while(lenDataToEncrypt >= plainTextBlockSize) { + int mbedErr = mbedtls_rsa_rsaes_oaep_encrypt(context, mbedtls_ctr_drbg_random, + drbgContext, MBEDTLS_RSA_PUBLIC, + label, 0, plainTextBlockSize, + data->data + inOffset, encrypted.data + offset); + if(mbedErr) { + UA_ByteString_clear(&encrypted); + return UA_STATUSCODE_BADINTERNALERROR; + } + + inOffset += plainTextBlockSize; + offset += context->len; + lenDataToEncrypt -= plainTextBlockSize; + } + + memcpy(data->data, encrypted.data, offset); + UA_ByteString_clear(&encrypted); + return UA_STATUSCODE_GOOD; +} + +UA_StatusCode +mbedtls_decrypt_rsaOaep(mbedtls_pk_context *localPrivateKey, + mbedtls_ctr_drbg_context *drbgContext, + UA_ByteString *data) { + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(*localPrivateKey); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1); + + if(data->length % rsaContext->len != 0) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t inOffset = 0; + size_t outOffset = 0; + size_t outLength = 0; + unsigned char buf[512]; + + while(inOffset < data->length) { + int mbedErr = mbedtls_rsa_rsaes_oaep_decrypt(rsaContext, mbedtls_ctr_drbg_random, + drbgContext, MBEDTLS_RSA_PRIVATE, + NULL, 0, &outLength, + data->data + inOffset, + buf, 512); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + memcpy(data->data + outOffset, buf, outLength); + inOffset += rsaContext->len; + outOffset += outLength; + } + + data->length = outOffset; + return UA_STATUSCODE_GOOD; +} + +int UA_mbedTLS_LoadPrivateKey(const UA_ByteString *key, mbedtls_pk_context *target) +{ + UA_ByteString data = UA_mbedTLS_CopyDataFormatAware(key); + int mbedErr = mbedtls_pk_parse_key(target, data.data, data.length, NULL, 0); + UA_ByteString_clear(&data); + + return mbedErr; +} + +UA_StatusCode UA_mbedTLS_LoadLocalCertificate(const UA_ByteString *certData, UA_ByteString *target) +{ + UA_ByteString data = UA_mbedTLS_CopyDataFormatAware(certData); + + mbedtls_x509_crt cert; + mbedtls_x509_crt_init(&cert); + + int mbedErr = mbedtls_x509_crt_parse(&cert, data.data, data.length); + + UA_StatusCode result = UA_STATUSCODE_BADINVALIDARGUMENT; + + if (!mbedErr) { + UA_ByteString tmp; + tmp.data = cert.raw.p; + tmp.length = cert.raw.len; + + result = UA_ByteString_copy(&tmp, target); + } else { + UA_ByteString_init(target); + } + + UA_ByteString_clear(&data); + mbedtls_x509_crt_free(&cert); + return result; +} + +// mbedTLS expects PEM data to be null terminated +// The data length parameter must include the null terminator +UA_ByteString UA_mbedTLS_CopyDataFormatAware(const UA_ByteString *data) +{ + UA_ByteString result; + UA_ByteString_init(&result); + + if (!data->length) + return result; + + if (data->length && data->data[0] == '-') { + UA_ByteString_allocBuffer(&result, data->length + 1); + memcpy(result.data, data->data, data->length); + result.data[data->length] = '\0'; + } else { + UA_ByteString_copy(data, &result); + } + + return result; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/ua_securitypolicy_basic128rsa15.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018-2019 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2018 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + * + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + + +#include <mbedtls/aes.h> +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/entropy.h> +#include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> +#include <mbedtls/md.h> +#include <mbedtls/sha1.h> +#include <mbedtls/version.h> +#include <mbedtls/x509_crt.h> + +/* Notes: + * mbedTLS' AES allows in-place encryption and decryption. Sow we don't have to + * allocate temp buffers. + * https://tls.mbed.org/discussions/generic/in-place-decryption-with-aes256-same-input-output-buffer + */ + +#define UA_SECURITYPOLICY_BASIC128RSA15_RSAPADDING_LEN 11 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_KEY_LENGTH 16 +#define UA_BASIC128RSA15_SYM_SIGNING_KEY_LENGTH 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC128RSA15_MINASYMKEYLENGTH 128 +#define UA_SECURITYPOLICY_BASIC128RSA15_MAXASYMKEYLENGTH 512 + +typedef struct { + UA_ByteString localCertThumbprint; + + mbedtls_ctr_drbg_context drbgContext; + mbedtls_entropy_context entropyContext; + mbedtls_md_context_t sha1MdContext; + mbedtls_pk_context localPrivateKey; +} Basic128Rsa15_PolicyContext; + +typedef struct { + Basic128Rsa15_PolicyContext *policyContext; + + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + mbedtls_x509_crt remoteCertificate; +} Basic128Rsa15_ChannelContext; + +/********************/ +/* AsymmetricModule */ +/********************/ + +static UA_StatusCode +asym_verify_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + return mbedtls_verifySig_sha1(&cc->remoteCertificate, message, signature); +} + +static UA_StatusCode +asym_sign_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic128Rsa15_PolicyContext *pc = cc->policyContext; + return mbedtls_sign_sha1(&pc->localPrivateKey, &pc->drbgContext, + message, signature); +} + +static size_t +asym_getLocalSignatureSize_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->policyContext->localPrivateKey)->len; +} + +static size_t +asym_getRemoteSignatureSize_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->remoteCertificate.pk)->len; +} + +static UA_StatusCode +asym_encrypt_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + Basic128Rsa15_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const size_t plainTextBlockSize = securityPolicy->asymmetricModule.cryptoModule.encryptionAlgorithm. + getRemotePlainTextBlockSize(securityPolicy, cc); + + if(data->length % plainTextBlockSize != 0) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_rsa_context *remoteRsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(remoteRsaContext, MBEDTLS_RSA_PKCS_V15, 0); + + UA_ByteString encrypted; + const size_t bufferOverhead = + UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(securityPolicy, cc, data->length); + UA_StatusCode retval = UA_ByteString_allocBuffer(&encrypted, data->length + bufferOverhead); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + size_t lenDataToEncrypt = data->length; + size_t inOffset = 0; + size_t offset = 0; + size_t outLength = 0; + Basic128Rsa15_PolicyContext *pc = cc->policyContext; + while(lenDataToEncrypt >= plainTextBlockSize) { + int mbedErr = mbedtls_pk_encrypt(&cc->remoteCertificate.pk, + data->data + inOffset, plainTextBlockSize, + encrypted.data + offset, &outLength, + encrypted.length - offset, + mbedtls_ctr_drbg_random, + &pc->drbgContext); + if(mbedErr) { + UA_ByteString_clear(&encrypted); + return UA_STATUSCODE_BADINTERNALERROR; + } + + inOffset += plainTextBlockSize; + offset += outLength; + lenDataToEncrypt -= plainTextBlockSize; + } + + memcpy(data->data, encrypted.data, offset); + UA_ByteString_clear(&encrypted); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +asym_decrypt_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + Basic128Rsa15_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->policyContext->localPrivateKey); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, 0); + + if(data->length % rsaContext->len != 0) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t inOffset = 0; + size_t outOffset = 0; + size_t outLength = 0; + unsigned char buf[512]; + + while(inOffset < data->length) { + int mbedErr = mbedtls_pk_decrypt(&cc->policyContext->localPrivateKey, + data->data + inOffset, rsaContext->len, + buf, &outLength, 512, NULL, NULL); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + memcpy(data->data + outOffset, buf, outLength); + inOffset += rsaContext->len; + outOffset += outLength; + } + + data->length = outOffset; + return UA_STATUSCODE_GOOD; +} + +static size_t +asym_getLocalEncryptionKeyLength_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->policyContext->localPrivateKey) * 8; +} + +static size_t +asym_getRemoteEncryptionKeyLength_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->remoteCertificate.pk) * 8; +} + +static size_t +asym_getRemoteBlockSize_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len; +} + +static size_t +asym_getRemotePlainTextBlockSize_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len - UA_SECURITYPOLICY_BASIC128RSA15_RSAPADDING_LEN; +} + +static UA_StatusCode +asym_makeThumbprint_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + if(securityPolicy == NULL || certificate == NULL || thumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_thumbprint_sha1(certificate, thumbprint); +} + +static UA_StatusCode +asymmetricModule_compareCertificateThumbprint_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + if(securityPolicy == NULL || certificateThumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic128Rsa15_PolicyContext *pc = (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + + return UA_STATUSCODE_GOOD; +} + +/*******************/ +/* SymmetricModule */ +/*******************/ + +static UA_StatusCode +sym_verify_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || cc == NULL || message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Compute MAC */ + if(signature->length != UA_SHA1_LENGTH) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Signature size does not have the desired size defined by the security policy"); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + Basic128Rsa15_PolicyContext *pc = + (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + + unsigned char mac[UA_SHA1_LENGTH]; + mbedtls_hmac(&pc->sha1MdContext, &cc->remoteSymSigningKey, message, mac); + + /* Compare with Signature */ + if(!UA_constantTimeEqual(signature->data, mac, UA_SHA1_LENGTH)) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sym_sign_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(signature->length != UA_SHA1_LENGTH) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_hmac(&cc->policyContext->sha1MdContext, &cc->localSymSigningKey, + message, signature->data); + return UA_STATUSCODE_GOOD; +} + +static size_t +sym_getSignatureSize_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA1_LENGTH; +} + +static size_t +sym_getSigningKeyLength_sp_basic128rsa15(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_BASIC128RSA15_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +sym_getEncryptionKeyLength_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_KEY_LENGTH; +} + +static size_t +sym_getEncryptionBlockSize_sp_basic128rsa15(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +sym_getPlainTextBlockSize_sp_basic128rsa15(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC128RSA15_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +sym_encrypt_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(cc->localSymIv.length != + securityPolicy->symmetricModule.cryptoModule.encryptionAlgorithm.getLocalBlockSize(securityPolicy, cc)) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t plainTextBlockSize = + securityPolicy->symmetricModule.cryptoModule.encryptionAlgorithm.getLocalPlainTextBlockSize(securityPolicy, cc); + + if(data->length % plainTextBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to encrypt is not a multiple of the plain text block size." + "Padding might not have been calculated appropriately."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Keylength in bits */ + unsigned int keylength = (unsigned int)(cc->localSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_enc(&aesContext, cc->localSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->localSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_ENCRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_decrypt_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const Basic128Rsa15_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t encryptionBlockSize = securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getRemoteBlockSize(securityPolicy, cc); + + if(cc->remoteSymIv.length != encryptionBlockSize) + return UA_STATUSCODE_BADINTERNALERROR; + + if(data->length % encryptionBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to decrypt is not a multiple of the encryptingBlock size."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + unsigned int keylength = (unsigned int)(cc->remoteSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_dec(&aesContext, cc->remoteSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->remoteSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_DECRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_generateKey_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out) { + if(securityPolicy == NULL || secret == NULL || seed == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic128Rsa15_PolicyContext *pc = + (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + + return mbedtls_generateKey(&pc->sha1MdContext, secret, seed, out); +} + +static UA_StatusCode +sym_generateNonce_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + UA_ByteString *out) { + if(securityPolicy == NULL || securityPolicy->policyContext == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic128Rsa15_PolicyContext *pc = + (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + + int mbedErr = mbedtls_ctr_drbg_random(&pc->drbgContext, out->data, out->length); + if(mbedErr) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* ChannelModule */ +/*****************/ + +/* Assumes that the certificate has been verified externally */ +static UA_StatusCode +parseRemoteCertificate_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *remoteCertificate) { + if(remoteCertificate == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Parse the certificate */ + int mbedErr = mbedtls_x509_crt_parse(&cc->remoteCertificate, remoteCertificate->data, + remoteCertificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Check the key length */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + if(rsaContext->len < UA_SECURITYPOLICY_BASIC128RSA15_MINASYMKEYLENGTH || + rsaContext->len > UA_SECURITYPOLICY_BASIC128RSA15_MAXASYMKEYLENGTH) + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + + return UA_STATUSCODE_GOOD; +} + +static void +channelContext_deleteContext_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc) { + UA_ByteString_clear(&cc->localSymSigningKey); + UA_ByteString_clear(&cc->localSymEncryptingKey); + UA_ByteString_clear(&cc->localSymIv); + + UA_ByteString_clear(&cc->remoteSymSigningKey); + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + UA_ByteString_clear(&cc->remoteSymIv); + + mbedtls_x509_crt_free(&cc->remoteCertificate); + + UA_free(cc); +} + +static UA_StatusCode +channelContext_newContext_sp_basic128rsa15(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **pp_contextData) { + if(securityPolicy == NULL || remoteCertificate == NULL || pp_contextData == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the channel context */ + *pp_contextData = UA_malloc(sizeof(Basic128Rsa15_ChannelContext)); + if(*pp_contextData == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + + Basic128Rsa15_ChannelContext *cc = (Basic128Rsa15_ChannelContext *)*pp_contextData; + + /* Initialize the channel context */ + cc->policyContext = (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + + UA_ByteString_init(&cc->localSymSigningKey); + UA_ByteString_init(&cc->localSymEncryptingKey); + UA_ByteString_init(&cc->localSymIv); + + UA_ByteString_init(&cc->remoteSymSigningKey); + UA_ByteString_init(&cc->remoteSymEncryptingKey); + UA_ByteString_init(&cc->remoteSymIv); + + mbedtls_x509_crt_init(&cc->remoteCertificate); + + // TODO: this can be optimized so that we dont allocate memory before parsing the certificate + UA_StatusCode retval = parseRemoteCertificate_sp_basic128rsa15(cc, remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) { + channelContext_deleteContext_sp_basic128rsa15(cc); + *pp_contextData = NULL; + } + return retval; +} + +static UA_StatusCode +channelContext_setLocalSymEncryptingKey_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setLocalSymSigningKey_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + + +static UA_StatusCode +channelContext_setLocalSymIv_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +channelContext_setRemoteSymEncryptingKey_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setRemoteSymSigningKey_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +channelContext_setRemoteSymIv_sp_basic128rsa15(Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(iv, &cc->remoteSymIv); +} + +static UA_StatusCode +channelContext_compareCertificate_sp_basic128rsa15(const Basic128Rsa15_ChannelContext *cc, + const UA_ByteString *certificate) { + if(cc == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_x509_crt cert; + mbedtls_x509_crt_init(&cert); + int mbedErr = mbedtls_x509_crt_parse(&cert, certificate->data, certificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(cert.raw.len != cc->remoteCertificate.raw.len || + memcmp(cert.raw.p, cc->remoteCertificate.raw.p, cert.raw.len) != 0) + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + mbedtls_x509_crt_free(&cert); + return retval; +} + +static void +clear_sp_basic128rsa15(UA_SecurityPolicy *securityPolicy) { + if(securityPolicy == NULL) + return; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + if(securityPolicy->policyContext == NULL) + return; + + /* delete all allocated members in the context */ + Basic128Rsa15_PolicyContext *pc = (Basic128Rsa15_PolicyContext *) + securityPolicy->policyContext; + + mbedtls_ctr_drbg_free(&pc->drbgContext); + mbedtls_entropy_free(&pc->entropyContext); + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_md_free(&pc->sha1MdContext); + UA_ByteString_clear(&pc->localCertThumbprint); + + UA_LOG_DEBUG(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Deleted members of EndpointContext for sp_basic128rsa15"); + + UA_free(pc); + securityPolicy->policyContext = NULL; +} + +static UA_StatusCode +updateCertificateAndPrivateKey_sp_basic128rsa15(UA_SecurityPolicy *securityPolicy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey) { + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(securityPolicy->policyContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic128Rsa15_PolicyContext *pc = (Basic128Rsa15_PolicyContext *)securityPolicy->policyContext; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&newCertificate, &securityPolicy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the new private key */ + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_pk_init(&pc->localPrivateKey); + int mbedErr = UA_mbedTLS_LoadPrivateKey(&newPrivateKey, &pc->localPrivateKey); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + retval = asym_makeThumbprint_sp_basic128rsa15(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return retval; + + error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not update certificate and private key"); + if(securityPolicy->policyContext != NULL) + clear_sp_basic128rsa15(securityPolicy); + return retval; +} + +static UA_StatusCode +policyContext_newContext_sp_basic128rsa15(UA_SecurityPolicy *securityPolicy, + const UA_ByteString localPrivateKey) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if (localPrivateKey.length == 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Can not initialize security policy. Private key is empty."); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Basic128Rsa15_PolicyContext *pc = (Basic128Rsa15_PolicyContext *) + UA_malloc(sizeof(Basic128Rsa15_PolicyContext)); + securityPolicy->policyContext = (void *)pc; + if(!pc) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Initialize the PolicyContext */ + memset(pc, 0, sizeof(Basic128Rsa15_PolicyContext)); + mbedtls_ctr_drbg_init(&pc->drbgContext); + mbedtls_entropy_init(&pc->entropyContext); + mbedtls_pk_init(&pc->localPrivateKey); + mbedtls_md_init(&pc->sha1MdContext); + + /* Initialized the message digest */ + const mbedtls_md_info_t *const mdInfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); + int mbedErr = mbedtls_md_setup(&pc->sha1MdContext, mdInfo, MBEDTLS_MD_SHA1); + if(mbedErr) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Add the system entropy source */ + mbedErr = mbedtls_entropy_add_source(&pc->entropyContext, + MBEDTLS_ENTROPY_POLL_METHOD, NULL, 0, + MBEDTLS_ENTROPY_SOURCE_STRONG); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Seed the RNG */ + char *personalization = "open62541-drbg"; + mbedErr = mbedtls_ctr_drbg_seed(&pc->drbgContext, mbedtls_entropy_func, + &pc->entropyContext, + (const unsigned char *)personalization, 14); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the private key */ + mbedErr = UA_mbedTLS_LoadPrivateKey(&localPrivateKey, &pc->localPrivateKey); + + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the local certificate thumbprint */ + retval = UA_ByteString_allocBuffer(&pc->localCertThumbprint, UA_SHA1_LENGTH); + if(retval != UA_STATUSCODE_GOOD) + goto error; + retval = asym_makeThumbprint_sp_basic128rsa15(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return UA_STATUSCODE_GOOD; + +error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not create securityContext: %s", UA_StatusCode_name(retval)); + if(securityPolicy->policyContext != NULL) + clear_sp_basic128rsa15(securityPolicy); + return retval; +} + +UA_StatusCode +UA_SecurityPolicy_Basic128Rsa15(UA_SecurityPolicy *policy, const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, const UA_Logger *logger) { + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15\0"); + + UA_SecurityPolicyAsymmetricModule *const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule *const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule *const channelModule = &policy->channelModule; + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule */ + UA_SecurityPolicySignatureAlgorithm *asym_signatureAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#rsa-sha1\0"); + asym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, const UA_ByteString *))asym_verify_sp_basic128rsa15; + asym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))asym_sign_sp_basic128rsa15; + asym_signatureAlgorithm->getLocalSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalSignatureSize_sp_basic128rsa15; + asym_signatureAlgorithm->getRemoteSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteSignatureSize_sp_basic128rsa15; + asym_signatureAlgorithm->getLocalKeyLength = NULL; // TODO: Write function + asym_signatureAlgorithm->getRemoteKeyLength = NULL; // TODO: Write function + + UA_SecurityPolicyEncryptionAlgorithm *asym_encryptionAlgorithm = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-1_5"); + asym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))asym_encrypt_sp_basic128rsa15; + asym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *)) + asym_decrypt_sp_basic128rsa15; + asym_encryptionAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalEncryptionKeyLength_sp_basic128rsa15; + asym_encryptionAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteEncryptionKeyLength_sp_basic128rsa15; + asym_encryptionAlgorithm->getLocalBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemoteBlockSize = (size_t (*)(const UA_SecurityPolicy *, + const void *))asym_getRemoteBlockSize_sp_basic128rsa15; + asym_encryptionAlgorithm->getLocalPlainTextBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemotePlainTextBlockSize_sp_basic128rsa15; + + asymmetricModule->makeCertificateThumbprint = asym_makeThumbprint_sp_basic128rsa15; + asymmetricModule->compareCertificateThumbprint = + asymmetricModule_compareCertificateThumbprint_sp_basic128rsa15; + + /* SymmetricModule */ + symmetricModule->generateKey = sym_generateKey_sp_basic128rsa15; + symmetricModule->generateNonce = sym_generateNonce_sp_basic128rsa15; + + UA_SecurityPolicySignatureAlgorithm *sym_signatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + sym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + sym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, const UA_ByteString *, + const UA_ByteString *))sym_verify_sp_basic128rsa15; + sym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))sym_sign_sp_basic128rsa15; + sym_signatureAlgorithm->getLocalSignatureSize = sym_getSignatureSize_sp_basic128rsa15; + sym_signatureAlgorithm->getRemoteSignatureSize = sym_getSignatureSize_sp_basic128rsa15; + sym_signatureAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic128rsa15; + sym_signatureAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic128rsa15; + + UA_SecurityPolicyEncryptionAlgorithm *sym_encryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + sym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes128-cbc"); + sym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_encrypt_sp_basic128rsa15; + sym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_decrypt_sp_basic128rsa15; + sym_encryptionAlgorithm->getLocalKeyLength = sym_getEncryptionKeyLength_sp_basic128rsa15; + sym_encryptionAlgorithm->getRemoteKeyLength = sym_getEncryptionKeyLength_sp_basic128rsa15; + sym_encryptionAlgorithm->getLocalBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic128rsa15; + sym_encryptionAlgorithm->getRemoteBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic128rsa15; + sym_encryptionAlgorithm->getLocalPlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic128rsa15; + sym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic128rsa15; + symmetricModule->secureChannelNonceLength = 16; + + // Use the same signature algorithm as the asymmetric component for certificate signing (see standard) + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + /* ChannelModule */ + channelModule->newContext = channelContext_newContext_sp_basic128rsa15; + channelModule->deleteContext = (void (*)(void *)) + channelContext_deleteContext_sp_basic128rsa15; + + channelModule->setLocalSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymEncryptingKey_sp_basic128rsa15; + channelModule->setLocalSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymSigningKey_sp_basic128rsa15; + channelModule->setLocalSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymIv_sp_basic128rsa15; + + channelModule->setRemoteSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymEncryptingKey_sp_basic128rsa15; + channelModule->setRemoteSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymSigningKey_sp_basic128rsa15; + channelModule->setRemoteSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymIv_sp_basic128rsa15; + + channelModule->compareCertificate = (UA_StatusCode (*)(const void *, const UA_ByteString *)) + channelContext_compareCertificate_sp_basic128rsa15; + + policy->updateCertificateAndPrivateKey = updateCertificateAndPrivateKey_sp_basic128rsa15; + policy->clear = clear_sp_basic128rsa15; + + UA_StatusCode res = policyContext_newContext_sp_basic128rsa15(policy, localPrivateKey); + if(res != UA_STATUSCODE_GOOD) + clear_sp_basic128rsa15(policy); + + return res; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/ua_securitypolicy_basic256.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + * + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + + +#include <mbedtls/aes.h> +#include <mbedtls/entropy.h> +#include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> +#include <mbedtls/sha1.h> +#include <mbedtls/version.h> + +/* Notes: + * mbedTLS' AES allows in-place encryption and decryption. Sow we don't have to + * allocate temp buffers. + * https://tls.mbed.org/discussions/generic/in-place-decryption-with-aes256-same-input-output-buffer + */ + +#define UA_SECURITYPOLICY_BASIC256SHA1_RSAPADDING_LEN 42 +#define UA_SHA1_LENGTH 20 +#define UA_BASIC256_SYM_SIGNING_KEY_LENGTH 24 +#define UA_SECURITYPOLICY_BASIC256_SYM_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256_MINASYMKEYLENGTH 128 +#define UA_SECURITYPOLICY_BASIC256_MAXASYMKEYLENGTH 512 + +typedef struct { + UA_ByteString localCertThumbprint; + + mbedtls_ctr_drbg_context drbgContext; + mbedtls_entropy_context entropyContext; + mbedtls_md_context_t sha1MdContext; + mbedtls_pk_context localPrivateKey; +} Basic256_PolicyContext; + +typedef struct { + Basic256_PolicyContext *policyContext; + + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + mbedtls_x509_crt remoteCertificate; +} Basic256_ChannelContext; + +/********************/ +/* AsymmetricModule */ +/********************/ + +/* VERIFY AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_verify_sp_basic256(const UA_SecurityPolicy *securityPolicy, + Basic256_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + return mbedtls_verifySig_sha1(&cc->remoteCertificate, message, signature); +} + +/* AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_sign_sp_basic256(const UA_SecurityPolicy *securityPolicy, + Basic256_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256_PolicyContext *pc = cc->policyContext; + return mbedtls_sign_sha1(&pc->localPrivateKey, &pc->drbgContext, + message, signature); +} + +static size_t +asym_getLocalSignatureSize_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + return mbedtls_pk_rsa(cc->policyContext->localPrivateKey)->len; +} + +static size_t +asym_getRemoteSignatureSize_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + return mbedtls_pk_rsa(cc->remoteCertificate.pk)->len; +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_encrypt_sp_basic256(const UA_SecurityPolicy *securityPolicy, + Basic256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const size_t plainTextBlockSize = securityPolicy->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemotePlainTextBlockSize(securityPolicy, cc); + + mbedtls_rsa_context *remoteRsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(remoteRsaContext, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1); + + return mbedtls_encrypt_rsaOaep(remoteRsaContext, &cc->policyContext->drbgContext, + data, plainTextBlockSize); +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_decrypt_sp_basic256(const UA_SecurityPolicy *securityPolicy, + Basic256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_decrypt_rsaOaep(&cc->policyContext->localPrivateKey, + &cc->policyContext->drbgContext, data); +} + +static size_t +asym_getLocalEncryptionKeyLength_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->policyContext->localPrivateKey) * 8; +} + +static size_t +asym_getRemoteEncryptionKeyLength_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->remoteCertificate.pk) * 8; +} + +static size_t +asym_getRemoteBlockSize_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len; +} + +static size_t +asym_getRemotePlainTextBlockSize_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len - UA_SECURITYPOLICY_BASIC256SHA1_RSAPADDING_LEN; +} + +static UA_StatusCode +asym_makeThumbprint_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + if(securityPolicy == NULL || certificate == NULL || thumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_thumbprint_sha1(certificate, thumbprint); +} + +static UA_StatusCode +asymmetricModule_compareCertificateThumbprint_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + if(securityPolicy == NULL || certificateThumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256_PolicyContext *pc = (Basic256_PolicyContext *)securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + + return UA_STATUSCODE_GOOD; +} + +/*******************/ +/* SymmetricModule */ +/*******************/ + +static UA_StatusCode +sym_verify_sp_basic256(const UA_SecurityPolicy *securityPolicy, + Basic256_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || cc == NULL || message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Compute MAC */ + if(signature->length != UA_SHA1_LENGTH) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Signature size does not have the desired size defined by the security policy"); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + Basic256_PolicyContext *pc = + (Basic256_PolicyContext *)securityPolicy->policyContext; + + unsigned char mac[UA_SHA1_LENGTH]; + mbedtls_hmac(&pc->sha1MdContext, &cc->remoteSymSigningKey, message, mac); + + /* Compare with Signature */ + if(!UA_constantTimeEqual(signature->data, mac, UA_SHA1_LENGTH)) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sym_sign_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(signature->length != UA_SHA1_LENGTH) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_hmac(&cc->policyContext->sha1MdContext, &cc->localSymSigningKey, + message, signature->data); + return UA_STATUSCODE_GOOD; +} + +static size_t +sym_getSignatureSize_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA1_LENGTH; +} + +static size_t +sym_getSigningKeyLength_sp_basic256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_BASIC256_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +sym_getEncryptionKeyLength_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_KEY_LENGTH; +} + +static size_t +sym_getEncryptionBlockSize_sp_basic256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +sym_getPlainTextBlockSize_sp_basic256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC256_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +sym_encrypt_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(cc->localSymIv.length != + securityPolicy->symmetricModule.cryptoModule.encryptionAlgorithm. + getLocalBlockSize(securityPolicy, cc)) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t plainTextBlockSize = + securityPolicy->symmetricModule.cryptoModule.encryptionAlgorithm. + getLocalPlainTextBlockSize(securityPolicy, cc); + + if(data->length % plainTextBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to encrypt is not a multiple of the plain text block size." + "Padding might not have been calculated appropriately."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Keylength in bits */ + unsigned int keylength = (unsigned int)(cc->localSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_enc(&aesContext, cc->localSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->localSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_ENCRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_decrypt_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const Basic256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t encryptionBlockSize = + securityPolicy->symmetricModule.cryptoModule.encryptionAlgorithm. + getRemoteBlockSize(securityPolicy, cc); + + if(cc->remoteSymIv.length != encryptionBlockSize) + return UA_STATUSCODE_BADINTERNALERROR; + + if(data->length % encryptionBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to decrypt is not a multiple of the encryptingBlock size."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + unsigned int keylength = (unsigned int)(cc->remoteSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_dec(&aesContext, cc->remoteSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->remoteSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_DECRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_generateKey_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out) { + if(securityPolicy == NULL || secret == NULL || seed == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256_PolicyContext *pc = + (Basic256_PolicyContext *)securityPolicy->policyContext; + + return mbedtls_generateKey(&pc->sha1MdContext, secret, seed, out); +} + +static UA_StatusCode +sym_generateNonce_sp_basic256(const UA_SecurityPolicy *securityPolicy, + UA_ByteString *out) { + if(securityPolicy == NULL || securityPolicy->policyContext == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256_PolicyContext *pc = + (Basic256_PolicyContext *)securityPolicy->policyContext; + + int mbedErr = mbedtls_ctr_drbg_random(&pc->drbgContext, out->data, out->length); + if(mbedErr) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* ChannelModule */ +/*****************/ + +/* Assumes that the certificate has been verified externally */ +static UA_StatusCode +parseRemoteCertificate_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *remoteCertificate) { + if(remoteCertificate == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Parse the certificate */ + int mbedErr = mbedtls_x509_crt_parse(&cc->remoteCertificate, remoteCertificate->data, + remoteCertificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Check the key length */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + if(rsaContext->len < UA_SECURITYPOLICY_BASIC256_MINASYMKEYLENGTH || + rsaContext->len > UA_SECURITYPOLICY_BASIC256_MAXASYMKEYLENGTH) + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + + return UA_STATUSCODE_GOOD; +} + +static void +channelContext_deleteContext_sp_basic256(Basic256_ChannelContext *cc) { + UA_ByteString_clear(&cc->localSymSigningKey); + UA_ByteString_clear(&cc->localSymEncryptingKey); + UA_ByteString_clear(&cc->localSymIv); + + UA_ByteString_clear(&cc->remoteSymSigningKey); + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + UA_ByteString_clear(&cc->remoteSymIv); + + mbedtls_x509_crt_free(&cc->remoteCertificate); + + UA_free(cc); +} + +static UA_StatusCode +channelContext_newContext_sp_basic256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **pp_contextData) { + if(securityPolicy == NULL || remoteCertificate == NULL || pp_contextData == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the channel context */ + *pp_contextData = UA_malloc(sizeof(Basic256_ChannelContext)); + if(*pp_contextData == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + + Basic256_ChannelContext *cc = (Basic256_ChannelContext *)*pp_contextData; + + /* Initialize the channel context */ + cc->policyContext = (Basic256_PolicyContext *)securityPolicy->policyContext; + + UA_ByteString_init(&cc->localSymSigningKey); + UA_ByteString_init(&cc->localSymEncryptingKey); + UA_ByteString_init(&cc->localSymIv); + + UA_ByteString_init(&cc->remoteSymSigningKey); + UA_ByteString_init(&cc->remoteSymEncryptingKey); + UA_ByteString_init(&cc->remoteSymIv); + + mbedtls_x509_crt_init(&cc->remoteCertificate); + + // TODO: this can be optimized so that we dont allocate memory before parsing the certificate + UA_StatusCode retval = parseRemoteCertificate_sp_basic256(cc, remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) { + channelContext_deleteContext_sp_basic256(cc); + *pp_contextData = NULL; + } + return retval; +} + +static UA_StatusCode +channelContext_setLocalSymEncryptingKey_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setLocalSymSigningKey_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + + +static UA_StatusCode +channelContext_setLocalSymIv_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +channelContext_setRemoteSymEncryptingKey_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setRemoteSymSigningKey_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +channelContext_setRemoteSymIv_sp_basic256(Basic256_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(iv, &cc->remoteSymIv); +} + +static UA_StatusCode +channelContext_compareCertificate_sp_basic256(const Basic256_ChannelContext *cc, + const UA_ByteString *certificate) { + if(cc == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_x509_crt cert; + mbedtls_x509_crt_init(&cert); + int mbedErr = mbedtls_x509_crt_parse(&cert, certificate->data, certificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(cert.raw.len != cc->remoteCertificate.raw.len || + memcmp(cert.raw.p, cc->remoteCertificate.raw.p, cert.raw.len) != 0) + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + mbedtls_x509_crt_free(&cert); + return retval; +} + +static void +clear_sp_basic256(UA_SecurityPolicy *securityPolicy) { + if(securityPolicy == NULL) + return; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + if(securityPolicy->policyContext == NULL) + return; + + /* delete all allocated members in the context */ + Basic256_PolicyContext *pc = (Basic256_PolicyContext *) + securityPolicy->policyContext; + + mbedtls_ctr_drbg_free(&pc->drbgContext); + mbedtls_entropy_free(&pc->entropyContext); + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_md_free(&pc->sha1MdContext); + UA_ByteString_clear(&pc->localCertThumbprint); + + UA_LOG_DEBUG(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Deleted members of EndpointContext for sp_basic256"); + + UA_free(pc); + securityPolicy->policyContext = NULL; +} + +static UA_StatusCode +updateCertificateAndPrivateKey_sp_basic256(UA_SecurityPolicy *securityPolicy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey) { + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(securityPolicy->policyContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256_PolicyContext *pc = (Basic256_PolicyContext *) + securityPolicy->policyContext; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&newCertificate, &securityPolicy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the new private key */ + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_pk_init(&pc->localPrivateKey); + + int mbedErr = UA_mbedTLS_LoadPrivateKey(&newPrivateKey, &pc->localPrivateKey); + + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + retval = asym_makeThumbprint_sp_basic256(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return retval; + + error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not update certificate and private key"); + if(securityPolicy->policyContext != NULL) + clear_sp_basic256(securityPolicy); + return retval; +} + +static UA_StatusCode +policyContext_newContext_sp_basic256(UA_SecurityPolicy *securityPolicy, + const UA_ByteString localPrivateKey) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if (localPrivateKey.length == 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Can not initialize security policy. Private key is empty."); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Basic256_PolicyContext *pc = (Basic256_PolicyContext *) + UA_malloc(sizeof(Basic256_PolicyContext)); + securityPolicy->policyContext = (void *)pc; + if(!pc) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Initialize the PolicyContext */ + memset(pc, 0, sizeof(Basic256_PolicyContext)); + mbedtls_ctr_drbg_init(&pc->drbgContext); + mbedtls_entropy_init(&pc->entropyContext); + mbedtls_pk_init(&pc->localPrivateKey); + mbedtls_md_init(&pc->sha1MdContext); + + /* Initialized the message digest */ + const mbedtls_md_info_t *mdInfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); + int mbedErr = mbedtls_md_setup(&pc->sha1MdContext, mdInfo, MBEDTLS_MD_SHA1); + if(mbedErr) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Add the system entropy source */ + mbedErr = mbedtls_entropy_add_source(&pc->entropyContext, + MBEDTLS_ENTROPY_POLL_METHOD, NULL, 0, + MBEDTLS_ENTROPY_SOURCE_STRONG); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Seed the RNG */ + char *personalization = "open62541-drbg"; + mbedErr = mbedtls_ctr_drbg_seed(&pc->drbgContext, mbedtls_entropy_func, + &pc->entropyContext, + (const unsigned char *)personalization, 14); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the private key */ + mbedErr = UA_mbedTLS_LoadPrivateKey(&localPrivateKey, &pc->localPrivateKey); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the local certificate thumbprint */ + retval = UA_ByteString_allocBuffer(&pc->localCertThumbprint, UA_SHA1_LENGTH); + if(retval != UA_STATUSCODE_GOOD) + goto error; + retval = asym_makeThumbprint_sp_basic256(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return UA_STATUSCODE_GOOD; + +error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not create securityContext: %s", UA_StatusCode_name(retval)); + if(securityPolicy->policyContext != NULL) + clear_sp_basic256(securityPolicy); + return retval; +} + +UA_StatusCode +UA_SecurityPolicy_Basic256(UA_SecurityPolicy *policy, const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, const UA_Logger *logger) { + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic256\0"); + + UA_SecurityPolicyAsymmetricModule *const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule *const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule *const channelModule = &policy->channelModule; + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule */ + UA_SecurityPolicySignatureAlgorithm *asym_signatureAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#rsa-sha1\0"); + asym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, const UA_ByteString *))asym_verify_sp_basic256; + asym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))asym_sign_sp_basic256; + asym_signatureAlgorithm->getLocalSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalSignatureSize_sp_basic256; + asym_signatureAlgorithm->getRemoteSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteSignatureSize_sp_basic256; + asym_signatureAlgorithm->getLocalKeyLength = NULL; // TODO: Write function + asym_signatureAlgorithm->getRemoteKeyLength = NULL; // TODO: Write function + + UA_SecurityPolicyEncryptionAlgorithm *asym_encryptionAlgorithm = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))asym_encrypt_sp_basic256; + asym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *)) + asym_decrypt_sp_basic256; + asym_encryptionAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalEncryptionKeyLength_sp_basic256; + asym_encryptionAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteEncryptionKeyLength_sp_basic256; + asym_encryptionAlgorithm->getLocalBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemoteBlockSize = (size_t (*)(const UA_SecurityPolicy *, + const void *))asym_getRemoteBlockSize_sp_basic256; + asym_encryptionAlgorithm->getLocalPlainTextBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemotePlainTextBlockSize_sp_basic256; + + asymmetricModule->makeCertificateThumbprint = asym_makeThumbprint_sp_basic256; + asymmetricModule->compareCertificateThumbprint = + asymmetricModule_compareCertificateThumbprint_sp_basic256; + + /* SymmetricModule */ + symmetricModule->generateKey = sym_generateKey_sp_basic256; + symmetricModule->generateNonce = sym_generateNonce_sp_basic256; + + UA_SecurityPolicySignatureAlgorithm *sym_signatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + sym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + sym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, const UA_ByteString *, + const UA_ByteString *))sym_verify_sp_basic256; + sym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))sym_sign_sp_basic256; + sym_signatureAlgorithm->getLocalSignatureSize = sym_getSignatureSize_sp_basic256; + sym_signatureAlgorithm->getRemoteSignatureSize = sym_getSignatureSize_sp_basic256; + sym_signatureAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic256; + sym_signatureAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic256; + + UA_SecurityPolicyEncryptionAlgorithm *sym_encryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + sym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes256-cbc\0"); + sym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_encrypt_sp_basic256; + sym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_decrypt_sp_basic256; + sym_encryptionAlgorithm->getLocalKeyLength = sym_getEncryptionKeyLength_sp_basic256; + sym_encryptionAlgorithm->getRemoteKeyLength = sym_getEncryptionKeyLength_sp_basic256; + sym_encryptionAlgorithm->getLocalBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic256; + sym_encryptionAlgorithm->getRemoteBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic256; + sym_encryptionAlgorithm->getLocalPlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic256; + sym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic256; + symmetricModule->secureChannelNonceLength = 32; + + // Use the same signature algorithm as the asymmetric component for certificate signing (see standard) + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + /* ChannelModule */ + channelModule->newContext = channelContext_newContext_sp_basic256; + channelModule->deleteContext = (void (*)(void *)) + channelContext_deleteContext_sp_basic256; + + channelModule->setLocalSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymEncryptingKey_sp_basic256; + channelModule->setLocalSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymSigningKey_sp_basic256; + channelModule->setLocalSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymIv_sp_basic256; + + channelModule->setRemoteSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymEncryptingKey_sp_basic256; + channelModule->setRemoteSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymSigningKey_sp_basic256; + channelModule->setRemoteSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymIv_sp_basic256; + + channelModule->compareCertificate = (UA_StatusCode (*)(const void *, const UA_ByteString *)) + channelContext_compareCertificate_sp_basic256; + + policy->updateCertificateAndPrivateKey = updateCertificateAndPrivateKey_sp_basic256; + policy->clear = clear_sp_basic256; + + UA_StatusCode res = policyContext_newContext_sp_basic256(policy, localPrivateKey); + if(res != UA_STATUSCODE_GOOD) + clear_sp_basic256(policy); + + return res; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/ua_securitypolicy_basic256sha256.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG + * Copyright 2018 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Wind River Systems, Inc. + * Copyright 2020 (c) basysKom GmbH + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + + +#include <mbedtls/aes.h> +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/entropy.h> +#include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> +#include <mbedtls/md.h> +#include <mbedtls/sha1.h> +#include <mbedtls/sha256.h> +#include <mbedtls/version.h> +#include <mbedtls/x509_crt.h> + +/* Notes: + * mbedTLS' AES allows in-place encryption and decryption. Sow we don't have to + * allocate temp buffers. + * https://tls.mbed.org/discussions/generic/in-place-decryption-with-aes256-same-input-output-buffer + */ + +#define UA_SECURITYPOLICY_BASIC256SHA256_RSAPADDING_LEN 42 +#define UA_SHA1_LENGTH 20 +#define UA_SHA256_LENGTH 32 +#define UA_BASIC256SHA256_SYM_SIGNING_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256SHA256_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_BASIC256SHA256_MINASYMKEYLENGTH 256 +#define UA_SECURITYPOLICY_BASIC256SHA256_MAXASYMKEYLENGTH 512 + +typedef struct { + UA_ByteString localCertThumbprint; + + mbedtls_ctr_drbg_context drbgContext; + mbedtls_entropy_context entropyContext; + mbedtls_md_context_t sha256MdContext; + mbedtls_pk_context localPrivateKey; +} Basic256Sha256_PolicyContext; + +typedef struct { + Basic256Sha256_PolicyContext *policyContext; + + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + mbedtls_x509_crt remoteCertificate; +} Basic256Sha256_ChannelContext; + +/********************/ +/* AsymmetricModule */ +/********************/ + +/* VERIFY AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_verify_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + Basic256Sha256_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + unsigned char hash[UA_SHA256_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + // TODO check return status + mbedtls_sha256_ret(message->data, message->length, hash, 0); +#else + mbedtls_sha256(message->data, message->length, hash, 0); +#endif + + /* Set the RSA settings */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_SHA256); + + /* For RSA keys, the default padding type is PKCS#1 v1.5 in mbedtls_pk_verify() */ + /* Alternatively, use more specific function mbedtls_rsa_rsassa_pkcs1_v15_verify(), i.e. */ + /* int mbedErr = mbedtls_rsa_rsassa_pkcs1_v15_verify(rsaContext, NULL, NULL, + MBEDTLS_RSA_PUBLIC, MBEDTLS_MD_SHA256, + UA_SHA256_LENGTH, hash, + signature->data); */ + int mbedErr = mbedtls_pk_verify(&cc->remoteCertificate.pk, + MBEDTLS_MD_SHA256, hash, UA_SHA256_LENGTH, + signature->data, signature->length); + + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +/* AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_sign_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + Basic256Sha256_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + unsigned char hash[UA_SHA256_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + // TODO check return status + mbedtls_sha256_ret(message->data, message->length, hash, 0); +#else + mbedtls_sha256(message->data, message->length, hash, 0); +#endif + + Basic256Sha256_PolicyContext *pc = cc->policyContext; + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(pc->localPrivateKey); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_SHA256); + + size_t sigLen = 0; + + /* For RSA keys, the default padding type is PKCS#1 v1.5 in mbedtls_pk_sign */ + /* Alternatively use more specific function mbedtls_rsa_rsassa_pkcs1_v15_sign() */ + int mbedErr = mbedtls_pk_sign(&pc->localPrivateKey, + MBEDTLS_MD_SHA256, hash, + UA_SHA256_LENGTH, signature->data, + &sigLen, mbedtls_ctr_drbg_random, + &pc->drbgContext); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +static size_t +asym_getLocalSignatureSize_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->policyContext->localPrivateKey)->len; +} + +static size_t +asym_getRemoteSignatureSize_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->remoteCertificate.pk)->len; +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_encrypt_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + Basic256Sha256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const size_t plainTextBlockSize = securityPolicy->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemotePlainTextBlockSize(securityPolicy, cc); + + mbedtls_rsa_context *remoteRsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(remoteRsaContext, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1); + + return mbedtls_encrypt_rsaOaep(remoteRsaContext, &cc->policyContext->drbgContext, + data, plainTextBlockSize); +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_decrypt_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + Basic256Sha256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_decrypt_rsaOaep(&cc->policyContext->localPrivateKey, + &cc->policyContext->drbgContext, data); +} + +static size_t +asym_getLocalEncryptionKeyLength_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->policyContext->localPrivateKey) * 8; +} + +static size_t +asym_getRemoteEncryptionKeyLength_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->remoteCertificate.pk) * 8; +} + +static size_t +asym_getRemoteBlockSize_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len; +} + +static size_t +asym_getRemotePlainTextBlockSize_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len - UA_SECURITYPOLICY_BASIC256SHA256_RSAPADDING_LEN; +} + +static UA_StatusCode +asym_makeThumbprint_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + if(securityPolicy == NULL || certificate == NULL || thumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_thumbprint_sha1(certificate, thumbprint); +} + +static UA_StatusCode +asymmetricModule_compareCertificateThumbprint_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + if(securityPolicy == NULL || certificateThumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256Sha256_PolicyContext *pc = (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + + return UA_STATUSCODE_GOOD; +} + +/*******************/ +/* SymmetricModule */ +/*******************/ + +static UA_StatusCode +sym_verify_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + Basic256Sha256_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || cc == NULL || message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Compute MAC */ + if(signature->length != UA_SHA256_LENGTH) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Signature size does not have the desired size defined by the security policy"); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + Basic256Sha256_PolicyContext *pc = + (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; + + unsigned char mac[UA_SHA256_LENGTH]; + mbedtls_hmac(&pc->sha256MdContext, &cc->remoteSymSigningKey, message, mac); + + /* Compare with Signature */ + if(!UA_constantTimeEqual(signature->data, mac, UA_SHA256_LENGTH)) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sym_sign_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(signature->length != UA_SHA256_LENGTH) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_hmac(&cc->policyContext->sha256MdContext, &cc->localSymSigningKey, + message, signature->data); + return UA_STATUSCODE_GOOD; +} + +static size_t +sym_getSignatureSize_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA256_LENGTH; +} + +static size_t +sym_getSigningKeyLength_sp_basic256sha256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_BASIC256SHA256_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +sym_getEncryptionKeyLength_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_KEY_LENGTH; +} + +static size_t +sym_getEncryptionBlockSize_sp_basic256sha256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +sym_getPlainTextBlockSize_sp_basic256sha256(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_BASIC256SHA256_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +sym_encrypt_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(cc->localSymIv.length != securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalBlockSize(securityPolicy, cc)) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t plainTextBlockSize = securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalPlainTextBlockSize(securityPolicy, cc); + + if(data->length % plainTextBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to encrypt is not a multiple of the plain text block size." + "Padding might not have been calculated appropriately."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Keylength in bits */ + unsigned int keylength = (unsigned int)(cc->localSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_enc(&aesContext, cc->localSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->localSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_ENCRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_decrypt_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const Basic256Sha256_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t encryptionBlockSize = securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getRemoteBlockSize(securityPolicy, cc); + + if(cc->remoteSymIv.length != encryptionBlockSize) + return UA_STATUSCODE_BADINTERNALERROR; + + if(data->length % encryptionBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to decrypt is not a multiple of the encryptingBlock size."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + unsigned int keylength = (unsigned int)(cc->remoteSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_dec(&aesContext, cc->remoteSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->remoteSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_DECRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_generateKey_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out) { + if(securityPolicy == NULL || secret == NULL || seed == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256Sha256_PolicyContext *pc = + (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; + + return mbedtls_generateKey(&pc->sha256MdContext, secret, seed, out); +} + +static UA_StatusCode +sym_generateNonce_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + UA_ByteString *out) { + if(securityPolicy == NULL || securityPolicy->policyContext == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256Sha256_PolicyContext *pc = + (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; + int mbedErr = mbedtls_ctr_drbg_random(&pc->drbgContext, out->data, out->length); + if(mbedErr) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* ChannelModule */ +/*****************/ + +/* Assumes that the certificate has been verified externally */ +static UA_StatusCode +parseRemoteCertificate_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *remoteCertificate) { + if(remoteCertificate == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Parse the certificate */ + int mbedErr = mbedtls_x509_crt_parse(&cc->remoteCertificate, remoteCertificate->data, + remoteCertificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Check the key length */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + if(rsaContext->len < UA_SECURITYPOLICY_BASIC256SHA256_MINASYMKEYLENGTH || + rsaContext->len > UA_SECURITYPOLICY_BASIC256SHA256_MAXASYMKEYLENGTH) + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + + return UA_STATUSCODE_GOOD; +} + +static void +channelContext_deleteContext_sp_basic256sha256(Basic256Sha256_ChannelContext *cc) { + UA_ByteString_clear(&cc->localSymSigningKey); + UA_ByteString_clear(&cc->localSymEncryptingKey); + UA_ByteString_clear(&cc->localSymIv); + + UA_ByteString_clear(&cc->remoteSymSigningKey); + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + UA_ByteString_clear(&cc->remoteSymIv); + + mbedtls_x509_crt_free(&cc->remoteCertificate); + + UA_free(cc); +} + +static UA_StatusCode +channelContext_newContext_sp_basic256sha256(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **pp_contextData) { + if(securityPolicy == NULL || remoteCertificate == NULL || pp_contextData == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the channel context */ + *pp_contextData = UA_malloc(sizeof(Basic256Sha256_ChannelContext)); + if(*pp_contextData == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + + Basic256Sha256_ChannelContext *cc = (Basic256Sha256_ChannelContext *)*pp_contextData; + + /* Initialize the channel context */ + cc->policyContext = (Basic256Sha256_PolicyContext *)securityPolicy->policyContext; + + UA_ByteString_init(&cc->localSymSigningKey); + UA_ByteString_init(&cc->localSymEncryptingKey); + UA_ByteString_init(&cc->localSymIv); + + UA_ByteString_init(&cc->remoteSymSigningKey); + UA_ByteString_init(&cc->remoteSymEncryptingKey); + UA_ByteString_init(&cc->remoteSymIv); + + mbedtls_x509_crt_init(&cc->remoteCertificate); + + // TODO: this can be optimized so that we dont allocate memory before parsing the certificate + UA_StatusCode retval = parseRemoteCertificate_sp_basic256sha256(cc, remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) { + channelContext_deleteContext_sp_basic256sha256(cc); + *pp_contextData = NULL; + } + return retval; +} + +static UA_StatusCode +channelContext_setLocalSymEncryptingKey_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setLocalSymSigningKey_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + + +static UA_StatusCode +channelContext_setLocalSymIv_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +channelContext_setRemoteSymEncryptingKey_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setRemoteSymSigningKey_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +channelContext_setRemoteSymIv_sp_basic256sha256(Basic256Sha256_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(iv, &cc->remoteSymIv); +} + +static UA_StatusCode +channelContext_compareCertificate_sp_basic256sha256(const Basic256Sha256_ChannelContext *cc, + const UA_ByteString *certificate) { + if(cc == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_x509_crt cert; + mbedtls_x509_crt_init(&cert); + int mbedErr = mbedtls_x509_crt_parse(&cert, certificate->data, certificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(cert.raw.len != cc->remoteCertificate.raw.len || + memcmp(cert.raw.p, cc->remoteCertificate.raw.p, cert.raw.len) != 0) + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + mbedtls_x509_crt_free(&cert); + return retval; +} + +static void +clear_sp_basic256sha256(UA_SecurityPolicy *securityPolicy) { + if(securityPolicy == NULL) + return; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + if(securityPolicy->policyContext == NULL) + return; + + /* delete all allocated members in the context */ + Basic256Sha256_PolicyContext *pc = (Basic256Sha256_PolicyContext *) + securityPolicy->policyContext; + + mbedtls_ctr_drbg_free(&pc->drbgContext); + mbedtls_entropy_free(&pc->entropyContext); + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_md_free(&pc->sha256MdContext); + UA_ByteString_clear(&pc->localCertThumbprint); + + UA_LOG_DEBUG(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Deleted members of EndpointContext for sp_basic256sha256"); + + UA_free(pc); + securityPolicy->policyContext = NULL; +} + +static UA_StatusCode +updateCertificateAndPrivateKey_sp_basic256sha256(UA_SecurityPolicy *securityPolicy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey) { + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(securityPolicy->policyContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Basic256Sha256_PolicyContext *pc = + (Basic256Sha256_PolicyContext *) securityPolicy->policyContext; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&newCertificate, &securityPolicy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* Set the new private key */ + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_pk_init(&pc->localPrivateKey); + int mbedErr = UA_mbedTLS_LoadPrivateKey(&newPrivateKey, &pc->localPrivateKey); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + retval = asym_makeThumbprint_sp_basic256sha256(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return retval; + + error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not update certificate and private key"); + if(securityPolicy->policyContext != NULL) + clear_sp_basic256sha256(securityPolicy); + return retval; +} + +static UA_StatusCode +policyContext_newContext_sp_basic256sha256(UA_SecurityPolicy *securityPolicy, + const UA_ByteString localPrivateKey) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if (localPrivateKey.length == 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Can not initialize security policy. Private key is empty."); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Basic256Sha256_PolicyContext *pc = (Basic256Sha256_PolicyContext *) + UA_malloc(sizeof(Basic256Sha256_PolicyContext)); + securityPolicy->policyContext = (void *)pc; + if(!pc) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Initialize the PolicyContext */ + memset(pc, 0, sizeof(Basic256Sha256_PolicyContext)); + mbedtls_ctr_drbg_init(&pc->drbgContext); + mbedtls_entropy_init(&pc->entropyContext); + mbedtls_pk_init(&pc->localPrivateKey); + mbedtls_md_init(&pc->sha256MdContext); + + /* Initialized the message digest */ + const mbedtls_md_info_t *const mdInfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + int mbedErr = mbedtls_md_setup(&pc->sha256MdContext, mdInfo, MBEDTLS_MD_SHA256); + if(mbedErr) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Add the system entropy source */ + mbedErr = mbedtls_entropy_add_source(&pc->entropyContext, + MBEDTLS_ENTROPY_POLL_METHOD, NULL, 0, + MBEDTLS_ENTROPY_SOURCE_STRONG); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Seed the RNG */ + char *personalization = "open62541-drbg"; + mbedErr = mbedtls_ctr_drbg_seed(&pc->drbgContext, mbedtls_entropy_func, + &pc->entropyContext, + (const unsigned char *)personalization, 14); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the private key */ + mbedErr = UA_mbedTLS_LoadPrivateKey(&localPrivateKey, &pc->localPrivateKey); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the local certificate thumbprint */ + retval = UA_ByteString_allocBuffer(&pc->localCertThumbprint, UA_SHA1_LENGTH); + if(retval != UA_STATUSCODE_GOOD) + goto error; + retval = asym_makeThumbprint_sp_basic256sha256(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return UA_STATUSCODE_GOOD; + +error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not create securityContext: %s", UA_StatusCode_name(retval)); + if(securityPolicy->policyContext != NULL) + clear_sp_basic256sha256(securityPolicy); + return retval; +} + +UA_StatusCode +UA_SecurityPolicy_Basic256Sha256(UA_SecurityPolicy *policy, const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, const UA_Logger *logger) { + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"); + + UA_SecurityPolicyAsymmetricModule *const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule *const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule *const channelModule = &policy->channelModule; + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule */ + UA_SecurityPolicySignatureAlgorithm *asym_signatureAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\0"); + asym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, const UA_ByteString *))asym_verify_sp_basic256sha256; + asym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))asym_sign_sp_basic256sha256; + asym_signatureAlgorithm->getLocalSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalSignatureSize_sp_basic256sha256; + asym_signatureAlgorithm->getRemoteSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteSignatureSize_sp_basic256sha256; + asym_signatureAlgorithm->getLocalKeyLength = NULL; // TODO: Write function + asym_signatureAlgorithm->getRemoteKeyLength = NULL; // TODO: Write function + + UA_SecurityPolicyEncryptionAlgorithm *asym_encryptionAlgorithm = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))asym_encrypt_sp_basic256sha256; + asym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *)) + asym_decrypt_sp_basic256sha256; + asym_encryptionAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalEncryptionKeyLength_sp_basic256sha256; + asym_encryptionAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteEncryptionKeyLength_sp_basic256sha256; + asym_encryptionAlgorithm->getLocalBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemoteBlockSize = (size_t (*)(const UA_SecurityPolicy *, + const void *))asym_getRemoteBlockSize_sp_basic256sha256; + asym_encryptionAlgorithm->getLocalPlainTextBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemotePlainTextBlockSize_sp_basic256sha256; + + asymmetricModule->makeCertificateThumbprint = asym_makeThumbprint_sp_basic256sha256; + asymmetricModule->compareCertificateThumbprint = + asymmetricModule_compareCertificateThumbprint_sp_basic256sha256; + + /* SymmetricModule */ + symmetricModule->generateKey = sym_generateKey_sp_basic256sha256; + symmetricModule->generateNonce = sym_generateNonce_sp_basic256sha256; + + UA_SecurityPolicySignatureAlgorithm *sym_signatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + sym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + sym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, const UA_ByteString *, + const UA_ByteString *))sym_verify_sp_basic256sha256; + sym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))sym_sign_sp_basic256sha256; + sym_signatureAlgorithm->getLocalSignatureSize = sym_getSignatureSize_sp_basic256sha256; + sym_signatureAlgorithm->getRemoteSignatureSize = sym_getSignatureSize_sp_basic256sha256; + sym_signatureAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic256sha256; + sym_signatureAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_basic256sha256; + + UA_SecurityPolicyEncryptionAlgorithm *sym_encryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + sym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes256-cbc"); + sym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_encrypt_sp_basic256sha256; + sym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_decrypt_sp_basic256sha256; + sym_encryptionAlgorithm->getLocalKeyLength = sym_getEncryptionKeyLength_sp_basic256sha256; + sym_encryptionAlgorithm->getRemoteKeyLength = sym_getEncryptionKeyLength_sp_basic256sha256; + sym_encryptionAlgorithm->getLocalBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic256sha256; + sym_encryptionAlgorithm->getRemoteBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_basic256sha256; + sym_encryptionAlgorithm->getLocalPlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic256sha256; + sym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_basic256sha256; + symmetricModule->secureChannelNonceLength = 32; + + // Use the same signature algorithm as the asymmetric component for certificate signing (see standard) + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + /* ChannelModule */ + channelModule->newContext = channelContext_newContext_sp_basic256sha256; + channelModule->deleteContext = (void (*)(void *)) + channelContext_deleteContext_sp_basic256sha256; + + channelModule->setLocalSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymEncryptingKey_sp_basic256sha256; + channelModule->setLocalSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymSigningKey_sp_basic256sha256; + channelModule->setLocalSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymIv_sp_basic256sha256; + + channelModule->setRemoteSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymEncryptingKey_sp_basic256sha256; + channelModule->setRemoteSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymSigningKey_sp_basic256sha256; + channelModule->setRemoteSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymIv_sp_basic256sha256; + + channelModule->compareCertificate = (UA_StatusCode (*)(const void *, const UA_ByteString *)) + channelContext_compareCertificate_sp_basic256sha256; + + policy->updateCertificateAndPrivateKey = updateCertificateAndPrivateKey_sp_basic256sha256; + policy->clear = clear_sp_basic256sha256; + + UA_StatusCode res = policyContext_newContext_sp_basic256sha256(policy, localPrivateKey); + if(res != UA_STATUSCODE_GOOD) + clear_sp_basic256sha256(policy); + + return res; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/ua_securitypolicy_aes128sha256rsaoaep.c" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG + * Copyright 2018 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Wind River Systems, Inc. + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + + +#include <mbedtls/aes.h> +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/entropy.h> +#include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> +#include <mbedtls/md.h> +#include <mbedtls/sha1.h> +#include <mbedtls/sha256.h> +#include <mbedtls/version.h> +#include <mbedtls/x509_crt.h> + +/* Notes: + * mbedTLS' AES allows in-place encryption and decryption. So we don't have to + * allocate temp buffers. + * https://tls.mbed.org/discussions/generic/in-place-decryption-with-aes256-same-input-output-buffer + */ + +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_RSAPADDING_LEN 42 +#define UA_SHA1_LENGTH 20 +#define UA_SHA256_LENGTH 32 +#define UA_AES128SHA256RSAOAEP_SYM_SIGNING_KEY_LENGTH 32 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_KEY_LENGTH 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_PLAIN_TEXT_BLOCK_SIZE 16 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MINASYMKEYLENGTH 256 +#define UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MAXASYMKEYLENGTH 512 + +typedef struct { + UA_ByteString localCertThumbprint; + + mbedtls_ctr_drbg_context drbgContext; + mbedtls_entropy_context entropyContext; + mbedtls_md_context_t sha256MdContext; + mbedtls_pk_context localPrivateKey; +} Aes128Sha256PsaOaep_PolicyContext; + +typedef struct { + Aes128Sha256PsaOaep_PolicyContext *policyContext; + + UA_ByteString localSymSigningKey; + UA_ByteString localSymEncryptingKey; + UA_ByteString localSymIv; + + UA_ByteString remoteSymSigningKey; + UA_ByteString remoteSymEncryptingKey; + UA_ByteString remoteSymIv; + + mbedtls_x509_crt remoteCertificate; +} Aes128Sha256PsaOaep_ChannelContext; + +/********************/ +/* AsymmetricModule */ +/********************/ + +/* VERIFY AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_verify_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + unsigned char hash[UA_SHA256_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + // TODO check return status + mbedtls_sha256_ret(message->data, message->length, hash, 0); +#else + mbedtls_sha256(message->data, message->length, hash, 0); +#endif + + /* Set the RSA settings */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_SHA256); + + /* For RSA keys, the default padding type is PKCS#1 v1.5 in mbedtls_pk_verify() */ + /* Alternatively, use more specific function mbedtls_rsa_rsassa_pkcs1_v15_verify(), i.e. */ + /* int mbedErr = mbedtls_rsa_rsassa_pkcs1_v15_verify(rsaContext, NULL, NULL, + MBEDTLS_RSA_PUBLIC, MBEDTLS_MD_SHA256, + UA_SHA256_LENGTH, hash, + signature->data); */ + int mbedErr = mbedtls_pk_verify(&cc->remoteCertificate.pk, + MBEDTLS_MD_SHA256, hash, UA_SHA256_LENGTH, + signature->data, signature->length); + + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +/* AsymmetricSignatureAlgorithm_RSA-PKCS15-SHA2-256 */ +static UA_StatusCode +asym_sign_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(securityPolicy == NULL || message == NULL || signature == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + unsigned char hash[UA_SHA256_LENGTH]; +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 + // TODO check return status + mbedtls_sha256_ret(message->data, message->length, hash, 0); +#else + mbedtls_sha256(message->data, message->length, hash, 0); +#endif + + Aes128Sha256PsaOaep_PolicyContext *pc = cc->policyContext; + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(pc->localPrivateKey); + mbedtls_rsa_set_padding(rsaContext, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_SHA256); + + size_t sigLen = 0; + + /* For RSA keys, the default padding type is PKCS#1 v1.5 in mbedtls_pk_sign */ + /* Alternatively use more specific function mbedtls_rsa_rsassa_pkcs1_v15_sign() */ + int mbedErr = mbedtls_pk_sign(&pc->localPrivateKey, + MBEDTLS_MD_SHA256, hash, + UA_SHA256_LENGTH, signature->data, + &sigLen, mbedtls_ctr_drbg_random, + &pc->drbgContext); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +static size_t +asym_getLocalSignatureSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->policyContext->localPrivateKey)->len; +} + +static size_t +asym_getRemoteSignatureSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + if(securityPolicy == NULL || cc == NULL) + return 0; + + return mbedtls_pk_rsa(cc->remoteCertificate.pk)->len; +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_encrypt_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + Aes128Sha256PsaOaep_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + const size_t plainTextBlockSize = securityPolicy->asymmetricModule.cryptoModule. + encryptionAlgorithm.getRemotePlainTextBlockSize(securityPolicy, cc); + + mbedtls_rsa_context *remoteRsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + mbedtls_rsa_set_padding(remoteRsaContext, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1); + + return mbedtls_encrypt_rsaOaep(remoteRsaContext, &cc->policyContext->drbgContext, + data, plainTextBlockSize); +} + +/* AsymmetricEncryptionAlgorithm_RSA-OAEP-SHA1 */ +static UA_StatusCode +asym_decrypt_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + Aes128Sha256PsaOaep_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_decrypt_rsaOaep(&cc->policyContext->localPrivateKey, + &cc->policyContext->drbgContext, data); +} + +static size_t +asym_getLocalEncryptionKeyLength_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->policyContext->localPrivateKey) * 8; +} + +static size_t +asym_getRemoteEncryptionKeyLength_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + return mbedtls_pk_get_len(&cc->remoteCertificate.pk) * 8; +} + +static size_t +asym_getRemoteBlockSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len; +} + +static size_t +asym_getRemotePlainTextBlockSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc) { + mbedtls_rsa_context *const rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + return rsaContext->len - UA_SECURITYPOLICY_AES128SHA256RSAOAEP_RSAPADDING_LEN; +} + +static UA_StatusCode +asym_makeThumbprint_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + if(securityPolicy == NULL || certificate == NULL || thumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + return mbedtls_thumbprint_sha1(certificate, thumbprint); +} + +static UA_StatusCode +asymmetricModule_compareCertificateThumbprint_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + if(securityPolicy == NULL || certificateThumbprint == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Aes128Sha256PsaOaep_PolicyContext *pc = (Aes128Sha256PsaOaep_PolicyContext *)securityPolicy->policyContext; + if(!UA_ByteString_equal(certificateThumbprint, &pc->localCertThumbprint)) + return UA_STATUSCODE_BADCERTIFICATEINVALID; + + return UA_STATUSCODE_GOOD; +} + +/*******************/ +/* SymmetricModule */ +/*******************/ + +static UA_StatusCode +sym_verify_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *message, + const UA_ByteString *signature) { + if(securityPolicy == NULL || cc == NULL || message == NULL || signature == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Compute MAC */ + if(signature->length != UA_SHA256_LENGTH) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Signature size does not have the desired size defined by the security policy"); + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + Aes128Sha256PsaOaep_PolicyContext *pc = + (Aes128Sha256PsaOaep_PolicyContext *)securityPolicy->policyContext; + + unsigned char mac[UA_SHA256_LENGTH]; + mbedtls_hmac(&pc->sha256MdContext, &cc->remoteSymSigningKey, message, mac); + + /* Compare with Signature */ + if(!UA_constantTimeEqual(signature->data, mac, UA_SHA256_LENGTH)) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sym_sign_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *message, + UA_ByteString *signature) { + if(signature->length != UA_SHA256_LENGTH) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_hmac(&cc->policyContext->sha256MdContext, &cc->localSymSigningKey, + message, signature->data); + return UA_STATUSCODE_GOOD; +} + +static size_t +sym_getSignatureSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SHA256_LENGTH; +} + +static size_t +sym_getSigningKeyLength_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_AES128SHA256RSAOAEP_SYM_SIGNING_KEY_LENGTH; +} + +static size_t +sym_getEncryptionKeyLength_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_KEY_LENGTH; +} + +static size_t +sym_getEncryptionBlockSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_ENCRYPTION_BLOCK_SIZE; +} + +static size_t +sym_getPlainTextBlockSize_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *const securityPolicy, + const void *const channelContext) { + return UA_SECURITYPOLICY_AES128SHA256RSAOAEP_SYM_PLAIN_TEXT_BLOCK_SIZE; +} + +static UA_StatusCode +sym_encrypt_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(cc->localSymIv.length != securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalBlockSize(securityPolicy, cc)) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t plainTextBlockSize = securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getLocalPlainTextBlockSize(securityPolicy, cc); + + if(data->length % plainTextBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to encrypt is not a multiple of the plain text block size." + "Padding might not have been calculated appropriately."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Keylength in bits */ + unsigned int keylength = (unsigned int)(cc->localSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_enc(&aesContext, cc->localSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->localSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_ENCRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_decrypt_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const Aes128Sha256PsaOaep_ChannelContext *cc, + UA_ByteString *data) { + if(securityPolicy == NULL || cc == NULL || data == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + size_t encryptionBlockSize = securityPolicy->symmetricModule.cryptoModule. + encryptionAlgorithm.getRemoteBlockSize(securityPolicy, cc); + + if(cc->remoteSymIv.length != encryptionBlockSize) + return UA_STATUSCODE_BADINTERNALERROR; + + if(data->length % encryptionBlockSize != 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Length of data to decrypt is not a multiple of the encryptingBlock size."); + return UA_STATUSCODE_BADINTERNALERROR; + } + + unsigned int keylength = (unsigned int)(cc->remoteSymEncryptingKey.length * 8); + mbedtls_aes_context aesContext; + int mbedErr = mbedtls_aes_setkey_dec(&aesContext, cc->remoteSymEncryptingKey.data, keylength); + if(mbedErr) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString ivCopy; + UA_StatusCode retval = UA_ByteString_copy(&cc->remoteSymIv, &ivCopy); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + mbedErr = mbedtls_aes_crypt_cbc(&aesContext, MBEDTLS_AES_DECRYPT, data->length, + ivCopy.data, data->data, data->data); + if(mbedErr) + retval = UA_STATUSCODE_BADINTERNALERROR; + UA_ByteString_clear(&ivCopy); + return retval; +} + +static UA_StatusCode +sym_generateKey_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, const UA_ByteString *seed, + UA_ByteString *out) { + if(securityPolicy == NULL || secret == NULL || seed == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Aes128Sha256PsaOaep_PolicyContext *pc = + (Aes128Sha256PsaOaep_PolicyContext *)securityPolicy->policyContext; + + return mbedtls_generateKey(&pc->sha256MdContext, secret, seed, out); +} + +static UA_StatusCode +sym_generateNonce_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + UA_ByteString *out) { + if(securityPolicy == NULL || securityPolicy->policyContext == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Aes128Sha256PsaOaep_PolicyContext *pc = + (Aes128Sha256PsaOaep_PolicyContext *)securityPolicy->policyContext; + int mbedErr = mbedtls_ctr_drbg_random(&pc->drbgContext, out->data, out->length); + if(mbedErr) + return UA_STATUSCODE_BADUNEXPECTEDERROR; + return UA_STATUSCODE_GOOD; +} + +/*****************/ +/* ChannelModule */ +/*****************/ + +/* Assumes that the certificate has been verified externally */ +static UA_StatusCode +parseRemoteCertificate_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *remoteCertificate) { + if(remoteCertificate == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Parse the certificate */ + int mbedErr = mbedtls_x509_crt_parse(&cc->remoteCertificate, remoteCertificate->data, + remoteCertificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Check the key length */ + mbedtls_rsa_context *rsaContext = mbedtls_pk_rsa(cc->remoteCertificate.pk); + if(rsaContext->len < UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MINASYMKEYLENGTH || + rsaContext->len > UA_SECURITYPOLICY_AES128SHA256RSAOAEP_MAXASYMKEYLENGTH) + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + + return UA_STATUSCODE_GOOD; +} + +static void +channelContext_deleteContext_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc) { + UA_ByteString_clear(&cc->localSymSigningKey); + UA_ByteString_clear(&cc->localSymEncryptingKey); + UA_ByteString_clear(&cc->localSymIv); + + UA_ByteString_clear(&cc->remoteSymSigningKey); + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + UA_ByteString_clear(&cc->remoteSymIv); + + mbedtls_x509_crt_free(&cc->remoteCertificate); + + UA_free(cc); +} + +static UA_StatusCode +channelContext_newContext_sp_aes128sha256rsaoaep(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **pp_contextData) { + if(securityPolicy == NULL || remoteCertificate == NULL || pp_contextData == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Allocate the channel context */ + *pp_contextData = UA_malloc(sizeof(Aes128Sha256PsaOaep_ChannelContext)); + if(*pp_contextData == NULL) + return UA_STATUSCODE_BADOUTOFMEMORY; + + Aes128Sha256PsaOaep_ChannelContext *cc = (Aes128Sha256PsaOaep_ChannelContext *)*pp_contextData; + + /* Initialize the channel context */ + cc->policyContext = (Aes128Sha256PsaOaep_PolicyContext *)securityPolicy->policyContext; + + UA_ByteString_init(&cc->localSymSigningKey); + UA_ByteString_init(&cc->localSymEncryptingKey); + UA_ByteString_init(&cc->localSymIv); + + UA_ByteString_init(&cc->remoteSymSigningKey); + UA_ByteString_init(&cc->remoteSymEncryptingKey); + UA_ByteString_init(&cc->remoteSymIv); + + mbedtls_x509_crt_init(&cc->remoteCertificate); + + // TODO: this can be optimized so that we dont allocate memory before parsing the certificate + UA_StatusCode retval = parseRemoteCertificate_sp_aes128sha256rsaoaep(cc, remoteCertificate); + if(retval != UA_STATUSCODE_GOOD) { + channelContext_deleteContext_sp_aes128sha256rsaoaep(cc); + *pp_contextData = NULL; + } + return retval; +} + +static UA_StatusCode +channelContext_setLocalSymEncryptingKey_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymEncryptingKey); + return UA_ByteString_copy(key, &cc->localSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setLocalSymSigningKey_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymSigningKey); + return UA_ByteString_copy(key, &cc->localSymSigningKey); +} + + +static UA_StatusCode +channelContext_setLocalSymIv_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->localSymIv); + return UA_ByteString_copy(iv, &cc->localSymIv); +} + +static UA_StatusCode +channelContext_setRemoteSymEncryptingKey_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymEncryptingKey); + return UA_ByteString_copy(key, &cc->remoteSymEncryptingKey); +} + +static UA_StatusCode +channelContext_setRemoteSymSigningKey_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *key) { + if(key == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymSigningKey); + return UA_ByteString_copy(key, &cc->remoteSymSigningKey); +} + +static UA_StatusCode +channelContext_setRemoteSymIv_sp_aes128sha256rsaoaep(Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *iv) { + if(iv == NULL || cc == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + UA_ByteString_clear(&cc->remoteSymIv); + return UA_ByteString_copy(iv, &cc->remoteSymIv); +} + +static UA_StatusCode +channelContext_compareCertificate_sp_aes128sha256rsaoaep(const Aes128Sha256PsaOaep_ChannelContext *cc, + const UA_ByteString *certificate) { + if(cc == NULL || certificate == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + mbedtls_x509_crt cert; + mbedtls_x509_crt_init(&cert); + int mbedErr = mbedtls_x509_crt_parse(&cert, certificate->data, certificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(cert.raw.len != cc->remoteCertificate.raw.len || + memcmp(cert.raw.p, cc->remoteCertificate.raw.p, cert.raw.len) != 0) + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + mbedtls_x509_crt_free(&cert); + return retval; +} + +static void +clear_sp_aes128sha256rsaoaep(UA_SecurityPolicy *securityPolicy) { + if(securityPolicy == NULL) + return; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + if(securityPolicy->policyContext == NULL) + return; + + /* delete all allocated members in the context */ + Aes128Sha256PsaOaep_PolicyContext *pc = (Aes128Sha256PsaOaep_PolicyContext *) + securityPolicy->policyContext; + + mbedtls_ctr_drbg_free(&pc->drbgContext); + mbedtls_entropy_free(&pc->entropyContext); + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_md_free(&pc->sha256MdContext); + UA_ByteString_clear(&pc->localCertThumbprint); + + UA_LOG_DEBUG(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Deleted members of EndpointContext for sp_aes128sha256rsaoaep"); + + UA_free(pc); + securityPolicy->policyContext = NULL; +} + +static UA_StatusCode +updateCertificateAndPrivateKey_sp_aes128sha256rsaoaep(UA_SecurityPolicy *securityPolicy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey) { + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(securityPolicy->policyContext == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + Aes128Sha256PsaOaep_PolicyContext *pc = + (Aes128Sha256PsaOaep_PolicyContext *) securityPolicy->policyContext; + + UA_ByteString_clear(&securityPolicy->localCertificate); + + UA_StatusCode retval = UA_ByteString_allocBuffer(&securityPolicy->localCertificate, + newCertificate.length + 1); + if(retval != UA_STATUSCODE_GOOD) + return retval; + memcpy(securityPolicy->localCertificate.data, newCertificate.data, newCertificate.length); + securityPolicy->localCertificate.data[newCertificate.length] = '\0'; + securityPolicy->localCertificate.length--; + + /* Set the new private key */ + mbedtls_pk_free(&pc->localPrivateKey); + mbedtls_pk_init(&pc->localPrivateKey); + int mbedErr = mbedtls_pk_parse_key(&pc->localPrivateKey, newPrivateKey.data, + newPrivateKey.length, NULL, 0); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + retval = asym_makeThumbprint_sp_aes128sha256rsaoaep(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return retval; + + error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not update certificate and private key"); + if(securityPolicy->policyContext != NULL) + clear_sp_aes128sha256rsaoaep(securityPolicy); + return retval; +} + +static UA_StatusCode +policyContext_newContext_sp_aes128sha256rsaoaep(UA_SecurityPolicy *securityPolicy, + const UA_ByteString localPrivateKey) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(securityPolicy == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if (localPrivateKey.length == 0) { + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Can not initialize security policy. Private key is empty."); + return UA_STATUSCODE_BADINVALIDARGUMENT; + } + + Aes128Sha256PsaOaep_PolicyContext *pc = (Aes128Sha256PsaOaep_PolicyContext *) + UA_malloc(sizeof(Aes128Sha256PsaOaep_PolicyContext)); + securityPolicy->policyContext = (void *)pc; + if(!pc) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Initialize the PolicyContext */ + memset(pc, 0, sizeof(Aes128Sha256PsaOaep_PolicyContext)); + mbedtls_ctr_drbg_init(&pc->drbgContext); + mbedtls_entropy_init(&pc->entropyContext); + mbedtls_pk_init(&pc->localPrivateKey); + mbedtls_md_init(&pc->sha256MdContext); + + /* Initialized the message digest */ + const mbedtls_md_info_t *const mdInfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + int mbedErr = mbedtls_md_setup(&pc->sha256MdContext, mdInfo, MBEDTLS_MD_SHA256); + if(mbedErr) { + retval = UA_STATUSCODE_BADOUTOFMEMORY; + goto error; + } + + /* Add the system entropy source */ + mbedErr = mbedtls_entropy_add_source(&pc->entropyContext, + MBEDTLS_ENTROPY_POLL_METHOD, NULL, 0, + MBEDTLS_ENTROPY_SOURCE_STRONG); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Seed the RNG */ + char *personalization = "open62541-drbg"; + mbedErr = mbedtls_ctr_drbg_seed(&pc->drbgContext, mbedtls_entropy_func, + &pc->entropyContext, + (const unsigned char *)personalization, 14); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the private key */ + mbedErr = UA_mbedTLS_LoadPrivateKey(&localPrivateKey, &pc->localPrivateKey); + if(mbedErr) { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + goto error; + } + + /* Set the local certificate thumbprint */ + retval = UA_ByteString_allocBuffer(&pc->localCertThumbprint, UA_SHA1_LENGTH); + if(retval != UA_STATUSCODE_GOOD) + goto error; + retval = asym_makeThumbprint_sp_aes128sha256rsaoaep(securityPolicy, + &securityPolicy->localCertificate, + &pc->localCertThumbprint); + if(retval != UA_STATUSCODE_GOOD) + goto error; + + return UA_STATUSCODE_GOOD; + +error: + UA_LOG_ERROR(securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, + "Could not create securityContext: %s", UA_StatusCode_name(retval)); + if(securityPolicy->policyContext != NULL) + clear_sp_aes128sha256rsaoaep(securityPolicy); + return retval; +} + +UA_StatusCode +UA_SecurityPolicy_Aes128Sha256RsaOaep(UA_SecurityPolicy *policy, const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, const UA_Logger *logger) { + memset(policy, 0, sizeof(UA_SecurityPolicy)); + policy->logger = logger; + + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep"); + + UA_SecurityPolicyAsymmetricModule *const asymmetricModule = &policy->asymmetricModule; + UA_SecurityPolicySymmetricModule *const symmetricModule = &policy->symmetricModule; + UA_SecurityPolicyChannelModule *const channelModule = &policy->channelModule; + + UA_StatusCode retval = UA_mbedTLS_LoadLocalCertificate(&localCertificate, &policy->localCertificate); + + if (retval != UA_STATUSCODE_GOOD) + return retval; + + /* AsymmetricModule */ + UA_SecurityPolicySignatureAlgorithm *asym_signatureAlgorithm = + &asymmetricModule->cryptoModule.signatureAlgorithm; + asym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\0"); + asym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, const UA_ByteString *))asym_verify_sp_aes128sha256rsaoaep; + asym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))asym_sign_sp_aes128sha256rsaoaep; + asym_signatureAlgorithm->getLocalSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalSignatureSize_sp_aes128sha256rsaoaep; + asym_signatureAlgorithm->getRemoteSignatureSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteSignatureSize_sp_aes128sha256rsaoaep; + asym_signatureAlgorithm->getLocalKeyLength = NULL; // TODO: Write function + asym_signatureAlgorithm->getRemoteKeyLength = NULL; // TODO: Write function + + UA_SecurityPolicyEncryptionAlgorithm *asym_encryptionAlgorithm = + &asymmetricModule->cryptoModule.encryptionAlgorithm; + asym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#rsa-oaep\0"); + asym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))asym_encrypt_sp_aes128sha256rsaoaep; + asym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *)) + asym_decrypt_sp_aes128sha256rsaoaep; + asym_encryptionAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getLocalEncryptionKeyLength_sp_aes128sha256rsaoaep; + asym_encryptionAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemoteEncryptionKeyLength_sp_aes128sha256rsaoaep; + asym_encryptionAlgorithm->getLocalBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemoteBlockSize = (size_t (*)(const UA_SecurityPolicy *, + const void *))asym_getRemoteBlockSize_sp_aes128sha256rsaoaep; + asym_encryptionAlgorithm->getLocalPlainTextBlockSize = NULL; // TODO: Write function + asym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))asym_getRemotePlainTextBlockSize_sp_aes128sha256rsaoaep; + + asymmetricModule->makeCertificateThumbprint = asym_makeThumbprint_sp_aes128sha256rsaoaep; + asymmetricModule->compareCertificateThumbprint = + asymmetricModule_compareCertificateThumbprint_sp_aes128sha256rsaoaep; + + /* SymmetricModule */ + symmetricModule->generateKey = sym_generateKey_sp_aes128sha256rsaoaep; + symmetricModule->generateNonce = sym_generateNonce_sp_aes128sha256rsaoaep; + + UA_SecurityPolicySignatureAlgorithm *sym_signatureAlgorithm = + &symmetricModule->cryptoModule.signatureAlgorithm; + sym_signatureAlgorithm->uri = + UA_STRING("http://www.w3.org/2000/09/xmldsig#hmac-sha1\0"); + sym_signatureAlgorithm->verify = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, const UA_ByteString *, + const UA_ByteString *))sym_verify_sp_aes128sha256rsaoaep; + sym_signatureAlgorithm->sign = + (UA_StatusCode (*)(const UA_SecurityPolicy *, void *, + const UA_ByteString *, UA_ByteString *))sym_sign_sp_aes128sha256rsaoaep; + sym_signatureAlgorithm->getLocalSignatureSize = sym_getSignatureSize_sp_aes128sha256rsaoaep; + sym_signatureAlgorithm->getRemoteSignatureSize = sym_getSignatureSize_sp_aes128sha256rsaoaep; + sym_signatureAlgorithm->getLocalKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_aes128sha256rsaoaep; + sym_signatureAlgorithm->getRemoteKeyLength = + (size_t (*)(const UA_SecurityPolicy *, + const void *))sym_getSigningKeyLength_sp_aes128sha256rsaoaep; + + UA_SecurityPolicyEncryptionAlgorithm *sym_encryptionAlgorithm = + &symmetricModule->cryptoModule.encryptionAlgorithm; + sym_encryptionAlgorithm->uri = UA_STRING("http://www.w3.org/2001/04/xmlenc#aes128-cbc"); + sym_encryptionAlgorithm->encrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_encrypt_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->decrypt = + (UA_StatusCode(*)(const UA_SecurityPolicy *, void *, UA_ByteString *))sym_decrypt_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getLocalKeyLength = sym_getEncryptionKeyLength_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getRemoteKeyLength = sym_getEncryptionKeyLength_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getLocalBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getRemoteBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getEncryptionBlockSize_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getLocalPlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_aes128sha256rsaoaep; + sym_encryptionAlgorithm->getRemotePlainTextBlockSize = + (size_t (*)(const UA_SecurityPolicy *, const void *))sym_getPlainTextBlockSize_sp_aes128sha256rsaoaep; + symmetricModule->secureChannelNonceLength = 32; + + // Use the same signature algorithm as the asymmetric component for certificate signing (see standard) + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + /* ChannelModule */ + channelModule->newContext = channelContext_newContext_sp_aes128sha256rsaoaep; + channelModule->deleteContext = (void (*)(void *)) + channelContext_deleteContext_sp_aes128sha256rsaoaep; + + channelModule->setLocalSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymEncryptingKey_sp_aes128sha256rsaoaep; + channelModule->setLocalSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymSigningKey_sp_aes128sha256rsaoaep; + channelModule->setLocalSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setLocalSymIv_sp_aes128sha256rsaoaep; + + channelModule->setRemoteSymEncryptingKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymEncryptingKey_sp_aes128sha256rsaoaep; + channelModule->setRemoteSymSigningKey = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymSigningKey_sp_aes128sha256rsaoaep; + channelModule->setRemoteSymIv = (UA_StatusCode (*)(void *, const UA_ByteString *)) + channelContext_setRemoteSymIv_sp_aes128sha256rsaoaep; + + channelModule->compareCertificate = (UA_StatusCode (*)(const void *, const UA_ByteString *)) + channelContext_compareCertificate_sp_aes128sha256rsaoaep; + + policy->updateCertificateAndPrivateKey = updateCertificateAndPrivateKey_sp_aes128sha256rsaoaep; + policy->clear = clear_sp_aes128sha256rsaoaep; + + UA_StatusCode res = policyContext_newContext_sp_aes128sha256rsaoaep(policy, localPrivateKey); + if(res != UA_STATUSCODE_GOOD) + clear_sp_aes128sha256rsaoaep(policy); + + return res; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/mbedtls/ua_pki_mbedtls.c" ***********************************/ + +/* 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 2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2019 (c) Julius Pfrommer, Fraunhofer IOSB + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + +#include <mbedtls/x509.h> +#include <mbedtls/x509_crt.h> +#include <mbedtls/error.h> + +#define REMOTECERTIFICATETRUSTED 1 +#define ISSUERKNOWN 2 +#define DUALPARENT 3 +#define PARENTFOUND 4 + +/* Find binary substring. Taken and adjusted from + * http://tungchingkai.blogspot.com/2011/07/binary-strstr.html */ + +static const unsigned char * +bstrchr(const unsigned char *s, const unsigned char ch, size_t l) { + /* find first occurrence of c in char s[] for length l*/ + /* handle special case */ + if(l == 0) + return (NULL); + + for(; *s != ch; ++s, --l) + if(l == 0) + return (NULL); + return s; +} + +static const unsigned char * +UA_Bstrstr(const unsigned char *s1, size_t l1, const unsigned char *s2, size_t l2) { + /* find first occurrence of s2[] in s1[] for length l1*/ + const unsigned char *ss1 = s1; + const unsigned char *ss2 = s2; + /* handle special case */ + if(l1 == 0) + return (NULL); + if(l2 == 0) + return s1; + + /* match prefix */ + for (; (s1 = bstrchr(s1, *s2, (uintptr_t)ss1-(uintptr_t)s1+(uintptr_t)l1)) != NULL && + (uintptr_t)ss1-(uintptr_t)s1+(uintptr_t)l1 != 0; ++s1) { + + /* match rest of prefix */ + const unsigned char *sc1, *sc2; + for (sc1 = s1, sc2 = s2; ;) + if (++sc2 >= ss2+l2) + return s1; + else if (*++sc1 != *sc2) + break; + } + return NULL; +} + +// mbedTLS expects PEM data to be null terminated +// The data length parameter must include the null terminator +static UA_ByteString copyDataFormatAware(const UA_ByteString *data) +{ + UA_ByteString result; + UA_ByteString_init(&result); + + if (!data->length) + return result; + + if (data->length && data->data[0] == '-') { + UA_ByteString_allocBuffer(&result, data->length + 1); + memcpy(result.data, data->data, data->length); + result.data[data->length] = '\0'; + } else { + UA_ByteString_copy(data, &result); + } + + return result; +} + +typedef struct { + /* If the folders are defined, we use them to reload the certificates during + * runtime */ + UA_String trustListFolder; + UA_String issuerListFolder; + UA_String revocationListFolder; + + mbedtls_x509_crt certificateTrustList; + mbedtls_x509_crt certificateIssuerList; + mbedtls_x509_crl certificateRevocationList; +} CertInfo; + +#ifdef __linux__ /* Linux only so far */ + +#include <dirent.h> +#include <limits.h> + +static UA_StatusCode +fileNamesFromFolder(const UA_String *folder, size_t *pathsSize, UA_String **paths) { + char buf[PATH_MAX + 1]; + if(folder->length > PATH_MAX) + return UA_STATUSCODE_BADINTERNALERROR; + + memcpy(buf, folder->data, folder->length); + buf[folder->length] = 0; + + DIR *dir = opendir(buf); + if(!dir) + return UA_STATUSCODE_BADINTERNALERROR; + + *paths = (UA_String*)UA_Array_new(256, &UA_TYPES[UA_TYPES_STRING]); + if(*paths == NULL) { + closedir(dir); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + struct dirent *ent; + char buf2[PATH_MAX + 1]; + char *res = realpath(buf, buf2); + if(!res) { + closedir(dir); + return UA_STATUSCODE_BADINTERNALERROR; + } + size_t pathlen = strlen(buf2); + *pathsSize = 0; + while((ent = readdir (dir)) != NULL && *pathsSize < 256) { + if(ent->d_type != DT_REG) + continue; + buf2[pathlen] = '/'; + buf2[pathlen+1] = 0; + strcat(buf2, ent->d_name); + (*paths)[*pathsSize] = UA_STRING_ALLOC(buf2); + *pathsSize += 1; + } + closedir(dir); + + if(*pathsSize == 0) { + UA_free(*paths); + *paths = NULL; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +reloadCertificates(CertInfo *ci) { + UA_StatusCode retval = UA_STATUSCODE_GOOD; + int err = 0; + int internalErrorFlag = 0; + + /* Load the trustlists */ + if(ci->trustListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the trust-list"); + mbedtls_x509_crt_free(&ci->certificateTrustList); + mbedtls_x509_crt_init(&ci->certificateTrustList); + + char f[PATH_MAX]; + memcpy(f, ci->trustListFolder.data, ci->trustListFolder.length); + f[ci->trustListFolder.length] = 0; + err = mbedtls_x509_crt_parse_path(&ci->certificateTrustList, f); + if(err == 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Loaded certificate from %s", f); + } else { + char errBuff[300]; + mbedtls_strerror(err, errBuff, 300); + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load certificate from %s, mbedTLS error: %s (error code: %d)", f, errBuff, err); + internalErrorFlag = 1; + } + } + + /* Load the revocationlists */ + if(ci->revocationListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the revocation-list"); + size_t pathsSize = 0; + UA_String *paths = NULL; + retval = fileNamesFromFolder(&ci->revocationListFolder, &pathsSize, &paths); + if(retval != UA_STATUSCODE_GOOD) + return retval; + mbedtls_x509_crl_free(&ci->certificateRevocationList); + mbedtls_x509_crl_init(&ci->certificateRevocationList); + for(size_t i = 0; i < pathsSize; i++) { + char f[PATH_MAX]; + memcpy(f, paths[i].data, paths[i].length); + f[paths[i].length] = 0; + err = mbedtls_x509_crl_parse_file(&ci->certificateRevocationList, f); + if(err == 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Loaded certificate from %.*s", + (int)paths[i].length, paths[i].data); + } else { + char errBuff[300]; + mbedtls_strerror(err, errBuff, 300); + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load certificate from %.*s, mbedTLS error: %s (error code: %d)", + (int)paths[i].length, paths[i].data, errBuff, err); + internalErrorFlag = 1; + } + } + UA_Array_delete(paths, pathsSize, &UA_TYPES[UA_TYPES_STRING]); + paths = NULL; + pathsSize = 0; + } + + /* Load the issuerlists */ + if(ci->issuerListFolder.length > 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Reloading the issuer-list"); + mbedtls_x509_crt_free(&ci->certificateIssuerList); + mbedtls_x509_crt_init(&ci->certificateIssuerList); + char f[PATH_MAX]; + memcpy(f, ci->issuerListFolder.data, ci->issuerListFolder.length); + f[ci->issuerListFolder.length] = 0; + err = mbedtls_x509_crt_parse_path(&ci->certificateIssuerList, f); + if(err == 0) { + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Loaded certificate from %s", f); + } else { + char errBuff[300]; + mbedtls_strerror(err, errBuff, 300); + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "Failed to load certificate from %s, mbedTLS error: %s (error code: %d)", + f, errBuff, err); + internalErrorFlag = 1; + } + } + + if(internalErrorFlag) { + retval = UA_STATUSCODE_BADINTERNALERROR; + } + return retval; +} + +#endif + +static UA_StatusCode +certificateVerification_allow(void *verificationContext, + const UA_ByteString *certificate) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +certificateVerification_verify(void *verificationContext, + const UA_ByteString *certificate) { + CertInfo *ci = (CertInfo*)verificationContext; + if(!ci) + return UA_STATUSCODE_BADINTERNALERROR; + +#ifdef __linux__ /* Reload certificates if folder paths are specified */ + UA_StatusCode certFlag = reloadCertificates(ci); + if(certFlag != UA_STATUSCODE_GOOD) { + return certFlag; + } +#endif + + if(ci->trustListFolder.length == 0 && + ci->issuerListFolder.length == 0 && + ci->revocationListFolder.length == 0 && + ci->certificateTrustList.raw.len == 0 && + ci->certificateIssuerList.raw.len == 0 && + ci->certificateRevocationList.raw.len == 0) { + UA_LOG_WARNING(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, + "PKI plugin unconfigured. Accepting the certificate."); + return UA_STATUSCODE_GOOD; + } + + /* Parse the certificate */ + mbedtls_x509_crt remoteCertificate; + + /* Temporary Object to parse the trustList */ + mbedtls_x509_crt *tempCert = NULL; + + /* Temporary Object to parse the revocationList */ + mbedtls_x509_crl *tempCrl = NULL; + + /* Temporary Object to identify the parent CA when there is no intermediate CA */ + mbedtls_x509_crt *parentCert = NULL; + + /* Temporary Object to identify the parent CA when there is intermediate CA */ + mbedtls_x509_crt *parentCert_2 = NULL; + + /* Flag value to identify if the issuer certificate is found */ + int issuerKnown = 0; + + /* Flag value to identify if the parent certificate found */ + int parentFound = 0; + + mbedtls_x509_crt_init(&remoteCertificate); + int mbedErr = mbedtls_x509_crt_parse(&remoteCertificate, certificate->data, + certificate->length); + if(mbedErr) { + /* char errBuff[300]; */ + /* mbedtls_strerror(mbedErr, errBuff, 300); */ + /* UA_LOG_WARNING(data->policyContext->securityPolicy->logger, UA_LOGCATEGORY_SECURITYPOLICY, */ + /* "Could not parse the remote certificate with error: %s", errBuff); */ + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + + /* Verify */ + mbedtls_x509_crt_profile crtProfile = { + MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA1) | MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA256), + 0xFFFFFF, 0x000000, 128 * 8 // in bits + }; // TODO: remove magic numbers + + uint32_t flags = 0; + mbedErr = mbedtls_x509_crt_verify_with_profile(&remoteCertificate, + &ci->certificateTrustList, + &ci->certificateRevocationList, + &crtProfile, NULL, &flags, NULL, NULL); + + /* Flag to check if the remote certificate is trusted or not */ + int TRUSTED = 0; + + /* Check if the remoteCertificate is present in the trustList while mbedErr value is not zero */ + if(mbedErr && !(flags & MBEDTLS_X509_BADCERT_EXPIRED) && !(flags & MBEDTLS_X509_BADCERT_FUTURE)) { + for(tempCert = &ci->certificateTrustList; tempCert != NULL; tempCert = tempCert->next) { + if(remoteCertificate.raw.len == tempCert->raw.len && + memcmp(remoteCertificate.raw.p, tempCert->raw.p, remoteCertificate.raw.len) == 0) { + TRUSTED = REMOTECERTIFICATETRUSTED; + break; + } + } + } + + /* If the remote certificate is present in the trustList then check if the issuer certificate + * of remoteCertificate is present in issuerList */ + if(TRUSTED && mbedErr) { + mbedErr = mbedtls_x509_crt_verify_with_profile(&remoteCertificate, + &ci->certificateIssuerList, + &ci->certificateRevocationList, + &crtProfile, NULL, &flags, NULL, NULL); + + /* Check if the parent certificate has a CRL file available */ + if(!mbedErr) { + /* Flag value to identify if that there is an intermediate CA present */ + int dualParent = 0; + + /* Identify the topmost parent certificate for the remoteCertificate */ + for(parentCert = &ci->certificateIssuerList; parentCert != NULL; parentCert = parentCert->next ) { + if(memcmp(remoteCertificate.issuer_raw.p, parentCert->subject_raw.p, parentCert->subject_raw.len) == 0) { + for(parentCert_2 = &ci->certificateTrustList; parentCert_2 != NULL; parentCert_2 = parentCert_2->next) { + if(memcmp(parentCert->issuer_raw.p, parentCert_2->subject_raw.p, parentCert_2->subject_raw.len) == 0) { + dualParent = DUALPARENT; + break; + } + } + parentFound = PARENTFOUND; + } + + if(parentFound == PARENTFOUND) + break; + } + + /* Check if there is an intermediate certificate between the topmost parent + * certificate and child certificate + * If yes the topmost parent certificate is to be checked whether it has a + * CRL file avaiable */ + if(dualParent == DUALPARENT && parentFound == PARENTFOUND) { + parentCert = parentCert_2; + } + + /* If a parent certificate is found traverse the revocationList and identify + * if there is any CRL file that corresponds to the parentCertificate */ + if(parentFound == PARENTFOUND) { + tempCrl = &ci->certificateRevocationList; + while(tempCrl != NULL) { + if(tempCrl->version != 0 && + tempCrl->issuer_raw.len == parentCert->subject_raw.len && + memcmp(tempCrl->issuer_raw.p, + parentCert->subject_raw.p, + tempCrl->issuer_raw.len) == 0) { + issuerKnown = ISSUERKNOWN; + break; + } + + tempCrl = tempCrl->next; + } + + /* If the CRL file corresponding to the parent certificate is not present + * then return UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN */ + if(!issuerKnown) { + return UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN; + } + + } + + } + + } + else if(!mbedErr && !TRUSTED) { + /* This else if section is to identify if the parent certificate which is present in trustList + * has CRL file corresponding to it */ + + /* Identify the parent certificate of the remoteCertificate */ + for(parentCert = &ci->certificateTrustList; parentCert != NULL; parentCert = parentCert->next) { + if(memcmp(remoteCertificate.issuer_raw.p, parentCert->subject_raw.p, parentCert->subject_raw.len) == 0) { + parentFound = PARENTFOUND; + break; + } + + } + + /* If the parent certificate is found traverse the revocationList and identify + * if there is any CRL file that corresponds to the parentCertificate */ + if(parentFound == PARENTFOUND && + memcmp(remoteCertificate.issuer_raw.p, remoteCertificate.subject_raw.p, remoteCertificate.subject_raw.len) != 0) { + tempCrl = &ci->certificateRevocationList; + while(tempCrl != NULL) { + if(tempCrl->version != 0 && + tempCrl->issuer_raw.len == parentCert->subject_raw.len && + memcmp(tempCrl->issuer_raw.p, + parentCert->subject_raw.p, + tempCrl->issuer_raw.len) == 0) { + issuerKnown = ISSUERKNOWN; + break; + } + + tempCrl = tempCrl->next; + } + + /* If the CRL file corresponding to the parent certificate is not present + * then return UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN */ + if(!issuerKnown) { + return UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN; + } + + } + + } + + // TODO: Extend verification + + /* This condition will check whether the certificate is a User certificate + * or a CA certificate. If the MBEDTLS_X509_KU_KEY_CERT_SIGN and + * MBEDTLS_X509_KU_CRL_SIGN of key_usage are set, then the certificate + * shall be condidered as CA Certificate and cannot be used to establish a + * connection. Refer the test case CTT/Security/Security Certificate Validation/029.js + * for more details */ + if((remoteCertificate.key_usage & MBEDTLS_X509_KU_KEY_CERT_SIGN) && + (remoteCertificate.key_usage & MBEDTLS_X509_KU_CRL_SIGN)) { + return UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED; + } + + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(mbedErr) { +#if UA_LOGLEVEL <= 400 + char buff[100]; + int len = mbedtls_x509_crt_verify_info(buff, 100, "", flags); + UA_LOG_WARNING(UA_Log_Stdout, UA_LOGCATEGORY_SECURITYPOLICY, + "Verifying the certificate failed with error: %.*s", len-1, buff); +#endif + if(flags & (uint32_t)MBEDTLS_X509_BADCERT_NOT_TRUSTED) { + retval = UA_STATUSCODE_BADCERTIFICATEUNTRUSTED; + } else if(flags & (uint32_t)MBEDTLS_X509_BADCERT_FUTURE || + flags & (uint32_t)MBEDTLS_X509_BADCERT_EXPIRED) { + retval = UA_STATUSCODE_BADCERTIFICATETIMEINVALID; + } else if(flags & (uint32_t)MBEDTLS_X509_BADCERT_REVOKED || + flags & (uint32_t)MBEDTLS_X509_BADCRL_EXPIRED) { + retval = UA_STATUSCODE_BADCERTIFICATEREVOKED; + } else { + retval = UA_STATUSCODE_BADSECURITYCHECKSFAILED; + } + } + + mbedtls_x509_crt_free(&remoteCertificate); + return retval; +} + +static UA_StatusCode +certificateVerification_verifyApplicationURI(void *verificationContext, + const UA_ByteString *certificate, + const UA_String *applicationURI) { + CertInfo *ci = (CertInfo*)verificationContext; + if(!ci) + return UA_STATUSCODE_BADINTERNALERROR; + + /* Parse the certificate */ + mbedtls_x509_crt remoteCertificate; + mbedtls_x509_crt_init(&remoteCertificate); + int mbedErr = mbedtls_x509_crt_parse(&remoteCertificate, certificate->data, + certificate->length); + if(mbedErr) + return UA_STATUSCODE_BADSECURITYCHECKSFAILED; + + /* Poor man's ApplicationUri verification. mbedTLS does not parse all fields + * of the Alternative Subject Name. Instead test whether the URI-string is + * present in the v3_ext field in general. + * + * TODO: Improve parsing of the Alternative Subject Name */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(UA_Bstrstr(remoteCertificate.v3_ext.p, remoteCertificate.v3_ext.len, + applicationURI->data, applicationURI->length) == NULL) + retval = UA_STATUSCODE_BADCERTIFICATEURIINVALID; + + mbedtls_x509_crt_free(&remoteCertificate); + return retval; +} + +static void +certificateVerification_clear(UA_CertificateVerification *cv) { + CertInfo *ci = (CertInfo*)cv->context; + if(!ci) + return; + mbedtls_x509_crt_free(&ci->certificateTrustList); + mbedtls_x509_crl_free(&ci->certificateRevocationList); + mbedtls_x509_crt_free(&ci->certificateIssuerList); + UA_String_clear(&ci->trustListFolder); + UA_String_clear(&ci->issuerListFolder); + UA_String_clear(&ci->revocationListFolder); + UA_free(ci); + cv->context = NULL; +} + +UA_StatusCode +UA_CertificateVerification_Trustlist(UA_CertificateVerification *cv, + const UA_ByteString *certificateTrustList, + size_t certificateTrustListSize, + const UA_ByteString *certificateIssuerList, + size_t certificateIssuerListSize, + const UA_ByteString *certificateRevocationList, + size_t certificateRevocationListSize) { + CertInfo *ci = (CertInfo*)UA_malloc(sizeof(CertInfo)); + if(!ci) + return UA_STATUSCODE_BADOUTOFMEMORY; + memset(ci, 0, sizeof(CertInfo)); + mbedtls_x509_crt_init(&ci->certificateTrustList); + mbedtls_x509_crl_init(&ci->certificateRevocationList); + mbedtls_x509_crt_init(&ci->certificateIssuerList); + + cv->context = (void*)ci; + if(certificateTrustListSize > 0) + cv->verifyCertificate = certificateVerification_verify; + else + cv->verifyCertificate = certificateVerification_allow; + cv->clear = certificateVerification_clear; + cv->verifyApplicationURI = certificateVerification_verifyApplicationURI; + + int err = 0; + UA_ByteString data; + UA_ByteString_init(&data); + + for(size_t i = 0; i < certificateTrustListSize; i++) { + data = copyDataFormatAware(&certificateTrustList[i]); + err = mbedtls_x509_crt_parse(&ci->certificateTrustList, + data.data, + data.length); + UA_ByteString_clear(&data); + if(err) + goto error; + } + for(size_t i = 0; i < certificateIssuerListSize; i++) { + data = copyDataFormatAware(&certificateIssuerList[i]); + err = mbedtls_x509_crt_parse(&ci->certificateIssuerList, + data.data, + data.length); + UA_ByteString_clear(&data); + if(err) + goto error; + } + for(size_t i = 0; i < certificateRevocationListSize; i++) { + data = copyDataFormatAware(&certificateRevocationList[i]); + err = mbedtls_x509_crl_parse(&ci->certificateRevocationList, + data.data, + data.length); + UA_ByteString_clear(&data); + if(err) + goto error; + } + + return UA_STATUSCODE_GOOD; +error: + certificateVerification_clear(cv); + return UA_STATUSCODE_BADINTERNALERROR; +} + +#ifdef __linux__ /* Linux only so far */ + +UA_StatusCode +UA_CertificateVerification_CertFolders(UA_CertificateVerification *cv, + const char *trustListFolder, + const char *issuerListFolder, + const char *revocationListFolder) { + CertInfo *ci = (CertInfo*)UA_malloc(sizeof(CertInfo)); + if(!ci) + return UA_STATUSCODE_BADOUTOFMEMORY; + memset(ci, 0, sizeof(CertInfo)); + mbedtls_x509_crt_init(&ci->certificateTrustList); + mbedtls_x509_crl_init(&ci->certificateRevocationList); + mbedtls_x509_crt_init(&ci->certificateIssuerList); + + /* Only set the folder paths. They will be reloaded during runtime. + * TODO: Add a more efficient reloading of only the changes */ + ci->trustListFolder = UA_STRING_ALLOC(trustListFolder); + ci->issuerListFolder = UA_STRING_ALLOC(issuerListFolder); + ci->revocationListFolder = UA_STRING_ALLOC(revocationListFolder); + + reloadCertificates(ci); + + cv->context = (void*)ci; + cv->verifyCertificate = certificateVerification_verify; + cv->clear = certificateVerification_clear; + cv->verifyApplicationURI = certificateVerification_verifyApplicationURI; + + return UA_STATUSCODE_GOOD; +} + +#endif +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_log_stdout.c" ***********************************/ + +/* 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 2016-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + */ + + +#include <stdio.h> + +#if UA_MULTITHREADING >= 200 +#include <pthread.h> +static pthread_mutex_t printf_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif + +/* ANSI escape sequences for color output taken from here: + * https://stackoverflow.com/questions/3219393/stdlib-and-colored-output-in-c*/ + +#ifdef UA_ENABLE_LOG_COLORS +# define ANSI_COLOR_RED "\x1b[31m" +# define ANSI_COLOR_GREEN "\x1b[32m" +# define ANSI_COLOR_YELLOW "\x1b[33m" +# define ANSI_COLOR_BLUE "\x1b[34m" +# define ANSI_COLOR_MAGENTA "\x1b[35m" +# define ANSI_COLOR_CYAN "\x1b[36m" +# define ANSI_COLOR_RESET "\x1b[0m" +#else +# define ANSI_COLOR_RED "" +# define ANSI_COLOR_GREEN "" +# define ANSI_COLOR_YELLOW "" +# define ANSI_COLOR_BLUE "" +# define ANSI_COLOR_MAGENTA "" +# define ANSI_COLOR_CYAN "" +# define ANSI_COLOR_RESET "" +#endif + +const char *logLevelNames[6] = {"trace", "debug", + ANSI_COLOR_GREEN "info", + ANSI_COLOR_YELLOW "warn", + ANSI_COLOR_RED "error", + ANSI_COLOR_MAGENTA "fatal"}; +const char *logCategoryNames[7] = {"network", "channel", "session", "server", + "client", "userland", "securitypolicy"}; + +#ifdef __clang__ +__attribute__((__format__(__printf__, 4 , 0))) +#endif +void +UA_Log_Stdout_log(void *context, UA_LogLevel level, UA_LogCategory category, + const char *msg, va_list args) { + + /* Assume that context is casted to UA_LogLevel */ + /* TODO we may later change this to a struct with bitfields to filter on category */ + if ( context != NULL && (UA_LogLevel)(uintptr_t)context > level ) + return; + + UA_Int64 tOffset = UA_DateTime_localTimeUtcOffset(); + UA_DateTimeStruct dts = UA_DateTime_toStruct(UA_DateTime_now() + tOffset); + +#if UA_MULTITHREADING >= 200 + pthread_mutex_lock(&printf_mutex); +#endif + + printf("[%04u-%02u-%02u %02u:%02u:%02u.%03u (UTC%+05d)] %s/%s" ANSI_COLOR_RESET "\t", + dts.year, dts.month, dts.day, dts.hour, dts.min, dts.sec, dts.milliSec, + (int)(tOffset / UA_DATETIME_SEC / 36), logLevelNames[level], logCategoryNames[category]); + vprintf(msg, args); + printf("\n"); + fflush(stdout); + +#if UA_MULTITHREADING >= 200 + pthread_mutex_unlock(&printf_mutex); +#endif +} + +void +UA_Log_Stdout_clear(void *logContext) { + +} + +const UA_Logger UA_Log_Stdout_ = {UA_Log_Stdout_log, NULL, UA_Log_Stdout_clear}; +const UA_Logger *UA_Log_Stdout = &UA_Log_Stdout_; + +/* By default the client and server is configured with UA_Log_Stdout + This constructs a logger with a configurable max log level */ + +UA_Logger UA_Log_Stdout_withLevel(UA_LogLevel minlevel) +{ + UA_Logger logger = {UA_Log_Stdout_log, (void*)minlevel, UA_Log_Stdout_clear}; + return logger; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_accesscontrol_default.c" ***********************************/ + +/* 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 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + +/* Example access control management. Anonymous and username / password login. + * The access rights are maximally permissive. + * + * FOR PRODUCTION USE, THIS EXAMPLE PLUGIN SHOULD BE REPLACED WITH LESS + * PERMISSIVE ACCESS CONTROL. + * + * For TransferSubscriptions, we check whether the transfer happens between + * Sessions for the same user. */ + +typedef struct { + UA_Boolean allowAnonymous; + size_t usernamePasswordLoginSize; + UA_UsernamePasswordLogin *usernamePasswordLogin; +} AccessControlContext; + +#define ANONYMOUS_POLICY "open62541-anonymous-policy" +#define USERNAME_POLICY "open62541-username-policy" +const UA_String anonymous_policy = UA_STRING_STATIC(ANONYMOUS_POLICY); +const UA_String username_policy = UA_STRING_STATIC(USERNAME_POLICY); + +/************************/ +/* Access Control Logic */ +/************************/ + +static UA_StatusCode +activateSession_default(UA_Server *server, UA_AccessControl *ac, + const UA_EndpointDescription *endpointDescription, + const UA_ByteString *secureChannelRemoteCertificate, + const UA_NodeId *sessionId, + const UA_ExtensionObject *userIdentityToken, + void **sessionContext) { + AccessControlContext *context = (AccessControlContext*)ac->context; + + /* The empty token is interpreted as anonymous */ + if(userIdentityToken->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY) { + if(!context->allowAnonymous) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + /* No userdata atm */ + *sessionContext = NULL; + return UA_STATUSCODE_GOOD; + } + + /* Could the token be decoded? */ + if(userIdentityToken->encoding < UA_EXTENSIONOBJECT_DECODED) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + /* Anonymous login */ + if(userIdentityToken->content.decoded.type == &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]) { + if(!context->allowAnonymous) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + const UA_AnonymousIdentityToken *token = (UA_AnonymousIdentityToken*) + userIdentityToken->content.decoded.data; + + /* Compatibility notice: Siemens OPC Scout v10 provides an empty + * policyId. This is not compliant. For compatibility, assume that empty + * policyId == ANONYMOUS_POLICY */ + if(token->policyId.data && !UA_String_equal(&token->policyId, &anonymous_policy)) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + /* No userdata atm */ + *sessionContext = NULL; + return UA_STATUSCODE_GOOD; + } + + /* Username and password */ + if(userIdentityToken->content.decoded.type == &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]) { + const UA_UserNameIdentityToken *userToken = + (UA_UserNameIdentityToken*)userIdentityToken->content.decoded.data; + + if(!UA_String_equal(&userToken->policyId, &username_policy)) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + /* The userToken has been decrypted by the server before forwarding + * it to the plugin. This information can be used here. */ + /* if(userToken->encryptionAlgorithm.length > 0) {} */ + + /* Empty username and password */ + if(userToken->userName.length == 0 && userToken->password.length == 0) + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; + + /* Try to match username/pw */ + UA_Boolean match = false; + for(size_t i = 0; i < context->usernamePasswordLoginSize; i++) { + if(UA_String_equal(&userToken->userName, &context->usernamePasswordLogin[i].username) && + UA_String_equal(&userToken->password, &context->usernamePasswordLogin[i].password)) { + match = true; + break; + } + } + if(!match) + return UA_STATUSCODE_BADUSERACCESSDENIED; + + /* For the CTT, recognize whether two sessions are */ + UA_ByteString *username = UA_ByteString_new(); + if(username) + UA_ByteString_copy(&userToken->userName, username); + *sessionContext = username; + return UA_STATUSCODE_GOOD; + } + + /* Unsupported token type */ + return UA_STATUSCODE_BADIDENTITYTOKENINVALID; +} + +static void +closeSession_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext) { + if(sessionContext) + UA_ByteString_delete((UA_ByteString*)sessionContext); +} + +static UA_UInt32 +getUserRightsMask_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext) { + return 0xFFFFFFFF; +} + +static UA_Byte +getUserAccessLevel_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext) { + return 0xFF; +} + +static UA_Boolean +getUserExecutable_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *methodId, void *methodContext) { + return true; +} + +static UA_Boolean +getUserExecutableOnObject_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext) { + return true; +} + +static UA_Boolean +allowAddNode_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_AddNodesItem *item) { + return true; +} + +static UA_Boolean +allowAddReference_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_AddReferencesItem *item) { + return true; +} + +static UA_Boolean +allowDeleteNode_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_DeleteNodesItem *item) { + return true; +} + +static UA_Boolean +allowDeleteReference_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_DeleteReferencesItem *item) { + return true; +} + +static UA_Boolean +allowBrowseNode_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext) { + return true; +} + +#ifdef UA_ENABLE_SUBSCRIPTIONS +static UA_Boolean +allowTransferSubscription_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *oldSessionId, void *oldSessionContext, + const UA_NodeId *newSessionId, void *newSessionContext) { + if(oldSessionContext == newSessionContext) + return true; + if(oldSessionContext && newSessionContext) + return UA_ByteString_equal((UA_ByteString*)oldSessionContext, + (UA_ByteString*)newSessionContext); + return false; +} +#endif + +#ifdef UA_ENABLE_HISTORIZING +static UA_Boolean +allowHistoryUpdateUpdateData_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, + UA_PerformUpdateType performInsertReplace, + const UA_DataValue *value) { + return true; +} + +static UA_Boolean +allowHistoryUpdateDeleteRawModified_default(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, + UA_DateTime startTimestamp, + UA_DateTime endTimestamp, + bool isDeleteModified) { + return true; +} +#endif + +/***************************************/ +/* Create Delete Access Control Plugin */ +/***************************************/ + +static void clear_default(UA_AccessControl *ac) { + UA_Array_delete((void*)(uintptr_t)ac->userTokenPolicies, + ac->userTokenPoliciesSize, + &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); + ac->userTokenPolicies = NULL; + ac->userTokenPoliciesSize = 0; + + AccessControlContext *context = (AccessControlContext*)ac->context; + + if (context) { + for(size_t i = 0; i < context->usernamePasswordLoginSize; i++) { + UA_String_clear(&context->usernamePasswordLogin[i].username); + UA_String_clear(&context->usernamePasswordLogin[i].password); + } + if(context->usernamePasswordLoginSize > 0) + UA_free(context->usernamePasswordLogin); + UA_free(ac->context); + ac->context = NULL; + } +} + +UA_StatusCode +UA_AccessControl_default(UA_ServerConfig *config, UA_Boolean allowAnonymous, + const UA_ByteString *userTokenPolicyUri, + size_t usernamePasswordLoginSize, + const UA_UsernamePasswordLogin *usernamePasswordLogin) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_SERVER, + "AccessControl: Unconfigured AccessControl. Users have all permissions."); + UA_AccessControl *ac = &config->accessControl; + ac->clear = clear_default; + ac->activateSession = activateSession_default; + ac->closeSession = closeSession_default; + ac->getUserRightsMask = getUserRightsMask_default; + ac->getUserAccessLevel = getUserAccessLevel_default; + ac->getUserExecutable = getUserExecutable_default; + ac->getUserExecutableOnObject = getUserExecutableOnObject_default; + ac->allowAddNode = allowAddNode_default; + ac->allowAddReference = allowAddReference_default; + ac->allowBrowseNode = allowBrowseNode_default; + +#ifdef UA_ENABLE_SUBSCRIPTIONS + ac->allowTransferSubscription = allowTransferSubscription_default; +#endif + +#ifdef UA_ENABLE_HISTORIZING + ac->allowHistoryUpdateUpdateData = allowHistoryUpdateUpdateData_default; + ac->allowHistoryUpdateDeleteRawModified = allowHistoryUpdateDeleteRawModified_default; +#endif + + ac->allowDeleteNode = allowDeleteNode_default; + ac->allowDeleteReference = allowDeleteReference_default; + + AccessControlContext *context = (AccessControlContext*) + UA_malloc(sizeof(AccessControlContext)); + if(!context) + return UA_STATUSCODE_BADOUTOFMEMORY; + memset(context, 0, sizeof(AccessControlContext)); + ac->context = context; + + /* Allow anonymous? */ + context->allowAnonymous = allowAnonymous; + if(allowAnonymous) { + UA_LOG_INFO(&config->logger, UA_LOGCATEGORY_SERVER, + "AccessControl: Anonymous login is enabled"); + } + + /* Copy username/password to the access control plugin */ + if(usernamePasswordLoginSize > 0) { + context->usernamePasswordLogin = (UA_UsernamePasswordLogin*) + UA_malloc(usernamePasswordLoginSize * sizeof(UA_UsernamePasswordLogin)); + if(!context->usernamePasswordLogin) + return UA_STATUSCODE_BADOUTOFMEMORY; + context->usernamePasswordLoginSize = usernamePasswordLoginSize; + for(size_t i = 0; i < usernamePasswordLoginSize; i++) { + UA_String_copy(&usernamePasswordLogin[i].username, &context->usernamePasswordLogin[i].username); + UA_String_copy(&usernamePasswordLogin[i].password, &context->usernamePasswordLogin[i].password); + } + } + + /* Set the allowed policies */ + size_t policies = 0; + if(allowAnonymous) + policies++; + if(usernamePasswordLoginSize > 0) + policies++; + ac->userTokenPoliciesSize = 0; + ac->userTokenPolicies = (UA_UserTokenPolicy *) + UA_Array_new(policies, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); + if(!ac->userTokenPolicies) + return UA_STATUSCODE_BADOUTOFMEMORY; + ac->userTokenPoliciesSize = policies; + + policies = 0; + if(allowAnonymous) { + ac->userTokenPolicies[policies].tokenType = UA_USERTOKENTYPE_ANONYMOUS; + ac->userTokenPolicies[policies].policyId = UA_STRING_ALLOC(ANONYMOUS_POLICY); + if (!ac->userTokenPolicies[policies].policyId.data) + return UA_STATUSCODE_BADOUTOFMEMORY; + policies++; + } + + if(usernamePasswordLoginSize > 0) { + ac->userTokenPolicies[policies].tokenType = UA_USERTOKENTYPE_USERNAME; + ac->userTokenPolicies[policies].policyId = UA_STRING_ALLOC(USERNAME_POLICY); + if(!ac->userTokenPolicies[policies].policyId.data) + return UA_STATUSCODE_BADOUTOFMEMORY; + +#if UA_LOGLEVEL <= 400 + const UA_String noneUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#None"); + if(UA_ByteString_equal(userTokenPolicyUri, &noneUri)) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_SERVER, + "Username/Password configured, but no encrypting SecurityPolicy. " + "This can leak credentials on the network."); + } +#endif + return UA_ByteString_copy(userTokenPolicyUri, + &ac->userTokenPolicies[policies].securityPolicyUri); + } + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_nodestore_ziptree.c" ***********************************/ + +/* 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 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +#ifndef container_of +#define container_of(ptr, type, member) \ + (type *)((uintptr_t)ptr - offsetof(type,member)) +#endif + +struct NodeEntry; +typedef struct NodeEntry NodeEntry; + +struct NodeEntry { + ZIP_ENTRY(NodeEntry) zipfields; + UA_UInt32 nodeIdHash; + UA_UInt16 refCount; /* How many consumers have a reference to the node? */ + UA_Boolean deleted; /* Node was marked as deleted and can be deleted when refCount == 0 */ + NodeEntry *orig; /* If a copy is made to replace a node, track that we + * replace only the node from which the copy was made. + * Important for concurrent operations. */ + UA_NodeId nodeId; /* This is actually a UA_Node that also starts with a NodeId */ +}; + +/* Absolute ordering for NodeIds */ +static enum ZIP_CMP +cmpNodeId(const void *a, const void *b) { + const NodeEntry *aa = (const NodeEntry*)a; + const NodeEntry *bb = (const NodeEntry*)b; + + /* Compare hash */ + if(aa->nodeIdHash < bb->nodeIdHash) + return ZIP_CMP_LESS; + if(aa->nodeIdHash > bb->nodeIdHash) + return ZIP_CMP_MORE; + + /* Compore nodes in detail */ + return (enum ZIP_CMP)UA_NodeId_order(&aa->nodeId, &bb->nodeId); +} + +ZIP_HEAD(NodeTree, NodeEntry); +typedef struct NodeTree NodeTree; + +typedef struct { + NodeTree root; + + /* Maps ReferenceTypeIndex to the NodeId of the ReferenceType */ + UA_NodeId referenceTypeIds[UA_REFERENCETYPESET_MAX]; + UA_Byte referenceTypeCounter; +} ZipContext; + +ZIP_PROTOTYPE(NodeTree, NodeEntry, NodeEntry) +ZIP_IMPL(NodeTree, NodeEntry, zipfields, NodeEntry, zipfields, cmpNodeId) + +static NodeEntry * +newEntry(UA_NodeClass nodeClass) { + size_t size = sizeof(NodeEntry) - sizeof(UA_NodeId); + switch(nodeClass) { + case UA_NODECLASS_OBJECT: + size += sizeof(UA_ObjectNode); + break; + case UA_NODECLASS_VARIABLE: + size += sizeof(UA_VariableNode); + break; + case UA_NODECLASS_METHOD: + size += sizeof(UA_MethodNode); + break; + case UA_NODECLASS_OBJECTTYPE: + size += sizeof(UA_ObjectTypeNode); + break; + case UA_NODECLASS_VARIABLETYPE: + size += sizeof(UA_VariableTypeNode); + break; + case UA_NODECLASS_REFERENCETYPE: + size += sizeof(UA_ReferenceTypeNode); + break; + case UA_NODECLASS_DATATYPE: + size += sizeof(UA_DataTypeNode); + break; + case UA_NODECLASS_VIEW: + size += sizeof(UA_ViewNode); + break; + default: + return NULL; + } + NodeEntry *entry = (NodeEntry*)UA_calloc(1, size); + if(!entry) + return NULL; + UA_Node *node = (UA_Node*)&entry->nodeId; + node->head.nodeClass = nodeClass; + return entry; +} + +static void +deleteEntry(NodeEntry *entry) { + UA_Node_clear((UA_Node*)&entry->nodeId); + UA_free(entry); +} + +static void +cleanupEntry(NodeEntry *entry) { + if(entry->deleted && entry->refCount == 0) + deleteEntry(entry); +} + +/***********************/ +/* Interface functions */ +/***********************/ + +/* Not yet inserted into the ZipContext */ +static UA_Node * +zipNsNewNode(void *nsCtx, UA_NodeClass nodeClass) { + NodeEntry *entry = newEntry(nodeClass); + if(!entry) + return NULL; + return (UA_Node*)&entry->nodeId; +} + +/* Not yet inserted into the ZipContext */ +static void +zipNsDeleteNode(void *nsCtx, UA_Node *node) { + deleteEntry(container_of(node, NodeEntry, nodeId)); +} + +static const UA_Node * +zipNsGetNode(void *nsCtx, const UA_NodeId *nodeId) { + ZipContext *ns = (ZipContext*)nsCtx; + NodeEntry dummy; + dummy.nodeIdHash = UA_NodeId_hash(nodeId); + dummy.nodeId = *nodeId; + NodeEntry *entry = ZIP_FIND(NodeTree, &ns->root, &dummy); + if(!entry) + return NULL; + ++entry->refCount; + return (const UA_Node*)&entry->nodeId; +} + +static void +zipNsReleaseNode(void *nsCtx, const UA_Node *node) { + if(!node) + return; + NodeEntry *entry = container_of(node, NodeEntry, nodeId); + UA_assert(entry->refCount > 0); + --entry->refCount; + cleanupEntry(entry); +} + +static UA_StatusCode +zipNsGetNodeCopy(void *nsCtx, const UA_NodeId *nodeId, + UA_Node **outNode) { + /* Find the node */ + const UA_Node *node = zipNsGetNode(nsCtx, nodeId); + if(!node) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + + /* Create the new entry */ + NodeEntry *ne = newEntry(node->head.nodeClass); + if(!ne) { + zipNsReleaseNode(nsCtx, node); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + /* Copy the node content */ + UA_Node *nnode = (UA_Node*)&ne->nodeId; + UA_StatusCode retval = UA_Node_copy(node, nnode); + zipNsReleaseNode(nsCtx, node); + if(retval != UA_STATUSCODE_GOOD) { + deleteEntry(ne); + return retval; + } + + ne->orig = container_of(node, NodeEntry, nodeId); + *outNode = nnode; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +zipNsInsertNode(void *nsCtx, UA_Node *node, UA_NodeId *addedNodeId) { + NodeEntry *entry = container_of(node, NodeEntry, nodeId); + ZipContext *ns = (ZipContext*)nsCtx; + + /* Ensure that the NodeId is unique */ + NodeEntry dummy; + dummy.nodeId = node->head.nodeId; + if(node->head.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC && + node->head.nodeId.identifier.numeric == 0) { + do { /* Create a random nodeid until we find an unoccupied id */ + node->head.nodeId.identifier.numeric = UA_UInt32_random(); + dummy.nodeId.identifier.numeric = node->head.nodeId.identifier.numeric; + dummy.nodeIdHash = UA_NodeId_hash(&node->head.nodeId); + } while(ZIP_FIND(NodeTree, &ns->root, &dummy)); + } else { + dummy.nodeIdHash = UA_NodeId_hash(&node->head.nodeId); + if(ZIP_FIND(NodeTree, &ns->root, &dummy)) { /* The nodeid exists */ + deleteEntry(entry); + return UA_STATUSCODE_BADNODEIDEXISTS; + } + } + + /* Copy the NodeId */ + if(addedNodeId) { + UA_StatusCode retval = UA_NodeId_copy(&node->head.nodeId, addedNodeId); + if(retval != UA_STATUSCODE_GOOD) { + deleteEntry(entry); + return retval; + } + } + + /* For new ReferencetypeNodes add to the index map */ + if(node->head.nodeClass == UA_NODECLASS_REFERENCETYPE) { + UA_ReferenceTypeNode *refNode = &node->referenceTypeNode; + if(ns->referenceTypeCounter >= UA_REFERENCETYPESET_MAX) { + deleteEntry(entry); + return UA_STATUSCODE_BADINTERNALERROR; + } + + UA_StatusCode retval = + UA_NodeId_copy(&node->head.nodeId, &ns->referenceTypeIds[ns->referenceTypeCounter]); + if(retval != UA_STATUSCODE_GOOD) { + deleteEntry(entry); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Assign the ReferenceTypeIndex to the new ReferenceTypeNode */ + refNode->referenceTypeIndex = ns->referenceTypeCounter; + refNode->subTypes = UA_REFTYPESET(ns->referenceTypeCounter); + + ns->referenceTypeCounter++; + } + + /* Insert the node */ + entry->nodeIdHash = dummy.nodeIdHash; + ZIP_INSERT(NodeTree, &ns->root, entry, ZIP_FFS32(UA_UInt32_random())); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +zipNsReplaceNode(void *nsCtx, UA_Node *node) { + /* Find the node */ + const UA_Node *oldNode = zipNsGetNode(nsCtx, &node->head.nodeId); + if(!oldNode) { + deleteEntry(container_of(node, NodeEntry, nodeId)); + return UA_STATUSCODE_BADNODEIDUNKNOWN; + } + + /* Test if the copy is current */ + NodeEntry *entry = container_of(node, NodeEntry, nodeId); + NodeEntry *oldEntry = container_of(oldNode, NodeEntry, nodeId); + if(oldEntry != entry->orig) { + /* The node was already updated since the copy was made */ + deleteEntry(entry); + zipNsReleaseNode(nsCtx, oldNode); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Replace */ + ZipContext *ns = (ZipContext*)nsCtx; + ZIP_REMOVE(NodeTree, &ns->root, oldEntry); + entry->nodeIdHash = oldEntry->nodeIdHash; + ZIP_INSERT(NodeTree, &ns->root, entry, ZIP_RANK(entry, zipfields)); + oldEntry->deleted = true; + + zipNsReleaseNode(nsCtx, oldNode); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +zipNsRemoveNode(void *nsCtx, const UA_NodeId *nodeId) { + ZipContext *ns = (ZipContext*)nsCtx; + NodeEntry dummy; + dummy.nodeIdHash = UA_NodeId_hash(nodeId); + dummy.nodeId = *nodeId; + NodeEntry *entry = ZIP_FIND(NodeTree, &ns->root, &dummy); + if(!entry) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + ZIP_REMOVE(NodeTree, &ns->root, entry); + entry->deleted = true; + cleanupEntry(entry); + return UA_STATUSCODE_GOOD; +} + +static const UA_NodeId * +zipNsGetReferenceTypeId(void *nsCtx, UA_Byte refTypeIndex) { + ZipContext *ns = (ZipContext*)nsCtx; + if(refTypeIndex > ns->referenceTypeCounter) + return NULL; + return &ns->referenceTypeIds[refTypeIndex]; +} + +struct VisitorData { + UA_NodestoreVisitor visitor; + void *visitorContext; +}; + +static void +nodeVisitor(NodeEntry *entry, void *data) { + struct VisitorData *d = (struct VisitorData*)data; + d->visitor(d->visitorContext, (UA_Node*)&entry->nodeId); +} + +static void +zipNsIterate(void *nsCtx, UA_NodestoreVisitor visitor, + void *visitorCtx) { + struct VisitorData d; + d.visitor = visitor; + d.visitorContext = visitorCtx; + ZipContext *ns = (ZipContext*)nsCtx; + ZIP_ITER(NodeTree, &ns->root, nodeVisitor, &d); +} + +static void +deleteNodeVisitor(NodeEntry *entry, void *data) { + deleteEntry(entry); +} + +/***********************/ +/* Nodestore Lifecycle */ +/***********************/ + +static void +zipNsClear(void *nsCtx) { + if (!nsCtx) + return; + ZipContext *ns = (ZipContext*)nsCtx; + ZIP_ITER(NodeTree, &ns->root, deleteNodeVisitor, NULL); + + /* Clean up the ReferenceTypes index array */ + for(size_t i = 0; i < ns->referenceTypeCounter; i++) + UA_NodeId_clear(&ns->referenceTypeIds[i]); + + UA_free(ns); +} + +UA_StatusCode +UA_Nodestore_ZipTree(UA_Nodestore *ns) { + /* Allocate and initialize the context */ + ZipContext *ctx = (ZipContext*)UA_malloc(sizeof(ZipContext)); + if(!ctx) + return UA_STATUSCODE_BADOUTOFMEMORY; + + ZIP_INIT(&ctx->root); + ctx->referenceTypeCounter = 0; + + /* Populate the nodestore */ + ns->context = (void*)ctx; + ns->clear = zipNsClear; + ns->newNode = zipNsNewNode; + ns->deleteNode = zipNsDeleteNode; + ns->getNode = zipNsGetNode; + ns->releaseNode = zipNsReleaseNode; + ns->getNodeCopy = zipNsGetNodeCopy; + ns->insertNode = zipNsInsertNode; + ns->replaceNode = zipNsReplaceNode; + ns->removeNode = zipNsRemoveNode; + ns->getReferenceTypeId = zipNsGetReferenceTypeId; + ns->iterate = zipNsIterate; + + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_nodestore_hashmap.c" ***********************************/ + +/* 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 2014-2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +#ifndef container_of +#define container_of(ptr, type, member) \ + (type *)((uintptr_t)ptr - offsetof(type,member)) +#endif + +/* The default Nodestore is simply a hash-map from NodeIds to Nodes. To find an + * entry, iterate over candidate positions according to the NodeId hash. + * + * - Tombstone or non-matching NodeId: continue searching + * - Matching NodeId: Return the entry + * - NULL: Abort the search */ + +typedef struct UA_NodeMapEntry { + struct UA_NodeMapEntry *orig; /* the version this is a copy from (or NULL) */ + UA_UInt16 refCount; /* How many consumers have a reference to the node? */ + UA_Boolean deleted; /* Node was marked as deleted and can be deleted when refCount == 0 */ + UA_Node node; +} UA_NodeMapEntry; + +#define UA_NODEMAP_MINSIZE 64 +#define UA_NODEMAP_TOMBSTONE ((UA_NodeMapEntry*)0x01) + +typedef struct { + UA_NodeMapEntry *entry; + UA_UInt32 nodeIdHash; +} UA_NodeMapSlot; + +typedef struct { + UA_NodeMapSlot *slots; + UA_UInt32 size; + UA_UInt32 count; + UA_UInt32 sizePrimeIndex; + + /* Maps ReferenceTypeIndex to the NodeId of the ReferenceType */ + UA_NodeId referenceTypeIds[UA_REFERENCETYPESET_MAX]; + UA_Byte referenceTypeCounter; +} UA_NodeMap; + +/*********************/ +/* HashMap Utilities */ +/*********************/ + +/* The size of the hash-map is always a prime number. They are chosen to be + * close to the next power of 2. So the size ca. doubles with each prime. */ +static UA_UInt32 const primes[] = { + 7, 13, 31, 61, 127, 251, + 509, 1021, 2039, 4093, 8191, 16381, + 32749, 65521, 131071, 262139, 524287, 1048573, + 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, + 134217689, 268435399, 536870909, 1073741789, 2147483647, 4294967291 +}; + +static UA_UInt32 mod(UA_UInt32 h, UA_UInt32 size) { return h % size; } +static UA_UInt32 mod2(UA_UInt32 h, UA_UInt32 size) { return 1 + (h % (size - 2)); } + +static UA_UInt16 +higher_prime_index(UA_UInt32 n) { + UA_UInt16 low = 0; + UA_UInt16 high = (UA_UInt16)(sizeof(primes) / sizeof(UA_UInt32)); + while(low != high) { + UA_UInt16 mid = (UA_UInt16)(low + ((high - low) / 2)); + if(n > primes[mid]) + low = (UA_UInt16)(mid + 1); + else + high = mid; + } + return low; +} + +/* Returns an empty slot or null if the nodeid exists or if no empty slot is found. */ +static UA_NodeMapSlot * +findFreeSlot(const UA_NodeMap *ns, const UA_NodeId *nodeid) { + UA_UInt32 h = UA_NodeId_hash(nodeid); + UA_UInt32 size = ns->size; + UA_UInt64 idx = mod(h, size); /* Use 64bit container to avoid overflow */ + UA_UInt32 startIdx = (UA_UInt32)idx; + UA_UInt32 hash2 = mod2(h, size); + + UA_NodeMapSlot *candidate = NULL; + do { + UA_NodeMapSlot *slot = &ns->slots[(UA_UInt32)idx]; + + if(slot->entry > UA_NODEMAP_TOMBSTONE) { + /* A Node with the NodeId does already exist */ + if(slot->nodeIdHash == h && + UA_NodeId_equal(&slot->entry->node.head.nodeId, nodeid)) + return NULL; + } else { + /* Found a candidate node */ + if(!candidate) + candidate = slot; + /* No matching node can come afterwards */ + if(slot->entry == NULL) + return candidate; + } + + idx += hash2; + if(idx >= size) + idx -= size; + } while((UA_UInt32)idx != startIdx); + + return candidate; +} + +/* The occupancy of the table after the call will be about 50% */ +static UA_StatusCode +expand(UA_NodeMap *ns) { + UA_UInt32 osize = ns->size; + UA_UInt32 count = ns->count; + /* Resize only when table after removal of unused elements is either too + full or too empty */ + if(count * 2 < osize && (count * 8 > osize || osize <= UA_NODEMAP_MINSIZE)) + return UA_STATUSCODE_GOOD; + + UA_NodeMapSlot *oslots = ns->slots; + UA_UInt32 nindex = higher_prime_index(count * 2); + UA_UInt32 nsize = primes[nindex]; + UA_NodeMapSlot *nslots= (UA_NodeMapSlot*)UA_calloc(nsize, sizeof(UA_NodeMapSlot)); + if(!nslots) + return UA_STATUSCODE_BADOUTOFMEMORY; + + ns->slots = nslots; + ns->size = nsize; + ns->sizePrimeIndex = nindex; + + /* recompute the position of every entry and insert the pointer */ + for(size_t i = 0, j = 0; i < osize && j < count; ++i) { + if(oslots[i].entry <= UA_NODEMAP_TOMBSTONE) + continue; + UA_NodeMapSlot *s = findFreeSlot(ns, &oslots[i].entry->node.head.nodeId); + UA_assert(s); + *s = oslots[i]; + ++j; + } + + UA_free(oslots); + return UA_STATUSCODE_GOOD; +} + +static UA_NodeMapEntry * +createEntry(UA_NodeClass nodeClass) { + size_t size = sizeof(UA_NodeMapEntry) - sizeof(UA_Node); + switch(nodeClass) { + case UA_NODECLASS_OBJECT: + size += sizeof(UA_ObjectNode); + break; + case UA_NODECLASS_VARIABLE: + size += sizeof(UA_VariableNode); + break; + case UA_NODECLASS_METHOD: + size += sizeof(UA_MethodNode); + break; + case UA_NODECLASS_OBJECTTYPE: + size += sizeof(UA_ObjectTypeNode); + break; + case UA_NODECLASS_VARIABLETYPE: + size += sizeof(UA_VariableTypeNode); + break; + case UA_NODECLASS_REFERENCETYPE: + size += sizeof(UA_ReferenceTypeNode); + break; + case UA_NODECLASS_DATATYPE: + size += sizeof(UA_DataTypeNode); + break; + case UA_NODECLASS_VIEW: + size += sizeof(UA_ViewNode); + break; + default: + return NULL; + } + UA_NodeMapEntry *entry = (UA_NodeMapEntry*)UA_calloc(1, size); + if(!entry) + return NULL; + entry->node.head.nodeClass = nodeClass; + return entry; +} + +static void +deleteNodeMapEntry(UA_NodeMapEntry *entry) { + UA_Node_clear(&entry->node); + UA_free(entry); +} + +static void +cleanupNodeMapEntry(UA_NodeMapEntry *entry) { + if(entry->deleted && entry->refCount == 0) + deleteNodeMapEntry(entry); +} + +static UA_NodeMapSlot * +findOccupiedSlot(const UA_NodeMap *ns, const UA_NodeId *nodeid) { + UA_UInt32 h = UA_NodeId_hash(nodeid); + UA_UInt32 size = ns->size; + UA_UInt64 idx = mod(h, size); /* Use 64bit container to avoid overflow */ + UA_UInt32 hash2 = mod2(h, size); + UA_UInt32 startIdx = (UA_UInt32)idx; + + do { + UA_NodeMapSlot *slot= &ns->slots[(UA_UInt32)idx]; + if(slot->entry > UA_NODEMAP_TOMBSTONE) { + if(slot->nodeIdHash == h && + UA_NodeId_equal(&slot->entry->node.head.nodeId, nodeid)) + return slot; + } else { + if(slot->entry == NULL) + return NULL; /* No further entry possible */ + } + + idx += hash2; + if(idx >= size) + idx -= size; + } while((UA_UInt32)idx != startIdx); + + return NULL; +} + +/***********************/ +/* Interface functions */ +/***********************/ + +static UA_Node * +UA_NodeMap_newNode(void *context, UA_NodeClass nodeClass) { + UA_NodeMapEntry *entry = createEntry(nodeClass); + if(!entry) + return NULL; + return &entry->node; +} + +static void +UA_NodeMap_deleteNode(void *context, UA_Node *node) { + UA_NodeMapEntry *entry = container_of(node, UA_NodeMapEntry, node); + UA_assert(&entry->node == node); + deleteNodeMapEntry(entry); +} + +static const UA_Node * +UA_NodeMap_getNode(void *context, const UA_NodeId *nodeid) { + UA_NodeMap *ns = (UA_NodeMap*)context; + UA_NodeMapSlot *slot = findOccupiedSlot(ns, nodeid); + if(!slot) + return NULL; + ++slot->entry->refCount; + return &slot->entry->node; +} + +static void +UA_NodeMap_releaseNode(void *context, const UA_Node *node) { + if (!node) + return; + UA_NodeMapEntry *entry = container_of(node, UA_NodeMapEntry, node); + UA_assert(&entry->node == node); + UA_assert(entry->refCount > 0); + --entry->refCount; + cleanupNodeMapEntry(entry); +} + +static UA_StatusCode +UA_NodeMap_getNodeCopy(void *context, const UA_NodeId *nodeid, + UA_Node **outNode) { + UA_NodeMap *ns = (UA_NodeMap*)context; + UA_NodeMapSlot *slot = findOccupiedSlot(ns, nodeid); + if(!slot) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + UA_NodeMapEntry *entry = slot->entry; + UA_NodeMapEntry *newItem = createEntry(entry->node.head.nodeClass); + if(!newItem) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode retval = UA_Node_copy(&entry->node, &newItem->node); + if(retval == UA_STATUSCODE_GOOD) { + newItem->orig = entry; /* Store the pointer to the original */ + *outNode = &newItem->node; + } else { + deleteNodeMapEntry(newItem); + } + return retval; +} + +static UA_StatusCode +UA_NodeMap_removeNode(void *context, const UA_NodeId *nodeid) { + UA_NodeMap *ns = (UA_NodeMap*)context; + UA_NodeMapSlot *slot = findOccupiedSlot(ns, nodeid); + if(!slot) + return UA_STATUSCODE_BADNODEIDUNKNOWN; + + UA_NodeMapEntry *entry = slot->entry; + slot->entry = UA_NODEMAP_TOMBSTONE; + UA_atomic_sync(); /* Set the tombstone before cleaning up. E.g. if the + * nodestore is accessed from an interrupt. */ + entry->deleted = true; + cleanupNodeMapEntry(entry); + --ns->count; + /* Downsize the hashmap if it is very empty */ + if(ns->count * 8 < ns->size && ns->size > UA_NODEMAP_MINSIZE) + expand(ns); /* Can fail. Just continue with the bigger hashmap. */ + return UA_STATUSCODE_GOOD; +} + +/* + * If this function fails in any way, the node parameter is deleted here, + * so the caller function does not need to take care of it anymore + */ +static UA_StatusCode +UA_NodeMap_insertNode(void *context, UA_Node *node, + UA_NodeId *addedNodeId) { + UA_NodeMap *ns = (UA_NodeMap*)context; + if(ns->size * 3 <= ns->count * 4) { + if(expand(ns) != UA_STATUSCODE_GOOD){ + deleteNodeMapEntry(container_of(node, UA_NodeMapEntry, node)); + return UA_STATUSCODE_BADINTERNALERROR; + } + } + + UA_NodeMapSlot *slot; + if(node->head.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC && + node->head.nodeId.identifier.numeric == 0) { + /* Create a random nodeid: Start at least with 50,000 to make sure we + * don not conflict with nodes from the spec. If we find a conflict, we + * just try another identifier until we have tried all possible + * identifiers. Since the size is prime and we don't change the increase + * val, we will reach the starting id again. E.g. adding a nodeset will + * create children while there are still other nodes which need to be + * created. Thus the node ids may collide. */ + UA_UInt32 size = ns->size; + UA_UInt64 identifier = mod(50000 + size+1, UA_UINT32_MAX); /* Use 64bit to + * avoid overflow */ + UA_UInt32 increase = mod2(ns->count+1, size); + UA_UInt32 startId = (UA_UInt32)identifier; /* mod ensures us that the id + * is a valid 32 bit integer */ + + do { + node->head.nodeId.identifier.numeric = (UA_UInt32)identifier; + slot = findFreeSlot(ns, &node->head.nodeId); + if(slot) + break; + identifier += increase; + if(identifier >= size) + identifier -= size; + } while((UA_UInt32)identifier != startId); + } else { + slot = findFreeSlot(ns, &node->head.nodeId); + } + + if(!slot) { + deleteNodeMapEntry(container_of(node, UA_NodeMapEntry, node)); + return UA_STATUSCODE_BADNODEIDEXISTS; + } + + /* Copy the NodeId */ + UA_StatusCode retval = UA_STATUSCODE_GOOD; + if(addedNodeId) { + retval = UA_NodeId_copy(&node->head.nodeId, addedNodeId); + if(retval != UA_STATUSCODE_GOOD) { + deleteNodeMapEntry(container_of(node, UA_NodeMapEntry, node)); + return retval; + } + } + + /* For new ReferencetypeNodes add to the index map */ + if(node->head.nodeClass == UA_NODECLASS_REFERENCETYPE) { + UA_ReferenceTypeNode *refNode = &node->referenceTypeNode; + if(ns->referenceTypeCounter >= UA_REFERENCETYPESET_MAX) { + deleteNodeMapEntry(container_of(node, UA_NodeMapEntry, node)); + return UA_STATUSCODE_BADINTERNALERROR; + } + + retval = UA_NodeId_copy(&node->head.nodeId, &ns->referenceTypeIds[ns->referenceTypeCounter]); + if(retval != UA_STATUSCODE_GOOD) { + deleteNodeMapEntry(container_of(node, UA_NodeMapEntry, node)); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Assign the ReferenceTypeIndex to the new ReferenceTypeNode */ + refNode->referenceTypeIndex = ns->referenceTypeCounter; + refNode->subTypes = UA_REFTYPESET(ns->referenceTypeCounter); + + ns->referenceTypeCounter++; + } + + /* Insert the node */ + UA_NodeMapEntry *newEntry = container_of(node, UA_NodeMapEntry, node); + slot->nodeIdHash = UA_NodeId_hash(&node->head.nodeId); + UA_atomic_sync(); /* Set the hash first */ + slot->entry = newEntry; + ++ns->count; + return retval; +} + +static UA_StatusCode +UA_NodeMap_replaceNode(void *context, UA_Node *node) { + UA_NodeMap *ns = (UA_NodeMap*)context; + UA_NodeMapEntry *newEntry = container_of(node, UA_NodeMapEntry, node); + + /* Find the node */ + UA_NodeMapSlot *slot = findOccupiedSlot(ns, &node->head.nodeId); + if(!slot) { + deleteNodeMapEntry(newEntry); + return UA_STATUSCODE_BADNODEIDUNKNOWN; + } + + /* The node was already updated since the copy was made? */ + UA_NodeMapEntry *oldEntry = slot->entry; + if(oldEntry != newEntry->orig) { + deleteNodeMapEntry(newEntry); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* Replace the entry */ + slot->entry = newEntry; + UA_atomic_sync(); + oldEntry->deleted = true; + cleanupNodeMapEntry(oldEntry); + return UA_STATUSCODE_GOOD; +} + +static const UA_NodeId * +UA_NodeMap_getReferenceTypeId(void *nsCtx, UA_Byte refTypeIndex) { + UA_NodeMap *ns = (UA_NodeMap*)nsCtx; + if(refTypeIndex > ns->referenceTypeCounter) + return NULL; + return &ns->referenceTypeIds[refTypeIndex]; +} + +static void +UA_NodeMap_iterate(void *context, UA_NodestoreVisitor visitor, + void *visitorContext) { + UA_NodeMap *ns = (UA_NodeMap*)context; + for(UA_UInt32 i = 0; i < ns->size; ++i) { + UA_NodeMapSlot *slot = &ns->slots[i]; + if(slot->entry > UA_NODEMAP_TOMBSTONE) { + /* The visitor can delete the node. So refcount here. */ + slot->entry->refCount++; + visitor(visitorContext, &slot->entry->node); + slot->entry->refCount--; + cleanupNodeMapEntry(slot->entry); + } + } +} + +static void +UA_NodeMap_delete(void *context) { + /* Already cleaned up? */ + if(!context) + return; + + UA_NodeMap *ns = (UA_NodeMap*)context; + UA_UInt32 size = ns->size; + UA_NodeMapSlot *slots = ns->slots; + for(UA_UInt32 i = 0; i < size; ++i) { + if(slots[i].entry > UA_NODEMAP_TOMBSTONE) { + /* On debugging builds, check that all nodes were release */ + UA_assert(slots[i].entry->refCount == 0); + /* Delete the node */ + deleteNodeMapEntry(slots[i].entry); + } + } + UA_free(ns->slots); + + /* Clean up the ReferenceTypes index array */ + for(size_t i = 0; i < ns->referenceTypeCounter; i++) + UA_NodeId_clear(&ns->referenceTypeIds[i]); + + UA_free(ns); +} + +UA_StatusCode +UA_Nodestore_HashMap(UA_Nodestore *ns) { + /* Allocate and initialize the nodemap */ + UA_NodeMap *nodemap = (UA_NodeMap*)UA_malloc(sizeof(UA_NodeMap)); + if(!nodemap) + return UA_STATUSCODE_BADOUTOFMEMORY; + nodemap->sizePrimeIndex = higher_prime_index(UA_NODEMAP_MINSIZE); + nodemap->size = primes[nodemap->sizePrimeIndex]; + nodemap->count = 0; + nodemap->slots = (UA_NodeMapSlot*) + UA_calloc(nodemap->size, sizeof(UA_NodeMapSlot)); + if(!nodemap->slots) { + UA_free(nodemap); + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + nodemap->referenceTypeCounter = 0; + + /* Populate the nodestore */ + ns->context = nodemap; + ns->clear = UA_NodeMap_delete; + ns->newNode = UA_NodeMap_newNode; + ns->deleteNode = UA_NodeMap_deleteNode; + ns->getNode = UA_NodeMap_getNode; + ns->releaseNode = UA_NodeMap_releaseNode; + ns->getNodeCopy = UA_NodeMap_getNodeCopy; + ns->insertNode = UA_NodeMap_insertNode; + ns->replaceNode = UA_NodeMap_replaceNode; + ns->removeNode = UA_NodeMap_removeNode; + ns->getReferenceTypeId = UA_NodeMap_getReferenceTypeId; + ns->iterate = UA_NodeMap_iterate; + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_config_default.c" ***********************************/ + +/* 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) Julian Grothoff + * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2019 (c) Kalycito Infotech Private Limited + * Copyright 2017-2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Wind River Systems, Inc. + */ + +#ifdef UA_ENABLE_WEBSOCKET_SERVER +#endif + +/* Struct initialization works across ANSI C/C99/C++ if it is done when the + * variable is first declared. Assigning values to existing structs is + * heterogeneous across the three. */ +static UA_INLINE UA_UInt32Range +UA_UINT32RANGE(UA_UInt32 min, UA_UInt32 max) { + UA_UInt32Range range = {min, max}; + return range; +} + +static UA_INLINE UA_DurationRange +UA_DURATIONRANGE(UA_Duration min, UA_Duration max) { + UA_DurationRange range = {min, max}; + return range; +} + +UA_Server * +UA_Server_new() { + UA_ServerConfig config; + memset(&config, 0, sizeof(UA_ServerConfig)); + /* Set a default logger and NodeStore for the initialization */ + config.logger = UA_Log_Stdout_; + if(UA_STATUSCODE_GOOD != UA_Nodestore_HashMap(&config.nodestore)) { + return NULL; + } + + return UA_Server_newWithConfig(&config); +} + +/*******************************/ +/* Default Connection Settings */ +/*******************************/ + +const UA_ConnectionConfig UA_ConnectionConfig_default = { + 0, /* .protocolVersion */ + 65535, /* .sendBufferSize, 64k per chunk */ + 65535, /* .recvBufferSize, 64k per chunk */ + 0, /* .localMaxMessageSize, 0 -> unlimited */ + 0, /* .remoteMaxMessageSize, 0 -> unlimited */ + 0, /* .localMaxChunkCount, 0 -> unlimited */ + 0 /* .remoteMaxChunkCount, 0 -> unlimited */ +}; + +/***************************/ +/* Default Server Settings */ +/***************************/ + +#define MANUFACTURER_NAME "open62541" +#define PRODUCT_NAME "open62541 OPC UA Server" +#define PRODUCT_URI "http://open62541.org" +#define APPLICATION_NAME "open62541-based OPC UA Application" +#define APPLICATION_URI "urn:unconfigured:application" +#define APPLICATION_URI_SERVER "urn:open62541.server.application" + +#define STRINGIFY(arg) #arg +#define VERSION(MAJOR, MINOR, PATCH, LABEL) \ + STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL + +static UA_StatusCode +createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, + const UA_SecurityPolicy *securityPolicy, + UA_MessageSecurityMode securityMode) { + UA_EndpointDescription_init(endpoint); + + endpoint->securityMode = securityMode; + UA_String_copy(&securityPolicy->policyUri, &endpoint->securityPolicyUri); + endpoint->transportProfileUri = + UA_STRING_ALLOC("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); + + /* Add security level value for the corresponding message security mode */ + endpoint->securityLevel = (UA_Byte) securityMode; + + /* Enable all login mechanisms from the access control plugin */ + UA_StatusCode retval = UA_Array_copy(conf->accessControl.userTokenPolicies, + conf->accessControl.userTokenPoliciesSize, + (void **)&endpoint->userIdentityTokens, + &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); + if(retval != UA_STATUSCODE_GOOD){ + UA_String_clear(&endpoint->securityPolicyUri); + UA_String_clear(&endpoint->transportProfileUri); + return retval; + } + endpoint->userIdentityTokensSize = conf->accessControl.userTokenPoliciesSize; + + UA_String_copy(&securityPolicy->localCertificate, &endpoint->serverCertificate); + UA_ApplicationDescription_copy(&conf->applicationDescription, &endpoint->server); + + return UA_STATUSCODE_GOOD; +} + +static const size_t usernamePasswordsSize = 2; +static UA_UsernamePasswordLogin usernamePasswords[2] = { + {UA_STRING_STATIC("user1"), UA_STRING_STATIC("password")}, + {UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1")}}; + +static UA_StatusCode +setDefaultConfig(UA_ServerConfig *conf) { + if(!conf) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + if(conf->nodestore.context == NULL) + UA_Nodestore_HashMap(&conf->nodestore); + + /* --> Start setting the default static config <-- */ + /* Allow user to set his own logger */ + if(!conf->logger.log) + conf->logger = UA_Log_Stdout_; + + conf->shutdownDelay = 0.0; + + /* Server Description */ + UA_BuildInfo_clear(&conf->buildInfo); + conf->buildInfo.productUri = UA_STRING_ALLOC(PRODUCT_URI); + conf->buildInfo.manufacturerName = UA_STRING_ALLOC(MANUFACTURER_NAME); + conf->buildInfo.productName = UA_STRING_ALLOC(PRODUCT_NAME); + conf->buildInfo.softwareVersion = + UA_STRING_ALLOC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR, + UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)); +#ifdef UA_PACK_DEBIAN + conf->buildInfo.buildNumber = UA_STRING_ALLOC("deb"); +#else + conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__); +#endif + conf->buildInfo.buildDate = UA_DateTime_now(); + + UA_ApplicationDescription_clear(&conf->applicationDescription); + conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER); + conf->applicationDescription.productUri = UA_STRING_ALLOC(PRODUCT_URI); + conf->applicationDescription.applicationName = + UA_LOCALIZEDTEXT_ALLOC("en", APPLICATION_NAME); + conf->applicationDescription.applicationType = UA_APPLICATIONTYPE_SERVER; + /* conf->applicationDescription.gatewayServerUri = UA_STRING_NULL; */ + /* conf->applicationDescription.discoveryProfileUri = UA_STRING_NULL; */ + /* conf->applicationDescription.discoveryUrlsSize = 0; */ + /* conf->applicationDescription.discoveryUrls = NULL; */ + +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + UA_MdnsDiscoveryConfiguration_clear(&conf->mdnsConfig); + conf->mdnsInterfaceIP = UA_STRING_NULL; +# if !defined(UA_HAS_GETIFADDR) + conf->mdnsIpAddressList = NULL; + conf->mdnsIpAddressListSize = 0; +# endif +#endif + + /* Custom DataTypes */ + /* conf->customDataTypesSize = 0; */ + /* conf->customDataTypes = NULL; */ + + /* Networking */ + /* conf->networkLayersSize = 0; */ + /* conf->networkLayers = NULL; */ + /* conf->customHostname = UA_STRING_NULL; */ + + /* Endpoints */ + /* conf->endpoints = {0, NULL}; */ + + /* Certificate Verification that accepts every certificate. Can be + * overwritten when the policy is specialized. */ + UA_CertificateVerification_AcceptAll(&conf->certificateVerification); + + /* * Global Node Lifecycle * */ + /* conf->nodeLifecycle.constructor = NULL; */ + /* conf->nodeLifecycle.destructor = NULL; */ + /* conf->nodeLifecycle.createOptionalChild = NULL; */ + /* conf->nodeLifecycle.generateChildNodeId = NULL; */ + + /* Limits for SecureChannels */ + conf->maxSecureChannels = 40; + conf->maxSecurityTokenLifetime = 10 * 60 * 1000; /* 10 minutes */ + + /* Limits for Sessions */ + conf->maxSessions = 100; + conf->maxSessionTimeout = 60.0 * 60.0 * 1000.0; /* 1h */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* Limits for Subscriptions */ + conf->publishingIntervalLimits = UA_DURATIONRANGE(100.0, 3600.0 * 1000.0); + conf->lifeTimeCountLimits = UA_UINT32RANGE(3, 15000); + conf->keepAliveCountLimits = UA_UINT32RANGE(1, 100); + conf->maxNotificationsPerPublish = 1000; + conf->enableRetransmissionQueue = true; + conf->maxRetransmissionQueueSize = 0; /* unlimited */ +# ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + conf->maxEventsPerNode = 0; /* unlimited */ +# endif + + /* Limits for MonitoredItems */ + conf->samplingIntervalLimits = UA_DURATIONRANGE(50.0, 24.0 * 3600.0 * 1000.0); + conf->queueSizeLimits = UA_UINT32RANGE(1, 100); +#endif + +#ifdef UA_ENABLE_DISCOVERY + conf->discoveryCleanupTimeout = 60 * 60; +#endif + +#ifdef UA_ENABLE_HISTORIZING + /* conf->accessHistoryDataCapability = UA_FALSE; */ + /* conf->maxReturnDataValues = 0; */ + + /* conf->accessHistoryEventsCapability = UA_FALSE; */ + /* conf->maxReturnEventValues = 0; */ + + /* conf->insertDataCapability = UA_FALSE; */ + /* conf->insertEventCapability = UA_FALSE; */ + /* conf->insertAnnotationsCapability = UA_FALSE; */ + + /* conf->replaceDataCapability = UA_FALSE; */ + /* conf->replaceEventCapability = UA_FALSE; */ + + /* conf->updateDataCapability = UA_FALSE; */ + /* conf->updateEventCapability = UA_FALSE; */ + + /* conf->deleteRawCapability = UA_FALSE; */ + /* conf->deleteEventCapability = UA_FALSE; */ + /* conf->deleteAtTimeDataCapability = UA_FALSE; */ +#endif + +#if UA_MULTITHREADING >= 100 + conf->maxAsyncOperationQueueSize = 0; + conf->asyncOperationTimeout = 120000; /* Async Operation Timeout in ms (2 minutes) */ +#endif + + /* --> Finish setting the default static config <-- */ + + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_setBasics(UA_ServerConfig* conf) { + UA_StatusCode res = setDefaultConfig(conf); + UA_LOG_WARNING(&conf->logger, UA_LOGCATEGORY_USERLAND, + "AcceptAll Certificate Verification. " + "Any remote certificate will be accepted."); + return res; +} + +static UA_StatusCode +addDefaultNetworkLayers(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { + return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, recvBufferSize); +} + +#ifdef UA_ENABLE_WEBSOCKET_SERVER +UA_EXPORT UA_StatusCode +UA_ServerConfig_addNetworkLayerWS(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize, const UA_ByteString* certificate, const UA_ByteString* privateKey) { + /* Add a network layer */ + UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) + UA_realloc(conf->networkLayers, + sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayers = tmp; + + UA_ConnectionConfig config = UA_ConnectionConfig_default; + if(sendBufferSize > 0) + config.sendBufferSize = sendBufferSize; + if(recvBufferSize > 0) + config.recvBufferSize = recvBufferSize; + + conf->networkLayers[conf->networkLayersSize] = + UA_ServerNetworkLayerWS(config, portNumber, certificate, privateKey); + if(!conf->networkLayers[conf->networkLayersSize].handle) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayersSize++; + + return UA_STATUSCODE_GOOD; +} +#endif + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { + /* Add a network layer */ + UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) + UA_realloc(conf->networkLayers, + sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayers = tmp; + + UA_ConnectionConfig config = UA_ConnectionConfig_default; + if (sendBufferSize > 0) + config.sendBufferSize = sendBufferSize; + if (recvBufferSize > 0) + config.recvBufferSize = recvBufferSize; + + conf->networkLayers[conf->networkLayersSize] = + UA_ServerNetworkLayerTCP(config, portNumber, 0); + if (!conf->networkLayers[conf->networkLayersSize].handle) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayersSize++; + + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + const UA_ByteString *certificate) { + /* Allocate the SecurityPolicies */ + UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) + UA_realloc(config->securityPolicies, + sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; + + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + UA_StatusCode retval = + UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + return retval; + } + + config->securityPoliciesSize++; + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, + UA_MessageSecurityMode securityMode) { + /* Allocate the endpoint */ + UA_EndpointDescription *tmp = (UA_EndpointDescription *) + UA_realloc(config->endpoints, + sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + config->endpoints = tmp; + + /* Lookup the security policy */ + const UA_SecurityPolicy *policy = NULL; + for (size_t i = 0; i < config->securityPoliciesSize; ++i) { + if (UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { + policy = &config->securityPolicies[i]; + break; + } + } + if (!policy) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Populate the endpoint */ + UA_StatusCode retval = + createEndpoint(config, &config->endpoints[config->endpointsSize], + policy, securityMode); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config) { + /* Allocate the endpoints */ + UA_EndpointDescription * tmp = (UA_EndpointDescription *) + UA_realloc(config->endpoints, + sizeof(UA_EndpointDescription) * + (2 * config->securityPoliciesSize + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + config->endpoints = tmp; + + /* Populate the endpoints */ + for(size_t i = 0; i < config->securityPoliciesSize; ++i) { + if(UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, &config->securityPolicies[i].policyUri)) { + UA_StatusCode retval = + createEndpoint(config, &config->endpoints[config->endpointsSize], + &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + } else { + UA_StatusCode retval = + createEndpoint(config, &config->endpoints[config->endpointsSize], + &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + + retval = createEndpoint(config, &config->endpoints[config->endpointsSize], + &config->securityPolicies[i], + UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + } + } + + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNumber, + const UA_ByteString *certificate, + UA_UInt32 sendBufferSize, + UA_UInt32 recvBufferSize) { + if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_StatusCode retval = setDefaultConfig(config); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + retval = addDefaultNetworkLayers(config, portNumber, sendBufferSize, recvBufferSize); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + /* Allocate the SecurityPolicies */ + retval = UA_ServerConfig_addSecurityPolicyNone(config, certificate); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + /* Initialize the Access Control plugin */ + retval = UA_AccessControl_default(config, true, + &config->securityPolicies[config->securityPoliciesSize-1].policyUri, + usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + /* Allocate the endpoint */ + retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, + UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "AcceptAll Certificate Verification. " + "Any remote certificate will be accepted."); + + return UA_STATUSCODE_GOOD; +} + +#ifdef UA_ENABLE_ENCRYPTION + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + /* Allocate the SecurityPolicies */ + UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) + UA_realloc(config->securityPolicies, + sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; + + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) + localPrivateKey = *privateKey; + UA_StatusCode retval = + UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, localPrivateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + return retval; + } + + config->securityPoliciesSize++; + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + /* Allocate the SecurityPolicies */ + UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) + UA_realloc(config->securityPolicies, + sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; + + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) + localPrivateKey = *privateKey; + UA_StatusCode retval = + UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, localPrivateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + return retval; + } + + config->securityPoliciesSize++; + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + /* Allocate the SecurityPolicies */ + UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) + UA_realloc(config->securityPolicies, + sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; + + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) + localPrivateKey = *privateKey; + UA_StatusCode retval = + UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, localPrivateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + return retval; + } + + config->securityPoliciesSize++; + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyAes128Sha256RsaOaep(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + /* Allocate the SecurityPolicies */ + UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) + UA_realloc(config->securityPolicies, + sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; + + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) + localPrivateKey = *privateKey; + UA_StatusCode retval = + UA_SecurityPolicy_Aes128Sha256RsaOaep(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, localPrivateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + return retval; + } + + config->securityPoliciesSize++; + return UA_STATUSCODE_GOOD; +} + +/* Always returns UA_STATUSCODE_GOOD. Logs a warning if policies could not be added. */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) + localPrivateKey = *privateKey; + + UA_StatusCode retval = UA_ServerConfig_addSecurityPolicyNone(config, &localCertificate); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#None with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_ServerConfig_addSecurityPolicyBasic128Rsa15(config, &localCertificate, &localPrivateKey); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic128Rsa15 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_ServerConfig_addSecurityPolicyBasic256(config, &localCertificate, &localPrivateKey); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic256 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_ServerConfig_addSecurityPolicyBasic256Sha256(config, &localCertificate, &localPrivateKey); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic256Sha256 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_ServerConfig_addSecurityPolicyAes128Sha256RsaOaep(config, &localCertificate, &localPrivateKey); + if(retval != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Aes128Sha256RsaOaep with error code %s", + UA_StatusCode_name(retval)); + } + + return UA_STATUSCODE_GOOD; +} + +UA_EXPORT UA_StatusCode +UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, + UA_UInt16 portNumber, + const UA_ByteString *certificate, + const UA_ByteString *privateKey, + const UA_ByteString *trustList, + size_t trustListSize, + const UA_ByteString *issuerList, + size_t issuerListSize, + const UA_ByteString *revocationList, + size_t revocationListSize) { + UA_StatusCode retval = setDefaultConfig(conf); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + + retval = UA_CertificateVerification_Trustlist(&conf->certificateVerification, + trustList, trustListSize, + issuerList, issuerListSize, + revocationList, revocationListSize); + if (retval != UA_STATUSCODE_GOOD) + return retval; + + retval = addDefaultNetworkLayers(conf, portNumber, 0, 0); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + + retval = UA_ServerConfig_addAllSecurityPolicies(conf, certificate, privateKey); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + + retval = UA_AccessControl_default(conf, true, + &conf->securityPolicies[conf->securityPoliciesSize-1].policyUri, + usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + + retval = UA_ServerConfig_addAllEndpoints(conf); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + + return UA_STATUSCODE_GOOD; +} + +#endif + +/***************************/ +/* Default Client Settings */ +/***************************/ + +UA_Client * UA_Client_new() { + UA_ClientConfig config; + memset(&config, 0, sizeof(UA_ClientConfig)); + config.logger.log = UA_Log_Stdout_log; + config.logger.context = NULL; + config.logger.clear = UA_Log_Stdout_clear; + return UA_Client_newWithConfig(&config); +} + +UA_StatusCode +UA_ClientConfig_setDefault(UA_ClientConfig *config) { + config->timeout = 5000; + config->secureChannelLifeTime = 10 * 60 * 1000; /* 10 minutes */ + + if(!config->logger.log) { + config->logger.log = UA_Log_Stdout_log; + config->logger.context = NULL; + config->logger.clear = UA_Log_Stdout_clear; + } + + config->localConnectionConfig = UA_ConnectionConfig_default; + + /* Certificate Verification that accepts every certificate. Can be + * overwritten when the policy is specialized. */ + UA_CertificateVerification_AcceptAll(&config->certificateVerification); + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "AcceptAll Certificate Verification. " + "Any remote certificate will be accepted."); + + /* With encryption enabled, the applicationUri needs to match the URI from + * the certificate */ + config->clientDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI); + config->clientDescription.applicationType = UA_APPLICATIONTYPE_CLIENT; + + if(config->securityPoliciesSize > 0) { + UA_LOG_ERROR(&config->logger, UA_LOGCATEGORY_NETWORK, + "Could not initialize a config that already has SecurityPolicies"); + return UA_STATUSCODE_BADINTERNALERROR; + } + + config->securityPolicies = (UA_SecurityPolicy*)UA_malloc(sizeof(UA_SecurityPolicy)); + if(!config->securityPolicies) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode retval = UA_SecurityPolicy_None(config->securityPolicies, + UA_BYTESTRING_NULL, &config->logger); + if(retval != UA_STATUSCODE_GOOD) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + return retval; + } + config->securityPoliciesSize = 1; + + config->initConnectionFunc = UA_ClientConnectionTCP_init; /* for async client */ + config->pollConnectionFunc = UA_ClientConnectionTCP_poll; /* for async connection */ + + config->customDataTypes = NULL; + config->stateCallback = NULL; + config->connectivityCheckInterval = 0; + + config->requestedSessionTimeout = 1200000; /* requestedSessionTimeout */ + + config->inactivityCallback = NULL; + config->clientContext = NULL; + +#ifdef UA_ENABLE_SUBSCRIPTIONS + config->outStandingPublishRequests = 10; + config->subscriptionInactivityCallback = NULL; +#endif + + return UA_STATUSCODE_GOOD; +} + +#ifdef UA_ENABLE_ENCRYPTION +UA_StatusCode +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) { + UA_StatusCode retval = UA_ClientConfig_setDefault(config); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_CertificateVerification_Trustlist(&config->certificateVerification, + trustList, trustListSize, + NULL, 0, + revocationList, revocationListSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Populate SecurityPolicies */ + UA_SecurityPolicy *sp = (UA_SecurityPolicy*) + UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * 5); + if(!sp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = sp; + + retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, privateKey, &config->logger); + if(retval == UA_STATUSCODE_GOOD) { + ++config->securityPoliciesSize; + } else { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic128Rsa15 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, privateKey, &config->logger); + if(retval == UA_STATUSCODE_GOOD) { + ++config->securityPoliciesSize; + } else { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic256 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, privateKey, &config->logger); + if(retval == UA_STATUSCODE_GOOD) { + ++config->securityPoliciesSize; + } else { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Basic256Sha256 with error code %s", + UA_StatusCode_name(retval)); + } + + retval = UA_SecurityPolicy_Aes128Sha256RsaOaep(&config->securityPolicies[config->securityPoliciesSize], + localCertificate, privateKey, &config->logger); + if(retval == UA_STATUSCODE_GOOD) { + ++config->securityPoliciesSize; + } else { + UA_LOG_WARNING(&config->logger, UA_LOGCATEGORY_USERLAND, + "Could not add SecurityPolicy#Aes128Sha256RsaOaep with error code %s", + UA_StatusCode_name(retval)); + } + + if(config->securityPoliciesSize == 0) { + UA_free(config->securityPolicies); + config->securityPolicies = NULL; + } + + return UA_STATUSCODE_GOOD; +} +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/ua_pki_none.c" ***********************************/ + +/* 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 2020 (c) Julius Pfrommer, Fraunhofer IOSB + */ + + +static UA_StatusCode +verifyCertificateAllowAll(void *verificationContext, + const UA_ByteString *certificate) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +verifyApplicationURIAllowAll(void *verificationContext, + const UA_ByteString *certificate, + const UA_String *applicationURI) { + return UA_STATUSCODE_GOOD; +} + +static void +clearVerifyAllowAll(UA_CertificateVerification *cv) { + +} + +void UA_CertificateVerification_AcceptAll(UA_CertificateVerification *cv) { + cv->verifyCertificate = verifyCertificateAllowAll; + cv->verifyApplicationURI = verifyApplicationURIAllowAll; + cv->clear = clearVerifyAllowAll; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/crypto/ua_securitypolicy_none.c" ***********************************/ + +/* 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-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS +#endif + +#ifdef UA_ENABLE_ENCRYPTION_OPENSSL +#endif + +static UA_StatusCode +verify_none(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + const UA_ByteString *message, + const UA_ByteString *signature) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +sign_none(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + const UA_ByteString *message, + UA_ByteString *signature) { + return UA_STATUSCODE_GOOD; +} + +static size_t +length_none(const UA_SecurityPolicy *securityPolicy, + const void *channelContext) { + return 0; +} + +static UA_StatusCode +encrypt_none(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + UA_ByteString *data) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +decrypt_none(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + UA_ByteString *data) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +makeThumbprint_none(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +compareThumbprint_none(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +generateKey_none(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, + const UA_ByteString *seed, + UA_ByteString *out) { + return UA_STATUSCODE_GOOD; +} + +/* Use the non-cryptographic RNG to set the nonce */ +static UA_StatusCode +generateNonce_none(const UA_SecurityPolicy *securityPolicy, UA_ByteString *out) { + if(securityPolicy == NULL || out == NULL) + return UA_STATUSCODE_BADINTERNALERROR; + + if(out->length == 0) + return UA_STATUSCODE_GOOD; + + /* Fill blocks of four byte */ + size_t i = 0; + while(i + 3 < out->length) { + UA_UInt32 randNumber = UA_UInt32_random(); + memcpy(&out->data[i], &randNumber, 4); + i = i+4; + } + + /* Fill the remaining byte */ + UA_UInt32 randNumber = UA_UInt32_random(); + memcpy(&out->data[i], &randNumber, out->length % 4); + + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +newContext_none(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **channelContext) { + return UA_STATUSCODE_GOOD; +} + +static void +deleteContext_none(void *channelContext) { +} + +static UA_StatusCode +setContextValue_none(void *channelContext, + const UA_ByteString *key) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +compareCertificate_none(const void *channelContext, + const UA_ByteString *certificate) { + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +updateCertificateAndPrivateKey_none(UA_SecurityPolicy *policy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey) { + UA_ByteString_clear(&policy->localCertificate); + UA_ByteString_copy(&newCertificate, &policy->localCertificate); + return UA_STATUSCODE_GOOD; +} + + +static void +policy_clear_none(UA_SecurityPolicy *policy) { + UA_ByteString_clear(&policy->localCertificate); +} + +UA_StatusCode +UA_SecurityPolicy_None(UA_SecurityPolicy *policy, const UA_ByteString localCertificate, + const UA_Logger *logger) { + policy->policyContext = (void *)(uintptr_t)logger; + policy->policyUri = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#None"); + policy->logger = logger; + +#ifdef UA_ENABLE_ENCRYPTION_MBEDTLS + UA_mbedTLS_LoadLocalCertificate(&localCertificate, &policy->localCertificate); +#elif defined(UA_ENABLE_ENCRYPTION_OPENSSL) + UA_OpenSSL_LoadLocalCertificate(&localCertificate, &policy->localCertificate); +#else + UA_ByteString_copy(&localCertificate, &policy->localCertificate); +#endif + + policy->symmetricModule.generateKey = generateKey_none; + policy->symmetricModule.generateNonce = generateNonce_none; + + UA_SecurityPolicySignatureAlgorithm *sym_signatureAlgorithm = + &policy->symmetricModule.cryptoModule.signatureAlgorithm; + sym_signatureAlgorithm->uri = UA_STRING_NULL; + sym_signatureAlgorithm->verify = verify_none; + sym_signatureAlgorithm->sign = sign_none; + sym_signatureAlgorithm->getLocalSignatureSize = length_none; + sym_signatureAlgorithm->getRemoteSignatureSize = length_none; + sym_signatureAlgorithm->getLocalKeyLength = length_none; + sym_signatureAlgorithm->getRemoteKeyLength = length_none; + + UA_SecurityPolicyEncryptionAlgorithm *sym_encryptionAlgorithm = + &policy->symmetricModule.cryptoModule.encryptionAlgorithm; + sym_encryptionAlgorithm->uri = UA_STRING_NULL; + sym_encryptionAlgorithm->encrypt = encrypt_none; + sym_encryptionAlgorithm->decrypt = decrypt_none; + sym_encryptionAlgorithm->getLocalKeyLength = length_none; + sym_encryptionAlgorithm->getRemoteKeyLength = length_none; + sym_encryptionAlgorithm->getLocalBlockSize = length_none; + sym_encryptionAlgorithm->getRemoteBlockSize = length_none; + sym_encryptionAlgorithm->getLocalPlainTextBlockSize = length_none; + sym_encryptionAlgorithm->getRemotePlainTextBlockSize = length_none; + policy->symmetricModule.secureChannelNonceLength = 0; + + policy->asymmetricModule.makeCertificateThumbprint = makeThumbprint_none; + policy->asymmetricModule.compareCertificateThumbprint = compareThumbprint_none; + + // This only works for none since symmetric and asymmetric crypto modules do the same i.e. nothing + policy->asymmetricModule.cryptoModule = policy->symmetricModule.cryptoModule; + + // Use the same signing algorithm as for asymmetric signing + policy->certificateSigningAlgorithm = policy->asymmetricModule.cryptoModule.signatureAlgorithm; + + policy->channelModule.newContext = newContext_none; + policy->channelModule.deleteContext = deleteContext_none; + policy->channelModule.setLocalSymEncryptingKey = setContextValue_none; + policy->channelModule.setLocalSymSigningKey = setContextValue_none; + policy->channelModule.setLocalSymIv = setContextValue_none; + policy->channelModule.setRemoteSymEncryptingKey = setContextValue_none; + policy->channelModule.setRemoteSymSigningKey = setContextValue_none; + policy->channelModule.setRemoteSymIv = setContextValue_none; + policy->channelModule.compareCertificate = compareCertificate_none; + policy->updateCertificateAndPrivateKey = updateCertificateAndPrivateKey_none; + policy->clear = policy_clear_none; + + return UA_STATUSCODE_GOOD; +} + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/ua_log_syslog.c" ***********************************/ + +/* 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 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + +#if defined(__linux__) || defined(__unix__) + +#include <syslog.h> + +const char *syslogLevelNames[6] = {"trace", "debug", "info", + "warn", "error", "fatal"}; +const char *syslogCategoryNames[7] = {"network", "channel", "session", "server", + "client", "userland", "securitypolicy"}; + +#ifdef __clang__ +__attribute__((__format__(__printf__, 4 , 0))) +#endif +static void +UA_Log_Syslog_log(void *context, UA_LogLevel level, UA_LogCategory category, + const char *msg, va_list args) { + /* Assume that context is casted to UA_LogLevel */ + if(context != NULL && (UA_LogLevel)(uintptr_t)context > level) + return; + + int priority = LOG_INFO; + switch(level) { + case UA_LOGLEVEL_DEBUG: + priority = LOG_DEBUG; + break; + case UA_LOGLEVEL_INFO: + priority = LOG_INFO; + break; + case UA_LOGLEVEL_WARNING: + priority = LOG_WARNING; + break; + case UA_LOGLEVEL_ERROR: + priority = LOG_ERR; + break; + case UA_LOGLEVEL_FATAL: + priority = LOG_CRIT; + break; + case UA_LOGLEVEL_TRACE: + default: + return; + } + +#define LOGBUFSIZE 512 + char logbuf[LOGBUFSIZE]; + int pos = snprintf(logbuf, LOGBUFSIZE, "[%s/%s] ", + syslogLevelNames[level], syslogCategoryNames[category]); + if(pos < 0) { + syslog(LOG_WARNING, "Log message too long for syslog"); + return; + } + pos = vsnprintf(&logbuf[pos], LOGBUFSIZE - (size_t)pos, msg, args); + if(pos < 0) { + syslog(LOG_WARNING, "Log message too long for syslog"); + return; + } + + syslog(priority, "%s", logbuf); +} + +static void +UA_Log_Syslog_clear(void *logContext) { + /* closelog is optional. We don't use it as several loggers might be + * instantiated in parallel. */ + /* closelog(); */ +} + +UA_Logger +UA_Log_Syslog(void) { + return UA_Log_Syslog_withLevel(UA_LOGLEVEL_TRACE); +} + +UA_Logger +UA_Log_Syslog_withLevel(UA_LogLevel minlevel) { + UA_Logger logger = {UA_Log_Syslog_log, (void*)minlevel, UA_Log_Syslog_clear}; + return logger; +} + +#endif + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/posix/ua_clock.c" ***********************************/ + +/* 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 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + */ + +#ifdef UA_ARCHITECTURE_POSIX + + +#include <time.h> +#include <sys/time.h> + +#if defined(__APPLE__) || defined(__MACH__) +# include <mach/clock.h> +# include <mach/mach.h> +#endif + +UA_DateTime UA_DateTime_now(void) { + struct timeval tv; + gettimeofday(&tv, NULL); + return (tv.tv_sec * UA_DATETIME_SEC) + (tv.tv_usec * UA_DATETIME_USEC) + UA_DATETIME_UNIX_EPOCH; +} + +/* Credit to https://stackoverflow.com/questions/13804095/get-the-time-zone-gmt-offset-in-c */ +UA_Int64 UA_DateTime_localTimeUtcOffset(void) { + time_t gmt, rawtime = time(NULL); + struct tm *ptm; + struct tm gbuf; + ptm = gmtime_r(&rawtime, &gbuf); + // Request that mktime() looksup dst in timezone database + ptm->tm_isdst = -1; + gmt = mktime(ptm); + return (UA_Int64) (difftime(rawtime, gmt) * UA_DATETIME_SEC); +} + +UA_DateTime UA_DateTime_nowMonotonic(void) { +#if defined(__APPLE__) || defined(__MACH__) + /* OS X does not have clock_gettime, use clock_get_time */ + clock_serv_t cclock; + mach_timespec_t mts; + host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock); + clock_get_time(cclock, &mts); + mach_port_deallocate(mach_task_self(), cclock); + return (mts.tv_sec * UA_DATETIME_SEC) + (mts.tv_nsec / 100); +#elif !defined(CLOCK_MONOTONIC_RAW) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (ts.tv_sec * UA_DATETIME_SEC) + (ts.tv_nsec / 100); +#else + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + return (ts.tv_sec * UA_DATETIME_SEC) + (ts.tv_nsec / 100); +#endif +} + +#endif /* UA_ARCHITECTURE_POSIX */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/posix/ua_architecture_functions.c" ***********************************/ + +/* 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 2018 (c) Jose Cabral, fortiss GmbH + */ + +#ifdef UA_ARCHITECTURE_POSIX + + +/* Global malloc singletons */ +#ifdef UA_ENABLE_MALLOC_SINGLETON +void * (*UA_mallocSingleton)(size_t size) = malloc; +void (*UA_freeSingleton)(void *ptr) = free; +void * (*UA_callocSingleton)(size_t nelem, size_t elsize) = calloc; +void * (*UA_reallocSingleton)(void *ptr, size_t size) = realloc; +#endif + +unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){ + int opts = fcntl(sockfd, F_GETFL); + if(opts < 0 || fcntl(sockfd, F_SETFL, opts & (~O_NONBLOCK)) < 0) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd){ + int opts = fcntl(sockfd, F_GETFL); + if(opts < 0 || fcntl(sockfd, F_SETFL, opts | O_NONBLOCK) < 0) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +void UA_initialize_architecture_network(void){ +} + +void UA_deinitialize_architecture_network(void){ +} + +#endif /* UA_ARCHITECTURE_POSIX */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/win32/ua_clock.c" ***********************************/ + +/* 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 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Thomas Stalder + */ + +#ifdef UA_ARCHITECTURE_WIN32 + +#ifndef _BSD_SOURCE +# define _BSD_SOURCE +#endif + + +#include <time.h> +/* Backup definition of SLIST_ENTRY on mingw winnt.h */ +# ifdef SLIST_ENTRY +# pragma push_macro("SLIST_ENTRY") +# undef SLIST_ENTRY +# define POP_SLIST_ENTRY +# endif +# include <windows.h> +/* restore definition */ +# ifdef POP_SLIST_ENTRY +# undef SLIST_ENTRY +# undef POP_SLIST_ENTRY +# pragma pop_macro("SLIST_ENTRY") +# endif + +UA_DateTime UA_DateTime_now(void) { + /* Windows filetime has the same definition as UA_DateTime */ + FILETIME ft; + SYSTEMTIME st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, &ft); + ULARGE_INTEGER ul; + ul.LowPart = ft.dwLowDateTime; + ul.HighPart = ft.dwHighDateTime; + return (UA_DateTime)ul.QuadPart; +} + +/* Credit to https://stackoverflow.com/questions/13804095/get-the-time-zone-gmt-offset-in-c */ +UA_Int64 UA_DateTime_localTimeUtcOffset(void) { + time_t gmt, rawtime = time(NULL); + + struct tm ptm; +#ifdef __CODEGEARC__ + gmtime_s(&rawtime, &ptm); +#else + gmtime_s(&ptm, &rawtime); +#endif + // Request that mktime() looksup dst in timezone database + ptm.tm_isdst = -1; + gmt = mktime(&ptm); + + return (UA_Int64) (difftime(rawtime, gmt) * UA_DATETIME_SEC); +} + +UA_DateTime UA_DateTime_nowMonotonic(void) { + LARGE_INTEGER freq, ticks; + QueryPerformanceFrequency(&freq); + QueryPerformanceCounter(&ticks); + UA_Double ticks2dt = UA_DATETIME_SEC / (UA_Double)freq.QuadPart; + return (UA_DateTime)(ticks.QuadPart * ticks2dt); +} + +#endif /* UA_ARCHITECTURE_WIN32 */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/win32/ua_architecture_functions.c" ***********************************/ + +/* 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 2018 (c) Jose Cabral, fortiss GmbH + */ + +#ifdef UA_ARCHITECTURE_WIN32 + + +/* Global malloc singletons */ +#ifdef UA_ENABLE_MALLOC_SINGLETON +void * (*UA_mallocSingleton)(size_t size) = malloc; +void (*UA_freeSingleton)(void *ptr) = free; +void * (*UA_callocSingleton)(size_t nelem, size_t elsize) = calloc; +void * (*UA_reallocSingleton)(void *ptr, size_t size) = realloc; +#endif + +unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){ + u_long iMode = 0; + if(ioctlsocket(sockfd, FIONBIO, &iMode) != NO_ERROR) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd){ + u_long iMode = 1; + if(ioctlsocket(sockfd, FIONBIO, &iMode) != NO_ERROR) + return UA_STATUSCODE_BADINTERNALERROR; + return UA_STATUSCODE_GOOD; +} + +void UA_initialize_architecture_network(void){ + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); +} + +void UA_deinitialize_architecture_network(void){ + WSACleanup(); +} + +#endif /* UA_ARCHITECTURE_WIN32 */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/network_tcp.c" ***********************************/ + +/* 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 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) frax2222 + * Copyright 2017 (c) Jose Cabral + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + +#define UA_INTERNAL + + + +#include <string.h> // memset + +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + +/****************************/ +/* Generic Socket Functions */ +/****************************/ + +static UA_StatusCode +connection_getsendbuffer(UA_Connection *connection, + size_t length, UA_ByteString *buf) { + UA_SecureChannel *channel = connection->channel; + if(channel && channel->config.sendBufferSize < length) + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + return UA_ByteString_allocBuffer(buf, length); +} + +static void +connection_releasesendbuffer(UA_Connection *connection, + UA_ByteString *buf) { + UA_ByteString_clear(buf); +} + +static void +connection_releaserecvbuffer(UA_Connection *connection, + UA_ByteString *buf) { + UA_ByteString_clear(buf); +} + +static UA_StatusCode +connection_write(UA_Connection *connection, UA_ByteString *buf) { + if(connection->state == UA_CONNECTIONSTATE_CLOSED) { + UA_ByteString_clear(buf); + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + /* Prevent OS signals when sending to a closed socket */ + int flags = 0; + flags |= MSG_NOSIGNAL; + + /* Send the full buffer. This may require several calls to send */ + size_t nWritten = 0; + do { + ssize_t n = 0; + do { + size_t bytes_to_send = buf->length - nWritten; + n = UA_send(connection->sockfd, + (const char*)buf->data + nWritten, + bytes_to_send, flags); + if(n < 0 && UA_ERRNO != UA_INTERRUPTED && UA_ERRNO != UA_AGAIN) { + connection->close(connection); + UA_ByteString_clear(buf); + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + } while(n < 0); + nWritten += (size_t)n; + } while(nWritten < buf->length); + + /* Free the buffer */ + UA_ByteString_clear(buf); + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +connection_recv(UA_Connection *connection, UA_ByteString *response, + UA_UInt32 timeout) { + if(connection->state == UA_CONNECTIONSTATE_CLOSED) + return UA_STATUSCODE_BADCONNECTIONCLOSED; + + /* Listen on the socket for the given timeout until a message arrives */ + fd_set fdset; + FD_ZERO(&fdset); + UA_fd_set(connection->sockfd, &fdset); + UA_UInt32 timeout_usec = timeout * 1000; + struct timeval tmptv = {(long int)(timeout_usec / 1000000), + (int)(timeout_usec % 1000000)}; + int resultsize = UA_select(connection->sockfd+1, &fdset, NULL, NULL, &tmptv); + + /* No result */ + if(resultsize == 0) + return UA_STATUSCODE_GOODNONCRITICALTIMEOUT; + + if(resultsize == -1) { + /* The call to select was interrupted. Act as if it timed out. */ + if(UA_ERRNO == EINTR) + return UA_STATUSCODE_GOODNONCRITICALTIMEOUT; + + /* The error cannot be recovered. Close the connection. */ + connection->close(connection); + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + UA_Boolean internallyAllocated = !response->length; + + /* Allocate the buffer */ + if(internallyAllocated) { + size_t bufferSize = 16384; /* Use as default for a new SecureChannel */ + UA_SecureChannel *channel = connection->channel; + if(channel && channel->config.recvBufferSize > 0) + bufferSize = channel->config.recvBufferSize; + UA_StatusCode res = UA_ByteString_allocBuffer(response, bufferSize); + if(res != UA_STATUSCODE_GOOD) + return res; + } + + /* Get the received packet(s) */ + ssize_t ret = UA_recv(connection->sockfd, (char*)response->data, response->length, 0); + + /* The remote side closed the connection */ + if(ret == 0) { + if(internallyAllocated) + UA_ByteString_clear(response); + connection->close(connection); + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + /* Error case */ + if(ret < 0) { + if(internallyAllocated) + UA_ByteString_clear(response); + if(UA_ERRNO == UA_INTERRUPTED || (timeout > 0) ? + false : (UA_ERRNO == UA_EAGAIN || UA_ERRNO == UA_WOULDBLOCK)) + return UA_STATUSCODE_GOOD; /* statuscode_good but no data -> retry */ + connection->close(connection); + return UA_STATUSCODE_BADCONNECTIONCLOSED; + } + + /* Set the length of the received buffer */ + response->length = (size_t)ret; + return UA_STATUSCODE_GOOD; +} + + +/***************************/ +/* Server NetworkLayer TCP */ +/***************************/ + +#define MAXBACKLOG 100 +#define NOHELLOTIMEOUT 120000 /* timeout in ms before close the connection + * if server does not receive Hello Message */ + +typedef struct ConnectionEntry { + UA_Connection connection; + LIST_ENTRY(ConnectionEntry) pointers; +} ConnectionEntry; + +typedef struct { + const UA_Logger *logger; + UA_UInt16 port; + UA_UInt16 maxConnections; + UA_SOCKET serverSockets[FD_SETSIZE]; + UA_UInt16 serverSocketsSize; + LIST_HEAD(, ConnectionEntry) connections; + UA_UInt16 connectionsSize; +} ServerNetworkLayerTCP; + +static void +ServerNetworkLayerTCP_freeConnection(UA_Connection *connection) { + UA_free(connection); +} + +/* This performs only 'shutdown'. 'close' is called when the shutdown + * socket is returned from select. */ +static void +ServerNetworkLayerTCP_close(UA_Connection *connection) { + if(connection->state == UA_CONNECTIONSTATE_CLOSED) + return; + UA_shutdown((UA_SOCKET)connection->sockfd, 2); + connection->state = UA_CONNECTIONSTATE_CLOSED; +} + +static UA_Boolean +purgeFirstConnectionWithoutChannel(ServerNetworkLayerTCP *layer) { + ConnectionEntry *e; + LIST_FOREACH(e, &layer->connections, pointers) { + if(e->connection.channel == NULL) { + LIST_REMOVE(e, pointers); + layer->connectionsSize--; + UA_close(e->connection.sockfd); + e->connection.free(&e->connection); + return true; + } + } + return false; +} + +static UA_StatusCode +ServerNetworkLayerTCP_add(UA_ServerNetworkLayer *nl, ServerNetworkLayerTCP *layer, + UA_Int32 newsockfd, struct sockaddr_storage *remote) { + if(layer->maxConnections && layer->connectionsSize >= layer->maxConnections && + !purgeFirstConnectionWithoutChannel(layer)) { + return UA_STATUSCODE_BADTCPNOTENOUGHRESOURCES; + } + + /* Set nonblocking */ + UA_socket_set_nonblocking(newsockfd);//TODO: check return value + + /* Do not merge packets on the socket (disable Nagle's algorithm) */ + int dummy = 1; + if(UA_setsockopt(newsockfd, IPPROTO_TCP, TCP_NODELAY, + (const char *)&dummy, sizeof(dummy)) < 0) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_ERROR(layer->logger, UA_LOGCATEGORY_NETWORK, + "Cannot set socket option TCP_NODELAY. Error: %s", + errno_str)); + return UA_STATUSCODE_BADUNEXPECTEDERROR; + } + +#if defined(UA_getnameinfo) + /* Get the peer name for logging */ + char remote_name[100]; + int res = UA_getnameinfo((struct sockaddr*)remote, + sizeof(struct sockaddr_storage), + remote_name, sizeof(remote_name), + NULL, 0, NI_NUMERICHOST); + if(res == 0) { + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | New connection over TCP from %s", + (int)newsockfd, remote_name); + } else { + UA_LOG_SOCKET_ERRNO_WRAP(UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | New connection over TCP, " + "getnameinfo failed with error: %s", + (int)newsockfd, errno_str)); + } +#else + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | New connection over TCP", + (int)newsockfd); +#endif + /* Allocate and initialize the connection */ + ConnectionEntry *e = (ConnectionEntry*)UA_malloc(sizeof(ConnectionEntry)); + if(!e) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + + UA_Connection *c = &e->connection; + memset(c, 0, sizeof(UA_Connection)); + c->sockfd = newsockfd; + c->handle = layer; + c->send = connection_write; + c->close = ServerNetworkLayerTCP_close; + c->free = ServerNetworkLayerTCP_freeConnection; + c->getSendBuffer = connection_getsendbuffer; + c->releaseSendBuffer = connection_releasesendbuffer; + c->releaseRecvBuffer = connection_releaserecvbuffer; + c->state = UA_CONNECTIONSTATE_OPENING; + c->openingDate = UA_DateTime_nowMonotonic(); + + layer->connectionsSize++; + + /* Add to the linked list */ + LIST_INSERT_HEAD(&layer->connections, e, pointers); + if(nl->statistics) { + nl->statistics->currentConnectionCount++; + nl->statistics->cumulatedConnectionCount++; + } + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +addServerSocket(ServerNetworkLayerTCP *layer, struct addrinfo *ai) { + /* Create the server socket */ + UA_SOCKET newsock = UA_socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); + if(newsock == UA_INVALID_SOCKET) + { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Error opening the server socket: %s", errno_str)); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + + /* Some Linux distributions have net.ipv6.bindv6only not activated. So + * sockets can double-bind to IPv4 and IPv6. This leads to problems. Use + * AF_INET6 sockets only for IPv6. */ + + int optval = 1; +#if UA_IPV6 + if(ai->ai_family == AF_INET6 && + UA_setsockopt(newsock, IPPROTO_IPV6, IPV6_V6ONLY, + (const char*)&optval, sizeof(optval)) == -1) { + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Could not set an IPv6 socket to IPv6 only"); + UA_close(newsock); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + + } +#endif + if(UA_setsockopt(newsock, SOL_SOCKET, SO_REUSEADDR, + (const char *)&optval, sizeof(optval)) == -1) { + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Could not make the socket reusable"); + UA_close(newsock); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + + + if(UA_socket_set_nonblocking(newsock) != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Could not set the server socket to nonblocking"); + UA_close(newsock); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + + /* Bind socket to address */ + int ret = UA_bind(newsock, ai->ai_addr, (socklen_t)ai->ai_addrlen); + if(ret < 0) { + /* If bind to specific address failed, try to bind *-socket */ + if(ai->ai_family == AF_INET) { + struct sockaddr_in *sin = (struct sockaddr_in *)ai->ai_addr; + if(sin->sin_addr.s_addr != htonl(INADDR_ANY)) { + sin->sin_addr.s_addr = 0; + ret = 0; + } + } + if(ai->ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai->ai_addr; + if(!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + memset(&sin6->sin6_addr, 0, sizeof(sin6->sin6_addr)); + sin6->sin6_scope_id = 0; + ret = 0; + } + } + if(ret == 0) { + ret = UA_bind(newsock, ai->ai_addr, (socklen_t)ai->ai_addrlen); + if(ret == 0) { + /* The second bind fixed the issue, inform the user. */ + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Server socket bound to unspecified address"); + } + } + } + if(ret < 0) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Error binding a server socket: %s", errno_str)); + UA_close(newsock); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + + /* Start listening */ + if(UA_listen(newsock, MAXBACKLOG) < 0) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "Error listening on server socket: %s", errno_str)); + UA_close(newsock); + return UA_STATUSCODE_BADCOMMUNICATIONERROR; + } + + if(layer->port == 0) { + /* Port was automatically chosen. Read it from the OS */ + struct sockaddr_in returned_addr; + memset(&returned_addr, 0, sizeof(returned_addr)); + socklen_t len = sizeof(returned_addr); + UA_getsockname(newsock, (struct sockaddr *)&returned_addr, &len); + layer->port = ntohs(returned_addr.sin_port); + } + + layer->serverSockets[layer->serverSocketsSize] = newsock; + layer->serverSocketsSize++; + return UA_STATUSCODE_GOOD; +} + +static UA_StatusCode +ServerNetworkLayerTCP_start(UA_ServerNetworkLayer *nl, const UA_Logger *logger, + const UA_String *customHostname) { + UA_initialize_architecture_network(); + + ServerNetworkLayerTCP *layer = (ServerNetworkLayerTCP *)nl->handle; + layer->logger = logger; + + /* Get addrinfo of the server and create server sockets */ + char hostname[512]; + if(customHostname->length) { + if(customHostname->length >= sizeof(hostname)) + return UA_STATUSCODE_BADOUTOFMEMORY; + memcpy(hostname, customHostname->data, customHostname->length); + hostname[customHostname->length] = '\0'; + } + char portno[6]; + UA_snprintf(portno, 6, "%d", layer->port); + struct addrinfo hints, *res; + memset(&hints, 0, sizeof hints); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + hints.ai_protocol = IPPROTO_TCP; + int retcode = UA_getaddrinfo(customHostname->length ? hostname : NULL, + portno, &hints, &res); + if(retcode != 0) { + UA_LOG_SOCKET_ERRNO_GAI_WRAP(UA_LOG_WARNING(layer->logger, UA_LOGCATEGORY_NETWORK, + "getaddrinfo lookup of %s failed with error %d - %s", hostname, retcode, errno_str)); + return UA_STATUSCODE_BADINTERNALERROR; + } + + /* There might be serveral addrinfos (for different network cards, + * IPv4/IPv6). Add a server socket for all of them. */ + struct addrinfo *ai = res; + for(layer->serverSocketsSize = 0; + layer->serverSocketsSize < FD_SETSIZE && ai != NULL; + ai = ai->ai_next) { + UA_StatusCode statusCode = addServerSocket(layer, ai); + if(statusCode != UA_STATUSCODE_GOOD) + { + UA_freeaddrinfo(res); + return statusCode; + } + } + UA_freeaddrinfo(res); + + /* Get the discovery url from the hostname */ + UA_String du = UA_STRING_NULL; + char discoveryUrlBuffer[256]; + if(customHostname->length) { + du.length = (size_t)UA_snprintf(discoveryUrlBuffer, 255, "opc.tcp://%.*s:%d/", + (int)customHostname->length, customHostname->data, + layer->port); + du.data = (UA_Byte*)discoveryUrlBuffer; + } else { + char hostnameBuffer[256]; + if(UA_gethostname(hostnameBuffer, 255) == 0) { + du.length = (size_t)UA_snprintf(discoveryUrlBuffer, 255, "opc.tcp://%s:%d/", + hostnameBuffer, layer->port); + du.data = (UA_Byte*)discoveryUrlBuffer; + } else { + UA_LOG_ERROR(layer->logger, UA_LOGCATEGORY_NETWORK, "Could not get the hostname"); + return UA_STATUSCODE_BADINTERNALERROR; + } + } + UA_String_copy(&du, &nl->discoveryUrl); + + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "TCP network layer listening on %.*s", + (int)nl->discoveryUrl.length, nl->discoveryUrl.data); + return UA_STATUSCODE_GOOD; +} + +/* After every select, reset the sockets to listen on */ +static UA_Int32 +setFDSet(ServerNetworkLayerTCP *layer, fd_set *fdset) { + FD_ZERO(fdset); + UA_Int32 highestfd = 0; + for(UA_UInt16 i = 0; i < layer->serverSocketsSize; i++) { + UA_fd_set(layer->serverSockets[i], fdset); + if((UA_Int32)layer->serverSockets[i] > highestfd) + highestfd = (UA_Int32)layer->serverSockets[i]; + } + + ConnectionEntry *e; + LIST_FOREACH(e, &layer->connections, pointers) { + UA_fd_set(e->connection.sockfd, fdset); + if((UA_Int32)e->connection.sockfd > highestfd) + highestfd = (UA_Int32)e->connection.sockfd; + } + + return highestfd; +} + +static UA_StatusCode +ServerNetworkLayerTCP_listen(UA_ServerNetworkLayer *nl, UA_Server *server, + UA_UInt16 timeout) { + /* Every open socket can generate two jobs */ + ServerNetworkLayerTCP *layer = (ServerNetworkLayerTCP *)nl->handle; + + if(layer->serverSocketsSize == 0) + return UA_STATUSCODE_GOOD; + + /* Listen on open sockets (including the server) */ + fd_set fdset, errset; + UA_Int32 highestfd = setFDSet(layer, &fdset); + setFDSet(layer, &errset); + struct timeval tmptv = {0, timeout * 1000}; + if(UA_select(highestfd+1, &fdset, NULL, &errset, &tmptv) < 0) { + UA_LOG_SOCKET_ERRNO_WRAP( + UA_LOG_DEBUG(layer->logger, UA_LOGCATEGORY_NETWORK, + "Socket select failed with %s", errno_str)); + // we will retry, so do not return bad + return UA_STATUSCODE_GOOD; + } + + /* Accept new connections via the server sockets */ + for(UA_UInt16 i = 0; i < layer->serverSocketsSize; i++) { + if(!UA_fd_isset(layer->serverSockets[i], &fdset)) + continue; + + struct sockaddr_storage remote; + socklen_t remote_size = sizeof(remote); + UA_SOCKET newsockfd = UA_accept(layer->serverSockets[i], + (struct sockaddr*)&remote, &remote_size); + if(newsockfd == UA_INVALID_SOCKET) + continue; + + UA_LOG_TRACE(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | New TCP connection on server socket %i", + (int)newsockfd, (int)(layer->serverSockets[i])); + + if(ServerNetworkLayerTCP_add(nl, layer, (UA_Int32)newsockfd, &remote) != UA_STATUSCODE_GOOD) { + UA_close(newsockfd); + } + } + + /* Read from established sockets */ + ConnectionEntry *e, *e_tmp; + UA_DateTime now = UA_DateTime_nowMonotonic(); + LIST_FOREACH_SAFE(e, &layer->connections, pointers, e_tmp) { + if((e->connection.state == UA_CONNECTIONSTATE_OPENING) && + (now > (e->connection.openingDate + (NOHELLOTIMEOUT * UA_DATETIME_MSEC)))) { + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Closed by the server (no Hello Message)", + (int)(e->connection.sockfd)); + LIST_REMOVE(e, pointers); + layer->connectionsSize--; + UA_close(e->connection.sockfd); + UA_Server_removeConnection(server, &e->connection); + if(nl->statistics) { + nl->statistics->connectionTimeoutCount--; + nl->statistics->currentConnectionCount--; + } + continue; + } + + if(!UA_fd_isset(e->connection.sockfd, &errset) && + !UA_fd_isset(e->connection.sockfd, &fdset)) + continue; + + UA_LOG_TRACE(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Activity on the socket", + (int)(e->connection.sockfd)); + + UA_ByteString buf = UA_BYTESTRING_NULL; + UA_StatusCode retval = connection_recv(&e->connection, &buf, 0); + + if(retval == UA_STATUSCODE_GOOD) { + /* Process packets */ + UA_Server_processBinaryMessage(server, &e->connection, &buf); + connection_releaserecvbuffer(&e->connection, &buf); + } else if(retval == UA_STATUSCODE_BADCONNECTIONCLOSED) { + /* The socket is shutdown but not closed */ + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Connection %i | Closed", + (int)(e->connection.sockfd)); + LIST_REMOVE(e, pointers); + layer->connectionsSize--; + UA_close(e->connection.sockfd); + UA_Server_removeConnection(server, &e->connection); + if(nl->statistics) { + nl->statistics->currentConnectionCount--; + } + } + } + return UA_STATUSCODE_GOOD; +} + +static void +ServerNetworkLayerTCP_stop(UA_ServerNetworkLayer *nl, UA_Server *server) { + ServerNetworkLayerTCP *layer = (ServerNetworkLayerTCP *)nl->handle; + UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, + "Shutting down the TCP network layer"); + + /* Close the server sockets */ + for(UA_UInt16 i = 0; i < layer->serverSocketsSize; i++) { + UA_shutdown(layer->serverSockets[i], 2); + UA_close(layer->serverSockets[i]); + } + layer->serverSocketsSize = 0; + + /* Close open connections */ + ConnectionEntry *e; + LIST_FOREACH(e, &layer->connections, pointers) + ServerNetworkLayerTCP_close(&e->connection); + + /* Run recv on client sockets. This picks up the closed sockets and frees + * the connection. */ + ServerNetworkLayerTCP_listen(nl, server, 0); + + UA_deinitialize_architecture_network(); +} + +/* run only when the server is stopped */ +static void +ServerNetworkLayerTCP_clear(UA_ServerNetworkLayer *nl) { + ServerNetworkLayerTCP *layer = (ServerNetworkLayerTCP *)nl->handle; + UA_String_clear(&nl->discoveryUrl); + + /* Hard-close and remove remaining connections. The server is no longer + * running. So this is safe. */ + ConnectionEntry *e, *e_tmp; + LIST_FOREACH_SAFE(e, &layer->connections, pointers, e_tmp) { + LIST_REMOVE(e, pointers); + layer->connectionsSize--; + UA_close(e->connection.sockfd); + UA_free(e); + if(nl->statistics) { + nl->statistics->currentConnectionCount--; + } + } + + /* Free the layer */ + UA_free(layer); +} + +UA_ServerNetworkLayer +UA_ServerNetworkLayerTCP(UA_ConnectionConfig config, UA_UInt16 port, + UA_UInt16 maxConnections) { + UA_ServerNetworkLayer nl; + memset(&nl, 0, sizeof(UA_ServerNetworkLayer)); + nl.clear = ServerNetworkLayerTCP_clear; + nl.localConnectionConfig = config; + nl.start = ServerNetworkLayerTCP_start; + nl.listen = ServerNetworkLayerTCP_listen; + nl.stop = ServerNetworkLayerTCP_stop; + nl.handle = NULL; + + ServerNetworkLayerTCP *layer = (ServerNetworkLayerTCP*) + UA_calloc(1,sizeof(ServerNetworkLayerTCP)); + if(!layer) + return nl; + nl.handle = layer; + + layer->port = port; + layer->maxConnections = maxConnections; + + return nl; +} + +typedef struct TCPClientConnection { + struct addrinfo hints, *server; + UA_DateTime connStart; + UA_String endpointUrl; + UA_UInt32 timeout; +} TCPClientConnection; + +/***************************/ +/* Client NetworkLayer TCP */ +/***************************/ + +static void +ClientNetworkLayerTCP_close(UA_Connection *connection) { + if(connection->state == UA_CONNECTIONSTATE_CLOSED) + return; + + if(connection->sockfd != UA_INVALID_SOCKET) { + UA_shutdown(connection->sockfd, 2); + UA_close(connection->sockfd); + } + connection->state = UA_CONNECTIONSTATE_CLOSED; +} + +static void +ClientNetworkLayerTCP_free(UA_Connection *connection) { + if(!connection->handle) + return; + + TCPClientConnection *tcpConnection = (TCPClientConnection *)connection->handle; + if(tcpConnection->server) + UA_freeaddrinfo(tcpConnection->server); + UA_String_clear(&tcpConnection->endpointUrl); + UA_free(tcpConnection); + connection->handle = NULL; +} + +UA_StatusCode +UA_ClientConnectionTCP_poll(UA_Connection *connection, UA_UInt32 timeout, + const UA_Logger *logger) { + if(connection->state == UA_CONNECTIONSTATE_CLOSED) + return UA_STATUSCODE_BADDISCONNECT; + if(connection->state == UA_CONNECTIONSTATE_ESTABLISHED) + return UA_STATUSCODE_GOOD; + + /* Connection timeout? */ + TCPClientConnection *tcpConnection = (TCPClientConnection*) connection->handle; + if((UA_Double) (UA_DateTime_nowMonotonic() - tcpConnection->connStart) + > (UA_Double) tcpConnection->timeout * UA_DATETIME_MSEC ) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, "Timed out"); + ClientNetworkLayerTCP_close(connection); + return UA_STATUSCODE_BADDISCONNECT; + } + + /* Get a socket */ + if(connection->sockfd == UA_INVALID_SOCKET) { + connection->sockfd = UA_socket(tcpConnection->server->ai_family, + tcpConnection->server->ai_socktype, + tcpConnection->server->ai_protocol); + if(connection->sockfd == UA_INVALID_SOCKET) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Could not create client socket: %s", strerror(UA_ERRNO)); + ClientNetworkLayerTCP_close(connection); + return UA_STATUSCODE_BADDISCONNECT; + } + + /* Non blocking connect to be able to timeout */ + if(UA_socket_set_nonblocking(connection->sockfd) != UA_STATUSCODE_GOOD) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Could not set the client socket to nonblocking"); + ClientNetworkLayerTCP_close(connection); + return UA_STATUSCODE_BADDISCONNECT; + } + + /* Don't have the socket create interrupt signals */ +#ifdef SO_NOSIGPIPE + int val = 1; + int sso_result = setsockopt(connection->sockfd, SOL_SOCKET, + SO_NOSIGPIPE, (void*)&val, sizeof(val)); + if(sso_result < 0) + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Couldn't set SO_NOSIGPIPE"); +#endif + } + + /* Non-blocking connect */ + int error = UA_connect(connection->sockfd, tcpConnection->server->ai_addr, + tcpConnection->server->ai_addrlen); + + /* Connection successful */ + if(error == 0) { + connection->state = UA_CONNECTIONSTATE_ESTABLISHED; + return UA_STATUSCODE_GOOD; + } + + /* The connection failed */ + if(UA_ERRNO != UA_ERR_CONNECTION_PROGRESS) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Connection to %.*s failed with error: %s", + (int)tcpConnection->endpointUrl.length, + tcpConnection->endpointUrl.data, strerror(UA_ERRNO)); + ClientNetworkLayerTCP_close(connection); + return UA_STATUSCODE_BADDISCONNECT; + } + + /* Use select to wait until connected. Return with a half-opened connection + * after a timeout. */ + UA_UInt32 timeout_usec = timeout * 1000; + +#ifdef _OS9000 + /* OS-9 can't use select for checking write sockets. Therefore, we need to + * use connect until success or failed */ + int resultsize = 0; + do { + u_int32 time = 0x80000001; + signal_code sig; + + timeout_usec -= 1000000/256; // Sleep 1/256 second + if(timeout_usec < 0) + break; + + _os_sleep(&time, &sig); + error = connect(connection->sockfd, tcpConnection->server->ai_addr, + tcpConnection->server->ai_addrlen); + if((error == -1 && UA_ERRNO == EISCONN) || (error == 0)) + resultsize = 1; + if(error == -1 && UA_ERRNO != EALREADY && UA_ERRNO != EINPROGRESS) + break; + } while(resultsize == 0); +#else + /* Wait in a select-call until the connection fully opens or the timeout + * happens */ + fd_set fdset; + FD_ZERO(&fdset); + UA_fd_set(connection->sockfd, &fdset); + struct timeval tmptv = { (long int) (timeout_usec / 1000000), + (int) (timeout_usec % 1000000) }; + int resultsize = UA_select((UA_Int32) (connection->sockfd + 1), NULL, + &fdset, NULL, &tmptv); +#endif + +#ifndef _WIN32 + /* Any errors on the socket reported? */ + OPTVAL_TYPE so_error = 0; + socklen_t len = sizeof(so_error); + int ret = UA_getsockopt(connection->sockfd, SOL_SOCKET, SO_ERROR, &so_error, &len); + if(ret != 0 || so_error != 0) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Connection to %.*s failed with error: %s", + (int)tcpConnection->endpointUrl.length, + tcpConnection->endpointUrl.data, + strerror(ret == 0 ? so_error : UA_ERRNO)); + ClientNetworkLayerTCP_close(connection); + return UA_STATUSCODE_BADDISCONNECT; + } +#endif + + /* The connection is fully opened. Otherwise, select has timed out. But we + * can retry. */ + if(resultsize == 1) + connection->state = UA_CONNECTIONSTATE_ESTABLISHED; + + return UA_STATUSCODE_GOOD; +} + +UA_Connection +UA_ClientConnectionTCP_init(UA_ConnectionConfig config, const UA_String endpointUrl, + UA_UInt32 timeout, const UA_Logger *logger) { + UA_initialize_architecture_network(); + + UA_Connection connection; + memset(&connection, 0, sizeof(UA_Connection)); + + connection.state = UA_CONNECTIONSTATE_OPENING; + connection.sockfd = UA_INVALID_SOCKET; + connection.send = connection_write; + connection.recv = connection_recv; + connection.close = ClientNetworkLayerTCP_close; + connection.free = ClientNetworkLayerTCP_free; + connection.getSendBuffer = connection_getsendbuffer; + connection.releaseSendBuffer = connection_releasesendbuffer; + connection.releaseRecvBuffer = connection_releaserecvbuffer; + + TCPClientConnection *tcpClientConnection = (TCPClientConnection*) + UA_malloc(sizeof(TCPClientConnection)); + if(!tcpClientConnection) { + connection.state = UA_CONNECTIONSTATE_CLOSED; + return connection; + } + memset(tcpClientConnection, 0, sizeof(TCPClientConnection)); + connection.handle = (void*) tcpClientConnection; + tcpClientConnection->timeout = timeout; + UA_String hostnameString = UA_STRING_NULL; + UA_String pathString = UA_STRING_NULL; + UA_UInt16 port = 0; + char hostname[512]; + tcpClientConnection->connStart = UA_DateTime_nowMonotonic(); + UA_String_copy(&endpointUrl, &tcpClientConnection->endpointUrl); + + UA_StatusCode parse_retval = + UA_parseEndpointUrl(&endpointUrl, &hostnameString, &port, &pathString); + if(parse_retval != UA_STATUSCODE_GOOD || hostnameString.length > 511) { + UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "Server url is invalid: %.*s", + (int)endpointUrl.length, endpointUrl.data); + connection.state = UA_CONNECTIONSTATE_CLOSED; + return connection; + } + memcpy(hostname, hostnameString.data, hostnameString.length); + hostname[hostnameString.length] = 0; + + if(port == 0) { + port = 4840; + UA_LOG_INFO(logger, UA_LOGCATEGORY_NETWORK, + "No port defined, using default port %" PRIu16, port); + } + + memset(&tcpClientConnection->hints, 0, sizeof(tcpClientConnection->hints)); + tcpClientConnection->hints.ai_family = AF_UNSPEC; + tcpClientConnection->hints.ai_socktype = SOCK_STREAM; + char portStr[6]; + UA_snprintf(portStr, 6, "%d", port); + int error = UA_getaddrinfo(hostname, portStr, &tcpClientConnection->hints, + &tcpClientConnection->server); + if(error != 0 || !tcpClientConnection->server) { + UA_LOG_SOCKET_ERRNO_GAI_WRAP(UA_LOG_WARNING(logger, UA_LOGCATEGORY_NETWORK, + "DNS lookup of %s failed with error %d - %s", + hostname, error, errno_str)); + connection.state = UA_CONNECTIONSTATE_CLOSED; + return connection; + } + + /* Return connection with state UA_CONNECTIONSTATE_OPENING */ + return connection; +} diff --git a/test/server/open62541.h b/test/server/open62541.h new file mode 100644 index 0000000000000000000000000000000000000000..4207e72a6150f77daef73f98497933376d4bba38 --- /dev/null +++ b/test/server/open62541.h @@ -0,0 +1,30486 @@ +/* THIS IS A SINGLE-FILE DISTRIBUTION CONCATENATED FROM THE OPEN62541 SOURCES + * visit http://open62541.org/ for information about this software + * Git-Revision: v1.2-29-g875d33a9 + */ + +/* + * Copyright (C) 2014-2018 the contributors as stated in the AUTHORS file + * + * This file is part of open62541. open62541 is free software: you can + * redistribute it and/or modify it under the terms of the Mozilla Public + * License v2.0 as stated in the LICENSE file provided with open62541. + * + * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. + */ + +#ifndef OPEN62541_H_ +#define OPEN62541_H_ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/config.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + + +/** + * open62541 Version + * ----------------- */ +#define UA_OPEN62541_VER_MAJOR 1 +#define UA_OPEN62541_VER_MINOR 2 +#define UA_OPEN62541_VER_PATCH 0 +#define UA_OPEN62541_VER_LABEL "-29-g875d33a9" /* Release candidate label, etc. */ +#define UA_OPEN62541_VER_COMMIT "v1.2-29-g875d33a9" + +/** + * Feature Options + * --------------- + * Changing the feature options has no effect on a pre-compiled library. */ + +#define UA_LOGLEVEL 300 +#ifndef UA_ENABLE_AMALGAMATION +#define UA_ENABLE_AMALGAMATION +#endif +#define UA_ENABLE_METHODCALLS +#define UA_ENABLE_NODEMANAGEMENT +#define UA_ENABLE_SUBSCRIPTIONS +/* #undef UA_ENABLE_PUBSUB */ +/* #undef UA_ENABLE_PUBSUB_FILE_CONFIG */ +/* #undef UA_ENABLE_PUBSUB_ETH_UADP */ +/* #undef UA_ENABLE_PUBSUB_ETH_UADP_ETF */ +/* #undef UA_ENABLE_PUBSUB_ETH_UADP_XDP */ +/* #undef UA_ENABLE_PUBSUB_DELTAFRAMES */ +/* #undef UA_ENABLE_PUBSUB_INFORMATIONMODEL */ +/* #undef UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS */ +#define UA_ENABLE_DA +/* #undef UA_ENABLE_ENCRYPTION */ +/* #undef UA_ENABLE_HISTORIZING */ +#define UA_ENABLE_PARSING +/* #undef UA_ENABLE_MICRO_EMB_DEV_PROFILE */ +/* #undef UA_ENABLE_EXPERIMENTAL_HISTORIZING */ +/* #undef UA_ENABLE_SUBSCRIPTIONS_EVENTS */ +/* #undef UA_ENABLE_JSON_ENCODING */ +/* #undef UA_ENABLE_PUBSUB_MQTT */ +/* #undef UA_ENABLE_ENCRYPTION_MBEDTLS */ +/* #undef UA_ENABLE_ENCRYPTION_OPENSSL */ +/* #undef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */ + +/* Multithreading */ +/* #undef UA_ENABLE_IMMUTABLE_NODES */ +#define UA_MULTITHREADING 0 + +/* Advanced Options */ +#define UA_ENABLE_STATUSCODE_DESCRIPTIONS +#define UA_ENABLE_TYPEDESCRIPTION +#define UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS +/* #undef UA_ENABLE_DETERMINISTIC_RNG */ +/* #undef UA_ENABLE_DISCOVERY */ +/* #undef UA_ENABLE_DISCOVERY_MULTICAST */ +/* #undef UA_ENABLE_WEBSOCKET_SERVER */ +/* #undef UA_ENABLE_QUERY */ +/* #undef UA_ENABLE_MALLOC_SINGLETON */ +#define UA_ENABLE_DISCOVERY_SEMAPHORE +/* #undef UA_ENABLE_UNIT_TEST_FAILURE_HOOKS */ +/* #undef UA_ENABLE_VALGRIND_INTERACTIVE */ +#define UA_VALGRIND_INTERACTIVE_INTERVAL 1000 +#define UA_GENERATED_NAMESPACE_ZERO +/* #undef UA_GENERATED_NAMESPACE_ZERO_FULL */ +/* #undef UA_ENABLE_PUBSUB_MONITORING */ + +/* #undef UA_PACK_DEBIAN */ + +/* Options for Debugging */ +#define UA_DEBUG +/* #undef UA_DEBUG_DUMP_PKGS */ + +/** + * Function Export + * --------------- + * On Win32: Define ``UA_DYNAMIC_LINKING`` and ``UA_DYNAMIC_LINKING_EXPORT`` in + * order to export symbols for a DLL. Define ``UA_DYNAMIC_LINKING`` only to + * import symbols from a DLL.*/ +/* #undef UA_DYNAMIC_LINKING */ + +/* Shortcuts for extern "C" declarations */ +#if !defined(_UA_BEGIN_DECLS) +# ifdef __cplusplus +# define _UA_BEGIN_DECLS extern "C" { +# else +# define _UA_BEGIN_DECLS +# endif +#endif +#if !defined(_UA_END_DECLS) +# ifdef __cplusplus +# define _UA_END_DECLS } +# else +# define _UA_END_DECLS +# endif +#endif + +/* Select default architecture if non is selected through CMake or compiler define */ +#if 1 && !defined(UA_ARCHITECTURE_ECOS) && !defined(UA_ARCHITECTURE_FREERTOSLWIP) && !defined(UA_ARCHITECTURE_POSIX) && !defined(UA_ARCHITECTURE_VXWORKS) && !defined(UA_ARCHITECTURE_WEC7) && !defined(UA_ARCHITECTURE_WIN32) +# ifdef _WIN32 +# define UA_ARCHITECTURE_WIN32 +# else +# define UA_ARCHITECTURE_POSIX +# endif +#endif + +// specific architectures can undef this +#define UA_HAS_GETIFADDR + + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/win32/ua_architecture.h" ***********************************/ + +/* 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 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + +#ifdef UA_ARCHITECTURE_WIN32 + +#ifndef PLUGINS_ARCH_WIN32_UA_ARCHITECTURE_H_ +#define PLUGINS_ARCH_WIN32_UA_ARCHITECTURE_H_ + +#ifndef _BSD_SOURCE +# define _BSD_SOURCE +#endif + +/* Disable some security warnings on MSVC */ +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS +#endif + +/* Assume that Windows versions are newer than Windows XP */ +#if defined(__MINGW32__) && (!defined(WINVER) || WINVER < 0x501) +# undef WINVER +# undef _WIN32_WINDOWS +# undef _WIN32_WINNT +# define WINVER 0x0600 +# define _WIN32_WINDOWS 0x0600 +# define _WIN32_WINNT 0x0600 //windows vista version, which included InepPton +#endif + +#include <stdlib.h> +#if defined(_WIN32) && !defined(__clang__) +# include <malloc.h> +#endif + +#include <stdio.h> +#include <errno.h> +#include <winsock2.h> +#include <windows.h> +#include <ws2tcpip.h> + +#if defined (_MSC_VER) || defined(__clang__) +# ifndef UNDER_CE +# include <io.h> //access +# define UA_access _access +# endif +#else +# include <unistd.h> //access and tests +# define UA_access access +#endif + +#define ssize_t int +#define OPTVAL_TYPE char +#ifdef UA_sleep_ms +void UA_sleep_ms(unsigned long ms); +#else +# define UA_sleep_ms(X) Sleep(X) +#endif + +// Windows does not support ansi colors +// #define UA_ENABLE_LOG_COLORS + +#define UA_IPV6 1 + +#if defined(__MINGW32__) && !defined(__clang__) //mingw defines SOCKET as long long unsigned int, giving errors in logging and when comparing with UA_Int32 +# define UA_SOCKET int +# define UA_INVALID_SOCKET -1 +#else +# define UA_SOCKET SOCKET +# define UA_INVALID_SOCKET INVALID_SOCKET +#endif +#define UA_ERRNO WSAGetLastError() +#define UA_INTERRUPTED WSAEINTR +#define UA_AGAIN WSAEWOULDBLOCK +#define UA_EAGAIN EAGAIN +#define UA_WOULDBLOCK WSAEWOULDBLOCK +#define UA_ERR_CONNECTION_PROGRESS WSAEWOULDBLOCK + +#define UA_fd_set(fd, fds) FD_SET((UA_SOCKET)fd, fds) +#define UA_fd_isset(fd, fds) FD_ISSET((UA_SOCKET)fd, fds) + +#ifdef UNDER_CE +# define errno +#endif + +#define UA_getnameinfo getnameinfo +#define UA_send(sockfd, buf, len, flags) send(sockfd, buf, (int)(len), flags) +#define UA_recv(sockfd, buf, len, flags) recv(sockfd, buf, (int)(len), flags) +#define UA_sendto(sockfd, buf, len, flags, dest_addr, addrlen) sendto(sockfd, (const char*)(buf), (int)(len), flags, dest_addr, (int) (addrlen)) +#define UA_recvfrom(sockfd, buf, len, flags, src_addr, addrlen) recvfrom(sockfd, (char*)(buf), (int)(len), flags, src_addr, addrlen) +#define UA_htonl htonl +#define UA_ntohl ntohl +#define UA_close closesocket +#define UA_select(nfds, readfds, writefds, exceptfds, timeout) select((int)(nfds), readfds, writefds, exceptfds, timeout) +#define UA_shutdown shutdown +#define UA_socket socket +#define UA_bind bind +#define UA_listen listen +#define UA_accept accept +#define UA_connect(sockfd, addr, addrlen) connect(sockfd, addr, (int)(addrlen)) +#define UA_getaddrinfo getaddrinfo +#define UA_getsockopt getsockopt +#define UA_setsockopt(sockfd, level, optname, optval, optlen) setsockopt(sockfd, level, optname, (const char*) (optval), optlen) +#define UA_freeaddrinfo freeaddrinfo +#define UA_gethostname gethostname +#define UA_getsockname getsockname +#define UA_inet_pton InetPton + +#if UA_IPV6 +# include <iphlpapi.h> +# define UA_if_nametoindex if_nametoindex +#endif + +#ifdef maxStringLength //defined in mingw64 +# undef maxStringLength +#endif + +/* Use the standard malloc */ +#ifndef UA_free +# define UA_free free +# define UA_malloc malloc +# define UA_calloc calloc +# define UA_realloc realloc +#endif + +#ifdef __CODEGEARC__ +#define _snprintf_s(a,b,c,...) snprintf(a,b,__VA_ARGS__) +#endif + +/* 3rd Argument is the string */ +#define UA_snprintf(source, size, ...) _snprintf_s(source, size, _TRUNCATE, __VA_ARGS__) +#define UA_strncasecmp _strnicmp + +#define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \ + char *errno_str = NULL; \ + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, \ + NULL, WSAGetLastError(), \ + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), \ + (LPSTR)&errno_str, 0, NULL); \ + LOG; \ + LocalFree(errno_str); \ +} +#define UA_LOG_SOCKET_ERRNO_GAI_WRAP UA_LOG_SOCKET_ERRNO_WRAP + +#if UA_MULTITHREADING >= 100 +#define UA_LOCK_TYPE(mutexName) CRITICAL_SECTION mutexName; \ + int mutexName##Counter; +#define UA_LOCK_INIT(mutexName) InitializeCriticalSection(&mutexName); \ + mutexName##Counter = 0; +#define UA_LOCK_DESTROY(mutexName) DeleteCriticalSection(&mutexName); +#define UA_LOCK(mutexName) EnterCriticalSection(&mutexName); \ + UA_assert(++(mutexName##Counter) == 1); +#define UA_UNLOCK(mutexName) UA_assert(--(mutexName##Counter) == 0); \ + LeaveCriticalSection(&mutexName); +#define UA_LOCK_ASSERT(mutexName, num) UA_assert(mutexName##Counter == num); +#else +#define UA_LOCK_TYPE(mutexName) +#define UA_LOCK_TYPE_POINTER(mutexName) +#define UA_LOCK_INIT(mutexName) +#define UA_LOCK_DESTROY(mutexName) +#define UA_LOCK(mutexName) +#define UA_UNLOCK(mutexName) +#define UA_LOCK_ASSERT(mutexName, num) +#endif + + +/* Fix redefinition of SLIST_ENTRY on mingw winnt.h */ +#if !defined(_SYS_QUEUE_H_) && defined(SLIST_ENTRY) +# undef SLIST_ENTRY +#endif + +#endif /* PLUGINS_ARCH_WIN32_UA_ARCHITECTURE_H_ */ + +#endif /* UA_ARCHITECTURE_WIN32 */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/arch/posix/ua_architecture.h" ***********************************/ + +/* 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 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + +#ifdef UA_ARCHITECTURE_POSIX + + +/* Enable POSIX features */ +#if !defined(_XOPEN_SOURCE) +# define _XOPEN_SOURCE 600 +#endif +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE +#endif +/* On older systems we need to define _BSD_SOURCE. + * _DEFAULT_SOURCE is an alias for that. */ +#ifndef _BSD_SOURCE +# define _BSD_SOURCE +#endif + + +#include <errno.h> +#include <arpa/inet.h> +#include <netinet/in.h> +#include <netdb.h> +#include <sys/ioctl.h> +#include <sys/select.h> +#include <sys/types.h> +#include <net/if.h> +#ifdef UA_sleep_ms +void UA_sleep_ms(unsigned long ms); +#else +# include <unistd.h> +# define UA_sleep_ms(X) usleep(X * 1000) +#endif + +#define OPTVAL_TYPE int + +#include <fcntl.h> +#include <unistd.h> // read, write, close + +#ifdef __QNX__ +# include <sys/socket.h> +#endif +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +# include <sys/param.h> +# if defined(BSD) +# include<sys/socket.h> +# endif +#endif + +#include <netinet/tcp.h> + +/* unsigned int for windows and workaround to a glibc bug */ +/* Additionally if GNU_LIBRARY is not defined, it may be using + * musl libc (e.g. Docker Alpine) */ +#if defined(__OpenBSD__) || \ + (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ <= 6) && \ + (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 16) || \ + !defined(__GNU_LIBRARY__)) +# define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds) +# define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds) +#else +# define UA_fd_set(fd, fds) FD_SET(fd, fds) +# define UA_fd_isset(fd, fds) FD_ISSET(fd, fds) +#endif + +#define UA_access access + +#define UA_IPV6 1 +#define UA_SOCKET int +#define UA_INVALID_SOCKET -1 +#define UA_ERRNO errno +#define UA_INTERRUPTED EINTR +#define UA_AGAIN EAGAIN +#define UA_EAGAIN EAGAIN +#define UA_WOULDBLOCK EWOULDBLOCK +#define UA_ERR_CONNECTION_PROGRESS EINPROGRESS + +#define UA_ENABLE_LOG_COLORS + +#define UA_getnameinfo getnameinfo +#define UA_send send +#define UA_recv recv +#define UA_sendto sendto +#define UA_recvfrom recvfrom +#define UA_htonl htonl +#define UA_ntohl ntohl +#define UA_close close +#define UA_select select +#define UA_shutdown shutdown +#define UA_socket socket +#define UA_bind bind +#define UA_listen listen +#define UA_accept accept +#define UA_connect connect +#define UA_getaddrinfo getaddrinfo +#define UA_getsockopt getsockopt +#define UA_setsockopt setsockopt +#define UA_freeaddrinfo freeaddrinfo +#define UA_gethostname gethostname +#define UA_getsockname getsockname +#define UA_inet_pton inet_pton +#if UA_IPV6 +# define UA_if_nametoindex if_nametoindex +#endif + +/* Use the standard malloc */ +#include <stdlib.h> +#ifndef UA_free +# define UA_free free +# define UA_malloc malloc +# define UA_calloc calloc +# define UA_realloc realloc +#endif + +#include <stdio.h> +#include <strings.h> +#define UA_snprintf snprintf +#define UA_strncasecmp strncasecmp + +#define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \ + char *errno_str = strerror(errno); \ + LOG; \ +} +#define UA_LOG_SOCKET_ERRNO_GAI_WRAP(LOG) { \ + const char *errno_str = gai_strerror(errno); \ + LOG; \ +} + +#if UA_MULTITHREADING >= 100 +#include <pthread.h> +#define Sleep(x) sleep(x / 1000) +#define UA_LOCK_TYPE(mutexName) pthread_mutex_t mutexName; \ + pthread_mutexattr_t mutexName##_attr; \ + int mutexName##Counter; +#define UA_LOCK_INIT(mutexName) pthread_mutexattr_init(&mutexName##_attr); \ + pthread_mutexattr_settype(&mutexName##_attr, PTHREAD_MUTEX_RECURSIVE); \ + pthread_mutex_init(&mutexName, &mutexName##_attr); \ + mutexName##Counter = 0; +#define UA_LOCK_DESTROY(mutexName) pthread_mutex_destroy(&mutexName); \ + pthread_mutexattr_destroy(&mutexName##_attr); + +#define UA_LOCK(mutexName) pthread_mutex_lock(&mutexName); \ + UA_assert(++(mutexName##Counter) == 1); \ + +#define UA_UNLOCK(mutexName) UA_assert(--(mutexName##Counter) == 0); \ + pthread_mutex_unlock(&mutexName); +#define UA_LOCK_ASSERT(mutexName, num) UA_assert(mutexName##Counter == num); +#else +#define UA_LOCK_TYPE(mutexName) +#define UA_LOCK_INIT(mutexName) +#define UA_LOCK_DESTROY(mutexName) +#define UA_LOCK(mutexName) +#define UA_UNLOCK(mutexName) +#define UA_LOCK_ASSERT(mutexName, num) +#endif + + +#if defined(__APPLE__) && defined(_SYS_QUEUE_H_) +// in some compilers there's already a _SYS_QUEUE_H_ which is included first and doesn't have all functions + +#undef SLIST_HEAD +#undef SLIST_HEAD_INITIALIZER +#undef SLIST_ENTRY +#undef SLIST_FIRST +#undef SLIST_END +#undef SLIST_EMPTY +#undef SLIST_NEXT +#undef SLIST_FOREACH +#undef SLIST_FOREACH_SAFE +#undef SLIST_INIT +#undef SLIST_INSERT_AFTER +#undef SLIST_INSERT_HEAD +#undef SLIST_REMOVE_AFTER +#undef SLIST_REMOVE_HEAD +#undef SLIST_REMOVE +#undef LIST_HEAD +#undef LIST_HEAD_INITIALIZER +#undef LIST_ENTRY +#undef LIST_FIRST +#undef LIST_END +#undef LIST_EMPTY +#undef LIST_NEXT +#undef LIST_FOREACH +#undef LIST_FOREACH_SAFE +#undef LIST_INIT +#undef LIST_INSERT_AFTER +#undef LIST_INSERT_BEFORE +#undef LIST_INSERT_HEAD +#undef LIST_REMOVE +#undef LIST_REPLACE +#undef SIMPLEQ_HEAD +#undef SIMPLEQ_HEAD_INITIALIZER +#undef SIMPLEQ_ENTRY +#undef SIMPLEQ_FIRST +#undef SIMPLEQ_END +#undef SIMPLEQ_EMPTY +#undef SIMPLEQ_NEXT +#undef SIMPLEQ_FOREACH +#undef SIMPLEQ_FOREACH_SAFE +#undef SIMPLEQ_INIT +#undef SIMPLEQ_INSERT_HEAD +#undef SIMPLEQ_INSERT_TAIL +#undef SIMPLEQ_INSERT_AFTER +#undef SIMPLEQ_REMOVE_HEAD +#undef SIMPLEQ_REMOVE_AFTER +#undef XSIMPLEQ_HEAD +#undef XSIMPLEQ_ENTRY +#undef XSIMPLEQ_XOR +#undef XSIMPLEQ_FIRST +#undef XSIMPLEQ_END +#undef XSIMPLEQ_EMPTY +#undef XSIMPLEQ_NEXT +#undef XSIMPLEQ_FOREACH +#undef XSIMPLEQ_FOREACH_SAFE +#undef XSIMPLEQ_INIT +#undef XSIMPLEQ_INSERT_HEAD +#undef XSIMPLEQ_INSERT_TAIL +#undef XSIMPLEQ_INSERT_AFTER +#undef XSIMPLEQ_REMOVE_HEAD +#undef XSIMPLEQ_REMOVE_AFTER +#undef TAILQ_HEAD +#undef TAILQ_HEAD_INITIALIZER +#undef TAILQ_ENTRY +#undef TAILQ_FIRST +#undef TAILQ_END +#undef TAILQ_NEXT +#undef TAILQ_LAST +#undef TAILQ_PREV +#undef TAILQ_EMPTY +#undef TAILQ_FOREACH +#undef TAILQ_FOREACH_SAFE +#undef TAILQ_FOREACH_REVERSE +#undef TAILQ_FOREACH_REVERSE_SAFE +#undef TAILQ_INIT +#undef TAILQ_INSERT_HEAD +#undef TAILQ_INSERT_TAIL +#undef TAILQ_INSERT_AFTER +#undef TAILQ_INSERT_BEFORE +#undef TAILQ_REMOVE +#undef TAILQ_REPLACE +#undef CIRCLEQ_HEAD +#undef CIRCLEQ_HEAD_INITIALIZER +#undef CIRCLEQ_ENTRY +#undef CIRCLEQ_FIRST +#undef CIRCLEQ_LAST +#undef CIRCLEQ_END +#undef CIRCLEQ_NEXT +#undef CIRCLEQ_PREV +#undef CIRCLEQ_EMPTY +#undef CIRCLEQ_FOREACH +#undef CIRCLEQ_FOREACH_SAFE +#undef CIRCLEQ_FOREACH_REVERSE +#undef CIRCLEQ_FOREACH_REVERSE_SAFE +#undef CIRCLEQ_INIT +#undef CIRCLEQ_INSERT_AFTER +#undef CIRCLEQ_INSERT_BEFORE +#undef CIRCLEQ_INSERT_HEAD +#undef CIRCLEQ_INSERT_TAIL +#undef CIRCLEQ_REMOVE +#undef CIRCLEQ_REPLACE + +#undef _SYS_QUEUE_H_ + +#endif /* defined(__APPLE__) && defined(_SYS_QUEUE_H_) */ + + +#endif /* UA_ARCHITECTURE_POSIX */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/ms_stdint.h" ***********************************/ + +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the product nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#if !defined(_MSC_VER) || _MSC_VER >= 1600 // [ +#include <stdint.h> +#else + + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include <limits.h> + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifndef UNDER_CE +#ifdef __cplusplus +extern "C" { +#endif +# include <wchar.h> +#ifdef __cplusplus +} +#endif +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>. +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // !defined(_MSC_VER) || _MSC_VER >= 1600 ] + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/architecture_definitions.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Jose Cabral, fortiss GmbH + */ + + + +/** + * C99 Definitions + * --------------- */ +#include <string.h> +#include <stddef.h> + +/* Include stdint.h and stdbool.h or workaround for older Visual Studios */ +#ifdef UNDER_CE +#endif +#if !defined(_MSC_VER) || _MSC_VER >= 1800 +# include <stdint.h> +# include <stdbool.h> /* C99 Boolean */ +#else +# if !defined(__bool_true_false_are_defined) +# define bool unsigned char +# define true 1 +# define false 0 +# define __bool_true_false_are_defined +# endif +#endif + +/* Include inttypes.h or workaround for older Visual Studios */ +#if !defined(_MSC_VER) || _MSC_VER >= 1800 +# include <inttypes.h> +#else +# define __PRI_8_LENGTH_MODIFIER__ "hh" +# define __PRI_64_LENGTH_MODIFIER__ "ll" + +# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" +# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" +# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" + +# define PRId16 "hd" +# define PRIi16 "hi" +# define PRIo16 "ho" +# define PRIu16 "hu" +# define PRIx16 "hx" +# define PRIX16 "hX" + +# define PRId32 "ld" +# define PRIi32 "li" +# define PRIo32 "lo" +# define PRIu32 "lu" +# define PRIx32 "lx" +# define PRIX32 "lX" + +# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" +# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" +# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" +# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" +# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" +# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" +#endif + +/** + * Memory Management + * ----------------- + * + * The flag ``UA_ENABLE_MALLOC_SINGLETON`` enables singleton (global) variables + * with method pointers for memory management (malloc et al.). The method + * pointers can be switched out at runtime. Use-cases for this are testing of + * constrained memory conditions and arena-based custom memory management. + * + * If the flag is undefined, then ``UA_malloc`` etc. are set to the default + * malloc, as defined in ``/arch/<architecture>/ua_architecture.h``. + */ + +#ifdef UA_ENABLE_MALLOC_SINGLETON +extern void * (*UA_mallocSingleton)(size_t size); +extern void (*UA_freeSingleton)(void *ptr); +extern void * (*UA_callocSingleton)(size_t nelem, size_t elsize); +extern void * (*UA_reallocSingleton)(void *ptr, size_t size); +# define UA_malloc(size) UA_mallocSingleton(size) +# define UA_free(ptr) UA_freeSingleton(ptr) +# define UA_calloc(num, size) UA_callocSingleton(num, size) +# define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size) +#endif + +/* Stack-allocation of memory. Use C99 variable-length arrays if possible. + * Otherwise revert to alloca. Note that alloca is not supported on some + * plattforms. */ +#ifndef UA_STACKARRAY +# if defined(__GNUC__) || defined(__clang__) +# define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE] +# else +# if defined(__GNUC__) || defined(__clang__) +# define UA_alloca(size) __builtin_alloca (size) +# elif defined(_WIN32) +# define UA_alloca(SIZE) _alloca(SIZE) +# else +# include <alloca.h> +# define UA_alloca(SIZE) alloca(SIZE) +# endif +# define UA_STACKARRAY(TYPE, NAME, SIZE) \ + TYPE *(NAME) = (TYPE*)UA_alloca(sizeof(TYPE) * (SIZE)) +# endif +#endif + +/** + * Assertions + * ---------- + * The assert macro is disabled by defining NDEBUG. It is often forgotten to + * include -DNDEBUG in the compiler flags when using the single-file release. So + * we make assertions dependent on the UA_DEBUG definition handled by CMake. */ +#ifdef UA_DEBUG +# include <assert.h> +# define UA_assert(ignore) assert(ignore) +#else +# define UA_assert(ignore) do {} while(0) +#endif + +/* Outputs an error message at compile time if the assert fails. + * Example usage: + * UA_STATIC_ASSERT(sizeof(long)==7, use_another_compiler_luke) + * See: https://stackoverflow.com/a/4815532/869402 */ +#if defined(__cplusplus) && __cplusplus >= 201103L /* C++11 or above */ +# define UA_STATIC_ASSERT(cond,msg) static_assert(cond, #msg) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* C11 or above */ +# define UA_STATIC_ASSERT(cond,msg) _Static_assert(cond, #msg) +#elif defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) /* GCC, Clang, MSC */ +# define UA_CTASTR2(pre,post) pre ## post +# define UA_CTASTR(pre,post) UA_CTASTR2(pre,post) +# ifndef __COUNTER__ /* PPC GCC fix */ +# define __COUNTER__ __LINE__ +# endif +# define UA_STATIC_ASSERT(cond,msg) \ + typedef struct { \ + int UA_CTASTR(static_assertion_failed_,msg) : !!(cond); \ + } UA_CTASTR(static_assertion_failed_,__COUNTER__) +#else /* Everybody else */ +# define UA_STATIC_ASSERT(cond,msg) typedef char static_assertion_##msg[(cond)?1:-1] +#endif + +#if defined(_WIN32) && defined(UA_DYNAMIC_LINKING) +# ifdef UA_DYNAMIC_LINKING_EXPORT /* export dll */ +# ifdef __GNUC__ +# define UA_EXPORT __attribute__ ((dllexport)) +# else +# define UA_EXPORT __declspec(dllexport) +# endif +# else /* import dll */ +# ifdef __GNUC__ +# define UA_EXPORT __attribute__ ((dllimport)) +# else +# define UA_EXPORT __declspec(dllimport) +# endif +# endif +#else /* non win32 */ +# if __GNUC__ || __clang__ +# define UA_EXPORT __attribute__ ((visibility ("default"))) +# endif +#endif +#ifndef UA_EXPORT +# define UA_EXPORT /* fallback to default */ +#endif + +#define UA_THREADSAFE + +/** + * Inline Functions + * ---------------- */ +#ifdef _MSC_VER +# define UA_INLINE __inline +#else +# define UA_INLINE inline +#endif + +/** + * Non-aliasing pointers + * -------------------- */ +#ifdef _MSC_VER +# define UA_RESTRICT __restrict +#elif defined(__GNUC__) +# define UA_RESTRICT __restrict__ +#elif defined(__CODEGEARC__) +# define UA_RESTRICT _RESTRICT +#else +# define UA_RESTRICT restrict +#endif + +/** + * Function attributes + * ------------------- */ +#if defined(__GNUC__) || defined(__clang__) +# define UA_FUNC_ATTR_MALLOC __attribute__((malloc)) +# define UA_FUNC_ATTR_PURE __attribute__ ((pure)) +# define UA_FUNC_ATTR_CONST __attribute__((const)) +# define UA_FUNC_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define UA_FORMAT(X,Y) __attribute__ ((format (printf, X, Y))) +#else +# define UA_FUNC_ATTR_MALLOC +# define UA_FUNC_ATTR_PURE +# define UA_FUNC_ATTR_CONST +# define UA_FUNC_ATTR_WARN_UNUSED_RESULT +# define UA_FORMAT(X,Y) +#endif + +#if defined(__GNUC__) || defined(__clang__) +# define UA_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +# define UA_DEPRECATED __declspec(deprecated) +#else +# define UA_DEPRECATED +#endif + +/** + * Internal Attributes + * ------------------- + * These attributes are only defined if the macro UA_INTERNAL is defined. That + * way public methods can be annotated (e.g. to warn for unused results) but + * warnings are only triggered for internal code. */ + +#if defined(UA_INTERNAL) && (defined(__GNUC__) || defined(__clang__)) +# define UA_INTERNAL_DEPRECATED _Pragma ("GCC warning \"Macro is deprecated for internal use\"") +#else +# define UA_INTERNAL_DEPRECATED +#endif + +#if defined(UA_INTERNAL) && (defined(__GNUC__) || defined(__clang__)) +# define UA_INTERNAL_FUNC_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define UA_INTERNAL_FUNC_ATTR_WARN_UNUSED_RESULT +#endif + +/** + * Detect Endianness and IEEE 754 floating point + * --------------------------------------------- + * Integers and floating point numbers are transmitted in little-endian (IEEE + * 754 for floating point) encoding. If the target architecture uses the same + * format, numeral datatypes can be memcpy'd (overlayed) on the network buffer. + * Otherwise, a slow default encoding routine is used that works for every + * architecture. + * + * Integer Endianness + * ^^^^^^^^^^^^^^^^^^ + * The definition ``UA_LITTLE_ENDIAN`` is true when the integer representation + * of the target architecture is little-endian. */ +#if defined(_WIN32) +# define UA_LITTLE_ENDIAN 1 +#elif defined(__i386__) || defined(__x86_64__) || defined(__amd64__) +# define UA_LITTLE_ENDIAN 1 +#elif (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ + (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) +# define UA_LITTLE_ENDIAN 1 +#elif defined(__linux__) /* Linux (including Android) */ +# include <endian.h> +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define UA_LITTLE_ENDIAN 1 +# endif +#elif defined(__OpenBSD__) /* OpenBSD */ +# include <sys/endian.h> +# if BYTE_ORDER == LITTLE_ENDIAN +# define UA_LITTLE_ENDIAN 1 +# endif +#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) /* Other BSD */ +# include <sys/endian.h> +# if _BYTE_ORDER == _LITTLE_ENDIAN +# define UA_LITTLE_ENDIAN 1 +# endif +#elif defined(__APPLE__) /* Apple (MacOS, iOS) */ +# include <libkern/OSByteOrder.h> +# if defined(__LITTLE_ENDIAN__) +# define UA_LITTLE_ENDIAN 1 +# endif +#elif defined(__QNX__) || defined(__QNXNTO__) /* QNX */ +# include <gulliver.h> +# if defined(__LITTLEENDIAN__) +# define UA_LITTLE_ENDIAN 1 +# endif +#elif defined(_OS9000) /* OS-9 */ +# if defined(_LIL_END) +# define UA_LITTLE_ENDIAN 1 +# endif +#endif +#ifndef UA_LITTLE_ENDIAN +# define UA_LITTLE_ENDIAN 0 +#endif + +/* Can the integers be memcpy'd onto the network buffer? Add additional checks + * here. Some platforms (e.g. QNX) have sizeof(bool) > 1. Manually disable + * overlayed integer encoding if that is the case. */ +#if (UA_LITTLE_ENDIAN == 1) +UA_STATIC_ASSERT(sizeof(bool) == 1, cannot_overlay_integers_with_large_bool); +# define UA_BINARY_OVERLAYABLE_INTEGER 1 +#else +# define UA_BINARY_OVERLAYABLE_INTEGER 0 +#endif + +/** + * Float Endianness + * ^^^^^^^^^^^^^^^^ + * The definition ``UA_FLOAT_IEEE754`` is set to true when the floating point + * number representation of the target architecture is IEEE 754. The definition + * ``UA_FLOAT_LITTLE_ENDIAN`` is set to true when the floating point number + * representation is in little-endian encoding. */ + +#if defined(_WIN32) +# define UA_FLOAT_IEEE754 1 +#elif defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || \ + defined(__ia64__) || defined(__powerpc__) || defined(__sparc__) || \ + defined(__arm__) +# define UA_FLOAT_IEEE754 1 +#elif defined(__STDC_IEC_559__) +# define UA_FLOAT_IEEE754 1 +#else +# define UA_FLOAT_IEEE754 0 +#endif + +/* Wikipedia says (https://en.wikipedia.org/wiki/Endianness): Although the + * ubiquitous x86 processors of today use little-endian storage for all types of + * data (integer, floating point, BCD), there are a number of hardware + * architectures where floating-point numbers are represented in big-endian form + * while integers are represented in little-endian form. */ +#if defined(_WIN32) +# define UA_FLOAT_LITTLE_ENDIAN 1 +#elif defined(__i386__) || defined(__x86_64__) || defined(__amd64__) +# define UA_FLOAT_LITTLE_ENDIAN 1 +#elif defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ + (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__) /* Defined only in GCC */ +# define UA_FLOAT_LITTLE_ENDIAN 1 +#elif defined(__FLOAT_WORD_ORDER) && defined(__LITTLE_ENDIAN) && \ + (__FLOAT_WORD_ORDER == __LITTLE_ENDIAN) /* Defined only in GCC */ +# define UA_FLOAT_LITTLE_ENDIAN 1 +#endif +#ifndef UA_FLOAT_LITTLE_ENDIAN +# define UA_FLOAT_LITTLE_ENDIAN 0 +#endif + +/* Only if the floating points are litle-endian **and** in IEEE 754 format can + * we memcpy directly onto the network buffer. */ +#if (UA_FLOAT_IEEE754 == 1) && (UA_FLOAT_LITTLE_ENDIAN == 1) +# define UA_BINARY_OVERLAYABLE_FLOAT 1 +#else +# define UA_BINARY_OVERLAYABLE_FLOAT 0 +#endif + +/* Atomic Operations + * ----------------- + * Atomic operations that synchronize across processor cores (for + * multithreading). Only the inline-functions defined next are used. Replace + * with architecture-specific operations if necessary. */ +#if UA_MULTITHREADING >= 200 + #ifdef _MSC_VER /* Visual Studio */ + #define UA_atomic_sync() _ReadWriteBarrier() + #else /* GCC/Clang */ + #define UA_atomic_sync() __sync_synchronize() + #endif +#else + #define UA_atomic_sync() +#endif + +static UA_INLINE void * +UA_atomic_xchg(void * volatile * addr, void *newptr) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedExchangePointer(addr, newptr); +#else /* GCC/Clang */ + return __sync_lock_test_and_set(addr, newptr); +#endif +#else + void *old = *addr; + *addr = newptr; + return old; +#endif +} + +static UA_INLINE void * +UA_atomic_cmpxchg(void * volatile * addr, void *expected, void *newptr) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedCompareExchangePointer(addr, expected, newptr); +#else /* GCC/Clang */ + return __sync_val_compare_and_swap(addr, expected, newptr); +#endif +#else + void *old = *addr; + if(old == expected) { + *addr = newptr; + } + return old; +#endif +} + +static UA_INLINE uint32_t +UA_atomic_addUInt32(volatile uint32_t *addr, uint32_t increase) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedExchangeAdd(addr, increase) + increase; +#else /* GCC/Clang */ + return __sync_add_and_fetch(addr, increase); +#endif +#else + *addr += increase; + return *addr; +#endif +} + +static UA_INLINE size_t +UA_atomic_addSize(volatile size_t *addr, size_t increase) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedExchangeAdd(addr, increase) + increase; +#else /* GCC/Clang */ + return __sync_add_and_fetch(addr, increase); +#endif +#else + *addr += increase; + return *addr; +#endif +} + +static UA_INLINE uint32_t +UA_atomic_subUInt32(volatile uint32_t *addr, uint32_t decrease) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedExchangeSub(addr, decrease) - decrease; +#else /* GCC/Clang */ + return __sync_sub_and_fetch(addr, decrease); +#endif +#else + *addr -= decrease; + return *addr; +#endif +} + +static UA_INLINE size_t +UA_atomic_subSize(volatile size_t *addr, size_t decrease) { +#if UA_MULTITHREADING >= 200 +#ifdef _MSC_VER /* Visual Studio */ + return _InterlockedExchangeSub(addr, decrease) - decrease; +#else /* GCC/Clang */ + return __sync_sub_and_fetch(addr, decrease); +#endif +#else + *addr -= decrease; + return *addr; +#endif +} + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/statuscodes.h" ***********************************/ + +/*--------------------------------------------------------- + * Autogenerated -- do not modify + * Generated from /home/rosselliot/sandbox/open62541/tools/schema/StatusCode.csv with script /home/rosselliot/sandbox/open62541/tools/generate_statuscode_descriptions.py + *-------------------------------------------------------*/ + +/** + * .. _statuscodes: + * + * StatusCodes + * ----------- + * StatusCodes are extensively used in the OPC UA protocol and in the open62541 + * API. They are represented by the :ref:`statuscode` data type. The following + * definitions are autogenerated from the ``Opc.Ua.StatusCodes.csv`` file provided + * with the OPC UA standard. */ + +/* These StatusCodes are manually generated. */ +#define UA_STATUSCODE_GOOD 0x00 +#define UA_STATUSCODE_INFOTYPE_DATAVALUE 0x00000400 +#define UA_STATUSCODE_INFOBITS_OVERFLOW 0x00000080 + +/* An unexpected error occurred. */ +#define UA_STATUSCODE_BADUNEXPECTEDERROR 0x80010000 + +/* An internal error occurred as a result of a programming or configuration error. */ +#define UA_STATUSCODE_BADINTERNALERROR 0x80020000 + +/* Not enough memory to complete the operation. */ +#define UA_STATUSCODE_BADOUTOFMEMORY 0x80030000 + +/* An operating system resource is not available. */ +#define UA_STATUSCODE_BADRESOURCEUNAVAILABLE 0x80040000 + +/* A low level communication error occurred. */ +#define UA_STATUSCODE_BADCOMMUNICATIONERROR 0x80050000 + +/* Encoding halted because of invalid data in the objects being serialized. */ +#define UA_STATUSCODE_BADENCODINGERROR 0x80060000 + +/* Decoding halted because of invalid data in the stream. */ +#define UA_STATUSCODE_BADDECODINGERROR 0x80070000 + +/* The message encoding/decoding limits imposed by the stack have been exceeded. */ +#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED 0x80080000 + +/* The request message size exceeds limits set by the server. */ +#define UA_STATUSCODE_BADREQUESTTOOLARGE 0x80B80000 + +/* The response message size exceeds limits set by the client. */ +#define UA_STATUSCODE_BADRESPONSETOOLARGE 0x80B90000 + +/* An unrecognized response was received from the server. */ +#define UA_STATUSCODE_BADUNKNOWNRESPONSE 0x80090000 + +/* The operation timed out. */ +#define UA_STATUSCODE_BADTIMEOUT 0x800A0000 + +/* The server does not support the requested service. */ +#define UA_STATUSCODE_BADSERVICEUNSUPPORTED 0x800B0000 + +/* The operation was cancelled because the application is shutting down. */ +#define UA_STATUSCODE_BADSHUTDOWN 0x800C0000 + +/* The operation could not complete because the client is not connected to the server. */ +#define UA_STATUSCODE_BADSERVERNOTCONNECTED 0x800D0000 + +/* The server has stopped and cannot process any requests. */ +#define UA_STATUSCODE_BADSERVERHALTED 0x800E0000 + +/* There was nothing to do because the client passed a list of operations with no elements. */ +#define UA_STATUSCODE_BADNOTHINGTODO 0x800F0000 + +/* The request could not be processed because it specified too many operations. */ +#define UA_STATUSCODE_BADTOOMANYOPERATIONS 0x80100000 + +/* The request could not be processed because there are too many monitored items in the subscription. */ +#define UA_STATUSCODE_BADTOOMANYMONITOREDITEMS 0x80DB0000 + +/* The extension object cannot be (de)serialized because the data type id is not recognized. */ +#define UA_STATUSCODE_BADDATATYPEIDUNKNOWN 0x80110000 + +/* The certificate provided as a parameter is not valid. */ +#define UA_STATUSCODE_BADCERTIFICATEINVALID 0x80120000 + +/* An error occurred verifying security. */ +#define UA_STATUSCODE_BADSECURITYCHECKSFAILED 0x80130000 + +/* The certificate does not meet the requirements of the security policy. */ +#define UA_STATUSCODE_BADCERTIFICATEPOLICYCHECKFAILED 0x81140000 + +/* The certificate has expired or is not yet valid. */ +#define UA_STATUSCODE_BADCERTIFICATETIMEINVALID 0x80140000 + +/* An issuer certificate has expired or is not yet valid. */ +#define UA_STATUSCODE_BADCERTIFICATEISSUERTIMEINVALID 0x80150000 + +/* The HostName used to connect to a server does not match a HostName in the certificate. */ +#define UA_STATUSCODE_BADCERTIFICATEHOSTNAMEINVALID 0x80160000 + +/* The URI specified in the ApplicationDescription does not match the URI in the certificate. */ +#define UA_STATUSCODE_BADCERTIFICATEURIINVALID 0x80170000 + +/* The certificate may not be used for the requested operation. */ +#define UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED 0x80180000 + +/* The issuer certificate may not be used for the requested operation. */ +#define UA_STATUSCODE_BADCERTIFICATEISSUERUSENOTALLOWED 0x80190000 + +/* The certificate is not trusted. */ +#define UA_STATUSCODE_BADCERTIFICATEUNTRUSTED 0x801A0000 + +/* It was not possible to determine if the certificate has been revoked. */ +#define UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN 0x801B0000 + +/* It was not possible to determine if the issuer certificate has been revoked. */ +#define UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN 0x801C0000 + +/* The certificate has been revoked. */ +#define UA_STATUSCODE_BADCERTIFICATEREVOKED 0x801D0000 + +/* The issuer certificate has been revoked. */ +#define UA_STATUSCODE_BADCERTIFICATEISSUERREVOKED 0x801E0000 + +/* The certificate chain is incomplete. */ +#define UA_STATUSCODE_BADCERTIFICATECHAININCOMPLETE 0x810D0000 + +/* User does not have permission to perform the requested operation. */ +#define UA_STATUSCODE_BADUSERACCESSDENIED 0x801F0000 + +/* The user identity token is not valid. */ +#define UA_STATUSCODE_BADIDENTITYTOKENINVALID 0x80200000 + +/* The user identity token is valid but the server has rejected it. */ +#define UA_STATUSCODE_BADIDENTITYTOKENREJECTED 0x80210000 + +/* The specified secure channel is no longer valid. */ +#define UA_STATUSCODE_BADSECURECHANNELIDINVALID 0x80220000 + +/* The timestamp is outside the range allowed by the server. */ +#define UA_STATUSCODE_BADINVALIDTIMESTAMP 0x80230000 + +/* The nonce does appear to be not a random value or it is not the correct length. */ +#define UA_STATUSCODE_BADNONCEINVALID 0x80240000 + +/* The session id is not valid. */ +#define UA_STATUSCODE_BADSESSIONIDINVALID 0x80250000 + +/* The session was closed by the client. */ +#define UA_STATUSCODE_BADSESSIONCLOSED 0x80260000 + +/* The session cannot be used because ActivateSession has not been called. */ +#define UA_STATUSCODE_BADSESSIONNOTACTIVATED 0x80270000 + +/* The subscription id is not valid. */ +#define UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID 0x80280000 + +/* The header for the request is missing or invalid. */ +#define UA_STATUSCODE_BADREQUESTHEADERINVALID 0x802A0000 + +/* The timestamps to return parameter is invalid. */ +#define UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID 0x802B0000 + +/* The request was cancelled by the client. */ +#define UA_STATUSCODE_BADREQUESTCANCELLEDBYCLIENT 0x802C0000 + +/* Too many arguments were provided. */ +#define UA_STATUSCODE_BADTOOMANYARGUMENTS 0x80E50000 + +/* The server requires a license to operate in general or to perform a service or operation */ +#define UA_STATUSCODE_BADLICENSEEXPIRED 0x810E0000 + +/* The server has limits on number of allowed operations / objects */ +#define UA_STATUSCODE_BADLICENSELIMITSEXCEEDED 0x810F0000 + +/* The server does not have a license which is required to operate in general or to perform a service or operation. */ +#define UA_STATUSCODE_BADLICENSENOTAVAILABLE 0x81100000 + +/* The subscription was transferred to another session. */ +#define UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED 0x002D0000 + +/* The processing will complete asynchronously. */ +#define UA_STATUSCODE_GOODCOMPLETESASYNCHRONOUSLY 0x002E0000 + +/* Sampling has slowed down due to resource limitations. */ +#define UA_STATUSCODE_GOODOVERLOAD 0x002F0000 + +/* The value written was accepted but was clamped. */ +#define UA_STATUSCODE_GOODCLAMPED 0x00300000 + +/* Communication with the data source is defined */ +#define UA_STATUSCODE_BADNOCOMMUNICATION 0x80310000 + +/* Waiting for the server to obtain values from the underlying data source. */ +#define UA_STATUSCODE_BADWAITINGFORINITIALDATA 0x80320000 + +/* The syntax of the node id is not valid. */ +#define UA_STATUSCODE_BADNODEIDINVALID 0x80330000 + +/* The node id refers to a node that does not exist in the server address space. */ +#define UA_STATUSCODE_BADNODEIDUNKNOWN 0x80340000 + +/* The attribute is not supported for the specified Node. */ +#define UA_STATUSCODE_BADATTRIBUTEIDINVALID 0x80350000 + +/* The syntax of the index range parameter is invalid. */ +#define UA_STATUSCODE_BADINDEXRANGEINVALID 0x80360000 + +/* No data exists within the range of indexes specified. */ +#define UA_STATUSCODE_BADINDEXRANGENODATA 0x80370000 + +/* The data encoding is invalid. */ +#define UA_STATUSCODE_BADDATAENCODINGINVALID 0x80380000 + +/* The server does not support the requested data encoding for the node. */ +#define UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED 0x80390000 + +/* The access level does not allow reading or subscribing to the Node. */ +#define UA_STATUSCODE_BADNOTREADABLE 0x803A0000 + +/* The access level does not allow writing to the Node. */ +#define UA_STATUSCODE_BADNOTWRITABLE 0x803B0000 + +/* The value was out of range. */ +#define UA_STATUSCODE_BADOUTOFRANGE 0x803C0000 + +/* The requested operation is not supported. */ +#define UA_STATUSCODE_BADNOTSUPPORTED 0x803D0000 + +/* A requested item was not found or a search operation ended without success. */ +#define UA_STATUSCODE_BADNOTFOUND 0x803E0000 + +/* The object cannot be used because it has been deleted. */ +#define UA_STATUSCODE_BADOBJECTDELETED 0x803F0000 + +/* Requested operation is not implemented. */ +#define UA_STATUSCODE_BADNOTIMPLEMENTED 0x80400000 + +/* The monitoring mode is invalid. */ +#define UA_STATUSCODE_BADMONITORINGMODEINVALID 0x80410000 + +/* The monitoring item id does not refer to a valid monitored item. */ +#define UA_STATUSCODE_BADMONITOREDITEMIDINVALID 0x80420000 + +/* The monitored item filter parameter is not valid. */ +#define UA_STATUSCODE_BADMONITOREDITEMFILTERINVALID 0x80430000 + +/* The server does not support the requested monitored item filter. */ +#define UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED 0x80440000 + +/* A monitoring filter cannot be used in combination with the attribute specified. */ +#define UA_STATUSCODE_BADFILTERNOTALLOWED 0x80450000 + +/* A mandatory structured parameter was missing or null. */ +#define UA_STATUSCODE_BADSTRUCTUREMISSING 0x80460000 + +/* The event filter is not valid. */ +#define UA_STATUSCODE_BADEVENTFILTERINVALID 0x80470000 + +/* The content filter is not valid. */ +#define UA_STATUSCODE_BADCONTENTFILTERINVALID 0x80480000 + +/* An unrecognized operator was provided in a filter. */ +#define UA_STATUSCODE_BADFILTEROPERATORINVALID 0x80C10000 + +/* A valid operator was provided */ +#define UA_STATUSCODE_BADFILTEROPERATORUNSUPPORTED 0x80C20000 + +/* The number of operands provided for the filter operator was less then expected for the operand provided. */ +#define UA_STATUSCODE_BADFILTEROPERANDCOUNTMISMATCH 0x80C30000 + +/* The operand used in a content filter is not valid. */ +#define UA_STATUSCODE_BADFILTEROPERANDINVALID 0x80490000 + +/* The referenced element is not a valid element in the content filter. */ +#define UA_STATUSCODE_BADFILTERELEMENTINVALID 0x80C40000 + +/* The referenced literal is not a valid value. */ +#define UA_STATUSCODE_BADFILTERLITERALINVALID 0x80C50000 + +/* The continuation point provide is longer valid. */ +#define UA_STATUSCODE_BADCONTINUATIONPOINTINVALID 0x804A0000 + +/* The operation could not be processed because all continuation points have been allocated. */ +#define UA_STATUSCODE_BADNOCONTINUATIONPOINTS 0x804B0000 + +/* The reference type id does not refer to a valid reference type node. */ +#define UA_STATUSCODE_BADREFERENCETYPEIDINVALID 0x804C0000 + +/* The browse direction is not valid. */ +#define UA_STATUSCODE_BADBROWSEDIRECTIONINVALID 0x804D0000 + +/* The node is not part of the view. */ +#define UA_STATUSCODE_BADNODENOTINVIEW 0x804E0000 + +/* The number was not accepted because of a numeric overflow. */ +#define UA_STATUSCODE_BADNUMERICOVERFLOW 0x81120000 + +/* The ServerUri is not a valid URI. */ +#define UA_STATUSCODE_BADSERVERURIINVALID 0x804F0000 + +/* No ServerName was specified. */ +#define UA_STATUSCODE_BADSERVERNAMEMISSING 0x80500000 + +/* No DiscoveryUrl was specified. */ +#define UA_STATUSCODE_BADDISCOVERYURLMISSING 0x80510000 + +/* The semaphore file specified by the client is not valid. */ +#define UA_STATUSCODE_BADSEMPAHOREFILEMISSING 0x80520000 + +/* The security token request type is not valid. */ +#define UA_STATUSCODE_BADREQUESTTYPEINVALID 0x80530000 + +/* The security mode does not meet the requirements set by the server. */ +#define UA_STATUSCODE_BADSECURITYMODEREJECTED 0x80540000 + +/* The security policy does not meet the requirements set by the server. */ +#define UA_STATUSCODE_BADSECURITYPOLICYREJECTED 0x80550000 + +/* The server has reached its maximum number of sessions. */ +#define UA_STATUSCODE_BADTOOMANYSESSIONS 0x80560000 + +/* The user token signature is missing or invalid. */ +#define UA_STATUSCODE_BADUSERSIGNATUREINVALID 0x80570000 + +/* The signature generated with the client certificate is missing or invalid. */ +#define UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID 0x80580000 + +/* The client did not provide at least one software certificate that is valid and meets the profile requirements for the server. */ +#define UA_STATUSCODE_BADNOVALIDCERTIFICATES 0x80590000 + +/* The server does not support changing the user identity assigned to the session. */ +#define UA_STATUSCODE_BADIDENTITYCHANGENOTSUPPORTED 0x80C60000 + +/* The request was cancelled by the client with the Cancel service. */ +#define UA_STATUSCODE_BADREQUESTCANCELLEDBYREQUEST 0x805A0000 + +/* The parent node id does not to refer to a valid node. */ +#define UA_STATUSCODE_BADPARENTNODEIDINVALID 0x805B0000 + +/* The reference could not be created because it violates constraints imposed by the data model. */ +#define UA_STATUSCODE_BADREFERENCENOTALLOWED 0x805C0000 + +/* The requested node id was reject because it was either invalid or server does not allow node ids to be specified by the client. */ +#define UA_STATUSCODE_BADNODEIDREJECTED 0x805D0000 + +/* The requested node id is already used by another node. */ +#define UA_STATUSCODE_BADNODEIDEXISTS 0x805E0000 + +/* The node class is not valid. */ +#define UA_STATUSCODE_BADNODECLASSINVALID 0x805F0000 + +/* The browse name is invalid. */ +#define UA_STATUSCODE_BADBROWSENAMEINVALID 0x80600000 + +/* The browse name is not unique among nodes that share the same relationship with the parent. */ +#define UA_STATUSCODE_BADBROWSENAMEDUPLICATED 0x80610000 + +/* The node attributes are not valid for the node class. */ +#define UA_STATUSCODE_BADNODEATTRIBUTESINVALID 0x80620000 + +/* The type definition node id does not reference an appropriate type node. */ +#define UA_STATUSCODE_BADTYPEDEFINITIONINVALID 0x80630000 + +/* The source node id does not reference a valid node. */ +#define UA_STATUSCODE_BADSOURCENODEIDINVALID 0x80640000 + +/* The target node id does not reference a valid node. */ +#define UA_STATUSCODE_BADTARGETNODEIDINVALID 0x80650000 + +/* The reference type between the nodes is already defined. */ +#define UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED 0x80660000 + +/* The server does not allow this type of self reference on this node. */ +#define UA_STATUSCODE_BADINVALIDSELFREFERENCE 0x80670000 + +/* The reference type is not valid for a reference to a remote server. */ +#define UA_STATUSCODE_BADREFERENCELOCALONLY 0x80680000 + +/* The server will not allow the node to be deleted. */ +#define UA_STATUSCODE_BADNODELETERIGHTS 0x80690000 + +/* The server was not able to delete all target references. */ +#define UA_STATUSCODE_UNCERTAINREFERENCENOTDELETED 0x40BC0000 + +/* The server index is not valid. */ +#define UA_STATUSCODE_BADSERVERINDEXINVALID 0x806A0000 + +/* The view id does not refer to a valid view node. */ +#define UA_STATUSCODE_BADVIEWIDUNKNOWN 0x806B0000 + +/* The view timestamp is not available or not supported. */ +#define UA_STATUSCODE_BADVIEWTIMESTAMPINVALID 0x80C90000 + +/* The view parameters are not consistent with each other. */ +#define UA_STATUSCODE_BADVIEWPARAMETERMISMATCH 0x80CA0000 + +/* The view version is not available or not supported. */ +#define UA_STATUSCODE_BADVIEWVERSIONINVALID 0x80CB0000 + +/* The list of references may not be complete because the underlying system is not available. */ +#define UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE 0x40C00000 + +/* The server should have followed a reference to a node in a remote server but did not. The result set may be incomplete. */ +#define UA_STATUSCODE_GOODRESULTSMAYBEINCOMPLETE 0x00BA0000 + +/* The provided Nodeid was not a type definition nodeid. */ +#define UA_STATUSCODE_BADNOTTYPEDEFINITION 0x80C80000 + +/* One of the references to follow in the relative path references to a node in the address space in another server. */ +#define UA_STATUSCODE_UNCERTAINREFERENCEOUTOFSERVER 0x406C0000 + +/* The requested operation has too many matches to return. */ +#define UA_STATUSCODE_BADTOOMANYMATCHES 0x806D0000 + +/* The requested operation requires too many resources in the server. */ +#define UA_STATUSCODE_BADQUERYTOOCOMPLEX 0x806E0000 + +/* The requested operation has no match to return. */ +#define UA_STATUSCODE_BADNOMATCH 0x806F0000 + +/* The max age parameter is invalid. */ +#define UA_STATUSCODE_BADMAXAGEINVALID 0x80700000 + +/* The operation is not permitted over the current secure channel. */ +#define UA_STATUSCODE_BADSECURITYMODEINSUFFICIENT 0x80E60000 + +/* The history details parameter is not valid. */ +#define UA_STATUSCODE_BADHISTORYOPERATIONINVALID 0x80710000 + +/* The server does not support the requested operation. */ +#define UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED 0x80720000 + +/* The defined timestamp to return was invalid. */ +#define UA_STATUSCODE_BADINVALIDTIMESTAMPARGUMENT 0x80BD0000 + +/* The server does not support writing the combination of value */ +#define UA_STATUSCODE_BADWRITENOTSUPPORTED 0x80730000 + +/* The value supplied for the attribute is not of the same type as the attribute's value. */ +#define UA_STATUSCODE_BADTYPEMISMATCH 0x80740000 + +/* The method id does not refer to a method for the specified object. */ +#define UA_STATUSCODE_BADMETHODINVALID 0x80750000 + +/* The client did not specify all of the input arguments for the method. */ +#define UA_STATUSCODE_BADARGUMENTSMISSING 0x80760000 + +/* The executable attribute does not allow the execution of the method. */ +#define UA_STATUSCODE_BADNOTEXECUTABLE 0x81110000 + +/* The server has reached its maximum number of subscriptions. */ +#define UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS 0x80770000 + +/* The server has reached the maximum number of queued publish requests. */ +#define UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS 0x80780000 + +/* There is no subscription available for this session. */ +#define UA_STATUSCODE_BADNOSUBSCRIPTION 0x80790000 + +/* The sequence number is unknown to the server. */ +#define UA_STATUSCODE_BADSEQUENCENUMBERUNKNOWN 0x807A0000 + +/* The requested notification message is no longer available. */ +#define UA_STATUSCODE_BADMESSAGENOTAVAILABLE 0x807B0000 + +/* The client of the current session does not support one or more Profiles that are necessary for the subscription. */ +#define UA_STATUSCODE_BADINSUFFICIENTCLIENTPROFILE 0x807C0000 + +/* The sub-state machine is not currently active. */ +#define UA_STATUSCODE_BADSTATENOTACTIVE 0x80BF0000 + +/* An equivalent rule already exists. */ +#define UA_STATUSCODE_BADALREADYEXISTS 0x81150000 + +/* The server cannot process the request because it is too busy. */ +#define UA_STATUSCODE_BADTCPSERVERTOOBUSY 0x807D0000 + +/* The type of the message specified in the header invalid. */ +#define UA_STATUSCODE_BADTCPMESSAGETYPEINVALID 0x807E0000 + +/* The SecureChannelId and/or TokenId are not currently in use. */ +#define UA_STATUSCODE_BADTCPSECURECHANNELUNKNOWN 0x807F0000 + +/* The size of the message specified in the header is too large. */ +#define UA_STATUSCODE_BADTCPMESSAGETOOLARGE 0x80800000 + +/* There are not enough resources to process the request. */ +#define UA_STATUSCODE_BADTCPNOTENOUGHRESOURCES 0x80810000 + +/* An internal error occurred. */ +#define UA_STATUSCODE_BADTCPINTERNALERROR 0x80820000 + +/* The server does not recognize the QueryString specified. */ +#define UA_STATUSCODE_BADTCPENDPOINTURLINVALID 0x80830000 + +/* The request could not be sent because of a network interruption. */ +#define UA_STATUSCODE_BADREQUESTINTERRUPTED 0x80840000 + +/* Timeout occurred while processing the request. */ +#define UA_STATUSCODE_BADREQUESTTIMEOUT 0x80850000 + +/* The secure channel has been closed. */ +#define UA_STATUSCODE_BADSECURECHANNELCLOSED 0x80860000 + +/* The token has expired or is not recognized. */ +#define UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN 0x80870000 + +/* The sequence number is not valid. */ +#define UA_STATUSCODE_BADSEQUENCENUMBERINVALID 0x80880000 + +/* The applications do not have compatible protocol versions. */ +#define UA_STATUSCODE_BADPROTOCOLVERSIONUNSUPPORTED 0x80BE0000 + +/* There is a problem with the configuration that affects the usefulness of the value. */ +#define UA_STATUSCODE_BADCONFIGURATIONERROR 0x80890000 + +/* The variable should receive its value from another variable */ +#define UA_STATUSCODE_BADNOTCONNECTED 0x808A0000 + +/* There has been a failure in the device/data source that generates the value that has affected the value. */ +#define UA_STATUSCODE_BADDEVICEFAILURE 0x808B0000 + +/* There has been a failure in the sensor from which the value is derived by the device/data source. */ +#define UA_STATUSCODE_BADSENSORFAILURE 0x808C0000 + +/* The source of the data is not operational. */ +#define UA_STATUSCODE_BADOUTOFSERVICE 0x808D0000 + +/* The deadband filter is not valid. */ +#define UA_STATUSCODE_BADDEADBANDFILTERINVALID 0x808E0000 + +/* Communication to the data source has failed. The variable value is the last value that had a good quality. */ +#define UA_STATUSCODE_UNCERTAINNOCOMMUNICATIONLASTUSABLEVALUE 0x408F0000 + +/* Whatever was updating this value has stopped doing so. */ +#define UA_STATUSCODE_UNCERTAINLASTUSABLEVALUE 0x40900000 + +/* The value is an operational value that was manually overwritten. */ +#define UA_STATUSCODE_UNCERTAINSUBSTITUTEVALUE 0x40910000 + +/* The value is an initial value for a variable that normally receives its value from another variable. */ +#define UA_STATUSCODE_UNCERTAININITIALVALUE 0x40920000 + +/* The value is at one of the sensor limits. */ +#define UA_STATUSCODE_UNCERTAINSENSORNOTACCURATE 0x40930000 + +/* The value is outside of the range of values defined for this parameter. */ +#define UA_STATUSCODE_UNCERTAINENGINEERINGUNITSEXCEEDED 0x40940000 + +/* The value is derived from multiple sources and has less than the required number of Good sources. */ +#define UA_STATUSCODE_UNCERTAINSUBNORMAL 0x40950000 + +/* The value has been overridden. */ +#define UA_STATUSCODE_GOODLOCALOVERRIDE 0x00960000 + +/* This Condition refresh failed */ +#define UA_STATUSCODE_BADREFRESHINPROGRESS 0x80970000 + +/* This condition has already been disabled. */ +#define UA_STATUSCODE_BADCONDITIONALREADYDISABLED 0x80980000 + +/* This condition has already been enabled. */ +#define UA_STATUSCODE_BADCONDITIONALREADYENABLED 0x80CC0000 + +/* Property not available */ +#define UA_STATUSCODE_BADCONDITIONDISABLED 0x80990000 + +/* The specified event id is not recognized. */ +#define UA_STATUSCODE_BADEVENTIDUNKNOWN 0x809A0000 + +/* The event cannot be acknowledged. */ +#define UA_STATUSCODE_BADEVENTNOTACKNOWLEDGEABLE 0x80BB0000 + +/* The dialog condition is not active. */ +#define UA_STATUSCODE_BADDIALOGNOTACTIVE 0x80CD0000 + +/* The response is not valid for the dialog. */ +#define UA_STATUSCODE_BADDIALOGRESPONSEINVALID 0x80CE0000 + +/* The condition branch has already been acknowledged. */ +#define UA_STATUSCODE_BADCONDITIONBRANCHALREADYACKED 0x80CF0000 + +/* The condition branch has already been confirmed. */ +#define UA_STATUSCODE_BADCONDITIONBRANCHALREADYCONFIRMED 0x80D00000 + +/* The condition has already been shelved. */ +#define UA_STATUSCODE_BADCONDITIONALREADYSHELVED 0x80D10000 + +/* The condition is not currently shelved. */ +#define UA_STATUSCODE_BADCONDITIONNOTSHELVED 0x80D20000 + +/* The shelving time not within an acceptable range. */ +#define UA_STATUSCODE_BADSHELVINGTIMEOUTOFRANGE 0x80D30000 + +/* No data exists for the requested time range or event filter. */ +#define UA_STATUSCODE_BADNODATA 0x809B0000 + +/* No data found to provide upper or lower bound value. */ +#define UA_STATUSCODE_BADBOUNDNOTFOUND 0x80D70000 + +/* The server cannot retrieve a bound for the variable. */ +#define UA_STATUSCODE_BADBOUNDNOTSUPPORTED 0x80D80000 + +/* Data is missing due to collection started/stopped/lost. */ +#define UA_STATUSCODE_BADDATALOST 0x809D0000 + +/* Expected data is unavailable for the requested time range due to an un-mounted volume */ +#define UA_STATUSCODE_BADDATAUNAVAILABLE 0x809E0000 + +/* The data or event was not successfully inserted because a matching entry exists. */ +#define UA_STATUSCODE_BADENTRYEXISTS 0x809F0000 + +/* The data or event was not successfully updated because no matching entry exists. */ +#define UA_STATUSCODE_BADNOENTRYEXISTS 0x80A00000 + +/* The client requested history using a timestamp format the server does not support (i.e requested ServerTimestamp when server only supports SourceTimestamp). */ +#define UA_STATUSCODE_BADTIMESTAMPNOTSUPPORTED 0x80A10000 + +/* The data or event was successfully inserted into the historical database. */ +#define UA_STATUSCODE_GOODENTRYINSERTED 0x00A20000 + +/* The data or event field was successfully replaced in the historical database. */ +#define UA_STATUSCODE_GOODENTRYREPLACED 0x00A30000 + +/* The value is derived from multiple values and has less than the required number of Good values. */ +#define UA_STATUSCODE_UNCERTAINDATASUBNORMAL 0x40A40000 + +/* No data exists for the requested time range or event filter. */ +#define UA_STATUSCODE_GOODNODATA 0x00A50000 + +/* The data or event field was successfully replaced in the historical database. */ +#define UA_STATUSCODE_GOODMOREDATA 0x00A60000 + +/* The requested number of Aggregates does not match the requested number of NodeIds. */ +#define UA_STATUSCODE_BADAGGREGATELISTMISMATCH 0x80D40000 + +/* The requested Aggregate is not support by the server. */ +#define UA_STATUSCODE_BADAGGREGATENOTSUPPORTED 0x80D50000 + +/* The aggregate value could not be derived due to invalid data inputs. */ +#define UA_STATUSCODE_BADAGGREGATEINVALIDINPUTS 0x80D60000 + +/* The aggregate configuration is not valid for specified node. */ +#define UA_STATUSCODE_BADAGGREGATECONFIGURATIONREJECTED 0x80DA0000 + +/* The request specifies fields which are not valid for the EventType or cannot be saved by the historian. */ +#define UA_STATUSCODE_GOODDATAIGNORED 0x00D90000 + +/* The request was rejected by the server because it did not meet the criteria set by the server. */ +#define UA_STATUSCODE_BADREQUESTNOTALLOWED 0x80E40000 + +/* The request has not been processed by the server yet. */ +#define UA_STATUSCODE_BADREQUESTNOTCOMPLETE 0x81130000 + +/* The value does not come from the real source and has been edited by the server. */ +#define UA_STATUSCODE_GOODEDITED 0x00DC0000 + +/* There was an error in execution of these post-actions. */ +#define UA_STATUSCODE_GOODPOSTACTIONFAILED 0x00DD0000 + +/* The related EngineeringUnit has been changed but the Variable Value is still provided based on the previous unit. */ +#define UA_STATUSCODE_UNCERTAINDOMINANTVALUECHANGED 0x40DE0000 + +/* A dependent value has been changed but the change has not been applied to the device. */ +#define UA_STATUSCODE_GOODDEPENDENTVALUECHANGED 0x00E00000 + +/* The related EngineeringUnit has been changed but this change has not been applied to the device. The Variable Value is still dependent on the previous unit but its status is currently Bad. */ +#define UA_STATUSCODE_BADDOMINANTVALUECHANGED 0x80E10000 + +/* A dependent value has been changed but the change has not been applied to the device. The quality of the dominant variable is uncertain. */ +#define UA_STATUSCODE_UNCERTAINDEPENDENTVALUECHANGED 0x40E20000 + +/* A dependent value has been changed but the change has not been applied to the device. The quality of the dominant variable is Bad. */ +#define UA_STATUSCODE_BADDEPENDENTVALUECHANGED 0x80E30000 + +/* The communication layer has raised an event. */ +#define UA_STATUSCODE_GOODCOMMUNICATIONEVENT 0x00A70000 + +/* The system is shutting down. */ +#define UA_STATUSCODE_GOODSHUTDOWNEVENT 0x00A80000 + +/* The operation is not finished and needs to be called again. */ +#define UA_STATUSCODE_GOODCALLAGAIN 0x00A90000 + +/* A non-critical timeout occurred. */ +#define UA_STATUSCODE_GOODNONCRITICALTIMEOUT 0x00AA0000 + +/* One or more arguments are invalid. */ +#define UA_STATUSCODE_BADINVALIDARGUMENT 0x80AB0000 + +/* Could not establish a network connection to remote server. */ +#define UA_STATUSCODE_BADCONNECTIONREJECTED 0x80AC0000 + +/* The server has disconnected from the client. */ +#define UA_STATUSCODE_BADDISCONNECT 0x80AD0000 + +/* The network connection has been closed. */ +#define UA_STATUSCODE_BADCONNECTIONCLOSED 0x80AE0000 + +/* The operation cannot be completed because the object is closed */ +#define UA_STATUSCODE_BADINVALIDSTATE 0x80AF0000 + +/* Cannot move beyond end of the stream. */ +#define UA_STATUSCODE_BADENDOFSTREAM 0x80B00000 + +/* No data is currently available for reading from a non-blocking stream. */ +#define UA_STATUSCODE_BADNODATAAVAILABLE 0x80B10000 + +/* The asynchronous operation is waiting for a response. */ +#define UA_STATUSCODE_BADWAITINGFORRESPONSE 0x80B20000 + +/* The asynchronous operation was abandoned by the caller. */ +#define UA_STATUSCODE_BADOPERATIONABANDONED 0x80B30000 + +/* The stream did not return all data requested (possibly because it is a non-blocking stream). */ +#define UA_STATUSCODE_BADEXPECTEDSTREAMTOBLOCK 0x80B40000 + +/* Non blocking behaviour is required and the operation would block. */ +#define UA_STATUSCODE_BADWOULDBLOCK 0x80B50000 + +/* A value had an invalid syntax. */ +#define UA_STATUSCODE_BADSYNTAXERROR 0x80B60000 + +/* The operation could not be finished because all available connections are in use. */ +#define UA_STATUSCODE_BADMAXCONNECTIONSREACHED 0x80B70000 + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/nodeids.h" ***********************************/ + +/*--------------------------------------------------------- + * Autogenerated -- do not modify + * Generated from /home/rosselliot/sandbox/open62541/tools/schema/NodeIds.csv with script /home/rosselliot/sandbox/open62541/tools/generate_nodeid_header.py + *-------------------------------------------------------*/ + +#ifndef UA_NODEIDS_NS0_H_ +#define UA_NODEIDS_NS0_H_ + +/** + * Namespace Zero NodeIds + * ---------------------- + * Numeric identifiers of standard-defined nodes in namespace zero. The + * following definitions are autogenerated from the ``/home/rosselliot/sandbox/open62541/tools/schema/NodeIds.csv`` file */ + +#define UA_NS0ID_BOOLEAN 1 /* DataType */ +#define UA_NS0ID_SBYTE 2 /* DataType */ +#define UA_NS0ID_BYTE 3 /* DataType */ +#define UA_NS0ID_INT16 4 /* DataType */ +#define UA_NS0ID_UINT16 5 /* DataType */ +#define UA_NS0ID_INT32 6 /* DataType */ +#define UA_NS0ID_UINT32 7 /* DataType */ +#define UA_NS0ID_INT64 8 /* DataType */ +#define UA_NS0ID_UINT64 9 /* DataType */ +#define UA_NS0ID_FLOAT 10 /* DataType */ +#define UA_NS0ID_DOUBLE 11 /* DataType */ +#define UA_NS0ID_STRING 12 /* DataType */ +#define UA_NS0ID_DATETIME 13 /* DataType */ +#define UA_NS0ID_GUID 14 /* DataType */ +#define UA_NS0ID_BYTESTRING 15 /* DataType */ +#define UA_NS0ID_XMLELEMENT 16 /* DataType */ +#define UA_NS0ID_NODEID 17 /* DataType */ +#define UA_NS0ID_EXPANDEDNODEID 18 /* DataType */ +#define UA_NS0ID_STATUSCODE 19 /* DataType */ +#define UA_NS0ID_QUALIFIEDNAME 20 /* DataType */ +#define UA_NS0ID_LOCALIZEDTEXT 21 /* DataType */ +#define UA_NS0ID_STRUCTURE 22 /* DataType */ +#define UA_NS0ID_DATAVALUE 23 /* DataType */ +#define UA_NS0ID_BASEDATATYPE 24 /* DataType */ +#define UA_NS0ID_DIAGNOSTICINFO 25 /* DataType */ +#define UA_NS0ID_NUMBER 26 /* DataType */ +#define UA_NS0ID_INTEGER 27 /* DataType */ +#define UA_NS0ID_UINTEGER 28 /* DataType */ +#define UA_NS0ID_ENUMERATION 29 /* DataType */ +#define UA_NS0ID_IMAGE 30 /* DataType */ +#define UA_NS0ID_REFERENCES 31 /* ReferenceType */ +#define UA_NS0ID_NONHIERARCHICALREFERENCES 32 /* ReferenceType */ +#define UA_NS0ID_HIERARCHICALREFERENCES 33 /* ReferenceType */ +#define UA_NS0ID_HASCHILD 34 /* ReferenceType */ +#define UA_NS0ID_ORGANIZES 35 /* ReferenceType */ +#define UA_NS0ID_HASEVENTSOURCE 36 /* ReferenceType */ +#define UA_NS0ID_HASMODELLINGRULE 37 /* ReferenceType */ +#define UA_NS0ID_HASENCODING 38 /* ReferenceType */ +#define UA_NS0ID_HASDESCRIPTION 39 /* ReferenceType */ +#define UA_NS0ID_HASTYPEDEFINITION 40 /* ReferenceType */ +#define UA_NS0ID_GENERATESEVENT 41 /* ReferenceType */ +#define UA_NS0ID_AGGREGATES 44 /* ReferenceType */ +#define UA_NS0ID_HASSUBTYPE 45 /* ReferenceType */ +#define UA_NS0ID_HASPROPERTY 46 /* ReferenceType */ +#define UA_NS0ID_HASCOMPONENT 47 /* ReferenceType */ +#define UA_NS0ID_HASNOTIFIER 48 /* ReferenceType */ +#define UA_NS0ID_HASORDEREDCOMPONENT 49 /* ReferenceType */ +#define UA_NS0ID_DECIMAL 50 /* DataType */ +#define UA_NS0ID_FROMSTATE 51 /* ReferenceType */ +#define UA_NS0ID_TOSTATE 52 /* ReferenceType */ +#define UA_NS0ID_HASCAUSE 53 /* ReferenceType */ +#define UA_NS0ID_HASEFFECT 54 /* ReferenceType */ +#define UA_NS0ID_HASHISTORICALCONFIGURATION 56 /* ReferenceType */ +#define UA_NS0ID_BASEOBJECTTYPE 58 /* ObjectType */ +#define UA_NS0ID_FOLDERTYPE 61 /* ObjectType */ +#define UA_NS0ID_BASEVARIABLETYPE 62 /* VariableType */ +#define UA_NS0ID_BASEDATAVARIABLETYPE 63 /* VariableType */ +#define UA_NS0ID_PROPERTYTYPE 68 /* VariableType */ +#define UA_NS0ID_DATATYPEDESCRIPTIONTYPE 69 /* VariableType */ +#define UA_NS0ID_DATATYPEDICTIONARYTYPE 72 /* VariableType */ +#define UA_NS0ID_DATATYPESYSTEMTYPE 75 /* ObjectType */ +#define UA_NS0ID_DATATYPEENCODINGTYPE 76 /* ObjectType */ +#define UA_NS0ID_MODELLINGRULETYPE 77 /* ObjectType */ +#define UA_NS0ID_MODELLINGRULE_MANDATORY 78 /* Object */ +#define UA_NS0ID_MODELLINGRULE_MANDATORYSHARED 79 /* Object */ +#define UA_NS0ID_MODELLINGRULE_OPTIONAL 80 /* Object */ +#define UA_NS0ID_MODELLINGRULE_EXPOSESITSARRAY 83 /* Object */ +#define UA_NS0ID_ROOTFOLDER 84 /* Object */ +#define UA_NS0ID_OBJECTSFOLDER 85 /* Object */ +#define UA_NS0ID_TYPESFOLDER 86 /* Object */ +#define UA_NS0ID_VIEWSFOLDER 87 /* Object */ +#define UA_NS0ID_OBJECTTYPESFOLDER 88 /* Object */ +#define UA_NS0ID_VARIABLETYPESFOLDER 89 /* Object */ +#define UA_NS0ID_DATATYPESFOLDER 90 /* Object */ +#define UA_NS0ID_REFERENCETYPESFOLDER 91 /* Object */ +#define UA_NS0ID_XMLSCHEMA_TYPESYSTEM 92 /* Object */ +#define UA_NS0ID_OPCBINARYSCHEMA_TYPESYSTEM 93 /* Object */ +#define UA_NS0ID_PERMISSIONTYPE 94 /* DataType */ +#define UA_NS0ID_ACCESSRESTRICTIONTYPE 95 /* DataType */ +#define UA_NS0ID_ROLEPERMISSIONTYPE 96 /* DataType */ +#define UA_NS0ID_DATATYPEDEFINITION 97 /* DataType */ +#define UA_NS0ID_STRUCTURETYPE 98 /* DataType */ +#define UA_NS0ID_STRUCTUREDEFINITION 99 /* DataType */ +#define UA_NS0ID_ENUMDEFINITION 100 /* DataType */ +#define UA_NS0ID_STRUCTUREFIELD 101 /* DataType */ +#define UA_NS0ID_ENUMFIELD 102 /* DataType */ +#define UA_NS0ID_DATATYPEDESCRIPTIONTYPE_DATATYPEVERSION 104 /* Variable */ +#define UA_NS0ID_DATATYPEDESCRIPTIONTYPE_DICTIONARYFRAGMENT 105 /* Variable */ +#define UA_NS0ID_DATATYPEDICTIONARYTYPE_DATATYPEVERSION 106 /* Variable */ +#define UA_NS0ID_DATATYPEDICTIONARYTYPE_NAMESPACEURI 107 /* Variable */ +#define UA_NS0ID_MODELLINGRULETYPE_NAMINGRULE 111 /* Variable */ +#define UA_NS0ID_MODELLINGRULE_MANDATORY_NAMINGRULE 112 /* Variable */ +#define UA_NS0ID_MODELLINGRULE_OPTIONAL_NAMINGRULE 113 /* Variable */ +#define UA_NS0ID_MODELLINGRULE_EXPOSESITSARRAY_NAMINGRULE 114 /* Variable */ +#define UA_NS0ID_MODELLINGRULE_MANDATORYSHARED_NAMINGRULE 116 /* Variable */ +#define UA_NS0ID_HASSUBSTATEMACHINE 117 /* ReferenceType */ +#define UA_NS0ID_NAMINGRULETYPE 120 /* DataType */ +#define UA_NS0ID_DATATYPEDEFINITION_ENCODING_DEFAULTBINARY 121 /* Object */ +#define UA_NS0ID_STRUCTUREDEFINITION_ENCODING_DEFAULTBINARY 122 /* Object */ +#define UA_NS0ID_ENUMDEFINITION_ENCODING_DEFAULTBINARY 123 /* Object */ +#define UA_NS0ID_DATASETMETADATATYPE_ENCODING_DEFAULTBINARY 124 /* Object */ +#define UA_NS0ID_DATATYPEDESCRIPTION_ENCODING_DEFAULTBINARY 125 /* Object */ +#define UA_NS0ID_STRUCTUREDESCRIPTION_ENCODING_DEFAULTBINARY 126 /* Object */ +#define UA_NS0ID_ENUMDESCRIPTION_ENCODING_DEFAULTBINARY 127 /* Object */ +#define UA_NS0ID_ROLEPERMISSIONTYPE_ENCODING_DEFAULTBINARY 128 /* Object */ +#define UA_NS0ID_HASARGUMENTDESCRIPTION 129 /* ReferenceType */ +#define UA_NS0ID_HASOPTIONALINPUTARGUMENTDESCRIPTION 131 /* ReferenceType */ +#define UA_NS0ID_IDTYPE 256 /* DataType */ +#define UA_NS0ID_NODECLASS 257 /* DataType */ +#define UA_NS0ID_NODE 258 /* DataType */ +#define UA_NS0ID_NODE_ENCODING_DEFAULTXML 259 /* Object */ +#define UA_NS0ID_NODE_ENCODING_DEFAULTBINARY 260 /* Object */ +#define UA_NS0ID_OBJECTNODE 261 /* DataType */ +#define UA_NS0ID_OBJECTNODE_ENCODING_DEFAULTXML 262 /* Object */ +#define UA_NS0ID_OBJECTNODE_ENCODING_DEFAULTBINARY 263 /* Object */ +#define UA_NS0ID_OBJECTTYPENODE 264 /* DataType */ +#define UA_NS0ID_OBJECTTYPENODE_ENCODING_DEFAULTXML 265 /* Object */ +#define UA_NS0ID_OBJECTTYPENODE_ENCODING_DEFAULTBINARY 266 /* Object */ +#define UA_NS0ID_VARIABLENODE 267 /* DataType */ +#define UA_NS0ID_VARIABLENODE_ENCODING_DEFAULTXML 268 /* Object */ +#define UA_NS0ID_VARIABLENODE_ENCODING_DEFAULTBINARY 269 /* Object */ +#define UA_NS0ID_VARIABLETYPENODE 270 /* DataType */ +#define UA_NS0ID_VARIABLETYPENODE_ENCODING_DEFAULTXML 271 /* Object */ +#define UA_NS0ID_VARIABLETYPENODE_ENCODING_DEFAULTBINARY 272 /* Object */ +#define UA_NS0ID_REFERENCETYPENODE 273 /* DataType */ +#define UA_NS0ID_REFERENCETYPENODE_ENCODING_DEFAULTXML 274 /* Object */ +#define UA_NS0ID_REFERENCETYPENODE_ENCODING_DEFAULTBINARY 275 /* Object */ +#define UA_NS0ID_METHODNODE 276 /* DataType */ +#define UA_NS0ID_METHODNODE_ENCODING_DEFAULTXML 277 /* Object */ +#define UA_NS0ID_METHODNODE_ENCODING_DEFAULTBINARY 278 /* Object */ +#define UA_NS0ID_VIEWNODE 279 /* DataType */ +#define UA_NS0ID_VIEWNODE_ENCODING_DEFAULTXML 280 /* Object */ +#define UA_NS0ID_VIEWNODE_ENCODING_DEFAULTBINARY 281 /* Object */ +#define UA_NS0ID_DATATYPENODE 282 /* DataType */ +#define UA_NS0ID_DATATYPENODE_ENCODING_DEFAULTXML 283 /* Object */ +#define UA_NS0ID_DATATYPENODE_ENCODING_DEFAULTBINARY 284 /* Object */ +#define UA_NS0ID_REFERENCENODE 285 /* DataType */ +#define UA_NS0ID_REFERENCENODE_ENCODING_DEFAULTXML 286 /* Object */ +#define UA_NS0ID_REFERENCENODE_ENCODING_DEFAULTBINARY 287 /* Object */ +#define UA_NS0ID_INTEGERID 288 /* DataType */ +#define UA_NS0ID_COUNTER 289 /* DataType */ +#define UA_NS0ID_DURATION 290 /* DataType */ +#define UA_NS0ID_NUMERICRANGE 291 /* DataType */ +#define UA_NS0ID_TIME 292 /* DataType */ +#define UA_NS0ID_DATE 293 /* DataType */ +#define UA_NS0ID_UTCTIME 294 /* DataType */ +#define UA_NS0ID_LOCALEID 295 /* DataType */ +#define UA_NS0ID_ARGUMENT 296 /* DataType */ +#define UA_NS0ID_ARGUMENT_ENCODING_DEFAULTXML 297 /* Object */ +#define UA_NS0ID_ARGUMENT_ENCODING_DEFAULTBINARY 298 /* Object */ +#define UA_NS0ID_STATUSRESULT 299 /* DataType */ +#define UA_NS0ID_STATUSRESULT_ENCODING_DEFAULTXML 300 /* Object */ +#define UA_NS0ID_STATUSRESULT_ENCODING_DEFAULTBINARY 301 /* Object */ +#define UA_NS0ID_MESSAGESECURITYMODE 302 /* DataType */ +#define UA_NS0ID_USERTOKENTYPE 303 /* DataType */ +#define UA_NS0ID_USERTOKENPOLICY 304 /* DataType */ +#define UA_NS0ID_USERTOKENPOLICY_ENCODING_DEFAULTXML 305 /* Object */ +#define UA_NS0ID_USERTOKENPOLICY_ENCODING_DEFAULTBINARY 306 /* Object */ +#define UA_NS0ID_APPLICATIONTYPE 307 /* DataType */ +#define UA_NS0ID_APPLICATIONDESCRIPTION 308 /* DataType */ +#define UA_NS0ID_APPLICATIONDESCRIPTION_ENCODING_DEFAULTXML 309 /* Object */ +#define UA_NS0ID_APPLICATIONDESCRIPTION_ENCODING_DEFAULTBINARY 310 /* Object */ +#define UA_NS0ID_APPLICATIONINSTANCECERTIFICATE 311 /* DataType */ +#define UA_NS0ID_ENDPOINTDESCRIPTION 312 /* DataType */ +#define UA_NS0ID_ENDPOINTDESCRIPTION_ENCODING_DEFAULTXML 313 /* Object */ +#define UA_NS0ID_ENDPOINTDESCRIPTION_ENCODING_DEFAULTBINARY 314 /* Object */ +#define UA_NS0ID_SECURITYTOKENREQUESTTYPE 315 /* DataType */ +#define UA_NS0ID_USERIDENTITYTOKEN 316 /* DataType */ +#define UA_NS0ID_USERIDENTITYTOKEN_ENCODING_DEFAULTXML 317 /* Object */ +#define UA_NS0ID_USERIDENTITYTOKEN_ENCODING_DEFAULTBINARY 318 /* Object */ +#define UA_NS0ID_ANONYMOUSIDENTITYTOKEN 319 /* DataType */ +#define UA_NS0ID_ANONYMOUSIDENTITYTOKEN_ENCODING_DEFAULTXML 320 /* Object */ +#define UA_NS0ID_ANONYMOUSIDENTITYTOKEN_ENCODING_DEFAULTBINARY 321 /* Object */ +#define UA_NS0ID_USERNAMEIDENTITYTOKEN 322 /* DataType */ +#define UA_NS0ID_USERNAMEIDENTITYTOKEN_ENCODING_DEFAULTXML 323 /* Object */ +#define UA_NS0ID_USERNAMEIDENTITYTOKEN_ENCODING_DEFAULTBINARY 324 /* Object */ +#define UA_NS0ID_X509IDENTITYTOKEN 325 /* DataType */ +#define UA_NS0ID_X509IDENTITYTOKEN_ENCODING_DEFAULTXML 326 /* Object */ +#define UA_NS0ID_X509IDENTITYTOKEN_ENCODING_DEFAULTBINARY 327 /* Object */ +#define UA_NS0ID_ENDPOINTCONFIGURATION 331 /* DataType */ +#define UA_NS0ID_ENDPOINTCONFIGURATION_ENCODING_DEFAULTXML 332 /* Object */ +#define UA_NS0ID_ENDPOINTCONFIGURATION_ENCODING_DEFAULTBINARY 333 /* Object */ +#define UA_NS0ID_BUILDINFO 338 /* DataType */ +#define UA_NS0ID_BUILDINFO_ENCODING_DEFAULTXML 339 /* Object */ +#define UA_NS0ID_BUILDINFO_ENCODING_DEFAULTBINARY 340 /* Object */ +#define UA_NS0ID_SIGNEDSOFTWARECERTIFICATE 344 /* DataType */ +#define UA_NS0ID_SIGNEDSOFTWARECERTIFICATE_ENCODING_DEFAULTXML 345 /* Object */ +#define UA_NS0ID_SIGNEDSOFTWARECERTIFICATE_ENCODING_DEFAULTBINARY 346 /* Object */ +#define UA_NS0ID_ATTRIBUTEWRITEMASK 347 /* DataType */ +#define UA_NS0ID_NODEATTRIBUTESMASK 348 /* DataType */ +#define UA_NS0ID_NODEATTRIBUTES 349 /* DataType */ +#define UA_NS0ID_NODEATTRIBUTES_ENCODING_DEFAULTXML 350 /* Object */ +#define UA_NS0ID_NODEATTRIBUTES_ENCODING_DEFAULTBINARY 351 /* Object */ +#define UA_NS0ID_OBJECTATTRIBUTES 352 /* DataType */ +#define UA_NS0ID_OBJECTATTRIBUTES_ENCODING_DEFAULTXML 353 /* Object */ +#define UA_NS0ID_OBJECTATTRIBUTES_ENCODING_DEFAULTBINARY 354 /* Object */ +#define UA_NS0ID_VARIABLEATTRIBUTES 355 /* DataType */ +#define UA_NS0ID_VARIABLEATTRIBUTES_ENCODING_DEFAULTXML 356 /* Object */ +#define UA_NS0ID_VARIABLEATTRIBUTES_ENCODING_DEFAULTBINARY 357 /* Object */ +#define UA_NS0ID_METHODATTRIBUTES 358 /* DataType */ +#define UA_NS0ID_METHODATTRIBUTES_ENCODING_DEFAULTXML 359 /* Object */ +#define UA_NS0ID_METHODATTRIBUTES_ENCODING_DEFAULTBINARY 360 /* Object */ +#define UA_NS0ID_OBJECTTYPEATTRIBUTES 361 /* DataType */ +#define UA_NS0ID_OBJECTTYPEATTRIBUTES_ENCODING_DEFAULTXML 362 /* Object */ +#define UA_NS0ID_OBJECTTYPEATTRIBUTES_ENCODING_DEFAULTBINARY 363 /* Object */ +#define UA_NS0ID_VARIABLETYPEATTRIBUTES 364 /* DataType */ +#define UA_NS0ID_VARIABLETYPEATTRIBUTES_ENCODING_DEFAULTXML 365 /* Object */ +#define UA_NS0ID_VARIABLETYPEATTRIBUTES_ENCODING_DEFAULTBINARY 366 /* Object */ +#define UA_NS0ID_REFERENCETYPEATTRIBUTES 367 /* DataType */ +#define UA_NS0ID_REFERENCETYPEATTRIBUTES_ENCODING_DEFAULTXML 368 /* Object */ +#define UA_NS0ID_REFERENCETYPEATTRIBUTES_ENCODING_DEFAULTBINARY 369 /* Object */ +#define UA_NS0ID_DATATYPEATTRIBUTES 370 /* DataType */ +#define UA_NS0ID_DATATYPEATTRIBUTES_ENCODING_DEFAULTXML 371 /* Object */ +#define UA_NS0ID_DATATYPEATTRIBUTES_ENCODING_DEFAULTBINARY 372 /* Object */ +#define UA_NS0ID_VIEWATTRIBUTES 373 /* DataType */ +#define UA_NS0ID_VIEWATTRIBUTES_ENCODING_DEFAULTXML 374 /* Object */ +#define UA_NS0ID_VIEWATTRIBUTES_ENCODING_DEFAULTBINARY 375 /* Object */ +#define UA_NS0ID_ADDNODESITEM 376 /* DataType */ +#define UA_NS0ID_ADDNODESITEM_ENCODING_DEFAULTXML 377 /* Object */ +#define UA_NS0ID_ADDNODESITEM_ENCODING_DEFAULTBINARY 378 /* Object */ +#define UA_NS0ID_ADDREFERENCESITEM 379 /* DataType */ +#define UA_NS0ID_ADDREFERENCESITEM_ENCODING_DEFAULTXML 380 /* Object */ +#define UA_NS0ID_ADDREFERENCESITEM_ENCODING_DEFAULTBINARY 381 /* Object */ +#define UA_NS0ID_DELETENODESITEM 382 /* DataType */ +#define UA_NS0ID_DELETENODESITEM_ENCODING_DEFAULTXML 383 /* Object */ +#define UA_NS0ID_DELETENODESITEM_ENCODING_DEFAULTBINARY 384 /* Object */ +#define UA_NS0ID_DELETEREFERENCESITEM 385 /* DataType */ +#define UA_NS0ID_DELETEREFERENCESITEM_ENCODING_DEFAULTXML 386 /* Object */ +#define UA_NS0ID_DELETEREFERENCESITEM_ENCODING_DEFAULTBINARY 387 /* Object */ +#define UA_NS0ID_SESSIONAUTHENTICATIONTOKEN 388 /* DataType */ +#define UA_NS0ID_REQUESTHEADER 389 /* DataType */ +#define UA_NS0ID_REQUESTHEADER_ENCODING_DEFAULTXML 390 /* Object */ +#define UA_NS0ID_REQUESTHEADER_ENCODING_DEFAULTBINARY 391 /* Object */ +#define UA_NS0ID_RESPONSEHEADER 392 /* DataType */ +#define UA_NS0ID_RESPONSEHEADER_ENCODING_DEFAULTXML 393 /* Object */ +#define UA_NS0ID_RESPONSEHEADER_ENCODING_DEFAULTBINARY 394 /* Object */ +#define UA_NS0ID_SERVICEFAULT 395 /* DataType */ +#define UA_NS0ID_SERVICEFAULT_ENCODING_DEFAULTXML 396 /* Object */ +#define UA_NS0ID_SERVICEFAULT_ENCODING_DEFAULTBINARY 397 /* Object */ +#define UA_NS0ID_FINDSERVERSREQUEST 420 /* DataType */ +#define UA_NS0ID_FINDSERVERSREQUEST_ENCODING_DEFAULTXML 421 /* Object */ +#define UA_NS0ID_FINDSERVERSREQUEST_ENCODING_DEFAULTBINARY 422 /* Object */ +#define UA_NS0ID_FINDSERVERSRESPONSE 423 /* DataType */ +#define UA_NS0ID_FINDSERVERSRESPONSE_ENCODING_DEFAULTXML 424 /* Object */ +#define UA_NS0ID_FINDSERVERSRESPONSE_ENCODING_DEFAULTBINARY 425 /* Object */ +#define UA_NS0ID_GETENDPOINTSREQUEST 426 /* DataType */ +#define UA_NS0ID_GETENDPOINTSREQUEST_ENCODING_DEFAULTXML 427 /* Object */ +#define UA_NS0ID_GETENDPOINTSREQUEST_ENCODING_DEFAULTBINARY 428 /* Object */ +#define UA_NS0ID_GETENDPOINTSRESPONSE 429 /* DataType */ +#define UA_NS0ID_GETENDPOINTSRESPONSE_ENCODING_DEFAULTXML 430 /* Object */ +#define UA_NS0ID_GETENDPOINTSRESPONSE_ENCODING_DEFAULTBINARY 431 /* Object */ +#define UA_NS0ID_REGISTEREDSERVER 432 /* DataType */ +#define UA_NS0ID_REGISTEREDSERVER_ENCODING_DEFAULTXML 433 /* Object */ +#define UA_NS0ID_REGISTEREDSERVER_ENCODING_DEFAULTBINARY 434 /* Object */ +#define UA_NS0ID_REGISTERSERVERREQUEST 435 /* DataType */ +#define UA_NS0ID_REGISTERSERVERREQUEST_ENCODING_DEFAULTXML 436 /* Object */ +#define UA_NS0ID_REGISTERSERVERREQUEST_ENCODING_DEFAULTBINARY 437 /* Object */ +#define UA_NS0ID_REGISTERSERVERRESPONSE 438 /* DataType */ +#define UA_NS0ID_REGISTERSERVERRESPONSE_ENCODING_DEFAULTXML 439 /* Object */ +#define UA_NS0ID_REGISTERSERVERRESPONSE_ENCODING_DEFAULTBINARY 440 /* Object */ +#define UA_NS0ID_CHANNELSECURITYTOKEN 441 /* DataType */ +#define UA_NS0ID_CHANNELSECURITYTOKEN_ENCODING_DEFAULTXML 442 /* Object */ +#define UA_NS0ID_CHANNELSECURITYTOKEN_ENCODING_DEFAULTBINARY 443 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELREQUEST 444 /* DataType */ +#define UA_NS0ID_OPENSECURECHANNELREQUEST_ENCODING_DEFAULTXML 445 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELREQUEST_ENCODING_DEFAULTBINARY 446 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELRESPONSE 447 /* DataType */ +#define UA_NS0ID_OPENSECURECHANNELRESPONSE_ENCODING_DEFAULTXML 448 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELRESPONSE_ENCODING_DEFAULTBINARY 449 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELREQUEST 450 /* DataType */ +#define UA_NS0ID_CLOSESECURECHANNELREQUEST_ENCODING_DEFAULTXML 451 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELREQUEST_ENCODING_DEFAULTBINARY 452 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELRESPONSE 453 /* DataType */ +#define UA_NS0ID_CLOSESECURECHANNELRESPONSE_ENCODING_DEFAULTXML 454 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELRESPONSE_ENCODING_DEFAULTBINARY 455 /* Object */ +#define UA_NS0ID_SIGNATUREDATA 456 /* DataType */ +#define UA_NS0ID_SIGNATUREDATA_ENCODING_DEFAULTXML 457 /* Object */ +#define UA_NS0ID_SIGNATUREDATA_ENCODING_DEFAULTBINARY 458 /* Object */ +#define UA_NS0ID_CREATESESSIONREQUEST 459 /* DataType */ +#define UA_NS0ID_CREATESESSIONREQUEST_ENCODING_DEFAULTXML 460 /* Object */ +#define UA_NS0ID_CREATESESSIONREQUEST_ENCODING_DEFAULTBINARY 461 /* Object */ +#define UA_NS0ID_CREATESESSIONRESPONSE 462 /* DataType */ +#define UA_NS0ID_CREATESESSIONRESPONSE_ENCODING_DEFAULTXML 463 /* Object */ +#define UA_NS0ID_CREATESESSIONRESPONSE_ENCODING_DEFAULTBINARY 464 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONREQUEST 465 /* DataType */ +#define UA_NS0ID_ACTIVATESESSIONREQUEST_ENCODING_DEFAULTXML 466 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONREQUEST_ENCODING_DEFAULTBINARY 467 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONRESPONSE 468 /* DataType */ +#define UA_NS0ID_ACTIVATESESSIONRESPONSE_ENCODING_DEFAULTXML 469 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONRESPONSE_ENCODING_DEFAULTBINARY 470 /* Object */ +#define UA_NS0ID_CLOSESESSIONREQUEST 471 /* DataType */ +#define UA_NS0ID_CLOSESESSIONREQUEST_ENCODING_DEFAULTXML 472 /* Object */ +#define UA_NS0ID_CLOSESESSIONREQUEST_ENCODING_DEFAULTBINARY 473 /* Object */ +#define UA_NS0ID_CLOSESESSIONRESPONSE 474 /* DataType */ +#define UA_NS0ID_CLOSESESSIONRESPONSE_ENCODING_DEFAULTXML 475 /* Object */ +#define UA_NS0ID_CLOSESESSIONRESPONSE_ENCODING_DEFAULTBINARY 476 /* Object */ +#define UA_NS0ID_CANCELREQUEST 477 /* DataType */ +#define UA_NS0ID_CANCELREQUEST_ENCODING_DEFAULTXML 478 /* Object */ +#define UA_NS0ID_CANCELREQUEST_ENCODING_DEFAULTBINARY 479 /* Object */ +#define UA_NS0ID_CANCELRESPONSE 480 /* DataType */ +#define UA_NS0ID_CANCELRESPONSE_ENCODING_DEFAULTXML 481 /* Object */ +#define UA_NS0ID_CANCELRESPONSE_ENCODING_DEFAULTBINARY 482 /* Object */ +#define UA_NS0ID_ADDNODESRESULT 483 /* DataType */ +#define UA_NS0ID_ADDNODESRESULT_ENCODING_DEFAULTXML 484 /* Object */ +#define UA_NS0ID_ADDNODESRESULT_ENCODING_DEFAULTBINARY 485 /* Object */ +#define UA_NS0ID_ADDNODESREQUEST 486 /* DataType */ +#define UA_NS0ID_ADDNODESREQUEST_ENCODING_DEFAULTXML 487 /* Object */ +#define UA_NS0ID_ADDNODESREQUEST_ENCODING_DEFAULTBINARY 488 /* Object */ +#define UA_NS0ID_ADDNODESRESPONSE 489 /* DataType */ +#define UA_NS0ID_ADDNODESRESPONSE_ENCODING_DEFAULTXML 490 /* Object */ +#define UA_NS0ID_ADDNODESRESPONSE_ENCODING_DEFAULTBINARY 491 /* Object */ +#define UA_NS0ID_ADDREFERENCESREQUEST 492 /* DataType */ +#define UA_NS0ID_ADDREFERENCESREQUEST_ENCODING_DEFAULTXML 493 /* Object */ +#define UA_NS0ID_ADDREFERENCESREQUEST_ENCODING_DEFAULTBINARY 494 /* Object */ +#define UA_NS0ID_ADDREFERENCESRESPONSE 495 /* DataType */ +#define UA_NS0ID_ADDREFERENCESRESPONSE_ENCODING_DEFAULTXML 496 /* Object */ +#define UA_NS0ID_ADDREFERENCESRESPONSE_ENCODING_DEFAULTBINARY 497 /* Object */ +#define UA_NS0ID_DELETENODESREQUEST 498 /* DataType */ +#define UA_NS0ID_DELETENODESREQUEST_ENCODING_DEFAULTXML 499 /* Object */ +#define UA_NS0ID_DELETENODESREQUEST_ENCODING_DEFAULTBINARY 500 /* Object */ +#define UA_NS0ID_DELETENODESRESPONSE 501 /* DataType */ +#define UA_NS0ID_DELETENODESRESPONSE_ENCODING_DEFAULTXML 502 /* Object */ +#define UA_NS0ID_DELETENODESRESPONSE_ENCODING_DEFAULTBINARY 503 /* Object */ +#define UA_NS0ID_DELETEREFERENCESREQUEST 504 /* DataType */ +#define UA_NS0ID_DELETEREFERENCESREQUEST_ENCODING_DEFAULTXML 505 /* Object */ +#define UA_NS0ID_DELETEREFERENCESREQUEST_ENCODING_DEFAULTBINARY 506 /* Object */ +#define UA_NS0ID_DELETEREFERENCESRESPONSE 507 /* DataType */ +#define UA_NS0ID_DELETEREFERENCESRESPONSE_ENCODING_DEFAULTXML 508 /* Object */ +#define UA_NS0ID_DELETEREFERENCESRESPONSE_ENCODING_DEFAULTBINARY 509 /* Object */ +#define UA_NS0ID_BROWSEDIRECTION 510 /* DataType */ +#define UA_NS0ID_VIEWDESCRIPTION 511 /* DataType */ +#define UA_NS0ID_VIEWDESCRIPTION_ENCODING_DEFAULTXML 512 /* Object */ +#define UA_NS0ID_VIEWDESCRIPTION_ENCODING_DEFAULTBINARY 513 /* Object */ +#define UA_NS0ID_BROWSEDESCRIPTION 514 /* DataType */ +#define UA_NS0ID_BROWSEDESCRIPTION_ENCODING_DEFAULTXML 515 /* Object */ +#define UA_NS0ID_BROWSEDESCRIPTION_ENCODING_DEFAULTBINARY 516 /* Object */ +#define UA_NS0ID_BROWSERESULTMASK 517 /* DataType */ +#define UA_NS0ID_REFERENCEDESCRIPTION 518 /* DataType */ +#define UA_NS0ID_REFERENCEDESCRIPTION_ENCODING_DEFAULTXML 519 /* Object */ +#define UA_NS0ID_REFERENCEDESCRIPTION_ENCODING_DEFAULTBINARY 520 /* Object */ +#define UA_NS0ID_CONTINUATIONPOINT 521 /* DataType */ +#define UA_NS0ID_BROWSERESULT 522 /* DataType */ +#define UA_NS0ID_BROWSERESULT_ENCODING_DEFAULTXML 523 /* Object */ +#define UA_NS0ID_BROWSERESULT_ENCODING_DEFAULTBINARY 524 /* Object */ +#define UA_NS0ID_BROWSEREQUEST 525 /* DataType */ +#define UA_NS0ID_BROWSEREQUEST_ENCODING_DEFAULTXML 526 /* Object */ +#define UA_NS0ID_BROWSEREQUEST_ENCODING_DEFAULTBINARY 527 /* Object */ +#define UA_NS0ID_BROWSERESPONSE 528 /* DataType */ +#define UA_NS0ID_BROWSERESPONSE_ENCODING_DEFAULTXML 529 /* Object */ +#define UA_NS0ID_BROWSERESPONSE_ENCODING_DEFAULTBINARY 530 /* Object */ +#define UA_NS0ID_BROWSENEXTREQUEST 531 /* DataType */ +#define UA_NS0ID_BROWSENEXTREQUEST_ENCODING_DEFAULTXML 532 /* Object */ +#define UA_NS0ID_BROWSENEXTREQUEST_ENCODING_DEFAULTBINARY 533 /* Object */ +#define UA_NS0ID_BROWSENEXTRESPONSE 534 /* DataType */ +#define UA_NS0ID_BROWSENEXTRESPONSE_ENCODING_DEFAULTXML 535 /* Object */ +#define UA_NS0ID_BROWSENEXTRESPONSE_ENCODING_DEFAULTBINARY 536 /* Object */ +#define UA_NS0ID_RELATIVEPATHELEMENT 537 /* DataType */ +#define UA_NS0ID_RELATIVEPATHELEMENT_ENCODING_DEFAULTXML 538 /* Object */ +#define UA_NS0ID_RELATIVEPATHELEMENT_ENCODING_DEFAULTBINARY 539 /* Object */ +#define UA_NS0ID_RELATIVEPATH 540 /* DataType */ +#define UA_NS0ID_RELATIVEPATH_ENCODING_DEFAULTXML 541 /* Object */ +#define UA_NS0ID_RELATIVEPATH_ENCODING_DEFAULTBINARY 542 /* Object */ +#define UA_NS0ID_BROWSEPATH 543 /* DataType */ +#define UA_NS0ID_BROWSEPATH_ENCODING_DEFAULTXML 544 /* Object */ +#define UA_NS0ID_BROWSEPATH_ENCODING_DEFAULTBINARY 545 /* Object */ +#define UA_NS0ID_BROWSEPATHTARGET 546 /* DataType */ +#define UA_NS0ID_BROWSEPATHTARGET_ENCODING_DEFAULTXML 547 /* Object */ +#define UA_NS0ID_BROWSEPATHTARGET_ENCODING_DEFAULTBINARY 548 /* Object */ +#define UA_NS0ID_BROWSEPATHRESULT 549 /* DataType */ +#define UA_NS0ID_BROWSEPATHRESULT_ENCODING_DEFAULTXML 550 /* Object */ +#define UA_NS0ID_BROWSEPATHRESULT_ENCODING_DEFAULTBINARY 551 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSREQUEST 552 /* DataType */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSREQUEST_ENCODING_DEFAULTXML 553 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSREQUEST_ENCODING_DEFAULTBINARY 554 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE 555 /* DataType */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE_ENCODING_DEFAULTXML 556 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE_ENCODING_DEFAULTBINARY 557 /* Object */ +#define UA_NS0ID_REGISTERNODESREQUEST 558 /* DataType */ +#define UA_NS0ID_REGISTERNODESREQUEST_ENCODING_DEFAULTXML 559 /* Object */ +#define UA_NS0ID_REGISTERNODESREQUEST_ENCODING_DEFAULTBINARY 560 /* Object */ +#define UA_NS0ID_REGISTERNODESRESPONSE 561 /* DataType */ +#define UA_NS0ID_REGISTERNODESRESPONSE_ENCODING_DEFAULTXML 562 /* Object */ +#define UA_NS0ID_REGISTERNODESRESPONSE_ENCODING_DEFAULTBINARY 563 /* Object */ +#define UA_NS0ID_UNREGISTERNODESREQUEST 564 /* DataType */ +#define UA_NS0ID_UNREGISTERNODESREQUEST_ENCODING_DEFAULTXML 565 /* Object */ +#define UA_NS0ID_UNREGISTERNODESREQUEST_ENCODING_DEFAULTBINARY 566 /* Object */ +#define UA_NS0ID_UNREGISTERNODESRESPONSE 567 /* DataType */ +#define UA_NS0ID_UNREGISTERNODESRESPONSE_ENCODING_DEFAULTXML 568 /* Object */ +#define UA_NS0ID_UNREGISTERNODESRESPONSE_ENCODING_DEFAULTBINARY 569 /* Object */ +#define UA_NS0ID_QUERYDATADESCRIPTION 570 /* DataType */ +#define UA_NS0ID_QUERYDATADESCRIPTION_ENCODING_DEFAULTXML 571 /* Object */ +#define UA_NS0ID_QUERYDATADESCRIPTION_ENCODING_DEFAULTBINARY 572 /* Object */ +#define UA_NS0ID_NODETYPEDESCRIPTION 573 /* DataType */ +#define UA_NS0ID_NODETYPEDESCRIPTION_ENCODING_DEFAULTXML 574 /* Object */ +#define UA_NS0ID_NODETYPEDESCRIPTION_ENCODING_DEFAULTBINARY 575 /* Object */ +#define UA_NS0ID_FILTEROPERATOR 576 /* DataType */ +#define UA_NS0ID_QUERYDATASET 577 /* DataType */ +#define UA_NS0ID_QUERYDATASET_ENCODING_DEFAULTXML 578 /* Object */ +#define UA_NS0ID_QUERYDATASET_ENCODING_DEFAULTBINARY 579 /* Object */ +#define UA_NS0ID_NODEREFERENCE 580 /* DataType */ +#define UA_NS0ID_NODEREFERENCE_ENCODING_DEFAULTXML 581 /* Object */ +#define UA_NS0ID_NODEREFERENCE_ENCODING_DEFAULTBINARY 582 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENT 583 /* DataType */ +#define UA_NS0ID_CONTENTFILTERELEMENT_ENCODING_DEFAULTXML 584 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENT_ENCODING_DEFAULTBINARY 585 /* Object */ +#define UA_NS0ID_CONTENTFILTER 586 /* DataType */ +#define UA_NS0ID_CONTENTFILTER_ENCODING_DEFAULTXML 587 /* Object */ +#define UA_NS0ID_CONTENTFILTER_ENCODING_DEFAULTBINARY 588 /* Object */ +#define UA_NS0ID_FILTEROPERAND 589 /* DataType */ +#define UA_NS0ID_FILTEROPERAND_ENCODING_DEFAULTXML 590 /* Object */ +#define UA_NS0ID_FILTEROPERAND_ENCODING_DEFAULTBINARY 591 /* Object */ +#define UA_NS0ID_ELEMENTOPERAND 592 /* DataType */ +#define UA_NS0ID_ELEMENTOPERAND_ENCODING_DEFAULTXML 593 /* Object */ +#define UA_NS0ID_ELEMENTOPERAND_ENCODING_DEFAULTBINARY 594 /* Object */ +#define UA_NS0ID_LITERALOPERAND 595 /* DataType */ +#define UA_NS0ID_LITERALOPERAND_ENCODING_DEFAULTXML 596 /* Object */ +#define UA_NS0ID_LITERALOPERAND_ENCODING_DEFAULTBINARY 597 /* Object */ +#define UA_NS0ID_ATTRIBUTEOPERAND 598 /* DataType */ +#define UA_NS0ID_ATTRIBUTEOPERAND_ENCODING_DEFAULTXML 599 /* Object */ +#define UA_NS0ID_ATTRIBUTEOPERAND_ENCODING_DEFAULTBINARY 600 /* Object */ +#define UA_NS0ID_SIMPLEATTRIBUTEOPERAND 601 /* DataType */ +#define UA_NS0ID_SIMPLEATTRIBUTEOPERAND_ENCODING_DEFAULTXML 602 /* Object */ +#define UA_NS0ID_SIMPLEATTRIBUTEOPERAND_ENCODING_DEFAULTBINARY 603 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENTRESULT 604 /* DataType */ +#define UA_NS0ID_CONTENTFILTERELEMENTRESULT_ENCODING_DEFAULTXML 605 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENTRESULT_ENCODING_DEFAULTBINARY 606 /* Object */ +#define UA_NS0ID_CONTENTFILTERRESULT 607 /* DataType */ +#define UA_NS0ID_CONTENTFILTERRESULT_ENCODING_DEFAULTXML 608 /* Object */ +#define UA_NS0ID_CONTENTFILTERRESULT_ENCODING_DEFAULTBINARY 609 /* Object */ +#define UA_NS0ID_PARSINGRESULT 610 /* DataType */ +#define UA_NS0ID_PARSINGRESULT_ENCODING_DEFAULTXML 611 /* Object */ +#define UA_NS0ID_PARSINGRESULT_ENCODING_DEFAULTBINARY 612 /* Object */ +#define UA_NS0ID_QUERYFIRSTREQUEST 613 /* DataType */ +#define UA_NS0ID_QUERYFIRSTREQUEST_ENCODING_DEFAULTXML 614 /* Object */ +#define UA_NS0ID_QUERYFIRSTREQUEST_ENCODING_DEFAULTBINARY 615 /* Object */ +#define UA_NS0ID_QUERYFIRSTRESPONSE 616 /* DataType */ +#define UA_NS0ID_QUERYFIRSTRESPONSE_ENCODING_DEFAULTXML 617 /* Object */ +#define UA_NS0ID_QUERYFIRSTRESPONSE_ENCODING_DEFAULTBINARY 618 /* Object */ +#define UA_NS0ID_QUERYNEXTREQUEST 619 /* DataType */ +#define UA_NS0ID_QUERYNEXTREQUEST_ENCODING_DEFAULTXML 620 /* Object */ +#define UA_NS0ID_QUERYNEXTREQUEST_ENCODING_DEFAULTBINARY 621 /* Object */ +#define UA_NS0ID_QUERYNEXTRESPONSE 622 /* DataType */ +#define UA_NS0ID_QUERYNEXTRESPONSE_ENCODING_DEFAULTXML 623 /* Object */ +#define UA_NS0ID_QUERYNEXTRESPONSE_ENCODING_DEFAULTBINARY 624 /* Object */ +#define UA_NS0ID_TIMESTAMPSTORETURN 625 /* DataType */ +#define UA_NS0ID_READVALUEID 626 /* DataType */ +#define UA_NS0ID_READVALUEID_ENCODING_DEFAULTXML 627 /* Object */ +#define UA_NS0ID_READVALUEID_ENCODING_DEFAULTBINARY 628 /* Object */ +#define UA_NS0ID_READREQUEST 629 /* DataType */ +#define UA_NS0ID_READREQUEST_ENCODING_DEFAULTXML 630 /* Object */ +#define UA_NS0ID_READREQUEST_ENCODING_DEFAULTBINARY 631 /* Object */ +#define UA_NS0ID_READRESPONSE 632 /* DataType */ +#define UA_NS0ID_READRESPONSE_ENCODING_DEFAULTXML 633 /* Object */ +#define UA_NS0ID_READRESPONSE_ENCODING_DEFAULTBINARY 634 /* Object */ +#define UA_NS0ID_HISTORYREADVALUEID 635 /* DataType */ +#define UA_NS0ID_HISTORYREADVALUEID_ENCODING_DEFAULTXML 636 /* Object */ +#define UA_NS0ID_HISTORYREADVALUEID_ENCODING_DEFAULTBINARY 637 /* Object */ +#define UA_NS0ID_HISTORYREADRESULT 638 /* DataType */ +#define UA_NS0ID_HISTORYREADRESULT_ENCODING_DEFAULTXML 639 /* Object */ +#define UA_NS0ID_HISTORYREADRESULT_ENCODING_DEFAULTBINARY 640 /* Object */ +#define UA_NS0ID_HISTORYREADDETAILS 641 /* DataType */ +#define UA_NS0ID_HISTORYREADDETAILS_ENCODING_DEFAULTXML 642 /* Object */ +#define UA_NS0ID_HISTORYREADDETAILS_ENCODING_DEFAULTBINARY 643 /* Object */ +#define UA_NS0ID_READEVENTDETAILS 644 /* DataType */ +#define UA_NS0ID_READEVENTDETAILS_ENCODING_DEFAULTXML 645 /* Object */ +#define UA_NS0ID_READEVENTDETAILS_ENCODING_DEFAULTBINARY 646 /* Object */ +#define UA_NS0ID_READRAWMODIFIEDDETAILS 647 /* DataType */ +#define UA_NS0ID_READRAWMODIFIEDDETAILS_ENCODING_DEFAULTXML 648 /* Object */ +#define UA_NS0ID_READRAWMODIFIEDDETAILS_ENCODING_DEFAULTBINARY 649 /* Object */ +#define UA_NS0ID_READPROCESSEDDETAILS 650 /* DataType */ +#define UA_NS0ID_READPROCESSEDDETAILS_ENCODING_DEFAULTXML 651 /* Object */ +#define UA_NS0ID_READPROCESSEDDETAILS_ENCODING_DEFAULTBINARY 652 /* Object */ +#define UA_NS0ID_READATTIMEDETAILS 653 /* DataType */ +#define UA_NS0ID_READATTIMEDETAILS_ENCODING_DEFAULTXML 654 /* Object */ +#define UA_NS0ID_READATTIMEDETAILS_ENCODING_DEFAULTBINARY 655 /* Object */ +#define UA_NS0ID_HISTORYDATA 656 /* DataType */ +#define UA_NS0ID_HISTORYDATA_ENCODING_DEFAULTXML 657 /* Object */ +#define UA_NS0ID_HISTORYDATA_ENCODING_DEFAULTBINARY 658 /* Object */ +#define UA_NS0ID_HISTORYEVENT 659 /* DataType */ +#define UA_NS0ID_HISTORYEVENT_ENCODING_DEFAULTXML 660 /* Object */ +#define UA_NS0ID_HISTORYEVENT_ENCODING_DEFAULTBINARY 661 /* Object */ +#define UA_NS0ID_HISTORYREADREQUEST 662 /* DataType */ +#define UA_NS0ID_HISTORYREADREQUEST_ENCODING_DEFAULTXML 663 /* Object */ +#define UA_NS0ID_HISTORYREADREQUEST_ENCODING_DEFAULTBINARY 664 /* Object */ +#define UA_NS0ID_HISTORYREADRESPONSE 665 /* DataType */ +#define UA_NS0ID_HISTORYREADRESPONSE_ENCODING_DEFAULTXML 666 /* Object */ +#define UA_NS0ID_HISTORYREADRESPONSE_ENCODING_DEFAULTBINARY 667 /* Object */ +#define UA_NS0ID_WRITEVALUE 668 /* DataType */ +#define UA_NS0ID_WRITEVALUE_ENCODING_DEFAULTXML 669 /* Object */ +#define UA_NS0ID_WRITEVALUE_ENCODING_DEFAULTBINARY 670 /* Object */ +#define UA_NS0ID_WRITEREQUEST 671 /* DataType */ +#define UA_NS0ID_WRITEREQUEST_ENCODING_DEFAULTXML 672 /* Object */ +#define UA_NS0ID_WRITEREQUEST_ENCODING_DEFAULTBINARY 673 /* Object */ +#define UA_NS0ID_WRITERESPONSE 674 /* DataType */ +#define UA_NS0ID_WRITERESPONSE_ENCODING_DEFAULTXML 675 /* Object */ +#define UA_NS0ID_WRITERESPONSE_ENCODING_DEFAULTBINARY 676 /* Object */ +#define UA_NS0ID_HISTORYUPDATEDETAILS 677 /* DataType */ +#define UA_NS0ID_HISTORYUPDATEDETAILS_ENCODING_DEFAULTXML 678 /* Object */ +#define UA_NS0ID_HISTORYUPDATEDETAILS_ENCODING_DEFAULTBINARY 679 /* Object */ +#define UA_NS0ID_UPDATEDATADETAILS 680 /* DataType */ +#define UA_NS0ID_UPDATEDATADETAILS_ENCODING_DEFAULTXML 681 /* Object */ +#define UA_NS0ID_UPDATEDATADETAILS_ENCODING_DEFAULTBINARY 682 /* Object */ +#define UA_NS0ID_UPDATEEVENTDETAILS 683 /* DataType */ +#define UA_NS0ID_UPDATEEVENTDETAILS_ENCODING_DEFAULTXML 684 /* Object */ +#define UA_NS0ID_UPDATEEVENTDETAILS_ENCODING_DEFAULTBINARY 685 /* Object */ +#define UA_NS0ID_DELETERAWMODIFIEDDETAILS 686 /* DataType */ +#define UA_NS0ID_DELETERAWMODIFIEDDETAILS_ENCODING_DEFAULTXML 687 /* Object */ +#define UA_NS0ID_DELETERAWMODIFIEDDETAILS_ENCODING_DEFAULTBINARY 688 /* Object */ +#define UA_NS0ID_DELETEATTIMEDETAILS 689 /* DataType */ +#define UA_NS0ID_DELETEATTIMEDETAILS_ENCODING_DEFAULTXML 690 /* Object */ +#define UA_NS0ID_DELETEATTIMEDETAILS_ENCODING_DEFAULTBINARY 691 /* Object */ +#define UA_NS0ID_DELETEEVENTDETAILS 692 /* DataType */ +#define UA_NS0ID_DELETEEVENTDETAILS_ENCODING_DEFAULTXML 693 /* Object */ +#define UA_NS0ID_DELETEEVENTDETAILS_ENCODING_DEFAULTBINARY 694 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESULT 695 /* DataType */ +#define UA_NS0ID_HISTORYUPDATERESULT_ENCODING_DEFAULTXML 696 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESULT_ENCODING_DEFAULTBINARY 697 /* Object */ +#define UA_NS0ID_HISTORYUPDATEREQUEST 698 /* DataType */ +#define UA_NS0ID_HISTORYUPDATEREQUEST_ENCODING_DEFAULTXML 699 /* Object */ +#define UA_NS0ID_HISTORYUPDATEREQUEST_ENCODING_DEFAULTBINARY 700 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESPONSE 701 /* DataType */ +#define UA_NS0ID_HISTORYUPDATERESPONSE_ENCODING_DEFAULTXML 702 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESPONSE_ENCODING_DEFAULTBINARY 703 /* Object */ +#define UA_NS0ID_CALLMETHODREQUEST 704 /* DataType */ +#define UA_NS0ID_CALLMETHODREQUEST_ENCODING_DEFAULTXML 705 /* Object */ +#define UA_NS0ID_CALLMETHODREQUEST_ENCODING_DEFAULTBINARY 706 /* Object */ +#define UA_NS0ID_CALLMETHODRESULT 707 /* DataType */ +#define UA_NS0ID_CALLMETHODRESULT_ENCODING_DEFAULTXML 708 /* Object */ +#define UA_NS0ID_CALLMETHODRESULT_ENCODING_DEFAULTBINARY 709 /* Object */ +#define UA_NS0ID_CALLREQUEST 710 /* DataType */ +#define UA_NS0ID_CALLREQUEST_ENCODING_DEFAULTXML 711 /* Object */ +#define UA_NS0ID_CALLREQUEST_ENCODING_DEFAULTBINARY 712 /* Object */ +#define UA_NS0ID_CALLRESPONSE 713 /* DataType */ +#define UA_NS0ID_CALLRESPONSE_ENCODING_DEFAULTXML 714 /* Object */ +#define UA_NS0ID_CALLRESPONSE_ENCODING_DEFAULTBINARY 715 /* Object */ +#define UA_NS0ID_MONITORINGMODE 716 /* DataType */ +#define UA_NS0ID_DATACHANGETRIGGER 717 /* DataType */ +#define UA_NS0ID_DEADBANDTYPE 718 /* DataType */ +#define UA_NS0ID_MONITORINGFILTER 719 /* DataType */ +#define UA_NS0ID_MONITORINGFILTER_ENCODING_DEFAULTXML 720 /* Object */ +#define UA_NS0ID_MONITORINGFILTER_ENCODING_DEFAULTBINARY 721 /* Object */ +#define UA_NS0ID_DATACHANGEFILTER 722 /* DataType */ +#define UA_NS0ID_DATACHANGEFILTER_ENCODING_DEFAULTXML 723 /* Object */ +#define UA_NS0ID_DATACHANGEFILTER_ENCODING_DEFAULTBINARY 724 /* Object */ +#define UA_NS0ID_EVENTFILTER 725 /* DataType */ +#define UA_NS0ID_EVENTFILTER_ENCODING_DEFAULTXML 726 /* Object */ +#define UA_NS0ID_EVENTFILTER_ENCODING_DEFAULTBINARY 727 /* Object */ +#define UA_NS0ID_AGGREGATEFILTER 728 /* DataType */ +#define UA_NS0ID_AGGREGATEFILTER_ENCODING_DEFAULTXML 729 /* Object */ +#define UA_NS0ID_AGGREGATEFILTER_ENCODING_DEFAULTBINARY 730 /* Object */ +#define UA_NS0ID_MONITORINGFILTERRESULT 731 /* DataType */ +#define UA_NS0ID_MONITORINGFILTERRESULT_ENCODING_DEFAULTXML 732 /* Object */ +#define UA_NS0ID_MONITORINGFILTERRESULT_ENCODING_DEFAULTBINARY 733 /* Object */ +#define UA_NS0ID_EVENTFILTERRESULT 734 /* DataType */ +#define UA_NS0ID_EVENTFILTERRESULT_ENCODING_DEFAULTXML 735 /* Object */ +#define UA_NS0ID_EVENTFILTERRESULT_ENCODING_DEFAULTBINARY 736 /* Object */ +#define UA_NS0ID_AGGREGATEFILTERRESULT 737 /* DataType */ +#define UA_NS0ID_AGGREGATEFILTERRESULT_ENCODING_DEFAULTXML 738 /* Object */ +#define UA_NS0ID_AGGREGATEFILTERRESULT_ENCODING_DEFAULTBINARY 739 /* Object */ +#define UA_NS0ID_MONITORINGPARAMETERS 740 /* DataType */ +#define UA_NS0ID_MONITORINGPARAMETERS_ENCODING_DEFAULTXML 741 /* Object */ +#define UA_NS0ID_MONITORINGPARAMETERS_ENCODING_DEFAULTBINARY 742 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATEREQUEST 743 /* DataType */ +#define UA_NS0ID_MONITOREDITEMCREATEREQUEST_ENCODING_DEFAULTXML 744 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATEREQUEST_ENCODING_DEFAULTBINARY 745 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATERESULT 746 /* DataType */ +#define UA_NS0ID_MONITOREDITEMCREATERESULT_ENCODING_DEFAULTXML 747 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATERESULT_ENCODING_DEFAULTBINARY 748 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSREQUEST 749 /* DataType */ +#define UA_NS0ID_CREATEMONITOREDITEMSREQUEST_ENCODING_DEFAULTXML 750 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY 751 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSRESPONSE 752 /* DataType */ +#define UA_NS0ID_CREATEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTXML 753 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTBINARY 754 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYREQUEST 755 /* DataType */ +#define UA_NS0ID_MONITOREDITEMMODIFYREQUEST_ENCODING_DEFAULTXML 756 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYREQUEST_ENCODING_DEFAULTBINARY 757 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYRESULT 758 /* DataType */ +#define UA_NS0ID_MONITOREDITEMMODIFYRESULT_ENCODING_DEFAULTXML 759 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYRESULT_ENCODING_DEFAULTBINARY 760 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSREQUEST 761 /* DataType */ +#define UA_NS0ID_MODIFYMONITOREDITEMSREQUEST_ENCODING_DEFAULTXML 762 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY 763 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSRESPONSE 764 /* DataType */ +#define UA_NS0ID_MODIFYMONITOREDITEMSRESPONSE_ENCODING_DEFAULTXML 765 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSRESPONSE_ENCODING_DEFAULTBINARY 766 /* Object */ +#define UA_NS0ID_SETMONITORINGMODEREQUEST 767 /* DataType */ +#define UA_NS0ID_SETMONITORINGMODEREQUEST_ENCODING_DEFAULTXML 768 /* Object */ +#define UA_NS0ID_SETMONITORINGMODEREQUEST_ENCODING_DEFAULTBINARY 769 /* Object */ +#define UA_NS0ID_SETMONITORINGMODERESPONSE 770 /* DataType */ +#define UA_NS0ID_SETMONITORINGMODERESPONSE_ENCODING_DEFAULTXML 771 /* Object */ +#define UA_NS0ID_SETMONITORINGMODERESPONSE_ENCODING_DEFAULTBINARY 772 /* Object */ +#define UA_NS0ID_SETTRIGGERINGREQUEST 773 /* DataType */ +#define UA_NS0ID_SETTRIGGERINGREQUEST_ENCODING_DEFAULTXML 774 /* Object */ +#define UA_NS0ID_SETTRIGGERINGREQUEST_ENCODING_DEFAULTBINARY 775 /* Object */ +#define UA_NS0ID_SETTRIGGERINGRESPONSE 776 /* DataType */ +#define UA_NS0ID_SETTRIGGERINGRESPONSE_ENCODING_DEFAULTXML 777 /* Object */ +#define UA_NS0ID_SETTRIGGERINGRESPONSE_ENCODING_DEFAULTBINARY 778 /* Object */ +#define UA_NS0ID_DELETEMONITOREDITEMSREQUEST 779 /* DataType */ +#define UA_NS0ID_DELETEMONITOREDITEMSREQUEST_ENCODING_DEFAULTXML 780 /* Object */ +#define UA_NS0ID_DELETEMONITOREDITEMSREQUEST_ENCODING_DEFAULTBINARY 781 /* Object */ +#define UA_NS0ID_DELETEMONITOREDITEMSRESPONSE 782 /* DataType */ +#define UA_NS0ID_DELETEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTXML 783 /* Object */ +#define UA_NS0ID_DELETEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTBINARY 784 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONREQUEST 785 /* DataType */ +#define UA_NS0ID_CREATESUBSCRIPTIONREQUEST_ENCODING_DEFAULTXML 786 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONREQUEST_ENCODING_DEFAULTBINARY 787 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONRESPONSE 788 /* DataType */ +#define UA_NS0ID_CREATESUBSCRIPTIONRESPONSE_ENCODING_DEFAULTXML 789 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONRESPONSE_ENCODING_DEFAULTBINARY 790 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONREQUEST 791 /* DataType */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONREQUEST_ENCODING_DEFAULTXML 792 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONREQUEST_ENCODING_DEFAULTBINARY 793 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONRESPONSE 794 /* DataType */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONRESPONSE_ENCODING_DEFAULTXML 795 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONRESPONSE_ENCODING_DEFAULTBINARY 796 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODEREQUEST 797 /* DataType */ +#define UA_NS0ID_SETPUBLISHINGMODEREQUEST_ENCODING_DEFAULTXML 798 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODEREQUEST_ENCODING_DEFAULTBINARY 799 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODERESPONSE 800 /* DataType */ +#define UA_NS0ID_SETPUBLISHINGMODERESPONSE_ENCODING_DEFAULTXML 801 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODERESPONSE_ENCODING_DEFAULTBINARY 802 /* Object */ +#define UA_NS0ID_NOTIFICATIONMESSAGE 803 /* DataType */ +#define UA_NS0ID_NOTIFICATIONMESSAGE_ENCODING_DEFAULTXML 804 /* Object */ +#define UA_NS0ID_NOTIFICATIONMESSAGE_ENCODING_DEFAULTBINARY 805 /* Object */ +#define UA_NS0ID_MONITOREDITEMNOTIFICATION 806 /* DataType */ +#define UA_NS0ID_MONITOREDITEMNOTIFICATION_ENCODING_DEFAULTXML 807 /* Object */ +#define UA_NS0ID_MONITOREDITEMNOTIFICATION_ENCODING_DEFAULTBINARY 808 /* Object */ +#define UA_NS0ID_DATACHANGENOTIFICATION 809 /* DataType */ +#define UA_NS0ID_DATACHANGENOTIFICATION_ENCODING_DEFAULTXML 810 /* Object */ +#define UA_NS0ID_DATACHANGENOTIFICATION_ENCODING_DEFAULTBINARY 811 /* Object */ +#define UA_NS0ID_STATUSCHANGENOTIFICATION 818 /* DataType */ +#define UA_NS0ID_STATUSCHANGENOTIFICATION_ENCODING_DEFAULTXML 819 /* Object */ +#define UA_NS0ID_STATUSCHANGENOTIFICATION_ENCODING_DEFAULTBINARY 820 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONACKNOWLEDGEMENT 821 /* DataType */ +#define UA_NS0ID_SUBSCRIPTIONACKNOWLEDGEMENT_ENCODING_DEFAULTXML 822 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONACKNOWLEDGEMENT_ENCODING_DEFAULTBINARY 823 /* Object */ +#define UA_NS0ID_PUBLISHREQUEST 824 /* DataType */ +#define UA_NS0ID_PUBLISHREQUEST_ENCODING_DEFAULTXML 825 /* Object */ +#define UA_NS0ID_PUBLISHREQUEST_ENCODING_DEFAULTBINARY 826 /* Object */ +#define UA_NS0ID_PUBLISHRESPONSE 827 /* DataType */ +#define UA_NS0ID_PUBLISHRESPONSE_ENCODING_DEFAULTXML 828 /* Object */ +#define UA_NS0ID_PUBLISHRESPONSE_ENCODING_DEFAULTBINARY 829 /* Object */ +#define UA_NS0ID_REPUBLISHREQUEST 830 /* DataType */ +#define UA_NS0ID_REPUBLISHREQUEST_ENCODING_DEFAULTXML 831 /* Object */ +#define UA_NS0ID_REPUBLISHREQUEST_ENCODING_DEFAULTBINARY 832 /* Object */ +#define UA_NS0ID_REPUBLISHRESPONSE 833 /* DataType */ +#define UA_NS0ID_REPUBLISHRESPONSE_ENCODING_DEFAULTXML 834 /* Object */ +#define UA_NS0ID_REPUBLISHRESPONSE_ENCODING_DEFAULTBINARY 835 /* Object */ +#define UA_NS0ID_TRANSFERRESULT 836 /* DataType */ +#define UA_NS0ID_TRANSFERRESULT_ENCODING_DEFAULTXML 837 /* Object */ +#define UA_NS0ID_TRANSFERRESULT_ENCODING_DEFAULTBINARY 838 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSREQUEST 839 /* DataType */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSREQUEST_ENCODING_DEFAULTXML 840 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSREQUEST_ENCODING_DEFAULTBINARY 841 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSRESPONSE 842 /* DataType */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTXML 843 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTBINARY 844 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSREQUEST 845 /* DataType */ +#define UA_NS0ID_DELETESUBSCRIPTIONSREQUEST_ENCODING_DEFAULTXML 846 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSREQUEST_ENCODING_DEFAULTBINARY 847 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSRESPONSE 848 /* DataType */ +#define UA_NS0ID_DELETESUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTXML 849 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTBINARY 850 /* Object */ +#define UA_NS0ID_REDUNDANCYSUPPORT 851 /* DataType */ +#define UA_NS0ID_SERVERSTATE 852 /* DataType */ +#define UA_NS0ID_REDUNDANTSERVERDATATYPE 853 /* DataType */ +#define UA_NS0ID_REDUNDANTSERVERDATATYPE_ENCODING_DEFAULTXML 854 /* Object */ +#define UA_NS0ID_REDUNDANTSERVERDATATYPE_ENCODING_DEFAULTBINARY 855 /* Object */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSDATATYPE 856 /* DataType */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_ENCODING_DEFAULTXML 857 /* Object */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_ENCODING_DEFAULTBINARY 858 /* Object */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYDATATYPE 859 /* DataType */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYDATATYPE_ENCODING_DEFAULTXML 860 /* Object */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYDATATYPE_ENCODING_DEFAULTBINARY 861 /* Object */ +#define UA_NS0ID_SERVERSTATUSDATATYPE 862 /* DataType */ +#define UA_NS0ID_SERVERSTATUSDATATYPE_ENCODING_DEFAULTXML 863 /* Object */ +#define UA_NS0ID_SERVERSTATUSDATATYPE_ENCODING_DEFAULTBINARY 864 /* Object */ +#define UA_NS0ID_SESSIONDIAGNOSTICSDATATYPE 865 /* DataType */ +#define UA_NS0ID_SESSIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTXML 866 /* Object */ +#define UA_NS0ID_SESSIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTBINARY 867 /* Object */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSDATATYPE 868 /* DataType */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSDATATYPE_ENCODING_DEFAULTXML 869 /* Object */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSDATATYPE_ENCODING_DEFAULTBINARY 870 /* Object */ +#define UA_NS0ID_SERVICECOUNTERDATATYPE 871 /* DataType */ +#define UA_NS0ID_SERVICECOUNTERDATATYPE_ENCODING_DEFAULTXML 872 /* Object */ +#define UA_NS0ID_SERVICECOUNTERDATATYPE_ENCODING_DEFAULTBINARY 873 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSDATATYPE 874 /* DataType */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTXML 875 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTBINARY 876 /* Object */ +#define UA_NS0ID_MODELCHANGESTRUCTUREDATATYPE 877 /* DataType */ +#define UA_NS0ID_MODELCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTXML 878 /* Object */ +#define UA_NS0ID_MODELCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTBINARY 879 /* Object */ +#define UA_NS0ID_RANGE 884 /* DataType */ +#define UA_NS0ID_RANGE_ENCODING_DEFAULTXML 885 /* Object */ +#define UA_NS0ID_RANGE_ENCODING_DEFAULTBINARY 886 /* Object */ +#define UA_NS0ID_EUINFORMATION 887 /* DataType */ +#define UA_NS0ID_EUINFORMATION_ENCODING_DEFAULTXML 888 /* Object */ +#define UA_NS0ID_EUINFORMATION_ENCODING_DEFAULTBINARY 889 /* Object */ +#define UA_NS0ID_EXCEPTIONDEVIATIONFORMAT 890 /* DataType */ +#define UA_NS0ID_ANNOTATION 891 /* DataType */ +#define UA_NS0ID_ANNOTATION_ENCODING_DEFAULTXML 892 /* Object */ +#define UA_NS0ID_ANNOTATION_ENCODING_DEFAULTBINARY 893 /* Object */ +#define UA_NS0ID_PROGRAMDIAGNOSTICDATATYPE 894 /* DataType */ +#define UA_NS0ID_PROGRAMDIAGNOSTICDATATYPE_ENCODING_DEFAULTXML 895 /* Object */ +#define UA_NS0ID_PROGRAMDIAGNOSTICDATATYPE_ENCODING_DEFAULTBINARY 896 /* Object */ +#define UA_NS0ID_SEMANTICCHANGESTRUCTUREDATATYPE 897 /* DataType */ +#define UA_NS0ID_SEMANTICCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTXML 898 /* Object */ +#define UA_NS0ID_SEMANTICCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTBINARY 899 /* Object */ +#define UA_NS0ID_EVENTNOTIFICATIONLIST 914 /* DataType */ +#define UA_NS0ID_EVENTNOTIFICATIONLIST_ENCODING_DEFAULTXML 915 /* Object */ +#define UA_NS0ID_EVENTNOTIFICATIONLIST_ENCODING_DEFAULTBINARY 916 /* Object */ +#define UA_NS0ID_EVENTFIELDLIST 917 /* DataType */ +#define UA_NS0ID_EVENTFIELDLIST_ENCODING_DEFAULTXML 918 /* Object */ +#define UA_NS0ID_EVENTFIELDLIST_ENCODING_DEFAULTBINARY 919 /* Object */ +#define UA_NS0ID_HISTORYEVENTFIELDLIST 920 /* DataType */ +#define UA_NS0ID_HISTORYEVENTFIELDLIST_ENCODING_DEFAULTXML 921 /* Object */ +#define UA_NS0ID_HISTORYEVENTFIELDLIST_ENCODING_DEFAULTBINARY 922 /* Object */ +#define UA_NS0ID_ISSUEDIDENTITYTOKEN 938 /* DataType */ +#define UA_NS0ID_ISSUEDIDENTITYTOKEN_ENCODING_DEFAULTXML 939 /* Object */ +#define UA_NS0ID_ISSUEDIDENTITYTOKEN_ENCODING_DEFAULTBINARY 940 /* Object */ +#define UA_NS0ID_NOTIFICATIONDATA 945 /* DataType */ +#define UA_NS0ID_NOTIFICATIONDATA_ENCODING_DEFAULTXML 946 /* Object */ +#define UA_NS0ID_NOTIFICATIONDATA_ENCODING_DEFAULTBINARY 947 /* Object */ +#define UA_NS0ID_AGGREGATECONFIGURATION 948 /* DataType */ +#define UA_NS0ID_AGGREGATECONFIGURATION_ENCODING_DEFAULTXML 949 /* Object */ +#define UA_NS0ID_AGGREGATECONFIGURATION_ENCODING_DEFAULTBINARY 950 /* Object */ +#define UA_NS0ID_IMAGEBMP 2000 /* DataType */ +#define UA_NS0ID_IMAGEGIF 2001 /* DataType */ +#define UA_NS0ID_IMAGEJPG 2002 /* DataType */ +#define UA_NS0ID_IMAGEPNG 2003 /* DataType */ +#define UA_NS0ID_SERVERTYPE 2004 /* ObjectType */ +#define UA_NS0ID_SERVERTYPE_SERVERARRAY 2005 /* Variable */ +#define UA_NS0ID_SERVERTYPE_NAMESPACEARRAY 2006 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS 2007 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVICELEVEL 2008 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES 2009 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS 2010 /* Object */ +#define UA_NS0ID_SERVERTYPE_VENDORSERVERINFO 2011 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERREDUNDANCY 2012 /* Object */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE 2013 /* ObjectType */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_SERVERPROFILEARRAY 2014 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_LOCALEIDARRAY 2016 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MINSUPPORTEDSAMPLERATE 2017 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MODELLINGRULES 2019 /* Object */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE 2020 /* ObjectType */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY 2021 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SAMPLINGINTERVALDIAGNOSTICSARRAY 2022 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SUBSCRIPTIONDIAGNOSTICSARRAY 2023 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_ENABLEDFLAG 2025 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE 2026 /* ObjectType */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_SESSIONDIAGNOSTICSARRAY 2027 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_SESSIONSECURITYDIAGNOSTICSARRAY 2028 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE 2029 /* ObjectType */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS 2030 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS 2031 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SUBSCRIPTIONDIAGNOSTICSARRAY 2032 /* Variable */ +#define UA_NS0ID_VENDORSERVERINFOTYPE 2033 /* ObjectType */ +#define UA_NS0ID_SERVERREDUNDANCYTYPE 2034 /* ObjectType */ +#define UA_NS0ID_SERVERREDUNDANCYTYPE_REDUNDANCYSUPPORT 2035 /* Variable */ +#define UA_NS0ID_TRANSPARENTREDUNDANCYTYPE 2036 /* ObjectType */ +#define UA_NS0ID_TRANSPARENTREDUNDANCYTYPE_CURRENTSERVERID 2037 /* Variable */ +#define UA_NS0ID_TRANSPARENTREDUNDANCYTYPE_REDUNDANTSERVERARRAY 2038 /* Variable */ +#define UA_NS0ID_NONTRANSPARENTREDUNDANCYTYPE 2039 /* ObjectType */ +#define UA_NS0ID_NONTRANSPARENTREDUNDANCYTYPE_SERVERURIARRAY 2040 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE 2041 /* ObjectType */ +#define UA_NS0ID_BASEEVENTTYPE_EVENTID 2042 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_EVENTTYPE 2043 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_SOURCENODE 2044 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_SOURCENAME 2045 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_TIME 2046 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_RECEIVETIME 2047 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_MESSAGE 2050 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_SEVERITY 2051 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE 2052 /* ObjectType */ +#define UA_NS0ID_AUDITEVENTTYPE_ACTIONTIMESTAMP 2053 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_STATUS 2054 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_SERVERID 2055 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_CLIENTAUDITENTRYID 2056 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_CLIENTUSERID 2057 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE 2058 /* ObjectType */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE 2059 /* ObjectType */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE 2060 /* ObjectType */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_CLIENTCERTIFICATE 2061 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_REQUESTTYPE 2062 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SECURITYPOLICYURI 2063 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SECURITYMODE 2065 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_REQUESTEDLIFETIME 2066 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE 2069 /* ObjectType */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_SESSIONID 2070 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE 2071 /* ObjectType */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SECURECHANNELID 2072 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_CLIENTCERTIFICATE 2073 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_REVISEDSESSIONTIMEOUT 2074 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE 2075 /* ObjectType */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_CLIENTSOFTWARECERTIFICATES 2076 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_USERIDENTITYTOKEN 2077 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE 2078 /* ObjectType */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_REQUESTHANDLE 2079 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE 2080 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_CERTIFICATE 2081 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE 2082 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_INVALIDHOSTNAME 2083 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_INVALIDURI 2084 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE 2085 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE 2086 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE 2087 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE 2088 /* ObjectType */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE 2089 /* ObjectType */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE 2090 /* ObjectType */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE 2091 /* ObjectType */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_NODESTOADD 2092 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE 2093 /* ObjectType */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_NODESTODELETE 2094 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE 2095 /* ObjectType */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_REFERENCESTOADD 2096 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE 2097 /* ObjectType */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_REFERENCESTODELETE 2098 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE 2099 /* ObjectType */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE 2100 /* ObjectType */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_INDEXRANGE 2101 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_OLDVALUE 2102 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_NEWVALUE 2103 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE 2104 /* ObjectType */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE 2127 /* ObjectType */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_METHODID 2128 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_INPUTARGUMENTS 2129 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE 2130 /* ObjectType */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE 2131 /* ObjectType */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE 2132 /* ObjectType */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE 2133 /* ObjectType */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_CHANGES 2134 /* Variable */ +#define UA_NS0ID_SERVERVENDORCAPABILITYTYPE 2137 /* VariableType */ +#define UA_NS0ID_SERVERSTATUSTYPE 2138 /* VariableType */ +#define UA_NS0ID_SERVERSTATUSTYPE_STARTTIME 2139 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_CURRENTTIME 2140 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_STATE 2141 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO 2142 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE 2150 /* VariableType */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_SERVERVIEWCOUNT 2151 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_CURRENTSESSIONCOUNT 2152 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_CUMULATEDSESSIONCOUNT 2153 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_SECURITYREJECTEDSESSIONCOUNT 2154 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_REJECTEDSESSIONCOUNT 2155 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_SESSIONTIMEOUTCOUNT 2156 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_SESSIONABORTCOUNT 2157 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_PUBLISHINGINTERVALCOUNT 2159 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_CURRENTSUBSCRIPTIONCOUNT 2160 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_CUMULATEDSUBSCRIPTIONCOUNT 2161 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_SECURITYREJECTEDREQUESTSCOUNT 2162 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYTYPE_REJECTEDREQUESTSCOUNT 2163 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE 2164 /* VariableType */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSTYPE 2165 /* VariableType */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSTYPE_SAMPLINGINTERVAL 2166 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE 2171 /* VariableType */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE 2172 /* VariableType */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_SESSIONID 2173 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_SUBSCRIPTIONID 2174 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_PRIORITY 2175 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_PUBLISHINGINTERVAL 2176 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MAXKEEPALIVECOUNT 2177 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MAXNOTIFICATIONSPERPUBLISH 2179 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_PUBLISHINGENABLED 2180 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MODIFYCOUNT 2181 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_ENABLECOUNT 2182 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_DISABLECOUNT 2183 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_REPUBLISHREQUESTCOUNT 2184 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_REPUBLISHMESSAGEREQUESTCOUNT 2185 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_REPUBLISHMESSAGECOUNT 2186 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_TRANSFERREQUESTCOUNT 2187 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_TRANSFERREDTOALTCLIENTCOUNT 2188 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_TRANSFERREDTOSAMECLIENTCOUNT 2189 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_PUBLISHREQUESTCOUNT 2190 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_DATACHANGENOTIFICATIONSCOUNT 2191 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_NOTIFICATIONSCOUNT 2193 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE 2196 /* VariableType */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE 2197 /* VariableType */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SESSIONID 2198 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SESSIONNAME 2199 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CLIENTDESCRIPTION 2200 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SERVERURI 2201 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_ENDPOINTURL 2202 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_LOCALEIDS 2203 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_ACTUALSESSIONTIMEOUT 2204 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CLIENTCONNECTIONTIME 2205 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CLIENTLASTCONTACTTIME 2206 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CURRENTSUBSCRIPTIONSCOUNT 2207 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CURRENTMONITOREDITEMSCOUNT 2208 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CURRENTPUBLISHREQUESTSINQUEUE 2209 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_READCOUNT 2217 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_HISTORYREADCOUNT 2218 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_WRITECOUNT 2219 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_HISTORYUPDATECOUNT 2220 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CALLCOUNT 2221 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CREATEMONITOREDITEMSCOUNT 2222 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_MODIFYMONITOREDITEMSCOUNT 2223 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SETMONITORINGMODECOUNT 2224 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SETTRIGGERINGCOUNT 2225 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_DELETEMONITOREDITEMSCOUNT 2226 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_CREATESUBSCRIPTIONCOUNT 2227 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_MODIFYSUBSCRIPTIONCOUNT 2228 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_SETPUBLISHINGMODECOUNT 2229 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_PUBLISHCOUNT 2230 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_REPUBLISHCOUNT 2231 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_TRANSFERSUBSCRIPTIONSCOUNT 2232 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_DELETESUBSCRIPTIONSCOUNT 2233 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_ADDNODESCOUNT 2234 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_ADDREFERENCESCOUNT 2235 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_DELETENODESCOUNT 2236 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_DELETEREFERENCESCOUNT 2237 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_BROWSECOUNT 2238 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_BROWSENEXTCOUNT 2239 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_TRANSLATEBROWSEPATHSTONODEIDSCOUNT 2240 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_QUERYFIRSTCOUNT 2241 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_QUERYNEXTCOUNT 2242 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE 2243 /* VariableType */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE 2244 /* VariableType */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_SESSIONID 2245 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_CLIENTUSERIDOFSESSION 2246 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_CLIENTUSERIDHISTORY 2247 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_AUTHENTICATIONMECHANISM 2248 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_ENCODING 2249 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_TRANSPORTPROTOCOL 2250 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_SECURITYMODE 2251 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_SECURITYPOLICYURI 2252 /* Variable */ +#define UA_NS0ID_SERVER 2253 /* Object */ +#define UA_NS0ID_SERVER_SERVERARRAY 2254 /* Variable */ +#define UA_NS0ID_SERVER_NAMESPACEARRAY 2255 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS 2256 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_STARTTIME 2257 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_CURRENTTIME 2258 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_STATE 2259 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO 2260 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTNAME 2261 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_PRODUCTURI 2262 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_MANUFACTURERNAME 2263 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_SOFTWAREVERSION 2264 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDNUMBER 2265 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_BUILDINFO_BUILDDATE 2266 /* Variable */ +#define UA_NS0ID_SERVER_SERVICELEVEL 2267 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES 2268 /* Object */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_SERVERPROFILEARRAY 2269 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_LOCALEIDARRAY 2271 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MINSUPPORTEDSAMPLERATE 2272 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS 2274 /* Object */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY 2275 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SERVERVIEWCOUNT 2276 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CURRENTSESSIONCOUNT 2277 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSESSIONCOUNT 2278 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDSESSIONCOUNT 2279 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SESSIONTIMEOUTCOUNT 2281 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SESSIONABORTCOUNT 2282 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_PUBLISHINGINTERVALCOUNT 2284 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CURRENTSUBSCRIPTIONCOUNT 2285 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSUBSCRIPTIONCOUNT 2286 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDREQUESTSCOUNT 2287 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_REJECTEDREQUESTSCOUNT 2288 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SAMPLINGINTERVALDIAGNOSTICSARRAY 2289 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SUBSCRIPTIONDIAGNOSTICSARRAY 2290 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_ENABLEDFLAG 2294 /* Variable */ +#define UA_NS0ID_SERVER_VENDORSERVERINFO 2295 /* Object */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY 2296 /* Object */ +#define UA_NS0ID_STATEMACHINETYPE 2299 /* ObjectType */ +#define UA_NS0ID_STATETYPE 2307 /* ObjectType */ +#define UA_NS0ID_STATETYPE_STATENUMBER 2308 /* Variable */ +#define UA_NS0ID_INITIALSTATETYPE 2309 /* ObjectType */ +#define UA_NS0ID_TRANSITIONTYPE 2310 /* ObjectType */ +#define UA_NS0ID_TRANSITIONEVENTTYPE 2311 /* ObjectType */ +#define UA_NS0ID_TRANSITIONTYPE_TRANSITIONNUMBER 2312 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE 2315 /* ObjectType */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE 2318 /* ObjectType */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_STEPPED 2323 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_DEFINITION 2324 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_MAXTIMEINTERVAL 2325 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_MINTIMEINTERVAL 2326 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_EXCEPTIONDEVIATION 2327 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_EXCEPTIONDEVIATIONFORMAT 2328 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE 2330 /* ObjectType */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_ACCESSHISTORYDATACAPABILITY 2331 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_ACCESSHISTORYEVENTSCAPABILITY 2332 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_INSERTDATACAPABILITY 2334 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_REPLACEDATACAPABILITY 2335 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_UPDATEDATACAPABILITY 2336 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_DELETERAWCAPABILITY 2337 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_DELETEATTIMECAPABILITY 2338 /* Variable */ +#define UA_NS0ID_AGGREGATEFUNCTIONTYPE 2340 /* ObjectType */ +#define UA_NS0ID_AGGREGATEFUNCTION_INTERPOLATIVE 2341 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_AVERAGE 2342 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_TIMEAVERAGE 2343 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_TOTAL 2344 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MINIMUM 2346 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MAXIMUM 2347 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MINIMUMACTUALTIME 2348 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MAXIMUMACTUALTIME 2349 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_RANGE 2350 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_ANNOTATIONCOUNT 2351 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_COUNT 2352 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_NUMBEROFTRANSITIONS 2355 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_START 2357 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_END 2358 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DELTA 2359 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DURATIONGOOD 2360 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DURATIONBAD 2361 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_PERCENTGOOD 2362 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_PERCENTBAD 2363 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_WORSTQUALITY 2364 /* Object */ +#define UA_NS0ID_DATAITEMTYPE 2365 /* VariableType */ +#define UA_NS0ID_DATAITEMTYPE_DEFINITION 2366 /* Variable */ +#define UA_NS0ID_DATAITEMTYPE_VALUEPRECISION 2367 /* Variable */ +#define UA_NS0ID_ANALOGITEMTYPE 2368 /* VariableType */ +#define UA_NS0ID_ANALOGITEMTYPE_EURANGE 2369 /* Variable */ +#define UA_NS0ID_ANALOGITEMTYPE_INSTRUMENTRANGE 2370 /* Variable */ +#define UA_NS0ID_ANALOGITEMTYPE_ENGINEERINGUNITS 2371 /* Variable */ +#define UA_NS0ID_DISCRETEITEMTYPE 2372 /* VariableType */ +#define UA_NS0ID_TWOSTATEDISCRETETYPE 2373 /* VariableType */ +#define UA_NS0ID_TWOSTATEDISCRETETYPE_FALSESTATE 2374 /* Variable */ +#define UA_NS0ID_TWOSTATEDISCRETETYPE_TRUESTATE 2375 /* Variable */ +#define UA_NS0ID_MULTISTATEDISCRETETYPE 2376 /* VariableType */ +#define UA_NS0ID_MULTISTATEDISCRETETYPE_ENUMSTRINGS 2377 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE 2378 /* ObjectType */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_INTERMEDIATERESULT 2379 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE 2380 /* VariableType */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_CREATESESSIONID 2381 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_CREATECLIENTNAME 2382 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_INVOCATIONCREATIONTIME 2383 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTTRANSITIONTIME 2384 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODCALL 2385 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODSESSIONID 2386 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODINPUTARGUMENTS 2387 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODOUTPUTARGUMENTS 2388 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODCALLTIME 2389 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTICTYPE_LASTMETHODRETURNSTATUS 2390 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE 2391 /* ObjectType */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CREATABLE 2392 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_DELETABLE 2393 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_AUTODELETE 2394 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RECYCLECOUNT 2395 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_INSTANCECOUNT 2396 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_MAXINSTANCECOUNT 2397 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_MAXRECYCLECOUNT 2398 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC 2399 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READY 2400 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READY_STATENUMBER 2401 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNING 2402 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNING_STATENUMBER 2403 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDED 2404 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDED_STATENUMBER 2405 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_HALTED 2406 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_HALTED_STATENUMBER 2407 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_HALTEDTOREADY 2408 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_HALTEDTOREADY_TRANSITIONNUMBER 2409 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READYTORUNNING 2410 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READYTORUNNING_TRANSITIONNUMBER 2411 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOHALTED 2412 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOHALTED_TRANSITIONNUMBER 2413 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOREADY 2414 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOREADY_TRANSITIONNUMBER 2415 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOSUSPENDED 2416 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RUNNINGTOSUSPENDED_TRANSITIONNUMBER 2417 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTORUNNING 2418 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTORUNNING_TRANSITIONNUMBER 2419 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTOHALTED 2420 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTOHALTED_TRANSITIONNUMBER 2421 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTOREADY 2422 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPENDEDTOREADY_TRANSITIONNUMBER 2423 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READYTOHALTED 2424 /* Object */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_READYTOHALTED_TRANSITIONNUMBER 2425 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_START 2426 /* Method */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_SUSPEND 2427 /* Method */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RESUME 2428 /* Method */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_HALT 2429 /* Method */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_RESET 2430 /* Method */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_REGISTERNODESCOUNT 2730 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_UNREGISTERNODESCOUNT 2731 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXBROWSECONTINUATIONPOINTS 2732 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXQUERYCONTINUATIONPOINTS 2733 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXHISTORYCONTINUATIONPOINTS 2734 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXBROWSECONTINUATIONPOINTS 2735 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXQUERYCONTINUATIONPOINTS 2736 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXHISTORYCONTINUATIONPOINTS 2737 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE 2738 /* ObjectType */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_CHANGES 2739 /* Variable */ +#define UA_NS0ID_SERVERTYPE_AUDITING 2742 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SESSIONSDIAGNOSTICSSUMMARY 2744 /* Object */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_SECURECHANNELID 2745 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_CLIENTCERTIFICATETHUMBPRINT 2746 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_CLIENTCERTIFICATETHUMBPRINT 2747 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE 2748 /* ObjectType */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_ENDPOINTURL 2749 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_ATTRIBUTEID 2750 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_PARAMETERDATATYPEID 2751 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_SECONDSTILLSHUTDOWN 2752 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_SHUTDOWNREASON 2753 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_AGGREGATEFUNCTIONS 2754 /* Object */ +#define UA_NS0ID_STATEVARIABLETYPE 2755 /* VariableType */ +#define UA_NS0ID_STATEVARIABLETYPE_ID 2756 /* Variable */ +#define UA_NS0ID_STATEVARIABLETYPE_NAME 2757 /* Variable */ +#define UA_NS0ID_STATEVARIABLETYPE_NUMBER 2758 /* Variable */ +#define UA_NS0ID_STATEVARIABLETYPE_EFFECTIVEDISPLAYNAME 2759 /* Variable */ +#define UA_NS0ID_FINITESTATEVARIABLETYPE 2760 /* VariableType */ +#define UA_NS0ID_FINITESTATEVARIABLETYPE_ID 2761 /* Variable */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE 2762 /* VariableType */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE_ID 2763 /* Variable */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE_NAME 2764 /* Variable */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE_NUMBER 2765 /* Variable */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE_TRANSITIONTIME 2766 /* Variable */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE 2767 /* VariableType */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE_ID 2768 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_CURRENTSTATE 2769 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION 2770 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE 2771 /* ObjectType */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_CURRENTSTATE 2772 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION 2773 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION 2774 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_FROMSTATE 2775 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TOSTATE 2776 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_OLDSTATEID 2777 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_NEWSTATEID 2778 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE 2782 /* ObjectType */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE 2787 /* ObjectType */ +#define UA_NS0ID_REFRESHENDEVENTTYPE 2788 /* ObjectType */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE 2789 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE 2790 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE 2803 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE 2829 /* ObjectType */ +#define UA_NS0ID_DIALOGCONDITIONTYPE 2830 /* ObjectType */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_PROMPT 2831 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE 2881 /* ObjectType */ +#define UA_NS0ID_ALARMCONDITIONTYPE 2915 /* ObjectType */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE 2929 /* ObjectType */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVED 2930 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVED 2932 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVED 2933 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVEDTOTIMEDSHELVED 2935 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVEDTOONESHOTSHELVED 2936 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVEDTOUNSHELVED 2940 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVEDTOONESHOTSHELVED 2942 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVEDTOUNSHELVED 2943 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVEDTOTIMEDSHELVED 2945 /* Object */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVE 2947 /* Method */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVE 2948 /* Method */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVE 2949 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE 2955 /* ObjectType */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVE_INPUTARGUMENTS 2991 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_SECONDSTILLSHUTDOWN 2992 /* Variable */ +#define UA_NS0ID_SERVER_SERVERSTATUS_SHUTDOWNREASON 2993 /* Variable */ +#define UA_NS0ID_SERVER_AUDITING 2994 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MODELLINGRULES 2996 /* Object */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_AGGREGATEFUNCTIONS 2997 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_EVENTNOTIFICATIONSCOUNT 2998 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE 2999 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_FILTER 3003 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE 3006 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE 3012 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE 3014 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_ISDELETEMODIFIED 3015 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_STARTTIME 3016 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_ENDTIME 3017 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE 3019 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_REQTIMES 3020 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_OLDVALUES 3021 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE 3022 /* ObjectType */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_EVENTIDS 3023 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_OLDVALUES 3024 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_UPDATEDNODE 3025 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_UPDATEDNODE 3026 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_UPDATEDNODE 3027 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_PERFORMINSERTREPLACE 3028 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_NEWVALUES 3029 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_OLDVALUES 3030 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_PERFORMINSERTREPLACE 3031 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_NEWVALUES 3032 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_OLDVALUES 3033 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_OLDVALUES 3034 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE 3035 /* ObjectType */ +#define UA_NS0ID_EVENTTYPESFOLDER 3048 /* Object */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_SOFTWARECERTIFICATES 3049 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_MAXRESPONSEMESSAGESIZE 3050 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE 3051 /* VariableType */ +#define UA_NS0ID_BUILDINFOTYPE_PRODUCTURI 3052 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE_MANUFACTURERNAME 3053 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE_PRODUCTNAME 3054 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE_SOFTWAREVERSION 3055 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE_BUILDNUMBER 3056 /* Variable */ +#define UA_NS0ID_BUILDINFOTYPE_BUILDDATE 3057 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSTYPE_CLIENTCERTIFICATE 3058 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATECONFIGURATION 3059 /* Object */ +#define UA_NS0ID_DEFAULTBINARY 3062 /* Object */ +#define UA_NS0ID_DEFAULTXML 3063 /* Object */ +#define UA_NS0ID_ALWAYSGENERATESEVENT 3065 /* ReferenceType */ +#define UA_NS0ID_ICON 3067 /* Variable */ +#define UA_NS0ID_NODEVERSION 3068 /* Variable */ +#define UA_NS0ID_LOCALTIME 3069 /* Variable */ +#define UA_NS0ID_ALLOWNULLS 3070 /* Variable */ +#define UA_NS0ID_ENUMVALUES 3071 /* Variable */ +#define UA_NS0ID_INPUTARGUMENTS 3072 /* Variable */ +#define UA_NS0ID_OUTPUTARGUMENTS 3073 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_STARTTIME 3074 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_CURRENTTIME 3075 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_STATE 3076 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO 3077 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_PRODUCTURI 3078 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_MANUFACTURERNAME 3079 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_PRODUCTNAME 3080 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_SOFTWAREVERSION 3081 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_BUILDNUMBER 3082 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_BUILDINFO_BUILDDATE 3083 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_SECONDSTILLSHUTDOWN 3084 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERSTATUS_SHUTDOWNREASON 3085 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_SERVERPROFILEARRAY 3086 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_LOCALEIDARRAY 3087 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MINSUPPORTEDSAMPLERATE 3088 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXBROWSECONTINUATIONPOINTS 3089 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXQUERYCONTINUATIONPOINTS 3090 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXHISTORYCONTINUATIONPOINTS 3091 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_SOFTWARECERTIFICATES 3092 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MODELLINGRULES 3093 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_AGGREGATEFUNCTIONS 3094 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY 3095 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SERVERVIEWCOUNT 3096 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CURRENTSESSIONCOUNT 3097 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSESSIONCOUNT 3098 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDSESSIONCOUNT 3099 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_REJECTEDSESSIONCOUNT 3100 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SESSIONTIMEOUTCOUNT 3101 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SESSIONABORTCOUNT 3102 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_PUBLISHINGINTERVALCOUNT 3104 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CURRENTSUBSCRIPTIONCOUNT 3105 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSUBSCRIPTIONCOUNT 3106 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDREQUESTSCOUNT 3107 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_REJECTEDREQUESTSCOUNT 3108 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SAMPLINGINTERVALDIAGNOSTICSARRAY 3109 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SUBSCRIPTIONDIAGNOSTICSARRAY 3110 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY 3111 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY_SESSIONDIAGNOSTICSARRAY 3112 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY_SESSIONSECURITYDIAGNOSTICSARRAY 3113 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERDIAGNOSTICS_ENABLEDFLAG 3114 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERREDUNDANCY_REDUNDANCYSUPPORT 3115 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_SERVERVIEWCOUNT 3116 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_CURRENTSESSIONCOUNT 3117 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSESSIONCOUNT 3118 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDSESSIONCOUNT 3119 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_REJECTEDSESSIONCOUNT 3120 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_SESSIONTIMEOUTCOUNT 3121 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_SESSIONABORTCOUNT 3122 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_PUBLISHINGINTERVALCOUNT 3124 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_CURRENTSUBSCRIPTIONCOUNT 3125 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_CUMULATEDSUBSCRIPTIONCOUNT 3126 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_SECURITYREJECTEDREQUESTSCOUNT 3127 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SERVERDIAGNOSTICSSUMMARY_REJECTEDREQUESTSCOUNT 3128 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SESSIONSDIAGNOSTICSSUMMARY_SESSIONDIAGNOSTICSARRAY 3129 /* Variable */ +#define UA_NS0ID_SERVERDIAGNOSTICSTYPE_SESSIONSDIAGNOSTICSSUMMARY_SESSIONSECURITYDIAGNOSTICSARRAY 3130 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SESSIONID 3131 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SESSIONNAME 3132 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CLIENTDESCRIPTION 3133 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SERVERURI 3134 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_ENDPOINTURL 3135 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_LOCALEIDS 3136 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_ACTUALSESSIONTIMEOUT 3137 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_MAXRESPONSEMESSAGESIZE 3138 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CLIENTCONNECTIONTIME 3139 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CLIENTLASTCONTACTTIME 3140 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CURRENTSUBSCRIPTIONSCOUNT 3141 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CURRENTMONITOREDITEMSCOUNT 3142 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CURRENTPUBLISHREQUESTSINQUEUE 3143 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_READCOUNT 3151 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_HISTORYREADCOUNT 3152 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_WRITECOUNT 3153 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_HISTORYUPDATECOUNT 3154 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CALLCOUNT 3155 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CREATEMONITOREDITEMSCOUNT 3156 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_MODIFYMONITOREDITEMSCOUNT 3157 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SETMONITORINGMODECOUNT 3158 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SETTRIGGERINGCOUNT 3159 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_DELETEMONITOREDITEMSCOUNT 3160 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_CREATESUBSCRIPTIONCOUNT 3161 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_MODIFYSUBSCRIPTIONCOUNT 3162 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_SETPUBLISHINGMODECOUNT 3163 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_PUBLISHCOUNT 3164 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_REPUBLISHCOUNT 3165 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_TRANSFERSUBSCRIPTIONSCOUNT 3166 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_DELETESUBSCRIPTIONSCOUNT 3167 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_ADDNODESCOUNT 3168 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_ADDREFERENCESCOUNT 3169 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_DELETENODESCOUNT 3170 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_DELETEREFERENCESCOUNT 3171 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_BROWSECOUNT 3172 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_BROWSENEXTCOUNT 3173 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_TRANSLATEBROWSEPATHSTONODEIDSCOUNT 3174 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_QUERYFIRSTCOUNT 3175 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_QUERYNEXTCOUNT 3176 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_REGISTERNODESCOUNT 3177 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_UNREGISTERNODESCOUNT 3178 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_SESSIONID 3179 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDOFSESSION 3180 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDHISTORY 3181 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_AUTHENTICATIONMECHANISM 3182 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_ENCODING 3183 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_TRANSPORTPROTOCOL 3184 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_SECURITYMODE 3185 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_SECURITYPOLICYURI 3186 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTCERTIFICATE 3187 /* Variable */ +#define UA_NS0ID_TRANSPARENTREDUNDANCYTYPE_REDUNDANCYSUPPORT 3188 /* Variable */ +#define UA_NS0ID_NONTRANSPARENTREDUNDANCYTYPE_REDUNDANCYSUPPORT 3189 /* Variable */ +#define UA_NS0ID_BASEEVENTTYPE_LOCALTIME 3190 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_EVENTID 3191 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_EVENTTYPE 3192 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_SOURCENODE 3193 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_SOURCENAME 3194 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_TIME 3195 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_RECEIVETIME 3196 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_LOCALTIME 3197 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_MESSAGE 3198 /* Variable */ +#define UA_NS0ID_EVENTQUEUEOVERFLOWEVENTTYPE_SEVERITY 3199 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_EVENTID 3200 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_EVENTTYPE 3201 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_SOURCENODE 3202 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_SOURCENAME 3203 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_TIME 3204 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_RECEIVETIME 3205 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_LOCALTIME 3206 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_MESSAGE 3207 /* Variable */ +#define UA_NS0ID_AUDITEVENTTYPE_SEVERITY 3208 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_EVENTID 3209 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_EVENTTYPE 3210 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_SOURCENODE 3211 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_SOURCENAME 3212 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_TIME 3213 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_RECEIVETIME 3214 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_LOCALTIME 3215 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_MESSAGE 3216 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_SEVERITY 3217 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_ACTIONTIMESTAMP 3218 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_STATUS 3219 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_SERVERID 3220 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_CLIENTAUDITENTRYID 3221 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_CLIENTUSERID 3222 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_EVENTID 3223 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_EVENTTYPE 3224 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_SOURCENODE 3225 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_SOURCENAME 3226 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_TIME 3227 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_RECEIVETIME 3228 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_LOCALTIME 3229 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_MESSAGE 3230 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_SEVERITY 3231 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_ACTIONTIMESTAMP 3232 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_STATUS 3233 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_SERVERID 3234 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_CLIENTAUDITENTRYID 3235 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_CLIENTUSERID 3236 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_EVENTID 3237 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_EVENTTYPE 3238 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SOURCENODE 3239 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SOURCENAME 3240 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_TIME 3241 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_RECEIVETIME 3242 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_LOCALTIME 3243 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_MESSAGE 3244 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SEVERITY 3245 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_ACTIONTIMESTAMP 3246 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_STATUS 3247 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SERVERID 3248 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_CLIENTAUDITENTRYID 3249 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_CLIENTUSERID 3250 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_SECURECHANNELID 3251 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_EVENTID 3252 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_EVENTTYPE 3253 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_SOURCENODE 3254 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_SOURCENAME 3255 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_TIME 3256 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_RECEIVETIME 3257 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_LOCALTIME 3258 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_MESSAGE 3259 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_SEVERITY 3260 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_ACTIONTIMESTAMP 3261 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_STATUS 3262 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_SERVERID 3263 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_CLIENTAUDITENTRYID 3264 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_CLIENTUSERID 3265 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_EVENTID 3266 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_EVENTTYPE 3267 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SOURCENODE 3268 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SOURCENAME 3269 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_TIME 3270 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_RECEIVETIME 3271 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_LOCALTIME 3272 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_MESSAGE 3273 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SEVERITY 3274 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_ACTIONTIMESTAMP 3275 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_STATUS 3276 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SERVERID 3277 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_CLIENTAUDITENTRYID 3278 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_CLIENTUSERID 3279 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_EVENTID 3281 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_EVENTTYPE 3282 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SOURCENODE 3283 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SOURCENAME 3284 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_TIME 3285 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_RECEIVETIME 3286 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_LOCALTIME 3287 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_MESSAGE 3288 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SEVERITY 3289 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_ACTIONTIMESTAMP 3290 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_STATUS 3291 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SERVERID 3292 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_CLIENTAUDITENTRYID 3293 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_CLIENTUSERID 3294 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SECURECHANNELID 3296 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_CLIENTCERTIFICATE 3297 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_CLIENTCERTIFICATETHUMBPRINT 3298 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_REVISEDSESSIONTIMEOUT 3299 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_EVENTID 3300 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_EVENTTYPE 3301 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SOURCENODE 3302 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SOURCENAME 3303 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_TIME 3304 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_RECEIVETIME 3305 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_LOCALTIME 3306 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_MESSAGE 3307 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SEVERITY 3308 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_ACTIONTIMESTAMP 3309 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_STATUS 3310 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SERVERID 3311 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_CLIENTAUDITENTRYID 3312 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_CLIENTUSERID 3313 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SESSIONID 3314 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_EVENTID 3315 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_EVENTTYPE 3316 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_SOURCENODE 3317 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_SOURCENAME 3318 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_TIME 3319 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_RECEIVETIME 3320 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_LOCALTIME 3321 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_MESSAGE 3322 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_SEVERITY 3323 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_ACTIONTIMESTAMP 3324 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_STATUS 3325 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_SERVERID 3326 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_CLIENTAUDITENTRYID 3327 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_CLIENTUSERID 3328 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_SESSIONID 3329 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_EVENTID 3330 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_EVENTTYPE 3331 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_SOURCENODE 3332 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_SOURCENAME 3333 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_TIME 3334 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_RECEIVETIME 3335 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_LOCALTIME 3336 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_MESSAGE 3337 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_SEVERITY 3338 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_ACTIONTIMESTAMP 3339 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_STATUS 3340 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_SERVERID 3341 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_CLIENTAUDITENTRYID 3342 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_CLIENTUSERID 3343 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_EVENTID 3344 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_EVENTTYPE 3345 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_SOURCENODE 3346 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_SOURCENAME 3347 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_TIME 3348 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_RECEIVETIME 3349 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_LOCALTIME 3350 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_MESSAGE 3351 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_SEVERITY 3352 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_ACTIONTIMESTAMP 3353 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_STATUS 3354 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_SERVERID 3355 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_CLIENTAUDITENTRYID 3356 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_CLIENTUSERID 3357 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_CERTIFICATE 3358 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_EVENTID 3359 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_EVENTTYPE 3360 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_SOURCENODE 3361 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_SOURCENAME 3362 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_TIME 3363 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_RECEIVETIME 3364 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_LOCALTIME 3365 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_MESSAGE 3366 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_SEVERITY 3367 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_ACTIONTIMESTAMP 3368 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_STATUS 3369 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_SERVERID 3370 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_CLIENTAUDITENTRYID 3371 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_CLIENTUSERID 3372 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_CERTIFICATE 3373 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_EVENTID 3374 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_EVENTTYPE 3375 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_SOURCENODE 3376 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_SOURCENAME 3377 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_TIME 3378 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_RECEIVETIME 3379 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_LOCALTIME 3380 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_MESSAGE 3381 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_SEVERITY 3382 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_ACTIONTIMESTAMP 3383 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_STATUS 3384 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_SERVERID 3385 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_CLIENTAUDITENTRYID 3386 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_CLIENTUSERID 3387 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_CERTIFICATE 3388 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_EVENTID 3389 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_EVENTTYPE 3390 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_SOURCENODE 3391 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_SOURCENAME 3392 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_TIME 3393 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_RECEIVETIME 3394 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_LOCALTIME 3395 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_MESSAGE 3396 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_SEVERITY 3397 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_ACTIONTIMESTAMP 3398 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_STATUS 3399 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_SERVERID 3400 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_CLIENTAUDITENTRYID 3401 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_CLIENTUSERID 3402 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_CERTIFICATE 3403 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_EVENTID 3404 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_EVENTTYPE 3405 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_SOURCENODE 3406 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_SOURCENAME 3407 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_TIME 3408 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_RECEIVETIME 3409 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_LOCALTIME 3410 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_MESSAGE 3411 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_SEVERITY 3412 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_ACTIONTIMESTAMP 3413 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_STATUS 3414 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_SERVERID 3415 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_CLIENTAUDITENTRYID 3416 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_CLIENTUSERID 3417 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_CERTIFICATE 3418 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_EVENTID 3419 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_EVENTTYPE 3420 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_SOURCENODE 3421 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_SOURCENAME 3422 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_TIME 3423 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_RECEIVETIME 3424 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_LOCALTIME 3425 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_MESSAGE 3426 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_SEVERITY 3427 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_ACTIONTIMESTAMP 3428 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_STATUS 3429 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_SERVERID 3430 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_CLIENTAUDITENTRYID 3431 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_CLIENTUSERID 3432 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_CERTIFICATE 3433 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_EVENTID 3434 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_EVENTTYPE 3435 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_SOURCENODE 3436 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_SOURCENAME 3437 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_TIME 3438 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_RECEIVETIME 3439 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_LOCALTIME 3440 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_MESSAGE 3441 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_SEVERITY 3442 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_ACTIONTIMESTAMP 3443 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_STATUS 3444 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_SERVERID 3445 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_CLIENTAUDITENTRYID 3446 /* Variable */ +#define UA_NS0ID_AUDITNODEMANAGEMENTEVENTTYPE_CLIENTUSERID 3447 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_EVENTID 3448 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_EVENTTYPE 3449 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_SOURCENODE 3450 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_SOURCENAME 3451 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_TIME 3452 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_RECEIVETIME 3453 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_LOCALTIME 3454 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_MESSAGE 3455 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_SEVERITY 3456 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_ACTIONTIMESTAMP 3457 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_STATUS 3458 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_SERVERID 3459 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_CLIENTAUDITENTRYID 3460 /* Variable */ +#define UA_NS0ID_AUDITADDNODESEVENTTYPE_CLIENTUSERID 3461 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_EVENTID 3462 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_EVENTTYPE 3463 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_SOURCENODE 3464 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_SOURCENAME 3465 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_TIME 3466 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_RECEIVETIME 3467 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_LOCALTIME 3468 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_MESSAGE 3469 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_SEVERITY 3470 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_ACTIONTIMESTAMP 3471 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_STATUS 3472 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_SERVERID 3473 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_CLIENTAUDITENTRYID 3474 /* Variable */ +#define UA_NS0ID_AUDITDELETENODESEVENTTYPE_CLIENTUSERID 3475 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_EVENTID 3476 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_EVENTTYPE 3477 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_SOURCENODE 3478 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_SOURCENAME 3479 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_TIME 3480 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_RECEIVETIME 3481 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_LOCALTIME 3482 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_MESSAGE 3483 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_SEVERITY 3484 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_ACTIONTIMESTAMP 3485 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_STATUS 3486 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_SERVERID 3487 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_CLIENTAUDITENTRYID 3488 /* Variable */ +#define UA_NS0ID_AUDITADDREFERENCESEVENTTYPE_CLIENTUSERID 3489 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_EVENTID 3490 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_EVENTTYPE 3491 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_SOURCENODE 3492 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_SOURCENAME 3493 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_TIME 3494 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_RECEIVETIME 3495 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_LOCALTIME 3496 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_MESSAGE 3497 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_SEVERITY 3498 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_ACTIONTIMESTAMP 3499 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_STATUS 3500 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_SERVERID 3501 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_CLIENTAUDITENTRYID 3502 /* Variable */ +#define UA_NS0ID_AUDITDELETEREFERENCESEVENTTYPE_CLIENTUSERID 3503 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_EVENTID 3504 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_EVENTTYPE 3505 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_SOURCENODE 3506 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_SOURCENAME 3507 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_TIME 3508 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_RECEIVETIME 3509 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_LOCALTIME 3510 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_MESSAGE 3511 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_SEVERITY 3512 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_ACTIONTIMESTAMP 3513 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_STATUS 3514 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_SERVERID 3515 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_CLIENTAUDITENTRYID 3516 /* Variable */ +#define UA_NS0ID_AUDITUPDATEEVENTTYPE_CLIENTUSERID 3517 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_EVENTID 3518 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_EVENTTYPE 3519 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_SOURCENODE 3520 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_SOURCENAME 3521 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_TIME 3522 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_RECEIVETIME 3523 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_LOCALTIME 3524 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_MESSAGE 3525 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_SEVERITY 3526 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_ACTIONTIMESTAMP 3527 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_STATUS 3528 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_SERVERID 3529 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_CLIENTAUDITENTRYID 3530 /* Variable */ +#define UA_NS0ID_AUDITWRITEUPDATEEVENTTYPE_CLIENTUSERID 3531 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_EVENTID 3532 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_EVENTTYPE 3533 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_SOURCENODE 3534 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_SOURCENAME 3535 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_TIME 3536 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_RECEIVETIME 3537 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_LOCALTIME 3538 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_MESSAGE 3539 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_SEVERITY 3540 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_ACTIONTIMESTAMP 3541 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_STATUS 3542 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_SERVERID 3543 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_CLIENTAUDITENTRYID 3544 /* Variable */ +#define UA_NS0ID_AUDITHISTORYUPDATEEVENTTYPE_CLIENTUSERID 3545 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_EVENTID 3546 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_EVENTTYPE 3547 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_SOURCENODE 3548 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_SOURCENAME 3549 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_TIME 3550 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_RECEIVETIME 3551 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_LOCALTIME 3552 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_MESSAGE 3553 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_SEVERITY 3554 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_ACTIONTIMESTAMP 3555 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_STATUS 3556 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_SERVERID 3557 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_CLIENTAUDITENTRYID 3558 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_CLIENTUSERID 3559 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTUPDATEEVENTTYPE_PARAMETERDATATYPEID 3560 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_EVENTID 3561 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_EVENTTYPE 3562 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_SOURCENODE 3563 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_SOURCENAME 3564 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_TIME 3565 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_RECEIVETIME 3566 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_LOCALTIME 3567 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_MESSAGE 3568 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_SEVERITY 3569 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_ACTIONTIMESTAMP 3570 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_STATUS 3571 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_SERVERID 3572 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_CLIENTAUDITENTRYID 3573 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_CLIENTUSERID 3574 /* Variable */ +#define UA_NS0ID_AUDITHISTORYVALUEUPDATEEVENTTYPE_PARAMETERDATATYPEID 3575 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_EVENTID 3576 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_EVENTTYPE 3577 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_SOURCENODE 3578 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_SOURCENAME 3579 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_TIME 3580 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_RECEIVETIME 3581 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_LOCALTIME 3582 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_MESSAGE 3583 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_SEVERITY 3584 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_ACTIONTIMESTAMP 3585 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_STATUS 3586 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_SERVERID 3587 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_CLIENTAUDITENTRYID 3588 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_CLIENTUSERID 3589 /* Variable */ +#define UA_NS0ID_AUDITHISTORYDELETEEVENTTYPE_PARAMETERDATATYPEID 3590 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_EVENTID 3591 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_EVENTTYPE 3592 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_SOURCENODE 3593 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_SOURCENAME 3594 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_TIME 3595 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_RECEIVETIME 3596 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_LOCALTIME 3597 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_MESSAGE 3598 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_SEVERITY 3599 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_ACTIONTIMESTAMP 3600 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_STATUS 3601 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_SERVERID 3602 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_CLIENTAUDITENTRYID 3603 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_CLIENTUSERID 3604 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_PARAMETERDATATYPEID 3605 /* Variable */ +#define UA_NS0ID_AUDITHISTORYRAWMODIFYDELETEEVENTTYPE_UPDATEDNODE 3606 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_EVENTID 3607 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_EVENTTYPE 3608 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_SOURCENODE 3609 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_SOURCENAME 3610 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_TIME 3611 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_RECEIVETIME 3612 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_LOCALTIME 3613 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_MESSAGE 3614 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_SEVERITY 3615 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_ACTIONTIMESTAMP 3616 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_STATUS 3617 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_SERVERID 3618 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_CLIENTAUDITENTRYID 3619 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_CLIENTUSERID 3620 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_PARAMETERDATATYPEID 3621 /* Variable */ +#define UA_NS0ID_AUDITHISTORYATTIMEDELETEEVENTTYPE_UPDATEDNODE 3622 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_EVENTID 3623 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_EVENTTYPE 3624 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_SOURCENODE 3625 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_SOURCENAME 3626 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_TIME 3627 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_RECEIVETIME 3628 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_LOCALTIME 3629 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_MESSAGE 3630 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_SEVERITY 3631 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_ACTIONTIMESTAMP 3632 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_STATUS 3633 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_SERVERID 3634 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_CLIENTAUDITENTRYID 3635 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_CLIENTUSERID 3636 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_PARAMETERDATATYPEID 3637 /* Variable */ +#define UA_NS0ID_AUDITHISTORYEVENTDELETEEVENTTYPE_UPDATEDNODE 3638 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_EVENTID 3639 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_EVENTTYPE 3640 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_SOURCENODE 3641 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_SOURCENAME 3642 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_TIME 3643 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_RECEIVETIME 3644 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_LOCALTIME 3645 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_MESSAGE 3646 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_SEVERITY 3647 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_ACTIONTIMESTAMP 3648 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_STATUS 3649 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_SERVERID 3650 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_CLIENTAUDITENTRYID 3651 /* Variable */ +#define UA_NS0ID_AUDITUPDATEMETHODEVENTTYPE_CLIENTUSERID 3652 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_EVENTID 3653 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_EVENTTYPE 3654 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_SOURCENODE 3655 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_SOURCENAME 3656 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_TIME 3657 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_RECEIVETIME 3658 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_LOCALTIME 3659 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_MESSAGE 3660 /* Variable */ +#define UA_NS0ID_SYSTEMEVENTTYPE_SEVERITY 3661 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_EVENTID 3662 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_EVENTTYPE 3663 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_SOURCENODE 3664 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_SOURCENAME 3665 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_TIME 3666 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_RECEIVETIME 3667 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_LOCALTIME 3668 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_MESSAGE 3669 /* Variable */ +#define UA_NS0ID_DEVICEFAILUREEVENTTYPE_SEVERITY 3670 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_EVENTID 3671 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_EVENTTYPE 3672 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_SOURCENODE 3673 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_SOURCENAME 3674 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_TIME 3675 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_RECEIVETIME 3676 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_LOCALTIME 3677 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_MESSAGE 3678 /* Variable */ +#define UA_NS0ID_BASEMODELCHANGEEVENTTYPE_SEVERITY 3679 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_EVENTID 3680 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_EVENTTYPE 3681 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_SOURCENODE 3682 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_SOURCENAME 3683 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_TIME 3684 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_RECEIVETIME 3685 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_LOCALTIME 3686 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_MESSAGE 3687 /* Variable */ +#define UA_NS0ID_GENERALMODELCHANGEEVENTTYPE_SEVERITY 3688 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_EVENTID 3689 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_EVENTTYPE 3690 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_SOURCENODE 3691 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_SOURCENAME 3692 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_TIME 3693 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_RECEIVETIME 3694 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_LOCALTIME 3695 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_MESSAGE 3696 /* Variable */ +#define UA_NS0ID_SEMANTICCHANGEEVENTTYPE_SEVERITY 3697 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_PRODUCTURI 3698 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_MANUFACTURERNAME 3699 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_PRODUCTNAME 3700 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_SOFTWAREVERSION 3701 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_BUILDNUMBER 3702 /* Variable */ +#define UA_NS0ID_SERVERSTATUSTYPE_BUILDINFO_BUILDDATE 3703 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_SOFTWARECERTIFICATES 3704 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SERVERDIAGNOSTICSSUMMARY_REJECTEDSESSIONCOUNT 3705 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY 3706 /* Object */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY_SESSIONDIAGNOSTICSARRAY 3707 /* Variable */ +#define UA_NS0ID_SERVER_SERVERDIAGNOSTICS_SESSIONSDIAGNOSTICSSUMMARY_SESSIONSECURITYDIAGNOSTICSARRAY 3708 /* Variable */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY_REDUNDANCYSUPPORT 3709 /* Variable */ +#define UA_NS0ID_FINITESTATEVARIABLETYPE_NAME 3714 /* Variable */ +#define UA_NS0ID_FINITESTATEVARIABLETYPE_NUMBER 3715 /* Variable */ +#define UA_NS0ID_FINITESTATEVARIABLETYPE_EFFECTIVEDISPLAYNAME 3716 /* Variable */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE_NAME 3717 /* Variable */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE_NUMBER 3718 /* Variable */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE_TRANSITIONTIME 3719 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_CURRENTSTATE_ID 3720 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_CURRENTSTATE_NAME 3721 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_CURRENTSTATE_NUMBER 3722 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 3723 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION_ID 3724 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION_NAME 3725 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION_NUMBER 3726 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 3727 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_CURRENTSTATE_ID 3728 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_CURRENTSTATE_NAME 3729 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_CURRENTSTATE_NUMBER 3730 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 3731 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION_ID 3732 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION_NAME 3733 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION_NUMBER 3734 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 3735 /* Variable */ +#define UA_NS0ID_INITIALSTATETYPE_STATENUMBER 3736 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_EVENTID 3737 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_EVENTTYPE 3738 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_SOURCENODE 3739 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_SOURCENAME 3740 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TIME 3741 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_RECEIVETIME 3742 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_LOCALTIME 3743 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_MESSAGE 3744 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_SEVERITY 3745 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_FROMSTATE_ID 3746 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_FROMSTATE_NAME 3747 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_FROMSTATE_NUMBER 3748 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_FROMSTATE_EFFECTIVEDISPLAYNAME 3749 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TOSTATE_ID 3750 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TOSTATE_NAME 3751 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TOSTATE_NUMBER 3752 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TOSTATE_EFFECTIVEDISPLAYNAME 3753 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION_ID 3754 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION_NAME 3755 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION_NUMBER 3756 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION_TRANSITIONTIME 3757 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_EVENTID 3758 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_EVENTTYPE 3759 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_SOURCENODE 3760 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_SOURCENAME 3761 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_TIME 3762 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_RECEIVETIME 3763 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_LOCALTIME 3764 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_MESSAGE 3765 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_SEVERITY 3766 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_ACTIONTIMESTAMP 3767 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_STATUS 3768 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_SERVERID 3769 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_CLIENTAUDITENTRYID 3770 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_CLIENTUSERID 3771 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_METHODID 3772 /* Variable */ +#define UA_NS0ID_AUDITUPDATESTATEEVENTTYPE_INPUTARGUMENTS 3773 /* Variable */ +#define UA_NS0ID_ANALOGITEMTYPE_DEFINITION 3774 /* Variable */ +#define UA_NS0ID_ANALOGITEMTYPE_VALUEPRECISION 3775 /* Variable */ +#define UA_NS0ID_DISCRETEITEMTYPE_DEFINITION 3776 /* Variable */ +#define UA_NS0ID_DISCRETEITEMTYPE_VALUEPRECISION 3777 /* Variable */ +#define UA_NS0ID_TWOSTATEDISCRETETYPE_DEFINITION 3778 /* Variable */ +#define UA_NS0ID_TWOSTATEDISCRETETYPE_VALUEPRECISION 3779 /* Variable */ +#define UA_NS0ID_MULTISTATEDISCRETETYPE_DEFINITION 3780 /* Variable */ +#define UA_NS0ID_MULTISTATEDISCRETETYPE_VALUEPRECISION 3781 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_EVENTID 3782 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_EVENTTYPE 3783 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_SOURCENODE 3784 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_SOURCENAME 3785 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TIME 3786 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_RECEIVETIME 3787 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_LOCALTIME 3788 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_MESSAGE 3789 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_SEVERITY 3790 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_FROMSTATE 3791 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_FROMSTATE_ID 3792 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_FROMSTATE_NAME 3793 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_FROMSTATE_NUMBER 3794 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_FROMSTATE_EFFECTIVEDISPLAYNAME 3795 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TOSTATE 3796 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TOSTATE_ID 3797 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TOSTATE_NAME 3798 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TOSTATE_NUMBER 3799 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TOSTATE_EFFECTIVEDISPLAYNAME 3800 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION 3801 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION_ID 3802 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION_NAME 3803 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION_NUMBER 3804 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION_TRANSITIONTIME 3805 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE 3806 /* ObjectType */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_EVENTID 3807 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_EVENTTYPE 3808 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_SOURCENODE 3809 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_SOURCENAME 3810 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TIME 3811 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_RECEIVETIME 3812 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_LOCALTIME 3813 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_MESSAGE 3814 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_SEVERITY 3815 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_ACTIONTIMESTAMP 3816 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_STATUS 3817 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_SERVERID 3818 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_CLIENTAUDITENTRYID 3819 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_CLIENTUSERID 3820 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_METHODID 3821 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_INPUTARGUMENTS 3822 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_OLDSTATEID 3823 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_NEWSTATEID 3824 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION 3825 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION_ID 3826 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION_NAME 3827 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION_NUMBER 3828 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION_TRANSITIONTIME 3829 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CURRENTSTATE 3830 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CURRENTSTATE_ID 3831 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CURRENTSTATE_NAME 3832 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CURRENTSTATE_NUMBER 3833 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 3834 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION 3835 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION_ID 3836 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION_NAME 3837 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION_NUMBER 3838 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 3839 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_CREATESESSIONID 3840 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_CREATECLIENTNAME 3841 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_INVOCATIONCREATIONTIME 3842 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTTRANSITIONTIME 3843 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODCALL 3844 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODSESSIONID 3845 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODINPUTARGUMENTS 3846 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODOUTPUTARGUMENTS 3847 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODCALLTIME 3848 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODRETURNSTATUS 3849 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_FINALRESULTDATA 3850 /* Object */ +#define UA_NS0ID_ADDCOMMENTMETHODTYPE 3863 /* Method */ +#define UA_NS0ID_ADDCOMMENTMETHODTYPE_INPUTARGUMENTS 3864 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_EVENTID 3865 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_EVENTTYPE 3866 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_SOURCENODE 3867 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_SOURCENAME 3868 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_TIME 3869 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_RECEIVETIME 3870 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_LOCALTIME 3871 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_MESSAGE 3872 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_SEVERITY 3873 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_RETAIN 3874 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONREFRESH 3875 /* Method */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONREFRESH_INPUTARGUMENTS 3876 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_EVENTID 3969 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_EVENTTYPE 3970 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_SOURCENODE 3971 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_SOURCENAME 3972 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_TIME 3973 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_RECEIVETIME 3974 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_LOCALTIME 3975 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_MESSAGE 3976 /* Variable */ +#define UA_NS0ID_REFRESHSTARTEVENTTYPE_SEVERITY 3977 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_EVENTID 3978 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_EVENTTYPE 3979 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_SOURCENODE 3980 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_SOURCENAME 3981 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_TIME 3982 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_RECEIVETIME 3983 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_LOCALTIME 3984 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_MESSAGE 3985 /* Variable */ +#define UA_NS0ID_REFRESHENDEVENTTYPE_SEVERITY 3986 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_EVENTID 3987 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_EVENTTYPE 3988 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_SOURCENODE 3989 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_SOURCENAME 3990 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_TIME 3991 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_RECEIVETIME 3992 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_LOCALTIME 3993 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_MESSAGE 3994 /* Variable */ +#define UA_NS0ID_REFRESHREQUIREDEVENTTYPE_SEVERITY 3995 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_EVENTID 3996 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_EVENTTYPE 3997 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_SOURCENODE 3998 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_SOURCENAME 3999 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_TIME 4000 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_RECEIVETIME 4001 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_LOCALTIME 4002 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_MESSAGE 4003 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_SEVERITY 4004 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_ACTIONTIMESTAMP 4005 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_STATUS 4006 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_SERVERID 4007 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_CLIENTAUDITENTRYID 4008 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_CLIENTUSERID 4009 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_METHODID 4010 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONEVENTTYPE_INPUTARGUMENTS 4011 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_EVENTID 4106 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_EVENTTYPE 4107 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_SOURCENODE 4108 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_SOURCENAME 4109 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_TIME 4110 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_RECEIVETIME 4111 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_LOCALTIME 4112 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_MESSAGE 4113 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_SEVERITY 4114 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_ACTIONTIMESTAMP 4115 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_STATUS 4116 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_SERVERID 4117 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_CLIENTAUDITENTRYID 4118 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_CLIENTUSERID 4119 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_METHODID 4120 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONENABLEEVENTTYPE_INPUTARGUMENTS 4121 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_EVENTID 4170 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_EVENTTYPE 4171 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_SOURCENODE 4172 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_SOURCENAME 4173 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_TIME 4174 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_RECEIVETIME 4175 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_LOCALTIME 4176 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_MESSAGE 4177 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_SEVERITY 4178 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_ACTIONTIMESTAMP 4179 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_STATUS 4180 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_SERVERID 4181 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_CLIENTAUDITENTRYID 4182 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_CLIENTUSERID 4183 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_METHODID 4184 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_INPUTARGUMENTS 4185 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_EVENTID 4188 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_EVENTTYPE 4189 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_SOURCENODE 4190 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_SOURCENAME 4191 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_TIME 4192 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_RECEIVETIME 4193 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_LOCALTIME 4194 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_MESSAGE 4195 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_SEVERITY 4196 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_RETAIN 4197 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONREFRESH 4198 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONREFRESH_INPUTARGUMENTS 4199 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_EVENTID 5113 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_EVENTTYPE 5114 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_SOURCENODE 5115 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_SOURCENAME 5116 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_TIME 5117 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_RECEIVETIME 5118 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_LOCALTIME 5119 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_MESSAGE 5120 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_SEVERITY 5121 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_RETAIN 5122 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONREFRESH 5123 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONREFRESH_INPUTARGUMENTS 5124 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_EVENTID 5540 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_EVENTTYPE 5541 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SOURCENODE 5542 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SOURCENAME 5543 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_TIME 5544 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_RECEIVETIME 5545 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LOCALTIME 5546 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_MESSAGE 5547 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SEVERITY 5548 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_RETAIN 5549 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONREFRESH 5550 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONREFRESH_INPUTARGUMENTS 5551 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_CURRENTSTATE 6088 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_CURRENTSTATE_ID 6089 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_CURRENTSTATE_NAME 6090 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_CURRENTSTATE_NUMBER 6091 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 6092 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION 6093 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION_ID 6094 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION_NAME 6095 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION_NUMBER 6096 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 6097 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVED_STATENUMBER 6098 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVED_STATENUMBER 6100 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVED_STATENUMBER 6101 /* Variable */ +#define UA_NS0ID_TIMEDSHELVEMETHODTYPE 6102 /* Method */ +#define UA_NS0ID_TIMEDSHELVEMETHODTYPE_INPUTARGUMENTS 6103 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_EVENTID 6116 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_EVENTTYPE 6117 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SOURCENODE 6118 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SOURCENAME 6119 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_TIME 6120 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_RECEIVETIME 6121 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LOCALTIME 6122 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_MESSAGE 6123 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SEVERITY 6124 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_RETAIN 6125 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONREFRESH 6126 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 6127 /* Variable */ +#define UA_NS0ID_IDTYPE_ENUMSTRINGS 7591 /* Variable */ +#define UA_NS0ID_ENUMVALUETYPE 7594 /* DataType */ +#define UA_NS0ID_MESSAGESECURITYMODE_ENUMSTRINGS 7595 /* Variable */ +#define UA_NS0ID_USERTOKENTYPE_ENUMSTRINGS 7596 /* Variable */ +#define UA_NS0ID_APPLICATIONTYPE_ENUMSTRINGS 7597 /* Variable */ +#define UA_NS0ID_SECURITYTOKENREQUESTTYPE_ENUMSTRINGS 7598 /* Variable */ +#define UA_NS0ID_BROWSEDIRECTION_ENUMSTRINGS 7603 /* Variable */ +#define UA_NS0ID_FILTEROPERATOR_ENUMSTRINGS 7605 /* Variable */ +#define UA_NS0ID_TIMESTAMPSTORETURN_ENUMSTRINGS 7606 /* Variable */ +#define UA_NS0ID_MONITORINGMODE_ENUMSTRINGS 7608 /* Variable */ +#define UA_NS0ID_DATACHANGETRIGGER_ENUMSTRINGS 7609 /* Variable */ +#define UA_NS0ID_DEADBANDTYPE_ENUMSTRINGS 7610 /* Variable */ +#define UA_NS0ID_REDUNDANCYSUPPORT_ENUMSTRINGS 7611 /* Variable */ +#define UA_NS0ID_SERVERSTATE_ENUMSTRINGS 7612 /* Variable */ +#define UA_NS0ID_EXCEPTIONDEVIATIONFORMAT_ENUMSTRINGS 7614 /* Variable */ +#define UA_NS0ID_ENUMVALUETYPE_ENCODING_DEFAULTXML 7616 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA 7617 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEVERSION 7618 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NAMESPACEURI 7619 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ARGUMENT 7650 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ARGUMENT_DATATYPEVERSION 7651 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ARGUMENT_DICTIONARYFRAGMENT 7652 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMVALUETYPE 7656 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMVALUETYPE_DATATYPEVERSION 7657 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMVALUETYPE_DICTIONARYFRAGMENT 7658 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STATUSRESULT 7659 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STATUSRESULT_DATATYPEVERSION 7660 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STATUSRESULT_DICTIONARYFRAGMENT 7661 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERTOKENPOLICY 7662 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERTOKENPOLICY_DATATYPEVERSION 7663 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERTOKENPOLICY_DICTIONARYFRAGMENT 7664 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_APPLICATIONDESCRIPTION 7665 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_APPLICATIONDESCRIPTION_DATATYPEVERSION 7666 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_APPLICATIONDESCRIPTION_DICTIONARYFRAGMENT 7667 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTDESCRIPTION 7668 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTDESCRIPTION_DATATYPEVERSION 7669 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTDESCRIPTION_DICTIONARYFRAGMENT 7670 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERIDENTITYTOKEN 7671 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERIDENTITYTOKEN_DATATYPEVERSION 7672 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERIDENTITYTOKEN_DICTIONARYFRAGMENT 7673 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANONYMOUSIDENTITYTOKEN 7674 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANONYMOUSIDENTITYTOKEN_DATATYPEVERSION 7675 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANONYMOUSIDENTITYTOKEN_DICTIONARYFRAGMENT 7676 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERNAMEIDENTITYTOKEN 7677 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERNAMEIDENTITYTOKEN_DATATYPEVERSION 7678 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_USERNAMEIDENTITYTOKEN_DICTIONARYFRAGMENT 7679 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_X509IDENTITYTOKEN 7680 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_X509IDENTITYTOKEN_DATATYPEVERSION 7681 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_X509IDENTITYTOKEN_DICTIONARYFRAGMENT 7682 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ISSUEDIDENTITYTOKEN 7683 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ISSUEDIDENTITYTOKEN_DATATYPEVERSION 7684 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ISSUEDIDENTITYTOKEN_DICTIONARYFRAGMENT 7685 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTCONFIGURATION 7686 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTCONFIGURATION_DATATYPEVERSION 7687 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTCONFIGURATION_DICTIONARYFRAGMENT 7688 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BUILDINFO 7692 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BUILDINFO_DATATYPEVERSION 7693 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BUILDINFO_DICTIONARYFRAGMENT 7694 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIGNEDSOFTWARECERTIFICATE 7698 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIGNEDSOFTWARECERTIFICATE_DATATYPEVERSION 7699 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIGNEDSOFTWARECERTIFICATE_DICTIONARYFRAGMENT 7700 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDNODESITEM 7728 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDNODESITEM_DATATYPEVERSION 7729 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDNODESITEM_DICTIONARYFRAGMENT 7730 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDREFERENCESITEM 7731 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDREFERENCESITEM_DATATYPEVERSION 7732 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDREFERENCESITEM_DICTIONARYFRAGMENT 7733 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETENODESITEM 7734 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETENODESITEM_DATATYPEVERSION 7735 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETENODESITEM_DICTIONARYFRAGMENT 7736 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETEREFERENCESITEM 7737 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETEREFERENCESITEM_DATATYPEVERSION 7738 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DELETEREFERENCESITEM_DICTIONARYFRAGMENT 7739 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REGISTEREDSERVER 7782 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REGISTEREDSERVER_DATATYPEVERSION 7783 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REGISTEREDSERVER_DICTIONARYFRAGMENT 7784 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTERELEMENT 7929 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTERELEMENT_DATATYPEVERSION 7930 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTERELEMENT_DICTIONARYFRAGMENT 7931 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTER 7932 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTER_DATATYPEVERSION 7933 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONTENTFILTER_DICTIONARYFRAGMENT 7934 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FILTEROPERAND 7935 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FILTEROPERAND_DATATYPEVERSION 7936 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FILTEROPERAND_DICTIONARYFRAGMENT 7937 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ELEMENTOPERAND 7938 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ELEMENTOPERAND_DATATYPEVERSION 7939 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ELEMENTOPERAND_DICTIONARYFRAGMENT 7940 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_LITERALOPERAND 7941 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_LITERALOPERAND_DATATYPEVERSION 7942 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_LITERALOPERAND_DICTIONARYFRAGMENT 7943 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ATTRIBUTEOPERAND 7944 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ATTRIBUTEOPERAND_DATATYPEVERSION 7945 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ATTRIBUTEOPERAND_DICTIONARYFRAGMENT 7946 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLEATTRIBUTEOPERAND 7947 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLEATTRIBUTEOPERAND_DATATYPEVERSION 7948 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLEATTRIBUTEOPERAND_DICTIONARYFRAGMENT 7949 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENT 8004 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENT_DATATYPEVERSION 8005 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENT_DICTIONARYFRAGMENT 8006 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MONITORINGFILTER 8067 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MONITORINGFILTER_DATATYPEVERSION 8068 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MONITORINGFILTER_DICTIONARYFRAGMENT 8069 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EVENTFILTER 8073 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EVENTFILTER_DATATYPEVERSION 8074 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EVENTFILTER_DICTIONARYFRAGMENT 8075 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AGGREGATECONFIGURATION 8076 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AGGREGATECONFIGURATION_DATATYPEVERSION 8077 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AGGREGATECONFIGURATION_DICTIONARYFRAGMENT 8078 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENTFIELDLIST 8172 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENTFIELDLIST_DATATYPEVERSION 8173 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_HISTORYEVENTFIELDLIST_DICTIONARYFRAGMENT 8174 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REDUNDANTSERVERDATATYPE 8208 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REDUNDANTSERVERDATATYPE_DATATYPEVERSION 8209 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_REDUNDANTSERVERDATATYPE_DICTIONARYFRAGMENT 8210 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE 8211 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_DATATYPEVERSION 8212 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8213 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE 8214 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE_DATATYPEVERSION 8215 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE_DICTIONARYFRAGMENT 8216 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERSTATUSDATATYPE 8217 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERSTATUSDATATYPE_DATATYPEVERSION 8218 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERSTATUSDATATYPE_DICTIONARYFRAGMENT 8219 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONDIAGNOSTICSDATATYPE 8220 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONDIAGNOSTICSDATATYPE_DATATYPEVERSION 8221 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8222 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE 8223 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE_DATATYPEVERSION 8224 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8225 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVICECOUNTERDATATYPE 8226 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVICECOUNTERDATATYPE_DATATYPEVERSION 8227 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVICECOUNTERDATATYPE_DICTIONARYFRAGMENT 8228 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE 8229 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE_DATATYPEVERSION 8230 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8231 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MODELCHANGESTRUCTUREDATATYPE 8232 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MODELCHANGESTRUCTUREDATATYPE_DATATYPEVERSION 8233 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MODELCHANGESTRUCTUREDATATYPE_DICTIONARYFRAGMENT 8234 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE 8235 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE_DATATYPEVERSION 8236 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE_DICTIONARYFRAGMENT 8237 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RANGE 8238 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RANGE_DATATYPEVERSION 8239 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RANGE_DICTIONARYFRAGMENT 8240 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EUINFORMATION 8241 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EUINFORMATION_DATATYPEVERSION 8242 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EUINFORMATION_DICTIONARYFRAGMENT 8243 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANNOTATION 8244 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANNOTATION_DATATYPEVERSION 8245 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ANNOTATION_DICTIONARYFRAGMENT 8246 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTICDATATYPE 8247 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTICDATATYPE_DATATYPEVERSION 8248 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTICDATATYPE_DICTIONARYFRAGMENT 8249 /* Variable */ +#define UA_NS0ID_ENUMVALUETYPE_ENCODING_DEFAULTBINARY 8251 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA 8252 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEVERSION 8253 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NAMESPACEURI 8254 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ARGUMENT 8285 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ARGUMENT_DATATYPEVERSION 8286 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ARGUMENT_DICTIONARYFRAGMENT 8287 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMVALUETYPE 8291 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMVALUETYPE_DATATYPEVERSION 8292 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMVALUETYPE_DICTIONARYFRAGMENT 8293 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STATUSRESULT 8294 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STATUSRESULT_DATATYPEVERSION 8295 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STATUSRESULT_DICTIONARYFRAGMENT 8296 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERTOKENPOLICY 8297 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERTOKENPOLICY_DATATYPEVERSION 8298 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERTOKENPOLICY_DICTIONARYFRAGMENT 8299 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_APPLICATIONDESCRIPTION 8300 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_APPLICATIONDESCRIPTION_DATATYPEVERSION 8301 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_APPLICATIONDESCRIPTION_DICTIONARYFRAGMENT 8302 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTDESCRIPTION 8303 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTDESCRIPTION_DATATYPEVERSION 8304 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTDESCRIPTION_DICTIONARYFRAGMENT 8305 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERIDENTITYTOKEN 8306 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERIDENTITYTOKEN_DATATYPEVERSION 8307 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERIDENTITYTOKEN_DICTIONARYFRAGMENT 8308 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANONYMOUSIDENTITYTOKEN 8309 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANONYMOUSIDENTITYTOKEN_DATATYPEVERSION 8310 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANONYMOUSIDENTITYTOKEN_DICTIONARYFRAGMENT 8311 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERNAMEIDENTITYTOKEN 8312 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERNAMEIDENTITYTOKEN_DATATYPEVERSION 8313 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_USERNAMEIDENTITYTOKEN_DICTIONARYFRAGMENT 8314 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_X509IDENTITYTOKEN 8315 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_X509IDENTITYTOKEN_DATATYPEVERSION 8316 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_X509IDENTITYTOKEN_DICTIONARYFRAGMENT 8317 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ISSUEDIDENTITYTOKEN 8318 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ISSUEDIDENTITYTOKEN_DATATYPEVERSION 8319 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ISSUEDIDENTITYTOKEN_DICTIONARYFRAGMENT 8320 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTCONFIGURATION 8321 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTCONFIGURATION_DATATYPEVERSION 8322 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTCONFIGURATION_DICTIONARYFRAGMENT 8323 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BUILDINFO 8327 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BUILDINFO_DATATYPEVERSION 8328 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BUILDINFO_DICTIONARYFRAGMENT 8329 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIGNEDSOFTWARECERTIFICATE 8333 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIGNEDSOFTWARECERTIFICATE_DATATYPEVERSION 8334 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIGNEDSOFTWARECERTIFICATE_DICTIONARYFRAGMENT 8335 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDNODESITEM 8363 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDNODESITEM_DATATYPEVERSION 8364 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDNODESITEM_DICTIONARYFRAGMENT 8365 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDREFERENCESITEM 8366 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDREFERENCESITEM_DATATYPEVERSION 8367 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDREFERENCESITEM_DICTIONARYFRAGMENT 8368 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETENODESITEM 8369 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETENODESITEM_DATATYPEVERSION 8370 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETENODESITEM_DICTIONARYFRAGMENT 8371 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETEREFERENCESITEM 8372 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETEREFERENCESITEM_DATATYPEVERSION 8373 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DELETEREFERENCESITEM_DICTIONARYFRAGMENT 8374 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REGISTEREDSERVER 8417 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REGISTEREDSERVER_DATATYPEVERSION 8418 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REGISTEREDSERVER_DICTIONARYFRAGMENT 8419 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTERELEMENT 8564 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTERELEMENT_DATATYPEVERSION 8565 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTERELEMENT_DICTIONARYFRAGMENT 8566 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTER 8567 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTER_DATATYPEVERSION 8568 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONTENTFILTER_DICTIONARYFRAGMENT 8569 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FILTEROPERAND 8570 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FILTEROPERAND_DATATYPEVERSION 8571 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FILTEROPERAND_DICTIONARYFRAGMENT 8572 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ELEMENTOPERAND 8573 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ELEMENTOPERAND_DATATYPEVERSION 8574 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ELEMENTOPERAND_DICTIONARYFRAGMENT 8575 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_LITERALOPERAND 8576 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_LITERALOPERAND_DATATYPEVERSION 8577 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_LITERALOPERAND_DICTIONARYFRAGMENT 8578 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ATTRIBUTEOPERAND 8579 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ATTRIBUTEOPERAND_DATATYPEVERSION 8580 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ATTRIBUTEOPERAND_DICTIONARYFRAGMENT 8581 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLEATTRIBUTEOPERAND 8582 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLEATTRIBUTEOPERAND_DATATYPEVERSION 8583 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLEATTRIBUTEOPERAND_DICTIONARYFRAGMENT 8584 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENT 8639 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENT_DATATYPEVERSION 8640 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENT_DICTIONARYFRAGMENT 8641 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MONITORINGFILTER 8702 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MONITORINGFILTER_DATATYPEVERSION 8703 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MONITORINGFILTER_DICTIONARYFRAGMENT 8704 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EVENTFILTER 8708 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EVENTFILTER_DATATYPEVERSION 8709 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EVENTFILTER_DICTIONARYFRAGMENT 8710 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AGGREGATECONFIGURATION 8711 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AGGREGATECONFIGURATION_DATATYPEVERSION 8712 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AGGREGATECONFIGURATION_DICTIONARYFRAGMENT 8713 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENTFIELDLIST 8807 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENTFIELDLIST_DATATYPEVERSION 8808 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_HISTORYEVENTFIELDLIST_DICTIONARYFRAGMENT 8809 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REDUNDANTSERVERDATATYPE 8843 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REDUNDANTSERVERDATATYPE_DATATYPEVERSION 8844 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_REDUNDANTSERVERDATATYPE_DICTIONARYFRAGMENT 8845 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE 8846 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_DATATYPEVERSION 8847 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8848 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE 8849 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE_DATATYPEVERSION 8850 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERDIAGNOSTICSSUMMARYDATATYPE_DICTIONARYFRAGMENT 8851 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERSTATUSDATATYPE 8852 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERSTATUSDATATYPE_DATATYPEVERSION 8853 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERSTATUSDATATYPE_DICTIONARYFRAGMENT 8854 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONDIAGNOSTICSDATATYPE 8855 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONDIAGNOSTICSDATATYPE_DATATYPEVERSION 8856 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8857 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE 8858 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE_DATATYPEVERSION 8859 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SESSIONSECURITYDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8860 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVICECOUNTERDATATYPE 8861 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVICECOUNTERDATATYPE_DATATYPEVERSION 8862 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVICECOUNTERDATATYPE_DICTIONARYFRAGMENT 8863 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE 8864 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE_DATATYPEVERSION 8865 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIPTIONDIAGNOSTICSDATATYPE_DICTIONARYFRAGMENT 8866 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MODELCHANGESTRUCTUREDATATYPE 8867 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MODELCHANGESTRUCTUREDATATYPE_DATATYPEVERSION 8868 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MODELCHANGESTRUCTUREDATATYPE_DICTIONARYFRAGMENT 8869 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE 8870 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE_DATATYPEVERSION 8871 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SEMANTICCHANGESTRUCTUREDATATYPE_DICTIONARYFRAGMENT 8872 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RANGE 8873 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RANGE_DATATYPEVERSION 8874 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RANGE_DICTIONARYFRAGMENT 8875 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EUINFORMATION 8876 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EUINFORMATION_DATATYPEVERSION 8877 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EUINFORMATION_DICTIONARYFRAGMENT 8878 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANNOTATION 8879 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANNOTATION_DATATYPEVERSION 8880 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ANNOTATION_DICTIONARYFRAGMENT 8881 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTICDATATYPE 8882 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTICDATATYPE_DATATYPEVERSION 8883 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTICDATATYPE_DICTIONARYFRAGMENT 8884 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MAXLIFETIMECOUNT 8888 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_LATEPUBLISHREQUESTCOUNT 8889 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_CURRENTKEEPALIVECOUNT 8890 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_CURRENTLIFETIMECOUNT 8891 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_UNACKNOWLEDGEDMESSAGECOUNT 8892 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_DISCARDEDMESSAGECOUNT 8893 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MONITOREDITEMCOUNT 8894 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_DISABLEDMONITOREDITEMCOUNT 8895 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_MONITORINGQUEUEOVERFLOWCOUNT 8896 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_NEXTSEQUENCENUMBER 8897 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_TOTALREQUESTCOUNT 8898 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_TOTALREQUESTCOUNT 8900 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSTYPE_EVENTQUEUEOVERFLOWCOUNT 8902 /* Variable */ +#define UA_NS0ID_TIMEZONEDATATYPE 8912 /* DataType */ +#define UA_NS0ID_TIMEZONEDATATYPE_ENCODING_DEFAULTXML 8913 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TIMEZONEDATATYPE 8914 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TIMEZONEDATATYPE_DATATYPEVERSION 8915 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TIMEZONEDATATYPE_DICTIONARYFRAGMENT 8916 /* Variable */ +#define UA_NS0ID_TIMEZONEDATATYPE_ENCODING_DEFAULTBINARY 8917 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TIMEZONEDATATYPE 8918 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TIMEZONEDATATYPE_DATATYPEVERSION 8919 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TIMEZONEDATATYPE_DICTIONARYFRAGMENT 8920 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE 8927 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_EVENTID 8928 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_EVENTTYPE 8929 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_SOURCENODE 8930 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_SOURCENAME 8931 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_TIME 8932 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_RECEIVETIME 8933 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_LOCALTIME 8934 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_MESSAGE 8935 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_SEVERITY 8936 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_ACTIONTIMESTAMP 8937 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_STATUS 8938 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_SERVERID 8939 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_CLIENTAUDITENTRYID 8940 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_CLIENTUSERID 8941 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_METHODID 8942 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_INPUTARGUMENTS 8943 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE 8944 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_EVENTID 8945 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_EVENTTYPE 8946 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_SOURCENODE 8947 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_SOURCENAME 8948 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_TIME 8949 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_RECEIVETIME 8950 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_LOCALTIME 8951 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_MESSAGE 8952 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_SEVERITY 8953 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_ACTIONTIMESTAMP 8954 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_STATUS 8955 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_SERVERID 8956 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_CLIENTAUDITENTRYID 8957 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_CLIENTUSERID 8958 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_METHODID 8959 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_INPUTARGUMENTS 8960 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE 8961 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_EVENTID 8962 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_EVENTTYPE 8963 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_SOURCENODE 8964 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_SOURCENAME 8965 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_TIME 8966 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_RECEIVETIME 8967 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_LOCALTIME 8968 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_MESSAGE 8969 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_SEVERITY 8970 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_ACTIONTIMESTAMP 8971 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_STATUS 8972 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_SERVERID 8973 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_CLIENTAUDITENTRYID 8974 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_CLIENTUSERID 8975 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_METHODID 8976 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_INPUTARGUMENTS 8977 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE 8995 /* VariableType */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_ID 8996 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_NAME 8997 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_NUMBER 8998 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_EFFECTIVEDISPLAYNAME 8999 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_TRANSITIONTIME 9000 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_EFFECTIVETRANSITIONTIME 9001 /* Variable */ +#define UA_NS0ID_CONDITIONVARIABLETYPE 9002 /* VariableType */ +#define UA_NS0ID_CONDITIONVARIABLETYPE_SOURCETIMESTAMP 9003 /* Variable */ +#define UA_NS0ID_HASTRUESUBSTATE 9004 /* ReferenceType */ +#define UA_NS0ID_HASFALSESUBSTATE 9005 /* ReferenceType */ +#define UA_NS0ID_HASCONDITION 9006 /* ReferenceType */ +#define UA_NS0ID_CONDITIONREFRESHMETHODTYPE 9007 /* Method */ +#define UA_NS0ID_CONDITIONREFRESHMETHODTYPE_INPUTARGUMENTS 9008 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONNAME 9009 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_BRANCHID 9010 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE 9011 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_ID 9012 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_NAME 9013 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_NUMBER 9014 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9015 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_TRANSITIONTIME 9016 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9017 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_TRUESTATE 9018 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLEDSTATE_FALSESTATE 9019 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_QUALITY 9020 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_QUALITY_SOURCETIMESTAMP 9021 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_LASTSEVERITY 9022 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_LASTSEVERITY_SOURCETIMESTAMP 9023 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_COMMENT 9024 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_COMMENT_SOURCETIMESTAMP 9025 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CLIENTUSERID 9026 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_ENABLE 9027 /* Method */ +#define UA_NS0ID_CONDITIONTYPE_DISABLE 9028 /* Method */ +#define UA_NS0ID_CONDITIONTYPE_ADDCOMMENT 9029 /* Method */ +#define UA_NS0ID_CONDITIONTYPE_ADDCOMMENT_INPUTARGUMENTS 9030 /* Variable */ +#define UA_NS0ID_DIALOGRESPONSEMETHODTYPE 9031 /* Method */ +#define UA_NS0ID_DIALOGRESPONSEMETHODTYPE_INPUTARGUMENTS 9032 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONNAME 9033 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_BRANCHID 9034 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE 9035 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_ID 9036 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_NAME 9037 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_NUMBER 9038 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9039 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_TRANSITIONTIME 9040 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9041 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_TRUESTATE 9042 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLEDSTATE_FALSESTATE 9043 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_QUALITY 9044 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_QUALITY_SOURCETIMESTAMP 9045 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_LASTSEVERITY 9046 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_LASTSEVERITY_SOURCETIMESTAMP 9047 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_COMMENT 9048 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_COMMENT_SOURCETIMESTAMP 9049 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CLIENTUSERID 9050 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ENABLE 9051 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DISABLE 9052 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ADDCOMMENT 9053 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_ADDCOMMENT_INPUTARGUMENTS 9054 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE 9055 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_ID 9056 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_NAME 9057 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_NUMBER 9058 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_EFFECTIVEDISPLAYNAME 9059 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_TRANSITIONTIME 9060 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_EFFECTIVETRANSITIONTIME 9061 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_TRUESTATE 9062 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DIALOGSTATE_FALSESTATE 9063 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_RESPONSEOPTIONSET 9064 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_DEFAULTRESPONSE 9065 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_OKRESPONSE 9066 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CANCELRESPONSE 9067 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_LASTRESPONSE 9068 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_RESPOND 9069 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_RESPOND_INPUTARGUMENTS 9070 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONNAME 9071 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_BRANCHID 9072 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE 9073 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_ID 9074 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_NAME 9075 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_NUMBER 9076 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9077 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_TRANSITIONTIME 9078 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9079 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_TRUESTATE 9080 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLEDSTATE_FALSESTATE 9081 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_QUALITY 9082 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_QUALITY_SOURCETIMESTAMP 9083 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_LASTSEVERITY 9084 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_LASTSEVERITY_SOURCETIMESTAMP 9085 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_COMMENT 9086 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_COMMENT_SOURCETIMESTAMP 9087 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CLIENTUSERID 9088 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ENABLE 9089 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_DISABLE 9090 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ADDCOMMENT 9091 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ADDCOMMENT_INPUTARGUMENTS 9092 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE 9093 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_ID 9094 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_NAME 9095 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_NUMBER 9096 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9097 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_TRANSITIONTIME 9098 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9099 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_TRUESTATE 9100 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKEDSTATE_FALSESTATE 9101 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE 9102 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_ID 9103 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_NAME 9104 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_NUMBER 9105 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9106 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9107 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9108 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_TRUESTATE 9109 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRMEDSTATE_FALSESTATE 9110 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKNOWLEDGE 9111 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9112 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRM 9113 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONFIRM_INPUTARGUMENTS 9114 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVETIME 9115 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONNAME 9116 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_BRANCHID 9117 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE 9118 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_ID 9119 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_NAME 9120 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_NUMBER 9121 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9122 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_TRANSITIONTIME 9123 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9124 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_TRUESTATE 9125 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLEDSTATE_FALSESTATE 9126 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_QUALITY 9127 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_QUALITY_SOURCETIMESTAMP 9128 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LASTSEVERITY 9129 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LASTSEVERITY_SOURCETIMESTAMP 9130 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_COMMENT 9131 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_COMMENT_SOURCETIMESTAMP 9132 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CLIENTUSERID 9133 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ENABLE 9134 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_DISABLE 9135 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ADDCOMMENT 9136 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ADDCOMMENT_INPUTARGUMENTS 9137 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE 9138 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_ID 9139 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_NAME 9140 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_NUMBER 9141 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9142 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_TRANSITIONTIME 9143 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9144 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_TRUESTATE 9145 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKEDSTATE_FALSESTATE 9146 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE 9147 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_ID 9148 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_NAME 9149 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_NUMBER 9150 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9151 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9152 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9153 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_TRUESTATE 9154 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRMEDSTATE_FALSESTATE 9155 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKNOWLEDGE 9156 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9157 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRM 9158 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONFIRM_INPUTARGUMENTS 9159 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE 9160 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_ID 9161 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_NAME 9162 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_NUMBER 9163 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9164 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_TRANSITIONTIME 9165 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9166 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_TRUESTATE 9167 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ACTIVESTATE_FALSESTATE 9168 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE 9169 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_ID 9170 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_NAME 9171 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_NUMBER 9172 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9173 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9174 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9175 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_TRUESTATE 9176 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDSTATE_FALSESTATE 9177 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE 9178 /* Object */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_CURRENTSTATE 9179 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9180 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9181 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9182 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9183 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION 9184 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9185 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9186 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9187 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9188 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_UNSHELVETIME 9189 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_UNSHELVE 9211 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_ONESHOTSHELVE 9212 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_TIMEDSHELVE 9213 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9214 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESSEDORSHELVED 9215 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_MAXTIMESHELVED 9216 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONNAME 9217 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_BRANCHID 9218 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE 9219 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_ID 9220 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_NAME 9221 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_NUMBER 9222 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9223 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9224 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9225 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_TRUESTATE 9226 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLEDSTATE_FALSESTATE 9227 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_QUALITY 9228 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_QUALITY_SOURCETIMESTAMP 9229 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LASTSEVERITY 9230 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9231 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_COMMENT 9232 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_COMMENT_SOURCETIMESTAMP 9233 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CLIENTUSERID 9234 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ENABLE 9235 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_DISABLE 9236 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_ADDCOMMENT 9237 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9238 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE 9239 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_ID 9240 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_NAME 9241 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_NUMBER 9242 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9243 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9244 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9245 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_TRUESTATE 9246 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKEDSTATE_FALSESTATE 9247 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE 9248 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_ID 9249 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_NAME 9250 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_NUMBER 9251 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9252 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9253 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9254 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9255 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9256 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACKNOWLEDGE 9257 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9258 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRM 9259 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_CONFIRM_INPUTARGUMENTS 9260 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE 9261 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_ID 9262 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_NAME 9263 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_NUMBER 9264 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9265 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9266 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9267 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_TRUESTATE 9268 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ACTIVESTATE_FALSESTATE 9269 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE 9270 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_ID 9271 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_NAME 9272 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_NUMBER 9273 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9274 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9275 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9276 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9277 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9278 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE 9279 /* Object */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9280 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9281 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9282 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9283 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9284 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9285 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9286 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9287 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9288 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9289 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9290 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_UNSHELVE 9312 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 9313 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 9314 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9315 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESSEDORSHELVED 9316 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_MAXTIMESHELVED 9317 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE 9318 /* ObjectType */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_CURRENTSTATE 9319 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_CURRENTSTATE_ID 9320 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_CURRENTSTATE_NAME 9321 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_CURRENTSTATE_NUMBER 9322 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9323 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION 9324 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION_ID 9325 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION_NAME 9326 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION_NUMBER 9327 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 9328 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHHIGH 9329 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHHIGH_STATENUMBER 9330 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGH 9331 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGH_STATENUMBER 9332 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOW 9333 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOW_STATENUMBER 9334 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWLOW 9335 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWLOW_STATENUMBER 9336 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWLOWTOLOW 9337 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWTOLOWLOW 9338 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHHIGHTOHIGH 9339 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHTOHIGHHIGH 9340 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE 9341 /* ObjectType */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_EVENTID 9342 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_EVENTTYPE 9343 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SOURCENODE 9344 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SOURCENAME 9345 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_TIME 9346 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_RECEIVETIME 9347 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LOCALTIME 9348 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_MESSAGE 9349 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SEVERITY 9350 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONNAME 9351 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_BRANCHID 9352 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_RETAIN 9353 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE 9354 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_ID 9355 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_NAME 9356 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_NUMBER 9357 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9358 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9359 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9360 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_TRUESTATE 9361 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_FALSESTATE 9362 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_QUALITY 9363 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_QUALITY_SOURCETIMESTAMP 9364 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LASTSEVERITY 9365 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9366 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_COMMENT 9367 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_COMMENT_SOURCETIMESTAMP 9368 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CLIENTUSERID 9369 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ENABLE 9370 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_DISABLE 9371 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ADDCOMMENT 9372 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9373 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH 9374 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 9375 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE 9376 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_ID 9377 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_NAME 9378 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_NUMBER 9379 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9380 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9381 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9382 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_TRUESTATE 9383 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKEDSTATE_FALSESTATE 9384 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE 9385 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_ID 9386 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_NAME 9387 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_NUMBER 9388 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9389 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9390 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9391 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9392 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9393 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKNOWLEDGE 9394 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9395 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRM 9396 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONFIRM_INPUTARGUMENTS 9397 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE 9398 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_ID 9399 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_NAME 9400 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_NUMBER 9401 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9402 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9403 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9404 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_TRUESTATE 9405 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ACTIVESTATE_FALSESTATE 9406 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE 9407 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_ID 9408 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_NAME 9409 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_NUMBER 9410 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9411 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9412 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9413 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9414 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9415 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE 9416 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9417 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9418 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9419 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9420 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9421 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9422 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9423 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9424 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9425 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9426 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9427 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_UNSHELVE 9449 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 9450 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 9451 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9452 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESSEDORSHELVED 9453 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_MAXTIMESHELVED 9454 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE 9455 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_CURRENTSTATE 9456 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_CURRENTSTATE_ID 9457 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_CURRENTSTATE_NAME 9458 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_CURRENTSTATE_NUMBER 9459 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9460 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION 9461 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION_ID 9462 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION_NAME 9463 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION_NUMBER 9464 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION_TRANSITIONTIME 9465 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_HIGHHIGHLIMIT 9478 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_HIGHLIMIT 9479 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LOWLIMIT 9480 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LOWLOWLIMIT 9481 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE 9482 /* ObjectType */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_EVENTID 9483 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_EVENTTYPE 9484 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SOURCENODE 9485 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SOURCENAME 9486 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_TIME 9487 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_RECEIVETIME 9488 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LOCALTIME 9489 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_MESSAGE 9490 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SEVERITY 9491 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONNAME 9492 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_BRANCHID 9493 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_RETAIN 9494 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE 9495 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_ID 9496 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_NAME 9497 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_NUMBER 9498 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9499 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9500 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9501 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_TRUESTATE 9502 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_FALSESTATE 9503 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_QUALITY 9504 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_QUALITY_SOURCETIMESTAMP 9505 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LASTSEVERITY 9506 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9507 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_COMMENT 9508 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_COMMENT_SOURCETIMESTAMP 9509 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CLIENTUSERID 9510 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ENABLE 9511 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_DISABLE 9512 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ADDCOMMENT 9513 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9514 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH 9515 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 9516 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE 9517 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_ID 9518 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_NAME 9519 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_NUMBER 9520 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9521 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9522 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9523 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_TRUESTATE 9524 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKEDSTATE_FALSESTATE 9525 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE 9526 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_ID 9527 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_NAME 9528 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_NUMBER 9529 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9530 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9531 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9532 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9533 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9534 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKNOWLEDGE 9535 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9536 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRM 9537 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONFIRM_INPUTARGUMENTS 9538 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE 9539 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_ID 9540 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_NAME 9541 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_NUMBER 9542 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9543 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9544 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9545 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_TRUESTATE 9546 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ACTIVESTATE_FALSESTATE 9547 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE 9548 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_ID 9549 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_NAME 9550 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_NUMBER 9551 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9552 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9553 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9554 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9555 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9556 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE 9557 /* Object */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9558 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9559 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9560 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9561 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9562 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9563 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9564 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9565 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9566 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9567 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9568 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_UNSHELVE 9590 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 9591 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 9592 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9593 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESSEDORSHELVED 9594 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_MAXTIMESHELVED 9595 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE 9596 /* Object */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_CURRENTSTATE 9597 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_CURRENTSTATE_ID 9598 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_CURRENTSTATE_NAME 9599 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_CURRENTSTATE_NUMBER 9600 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9601 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION 9602 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION_ID 9603 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION_NAME 9604 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION_NUMBER 9605 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION_TRANSITIONTIME 9606 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_HIGHHIGHLIMIT 9619 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_HIGHLIMIT 9620 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LOWLIMIT 9621 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LOWLOWLIMIT 9622 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE 9623 /* ObjectType */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_EVENTID 9624 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_EVENTTYPE 9625 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SOURCENODE 9626 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SOURCENAME 9627 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_TIME 9628 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_RECEIVETIME 9629 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LOCALTIME 9630 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_MESSAGE 9631 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SEVERITY 9632 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONNAME 9633 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_BRANCHID 9634 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_RETAIN 9635 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE 9636 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_ID 9637 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_NAME 9638 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_NUMBER 9639 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9640 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9641 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9642 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_TRUESTATE 9643 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_FALSESTATE 9644 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_QUALITY 9645 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_QUALITY_SOURCETIMESTAMP 9646 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LASTSEVERITY 9647 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9648 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_COMMENT 9649 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_COMMENT_SOURCETIMESTAMP 9650 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CLIENTUSERID 9651 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENABLE 9652 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_DISABLE 9653 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ADDCOMMENT 9654 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9655 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH 9656 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 9657 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE 9658 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_ID 9659 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_NAME 9660 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_NUMBER 9661 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9662 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9663 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9664 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_TRUESTATE 9665 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_FALSESTATE 9666 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE 9667 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_ID 9668 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_NAME 9669 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_NUMBER 9670 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9671 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9672 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9673 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9674 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9675 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKNOWLEDGE 9676 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9677 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRM 9678 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRM_INPUTARGUMENTS 9679 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE 9680 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_ID 9681 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_NAME 9682 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_NUMBER 9683 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9684 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9685 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9686 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_TRUESTATE 9687 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_FALSESTATE 9688 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE 9689 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_ID 9690 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_NAME 9691 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_NUMBER 9692 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9693 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9694 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9695 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9696 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9697 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE 9698 /* Object */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9699 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9700 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9701 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9702 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9703 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9704 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9705 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9706 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9707 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9708 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9709 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_UNSHELVE 9731 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 9732 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 9733 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9734 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDORSHELVED 9735 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_MAXTIMESHELVED 9736 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE 9737 /* Object */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_CURRENTSTATE 9738 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_CURRENTSTATE_ID 9739 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_CURRENTSTATE_NAME 9740 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_CURRENTSTATE_NUMBER 9741 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9742 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION 9743 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION_ID 9744 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION_NAME 9745 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION_NUMBER 9746 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION_TRANSITIONTIME 9747 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHLIMIT 9760 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_HIGHLIMIT 9761 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LOWLIMIT 9762 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWLIMIT 9763 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE 9764 /* ObjectType */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_EVENTID 9765 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_EVENTTYPE 9766 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SOURCENODE 9767 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SOURCENAME 9768 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_TIME 9769 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_RECEIVETIME 9770 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LOCALTIME 9771 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_MESSAGE 9772 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SEVERITY 9773 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONNAME 9774 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BRANCHID 9775 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_RETAIN 9776 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE 9777 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_ID 9778 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_NAME 9779 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_NUMBER 9780 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9781 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9782 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9783 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_TRUESTATE 9784 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_FALSESTATE 9785 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_QUALITY 9786 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_QUALITY_SOURCETIMESTAMP 9787 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LASTSEVERITY 9788 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9789 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_COMMENT 9790 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_COMMENT_SOURCETIMESTAMP 9791 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CLIENTUSERID 9792 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ENABLE 9793 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_DISABLE 9794 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ADDCOMMENT 9795 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9796 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH 9797 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 9798 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE 9799 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_ID 9800 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_NAME 9801 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_NUMBER 9802 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9803 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9804 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9805 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_TRUESTATE 9806 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_FALSESTATE 9807 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE 9808 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_ID 9809 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_NAME 9810 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_NUMBER 9811 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9812 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9813 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9814 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9815 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9816 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKNOWLEDGE 9817 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9818 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRM 9819 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONFIRM_INPUTARGUMENTS 9820 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE 9821 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_ID 9822 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_NAME 9823 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_NUMBER 9824 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9825 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9826 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9827 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_TRUESTATE 9828 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_FALSESTATE 9829 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE 9830 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_ID 9831 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_NAME 9832 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_NUMBER 9833 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9834 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9835 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9836 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9837 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9838 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE 9839 /* Object */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9840 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9841 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9842 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9843 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9844 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9845 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9846 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9847 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9848 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9849 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9850 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_UNSHELVE 9872 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 9873 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 9874 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 9875 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDORSHELVED 9876 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_MAXTIMESHELVED 9877 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE 9878 /* Object */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_CURRENTSTATE 9879 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_CURRENTSTATE_ID 9880 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_CURRENTSTATE_NAME 9881 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_CURRENTSTATE_NUMBER 9882 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9883 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION 9884 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION_ID 9885 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION_NAME 9886 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION_NUMBER 9887 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION_TRANSITIONTIME 9888 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHLIMIT 9901 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_HIGHLIMIT 9902 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LOWLIMIT 9903 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LOWLOWLIMIT 9904 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SETPOINTNODE 9905 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE 9906 /* ObjectType */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_EVENTID 9907 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_EVENTTYPE 9908 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SOURCENODE 9909 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SOURCENAME 9910 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_TIME 9911 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_RECEIVETIME 9912 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOCALTIME 9913 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_MESSAGE 9914 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SEVERITY 9915 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONNAME 9916 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_BRANCHID 9917 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_RETAIN 9918 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE 9919 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_ID 9920 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_NAME 9921 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_NUMBER 9922 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 9923 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 9924 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 9925 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_TRUESTATE 9926 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLEDSTATE_FALSESTATE 9927 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_QUALITY 9928 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_QUALITY_SOURCETIMESTAMP 9929 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LASTSEVERITY 9930 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 9931 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_COMMENT 9932 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_COMMENT_SOURCETIMESTAMP 9933 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CLIENTUSERID 9934 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ENABLE 9935 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_DISABLE 9936 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ADDCOMMENT 9937 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 9938 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH 9939 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 9940 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE 9941 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_ID 9942 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_NAME 9943 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_NUMBER 9944 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 9945 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_TRANSITIONTIME 9946 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 9947 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_TRUESTATE 9948 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKEDSTATE_FALSESTATE 9949 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE 9950 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_ID 9951 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_NAME 9952 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_NUMBER 9953 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 9954 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 9955 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 9956 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_TRUESTATE 9957 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRMEDSTATE_FALSESTATE 9958 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKNOWLEDGE 9959 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 9960 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRM 9961 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONFIRM_INPUTARGUMENTS 9962 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE 9963 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_ID 9964 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_NAME 9965 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_NUMBER 9966 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 9967 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_TRANSITIONTIME 9968 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 9969 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_TRUESTATE 9970 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ACTIVESTATE_FALSESTATE 9971 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE 9972 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_ID 9973 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_NAME 9974 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_NUMBER 9975 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 9976 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 9977 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 9978 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 9979 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 9980 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE 9981 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE 9982 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 9983 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 9984 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 9985 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 9986 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION 9987 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 9988 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 9989 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 9990 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 9991 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_UNSHELVETIME 9992 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_UNSHELVE 10014 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10015 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10016 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10017 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESSEDORSHELVED 10018 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_MAXTIMESHELVED 10019 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE 10020 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_ID 10021 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_NAME 10022 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_NUMBER 10023 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_EFFECTIVEDISPLAYNAME 10024 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_TRANSITIONTIME 10025 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_EFFECTIVETRANSITIONTIME 10026 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_TRUESTATE 10027 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHSTATE_FALSESTATE 10028 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE 10029 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_ID 10030 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_NAME 10031 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_NUMBER 10032 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_EFFECTIVEDISPLAYNAME 10033 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_TRANSITIONTIME 10034 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_EFFECTIVETRANSITIONTIME 10035 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_TRUESTATE 10036 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHSTATE_FALSESTATE 10037 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE 10038 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_ID 10039 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_NAME 10040 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_NUMBER 10041 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_EFFECTIVEDISPLAYNAME 10042 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_TRANSITIONTIME 10043 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_EFFECTIVETRANSITIONTIME 10044 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_TRUESTATE 10045 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWSTATE_FALSESTATE 10046 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE 10047 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_ID 10048 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_NAME 10049 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_NUMBER 10050 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_EFFECTIVEDISPLAYNAME 10051 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_TRANSITIONTIME 10052 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_EFFECTIVETRANSITIONTIME 10053 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_TRUESTATE 10054 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWSTATE_FALSESTATE 10055 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHHIGHLIMIT 10056 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_HIGHLIMIT 10057 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLIMIT 10058 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LOWLOWLIMIT 10059 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE 10060 /* ObjectType */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_EVENTID 10061 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_EVENTTYPE 10062 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SOURCENODE 10063 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SOURCENAME 10064 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_TIME 10065 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_RECEIVETIME 10066 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOCALTIME 10067 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_MESSAGE 10068 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SEVERITY 10069 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONNAME 10070 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_BRANCHID 10071 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_RETAIN 10072 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE 10073 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_ID 10074 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_NAME 10075 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_NUMBER 10076 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10077 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10078 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10079 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_TRUESTATE 10080 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLEDSTATE_FALSESTATE 10081 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_QUALITY 10082 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_QUALITY_SOURCETIMESTAMP 10083 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LASTSEVERITY 10084 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10085 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_COMMENT 10086 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_COMMENT_SOURCETIMESTAMP 10087 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CLIENTUSERID 10088 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ENABLE 10089 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_DISABLE 10090 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ADDCOMMENT 10091 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10092 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH 10093 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10094 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE 10095 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_ID 10096 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_NAME 10097 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_NUMBER 10098 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10099 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10100 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10101 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_TRUESTATE 10102 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKEDSTATE_FALSESTATE 10103 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE 10104 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_ID 10105 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_NAME 10106 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_NUMBER 10107 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10108 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10109 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10110 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10111 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10112 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKNOWLEDGE 10113 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10114 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRM 10115 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONFIRM_INPUTARGUMENTS 10116 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE 10117 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_ID 10118 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_NAME 10119 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_NUMBER 10120 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10121 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10122 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10123 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_TRUESTATE 10124 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ACTIVESTATE_FALSESTATE 10125 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE 10126 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_ID 10127 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_NAME 10128 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_NUMBER 10129 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10130 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10131 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10132 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10133 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10134 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE 10135 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10136 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10137 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10138 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10139 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10140 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10141 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10142 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10143 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10144 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10145 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10146 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_UNSHELVE 10168 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10169 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10170 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10171 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESSEDORSHELVED 10172 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_MAXTIMESHELVED 10173 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE 10174 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_ID 10175 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_NAME 10176 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_NUMBER 10177 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_EFFECTIVEDISPLAYNAME 10178 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_TRANSITIONTIME 10179 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_EFFECTIVETRANSITIONTIME 10180 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_TRUESTATE 10181 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHSTATE_FALSESTATE 10182 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE 10183 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_ID 10184 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_NAME 10185 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_NUMBER 10186 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_EFFECTIVEDISPLAYNAME 10187 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_TRANSITIONTIME 10188 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_EFFECTIVETRANSITIONTIME 10189 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_TRUESTATE 10190 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHSTATE_FALSESTATE 10191 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE 10192 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_ID 10193 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_NAME 10194 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_NUMBER 10195 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_EFFECTIVEDISPLAYNAME 10196 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_TRANSITIONTIME 10197 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_EFFECTIVETRANSITIONTIME 10198 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_TRUESTATE 10199 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWSTATE_FALSESTATE 10200 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE 10201 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_ID 10202 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_NAME 10203 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_NUMBER 10204 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_EFFECTIVEDISPLAYNAME 10205 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_TRANSITIONTIME 10206 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_EFFECTIVETRANSITIONTIME 10207 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_TRUESTATE 10208 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWSTATE_FALSESTATE 10209 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHHIGHLIMIT 10210 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_HIGHLIMIT 10211 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLIMIT 10212 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LOWLOWLIMIT 10213 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE 10214 /* ObjectType */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_EVENTID 10215 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_EVENTTYPE 10216 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SOURCENODE 10217 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SOURCENAME 10218 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_TIME 10219 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_RECEIVETIME 10220 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOCALTIME 10221 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_MESSAGE 10222 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SEVERITY 10223 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONNAME 10224 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_BRANCHID 10225 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_RETAIN 10226 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE 10227 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_ID 10228 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_NAME 10229 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_NUMBER 10230 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10231 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10232 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10233 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_TRUESTATE 10234 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLEDSTATE_FALSESTATE 10235 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_QUALITY 10236 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_QUALITY_SOURCETIMESTAMP 10237 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LASTSEVERITY 10238 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10239 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_COMMENT 10240 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_COMMENT_SOURCETIMESTAMP 10241 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CLIENTUSERID 10242 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENABLE 10243 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_DISABLE 10244 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ADDCOMMENT 10245 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10246 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH 10247 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10248 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE 10249 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_ID 10250 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_NAME 10251 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_NUMBER 10252 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10253 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10254 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10255 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_TRUESTATE 10256 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKEDSTATE_FALSESTATE 10257 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE 10258 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_ID 10259 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_NAME 10260 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_NUMBER 10261 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10262 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10263 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10264 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10265 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10266 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKNOWLEDGE 10267 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10268 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRM 10269 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONFIRM_INPUTARGUMENTS 10270 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE 10271 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_ID 10272 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_NAME 10273 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_NUMBER 10274 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10275 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10276 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10277 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_TRUESTATE 10278 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ACTIVESTATE_FALSESTATE 10279 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE 10280 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_ID 10281 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_NAME 10282 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_NUMBER 10283 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10284 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10285 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10286 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10287 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10288 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE 10289 /* Object */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10290 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10291 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10292 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10293 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10294 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10295 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10296 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10297 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10298 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10299 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10300 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_UNSHELVE 10322 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10323 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10324 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10325 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESSEDORSHELVED 10326 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_MAXTIMESHELVED 10327 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE 10328 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_ID 10329 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_NAME 10330 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_NUMBER 10331 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_EFFECTIVEDISPLAYNAME 10332 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_TRANSITIONTIME 10333 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_EFFECTIVETRANSITIONTIME 10334 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_TRUESTATE 10335 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHSTATE_FALSESTATE 10336 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE 10337 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_ID 10338 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_NAME 10339 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_NUMBER 10340 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_EFFECTIVEDISPLAYNAME 10341 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_TRANSITIONTIME 10342 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_EFFECTIVETRANSITIONTIME 10343 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_TRUESTATE 10344 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHSTATE_FALSESTATE 10345 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE 10346 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_ID 10347 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_NAME 10348 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_NUMBER 10349 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_EFFECTIVEDISPLAYNAME 10350 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_TRANSITIONTIME 10351 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_EFFECTIVETRANSITIONTIME 10352 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_TRUESTATE 10353 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWSTATE_FALSESTATE 10354 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE 10355 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_ID 10356 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_NAME 10357 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_NUMBER 10358 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_EFFECTIVEDISPLAYNAME 10359 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_TRANSITIONTIME 10360 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_EFFECTIVETRANSITIONTIME 10361 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_TRUESTATE 10362 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWSTATE_FALSESTATE 10363 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHHIGHLIMIT 10364 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_HIGHLIMIT 10365 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLIMIT 10366 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LOWLOWLIMIT 10367 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE 10368 /* ObjectType */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_EVENTID 10369 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_EVENTTYPE 10370 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SOURCENODE 10371 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SOURCENAME 10372 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_TIME 10373 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_RECEIVETIME 10374 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOCALTIME 10375 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_MESSAGE 10376 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SEVERITY 10377 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONNAME 10378 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BRANCHID 10379 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_RETAIN 10380 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE 10381 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_ID 10382 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_NAME 10383 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_NUMBER 10384 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10385 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10386 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10387 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_TRUESTATE 10388 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLEDSTATE_FALSESTATE 10389 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_QUALITY 10390 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_QUALITY_SOURCETIMESTAMP 10391 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LASTSEVERITY 10392 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10393 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_COMMENT 10394 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_COMMENT_SOURCETIMESTAMP 10395 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CLIENTUSERID 10396 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ENABLE 10397 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_DISABLE 10398 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ADDCOMMENT 10399 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10400 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH 10401 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10402 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE 10403 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_ID 10404 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_NAME 10405 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_NUMBER 10406 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10407 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10408 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10409 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_TRUESTATE 10410 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKEDSTATE_FALSESTATE 10411 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE 10412 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_ID 10413 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_NAME 10414 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_NUMBER 10415 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10416 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10417 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10418 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10419 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10420 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKNOWLEDGE 10421 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10422 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRM 10423 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONFIRM_INPUTARGUMENTS 10424 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE 10425 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_ID 10426 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_NAME 10427 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_NUMBER 10428 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10429 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10430 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10431 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_TRUESTATE 10432 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ACTIVESTATE_FALSESTATE 10433 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE 10434 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_ID 10435 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_NAME 10436 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_NUMBER 10437 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10438 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10439 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10440 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10441 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10442 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE 10443 /* Object */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10444 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10445 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10446 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10447 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10448 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10449 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10450 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10451 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10452 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10453 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10454 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_UNSHELVE 10476 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10477 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10478 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10479 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESSEDORSHELVED 10480 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_MAXTIMESHELVED 10481 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE 10482 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_ID 10483 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_NAME 10484 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_NUMBER 10485 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_EFFECTIVEDISPLAYNAME 10486 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_TRANSITIONTIME 10487 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_EFFECTIVETRANSITIONTIME 10488 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_TRUESTATE 10489 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHSTATE_FALSESTATE 10490 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE 10491 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_ID 10492 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_NAME 10493 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_NUMBER 10494 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_EFFECTIVEDISPLAYNAME 10495 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_TRANSITIONTIME 10496 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_EFFECTIVETRANSITIONTIME 10497 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_TRUESTATE 10498 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHSTATE_FALSESTATE 10499 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE 10500 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_ID 10501 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_NAME 10502 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_NUMBER 10503 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_EFFECTIVEDISPLAYNAME 10504 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_TRANSITIONTIME 10505 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_EFFECTIVETRANSITIONTIME 10506 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_TRUESTATE 10507 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWSTATE_FALSESTATE 10508 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE 10509 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_ID 10510 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_NAME 10511 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_NUMBER 10512 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_EFFECTIVEDISPLAYNAME 10513 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_TRANSITIONTIME 10514 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_EFFECTIVETRANSITIONTIME 10515 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_TRUESTATE 10516 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWSTATE_FALSESTATE 10517 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHHIGHLIMIT 10518 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_HIGHLIMIT 10519 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLIMIT 10520 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LOWLOWLIMIT 10521 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SETPOINTNODE 10522 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE 10523 /* ObjectType */ +#define UA_NS0ID_DISCRETEALARMTYPE_EVENTID 10524 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_EVENTTYPE 10525 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SOURCENODE 10526 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SOURCENAME 10527 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_TIME 10528 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_RECEIVETIME 10529 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LOCALTIME 10530 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_MESSAGE 10531 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SEVERITY 10532 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONNAME 10533 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_BRANCHID 10534 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_RETAIN 10535 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE 10536 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_ID 10537 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_NAME 10538 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_NUMBER 10539 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10540 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10541 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10542 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_TRUESTATE 10543 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLEDSTATE_FALSESTATE 10544 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_QUALITY 10545 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_QUALITY_SOURCETIMESTAMP 10546 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LASTSEVERITY 10547 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10548 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_COMMENT 10549 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_COMMENT_SOURCETIMESTAMP 10550 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CLIENTUSERID 10551 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ENABLE 10552 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_DISABLE 10553 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_ADDCOMMENT 10554 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10555 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONREFRESH 10556 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10557 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE 10558 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_ID 10559 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_NAME 10560 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_NUMBER 10561 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10562 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10563 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10564 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_TRUESTATE 10565 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKEDSTATE_FALSESTATE 10566 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE 10567 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_ID 10568 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_NAME 10569 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_NUMBER 10570 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10571 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10572 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10573 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10574 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10575 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKNOWLEDGE 10576 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10577 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRM 10578 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONFIRM_INPUTARGUMENTS 10579 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE 10580 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_ID 10581 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_NAME 10582 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_NUMBER 10583 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10584 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10585 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10586 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_TRUESTATE 10587 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ACTIVESTATE_FALSESTATE 10588 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE 10589 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_ID 10590 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_NAME 10591 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_NUMBER 10592 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10593 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10594 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10595 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10596 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10597 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE 10598 /* Object */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10599 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10600 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10601 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10602 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10603 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10604 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10605 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10606 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10607 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10608 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10609 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_UNSHELVE 10631 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10632 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10633 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10634 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESSEDORSHELVED 10635 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_MAXTIMESHELVED 10636 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE 10637 /* ObjectType */ +#define UA_NS0ID_OFFNORMALALARMTYPE_EVENTID 10638 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_EVENTTYPE 10639 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SOURCENODE 10640 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SOURCENAME 10641 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_TIME 10642 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_RECEIVETIME 10643 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LOCALTIME 10644 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_MESSAGE 10645 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SEVERITY 10646 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONNAME 10647 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_BRANCHID 10648 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_RETAIN 10649 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE 10650 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_ID 10651 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_NAME 10652 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_NUMBER 10653 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10654 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10655 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10656 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_TRUESTATE 10657 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLEDSTATE_FALSESTATE 10658 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_QUALITY 10659 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_QUALITY_SOURCETIMESTAMP 10660 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LASTSEVERITY 10661 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10662 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_COMMENT 10663 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_COMMENT_SOURCETIMESTAMP 10664 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CLIENTUSERID 10665 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ENABLE 10666 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_DISABLE 10667 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ADDCOMMENT 10668 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10669 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONREFRESH 10670 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10671 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE 10672 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_ID 10673 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_NAME 10674 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_NUMBER 10675 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10676 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10677 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10678 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_TRUESTATE 10679 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKEDSTATE_FALSESTATE 10680 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE 10681 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_ID 10682 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_NAME 10683 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_NUMBER 10684 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10685 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10686 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10687 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10688 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10689 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKNOWLEDGE 10690 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10691 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRM 10692 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONFIRM_INPUTARGUMENTS 10693 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE 10694 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_ID 10695 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_NAME 10696 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_NUMBER 10697 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10698 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10699 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10700 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_TRUESTATE 10701 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ACTIVESTATE_FALSESTATE 10702 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE 10703 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_ID 10704 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_NAME 10705 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_NUMBER 10706 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10707 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10708 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10709 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10710 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10711 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE 10712 /* Object */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10713 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10714 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10715 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10716 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10717 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10718 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10719 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10720 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10721 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10722 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10723 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_UNSHELVE 10745 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10746 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10747 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10748 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESSEDORSHELVED 10749 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_MAXTIMESHELVED 10750 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE 10751 /* ObjectType */ +#define UA_NS0ID_TRIPALARMTYPE_EVENTID 10752 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_EVENTTYPE 10753 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SOURCENODE 10754 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SOURCENAME 10755 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_TIME 10756 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_RECEIVETIME 10757 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LOCALTIME 10758 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_MESSAGE 10759 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SEVERITY 10760 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONNAME 10761 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_BRANCHID 10762 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_RETAIN 10763 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE 10764 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_ID 10765 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_NAME 10766 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_NUMBER 10767 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 10768 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 10769 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 10770 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_TRUESTATE 10771 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLEDSTATE_FALSESTATE 10772 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_QUALITY 10773 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_QUALITY_SOURCETIMESTAMP 10774 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LASTSEVERITY 10775 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 10776 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_COMMENT 10777 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_COMMENT_SOURCETIMESTAMP 10778 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CLIENTUSERID 10779 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ENABLE 10780 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_DISABLE 10781 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_ADDCOMMENT 10782 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 10783 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONREFRESH 10784 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 10785 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE 10786 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_ID 10787 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_NAME 10788 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_NUMBER 10789 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 10790 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_TRANSITIONTIME 10791 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 10792 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_TRUESTATE 10793 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKEDSTATE_FALSESTATE 10794 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE 10795 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_ID 10796 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_NAME 10797 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_NUMBER 10798 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 10799 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 10800 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 10801 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_TRUESTATE 10802 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRMEDSTATE_FALSESTATE 10803 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACKNOWLEDGE 10804 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 10805 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRM 10806 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_CONFIRM_INPUTARGUMENTS 10807 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE 10808 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_ID 10809 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_NAME 10810 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_NUMBER 10811 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 10812 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_TRANSITIONTIME 10813 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 10814 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_TRUESTATE 10815 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_ACTIVESTATE_FALSESTATE 10816 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE 10817 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_ID 10818 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_NAME 10819 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_NUMBER 10820 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 10821 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 10822 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 10823 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 10824 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 10825 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE 10826 /* Object */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_CURRENTSTATE 10827 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 10828 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 10829 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 10830 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 10831 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION 10832 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 10833 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 10834 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 10835 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 10836 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_UNSHELVETIME 10837 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_UNSHELVE 10859 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 10860 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 10861 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 10862 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESSEDORSHELVED 10863 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_MAXTIMESHELVED 10864 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE 11093 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_EVENTID 11094 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_EVENTTYPE 11095 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_SOURCENODE 11096 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_SOURCENAME 11097 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_TIME 11098 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_RECEIVETIME 11099 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_LOCALTIME 11100 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_MESSAGE 11101 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_SEVERITY 11102 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_ACTIONTIMESTAMP 11103 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_STATUS 11104 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_SERVERID 11105 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_CLIENTAUDITENTRYID 11106 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_CLIENTUSERID 11107 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_METHODID 11108 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_INPUTARGUMENTS 11109 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_TRUESTATE 11110 /* Variable */ +#define UA_NS0ID_TWOSTATEVARIABLETYPE_FALSESTATE 11111 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONCLASSID 11112 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONCLASSNAME 11113 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONCLASSID 11114 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONCLASSNAME 11115 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONCLASSID 11116 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONCLASSNAME 11117 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONCLASSID 11118 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONCLASSNAME 11119 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_INPUTNODE 11120 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONCLASSID 11121 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONCLASSNAME 11122 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_INPUTNODE 11123 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_HIGHHIGHLIMIT 11124 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_HIGHLIMIT 11125 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LOWLIMIT 11126 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LOWLOWLIMIT 11127 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONCLASSID 11128 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONCLASSNAME 11129 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_INPUTNODE 11130 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONCLASSID 11131 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONCLASSNAME 11132 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_INPUTNODE 11133 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONCLASSID 11134 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONCLASSNAME 11135 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_INPUTNODE 11136 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONCLASSID 11137 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONCLASSNAME 11138 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_INPUTNODE 11139 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONCLASSID 11140 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONCLASSNAME 11141 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_INPUTNODE 11142 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONCLASSID 11143 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONCLASSNAME 11144 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_INPUTNODE 11145 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONCLASSID 11146 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONCLASSNAME 11147 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_INPUTNODE 11148 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONCLASSID 11149 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONCLASSNAME 11150 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_INPUTNODE 11151 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONCLASSID 11152 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONCLASSNAME 11153 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_INPUTNODE 11154 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONCLASSID 11155 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONCLASSNAME 11156 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_INPUTNODE 11157 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_NORMALSTATE 11158 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONCLASSID 11159 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONCLASSNAME 11160 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_INPUTNODE 11161 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_NORMALSTATE 11162 /* Variable */ +#define UA_NS0ID_BASECONDITIONCLASSTYPE 11163 /* ObjectType */ +#define UA_NS0ID_PROCESSCONDITIONCLASSTYPE 11164 /* ObjectType */ +#define UA_NS0ID_MAINTENANCECONDITIONCLASSTYPE 11165 /* ObjectType */ +#define UA_NS0ID_SYSTEMCONDITIONCLASSTYPE 11166 /* ObjectType */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATECONFIGURATION_TREATUNCERTAINASBAD 11168 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATECONFIGURATION_PERCENTDATABAD 11169 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATECONFIGURATION_PERCENTDATAGOOD 11170 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATECONFIGURATION_USESLOPEDEXTRAPOLATION 11171 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_AGGREGATEFUNCTIONS 11172 /* Object */ +#define UA_NS0ID_AGGREGATECONFIGURATIONTYPE 11187 /* ObjectType */ +#define UA_NS0ID_AGGREGATECONFIGURATIONTYPE_TREATUNCERTAINASBAD 11188 /* Variable */ +#define UA_NS0ID_AGGREGATECONFIGURATIONTYPE_PERCENTDATABAD 11189 /* Variable */ +#define UA_NS0ID_AGGREGATECONFIGURATIONTYPE_PERCENTDATAGOOD 11190 /* Variable */ +#define UA_NS0ID_AGGREGATECONFIGURATIONTYPE_USESLOPEDEXTRAPOLATION 11191 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES 11192 /* Object */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_ACCESSHISTORYDATACAPABILITY 11193 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTDATACAPABILITY 11196 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_REPLACEDATACAPABILITY 11197 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_UPDATEDATACAPABILITY 11198 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETERAWCAPABILITY 11199 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETEATTIMECAPABILITY 11200 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_AGGREGATEFUNCTIONS 11201 /* Object */ +#define UA_NS0ID_HACONFIGURATION 11202 /* Object */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATECONFIGURATION 11203 /* Object */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATECONFIGURATION_TREATUNCERTAINASBAD 11204 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATECONFIGURATION_PERCENTDATABAD 11205 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATECONFIGURATION_PERCENTDATAGOOD 11206 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATECONFIGURATION_USESLOPEDEXTRAPOLATION 11207 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_STEPPED 11208 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_DEFINITION 11209 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_MAXTIMEINTERVAL 11210 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_MINTIMEINTERVAL 11211 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_EXCEPTIONDEVIATION 11212 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_EXCEPTIONDEVIATIONFORMAT 11213 /* Variable */ +#define UA_NS0ID_ANNOTATIONS 11214 /* Variable */ +#define UA_NS0ID_HISTORICALEVENTFILTER 11215 /* Variable */ +#define UA_NS0ID_MODIFICATIONINFO 11216 /* DataType */ +#define UA_NS0ID_HISTORYMODIFIEDDATA 11217 /* DataType */ +#define UA_NS0ID_MODIFICATIONINFO_ENCODING_DEFAULTXML 11218 /* Object */ +#define UA_NS0ID_HISTORYMODIFIEDDATA_ENCODING_DEFAULTXML 11219 /* Object */ +#define UA_NS0ID_MODIFICATIONINFO_ENCODING_DEFAULTBINARY 11226 /* Object */ +#define UA_NS0ID_HISTORYMODIFIEDDATA_ENCODING_DEFAULTBINARY 11227 /* Object */ +#define UA_NS0ID_HISTORYUPDATETYPE 11234 /* DataType */ +#define UA_NS0ID_MULTISTATEVALUEDISCRETETYPE 11238 /* VariableType */ +#define UA_NS0ID_MULTISTATEVALUEDISCRETETYPE_DEFINITION 11239 /* Variable */ +#define UA_NS0ID_MULTISTATEVALUEDISCRETETYPE_VALUEPRECISION 11240 /* Variable */ +#define UA_NS0ID_MULTISTATEVALUEDISCRETETYPE_ENUMVALUES 11241 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_ACCESSHISTORYEVENTSCAPABILITY 11242 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_MAXRETURNDATAVALUES 11268 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_MAXRETURNEVENTVALUES 11269 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_INSERTANNOTATIONCAPABILITY 11270 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_MAXRETURNDATAVALUES 11273 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_MAXRETURNEVENTVALUES 11274 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTANNOTATIONCAPABILITY 11275 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_INSERTEVENTCAPABILITY 11278 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_REPLACEEVENTCAPABILITY 11279 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_UPDATEEVENTCAPABILITY 11280 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_INSERTEVENTCAPABILITY 11281 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_REPLACEEVENTCAPABILITY 11282 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_UPDATEEVENTCAPABILITY 11283 /* Variable */ +#define UA_NS0ID_AGGREGATEFUNCTION_TIMEAVERAGE2 11285 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MINIMUM2 11286 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MAXIMUM2 11287 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_RANGE2 11288 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_WORSTQUALITY2 11292 /* Object */ +#define UA_NS0ID_PERFORMUPDATETYPE 11293 /* DataType */ +#define UA_NS0ID_UPDATESTRUCTUREDATADETAILS 11295 /* DataType */ +#define UA_NS0ID_UPDATESTRUCTUREDATADETAILS_ENCODING_DEFAULTXML 11296 /* Object */ +#define UA_NS0ID_UPDATESTRUCTUREDATADETAILS_ENCODING_DEFAULTBINARY 11300 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_TOTAL2 11304 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MINIMUMACTUALTIME2 11305 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_MAXIMUMACTUALTIME2 11306 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DURATIONINSTATEZERO 11307 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DURATIONINSTATENONZERO 11308 /* Object */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY_CURRENTSERVERID 11312 /* Variable */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY_REDUNDANTSERVERARRAY 11313 /* Variable */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY_SERVERURIARRAY 11314 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVEDTOTIMEDSHELVED_TRANSITIONNUMBER 11322 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_UNSHELVEDTOONESHOTSHELVED_TRANSITIONNUMBER 11323 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVEDTOUNSHELVED_TRANSITIONNUMBER 11324 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_TIMEDSHELVEDTOONESHOTSHELVED_TRANSITIONNUMBER 11325 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVEDTOUNSHELVED_TRANSITIONNUMBER 11326 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_ONESHOTSHELVEDTOTIMEDSHELVED_TRANSITIONNUMBER 11327 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWLOWTOLOW_TRANSITIONNUMBER 11340 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LOWTOLOWLOW_TRANSITIONNUMBER 11341 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHHIGHTOHIGH_TRANSITIONNUMBER 11342 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_HIGHTOHIGHHIGH_TRANSITIONNUMBER 11343 /* Variable */ +#define UA_NS0ID_AGGREGATEFUNCTION_STANDARDDEVIATIONSAMPLE 11426 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_STANDARDDEVIATIONPOPULATION 11427 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_VARIANCESAMPLE 11428 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_VARIANCEPOPULATION 11429 /* Object */ +#define UA_NS0ID_ENUMSTRINGS 11432 /* Variable */ +#define UA_NS0ID_VALUEASTEXT 11433 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE 11436 /* ObjectType */ +#define UA_NS0ID_PROGRESSEVENTTYPE_EVENTID 11437 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_EVENTTYPE 11438 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_SOURCENODE 11439 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_SOURCENAME 11440 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_TIME 11441 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_RECEIVETIME 11442 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_LOCALTIME 11443 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_MESSAGE 11444 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_SEVERITY 11445 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE 11446 /* ObjectType */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_EVENTID 11447 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_EVENTTYPE 11448 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_SOURCENODE 11449 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_SOURCENAME 11450 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_TIME 11451 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_RECEIVETIME 11452 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_LOCALTIME 11453 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_MESSAGE 11454 /* Variable */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_SEVERITY 11455 /* Variable */ +#define UA_NS0ID_TRANSITIONVARIABLETYPE_EFFECTIVETRANSITIONTIME 11456 /* Variable */ +#define UA_NS0ID_FINITETRANSITIONVARIABLETYPE_EFFECTIVETRANSITIONTIME 11457 /* Variable */ +#define UA_NS0ID_STATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11458 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11459 /* Variable */ +#define UA_NS0ID_TRANSITIONEVENTTYPE_TRANSITION_EFFECTIVETRANSITIONTIME 11460 /* Variable */ +#define UA_NS0ID_MULTISTATEVALUEDISCRETETYPE_VALUEASTEXT 11461 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONEVENTTYPE_TRANSITION_EFFECTIVETRANSITIONTIME 11462 /* Variable */ +#define UA_NS0ID_PROGRAMTRANSITIONAUDITEVENTTYPE_TRANSITION_EFFECTIVETRANSITIONTIME 11463 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11464 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11465 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11466 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11467 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11468 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11469 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11470 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11471 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11472 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11473 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11474 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11475 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11476 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11477 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11478 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11479 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11480 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11481 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11482 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11483 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_SECURECHANNELID 11485 /* Variable */ +#define UA_NS0ID_OPTIONSETTYPE 11487 /* VariableType */ +#define UA_NS0ID_OPTIONSETTYPE_OPTIONSETVALUES 11488 /* Variable */ +#define UA_NS0ID_SERVERTYPE_GETMONITOREDITEMS 11489 /* Method */ +#define UA_NS0ID_SERVERTYPE_GETMONITOREDITEMS_INPUTARGUMENTS 11490 /* Variable */ +#define UA_NS0ID_SERVERTYPE_GETMONITOREDITEMS_OUTPUTARGUMENTS 11491 /* Variable */ +#define UA_NS0ID_SERVER_GETMONITOREDITEMS 11492 /* Method */ +#define UA_NS0ID_SERVER_GETMONITOREDITEMS_INPUTARGUMENTS 11493 /* Variable */ +#define UA_NS0ID_SERVER_GETMONITOREDITEMS_OUTPUTARGUMENTS 11494 /* Variable */ +#define UA_NS0ID_GETMONITOREDITEMSMETHODTYPE 11495 /* Method */ +#define UA_NS0ID_GETMONITOREDITEMSMETHODTYPE_INPUTARGUMENTS 11496 /* Variable */ +#define UA_NS0ID_GETMONITOREDITEMSMETHODTYPE_OUTPUTARGUMENTS 11497 /* Variable */ +#define UA_NS0ID_MAXSTRINGLENGTH 11498 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_STARTOFARCHIVE 11499 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_STARTOFONLINEARCHIVE 11500 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIESTYPE_DELETEEVENTCAPABILITY 11501 /* Variable */ +#define UA_NS0ID_HISTORYSERVERCAPABILITIES_DELETEEVENTCAPABILITY 11502 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_STARTOFARCHIVE 11503 /* Variable */ +#define UA_NS0ID_HACONFIGURATION_STARTOFONLINEARCHIVE 11504 /* Variable */ +#define UA_NS0ID_AGGREGATEFUNCTION_STARTBOUND 11505 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_ENDBOUND 11506 /* Object */ +#define UA_NS0ID_AGGREGATEFUNCTION_DELTABOUNDS 11507 /* Object */ +#define UA_NS0ID_MODELLINGRULE_OPTIONALPLACEHOLDER 11508 /* Object */ +#define UA_NS0ID_MODELLINGRULE_OPTIONALPLACEHOLDER_NAMINGRULE 11509 /* Variable */ +#define UA_NS0ID_MODELLINGRULE_MANDATORYPLACEHOLDER 11510 /* Object */ +#define UA_NS0ID_MODELLINGRULE_MANDATORYPLACEHOLDER_NAMINGRULE 11511 /* Variable */ +#define UA_NS0ID_MAXARRAYLENGTH 11512 /* Variable */ +#define UA_NS0ID_ENGINEERINGUNITS 11513 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXARRAYLENGTH 11514 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXSTRINGLENGTH 11515 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS 11516 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREAD 11517 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERWRITE 11519 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERMETHODCALL 11521 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERBROWSE 11522 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREGISTERNODES 11523 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERTRANSLATEBROWSEPATHSTONODEIDS 11524 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERNODEMANAGEMENT 11525 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXMONITOREDITEMSPERCALL 11526 /* Variable */ +#define UA_NS0ID_SERVERTYPE_NAMESPACES 11527 /* Object */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXARRAYLENGTH 11549 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXSTRINGLENGTH 11550 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS 11551 /* Object */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERREAD 11552 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERWRITE 11554 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERMETHODCALL 11556 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERBROWSE 11557 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERREGISTERNODES 11558 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERTRANSLATEBROWSEPATHSTONODEIDS 11559 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERNODEMANAGEMENT 11560 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXMONITOREDITEMSPERCALL 11561 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_VENDORCAPABILITY_PLACEHOLDER 11562 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE 11564 /* ObjectType */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERREAD 11565 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERWRITE 11567 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERMETHODCALL 11569 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERBROWSE 11570 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERREGISTERNODES 11571 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERTRANSLATEBROWSEPATHSTONODEIDS 11572 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERNODEMANAGEMENT 11573 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXMONITOREDITEMSPERCALL 11574 /* Variable */ +#define UA_NS0ID_FILETYPE 11575 /* ObjectType */ +#define UA_NS0ID_FILETYPE_SIZE 11576 /* Variable */ +#define UA_NS0ID_FILETYPE_OPENCOUNT 11579 /* Variable */ +#define UA_NS0ID_FILETYPE_OPEN 11580 /* Method */ +#define UA_NS0ID_FILETYPE_OPEN_INPUTARGUMENTS 11581 /* Variable */ +#define UA_NS0ID_FILETYPE_OPEN_OUTPUTARGUMENTS 11582 /* Variable */ +#define UA_NS0ID_FILETYPE_CLOSE 11583 /* Method */ +#define UA_NS0ID_FILETYPE_CLOSE_INPUTARGUMENTS 11584 /* Variable */ +#define UA_NS0ID_FILETYPE_READ 11585 /* Method */ +#define UA_NS0ID_FILETYPE_READ_INPUTARGUMENTS 11586 /* Variable */ +#define UA_NS0ID_FILETYPE_READ_OUTPUTARGUMENTS 11587 /* Variable */ +#define UA_NS0ID_FILETYPE_WRITE 11588 /* Method */ +#define UA_NS0ID_FILETYPE_WRITE_INPUTARGUMENTS 11589 /* Variable */ +#define UA_NS0ID_FILETYPE_GETPOSITION 11590 /* Method */ +#define UA_NS0ID_FILETYPE_GETPOSITION_INPUTARGUMENTS 11591 /* Variable */ +#define UA_NS0ID_FILETYPE_GETPOSITION_OUTPUTARGUMENTS 11592 /* Variable */ +#define UA_NS0ID_FILETYPE_SETPOSITION 11593 /* Method */ +#define UA_NS0ID_FILETYPE_SETPOSITION_INPUTARGUMENTS 11594 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE 11595 /* ObjectType */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_SIZE 11596 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_OPENCOUNT 11599 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_OPEN 11600 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_OPEN_INPUTARGUMENTS 11601 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_OPEN_OUTPUTARGUMENTS 11602 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_CLOSE 11603 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_CLOSE_INPUTARGUMENTS 11604 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_READ 11605 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_READ_INPUTARGUMENTS 11606 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_READ_OUTPUTARGUMENTS 11607 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_WRITE 11608 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_WRITE_INPUTARGUMENTS 11609 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_GETPOSITION 11610 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_GETPOSITION_INPUTARGUMENTS 11611 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_GETPOSITION_OUTPUTARGUMENTS 11612 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_SETPOSITION 11613 /* Method */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_SETPOSITION_INPUTARGUMENTS 11614 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_EXPORTNAMESPACE 11615 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE 11616 /* ObjectType */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEURI 11617 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEVERSION 11618 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEPUBLICATIONDATE 11619 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_ISNAMESPACESUBSET 11620 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_STATICNODEIDTYPES 11621 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_STATICNUMERICNODEIDRANGE 11622 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_STATICSTRINGNODEIDPATTERN 11623 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE 11624 /* Object */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_SIZE 11625 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_OPENCOUNT 11628 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_OPEN 11629 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_OPEN_INPUTARGUMENTS 11630 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_OPEN_OUTPUTARGUMENTS 11631 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_CLOSE 11632 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_CLOSE_INPUTARGUMENTS 11633 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_READ 11634 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_READ_INPUTARGUMENTS 11635 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_READ_OUTPUTARGUMENTS 11636 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_WRITE 11637 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_WRITE_INPUTARGUMENTS 11638 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_GETPOSITION 11639 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_GETPOSITION_INPUTARGUMENTS 11640 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_GETPOSITION_OUTPUTARGUMENTS 11641 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_SETPOSITION 11642 /* Method */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_SETPOSITION_INPUTARGUMENTS 11643 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_EXPORTNAMESPACE 11644 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE 11645 /* ObjectType */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER 11646 /* Object */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEURI 11647 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEVERSION 11648 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEPUBLICATIONDATE 11649 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_ISNAMESPACESUBSET 11650 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_STATICNODEIDTYPES 11651 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_STATICNUMERICNODEIDRANGE 11652 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_STATICSTRINGNODEIDPATTERN 11653 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE 11654 /* Object */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_SIZE 11655 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_OPENCOUNT 11658 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_OPEN 11659 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_OPEN_INPUTARGUMENTS 11660 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_OPEN_OUTPUTARGUMENTS 11661 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_CLOSE 11662 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_CLOSE_INPUTARGUMENTS 11663 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_READ 11664 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_READ_INPUTARGUMENTS 11665 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_READ_OUTPUTARGUMENTS 11666 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_WRITE 11667 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_WRITE_INPUTARGUMENTS 11668 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_GETPOSITION 11669 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_GETPOSITION_INPUTARGUMENTS 11670 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_GETPOSITION_OUTPUTARGUMENTS 11671 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_SETPOSITION 11672 /* Method */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_SETPOSITION_INPUTARGUMENTS 11673 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_EXPORTNAMESPACE 11674 /* Method */ +#define UA_NS0ID_SYSTEMSTATUSCHANGEEVENTTYPE_SYSTEMSTATE 11696 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSTYPE_SAMPLEDMONITOREDITEMSCOUNT 11697 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSTYPE_MAXSAMPLEDMONITOREDITEMSCOUNT 11698 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSTYPE_DISABLEDMONITOREDITEMSSAMPLINGCOUNT 11699 /* Variable */ +#define UA_NS0ID_OPTIONSETTYPE_BITMASK 11701 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXARRAYLENGTH 11702 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXSTRINGLENGTH 11703 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS 11704 /* Object */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREAD 11705 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERWRITE 11707 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERMETHODCALL 11709 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERBROWSE 11710 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERREGISTERNODES 11711 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERTRANSLATEBROWSEPATHSTONODEIDS 11712 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERNODEMANAGEMENT 11713 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXMONITOREDITEMSPERCALL 11714 /* Variable */ +#define UA_NS0ID_SERVER_NAMESPACES 11715 /* Object */ +#define UA_NS0ID_BITFIELDMASKDATATYPE 11737 /* DataType */ +#define UA_NS0ID_OPENMETHODTYPE 11738 /* Method */ +#define UA_NS0ID_OPENMETHODTYPE_INPUTARGUMENTS 11739 /* Variable */ +#define UA_NS0ID_OPENMETHODTYPE_OUTPUTARGUMENTS 11740 /* Variable */ +#define UA_NS0ID_CLOSEMETHODTYPE 11741 /* Method */ +#define UA_NS0ID_CLOSEMETHODTYPE_INPUTARGUMENTS 11742 /* Variable */ +#define UA_NS0ID_READMETHODTYPE 11743 /* Method */ +#define UA_NS0ID_READMETHODTYPE_INPUTARGUMENTS 11744 /* Variable */ +#define UA_NS0ID_READMETHODTYPE_OUTPUTARGUMENTS 11745 /* Variable */ +#define UA_NS0ID_WRITEMETHODTYPE 11746 /* Method */ +#define UA_NS0ID_WRITEMETHODTYPE_INPUTARGUMENTS 11747 /* Variable */ +#define UA_NS0ID_GETPOSITIONMETHODTYPE 11748 /* Method */ +#define UA_NS0ID_GETPOSITIONMETHODTYPE_INPUTARGUMENTS 11749 /* Variable */ +#define UA_NS0ID_GETPOSITIONMETHODTYPE_OUTPUTARGUMENTS 11750 /* Variable */ +#define UA_NS0ID_SETPOSITIONMETHODTYPE 11751 /* Method */ +#define UA_NS0ID_SETPOSITIONMETHODTYPE_INPUTARGUMENTS 11752 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE 11753 /* ObjectType */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_EVENTID 11754 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_EVENTTYPE 11755 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SOURCENODE 11756 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SOURCENAME 11757 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_TIME 11758 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_RECEIVETIME 11759 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LOCALTIME 11760 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_MESSAGE 11761 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SEVERITY 11762 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONCLASSID 11763 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONCLASSNAME 11764 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONNAME 11765 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_BRANCHID 11766 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_RETAIN 11767 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE 11768 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_ID 11769 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_NAME 11770 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_NUMBER 11771 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 11772 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 11773 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 11774 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_TRUESTATE 11775 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLEDSTATE_FALSESTATE 11776 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_QUALITY 11777 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_QUALITY_SOURCETIMESTAMP 11778 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LASTSEVERITY 11779 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 11780 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_COMMENT 11781 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_COMMENT_SOURCETIMESTAMP 11782 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CLIENTUSERID 11783 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_DISABLE 11784 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ENABLE 11785 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ADDCOMMENT 11786 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 11787 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONREFRESH 11788 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 11789 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE 11790 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_ID 11791 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_NAME 11792 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_NUMBER 11793 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 11794 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_TRANSITIONTIME 11795 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 11796 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_TRUESTATE 11797 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKEDSTATE_FALSESTATE 11798 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE 11799 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_ID 11800 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_NAME 11801 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_NUMBER 11802 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 11803 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 11804 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 11805 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_TRUESTATE 11806 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRMEDSTATE_FALSESTATE 11807 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKNOWLEDGE 11808 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 11809 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRM 11810 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONFIRM_INPUTARGUMENTS 11811 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE 11812 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_ID 11813 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_NAME 11814 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_NUMBER 11815 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 11816 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_TRANSITIONTIME 11817 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 11818 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_TRUESTATE 11819 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ACTIVESTATE_FALSESTATE 11820 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_INPUTNODE 11821 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE 11822 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_ID 11823 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_NAME 11824 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_NUMBER 11825 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 11826 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 11827 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 11828 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 11829 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 11830 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE 11831 /* Object */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE 11832 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 11833 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 11834 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 11835 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 11836 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION 11837 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 11838 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 11839 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 11840 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 11841 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 11842 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_UNSHELVETIME 11843 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_UNSHELVE 11844 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 11845 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 11846 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 11847 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESSEDORSHELVED 11848 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_MAXTIMESHELVED 11849 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_NORMALSTATE 11850 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_COMMENT 11851 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESPONDEVENTTYPE_SELECTEDRESPONSE 11852 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_COMMENT 11853 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_COMMENT 11854 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSHELVINGEVENTTYPE_SHELVINGTIME 11855 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE 11856 /* ObjectType */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_EVENTID 11857 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_EVENTTYPE 11858 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_SOURCENODE 11859 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_SOURCENAME 11860 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_TIME 11861 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_RECEIVETIME 11862 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_LOCALTIME 11863 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_MESSAGE 11864 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_SEVERITY 11865 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_ACTIONTIMESTAMP 11866 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_STATUS 11867 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_SERVERID 11868 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_CLIENTAUDITENTRYID 11869 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_CLIENTUSERID 11870 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_METHODID 11871 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_INPUTARGUMENTS 11872 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_OLDSTATEID 11873 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_NEWSTATEID 11874 /* Variable */ +#define UA_NS0ID_AUDITPROGRAMTRANSITIONEVENTTYPE_TRANSITIONNUMBER 11875 /* Variable */ +#define UA_NS0ID_HISTORICALDATACONFIGURATIONTYPE_AGGREGATEFUNCTIONS 11876 /* Object */ +#define UA_NS0ID_HACONFIGURATION_AGGREGATEFUNCTIONS 11877 /* Object */ +#define UA_NS0ID_NODECLASS_ENUMVALUES 11878 /* Variable */ +#define UA_NS0ID_INSTANCENODE 11879 /* DataType */ +#define UA_NS0ID_TYPENODE 11880 /* DataType */ +#define UA_NS0ID_NODEATTRIBUTESMASK_ENUMVALUES 11881 /* Variable */ +#define UA_NS0ID_BROWSERESULTMASK_ENUMVALUES 11883 /* Variable */ +#define UA_NS0ID_HISTORYUPDATETYPE_ENUMVALUES 11884 /* Variable */ +#define UA_NS0ID_PERFORMUPDATETYPE_ENUMVALUES 11885 /* Variable */ +#define UA_NS0ID_INSTANCENODE_ENCODING_DEFAULTXML 11887 /* Object */ +#define UA_NS0ID_TYPENODE_ENCODING_DEFAULTXML 11888 /* Object */ +#define UA_NS0ID_INSTANCENODE_ENCODING_DEFAULTBINARY 11889 /* Object */ +#define UA_NS0ID_TYPENODE_ENCODING_DEFAULTBINARY 11890 /* Object */ +#define UA_NS0ID_SESSIONDIAGNOSTICSOBJECTTYPE_SESSIONDIAGNOSTICS_UNAUTHORIZEDREQUESTCOUNT 11891 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSVARIABLETYPE_UNAUTHORIZEDREQUESTCOUNT 11892 /* Variable */ +#define UA_NS0ID_OPENFILEMODE 11939 /* DataType */ +#define UA_NS0ID_OPENFILEMODE_ENUMVALUES 11940 /* Variable */ +#define UA_NS0ID_MODELCHANGESTRUCTUREVERBMASK 11941 /* DataType */ +#define UA_NS0ID_MODELCHANGESTRUCTUREVERBMASK_ENUMVALUES 11942 /* Variable */ +#define UA_NS0ID_ENDPOINTURLLISTDATATYPE 11943 /* DataType */ +#define UA_NS0ID_NETWORKGROUPDATATYPE 11944 /* DataType */ +#define UA_NS0ID_NONTRANSPARENTNETWORKREDUNDANCYTYPE 11945 /* ObjectType */ +#define UA_NS0ID_NONTRANSPARENTNETWORKREDUNDANCYTYPE_REDUNDANCYSUPPORT 11946 /* Variable */ +#define UA_NS0ID_NONTRANSPARENTNETWORKREDUNDANCYTYPE_SERVERURIARRAY 11947 /* Variable */ +#define UA_NS0ID_NONTRANSPARENTNETWORKREDUNDANCYTYPE_SERVERNETWORKGROUPS 11948 /* Variable */ +#define UA_NS0ID_ENDPOINTURLLISTDATATYPE_ENCODING_DEFAULTXML 11949 /* Object */ +#define UA_NS0ID_NETWORKGROUPDATATYPE_ENCODING_DEFAULTXML 11950 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTURLLISTDATATYPE 11951 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTURLLISTDATATYPE_DATATYPEVERSION 11952 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTURLLISTDATATYPE_DICTIONARYFRAGMENT 11953 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKGROUPDATATYPE 11954 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKGROUPDATATYPE_DATATYPEVERSION 11955 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKGROUPDATATYPE_DICTIONARYFRAGMENT 11956 /* Variable */ +#define UA_NS0ID_ENDPOINTURLLISTDATATYPE_ENCODING_DEFAULTBINARY 11957 /* Object */ +#define UA_NS0ID_NETWORKGROUPDATATYPE_ENCODING_DEFAULTBINARY 11958 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTURLLISTDATATYPE 11959 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTURLLISTDATATYPE_DATATYPEVERSION 11960 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTURLLISTDATATYPE_DICTIONARYFRAGMENT 11961 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKGROUPDATATYPE 11962 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKGROUPDATATYPE_DATATYPEVERSION 11963 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKGROUPDATATYPE_DICTIONARYFRAGMENT 11964 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE 12021 /* VariableType */ +#define UA_NS0ID_ARRAYITEMTYPE_DEFINITION 12022 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_VALUEPRECISION 12023 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_INSTRUMENTRANGE 12024 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_EURANGE 12025 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_ENGINEERINGUNITS 12026 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_TITLE 12027 /* Variable */ +#define UA_NS0ID_ARRAYITEMTYPE_AXISSCALETYPE 12028 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE 12029 /* VariableType */ +#define UA_NS0ID_YARRAYITEMTYPE_DEFINITION 12030 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_VALUEPRECISION 12031 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_INSTRUMENTRANGE 12032 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_EURANGE 12033 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_ENGINEERINGUNITS 12034 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_TITLE 12035 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_AXISSCALETYPE 12036 /* Variable */ +#define UA_NS0ID_YARRAYITEMTYPE_XAXISDEFINITION 12037 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE 12038 /* VariableType */ +#define UA_NS0ID_XYARRAYITEMTYPE_DEFINITION 12039 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_VALUEPRECISION 12040 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_INSTRUMENTRANGE 12041 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_EURANGE 12042 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_ENGINEERINGUNITS 12043 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_TITLE 12044 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_AXISSCALETYPE 12045 /* Variable */ +#define UA_NS0ID_XYARRAYITEMTYPE_XAXISDEFINITION 12046 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE 12047 /* VariableType */ +#define UA_NS0ID_IMAGEITEMTYPE_DEFINITION 12048 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_VALUEPRECISION 12049 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_INSTRUMENTRANGE 12050 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_EURANGE 12051 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_ENGINEERINGUNITS 12052 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_TITLE 12053 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_AXISSCALETYPE 12054 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_XAXISDEFINITION 12055 /* Variable */ +#define UA_NS0ID_IMAGEITEMTYPE_YAXISDEFINITION 12056 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE 12057 /* VariableType */ +#define UA_NS0ID_CUBEITEMTYPE_DEFINITION 12058 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_VALUEPRECISION 12059 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_INSTRUMENTRANGE 12060 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_EURANGE 12061 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_ENGINEERINGUNITS 12062 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_TITLE 12063 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_AXISSCALETYPE 12064 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_XAXISDEFINITION 12065 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_YAXISDEFINITION 12066 /* Variable */ +#define UA_NS0ID_CUBEITEMTYPE_ZAXISDEFINITION 12067 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE 12068 /* VariableType */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_DEFINITION 12069 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_VALUEPRECISION 12070 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_INSTRUMENTRANGE 12071 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_EURANGE 12072 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_ENGINEERINGUNITS 12073 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_TITLE 12074 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_AXISSCALETYPE 12075 /* Variable */ +#define UA_NS0ID_NDIMENSIONARRAYITEMTYPE_AXISDEFINITION 12076 /* Variable */ +#define UA_NS0ID_AXISSCALEENUMERATION 12077 /* DataType */ +#define UA_NS0ID_AXISSCALEENUMERATION_ENUMSTRINGS 12078 /* Variable */ +#define UA_NS0ID_AXISINFORMATION 12079 /* DataType */ +#define UA_NS0ID_XVTYPE 12080 /* DataType */ +#define UA_NS0ID_AXISINFORMATION_ENCODING_DEFAULTXML 12081 /* Object */ +#define UA_NS0ID_XVTYPE_ENCODING_DEFAULTXML 12082 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AXISINFORMATION 12083 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AXISINFORMATION_DATATYPEVERSION 12084 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_AXISINFORMATION_DICTIONARYFRAGMENT 12085 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_XVTYPE 12086 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_XVTYPE_DATATYPEVERSION 12087 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_XVTYPE_DICTIONARYFRAGMENT 12088 /* Variable */ +#define UA_NS0ID_AXISINFORMATION_ENCODING_DEFAULTBINARY 12089 /* Object */ +#define UA_NS0ID_XVTYPE_ENCODING_DEFAULTBINARY 12090 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AXISINFORMATION 12091 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AXISINFORMATION_DATATYPEVERSION 12092 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_AXISINFORMATION_DICTIONARYFRAGMENT 12093 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_XVTYPE 12094 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_XVTYPE_DATATYPEVERSION 12095 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_XVTYPE_DICTIONARYFRAGMENT 12096 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER 12097 /* Object */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS 12098 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SESSIONID 12099 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SESSIONNAME 12100 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CLIENTDESCRIPTION 12101 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SERVERURI 12102 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_ENDPOINTURL 12103 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_LOCALEIDS 12104 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_ACTUALSESSIONTIMEOUT 12105 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_MAXRESPONSEMESSAGESIZE 12106 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CLIENTCONNECTIONTIME 12107 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CLIENTLASTCONTACTTIME 12108 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CURRENTSUBSCRIPTIONSCOUNT 12109 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CURRENTMONITOREDITEMSCOUNT 12110 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CURRENTPUBLISHREQUESTSINQUEUE 12111 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_TOTALREQUESTCOUNT 12112 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_UNAUTHORIZEDREQUESTCOUNT 12113 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_READCOUNT 12114 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_HISTORYREADCOUNT 12115 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_WRITECOUNT 12116 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_HISTORYUPDATECOUNT 12117 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CALLCOUNT 12118 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CREATEMONITOREDITEMSCOUNT 12119 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_MODIFYMONITOREDITEMSCOUNT 12120 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SETMONITORINGMODECOUNT 12121 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SETTRIGGERINGCOUNT 12122 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_DELETEMONITOREDITEMSCOUNT 12123 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_CREATESUBSCRIPTIONCOUNT 12124 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_MODIFYSUBSCRIPTIONCOUNT 12125 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_SETPUBLISHINGMODECOUNT 12126 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_PUBLISHCOUNT 12127 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_REPUBLISHCOUNT 12128 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_TRANSFERSUBSCRIPTIONSCOUNT 12129 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_DELETESUBSCRIPTIONSCOUNT 12130 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_ADDNODESCOUNT 12131 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_ADDREFERENCESCOUNT 12132 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_DELETENODESCOUNT 12133 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_DELETEREFERENCESCOUNT 12134 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_BROWSECOUNT 12135 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_BROWSENEXTCOUNT 12136 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_TRANSLATEBROWSEPATHSTONODEIDSCOUNT 12137 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_QUERYFIRSTCOUNT 12138 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_QUERYNEXTCOUNT 12139 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_REGISTERNODESCOUNT 12140 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONDIAGNOSTICS_UNREGISTERNODESCOUNT 12141 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS 12142 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_SESSIONID 12143 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDOFSESSION 12144 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDHISTORY 12145 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_AUTHENTICATIONMECHANISM 12146 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_ENCODING 12147 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_TRANSPORTPROTOCOL 12148 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_SECURITYMODE 12149 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_SECURITYPOLICYURI 12150 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SESSIONSECURITYDIAGNOSTICS_CLIENTCERTIFICATE 12151 /* Variable */ +#define UA_NS0ID_SESSIONSDIAGNOSTICSSUMMARYTYPE_CLIENTNAME_PLACEHOLDER_SUBSCRIPTIONDIAGNOSTICSARRAY 12152 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADDATA 12153 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADEVENTS 12154 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEDATA 12155 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEEVENTS 12156 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERHISTORYREADDATA 12157 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERHISTORYREADEVENTS 12158 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEDATA 12159 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEEVENTS 12160 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERHISTORYREADDATA 12161 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERHISTORYREADEVENTS 12162 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERHISTORYUPDATEDATA 12163 /* Variable */ +#define UA_NS0ID_OPERATIONLIMITSTYPE_MAXNODESPERHISTORYUPDATEEVENTS 12164 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADDATA 12165 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYREADEVENTS 12166 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEDATA 12167 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_OPERATIONLIMITS_MAXNODESPERHISTORYUPDATEEVENTS 12168 /* Variable */ +#define UA_NS0ID_NAMINGRULETYPE_ENUMVALUES 12169 /* Variable */ +#define UA_NS0ID_VIEWVERSION 12170 /* Variable */ +#define UA_NS0ID_COMPLEXNUMBERTYPE 12171 /* DataType */ +#define UA_NS0ID_DOUBLECOMPLEXNUMBERTYPE 12172 /* DataType */ +#define UA_NS0ID_COMPLEXNUMBERTYPE_ENCODING_DEFAULTXML 12173 /* Object */ +#define UA_NS0ID_DOUBLECOMPLEXNUMBERTYPE_ENCODING_DEFAULTXML 12174 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_COMPLEXNUMBERTYPE 12175 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_COMPLEXNUMBERTYPE_DATATYPEVERSION 12176 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_COMPLEXNUMBERTYPE_DICTIONARYFRAGMENT 12177 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DOUBLECOMPLEXNUMBERTYPE 12178 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DOUBLECOMPLEXNUMBERTYPE_DATATYPEVERSION 12179 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DOUBLECOMPLEXNUMBERTYPE_DICTIONARYFRAGMENT 12180 /* Variable */ +#define UA_NS0ID_COMPLEXNUMBERTYPE_ENCODING_DEFAULTBINARY 12181 /* Object */ +#define UA_NS0ID_DOUBLECOMPLEXNUMBERTYPE_ENCODING_DEFAULTBINARY 12182 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_COMPLEXNUMBERTYPE 12183 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_COMPLEXNUMBERTYPE_DATATYPEVERSION 12184 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_COMPLEXNUMBERTYPE_DICTIONARYFRAGMENT 12185 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DOUBLECOMPLEXNUMBERTYPE 12186 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DOUBLECOMPLEXNUMBERTYPE_DATATYPEVERSION 12187 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DOUBLECOMPLEXNUMBERTYPE_DICTIONARYFRAGMENT 12188 /* Variable */ +#define UA_NS0ID_SERVERONNETWORK 12189 /* DataType */ +#define UA_NS0ID_FINDSERVERSONNETWORKREQUEST 12190 /* DataType */ +#define UA_NS0ID_FINDSERVERSONNETWORKRESPONSE 12191 /* DataType */ +#define UA_NS0ID_REGISTERSERVER2REQUEST 12193 /* DataType */ +#define UA_NS0ID_REGISTERSERVER2RESPONSE 12194 /* DataType */ +#define UA_NS0ID_SERVERONNETWORK_ENCODING_DEFAULTXML 12195 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKREQUEST_ENCODING_DEFAULTXML 12196 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKRESPONSE_ENCODING_DEFAULTXML 12197 /* Object */ +#define UA_NS0ID_REGISTERSERVER2REQUEST_ENCODING_DEFAULTXML 12199 /* Object */ +#define UA_NS0ID_REGISTERSERVER2RESPONSE_ENCODING_DEFAULTXML 12200 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERONNETWORK 12201 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERONNETWORK_DATATYPEVERSION 12202 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SERVERONNETWORK_DICTIONARYFRAGMENT 12203 /* Variable */ +#define UA_NS0ID_SERVERONNETWORK_ENCODING_DEFAULTBINARY 12207 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKREQUEST_ENCODING_DEFAULTBINARY 12208 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKRESPONSE_ENCODING_DEFAULTBINARY 12209 /* Object */ +#define UA_NS0ID_REGISTERSERVER2REQUEST_ENCODING_DEFAULTBINARY 12211 /* Object */ +#define UA_NS0ID_REGISTERSERVER2RESPONSE_ENCODING_DEFAULTBINARY 12212 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERONNETWORK 12213 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERONNETWORK_DATATYPEVERSION 12214 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SERVERONNETWORK_DICTIONARYFRAGMENT 12215 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_CONTEXT 12502 /* Variable */ +#define UA_NS0ID_PROGRESSEVENTTYPE_PROGRESS 12503 /* Variable */ +#define UA_NS0ID_OPENWITHMASKSMETHODTYPE 12513 /* Method */ +#define UA_NS0ID_OPENWITHMASKSMETHODTYPE_INPUTARGUMENTS 12514 /* Variable */ +#define UA_NS0ID_OPENWITHMASKSMETHODTYPE_OUTPUTARGUMENTS 12515 /* Variable */ +#define UA_NS0ID_CLOSEANDUPDATEMETHODTYPE 12516 /* Method */ +#define UA_NS0ID_CLOSEANDUPDATEMETHODTYPE_OUTPUTARGUMENTS 12517 /* Variable */ +#define UA_NS0ID_ADDCERTIFICATEMETHODTYPE 12518 /* Method */ +#define UA_NS0ID_ADDCERTIFICATEMETHODTYPE_INPUTARGUMENTS 12519 /* Variable */ +#define UA_NS0ID_REMOVECERTIFICATEMETHODTYPE 12520 /* Method */ +#define UA_NS0ID_REMOVECERTIFICATEMETHODTYPE_INPUTARGUMENTS 12521 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE 12522 /* ObjectType */ +#define UA_NS0ID_TRUSTLISTTYPE_SIZE 12523 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_OPENCOUNT 12526 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_OPEN 12527 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_OPEN_INPUTARGUMENTS 12528 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_OPEN_OUTPUTARGUMENTS 12529 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_CLOSE 12530 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_CLOSE_INPUTARGUMENTS 12531 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_READ 12532 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_READ_INPUTARGUMENTS 12533 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_READ_OUTPUTARGUMENTS 12534 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_WRITE 12535 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_WRITE_INPUTARGUMENTS 12536 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_GETPOSITION 12537 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_GETPOSITION_INPUTARGUMENTS 12538 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_GETPOSITION_OUTPUTARGUMENTS 12539 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_SETPOSITION 12540 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_SETPOSITION_INPUTARGUMENTS 12541 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_LASTUPDATETIME 12542 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_OPENWITHMASKS 12543 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_OPENWITHMASKS_INPUTARGUMENTS 12544 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_OPENWITHMASKS_OUTPUTARGUMENTS 12545 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_CLOSEANDUPDATE 12546 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_CLOSEANDUPDATE_OUTPUTARGUMENTS 12547 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_ADDCERTIFICATE 12548 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_ADDCERTIFICATE_INPUTARGUMENTS 12549 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_REMOVECERTIFICATE 12550 /* Method */ +#define UA_NS0ID_TRUSTLISTTYPE_REMOVECERTIFICATE_INPUTARGUMENTS 12551 /* Variable */ +#define UA_NS0ID_TRUSTLISTMASKS 12552 /* DataType */ +#define UA_NS0ID_TRUSTLISTMASKS_ENUMVALUES 12553 /* Variable */ +#define UA_NS0ID_TRUSTLISTDATATYPE 12554 /* DataType */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE 12555 /* ObjectType */ +#define UA_NS0ID_CERTIFICATETYPE 12556 /* ObjectType */ +#define UA_NS0ID_APPLICATIONCERTIFICATETYPE 12557 /* ObjectType */ +#define UA_NS0ID_HTTPSCERTIFICATETYPE 12558 /* ObjectType */ +#define UA_NS0ID_RSAMINAPPLICATIONCERTIFICATETYPE 12559 /* ObjectType */ +#define UA_NS0ID_RSASHA256APPLICATIONCERTIFICATETYPE 12560 /* ObjectType */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE 12561 /* ObjectType */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_EVENTID 12562 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_EVENTTYPE 12563 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_SOURCENODE 12564 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_SOURCENAME 12565 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_TIME 12566 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_RECEIVETIME 12567 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_LOCALTIME 12568 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_MESSAGE 12569 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_SEVERITY 12570 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_ACTIONTIMESTAMP 12571 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_STATUS 12572 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_SERVERID 12573 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_CLIENTAUDITENTRYID 12574 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_CLIENTUSERID 12575 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_METHODID 12576 /* Variable */ +#define UA_NS0ID_TRUSTLISTUPDATEDAUDITEVENTTYPE_INPUTARGUMENTS 12577 /* Variable */ +#define UA_NS0ID_UPDATECERTIFICATEMETHODTYPE 12578 /* Method */ +#define UA_NS0ID_UPDATECERTIFICATEMETHODTYPE_INPUTARGUMENTS 12579 /* Variable */ +#define UA_NS0ID_UPDATECERTIFICATEMETHODTYPE_OUTPUTARGUMENTS 12580 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE 12581 /* ObjectType */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_SUPPORTEDPRIVATEKEYFORMATS 12583 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_MAXTRUSTLISTSIZE 12584 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_MULTICASTDNSENABLED 12585 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_UPDATECERTIFICATE 12616 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_UPDATECERTIFICATE_INPUTARGUMENTS 12617 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_UPDATECERTIFICATE_OUTPUTARGUMENTS 12618 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE 12620 /* ObjectType */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_EVENTID 12621 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_EVENTTYPE 12622 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_SOURCENODE 12623 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_SOURCENAME 12624 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_TIME 12625 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_RECEIVETIME 12626 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_LOCALTIME 12627 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_MESSAGE 12628 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_SEVERITY 12629 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_ACTIONTIMESTAMP 12630 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_STATUS 12631 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_SERVERID 12632 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_CLIENTAUDITENTRYID 12633 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_CLIENTUSERID 12634 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_METHODID 12635 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_INPUTARGUMENTS 12636 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION 12637 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_SUPPORTEDPRIVATEKEYFORMATS 12639 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_MAXTRUSTLISTSIZE 12640 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_MULTICASTDNSENABLED 12641 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST 12642 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SIZE 12643 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENCOUNT 12646 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN 12647 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 12648 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 12649 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE 12650 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 12651 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ 12652 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_INPUTARGUMENTS 12653 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 12654 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE 12655 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 12656 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION 12657 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 12658 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 12659 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION 12660 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 12661 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_LASTUPDATETIME 12662 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS 12663 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 12664 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 12665 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE 12666 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 12667 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE 12668 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 12669 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE 12670 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 12671 /* Variable */ +#define UA_NS0ID_TRUSTLISTDATATYPE_ENCODING_DEFAULTXML 12676 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TRUSTLISTDATATYPE 12677 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TRUSTLISTDATATYPE_DATATYPEVERSION 12678 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TRUSTLISTDATATYPE_DICTIONARYFRAGMENT 12679 /* Variable */ +#define UA_NS0ID_TRUSTLISTDATATYPE_ENCODING_DEFAULTBINARY 12680 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TRUSTLISTDATATYPE 12681 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TRUSTLISTDATATYPE_DATATYPEVERSION 12682 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TRUSTLISTDATATYPE_DICTIONARYFRAGMENT 12683 /* Variable */ +#define UA_NS0ID_FILETYPE_WRITABLE 12686 /* Variable */ +#define UA_NS0ID_FILETYPE_USERWRITABLE 12687 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_WRITABLE 12688 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_USERWRITABLE 12689 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_WRITABLE 12690 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_USERWRITABLE 12691 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_WRITABLE 12692 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_USERWRITABLE 12693 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_WRITABLE 12698 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_USERWRITABLE 12699 /* Variable */ +#define UA_NS0ID_CLOSEANDUPDATEMETHODTYPE_INPUTARGUMENTS 12704 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_CLOSEANDUPDATE_INPUTARGUMENTS 12705 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_SERVERCAPABILITIES 12708 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_SERVERCAPABILITIES 12710 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATHELEMENT 12712 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATHELEMENT_DATATYPEVERSION 12713 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATHELEMENT_DICTIONARYFRAGMENT 12714 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATH 12715 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATH_DATATYPEVERSION 12716 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_RELATIVEPATH_DICTIONARYFRAGMENT 12717 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATHELEMENT 12718 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATHELEMENT_DATATYPEVERSION 12719 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATHELEMENT_DICTIONARYFRAGMENT 12720 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATH 12721 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATH_DATATYPEVERSION 12722 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_RELATIVEPATH_DICTIONARYFRAGMENT 12723 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CREATESIGNINGREQUEST 12731 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CREATESIGNINGREQUEST_INPUTARGUMENTS 12732 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CREATESIGNINGREQUEST_OUTPUTARGUMENTS 12733 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_APPLYCHANGES 12734 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CREATESIGNINGREQUEST 12737 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CREATESIGNINGREQUEST_INPUTARGUMENTS 12738 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CREATESIGNINGREQUEST_OUTPUTARGUMENTS 12739 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_APPLYCHANGES 12740 /* Method */ +#define UA_NS0ID_CREATESIGNINGREQUESTMETHODTYPE 12741 /* Method */ +#define UA_NS0ID_CREATESIGNINGREQUESTMETHODTYPE_INPUTARGUMENTS 12742 /* Variable */ +#define UA_NS0ID_CREATESIGNINGREQUESTMETHODTYPE_OUTPUTARGUMENTS 12743 /* Variable */ +#define UA_NS0ID_OPTIONSETVALUES 12745 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SETSUBSCRIPTIONDURABLE 12746 /* Method */ +#define UA_NS0ID_SERVERTYPE_SETSUBSCRIPTIONDURABLE_INPUTARGUMENTS 12747 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SETSUBSCRIPTIONDURABLE_OUTPUTARGUMENTS 12748 /* Variable */ +#define UA_NS0ID_SERVER_SETSUBSCRIPTIONDURABLE 12749 /* Method */ +#define UA_NS0ID_SERVER_SETSUBSCRIPTIONDURABLE_INPUTARGUMENTS 12750 /* Variable */ +#define UA_NS0ID_SERVER_SETSUBSCRIPTIONDURABLE_OUTPUTARGUMENTS 12751 /* Variable */ +#define UA_NS0ID_SETSUBSCRIPTIONDURABLEMETHODTYPE 12752 /* Method */ +#define UA_NS0ID_SETSUBSCRIPTIONDURABLEMETHODTYPE_INPUTARGUMENTS 12753 /* Variable */ +#define UA_NS0ID_SETSUBSCRIPTIONDURABLEMETHODTYPE_OUTPUTARGUMENTS 12754 /* Variable */ +#define UA_NS0ID_OPTIONSET 12755 /* DataType */ +#define UA_NS0ID_UNION 12756 /* DataType */ +#define UA_NS0ID_OPTIONSET_ENCODING_DEFAULTXML 12757 /* Object */ +#define UA_NS0ID_UNION_ENCODING_DEFAULTXML 12758 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_OPTIONSET 12759 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_OPTIONSET_DATATYPEVERSION 12760 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_OPTIONSET_DICTIONARYFRAGMENT 12761 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UNION 12762 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UNION_DATATYPEVERSION 12763 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UNION_DICTIONARYFRAGMENT 12764 /* Variable */ +#define UA_NS0ID_OPTIONSET_ENCODING_DEFAULTBINARY 12765 /* Object */ +#define UA_NS0ID_UNION_ENCODING_DEFAULTBINARY 12766 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_OPTIONSET 12767 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_OPTIONSET_DATATYPEVERSION 12768 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_OPTIONSET_DICTIONARYFRAGMENT 12769 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UNION 12770 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UNION_DATATYPEVERSION 12771 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UNION_DICTIONARYFRAGMENT 12772 /* Variable */ +#define UA_NS0ID_GETREJECTEDLISTMETHODTYPE 12773 /* Method */ +#define UA_NS0ID_GETREJECTEDLISTMETHODTYPE_OUTPUTARGUMENTS 12774 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_GETREJECTEDLIST 12775 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_GETREJECTEDLIST_OUTPUTARGUMENTS 12776 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_GETREJECTEDLIST 12777 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_GETREJECTEDLIST_OUTPUTARGUMENTS 12778 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE_SAMPLINGINTERVALDIAGNOSTICS 12779 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE_SAMPLINGINTERVALDIAGNOSTICS_SAMPLINGINTERVAL 12780 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE_SAMPLINGINTERVALDIAGNOSTICS_SAMPLEDMONITOREDITEMSCOUNT 12781 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE_SAMPLINGINTERVALDIAGNOSTICS_MAXSAMPLEDMONITOREDITEMSCOUNT 12782 /* Variable */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSARRAYTYPE_SAMPLINGINTERVALDIAGNOSTICS_DISABLEDMONITOREDITEMSSAMPLINGCOUNT 12783 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS 12784 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_SESSIONID 12785 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_SUBSCRIPTIONID 12786 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_PRIORITY 12787 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_PUBLISHINGINTERVAL 12788 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MAXKEEPALIVECOUNT 12789 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MAXLIFETIMECOUNT 12790 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MAXNOTIFICATIONSPERPUBLISH 12791 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_PUBLISHINGENABLED 12792 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MODIFYCOUNT 12793 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_ENABLECOUNT 12794 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_DISABLECOUNT 12795 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_REPUBLISHREQUESTCOUNT 12796 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_REPUBLISHMESSAGEREQUESTCOUNT 12797 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_REPUBLISHMESSAGECOUNT 12798 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_TRANSFERREQUESTCOUNT 12799 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_TRANSFERREDTOALTCLIENTCOUNT 12800 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_TRANSFERREDTOSAMECLIENTCOUNT 12801 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_PUBLISHREQUESTCOUNT 12802 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_DATACHANGENOTIFICATIONSCOUNT 12803 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_EVENTNOTIFICATIONSCOUNT 12804 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_NOTIFICATIONSCOUNT 12805 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_LATEPUBLISHREQUESTCOUNT 12806 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_CURRENTKEEPALIVECOUNT 12807 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_CURRENTLIFETIMECOUNT 12808 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_UNACKNOWLEDGEDMESSAGECOUNT 12809 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_DISCARDEDMESSAGECOUNT 12810 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MONITOREDITEMCOUNT 12811 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_DISABLEDMONITOREDITEMCOUNT 12812 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_MONITORINGQUEUEOVERFLOWCOUNT 12813 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_NEXTSEQUENCENUMBER 12814 /* Variable */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSARRAYTYPE_SUBSCRIPTIONDIAGNOSTICS_EVENTQUEUEOVERFLOWCOUNT 12815 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS 12816 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SESSIONID 12817 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SESSIONNAME 12818 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CLIENTDESCRIPTION 12819 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SERVERURI 12820 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_ENDPOINTURL 12821 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_LOCALEIDS 12822 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_ACTUALSESSIONTIMEOUT 12823 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_MAXRESPONSEMESSAGESIZE 12824 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CLIENTCONNECTIONTIME 12825 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CLIENTLASTCONTACTTIME 12826 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CURRENTSUBSCRIPTIONSCOUNT 12827 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CURRENTMONITOREDITEMSCOUNT 12828 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CURRENTPUBLISHREQUESTSINQUEUE 12829 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_TOTALREQUESTCOUNT 12830 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_UNAUTHORIZEDREQUESTCOUNT 12831 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_READCOUNT 12832 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_HISTORYREADCOUNT 12833 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_WRITECOUNT 12834 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_HISTORYUPDATECOUNT 12835 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CALLCOUNT 12836 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CREATEMONITOREDITEMSCOUNT 12837 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_MODIFYMONITOREDITEMSCOUNT 12838 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SETMONITORINGMODECOUNT 12839 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SETTRIGGERINGCOUNT 12840 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_DELETEMONITOREDITEMSCOUNT 12841 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_CREATESUBSCRIPTIONCOUNT 12842 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_MODIFYSUBSCRIPTIONCOUNT 12843 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_SETPUBLISHINGMODECOUNT 12844 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_PUBLISHCOUNT 12845 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_REPUBLISHCOUNT 12846 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_TRANSFERSUBSCRIPTIONSCOUNT 12847 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_DELETESUBSCRIPTIONSCOUNT 12848 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_ADDNODESCOUNT 12849 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_ADDREFERENCESCOUNT 12850 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_DELETENODESCOUNT 12851 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_DELETEREFERENCESCOUNT 12852 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_BROWSECOUNT 12853 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_BROWSENEXTCOUNT 12854 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_TRANSLATEBROWSEPATHSTONODEIDSCOUNT 12855 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_QUERYFIRSTCOUNT 12856 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_QUERYNEXTCOUNT 12857 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_REGISTERNODESCOUNT 12858 /* Variable */ +#define UA_NS0ID_SESSIONDIAGNOSTICSARRAYTYPE_SESSIONDIAGNOSTICS_UNREGISTERNODESCOUNT 12859 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS 12860 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_SESSIONID 12861 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDOFSESSION 12862 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTUSERIDHISTORY 12863 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_AUTHENTICATIONMECHANISM 12864 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_ENCODING 12865 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_TRANSPORTPROTOCOL 12866 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_SECURITYMODE 12867 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_SECURITYPOLICYURI 12868 /* Variable */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSARRAYTYPE_SESSIONSECURITYDIAGNOSTICS_CLIENTCERTIFICATE 12869 /* Variable */ +#define UA_NS0ID_SERVERTYPE_RESENDDATA 12871 /* Method */ +#define UA_NS0ID_SERVERTYPE_RESENDDATA_INPUTARGUMENTS 12872 /* Variable */ +#define UA_NS0ID_SERVER_RESENDDATA 12873 /* Method */ +#define UA_NS0ID_SERVER_RESENDDATA_INPUTARGUMENTS 12874 /* Variable */ +#define UA_NS0ID_RESENDDATAMETHODTYPE 12875 /* Method */ +#define UA_NS0ID_RESENDDATAMETHODTYPE_INPUTARGUMENTS 12876 /* Variable */ +#define UA_NS0ID_NORMALIZEDSTRING 12877 /* DataType */ +#define UA_NS0ID_DECIMALSTRING 12878 /* DataType */ +#define UA_NS0ID_DURATIONSTRING 12879 /* DataType */ +#define UA_NS0ID_TIMESTRING 12880 /* DataType */ +#define UA_NS0ID_DATESTRING 12881 /* DataType */ +#define UA_NS0ID_SERVERTYPE_ESTIMATEDRETURNTIME 12882 /* Variable */ +#define UA_NS0ID_SERVERTYPE_REQUESTSERVERSTATECHANGE 12883 /* Method */ +#define UA_NS0ID_SERVERTYPE_REQUESTSERVERSTATECHANGE_INPUTARGUMENTS 12884 /* Variable */ +#define UA_NS0ID_SERVER_ESTIMATEDRETURNTIME 12885 /* Variable */ +#define UA_NS0ID_SERVER_REQUESTSERVERSTATECHANGE 12886 /* Method */ +#define UA_NS0ID_SERVER_REQUESTSERVERSTATECHANGE_INPUTARGUMENTS 12887 /* Variable */ +#define UA_NS0ID_REQUESTSERVERSTATECHANGEMETHODTYPE 12888 /* Method */ +#define UA_NS0ID_REQUESTSERVERSTATECHANGEMETHODTYPE_INPUTARGUMENTS 12889 /* Variable */ +#define UA_NS0ID_DISCOVERYCONFIGURATION 12890 /* DataType */ +#define UA_NS0ID_MDNSDISCOVERYCONFIGURATION 12891 /* DataType */ +#define UA_NS0ID_DISCOVERYCONFIGURATION_ENCODING_DEFAULTXML 12892 /* Object */ +#define UA_NS0ID_MDNSDISCOVERYCONFIGURATION_ENCODING_DEFAULTXML 12893 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DISCOVERYCONFIGURATION 12894 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DISCOVERYCONFIGURATION_DATATYPEVERSION 12895 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DISCOVERYCONFIGURATION_DICTIONARYFRAGMENT 12896 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MDNSDISCOVERYCONFIGURATION 12897 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MDNSDISCOVERYCONFIGURATION_DATATYPEVERSION 12898 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_MDNSDISCOVERYCONFIGURATION_DICTIONARYFRAGMENT 12899 /* Variable */ +#define UA_NS0ID_DISCOVERYCONFIGURATION_ENCODING_DEFAULTBINARY 12900 /* Object */ +#define UA_NS0ID_MDNSDISCOVERYCONFIGURATION_ENCODING_DEFAULTBINARY 12901 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DISCOVERYCONFIGURATION 12902 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DISCOVERYCONFIGURATION_DATATYPEVERSION 12903 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DISCOVERYCONFIGURATION_DICTIONARYFRAGMENT 12904 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MDNSDISCOVERYCONFIGURATION 12905 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MDNSDISCOVERYCONFIGURATION_DATATYPEVERSION 12906 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_MDNSDISCOVERYCONFIGURATION_DICTIONARYFRAGMENT 12907 /* Variable */ +#define UA_NS0ID_MAXBYTESTRINGLENGTH 12908 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_MAXBYTESTRINGLENGTH 12909 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_MAXBYTESTRINGLENGTH 12910 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_MAXBYTESTRINGLENGTH 12911 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONREFRESH2 12912 /* Method */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12913 /* Variable */ +#define UA_NS0ID_CONDITIONREFRESH2METHODTYPE 12914 /* Method */ +#define UA_NS0ID_CONDITIONREFRESH2METHODTYPE_INPUTARGUMENTS 12915 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONREFRESH2 12916 /* Method */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12917 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONREFRESH2 12918 /* Method */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12919 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONREFRESH2 12984 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12985 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONREFRESH2 12986 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12987 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH2 12988 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12989 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH2 12990 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12991 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH2 12992 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12993 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH2 12994 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12995 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH2 12996 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12997 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH2 12998 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 12999 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH2 13000 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13001 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH2 13002 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13003 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONREFRESH2 13004 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13005 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONREFRESH2 13006 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13007 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONREFRESH2 13008 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13009 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONREFRESH2 13010 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13011 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE 13225 /* ObjectType */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_EVENTID 13226 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_EVENTTYPE 13227 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SOURCENODE 13228 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SOURCENAME 13229 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_TIME 13230 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_RECEIVETIME 13231 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LOCALTIME 13232 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_MESSAGE 13233 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SEVERITY 13234 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONCLASSID 13235 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONCLASSNAME 13236 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONNAME 13237 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_BRANCHID 13238 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_RETAIN 13239 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE 13240 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_ID 13241 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_NAME 13242 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_NUMBER 13243 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 13244 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 13245 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 13246 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_TRUESTATE 13247 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLEDSTATE_FALSESTATE 13248 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_QUALITY 13249 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_QUALITY_SOURCETIMESTAMP 13250 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LASTSEVERITY 13251 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 13252 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_COMMENT 13253 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_COMMENT_SOURCETIMESTAMP 13254 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CLIENTUSERID 13255 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_DISABLE 13256 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ENABLE 13257 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ADDCOMMENT 13258 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 13259 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONREFRESH 13260 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 13261 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONREFRESH2 13262 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 13263 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE 13264 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_ID 13265 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_NAME 13266 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_NUMBER 13267 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 13268 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_TRANSITIONTIME 13269 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 13270 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_TRUESTATE 13271 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKEDSTATE_FALSESTATE 13272 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE 13273 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_ID 13274 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_NAME 13275 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_NUMBER 13276 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 13277 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 13278 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 13279 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_TRUESTATE 13280 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRMEDSTATE_FALSESTATE 13281 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKNOWLEDGE 13282 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 13283 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRM 13284 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONFIRM_INPUTARGUMENTS 13285 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE 13286 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_ID 13287 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_NAME 13288 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_NUMBER 13289 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 13290 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_TRANSITIONTIME 13291 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 13292 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_TRUESTATE 13293 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ACTIVESTATE_FALSESTATE 13294 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_INPUTNODE 13295 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE 13296 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_ID 13297 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_NAME 13298 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_NUMBER 13299 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 13300 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 13301 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 13302 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 13303 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 13304 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE 13305 /* Object */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE 13306 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 13307 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 13308 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 13309 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 13310 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION 13311 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 13312 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 13313 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 13314 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 13315 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 13316 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_UNSHELVETIME 13317 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_UNSHELVE 13318 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 13319 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 13320 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 13321 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESSEDORSHELVED 13322 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_MAXTIMESHELVED 13323 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_NORMALSTATE 13324 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_EXPIRATIONDATE 13325 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CERTIFICATETYPE 13326 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CERTIFICATE 13327 /* Variable */ +#define UA_NS0ID_FILETYPE_MIMETYPE 13341 /* Variable */ +#define UA_NS0ID_CREATEDIRECTORYMETHODTYPE 13342 /* Method */ +#define UA_NS0ID_CREATEDIRECTORYMETHODTYPE_INPUTARGUMENTS 13343 /* Variable */ +#define UA_NS0ID_CREATEDIRECTORYMETHODTYPE_OUTPUTARGUMENTS 13344 /* Variable */ +#define UA_NS0ID_CREATEFILEMETHODTYPE 13345 /* Method */ +#define UA_NS0ID_CREATEFILEMETHODTYPE_INPUTARGUMENTS 13346 /* Variable */ +#define UA_NS0ID_CREATEFILEMETHODTYPE_OUTPUTARGUMENTS 13347 /* Variable */ +#define UA_NS0ID_DELETEFILEMETHODTYPE 13348 /* Method */ +#define UA_NS0ID_DELETEFILEMETHODTYPE_INPUTARGUMENTS 13349 /* Variable */ +#define UA_NS0ID_MOVEORCOPYMETHODTYPE 13350 /* Method */ +#define UA_NS0ID_MOVEORCOPYMETHODTYPE_INPUTARGUMENTS 13351 /* Variable */ +#define UA_NS0ID_MOVEORCOPYMETHODTYPE_OUTPUTARGUMENTS 13352 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE 13353 /* ObjectType */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER 13354 /* Object */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY 13355 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY_INPUTARGUMENTS 13356 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY_OUTPUTARGUMENTS 13357 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE 13358 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE_INPUTARGUMENTS 13359 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE_OUTPUTARGUMENTS 13360 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY 13363 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY_INPUTARGUMENTS 13364 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY_OUTPUTARGUMENTS 13365 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER 13366 /* Object */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_SIZE 13367 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_WRITABLE 13368 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_USERWRITABLE 13369 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_OPENCOUNT 13370 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_MIMETYPE 13371 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_OPEN 13372 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_OPEN_INPUTARGUMENTS 13373 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_OPEN_OUTPUTARGUMENTS 13374 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_CLOSE 13375 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_CLOSE_INPUTARGUMENTS 13376 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_READ 13377 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_READ_INPUTARGUMENTS 13378 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_READ_OUTPUTARGUMENTS 13379 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_WRITE 13380 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_WRITE_INPUTARGUMENTS 13381 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_GETPOSITION 13382 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_GETPOSITION_INPUTARGUMENTS 13383 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_GETPOSITION_OUTPUTARGUMENTS 13384 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_SETPOSITION 13385 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILENAME_PLACEHOLDER_SETPOSITION_INPUTARGUMENTS 13386 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEDIRECTORY 13387 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEDIRECTORY_INPUTARGUMENTS 13388 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEDIRECTORY_OUTPUTARGUMENTS 13389 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEFILE 13390 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEFILE_INPUTARGUMENTS 13391 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_CREATEFILE_OUTPUTARGUMENTS 13392 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_DELETEFILESYSTEMOBJECT 13393 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_DELETEFILESYSTEMOBJECT_INPUTARGUMENTS 13394 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_MOVEORCOPY 13395 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_MOVEORCOPY_INPUTARGUMENTS 13396 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_MOVEORCOPY_OUTPUTARGUMENTS 13397 /* Variable */ +#define UA_NS0ID_ADDRESSSPACEFILETYPE_MIMETYPE 13398 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_NAMESPACEFILE_MIMETYPE 13399 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_NAMESPACEFILE_MIMETYPE 13400 /* Variable */ +#define UA_NS0ID_TRUSTLISTTYPE_MIMETYPE 13403 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST 13599 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_SIZE 13600 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_WRITABLE 13601 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_USERWRITABLE 13602 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPENCOUNT 13603 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_MIMETYPE 13604 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPEN 13605 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPEN_INPUTARGUMENTS 13606 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13607 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_CLOSE 13608 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_CLOSE_INPUTARGUMENTS 13609 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_READ 13610 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_READ_INPUTARGUMENTS 13611 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_READ_OUTPUTARGUMENTS 13612 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_WRITE 13613 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_WRITE_INPUTARGUMENTS 13614 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_GETPOSITION 13615 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13616 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13617 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_SETPOSITION 13618 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13619 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_LASTUPDATETIME 13620 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPENWITHMASKS 13621 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13622 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13623 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_CLOSEANDUPDATE 13624 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13625 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13626 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_ADDCERTIFICATE 13627 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13628 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_REMOVECERTIFICATE 13629 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13630 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPTYPE_CERTIFICATETYPES 13631 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_CERTIFICATEGROUP 13735 /* Variable */ +#define UA_NS0ID_CERTIFICATEUPDATEDAUDITEVENTTYPE_CERTIFICATETYPE 13736 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_UPDATECERTIFICATE 13737 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_UPDATECERTIFICATE_INPUTARGUMENTS 13738 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_UPDATECERTIFICATE_OUTPUTARGUMENTS 13739 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE 13813 /* ObjectType */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP 13814 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST 13815 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SIZE 13816 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITABLE 13817 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_USERWRITABLE 13818 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENCOUNT 13819 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_MIMETYPE 13820 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN 13821 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 13822 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13823 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE 13824 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 13825 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ 13826 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_INPUTARGUMENTS 13827 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 13828 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE 13829 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 13830 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION 13831 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13832 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13833 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION 13834 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13835 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_LASTUPDATETIME 13836 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS 13837 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13838 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13839 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE 13840 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13841 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13842 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE 13843 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13844 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE 13845 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13846 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTAPPLICATIONGROUP_CERTIFICATETYPES 13847 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP 13848 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST 13849 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_SIZE 13850 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_WRITABLE 13851 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_USERWRITABLE 13852 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPENCOUNT 13853 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_MIMETYPE 13854 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN 13855 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 13856 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13857 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE 13858 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 13859 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_READ 13860 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_READ_INPUTARGUMENTS 13861 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 13862 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE 13863 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 13864 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION 13865 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13866 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13867 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION 13868 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13869 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_LASTUPDATETIME 13870 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS 13871 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13872 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13873 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE 13874 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13875 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13876 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE 13877 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13878 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE 13879 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13880 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTHTTPSGROUP_CERTIFICATETYPES 13881 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP 13882 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST 13883 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_SIZE 13884 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITABLE 13885 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_USERWRITABLE 13886 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENCOUNT 13887 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_MIMETYPE 13888 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN 13889 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 13890 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13891 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE 13892 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 13893 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ 13894 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_INPUTARGUMENTS 13895 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 13896 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE 13897 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 13898 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION 13899 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13900 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13901 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION 13902 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13903 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_LASTUPDATETIME 13904 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS 13905 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13906 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13907 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE 13908 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13909 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13910 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE 13911 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13912 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE 13913 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13914 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_DEFAULTUSERTOKENGROUP_CERTIFICATETYPES 13915 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER 13916 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST 13917 /* Object */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_SIZE 13918 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_WRITABLE 13919 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_USERWRITABLE 13920 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPENCOUNT 13921 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_MIMETYPE 13922 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPEN 13923 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPEN_INPUTARGUMENTS 13924 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13925 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_CLOSE 13926 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_CLOSE_INPUTARGUMENTS 13927 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_READ 13928 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_READ_INPUTARGUMENTS 13929 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_READ_OUTPUTARGUMENTS 13930 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_WRITE 13931 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_WRITE_INPUTARGUMENTS 13932 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_GETPOSITION 13933 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13934 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13935 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_SETPOSITION 13936 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13937 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_LASTUPDATETIME 13938 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPENWITHMASKS 13939 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13940 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13941 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_CLOSEANDUPDATE 13942 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13943 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13944 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_ADDCERTIFICATE 13945 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13946 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_REMOVECERTIFICATE 13947 /* Method */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13948 /* Variable */ +#define UA_NS0ID_CERTIFICATEGROUPFOLDERTYPE_ADDITIONALGROUP_PLACEHOLDER_CERTIFICATETYPES 13949 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS 13950 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP 13951 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST 13952 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SIZE 13953 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITABLE 13954 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_USERWRITABLE 13955 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENCOUNT 13956 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_MIMETYPE 13957 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN 13958 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 13959 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13960 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE 13961 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 13962 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ 13963 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_INPUTARGUMENTS 13964 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 13965 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE 13966 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 13967 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION 13968 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 13969 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 13970 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION 13971 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 13972 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_LASTUPDATETIME 13973 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS 13974 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 13975 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 13976 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE 13977 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 13978 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 13979 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE 13980 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 13981 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE 13982 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 13983 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_CERTIFICATETYPES 13984 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP 13985 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST 13986 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SIZE 13987 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITABLE 13988 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_USERWRITABLE 13989 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENCOUNT 13990 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_MIMETYPE 13991 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN 13992 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 13993 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 13994 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE 13995 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 13996 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ 13997 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ_INPUTARGUMENTS 13998 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 13999 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE 14000 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 14001 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION 14002 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 14003 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 14004 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION 14005 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 14006 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_LASTUPDATETIME 14007 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS 14008 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 14009 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 14010 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE 14011 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 14012 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 14013 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE 14014 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 14015 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE 14016 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 14017 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_CERTIFICATETYPES 14018 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP 14019 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST 14020 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SIZE 14021 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITABLE 14022 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_USERWRITABLE 14023 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENCOUNT 14024 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_MIMETYPE 14025 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN 14026 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 14027 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 14028 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE 14029 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 14030 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ 14031 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_INPUTARGUMENTS 14032 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 14033 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE 14034 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 14035 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION 14036 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 14037 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 14038 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION 14039 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 14040 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_LASTUPDATETIME 14041 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS 14042 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 14043 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 14044 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE 14045 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 14046 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 14047 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE 14048 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 14049 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE 14050 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 14051 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATIONTYPE_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_CERTIFICATETYPES 14052 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS 14053 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP 14088 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST 14089 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SIZE 14090 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITABLE 14091 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_USERWRITABLE 14092 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENCOUNT 14093 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_MIMETYPE 14094 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN 14095 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 14096 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 14097 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE 14098 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 14099 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ 14100 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ_INPUTARGUMENTS 14101 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 14102 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE 14103 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 14104 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION 14105 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 14106 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 14107 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION 14108 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 14109 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_LASTUPDATETIME 14110 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS 14111 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 14112 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 14113 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE 14114 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 14115 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 14116 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE 14117 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 14118 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE 14119 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 14120 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTHTTPSGROUP_CERTIFICATETYPES 14121 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP 14122 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST 14123 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SIZE 14124 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITABLE 14125 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_USERWRITABLE 14126 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENCOUNT 14127 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_MIMETYPE 14128 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN 14129 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_INPUTARGUMENTS 14130 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPEN_OUTPUTARGUMENTS 14131 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE 14132 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSE_INPUTARGUMENTS 14133 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ 14134 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_INPUTARGUMENTS 14135 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_READ_OUTPUTARGUMENTS 14136 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE 14137 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_WRITE_INPUTARGUMENTS 14138 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION 14139 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_INPUTARGUMENTS 14140 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_GETPOSITION_OUTPUTARGUMENTS 14141 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION 14142 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_SETPOSITION_INPUTARGUMENTS 14143 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_LASTUPDATETIME 14144 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS 14145 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_INPUTARGUMENTS 14146 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_OPENWITHMASKS_OUTPUTARGUMENTS 14147 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE 14148 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 14149 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_CLOSEANDUPDATE_OUTPUTARGUMENTS 14150 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE 14151 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_ADDCERTIFICATE_INPUTARGUMENTS 14152 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE 14153 /* Method */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_TRUSTLIST_REMOVECERTIFICATE_INPUTARGUMENTS 14154 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTUSERTOKENGROUP_CERTIFICATETYPES 14155 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP 14156 /* Object */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_WRITABLE 14157 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_USERWRITABLE 14158 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_MIMETYPE 14159 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_TRUSTLIST_CLOSEANDUPDATE_INPUTARGUMENTS 14160 /* Variable */ +#define UA_NS0ID_SERVERCONFIGURATION_CERTIFICATEGROUPS_DEFAULTAPPLICATIONGROUP_CERTIFICATETYPES 14161 /* Variable */ +#define UA_NS0ID_REMOVECONNECTIONMETHODTYPE 14183 /* Method */ +#define UA_NS0ID_REMOVECONNECTIONMETHODTYPE_INPUTARGUMENTS 14184 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE 14209 /* ObjectType */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDRESS 14221 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_REMOVEGROUP 14225 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_REMOVEGROUP_INPUTARGUMENTS 14226 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE 14232 /* ObjectType */ +#define UA_NS0ID_PUBLISHEDVARIABLEDATATYPE 14273 /* DataType */ +#define UA_NS0ID_PUBLISHEDVARIABLEDATATYPE_ENCODING_DEFAULTXML 14319 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDVARIABLEDATATYPE 14320 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDVARIABLEDATATYPE_DATATYPEVERSION 14321 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDVARIABLEDATATYPE_DICTIONARYFRAGMENT 14322 /* Variable */ +#define UA_NS0ID_PUBLISHEDVARIABLEDATATYPE_ENCODING_DEFAULTBINARY 14323 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDVARIABLEDATATYPE 14324 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDVARIABLEDATATYPE_DATATYPEVERSION 14325 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDVARIABLEDATATYPE_DICTIONARYFRAGMENT 14326 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_SESSIONID 14413 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_SESSIONID 14414 /* Variable */ +#define UA_NS0ID_SERVER_SERVERREDUNDANCY_SERVERNETWORKGROUPS 14415 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE 14416 /* ObjectType */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER 14417 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_PUBLISHERID 14418 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_STATUS 14419 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_STATUS_STATE 14420 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_STATUS_ENABLE 14421 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_STATUS_DISABLE 14422 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDRESS 14423 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_REMOVEGROUP 14424 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_REMOVEGROUP_INPUTARGUMENTS 14425 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_REMOVECONNECTION 14432 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_REMOVECONNECTION_INPUTARGUMENTS 14433 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS 14434 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS 14435 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS_INPUTARGUMENTS 14436 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS_OUTPUTARGUMENTS 14437 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS 14438 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS_INPUTARGUMENTS 14439 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS_OUTPUTARGUMENTS 14440 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_REMOVEPUBLISHEDDATASET 14441 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_REMOVEPUBLISHEDDATASET_INPUTARGUMENTS 14442 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE 14443 /* Object */ +#define UA_NS0ID_HASPUBSUBCONNECTION 14476 /* ReferenceType */ +#define UA_NS0ID_DATASETFOLDERTYPE 14477 /* ObjectType */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER 14478 /* Object */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMS 14479 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMS_INPUTARGUMENTS 14480 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMS_OUTPUTARGUMENTS 14481 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTS 14482 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTS_INPUTARGUMENTS 14483 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTS_OUTPUTARGUMENTS 14484 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_REMOVEPUBLISHEDDATASET 14485 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_REMOVEPUBLISHEDDATASET_INPUTARGUMENTS 14486 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER 14487 /* Object */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_CONFIGURATIONVERSION 14489 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS 14493 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS_INPUTARGUMENTS 14494 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMS_OUTPUTARGUMENTS 14495 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTS 14496 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTS_INPUTARGUMENTS 14497 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTS_OUTPUTARGUMENTS 14498 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET 14499 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_REMOVEPUBLISHEDDATASET_INPUTARGUMENTS 14500 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSMETHODTYPE 14501 /* Method */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSMETHODTYPE_INPUTARGUMENTS 14502 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSMETHODTYPE_OUTPUTARGUMENTS 14503 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSMETHODTYPE 14504 /* Method */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSMETHODTYPE_INPUTARGUMENTS 14505 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSMETHODTYPE_OUTPUTARGUMENTS 14506 /* Variable */ +#define UA_NS0ID_REMOVEPUBLISHEDDATASETMETHODTYPE 14507 /* Method */ +#define UA_NS0ID_REMOVEPUBLISHEDDATASETMETHODTYPE_INPUTARGUMENTS 14508 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE 14509 /* ObjectType */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_CONFIGURATIONVERSION 14519 /* Variable */ +#define UA_NS0ID_DATASETMETADATATYPE 14523 /* DataType */ +#define UA_NS0ID_FIELDMETADATA 14524 /* DataType */ +#define UA_NS0ID_DATATYPEDESCRIPTION 14525 /* DataType */ +#define UA_NS0ID_STRUCTURETYPE_ENUMSTRINGS 14528 /* Variable */ +#define UA_NS0ID_KEYVALUEPAIR 14533 /* DataType */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE 14534 /* ObjectType */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_CONFIGURATIONVERSION 14544 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_PUBLISHEDDATA 14548 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_ADDVARIABLES 14555 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_ADDVARIABLES_INPUTARGUMENTS 14556 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_ADDVARIABLES_OUTPUTARGUMENTS 14557 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_REMOVEVARIABLES 14558 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_REMOVEVARIABLES_INPUTARGUMENTS 14559 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_REMOVEVARIABLES_OUTPUTARGUMENTS 14560 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSADDVARIABLESMETHODTYPE 14564 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSADDVARIABLESMETHODTYPE_INPUTARGUMENTS 14565 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSADDVARIABLESMETHODTYPE_OUTPUTARGUMENTS 14566 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSREMOVEVARIABLESMETHODTYPE 14567 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSREMOVEVARIABLESMETHODTYPE_INPUTARGUMENTS 14568 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSREMOVEVARIABLESMETHODTYPE_OUTPUTARGUMENTS 14569 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE 14572 /* ObjectType */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_CONFIGURATIONVERSION 14582 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_PUBSUBEVENTNOTIFIER 14586 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_SELECTEDFIELDS 14587 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_FILTER 14588 /* Variable */ +#define UA_NS0ID_CONFIGURATIONVERSIONDATATYPE 14593 /* DataType */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_PUBLISHERID 14595 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_STATUS 14600 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_STATUS_STATE 14601 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_STATUS_ENABLE 14602 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_STATUS_DISABLE 14603 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPEREMOVEGROUPMETHODTYPE 14604 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPEREMOVEGROUPMETHODTYPE_INPUTARGUMENTS 14605 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEREMOVEWRITERMETHODTYPE 14623 /* Method */ +#define UA_NS0ID_PUBSUBGROUPTYPEREMOVEWRITERMETHODTYPE_INPUTARGUMENTS 14624 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEREMOVEREADERMETHODTYPE 14625 /* Method */ +#define UA_NS0ID_PUBSUBGROUPTYPEREMOVEREADERMETHODTYPE_INPUTARGUMENTS 14626 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSTYPE 14643 /* ObjectType */ +#define UA_NS0ID_PUBSUBSTATUSTYPE_STATE 14644 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSTYPE_ENABLE 14645 /* Method */ +#define UA_NS0ID_PUBSUBSTATUSTYPE_DISABLE 14646 /* Method */ +#define UA_NS0ID_PUBSUBSTATE 14647 /* DataType */ +#define UA_NS0ID_PUBSUBSTATE_ENUMSTRINGS 14648 /* Variable */ +#define UA_NS0ID_FIELDTARGETDATATYPE 14744 /* DataType */ +#define UA_NS0ID_DATASETMETADATATYPE_ENCODING_DEFAULTXML 14794 /* Object */ +#define UA_NS0ID_FIELDMETADATA_ENCODING_DEFAULTXML 14795 /* Object */ +#define UA_NS0ID_DATATYPEDESCRIPTION_ENCODING_DEFAULTXML 14796 /* Object */ +#define UA_NS0ID_DATATYPEDEFINITION_ENCODING_DEFAULTXML 14797 /* Object */ +#define UA_NS0ID_STRUCTUREDEFINITION_ENCODING_DEFAULTXML 14798 /* Object */ +#define UA_NS0ID_ENUMDEFINITION_ENCODING_DEFAULTXML 14799 /* Object */ +#define UA_NS0ID_STRUCTUREFIELD_ENCODING_DEFAULTXML 14800 /* Object */ +#define UA_NS0ID_ENUMFIELD_ENCODING_DEFAULTXML 14801 /* Object */ +#define UA_NS0ID_KEYVALUEPAIR_ENCODING_DEFAULTXML 14802 /* Object */ +#define UA_NS0ID_CONFIGURATIONVERSIONDATATYPE_ENCODING_DEFAULTXML 14803 /* Object */ +#define UA_NS0ID_FIELDTARGETDATATYPE_ENCODING_DEFAULTXML 14804 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETMETADATATYPE 14805 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETMETADATATYPE_DATATYPEVERSION 14806 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETMETADATATYPE_DICTIONARYFRAGMENT 14807 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDMETADATA 14808 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDMETADATA_DATATYPEVERSION 14809 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDMETADATA_DICTIONARYFRAGMENT 14810 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDESCRIPTION 14811 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDESCRIPTION_DATATYPEVERSION 14812 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDESCRIPTION_DICTIONARYFRAGMENT 14813 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMFIELD 14826 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMFIELD_DATATYPEVERSION 14827 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMFIELD_DICTIONARYFRAGMENT 14828 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_KEYVALUEPAIR 14829 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_KEYVALUEPAIR_DATATYPEVERSION 14830 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_KEYVALUEPAIR_DICTIONARYFRAGMENT 14831 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONFIGURATIONVERSIONDATATYPE 14832 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONFIGURATIONVERSIONDATATYPE_DATATYPEVERSION 14833 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONFIGURATIONVERSIONDATATYPE_DICTIONARYFRAGMENT 14834 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDTARGETDATATYPE 14835 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDTARGETDATATYPE_DATATYPEVERSION 14836 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_FIELDTARGETDATATYPE_DICTIONARYFRAGMENT 14837 /* Variable */ +#define UA_NS0ID_FIELDMETADATA_ENCODING_DEFAULTBINARY 14839 /* Object */ +#define UA_NS0ID_STRUCTUREFIELD_ENCODING_DEFAULTBINARY 14844 /* Object */ +#define UA_NS0ID_ENUMFIELD_ENCODING_DEFAULTBINARY 14845 /* Object */ +#define UA_NS0ID_KEYVALUEPAIR_ENCODING_DEFAULTBINARY 14846 /* Object */ +#define UA_NS0ID_CONFIGURATIONVERSIONDATATYPE_ENCODING_DEFAULTBINARY 14847 /* Object */ +#define UA_NS0ID_FIELDTARGETDATATYPE_ENCODING_DEFAULTBINARY 14848 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETMETADATATYPE 14849 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETMETADATATYPE_DATATYPEVERSION 14850 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETMETADATATYPE_DICTIONARYFRAGMENT 14851 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDMETADATA 14852 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDMETADATA_DATATYPEVERSION 14853 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDMETADATA_DICTIONARYFRAGMENT 14854 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDESCRIPTION 14855 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDESCRIPTION_DATATYPEVERSION 14856 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDESCRIPTION_DICTIONARYFRAGMENT 14857 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMFIELD 14870 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMFIELD_DATATYPEVERSION 14871 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMFIELD_DICTIONARYFRAGMENT 14872 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_KEYVALUEPAIR 14873 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_KEYVALUEPAIR_DATATYPEVERSION 14874 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_KEYVALUEPAIR_DICTIONARYFRAGMENT 14875 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONFIGURATIONVERSIONDATATYPE 14876 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONFIGURATIONVERSIONDATATYPE_DATATYPEVERSION 14877 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONFIGURATIONVERSIONDATATYPE_DICTIONARYFRAGMENT 14878 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDTARGETDATATYPE_DATATYPEVERSION 14880 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDTARGETDATATYPE_DICTIONARYFRAGMENT 14881 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_EXPIRATIONLIMIT 14900 /* Variable */ +#define UA_NS0ID_DATASETTOWRITER 14936 /* ReferenceType */ +#define UA_NS0ID_DATATYPEDICTIONARYTYPE_DEPRECATED 15001 /* Variable */ +#define UA_NS0ID_MAXCHARACTERS 15002 /* Variable */ +#define UA_NS0ID_SERVERTYPE_URISVERSION 15003 /* Variable */ +#define UA_NS0ID_SERVER_URISVERSION 15004 /* Variable */ +#define UA_NS0ID_SIMPLETYPEDESCRIPTION 15005 /* DataType */ +#define UA_NS0ID_UABINARYFILEDATATYPE 15006 /* DataType */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTDATATYPE 15007 /* DataType */ +#define UA_NS0ID_BROKERTRANSPORTQUALITYOFSERVICE 15008 /* DataType */ +#define UA_NS0ID_BROKERTRANSPORTQUALITYOFSERVICE_ENUMSTRINGS 15009 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER_KEYLIFETIME 15010 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER_SECURITYPOLICYURI 15011 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER_MAXFUTUREKEYCOUNT 15012 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE 15013 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_EVENTID 15014 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_EVENTTYPE 15015 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_SOURCENODE 15016 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_SOURCENAME 15017 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_TIME 15018 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_RECEIVETIME 15019 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_LOCALTIME 15020 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_MESSAGE 15021 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_SEVERITY 15022 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_ACTIONTIMESTAMP 15023 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_STATUS 15024 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_SERVERID 15025 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_CLIENTAUDITENTRYID 15026 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_CLIENTUSERID 15027 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_METHODID 15028 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONRESETEVENTTYPE_INPUTARGUMENTS 15029 /* Variable */ +#define UA_NS0ID_PERMISSIONTYPE_OPTIONSETVALUES 15030 /* Variable */ +#define UA_NS0ID_ACCESSLEVELTYPE 15031 /* DataType */ +#define UA_NS0ID_ACCESSLEVELTYPE_OPTIONSETVALUES 15032 /* Variable */ +#define UA_NS0ID_EVENTNOTIFIERTYPE 15033 /* DataType */ +#define UA_NS0ID_EVENTNOTIFIERTYPE_OPTIONSETVALUES 15034 /* Variable */ +#define UA_NS0ID_ACCESSRESTRICTIONTYPE_OPTIONSETVALUES 15035 /* Variable */ +#define UA_NS0ID_ATTRIBUTEWRITEMASK_OPTIONSETVALUES 15036 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DEPRECATED 15037 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODINPUTVALUES 15038 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DEPRECATED 15039 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_PROGRAMDIAGNOSTIC_LASTMETHODOUTPUTVALUES 15040 /* Variable */ +#define UA_NS0ID_KEYVALUEPAIR_ENCODING_DEFAULTJSON 15041 /* Object */ +#define UA_NS0ID_IDENTITYMAPPINGRULETYPE_ENCODING_DEFAULTJSON 15042 /* Object */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER_MAXPASTKEYCOUNT 15043 /* Variable */ +#define UA_NS0ID_TRUSTLISTDATATYPE_ENCODING_DEFAULTJSON 15044 /* Object */ +#define UA_NS0ID_DECIMALDATATYPE_ENCODING_DEFAULTJSON 15045 /* Object */ +#define UA_NS0ID_SECURITYGROUPTYPE_KEYLIFETIME 15046 /* Variable */ +#define UA_NS0ID_SECURITYGROUPTYPE_SECURITYPOLICYURI 15047 /* Variable */ +#define UA_NS0ID_SECURITYGROUPTYPE_MAXFUTUREKEYCOUNT 15048 /* Variable */ +#define UA_NS0ID_CONFIGURATIONVERSIONDATATYPE_ENCODING_DEFAULTJSON 15049 /* Object */ +#define UA_NS0ID_DATASETMETADATATYPE_ENCODING_DEFAULTJSON 15050 /* Object */ +#define UA_NS0ID_FIELDMETADATA_ENCODING_DEFAULTJSON 15051 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_MODIFYFIELDSELECTION 15052 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_MODIFYFIELDSELECTION_INPUTARGUMENTS 15053 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPEMODIFYFIELDSELECTIONMETHODTYPE 15054 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPEMODIFYFIELDSELECTIONMETHODTYPE_INPUTARGUMENTS 15055 /* Variable */ +#define UA_NS0ID_SECURITYGROUPTYPE_MAXPASTKEYCOUNT 15056 /* Variable */ +#define UA_NS0ID_DATATYPEDESCRIPTION_ENCODING_DEFAULTJSON 15057 /* Object */ +#define UA_NS0ID_STRUCTUREDESCRIPTION_ENCODING_DEFAULTJSON 15058 /* Object */ +#define UA_NS0ID_ENUMDESCRIPTION_ENCODING_DEFAULTJSON 15059 /* Object */ +#define UA_NS0ID_PUBLISHEDVARIABLEDATATYPE_ENCODING_DEFAULTJSON 15060 /* Object */ +#define UA_NS0ID_FIELDTARGETDATATYPE_ENCODING_DEFAULTJSON 15061 /* Object */ +#define UA_NS0ID_ROLEPERMISSIONTYPE_ENCODING_DEFAULTJSON 15062 /* Object */ +#define UA_NS0ID_DATATYPEDEFINITION_ENCODING_DEFAULTJSON 15063 /* Object */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE 15064 /* ObjectType */ +#define UA_NS0ID_STRUCTUREFIELD_ENCODING_DEFAULTJSON 15065 /* Object */ +#define UA_NS0ID_STRUCTUREDEFINITION_ENCODING_DEFAULTJSON 15066 /* Object */ +#define UA_NS0ID_ENUMDEFINITION_ENCODING_DEFAULTJSON 15067 /* Object */ +#define UA_NS0ID_NODE_ENCODING_DEFAULTJSON 15068 /* Object */ +#define UA_NS0ID_INSTANCENODE_ENCODING_DEFAULTJSON 15069 /* Object */ +#define UA_NS0ID_TYPENODE_ENCODING_DEFAULTJSON 15070 /* Object */ +#define UA_NS0ID_OBJECTNODE_ENCODING_DEFAULTJSON 15071 /* Object */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE_DISCOVERYADDRESS 15072 /* Object */ +#define UA_NS0ID_OBJECTTYPENODE_ENCODING_DEFAULTJSON 15073 /* Object */ +#define UA_NS0ID_VARIABLENODE_ENCODING_DEFAULTJSON 15074 /* Object */ +#define UA_NS0ID_VARIABLETYPENODE_ENCODING_DEFAULTJSON 15075 /* Object */ +#define UA_NS0ID_REFERENCETYPENODE_ENCODING_DEFAULTJSON 15076 /* Object */ +#define UA_NS0ID_METHODNODE_ENCODING_DEFAULTJSON 15077 /* Object */ +#define UA_NS0ID_VIEWNODE_ENCODING_DEFAULTJSON 15078 /* Object */ +#define UA_NS0ID_DATATYPENODE_ENCODING_DEFAULTJSON 15079 /* Object */ +#define UA_NS0ID_REFERENCENODE_ENCODING_DEFAULTJSON 15080 /* Object */ +#define UA_NS0ID_ARGUMENT_ENCODING_DEFAULTJSON 15081 /* Object */ +#define UA_NS0ID_ENUMVALUETYPE_ENCODING_DEFAULTJSON 15082 /* Object */ +#define UA_NS0ID_ENUMFIELD_ENCODING_DEFAULTJSON 15083 /* Object */ +#define UA_NS0ID_OPTIONSET_ENCODING_DEFAULTJSON 15084 /* Object */ +#define UA_NS0ID_UNION_ENCODING_DEFAULTJSON 15085 /* Object */ +#define UA_NS0ID_TIMEZONEDATATYPE_ENCODING_DEFAULTJSON 15086 /* Object */ +#define UA_NS0ID_APPLICATIONDESCRIPTION_ENCODING_DEFAULTJSON 15087 /* Object */ +#define UA_NS0ID_REQUESTHEADER_ENCODING_DEFAULTJSON 15088 /* Object */ +#define UA_NS0ID_RESPONSEHEADER_ENCODING_DEFAULTJSON 15089 /* Object */ +#define UA_NS0ID_SERVICEFAULT_ENCODING_DEFAULTJSON 15090 /* Object */ +#define UA_NS0ID_SESSIONLESSINVOKEREQUESTTYPE_ENCODING_DEFAULTJSON 15091 /* Object */ +#define UA_NS0ID_SESSIONLESSINVOKERESPONSETYPE_ENCODING_DEFAULTJSON 15092 /* Object */ +#define UA_NS0ID_FINDSERVERSREQUEST_ENCODING_DEFAULTJSON 15093 /* Object */ +#define UA_NS0ID_FINDSERVERSRESPONSE_ENCODING_DEFAULTJSON 15094 /* Object */ +#define UA_NS0ID_SERVERONNETWORK_ENCODING_DEFAULTJSON 15095 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKREQUEST_ENCODING_DEFAULTJSON 15096 /* Object */ +#define UA_NS0ID_FINDSERVERSONNETWORKRESPONSE_ENCODING_DEFAULTJSON 15097 /* Object */ +#define UA_NS0ID_USERTOKENPOLICY_ENCODING_DEFAULTJSON 15098 /* Object */ +#define UA_NS0ID_ENDPOINTDESCRIPTION_ENCODING_DEFAULTJSON 15099 /* Object */ +#define UA_NS0ID_GETENDPOINTSREQUEST_ENCODING_DEFAULTJSON 15100 /* Object */ +#define UA_NS0ID_GETENDPOINTSRESPONSE_ENCODING_DEFAULTJSON 15101 /* Object */ +#define UA_NS0ID_REGISTEREDSERVER_ENCODING_DEFAULTJSON 15102 /* Object */ +#define UA_NS0ID_REGISTERSERVERREQUEST_ENCODING_DEFAULTJSON 15103 /* Object */ +#define UA_NS0ID_REGISTERSERVERRESPONSE_ENCODING_DEFAULTJSON 15104 /* Object */ +#define UA_NS0ID_DISCOVERYCONFIGURATION_ENCODING_DEFAULTJSON 15105 /* Object */ +#define UA_NS0ID_MDNSDISCOVERYCONFIGURATION_ENCODING_DEFAULTJSON 15106 /* Object */ +#define UA_NS0ID_REGISTERSERVER2REQUEST_ENCODING_DEFAULTJSON 15107 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETTYPE 15108 /* ObjectType */ +#define UA_NS0ID_CHOICESTATETYPE 15109 /* ObjectType */ +#define UA_NS0ID_CHOICESTATETYPE_STATENUMBER 15110 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPE 15111 /* ObjectType */ +#define UA_NS0ID_HASGUARD 15112 /* ReferenceType */ +#define UA_NS0ID_GUARDVARIABLETYPE 15113 /* VariableType */ +#define UA_NS0ID_TARGETVARIABLESTYPE_TARGETVARIABLES 15114 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPE_ADDTARGETVARIABLES 15115 /* Method */ +#define UA_NS0ID_TARGETVARIABLESTYPE_ADDTARGETVARIABLES_INPUTARGUMENTS 15116 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPE_ADDTARGETVARIABLES_OUTPUTARGUMENTS 15117 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPE_REMOVETARGETVARIABLES 15118 /* Method */ +#define UA_NS0ID_TARGETVARIABLESTYPE_REMOVETARGETVARIABLES_INPUTARGUMENTS 15119 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPE_REMOVETARGETVARIABLES_OUTPUTARGUMENTS 15120 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPEADDTARGETVARIABLESMETHODTYPE 15121 /* Method */ +#define UA_NS0ID_TARGETVARIABLESTYPEADDTARGETVARIABLESMETHODTYPE_INPUTARGUMENTS 15122 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPEADDTARGETVARIABLESMETHODTYPE_OUTPUTARGUMENTS 15123 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPEREMOVETARGETVARIABLESMETHODTYPE 15124 /* Method */ +#define UA_NS0ID_TARGETVARIABLESTYPEREMOVETARGETVARIABLESMETHODTYPE_INPUTARGUMENTS 15125 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESTYPEREMOVETARGETVARIABLESMETHODTYPE_OUTPUTARGUMENTS 15126 /* Variable */ +#define UA_NS0ID_SUBSCRIBEDDATASETMIRRORTYPE 15127 /* ObjectType */ +#define UA_NS0ID_EXPRESSIONGUARDVARIABLETYPE 15128 /* VariableType */ +#define UA_NS0ID_EXPRESSIONGUARDVARIABLETYPE_EXPRESSION 15129 /* Variable */ +#define UA_NS0ID_REGISTERSERVER2RESPONSE_ENCODING_DEFAULTJSON 15130 /* Object */ +#define UA_NS0ID_CHANNELSECURITYTOKEN_ENCODING_DEFAULTJSON 15131 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELREQUEST_ENCODING_DEFAULTJSON 15132 /* Object */ +#define UA_NS0ID_OPENSECURECHANNELRESPONSE_ENCODING_DEFAULTJSON 15133 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELREQUEST_ENCODING_DEFAULTJSON 15134 /* Object */ +#define UA_NS0ID_CLOSESECURECHANNELRESPONSE_ENCODING_DEFAULTJSON 15135 /* Object */ +#define UA_NS0ID_SIGNEDSOFTWARECERTIFICATE_ENCODING_DEFAULTJSON 15136 /* Object */ +#define UA_NS0ID_SIGNATUREDATA_ENCODING_DEFAULTJSON 15137 /* Object */ +#define UA_NS0ID_CREATESESSIONREQUEST_ENCODING_DEFAULTJSON 15138 /* Object */ +#define UA_NS0ID_CREATESESSIONRESPONSE_ENCODING_DEFAULTJSON 15139 /* Object */ +#define UA_NS0ID_USERIDENTITYTOKEN_ENCODING_DEFAULTJSON 15140 /* Object */ +#define UA_NS0ID_ANONYMOUSIDENTITYTOKEN_ENCODING_DEFAULTJSON 15141 /* Object */ +#define UA_NS0ID_USERNAMEIDENTITYTOKEN_ENCODING_DEFAULTJSON 15142 /* Object */ +#define UA_NS0ID_X509IDENTITYTOKEN_ENCODING_DEFAULTJSON 15143 /* Object */ +#define UA_NS0ID_ISSUEDIDENTITYTOKEN_ENCODING_DEFAULTJSON 15144 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONREQUEST_ENCODING_DEFAULTJSON 15145 /* Object */ +#define UA_NS0ID_ACTIVATESESSIONRESPONSE_ENCODING_DEFAULTJSON 15146 /* Object */ +#define UA_NS0ID_CLOSESESSIONREQUEST_ENCODING_DEFAULTJSON 15147 /* Object */ +#define UA_NS0ID_CLOSESESSIONRESPONSE_ENCODING_DEFAULTJSON 15148 /* Object */ +#define UA_NS0ID_CANCELREQUEST_ENCODING_DEFAULTJSON 15149 /* Object */ +#define UA_NS0ID_CANCELRESPONSE_ENCODING_DEFAULTJSON 15150 /* Object */ +#define UA_NS0ID_NODEATTRIBUTES_ENCODING_DEFAULTJSON 15151 /* Object */ +#define UA_NS0ID_OBJECTATTRIBUTES_ENCODING_DEFAULTJSON 15152 /* Object */ +#define UA_NS0ID_VARIABLEATTRIBUTES_ENCODING_DEFAULTJSON 15153 /* Object */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE_DISCOVERYADDRESS_NETWORKINTERFACE 15154 /* Variable */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTTYPE 15155 /* ObjectType */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTTYPE_RESOURCEURI 15156 /* Variable */ +#define UA_NS0ID_METHODATTRIBUTES_ENCODING_DEFAULTJSON 15157 /* Object */ +#define UA_NS0ID_OBJECTTYPEATTRIBUTES_ENCODING_DEFAULTJSON 15158 /* Object */ +#define UA_NS0ID_VARIABLETYPEATTRIBUTES_ENCODING_DEFAULTJSON 15159 /* Object */ +#define UA_NS0ID_REFERENCETYPEATTRIBUTES_ENCODING_DEFAULTJSON 15160 /* Object */ +#define UA_NS0ID_DATATYPEATTRIBUTES_ENCODING_DEFAULTJSON 15161 /* Object */ +#define UA_NS0ID_VIEWATTRIBUTES_ENCODING_DEFAULTJSON 15162 /* Object */ +#define UA_NS0ID_GENERICATTRIBUTEVALUE_ENCODING_DEFAULTJSON 15163 /* Object */ +#define UA_NS0ID_GENERICATTRIBUTES_ENCODING_DEFAULTJSON 15164 /* Object */ +#define UA_NS0ID_ADDNODESITEM_ENCODING_DEFAULTJSON 15165 /* Object */ +#define UA_NS0ID_ADDNODESRESULT_ENCODING_DEFAULTJSON 15166 /* Object */ +#define UA_NS0ID_ADDNODESREQUEST_ENCODING_DEFAULTJSON 15167 /* Object */ +#define UA_NS0ID_ADDNODESRESPONSE_ENCODING_DEFAULTJSON 15168 /* Object */ +#define UA_NS0ID_ADDREFERENCESITEM_ENCODING_DEFAULTJSON 15169 /* Object */ +#define UA_NS0ID_ADDREFERENCESREQUEST_ENCODING_DEFAULTJSON 15170 /* Object */ +#define UA_NS0ID_ADDREFERENCESRESPONSE_ENCODING_DEFAULTJSON 15171 /* Object */ +#define UA_NS0ID_DELETENODESITEM_ENCODING_DEFAULTJSON 15172 /* Object */ +#define UA_NS0ID_DELETENODESREQUEST_ENCODING_DEFAULTJSON 15173 /* Object */ +#define UA_NS0ID_DELETENODESRESPONSE_ENCODING_DEFAULTJSON 15174 /* Object */ +#define UA_NS0ID_DELETEREFERENCESITEM_ENCODING_DEFAULTJSON 15175 /* Object */ +#define UA_NS0ID_DELETEREFERENCESREQUEST_ENCODING_DEFAULTJSON 15176 /* Object */ +#define UA_NS0ID_DELETEREFERENCESRESPONSE_ENCODING_DEFAULTJSON 15177 /* Object */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTTYPE_AUTHENTICATIONPROFILEURI 15178 /* Variable */ +#define UA_NS0ID_VIEWDESCRIPTION_ENCODING_DEFAULTJSON 15179 /* Object */ +#define UA_NS0ID_BROWSEDESCRIPTION_ENCODING_DEFAULTJSON 15180 /* Object */ +#define UA_NS0ID_USERCREDENTIALCERTIFICATETYPE 15181 /* ObjectType */ +#define UA_NS0ID_REFERENCEDESCRIPTION_ENCODING_DEFAULTJSON 15182 /* Object */ +#define UA_NS0ID_BROWSERESULT_ENCODING_DEFAULTJSON 15183 /* Object */ +#define UA_NS0ID_BROWSEREQUEST_ENCODING_DEFAULTJSON 15184 /* Object */ +#define UA_NS0ID_BROWSERESPONSE_ENCODING_DEFAULTJSON 15185 /* Object */ +#define UA_NS0ID_BROWSENEXTREQUEST_ENCODING_DEFAULTJSON 15186 /* Object */ +#define UA_NS0ID_BROWSENEXTRESPONSE_ENCODING_DEFAULTJSON 15187 /* Object */ +#define UA_NS0ID_RELATIVEPATHELEMENT_ENCODING_DEFAULTJSON 15188 /* Object */ +#define UA_NS0ID_RELATIVEPATH_ENCODING_DEFAULTJSON 15189 /* Object */ +#define UA_NS0ID_BROWSEPATH_ENCODING_DEFAULTJSON 15190 /* Object */ +#define UA_NS0ID_BROWSEPATHTARGET_ENCODING_DEFAULTJSON 15191 /* Object */ +#define UA_NS0ID_BROWSEPATHRESULT_ENCODING_DEFAULTJSON 15192 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSREQUEST_ENCODING_DEFAULTJSON 15193 /* Object */ +#define UA_NS0ID_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE_ENCODING_DEFAULTJSON 15194 /* Object */ +#define UA_NS0ID_REGISTERNODESREQUEST_ENCODING_DEFAULTJSON 15195 /* Object */ +#define UA_NS0ID_REGISTERNODESRESPONSE_ENCODING_DEFAULTJSON 15196 /* Object */ +#define UA_NS0ID_UNREGISTERNODESREQUEST_ENCODING_DEFAULTJSON 15197 /* Object */ +#define UA_NS0ID_UNREGISTERNODESRESPONSE_ENCODING_DEFAULTJSON 15198 /* Object */ +#define UA_NS0ID_ENDPOINTCONFIGURATION_ENCODING_DEFAULTJSON 15199 /* Object */ +#define UA_NS0ID_QUERYDATADESCRIPTION_ENCODING_DEFAULTJSON 15200 /* Object */ +#define UA_NS0ID_NODETYPEDESCRIPTION_ENCODING_DEFAULTJSON 15201 /* Object */ +#define UA_NS0ID_QUERYDATASET_ENCODING_DEFAULTJSON 15202 /* Object */ +#define UA_NS0ID_NODEREFERENCE_ENCODING_DEFAULTJSON 15203 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENT_ENCODING_DEFAULTJSON 15204 /* Object */ +#define UA_NS0ID_CONTENTFILTER_ENCODING_DEFAULTJSON 15205 /* Object */ +#define UA_NS0ID_FILTEROPERAND_ENCODING_DEFAULTJSON 15206 /* Object */ +#define UA_NS0ID_ELEMENTOPERAND_ENCODING_DEFAULTJSON 15207 /* Object */ +#define UA_NS0ID_LITERALOPERAND_ENCODING_DEFAULTJSON 15208 /* Object */ +#define UA_NS0ID_ATTRIBUTEOPERAND_ENCODING_DEFAULTJSON 15209 /* Object */ +#define UA_NS0ID_SIMPLEATTRIBUTEOPERAND_ENCODING_DEFAULTJSON 15210 /* Object */ +#define UA_NS0ID_CONTENTFILTERELEMENTRESULT_ENCODING_DEFAULTJSON 15211 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYKEYS 15212 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYKEYS_INPUTARGUMENTS 15213 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYKEYS_OUTPUTARGUMENTS 15214 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYKEYS 15215 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYKEYS_INPUTARGUMENTS 15216 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYKEYS_OUTPUTARGUMENTS 15217 /* Variable */ +#define UA_NS0ID_GETSECURITYKEYSMETHODTYPE 15218 /* Method */ +#define UA_NS0ID_GETSECURITYKEYSMETHODTYPE_INPUTARGUMENTS 15219 /* Variable */ +#define UA_NS0ID_GETSECURITYKEYSMETHODTYPE_OUTPUTARGUMENTS 15220 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_DATASETMETADATA 15221 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER 15222 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS 15223 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_STATE 15224 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_ENABLE 15225 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_DISABLE 15226 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_TRANSPORTSETTINGS 15227 /* Object */ +#define UA_NS0ID_CONTENTFILTERRESULT_ENCODING_DEFAULTJSON 15228 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETMETADATA 15229 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER 15230 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS 15231 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_STATE 15232 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_ENABLE 15233 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_DISABLE 15234 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_TRANSPORTSETTINGS 15235 /* Object */ +#define UA_NS0ID_PARSINGRESULT_ENCODING_DEFAULTJSON 15236 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETMETADATA 15237 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER 15238 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS 15239 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_STATE 15240 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_ENABLE 15241 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_DISABLE 15242 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_TRANSPORTSETTINGS 15243 /* Object */ +#define UA_NS0ID_QUERYFIRSTREQUEST_ENCODING_DEFAULTJSON 15244 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETMETADATA 15245 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTTYPE_RESOURCEURI 15246 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTTYPE_AUTHENTICATIONPROFILEURI 15247 /* Variable */ +#define UA_NS0ID_CREATECREDENTIALMETHODTYPE 15248 /* Method */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTTYPE_REQUESTEDDELIVERYGUARANTEE 15249 /* Variable */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_RESOURCEURI 15250 /* Variable */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_AUTHENTICATIONPROFILEURI 15251 /* Variable */ +#define UA_NS0ID_QUERYFIRSTRESPONSE_ENCODING_DEFAULTJSON 15252 /* Object */ +#define UA_NS0ID_CREATECREDENTIALMETHODTYPE_INPUTARGUMENTS 15253 /* Variable */ +#define UA_NS0ID_QUERYNEXTREQUEST_ENCODING_DEFAULTJSON 15254 /* Object */ +#define UA_NS0ID_QUERYNEXTRESPONSE_ENCODING_DEFAULTJSON 15255 /* Object */ +#define UA_NS0ID_READVALUEID_ENCODING_DEFAULTJSON 15256 /* Object */ +#define UA_NS0ID_READREQUEST_ENCODING_DEFAULTJSON 15257 /* Object */ +#define UA_NS0ID_READRESPONSE_ENCODING_DEFAULTJSON 15258 /* Object */ +#define UA_NS0ID_HISTORYREADVALUEID_ENCODING_DEFAULTJSON 15259 /* Object */ +#define UA_NS0ID_HISTORYREADRESULT_ENCODING_DEFAULTJSON 15260 /* Object */ +#define UA_NS0ID_HISTORYREADDETAILS_ENCODING_DEFAULTJSON 15261 /* Object */ +#define UA_NS0ID_READEVENTDETAILS_ENCODING_DEFAULTJSON 15262 /* Object */ +#define UA_NS0ID_READRAWMODIFIEDDETAILS_ENCODING_DEFAULTJSON 15263 /* Object */ +#define UA_NS0ID_READPROCESSEDDETAILS_ENCODING_DEFAULTJSON 15264 /* Object */ +#define UA_NS0ID_PUBSUBGROUPTYPE_STATUS 15265 /* Object */ +#define UA_NS0ID_PUBSUBGROUPTYPE_STATUS_STATE 15266 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_STATUS_ENABLE 15267 /* Method */ +#define UA_NS0ID_PUBSUBGROUPTYPE_STATUS_DISABLE 15268 /* Method */ +#define UA_NS0ID_READATTIMEDETAILS_ENCODING_DEFAULTJSON 15269 /* Object */ +#define UA_NS0ID_HISTORYDATA_ENCODING_DEFAULTJSON 15270 /* Object */ +#define UA_NS0ID_MODIFICATIONINFO_ENCODING_DEFAULTJSON 15271 /* Object */ +#define UA_NS0ID_HISTORYMODIFIEDDATA_ENCODING_DEFAULTJSON 15272 /* Object */ +#define UA_NS0ID_HISTORYEVENT_ENCODING_DEFAULTJSON 15273 /* Object */ +#define UA_NS0ID_HISTORYREADREQUEST_ENCODING_DEFAULTJSON 15274 /* Object */ +#define UA_NS0ID_HISTORYREADRESPONSE_ENCODING_DEFAULTJSON 15275 /* Object */ +#define UA_NS0ID_WRITEVALUE_ENCODING_DEFAULTJSON 15276 /* Object */ +#define UA_NS0ID_WRITEREQUEST_ENCODING_DEFAULTJSON 15277 /* Object */ +#define UA_NS0ID_WRITERESPONSE_ENCODING_DEFAULTJSON 15278 /* Object */ +#define UA_NS0ID_HISTORYUPDATEDETAILS_ENCODING_DEFAULTJSON 15279 /* Object */ +#define UA_NS0ID_UPDATEDATADETAILS_ENCODING_DEFAULTJSON 15280 /* Object */ +#define UA_NS0ID_UPDATESTRUCTUREDATADETAILS_ENCODING_DEFAULTJSON 15281 /* Object */ +#define UA_NS0ID_UPDATEEVENTDETAILS_ENCODING_DEFAULTJSON 15282 /* Object */ +#define UA_NS0ID_DELETERAWMODIFIEDDETAILS_ENCODING_DEFAULTJSON 15283 /* Object */ +#define UA_NS0ID_DELETEATTIMEDETAILS_ENCODING_DEFAULTJSON 15284 /* Object */ +#define UA_NS0ID_DELETEEVENTDETAILS_ENCODING_DEFAULTJSON 15285 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESULT_ENCODING_DEFAULTJSON 15286 /* Object */ +#define UA_NS0ID_HISTORYUPDATEREQUEST_ENCODING_DEFAULTJSON 15287 /* Object */ +#define UA_NS0ID_HISTORYUPDATERESPONSE_ENCODING_DEFAULTJSON 15288 /* Object */ +#define UA_NS0ID_CALLMETHODREQUEST_ENCODING_DEFAULTJSON 15289 /* Object */ +#define UA_NS0ID_CALLMETHODRESULT_ENCODING_DEFAULTJSON 15290 /* Object */ +#define UA_NS0ID_CALLREQUEST_ENCODING_DEFAULTJSON 15291 /* Object */ +#define UA_NS0ID_CALLRESPONSE_ENCODING_DEFAULTJSON 15292 /* Object */ +#define UA_NS0ID_MONITORINGFILTER_ENCODING_DEFAULTJSON 15293 /* Object */ +#define UA_NS0ID_DATACHANGEFILTER_ENCODING_DEFAULTJSON 15294 /* Object */ +#define UA_NS0ID_EVENTFILTER_ENCODING_DEFAULTJSON 15295 /* Object */ +#define UA_NS0ID_HASDATASETWRITER 15296 /* ReferenceType */ +#define UA_NS0ID_HASDATASETREADER 15297 /* ReferenceType */ +#define UA_NS0ID_DATASETWRITERTYPE 15298 /* ObjectType */ +#define UA_NS0ID_DATASETWRITERTYPE_STATUS 15299 /* Object */ +#define UA_NS0ID_DATASETWRITERTYPE_STATUS_STATE 15300 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_STATUS_ENABLE 15301 /* Method */ +#define UA_NS0ID_DATASETWRITERTYPE_STATUS_DISABLE 15302 /* Method */ +#define UA_NS0ID_DATASETWRITERTYPE_TRANSPORTSETTINGS 15303 /* Object */ +#define UA_NS0ID_AGGREGATECONFIGURATION_ENCODING_DEFAULTJSON 15304 /* Object */ +#define UA_NS0ID_DATASETWRITERTRANSPORTTYPE 15305 /* ObjectType */ +#define UA_NS0ID_DATASETREADERTYPE 15306 /* ObjectType */ +#define UA_NS0ID_DATASETREADERTYPE_STATUS 15307 /* Object */ +#define UA_NS0ID_DATASETREADERTYPE_STATUS_STATE 15308 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_STATUS_ENABLE 15309 /* Method */ +#define UA_NS0ID_DATASETREADERTYPE_STATUS_DISABLE 15310 /* Method */ +#define UA_NS0ID_DATASETREADERTYPE_TRANSPORTSETTINGS 15311 /* Object */ +#define UA_NS0ID_AGGREGATEFILTER_ENCODING_DEFAULTJSON 15312 /* Object */ +#define UA_NS0ID_MONITORINGFILTERRESULT_ENCODING_DEFAULTJSON 15313 /* Object */ +#define UA_NS0ID_EVENTFILTERRESULT_ENCODING_DEFAULTJSON 15314 /* Object */ +#define UA_NS0ID_AGGREGATEFILTERRESULT_ENCODING_DEFAULTJSON 15315 /* Object */ +#define UA_NS0ID_DATASETREADERTYPE_SUBSCRIBEDDATASET 15316 /* Object */ +#define UA_NS0ID_ELSEGUARDVARIABLETYPE 15317 /* VariableType */ +#define UA_NS0ID_BASEANALOGTYPE 15318 /* VariableType */ +#define UA_NS0ID_DATASETREADERTRANSPORTTYPE 15319 /* ObjectType */ +#define UA_NS0ID_MONITORINGPARAMETERS_ENCODING_DEFAULTJSON 15320 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATEREQUEST_ENCODING_DEFAULTJSON 15321 /* Object */ +#define UA_NS0ID_MONITOREDITEMCREATERESULT_ENCODING_DEFAULTJSON 15322 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSREQUEST_ENCODING_DEFAULTJSON 15323 /* Object */ +#define UA_NS0ID_CREATEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTJSON 15324 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYREQUEST_ENCODING_DEFAULTJSON 15325 /* Object */ +#define UA_NS0ID_MONITOREDITEMMODIFYRESULT_ENCODING_DEFAULTJSON 15326 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSREQUEST_ENCODING_DEFAULTJSON 15327 /* Object */ +#define UA_NS0ID_MODIFYMONITOREDITEMSRESPONSE_ENCODING_DEFAULTJSON 15328 /* Object */ +#define UA_NS0ID_SETMONITORINGMODEREQUEST_ENCODING_DEFAULTJSON 15329 /* Object */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_REQUESTEDDELIVERYGUARANTEE 15330 /* Variable */ +#define UA_NS0ID_SETMONITORINGMODERESPONSE_ENCODING_DEFAULTJSON 15331 /* Object */ +#define UA_NS0ID_SETTRIGGERINGREQUEST_ENCODING_DEFAULTJSON 15332 /* Object */ +#define UA_NS0ID_SETTRIGGERINGRESPONSE_ENCODING_DEFAULTJSON 15333 /* Object */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE_RESOURCEURI 15334 /* Variable */ +#define UA_NS0ID_DELETEMONITOREDITEMSREQUEST_ENCODING_DEFAULTJSON 15335 /* Object */ +#define UA_NS0ID_DELETEMONITOREDITEMSRESPONSE_ENCODING_DEFAULTJSON 15336 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONREQUEST_ENCODING_DEFAULTJSON 15337 /* Object */ +#define UA_NS0ID_CREATESUBSCRIPTIONRESPONSE_ENCODING_DEFAULTJSON 15338 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONREQUEST_ENCODING_DEFAULTJSON 15339 /* Object */ +#define UA_NS0ID_MODIFYSUBSCRIPTIONRESPONSE_ENCODING_DEFAULTJSON 15340 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODEREQUEST_ENCODING_DEFAULTJSON 15341 /* Object */ +#define UA_NS0ID_SETPUBLISHINGMODERESPONSE_ENCODING_DEFAULTJSON 15342 /* Object */ +#define UA_NS0ID_NOTIFICATIONMESSAGE_ENCODING_DEFAULTJSON 15343 /* Object */ +#define UA_NS0ID_NOTIFICATIONDATA_ENCODING_DEFAULTJSON 15344 /* Object */ +#define UA_NS0ID_DATACHANGENOTIFICATION_ENCODING_DEFAULTJSON 15345 /* Object */ +#define UA_NS0ID_MONITOREDITEMNOTIFICATION_ENCODING_DEFAULTJSON 15346 /* Object */ +#define UA_NS0ID_EVENTNOTIFICATIONLIST_ENCODING_DEFAULTJSON 15347 /* Object */ +#define UA_NS0ID_EVENTFIELDLIST_ENCODING_DEFAULTJSON 15348 /* Object */ +#define UA_NS0ID_HISTORYEVENTFIELDLIST_ENCODING_DEFAULTJSON 15349 /* Object */ +#define UA_NS0ID_STATUSCHANGENOTIFICATION_ENCODING_DEFAULTJSON 15350 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONACKNOWLEDGEMENT_ENCODING_DEFAULTJSON 15351 /* Object */ +#define UA_NS0ID_PUBLISHREQUEST_ENCODING_DEFAULTJSON 15352 /* Object */ +#define UA_NS0ID_PUBLISHRESPONSE_ENCODING_DEFAULTJSON 15353 /* Object */ +#define UA_NS0ID_REPUBLISHREQUEST_ENCODING_DEFAULTJSON 15354 /* Object */ +#define UA_NS0ID_REPUBLISHRESPONSE_ENCODING_DEFAULTJSON 15355 /* Object */ +#define UA_NS0ID_TRANSFERRESULT_ENCODING_DEFAULTJSON 15356 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSREQUEST_ENCODING_DEFAULTJSON 15357 /* Object */ +#define UA_NS0ID_TRANSFERSUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTJSON 15358 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSREQUEST_ENCODING_DEFAULTJSON 15359 /* Object */ +#define UA_NS0ID_DELETESUBSCRIPTIONSRESPONSE_ENCODING_DEFAULTJSON 15360 /* Object */ +#define UA_NS0ID_BUILDINFO_ENCODING_DEFAULTJSON 15361 /* Object */ +#define UA_NS0ID_REDUNDANTSERVERDATATYPE_ENCODING_DEFAULTJSON 15362 /* Object */ +#define UA_NS0ID_ENDPOINTURLLISTDATATYPE_ENCODING_DEFAULTJSON 15363 /* Object */ +#define UA_NS0ID_NETWORKGROUPDATATYPE_ENCODING_DEFAULTJSON 15364 /* Object */ +#define UA_NS0ID_SAMPLINGINTERVALDIAGNOSTICSDATATYPE_ENCODING_DEFAULTJSON 15365 /* Object */ +#define UA_NS0ID_SERVERDIAGNOSTICSSUMMARYDATATYPE_ENCODING_DEFAULTJSON 15366 /* Object */ +#define UA_NS0ID_SERVERSTATUSDATATYPE_ENCODING_DEFAULTJSON 15367 /* Object */ +#define UA_NS0ID_SESSIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTJSON 15368 /* Object */ +#define UA_NS0ID_SESSIONSECURITYDIAGNOSTICSDATATYPE_ENCODING_DEFAULTJSON 15369 /* Object */ +#define UA_NS0ID_SERVICECOUNTERDATATYPE_ENCODING_DEFAULTJSON 15370 /* Object */ +#define UA_NS0ID_STATUSRESULT_ENCODING_DEFAULTJSON 15371 /* Object */ +#define UA_NS0ID_SUBSCRIPTIONDIAGNOSTICSDATATYPE_ENCODING_DEFAULTJSON 15372 /* Object */ +#define UA_NS0ID_MODELCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTJSON 15373 /* Object */ +#define UA_NS0ID_SEMANTICCHANGESTRUCTUREDATATYPE_ENCODING_DEFAULTJSON 15374 /* Object */ +#define UA_NS0ID_RANGE_ENCODING_DEFAULTJSON 15375 /* Object */ +#define UA_NS0ID_EUINFORMATION_ENCODING_DEFAULTJSON 15376 /* Object */ +#define UA_NS0ID_COMPLEXNUMBERTYPE_ENCODING_DEFAULTJSON 15377 /* Object */ +#define UA_NS0ID_DOUBLECOMPLEXNUMBERTYPE_ENCODING_DEFAULTJSON 15378 /* Object */ +#define UA_NS0ID_AXISINFORMATION_ENCODING_DEFAULTJSON 15379 /* Object */ +#define UA_NS0ID_XVTYPE_ENCODING_DEFAULTJSON 15380 /* Object */ +#define UA_NS0ID_PROGRAMDIAGNOSTICDATATYPE_ENCODING_DEFAULTJSON 15381 /* Object */ +#define UA_NS0ID_ANNOTATION_ENCODING_DEFAULTJSON 15382 /* Object */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE 15383 /* VariableType */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_CREATESESSIONID 15384 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_CREATECLIENTNAME 15385 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_INVOCATIONCREATIONTIME 15386 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTTRANSITIONTIME 15387 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODCALL 15388 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODSESSIONID 15389 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODINPUTARGUMENTS 15390 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODOUTPUTARGUMENTS 15391 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODINPUTVALUES 15392 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODOUTPUTVALUES 15393 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODCALLTIME 15394 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2TYPE_LASTMETHODRETURNSTATUS 15395 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2DATATYPE 15396 /* DataType */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2DATATYPE_ENCODING_DEFAULTBINARY 15397 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE 15398 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE_DATATYPEVERSION 15399 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE_DICTIONARYFRAGMENT 15400 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2DATATYPE_ENCODING_DEFAULTXML 15401 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE 15402 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE_DATATYPEVERSION 15403 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PROGRAMDIAGNOSTIC2DATATYPE_DICTIONARYFRAGMENT 15404 /* Variable */ +#define UA_NS0ID_PROGRAMDIAGNOSTIC2DATATYPE_ENCODING_DEFAULTJSON 15405 /* Object */ +#define UA_NS0ID_ACCESSLEVELEXTYPE 15406 /* DataType */ +#define UA_NS0ID_ACCESSLEVELEXTYPE_OPTIONSETVALUES 15407 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_APPLICATIONSEXCLUDE 15408 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ENDPOINTSEXCLUDE 15409 /* Variable */ +#define UA_NS0ID_ROLETYPE_APPLICATIONSEXCLUDE 15410 /* Variable */ +#define UA_NS0ID_ROLETYPE_ENDPOINTSEXCLUDE 15411 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_APPLICATIONSEXCLUDE 15412 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ENDPOINTSEXCLUDE 15413 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_APPLICATIONSEXCLUDE 15414 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ENDPOINTSEXCLUDE 15415 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_APPLICATIONSEXCLUDE 15416 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ENDPOINTSEXCLUDE 15417 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_APPLICATIONSEXCLUDE 15418 /* Variable */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE_AUTHENTICATIONPROFILEURI 15419 /* Variable */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE_REQUESTEDDELIVERYGUARANTEE 15420 /* Variable */ +#define UA_NS0ID_SIMPLETYPEDESCRIPTION_ENCODING_DEFAULTBINARY 15421 /* Object */ +#define UA_NS0ID_UABINARYFILEDATATYPE_ENCODING_DEFAULTBINARY 15422 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ENDPOINTSEXCLUDE 15423 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_APPLICATIONSEXCLUDE 15424 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ENDPOINTSEXCLUDE 15425 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_APPLICATIONSEXCLUDE 15426 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ENDPOINTSEXCLUDE 15427 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_APPLICATIONSEXCLUDE 15428 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ENDPOINTSEXCLUDE 15429 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_APPLICATIONSEXCLUDE 15430 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYGROUP 15431 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYGROUP_INPUTARGUMENTS 15432 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_GETSECURITYGROUP_OUTPUTARGUMENTS 15433 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS 15434 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS_ADDSECURITYGROUP 15435 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS_ADDSECURITYGROUP_INPUTARGUMENTS 15436 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS_ADDSECURITYGROUP_OUTPUTARGUMENTS 15437 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS_REMOVESECURITYGROUP 15438 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SECURITYGROUPS_REMOVESECURITYGROUP_INPUTARGUMENTS 15439 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYGROUP 15440 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYGROUP_INPUTARGUMENTS 15441 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_GETSECURITYGROUP_OUTPUTARGUMENTS 15442 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS 15443 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS_ADDSECURITYGROUP 15444 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS_ADDSECURITYGROUP_INPUTARGUMENTS 15445 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS_ADDSECURITYGROUP_OUTPUTARGUMENTS 15446 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS_REMOVESECURITYGROUP 15447 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SECURITYGROUPS_REMOVESECURITYGROUP_INPUTARGUMENTS 15448 /* Variable */ +#define UA_NS0ID_GETSECURITYGROUPMETHODTYPE 15449 /* Method */ +#define UA_NS0ID_GETSECURITYGROUPMETHODTYPE_INPUTARGUMENTS 15450 /* Variable */ +#define UA_NS0ID_GETSECURITYGROUPMETHODTYPE_OUTPUTARGUMENTS 15451 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE 15452 /* ObjectType */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER 15453 /* Object */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER_ADDSECURITYGROUP 15454 /* Method */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER_ADDSECURITYGROUP_INPUTARGUMENTS 15455 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER_ADDSECURITYGROUP_OUTPUTARGUMENTS 15456 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER_REMOVESECURITYGROUP 15457 /* Method */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPFOLDERNAME_PLACEHOLDER_REMOVESECURITYGROUP_INPUTARGUMENTS 15458 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER 15459 /* Object */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_SECURITYGROUPNAME_PLACEHOLDER_SECURITYGROUPID 15460 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_ADDSECURITYGROUP 15461 /* Method */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_ADDSECURITYGROUP_INPUTARGUMENTS 15462 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_ADDSECURITYGROUP_OUTPUTARGUMENTS 15463 /* Variable */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_REMOVESECURITYGROUP 15464 /* Method */ +#define UA_NS0ID_SECURITYGROUPFOLDERTYPE_REMOVESECURITYGROUP_INPUTARGUMENTS 15465 /* Variable */ +#define UA_NS0ID_ADDSECURITYGROUPMETHODTYPE 15466 /* Method */ +#define UA_NS0ID_ADDSECURITYGROUPMETHODTYPE_INPUTARGUMENTS 15467 /* Variable */ +#define UA_NS0ID_ADDSECURITYGROUPMETHODTYPE_OUTPUTARGUMENTS 15468 /* Variable */ +#define UA_NS0ID_REMOVESECURITYGROUPMETHODTYPE 15469 /* Method */ +#define UA_NS0ID_REMOVESECURITYGROUPMETHODTYPE_INPUTARGUMENTS 15470 /* Variable */ +#define UA_NS0ID_SECURITYGROUPTYPE 15471 /* ObjectType */ +#define UA_NS0ID_SECURITYGROUPTYPE_SECURITYGROUPID 15472 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS 15473 /* Object */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS_ADDEXTENSIONFIELD 15474 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS_ADDEXTENSIONFIELD_INPUTARGUMENTS 15475 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS_ADDEXTENSIONFIELD_OUTPUTARGUMENTS 15476 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD 15477 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD_INPUTARGUMENTS 15478 /* Variable */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15479 /* Object */ +#define UA_NS0ID_WRITERGROUPDATATYPE 15480 /* DataType */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS 15481 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD 15482 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_INPUTARGUMENTS 15483 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_OUTPUTARGUMENTS 15484 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD 15485 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD_INPUTARGUMENTS 15486 /* Variable */ +#define UA_NS0ID_STRUCTUREDESCRIPTION 15487 /* DataType */ +#define UA_NS0ID_ENUMDESCRIPTION 15488 /* DataType */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE 15489 /* ObjectType */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_EXTENSIONFIELDNAME_PLACEHOLDER 15490 /* Variable */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_ADDEXTENSIONFIELD 15491 /* Method */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_ADDEXTENSIONFIELD_INPUTARGUMENTS 15492 /* Variable */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_ADDEXTENSIONFIELD_OUTPUTARGUMENTS 15493 /* Variable */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_REMOVEEXTENSIONFIELD 15494 /* Method */ +#define UA_NS0ID_EXTENSIONFIELDSTYPE_REMOVEEXTENSIONFIELD_INPUTARGUMENTS 15495 /* Variable */ +#define UA_NS0ID_ADDEXTENSIONFIELDMETHODTYPE 15496 /* Method */ +#define UA_NS0ID_ADDEXTENSIONFIELDMETHODTYPE_INPUTARGUMENTS 15497 /* Variable */ +#define UA_NS0ID_ADDEXTENSIONFIELDMETHODTYPE_OUTPUTARGUMENTS 15498 /* Variable */ +#define UA_NS0ID_REMOVEEXTENSIONFIELDMETHODTYPE 15499 /* Method */ +#define UA_NS0ID_REMOVEEXTENSIONFIELDMETHODTYPE_INPUTARGUMENTS 15500 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLETYPEDESCRIPTION 15501 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSDATATYPE 15502 /* DataType */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS 15503 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD 15504 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_INPUTARGUMENTS 15505 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_OUTPUTARGUMENTS 15506 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD 15507 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD_INPUTARGUMENTS 15508 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLETYPEDESCRIPTION_DATATYPEVERSION 15509 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLDATATYPE 15510 /* DataType */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS 15511 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD 15512 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_INPUTARGUMENTS 15513 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS_ADDEXTENSIONFIELD_OUTPUTARGUMENTS 15514 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD 15515 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_EXTENSIONFIELDS_REMOVEEXTENSIONFIELD_INPUTARGUMENTS 15516 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_MODIFYFIELDSELECTION_OUTPUTARGUMENTS 15517 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPEMODIFYFIELDSELECTIONMETHODTYPE_OUTPUTARGUMENTS 15518 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SIMPLETYPEDESCRIPTION_DICTIONARYFRAGMENT 15519 /* Variable */ +#define UA_NS0ID_READERGROUPDATATYPE 15520 /* DataType */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UABINARYFILEDATATYPE 15521 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UABINARYFILEDATATYPE_DATATYPEVERSION 15522 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UABINARYFILEDATATYPE_DICTIONARYFRAGMENT 15523 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE 15524 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 15525 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15526 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ENDPOINTSEXCLUDE 15527 /* Variable */ +#define UA_NS0ID_ENDPOINTTYPE 15528 /* DataType */ +#define UA_NS0ID_SIMPLETYPEDESCRIPTION_ENCODING_DEFAULTXML 15529 /* Object */ +#define UA_NS0ID_PUBSUBCONFIGURATIONDATATYPE 15530 /* DataType */ +#define UA_NS0ID_UABINARYFILEDATATYPE_ENCODING_DEFAULTXML 15531 /* Object */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTDATATYPE 15532 /* DataType */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE 15533 /* Variable */ +#define UA_NS0ID_DATATYPESCHEMAHEADER 15534 /* DataType */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE 15535 /* ObjectType */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_EVENTID 15536 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_EVENTTYPE 15537 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_SOURCENODE 15538 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_SOURCENAME 15539 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_TIME 15540 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_RECEIVETIME 15541 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_LOCALTIME 15542 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_MESSAGE 15543 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_SEVERITY 15544 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_CONNECTIONID 15545 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_GROUPID 15546 /* Variable */ +#define UA_NS0ID_PUBSUBSTATUSEVENTTYPE_STATE 15547 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE 15548 /* ObjectType */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_EVENTID 15549 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_EVENTTYPE 15550 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_SOURCENODE 15551 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_SOURCENAME 15552 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_TIME 15553 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_RECEIVETIME 15554 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_LOCALTIME 15555 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_MESSAGE 15556 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_SEVERITY 15557 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_CONNECTIONID 15558 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_GROUPID 15559 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_STATE 15560 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_ACTUAL 15561 /* Variable */ +#define UA_NS0ID_PUBSUBTRANSPORTLIMITSEXCEEDEVENTTYPE_MAXIMUM 15562 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE 15563 /* ObjectType */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_EVENTID 15564 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_EVENTTYPE 15565 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_SOURCENODE 15566 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_SOURCENAME 15567 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_TIME 15568 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_RECEIVETIME 15569 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_LOCALTIME 15570 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_MESSAGE 15571 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_SEVERITY 15572 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_CONNECTIONID 15573 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_GROUPID 15574 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_STATE 15575 /* Variable */ +#define UA_NS0ID_PUBSUBCOMMUNICATIONFAILUREEVENTTYPE_ERROR 15576 /* Variable */ +#define UA_NS0ID_DATASETFIELDFLAGS_OPTIONSETVALUES 15577 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETDATATYPE 15578 /* DataType */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTXML 15579 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETSOURCEDATATYPE 15580 /* DataType */ +#define UA_NS0ID_PUBLISHEDDATAITEMSDATATYPE 15581 /* DataType */ +#define UA_NS0ID_PUBLISHEDEVENTSDATATYPE 15582 /* DataType */ +#define UA_NS0ID_DATASETFIELDCONTENTMASK 15583 /* DataType */ +#define UA_NS0ID_DATASETFIELDCONTENTMASK_OPTIONSETVALUES 15584 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLETYPEDESCRIPTION 15585 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLETYPEDESCRIPTION_DATATYPEVERSION 15586 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SIMPLETYPEDESCRIPTION_DICTIONARYFRAGMENT 15587 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UABINARYFILEDATATYPE 15588 /* Variable */ +#define UA_NS0ID_STRUCTUREDESCRIPTION_ENCODING_DEFAULTXML 15589 /* Object */ +#define UA_NS0ID_ENUMDESCRIPTION_ENCODING_DEFAULTXML 15590 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDESCRIPTION 15591 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDESCRIPTION_DATATYPEVERSION 15592 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDESCRIPTION_DICTIONARYFRAGMENT 15593 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDESCRIPTION 15594 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDESCRIPTION_DATATYPEVERSION 15595 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDESCRIPTION_DICTIONARYFRAGMENT 15596 /* Variable */ +#define UA_NS0ID_DATASETWRITERDATATYPE 15597 /* DataType */ +#define UA_NS0ID_DATASETWRITERTRANSPORTDATATYPE 15598 /* DataType */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDESCRIPTION 15599 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDESCRIPTION_DATATYPEVERSION 15600 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDESCRIPTION_DICTIONARYFRAGMENT 15601 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDESCRIPTION 15602 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDESCRIPTION_DATATYPEVERSION 15603 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDESCRIPTION_DICTIONARYFRAGMENT 15604 /* Variable */ +#define UA_NS0ID_DATASETWRITERMESSAGEDATATYPE 15605 /* DataType */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET 15606 /* Object */ +#define UA_NS0ID_ROLESETTYPE 15607 /* ObjectType */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER 15608 /* Object */ +#define UA_NS0ID_PUBSUBGROUPDATATYPE 15609 /* DataType */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UABINARYFILEDATATYPE_DATATYPEVERSION 15610 /* Variable */ +#define UA_NS0ID_WRITERGROUPTRANSPORTDATATYPE 15611 /* DataType */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDIDENTITY 15612 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDIDENTITY_INPUTARGUMENTS 15613 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEIDENTITY 15614 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEIDENTITY_INPUTARGUMENTS 15615 /* Variable */ +#define UA_NS0ID_WRITERGROUPMESSAGEDATATYPE 15616 /* DataType */ +#define UA_NS0ID_PUBSUBCONNECTIONDATATYPE 15617 /* DataType */ +#define UA_NS0ID_CONNECTIONTRANSPORTDATATYPE 15618 /* DataType */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UABINARYFILEDATATYPE_DICTIONARYFRAGMENT 15619 /* Variable */ +#define UA_NS0ID_ROLETYPE 15620 /* ObjectType */ +#define UA_NS0ID_READERGROUPTRANSPORTDATATYPE 15621 /* DataType */ +#define UA_NS0ID_READERGROUPMESSAGEDATATYPE 15622 /* DataType */ +#define UA_NS0ID_DATASETREADERDATATYPE 15623 /* DataType */ +#define UA_NS0ID_ROLETYPE_ADDIDENTITY 15624 /* Method */ +#define UA_NS0ID_ROLETYPE_ADDIDENTITY_INPUTARGUMENTS 15625 /* Variable */ +#define UA_NS0ID_ROLETYPE_REMOVEIDENTITY 15626 /* Method */ +#define UA_NS0ID_ROLETYPE_REMOVEIDENTITY_INPUTARGUMENTS 15627 /* Variable */ +#define UA_NS0ID_DATASETREADERTRANSPORTDATATYPE 15628 /* DataType */ +#define UA_NS0ID_DATASETREADERMESSAGEDATATYPE 15629 /* DataType */ +#define UA_NS0ID_SUBSCRIBEDDATASETDATATYPE 15630 /* DataType */ +#define UA_NS0ID_TARGETVARIABLESDATATYPE 15631 /* DataType */ +#define UA_NS0ID_IDENTITYCRITERIATYPE 15632 /* DataType */ +#define UA_NS0ID_IDENTITYCRITERIATYPE_ENUMVALUES 15633 /* Variable */ +#define UA_NS0ID_IDENTITYMAPPINGRULETYPE 15634 /* DataType */ +#define UA_NS0ID_SUBSCRIBEDDATASETMIRRORDATATYPE 15635 /* DataType */ +#define UA_NS0ID_ADDIDENTITYMETHODTYPE 15636 /* Method */ +#define UA_NS0ID_ADDIDENTITYMETHODTYPE_INPUTARGUMENTS 15637 /* Variable */ +#define UA_NS0ID_REMOVEIDENTITYMETHODTYPE 15638 /* Method */ +#define UA_NS0ID_REMOVEIDENTITYMETHODTYPE_INPUTARGUMENTS 15639 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE 15640 /* Variable */ +#define UA_NS0ID_DATASETORDERINGTYPE_ENUMSTRINGS 15641 /* Variable */ +#define UA_NS0ID_UADPNETWORKMESSAGECONTENTMASK 15642 /* DataType */ +#define UA_NS0ID_UADPNETWORKMESSAGECONTENTMASK_OPTIONSETVALUES 15643 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS 15644 /* Object */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGEDATATYPE 15645 /* DataType */ +#define UA_NS0ID_UADPDATASETMESSAGECONTENTMASK 15646 /* DataType */ +#define UA_NS0ID_UADPDATASETMESSAGECONTENTMASK_OPTIONSETVALUES 15647 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDIDENTITY 15648 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDIDENTITY_INPUTARGUMENTS 15649 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEIDENTITY 15650 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEIDENTITY_INPUTARGUMENTS 15651 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGEDATATYPE 15652 /* DataType */ +#define UA_NS0ID_UADPDATASETREADERMESSAGEDATATYPE 15653 /* DataType */ +#define UA_NS0ID_JSONNETWORKMESSAGECONTENTMASK 15654 /* DataType */ +#define UA_NS0ID_JSONNETWORKMESSAGECONTENTMASK_OPTIONSETVALUES 15655 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER 15656 /* Object */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGEDATATYPE 15657 /* DataType */ +#define UA_NS0ID_JSONDATASETMESSAGECONTENTMASK 15658 /* DataType */ +#define UA_NS0ID_JSONDATASETMESSAGECONTENTMASK_OPTIONSETVALUES 15659 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDIDENTITY 15660 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDIDENTITY_INPUTARGUMENTS 15661 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEIDENTITY 15662 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEIDENTITY_INPUTARGUMENTS 15663 /* Variable */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGEDATATYPE 15664 /* DataType */ +#define UA_NS0ID_JSONDATASETREADERMESSAGEDATATYPE 15665 /* DataType */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 15666 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTDATATYPE 15667 /* DataType */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER 15668 /* Object */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTDATATYPE 15669 /* DataType */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTDATATYPE 15670 /* DataType */ +#define UA_NS0ID_ENDPOINTTYPE_ENCODING_DEFAULTBINARY 15671 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDIDENTITY 15672 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDIDENTITY_INPUTARGUMENTS 15673 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEIDENTITY 15674 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEIDENTITY_INPUTARGUMENTS 15675 /* Variable */ +#define UA_NS0ID_DATATYPESCHEMAHEADER_ENCODING_DEFAULTBINARY 15676 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETDATATYPE_ENCODING_DEFAULTBINARY 15677 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETSOURCEDATATYPE_ENCODING_DEFAULTBINARY 15678 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSDATATYPE_ENCODING_DEFAULTBINARY 15679 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR 15680 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSDATATYPE_ENCODING_DEFAULTBINARY 15681 /* Object */ +#define UA_NS0ID_DATASETWRITERDATATYPE_ENCODING_DEFAULTBINARY 15682 /* Object */ +#define UA_NS0ID_DATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15683 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDIDENTITY 15684 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDIDENTITY_INPUTARGUMENTS 15685 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEIDENTITY 15686 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEIDENTITY_INPUTARGUMENTS 15687 /* Variable */ +#define UA_NS0ID_DATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15688 /* Object */ +#define UA_NS0ID_PUBSUBGROUPDATATYPE_ENCODING_DEFAULTBINARY 15689 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERCONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15690 /* Variable */ +#define UA_NS0ID_WRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15691 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR 15692 /* Object */ +#define UA_NS0ID_WRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15693 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONDATATYPE_ENCODING_DEFAULTBINARY 15694 /* Object */ +#define UA_NS0ID_CONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15695 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDIDENTITY 15696 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDIDENTITY_INPUTARGUMENTS 15697 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEIDENTITY 15698 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEIDENTITY_INPUTARGUMENTS 15699 /* Variable */ +#define UA_NS0ID_SIMPLETYPEDESCRIPTION_ENCODING_DEFAULTJSON 15700 /* Object */ +#define UA_NS0ID_READERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15701 /* Object */ +#define UA_NS0ID_READERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15702 /* Object */ +#define UA_NS0ID_DATASETREADERDATATYPE_ENCODING_DEFAULTBINARY 15703 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN 15704 /* Object */ +#define UA_NS0ID_DATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15705 /* Object */ +#define UA_NS0ID_DATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15706 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETDATATYPE_ENCODING_DEFAULTBINARY 15707 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDIDENTITY 15708 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDIDENTITY_INPUTARGUMENTS 15709 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEIDENTITY 15710 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEIDENTITY_INPUTARGUMENTS 15711 /* Variable */ +#define UA_NS0ID_TARGETVARIABLESDATATYPE_ENCODING_DEFAULTBINARY 15712 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETMIRRORDATATYPE_ENCODING_DEFAULTBINARY 15713 /* Object */ +#define UA_NS0ID_UABINARYFILEDATATYPE_ENCODING_DEFAULTJSON 15714 /* Object */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15715 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN 15716 /* Object */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15717 /* Object */ +#define UA_NS0ID_UADPDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15718 /* Object */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15719 /* Object */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDIDENTITY 15720 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDIDENTITY_INPUTARGUMENTS 15721 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEIDENTITY 15722 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEIDENTITY_INPUTARGUMENTS 15723 /* Variable */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15724 /* Object */ +#define UA_NS0ID_JSONDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTBINARY 15725 /* Object */ +#define UA_NS0ID_BROKERCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 15726 /* Object */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15727 /* Object */ +#define UA_NS0ID_IDENTITYMAPPINGRULETYPE_ENCODING_DEFAULTXML 15728 /* Object */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15729 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_IDENTITYMAPPINGRULETYPE 15730 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_IDENTITYMAPPINGRULETYPE_DATATYPEVERSION 15731 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_IDENTITYMAPPINGRULETYPE_DICTIONARYFRAGMENT 15732 /* Variable */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 15733 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTTYPE 15734 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTTYPE_DATATYPEVERSION 15735 /* Variable */ +#define UA_NS0ID_IDENTITYMAPPINGRULETYPE_ENCODING_DEFAULTBINARY 15736 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENDPOINTTYPE_DICTIONARYFRAGMENT 15737 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_IDENTITYMAPPINGRULETYPE 15738 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_IDENTITYMAPPINGRULETYPE_DATATYPEVERSION 15739 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_IDENTITYMAPPINGRULETYPE_DICTIONARYFRAGMENT 15740 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPESCHEMAHEADER 15741 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPESCHEMAHEADER_DATATYPEVERSION 15742 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPESCHEMAHEADER_DICTIONARYFRAGMENT 15743 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE 15744 /* ObjectType */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_CLIENTPROCESSINGTIMEOUT 15745 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORREAD 15746 /* Method */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORREAD_INPUTARGUMENTS 15747 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORREAD_OUTPUTARGUMENTS 15748 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORWRITE 15749 /* Method */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORWRITE_OUTPUTARGUMENTS 15750 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_CLOSEANDCOMMIT 15751 /* Method */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_CLOSEANDCOMMIT_INPUTARGUMENTS 15752 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_CLOSEANDCOMMIT_OUTPUTARGUMENTS 15753 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER 15754 /* Object */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_CURRENTSTATE 15755 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_CURRENTSTATE_ID 15756 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_CURRENTSTATE_NAME 15757 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_CURRENTSTATE_NUMBER 15758 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_CURRENTSTATE_EFFECTIVEDISPLAYNAME 15759 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION 15760 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION_ID 15761 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION_NAME 15762 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION_NUMBER 15763 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION_TRANSITIONTIME 15764 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_LASTTRANSITION_EFFECTIVETRANSITIONTIME 15765 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETDATATYPE 15766 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETDATATYPE_DATATYPEVERSION 15767 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETDATATYPE_DICTIONARYFRAGMENT 15768 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE 15769 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE_DATATYPEVERSION 15770 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE_DICTIONARYFRAGMENT 15771 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATAITEMSDATATYPE 15772 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATAITEMSDATATYPE_DATATYPEVERSION 15773 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDDATAITEMSDATATYPE_DICTIONARYFRAGMENT 15774 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDEVENTSDATATYPE 15775 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDEVENTSDATATYPE_DATATYPEVERSION 15776 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBLISHEDEVENTSDATATYPE_DICTIONARYFRAGMENT 15777 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERDATATYPE 15778 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERDATATYPE_DATATYPEVERSION 15779 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERDATATYPE_DICTIONARYFRAGMENT 15780 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERTRANSPORTDATATYPE 15781 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERTRANSPORTDATATYPE_DATATYPEVERSION 15782 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15783 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERMESSAGEDATATYPE 15784 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 15785 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15786 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBGROUPDATATYPE 15787 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBGROUPDATATYPE_DATATYPEVERSION 15788 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBGROUPDATATYPE_DICTIONARYFRAGMENT 15789 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER 15790 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_PUBLISHERID 15791 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI 15792 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPTRANSPORTDATATYPE 15793 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_RESET 15794 /* Method */ +#define UA_NS0ID_GENERATEFILEFORREADMETHODTYPE 15795 /* Method */ +#define UA_NS0ID_GENERATEFILEFORREADMETHODTYPE_INPUTARGUMENTS 15796 /* Variable */ +#define UA_NS0ID_GENERATEFILEFORREADMETHODTYPE_OUTPUTARGUMENTS 15797 /* Variable */ +#define UA_NS0ID_GENERATEFILEFORWRITEMETHODTYPE 15798 /* Method */ +#define UA_NS0ID_GENERATEFILEFORWRITEMETHODTYPE_OUTPUTARGUMENTS 15799 /* Variable */ +#define UA_NS0ID_CLOSEANDCOMMITMETHODTYPE 15800 /* Method */ +#define UA_NS0ID_CLOSEANDCOMMITMETHODTYPE_INPUTARGUMENTS 15801 /* Variable */ +#define UA_NS0ID_CLOSEANDCOMMITMETHODTYPE_OUTPUTARGUMENTS 15802 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE 15803 /* ObjectType */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_CURRENTSTATE 15804 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_CURRENTSTATE_ID 15805 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_CURRENTSTATE_NAME 15806 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_CURRENTSTATE_NUMBER 15807 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 15808 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION 15809 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION_ID 15810 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION_NAME 15811 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION_NUMBER 15812 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION_TRANSITIONTIME 15813 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 15814 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLE 15815 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLE_STATENUMBER 15816 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARE 15817 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARE_STATENUMBER 15818 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFER 15819 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFER_STATENUMBER 15820 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITE 15821 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITE_STATENUMBER 15822 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_ERROR 15823 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_ERROR_STATENUMBER 15824 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLETOREADPREPARE 15825 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLETOREADPREPARE_TRANSITIONNUMBER 15826 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARETOREADTRANSFER 15827 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARETOREADTRANSFER_TRANSITIONNUMBER 15828 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFERTOIDLE 15829 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFERTOIDLE_TRANSITIONNUMBER 15830 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLETOAPPLYWRITE 15831 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_IDLETOAPPLYWRITE_TRANSITIONNUMBER 15832 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITETOIDLE 15833 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITETOIDLE_TRANSITIONNUMBER 15834 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARETOERROR 15835 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READPREPARETOERROR_TRANSITIONNUMBER 15836 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFERTOERROR 15837 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_READTRANSFERTOERROR_TRANSITIONNUMBER 15838 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITETOERROR 15839 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_APPLYWRITETOERROR_TRANSITIONNUMBER 15840 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_ERRORTOIDLE 15841 /* Object */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_ERRORTOIDLE_TRANSITIONNUMBER 15842 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_RESET 15843 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_STATUS 15844 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_STATUS_STATE 15845 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_STATUS_ENABLE 15846 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_STATUS_DISABLE 15847 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_SELECTIONS 15848 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_SELECTIONDESCRIPTIONS 15849 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_RESTRICTTOLIST 15850 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDRESS 15851 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 15852 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15853 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPMESSAGEDATATYPE 15854 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 15855 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 15856 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONNECTIONDATATYPE 15857 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONNECTIONDATATYPE_DATATYPEVERSION 15858 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONNECTIONDATATYPE_DICTIONARYFRAGMENT 15859 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONNECTIONTRANSPORTDATATYPE 15860 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 15861 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_CONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15862 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE 15863 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTSETTINGS 15864 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_STATUS 15865 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPTRANSPORTDATATYPE 15866 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 15867 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15868 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPMESSAGEDATATYPE 15869 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPMESSAGEDATATYPE_DATATYPEVERSION 15870 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 15871 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERDATATYPE 15872 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERDATATYPE_DATATYPEVERSION 15873 /* Variable */ +#define UA_NS0ID_OVERRIDEVALUEHANDLING 15874 /* DataType */ +#define UA_NS0ID_OVERRIDEVALUEHANDLING_ENUMSTRINGS 15875 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERDATATYPE_DICTIONARYFRAGMENT 15876 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERTRANSPORTDATATYPE 15877 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERTRANSPORTDATATYPE_DATATYPEVERSION 15878 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15879 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERMESSAGEDATATYPE 15880 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 15881 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15882 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETDATATYPE 15883 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETDATATYPE_DATATYPEVERSION 15884 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETDATATYPE_DICTIONARYFRAGMENT 15885 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TARGETVARIABLESDATATYPE 15886 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TARGETVARIABLESDATATYPE_DATATYPEVERSION 15887 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_TARGETVARIABLESDATATYPE_DICTIONARYFRAGMENT 15888 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE 15889 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE_DATATYPEVERSION 15890 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE_DICTIONARYFRAGMENT 15891 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_STATUS_STATE 15892 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_STATUS_ENABLE 15893 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_STATUS_DISABLE 15894 /* Method */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE 15895 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 15896 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 15897 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE 15898 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 15899 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15900 /* Variable */ +#define UA_NS0ID_SESSIONLESSINVOKEREQUESTTYPE 15901 /* DataType */ +#define UA_NS0ID_SESSIONLESSINVOKEREQUESTTYPE_ENCODING_DEFAULTXML 15902 /* Object */ +#define UA_NS0ID_SESSIONLESSINVOKEREQUESTTYPE_ENCODING_DEFAULTBINARY 15903 /* Object */ +#define UA_NS0ID_DATASETFIELDFLAGS 15904 /* DataType */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTSETTINGS 15905 /* Object */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE 15906 /* ObjectType */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYKEYS 15907 /* Method */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYKEYS_INPUTARGUMENTS 15908 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYKEYS_OUTPUTARGUMENTS 15909 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYGROUP 15910 /* Method */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYGROUP_INPUTARGUMENTS 15911 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_GETSECURITYGROUP_OUTPUTARGUMENTS 15912 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS 15913 /* Object */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS_ADDSECURITYGROUP 15914 /* Method */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS_ADDSECURITYGROUP_INPUTARGUMENTS 15915 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS_ADDSECURITYGROUP_OUTPUTARGUMENTS 15916 /* Variable */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS_REMOVESECURITYGROUP 15917 /* Method */ +#define UA_NS0ID_PUBSUBKEYSERVICETYPE_SECURITYGROUPS_REMOVESECURITYGROUP_INPUTARGUMENTS 15918 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETREADERMESSAGEDATATYPE 15919 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 15920 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_UADPDATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15921 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE 15922 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 15923 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 15924 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE 15925 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_SECURITYMODE 15926 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_SECURITYGROUPID 15927 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_SECURITYKEYSERVICES 15928 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 15929 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15930 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETREADERMESSAGEDATATYPE 15931 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_SECURITYMODE 15932 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_SECURITYGROUPID 15933 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_SECURITYKEYSERVICES 15934 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 15935 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_JSONDATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 15936 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS 15937 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 15938 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 15939 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE 15940 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 15941 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15942 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE 15943 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE_DATATYPEVERSION 15944 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15945 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE 15946 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE_DATATYPEVERSION 15947 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 15948 /* Variable */ +#define UA_NS0ID_ENDPOINTTYPE_ENCODING_DEFAULTXML 15949 /* Object */ +#define UA_NS0ID_DATATYPESCHEMAHEADER_ENCODING_DEFAULTXML 15950 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETDATATYPE_ENCODING_DEFAULTXML 15951 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETSOURCEDATATYPE_ENCODING_DEFAULTXML 15952 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSDATATYPE_ENCODING_DEFAULTXML 15953 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSDATATYPE_ENCODING_DEFAULTXML 15954 /* Object */ +#define UA_NS0ID_DATASETWRITERDATATYPE_ENCODING_DEFAULTXML 15955 /* Object */ +#define UA_NS0ID_DATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTXML 15956 /* Object */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA 15957 /* Object */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEURI 15958 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEVERSION 15959 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEPUBLICATIONDATE 15960 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_ISNAMESPACESUBSET 15961 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_STATICNODEIDTYPES 15962 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_STATICNUMERICNODEIDRANGE 15963 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_STATICSTRINGNODEIDPATTERN 15964 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE 15965 /* Object */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_SIZE 15966 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_WRITABLE 15967 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_USERWRITABLE 15968 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_OPENCOUNT 15969 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_MIMETYPE 15970 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_OPEN 15971 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_OPEN_INPUTARGUMENTS 15972 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_OPEN_OUTPUTARGUMENTS 15973 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_CLOSE 15974 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_CLOSE_INPUTARGUMENTS 15975 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_READ 15976 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_READ_INPUTARGUMENTS 15977 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_READ_OUTPUTARGUMENTS 15978 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_WRITE 15979 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_WRITE_INPUTARGUMENTS 15980 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_GETPOSITION 15981 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_GETPOSITION_INPUTARGUMENTS 15982 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_GETPOSITION_OUTPUTARGUMENTS 15983 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_SETPOSITION 15984 /* Method */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_SETPOSITION_INPUTARGUMENTS 15985 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_NAMESPACEFILE_EXPORTNAMESPACE 15986 /* Method */ +#define UA_NS0ID_DATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTXML 15987 /* Object */ +#define UA_NS0ID_PUBSUBGROUPDATATYPE_ENCODING_DEFAULTXML 15988 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 15989 /* Variable */ +#define UA_NS0ID_WRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTXML 15990 /* Object */ +#define UA_NS0ID_WRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTXML 15991 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONDATATYPE_ENCODING_DEFAULTXML 15992 /* Object */ +#define UA_NS0ID_CONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTXML 15993 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 15994 /* Variable */ +#define UA_NS0ID_READERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTXML 15995 /* Object */ +#define UA_NS0ID_READERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTXML 15996 /* Object */ +#define UA_NS0ID_ROLESETTYPE_ADDROLE 15997 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ADDROLE_INPUTARGUMENTS 15998 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ADDROLE_OUTPUTARGUMENTS 15999 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_REMOVEROLE 16000 /* Method */ +#define UA_NS0ID_ROLESETTYPE_REMOVEROLE_INPUTARGUMENTS 16001 /* Variable */ +#define UA_NS0ID_ADDROLEMETHODTYPE 16002 /* Method */ +#define UA_NS0ID_ADDROLEMETHODTYPE_INPUTARGUMENTS 16003 /* Variable */ +#define UA_NS0ID_ADDROLEMETHODTYPE_OUTPUTARGUMENTS 16004 /* Variable */ +#define UA_NS0ID_REMOVEROLEMETHODTYPE 16005 /* Method */ +#define UA_NS0ID_REMOVEROLEMETHODTYPE_INPUTARGUMENTS 16006 /* Variable */ +#define UA_NS0ID_DATASETREADERDATATYPE_ENCODING_DEFAULTXML 16007 /* Object */ +#define UA_NS0ID_DATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTXML 16008 /* Object */ +#define UA_NS0ID_DATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTXML 16009 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETDATATYPE_ENCODING_DEFAULTXML 16010 /* Object */ +#define UA_NS0ID_TARGETVARIABLESDATATYPE_ENCODING_DEFAULTXML 16011 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETMIRRORDATATYPE_ENCODING_DEFAULTXML 16012 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 16013 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTXML 16014 /* Object */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTXML 16015 /* Object */ +#define UA_NS0ID_UADPDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTXML 16016 /* Object */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTXML 16017 /* Object */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTXML 16018 /* Object */ +#define UA_NS0ID_JSONDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTXML 16019 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 16020 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTXML 16021 /* Object */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTXML 16022 /* Object */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTXML 16023 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTTYPE 16024 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTTYPE_DATATYPEVERSION 16025 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENDPOINTTYPE_DICTIONARYFRAGMENT 16026 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPESCHEMAHEADER 16027 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPESCHEMAHEADER_DATATYPEVERSION 16028 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPESCHEMAHEADER_DICTIONARYFRAGMENT 16029 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETDATATYPE 16030 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETDATATYPE_DATATYPEVERSION 16031 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETDATATYPE_DICTIONARYFRAGMENT 16032 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE 16033 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE_DATATYPEVERSION 16034 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATASETSOURCEDATATYPE_DICTIONARYFRAGMENT 16035 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER 16036 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATAITEMSDATATYPE 16037 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATAITEMSDATATYPE_DATATYPEVERSION 16038 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDDATAITEMSDATATYPE_DICTIONARYFRAGMENT 16039 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDEVENTSDATATYPE 16040 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDIDENTITY 16041 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDIDENTITY_INPUTARGUMENTS 16042 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEIDENTITY 16043 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEIDENTITY_INPUTARGUMENTS 16044 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDEVENTSDATATYPE_DATATYPEVERSION 16045 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBLISHEDEVENTSDATATYPE_DICTIONARYFRAGMENT 16046 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERDATATYPE 16047 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERDATATYPE_DATATYPEVERSION 16048 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERDATATYPE_DICTIONARYFRAGMENT 16049 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERTRANSPORTDATATYPE 16050 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERTRANSPORTDATATYPE_DATATYPEVERSION 16051 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16052 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERMESSAGEDATATYPE 16053 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 16054 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16055 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBGROUPDATATYPE 16056 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBGROUPDATATYPE_DATATYPEVERSION 16057 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBGROUPDATATYPE_DICTIONARYFRAGMENT 16058 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 16059 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 16060 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 16061 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPTRANSPORTDATATYPE 16062 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 16063 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16064 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPMESSAGEDATATYPE 16065 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 16066 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 16067 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONNECTIONDATATYPE 16068 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONNECTIONDATATYPE_DATATYPEVERSION 16069 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONNECTIONDATATYPE_DICTIONARYFRAGMENT 16070 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONNECTIONTRANSPORTDATATYPE 16071 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 16072 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_CONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16073 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 16074 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 16075 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_RESET 16076 /* Method */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPTRANSPORTDATATYPE 16077 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 16078 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16079 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPMESSAGEDATATYPE 16080 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPMESSAGEDATATYPE_DATATYPEVERSION 16081 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 16082 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERDATATYPE 16083 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERDATATYPE_DATATYPEVERSION 16084 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERDATATYPE_DICTIONARYFRAGMENT 16085 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERTRANSPORTDATATYPE 16086 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERTRANSPORTDATATYPE_DATATYPEVERSION 16087 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16088 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERMESSAGEDATATYPE 16089 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 16090 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16091 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETDATATYPE 16092 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETDATATYPE_DATATYPEVERSION 16093 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETDATATYPE_DICTIONARYFRAGMENT 16094 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TARGETVARIABLESDATATYPE 16095 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TARGETVARIABLESDATATYPE_DATATYPEVERSION 16096 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_TARGETVARIABLESDATATYPE_DICTIONARYFRAGMENT 16097 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE 16098 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE_DATATYPEVERSION 16099 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_SUBSCRIBEDDATASETMIRRORDATATYPE_DICTIONARYFRAGMENT 16100 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 16101 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 16102 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 16103 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE 16104 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 16105 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPWRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 16106 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE 16107 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 16108 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16109 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETREADERMESSAGEDATATYPE 16110 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 16111 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_UADPDATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16112 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE 16113 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE_DATATYPEVERSION 16114 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONWRITERGROUPMESSAGEDATATYPE_DICTIONARYFRAGMENT 16115 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE 16116 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE_DATATYPEVERSION 16117 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETWRITERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16118 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETREADERMESSAGEDATATYPE 16119 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETREADERMESSAGEDATATYPE_DATATYPEVERSION 16120 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_JSONDATASETREADERMESSAGEDATATYPE_DICTIONARYFRAGMENT 16121 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 16122 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 16123 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 16124 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE 16125 /* Variable */ +#define UA_NS0ID_ROLEPERMISSIONTYPE_ENCODING_DEFAULTXML 16126 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ROLEPERMISSIONTYPE 16127 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ROLEPERMISSIONTYPE_DATATYPEVERSION 16128 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ROLEPERMISSIONTYPE_DICTIONARYFRAGMENT 16129 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 16130 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ROLEPERMISSIONTYPE 16131 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ROLEPERMISSIONTYPE_DATATYPEVERSION 16132 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ROLEPERMISSIONTYPE_DICTIONARYFRAGMENT 16133 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_DEFAULTROLEPERMISSIONS 16134 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_DEFAULTUSERROLEPERMISSIONS 16135 /* Variable */ +#define UA_NS0ID_OPCUANAMESPACEMETADATA_DEFAULTACCESSRESTRICTIONS 16136 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_DEFAULTROLEPERMISSIONS 16137 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_DEFAULTUSERROLEPERMISSIONS 16138 /* Variable */ +#define UA_NS0ID_NAMESPACEMETADATATYPE_DEFAULTACCESSRESTRICTIONS 16139 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_DEFAULTROLEPERMISSIONS 16140 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_DEFAULTUSERROLEPERMISSIONS 16141 /* Variable */ +#define UA_NS0ID_NAMESPACESTYPE_NAMESPACEIDENTIFIER_PLACEHOLDER_DEFAULTACCESSRESTRICTIONS 16142 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERWRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16143 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE 16144 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE_DATATYPEVERSION 16145 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETWRITERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16146 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE 16147 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE_DATATYPEVERSION 16148 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_BROKERDATASETREADERTRANSPORTDATATYPE_DICTIONARYFRAGMENT 16149 /* Variable */ +#define UA_NS0ID_ENDPOINTTYPE_ENCODING_DEFAULTJSON 16150 /* Object */ +#define UA_NS0ID_DATATYPESCHEMAHEADER_ENCODING_DEFAULTJSON 16151 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETDATATYPE_ENCODING_DEFAULTJSON 16152 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETSOURCEDATATYPE_ENCODING_DEFAULTJSON 16153 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSDATATYPE_ENCODING_DEFAULTJSON 16154 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSDATATYPE_ENCODING_DEFAULTJSON 16155 /* Object */ +#define UA_NS0ID_DATASETWRITERDATATYPE_ENCODING_DEFAULTJSON 16156 /* Object */ +#define UA_NS0ID_DATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16157 /* Object */ +#define UA_NS0ID_DATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16158 /* Object */ +#define UA_NS0ID_PUBSUBGROUPDATATYPE_ENCODING_DEFAULTJSON 16159 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 16160 /* Variable */ +#define UA_NS0ID_WRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16161 /* Object */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_IDENTITIES 16162 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_APPLICATIONS 16163 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ENDPOINTS 16164 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDAPPLICATION 16165 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDAPPLICATION_INPUTARGUMENTS 16166 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEAPPLICATION 16167 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEAPPLICATION_INPUTARGUMENTS 16168 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDENDPOINT 16169 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_ADDENDPOINT_INPUTARGUMENTS 16170 /* Variable */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEENDPOINT 16171 /* Method */ +#define UA_NS0ID_ROLESETTYPE_ROLENAME_PLACEHOLDER_REMOVEENDPOINT_INPUTARGUMENTS 16172 /* Variable */ +#define UA_NS0ID_ROLETYPE_IDENTITIES 16173 /* Variable */ +#define UA_NS0ID_ROLETYPE_APPLICATIONS 16174 /* Variable */ +#define UA_NS0ID_ROLETYPE_ENDPOINTS 16175 /* Variable */ +#define UA_NS0ID_ROLETYPE_ADDAPPLICATION 16176 /* Method */ +#define UA_NS0ID_ROLETYPE_ADDAPPLICATION_INPUTARGUMENTS 16177 /* Variable */ +#define UA_NS0ID_ROLETYPE_REMOVEAPPLICATION 16178 /* Method */ +#define UA_NS0ID_ROLETYPE_REMOVEAPPLICATION_INPUTARGUMENTS 16179 /* Variable */ +#define UA_NS0ID_ROLETYPE_ADDENDPOINT 16180 /* Method */ +#define UA_NS0ID_ROLETYPE_ADDENDPOINT_INPUTARGUMENTS 16181 /* Variable */ +#define UA_NS0ID_ROLETYPE_REMOVEENDPOINT 16182 /* Method */ +#define UA_NS0ID_ROLETYPE_REMOVEENDPOINT_INPUTARGUMENTS 16183 /* Variable */ +#define UA_NS0ID_ADDAPPLICATIONMETHODTYPE 16184 /* Method */ +#define UA_NS0ID_ADDAPPLICATIONMETHODTYPE_INPUTARGUMENTS 16185 /* Variable */ +#define UA_NS0ID_REMOVEAPPLICATIONMETHODTYPE 16186 /* Method */ +#define UA_NS0ID_REMOVEAPPLICATIONMETHODTYPE_INPUTARGUMENTS 16187 /* Variable */ +#define UA_NS0ID_ADDENDPOINTMETHODTYPE 16188 /* Method */ +#define UA_NS0ID_ADDENDPOINTMETHODTYPE_INPUTARGUMENTS 16189 /* Variable */ +#define UA_NS0ID_REMOVEENDPOINTMETHODTYPE 16190 /* Method */ +#define UA_NS0ID_REMOVEENDPOINTMETHODTYPE_INPUTARGUMENTS 16191 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_IDENTITIES 16192 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_APPLICATIONS 16193 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ENDPOINTS 16194 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDAPPLICATION 16195 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDAPPLICATION_INPUTARGUMENTS 16196 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEAPPLICATION 16197 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEAPPLICATION_INPUTARGUMENTS 16198 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDENDPOINT 16199 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_ADDENDPOINT_INPUTARGUMENTS 16200 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEENDPOINT 16201 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ANONYMOUS_REMOVEENDPOINT_INPUTARGUMENTS 16202 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_IDENTITIES 16203 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_APPLICATIONS 16204 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ENDPOINTS 16205 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDAPPLICATION 16206 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDAPPLICATION_INPUTARGUMENTS 16207 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEAPPLICATION 16208 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEAPPLICATION_INPUTARGUMENTS 16209 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDENDPOINT 16210 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_ADDENDPOINT_INPUTARGUMENTS 16211 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEENDPOINT 16212 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_AUTHENTICATEDUSER_REMOVEENDPOINT_INPUTARGUMENTS 16213 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_IDENTITIES 16214 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_APPLICATIONS 16215 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ENDPOINTS 16216 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDAPPLICATION 16217 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDAPPLICATION_INPUTARGUMENTS 16218 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEAPPLICATION 16219 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEAPPLICATION_INPUTARGUMENTS 16220 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDENDPOINT 16221 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_ADDENDPOINT_INPUTARGUMENTS 16222 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEENDPOINT 16223 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OBSERVER_REMOVEENDPOINT_INPUTARGUMENTS 16224 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_IDENTITIES 16225 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_APPLICATIONS 16226 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ENDPOINTS 16227 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDAPPLICATION 16228 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDAPPLICATION_INPUTARGUMENTS 16229 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEAPPLICATION 16230 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEAPPLICATION_INPUTARGUMENTS 16231 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDENDPOINT 16232 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_ADDENDPOINT_INPUTARGUMENTS 16233 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEENDPOINT 16234 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_OPERATOR_REMOVEENDPOINT_INPUTARGUMENTS 16235 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_IDENTITIES 16236 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_APPLICATIONS 16237 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ENDPOINTS 16238 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDAPPLICATION 16239 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDAPPLICATION_INPUTARGUMENTS 16240 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEAPPLICATION 16241 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEAPPLICATION_INPUTARGUMENTS 16242 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDENDPOINT 16243 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_ADDENDPOINT_INPUTARGUMENTS 16244 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEENDPOINT 16245 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_ENGINEER_REMOVEENDPOINT_INPUTARGUMENTS 16246 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_IDENTITIES 16247 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_APPLICATIONS 16248 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ENDPOINTS 16249 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDAPPLICATION 16250 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDAPPLICATION_INPUTARGUMENTS 16251 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEAPPLICATION 16252 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEAPPLICATION_INPUTARGUMENTS 16253 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDENDPOINT 16254 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_ADDENDPOINT_INPUTARGUMENTS 16255 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEENDPOINT 16256 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SUPERVISOR_REMOVEENDPOINT_INPUTARGUMENTS 16257 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_IDENTITIES 16258 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_APPLICATIONS 16259 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ENDPOINTS 16260 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDAPPLICATION 16261 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDAPPLICATION_INPUTARGUMENTS 16262 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEAPPLICATION 16263 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEAPPLICATION_INPUTARGUMENTS 16264 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDENDPOINT 16265 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_ADDENDPOINT_INPUTARGUMENTS 16266 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEENDPOINT 16267 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_SECURITYADMIN_REMOVEENDPOINT_INPUTARGUMENTS 16268 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_IDENTITIES 16269 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_APPLICATIONS 16270 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ENDPOINTS 16271 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDAPPLICATION 16272 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDAPPLICATION_INPUTARGUMENTS 16273 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEAPPLICATION 16274 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEAPPLICATION_INPUTARGUMENTS 16275 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDENDPOINT 16276 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_ADDENDPOINT_INPUTARGUMENTS 16277 /* Variable */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEENDPOINT 16278 /* Method */ +#define UA_NS0ID_WELLKNOWNROLE_CONFIGUREADMIN_REMOVEENDPOINT_INPUTARGUMENTS 16279 /* Variable */ +#define UA_NS0ID_WRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16280 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONDATATYPE_ENCODING_DEFAULTJSON 16281 /* Object */ +#define UA_NS0ID_CONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16282 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 16283 /* Variable */ +#define UA_NS0ID_READERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16284 /* Object */ +#define UA_NS0ID_READERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16285 /* Object */ +#define UA_NS0ID_DATASETREADERDATATYPE_ENCODING_DEFAULTJSON 16286 /* Object */ +#define UA_NS0ID_DATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16287 /* Object */ +#define UA_NS0ID_DATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16288 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET 16289 /* Object */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET_ADDROLE 16290 /* Method */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET_ADDROLE_INPUTARGUMENTS 16291 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET_ADDROLE_OUTPUTARGUMENTS 16292 /* Variable */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET_REMOVEROLE 16293 /* Method */ +#define UA_NS0ID_SERVERTYPE_SERVERCAPABILITIES_ROLESET_REMOVEROLE_INPUTARGUMENTS 16294 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET 16295 /* Object */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET_ADDROLE 16296 /* Method */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET_ADDROLE_INPUTARGUMENTS 16297 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET_ADDROLE_OUTPUTARGUMENTS 16298 /* Variable */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET_REMOVEROLE 16299 /* Method */ +#define UA_NS0ID_SERVERCAPABILITIESTYPE_ROLESET_REMOVEROLE_INPUTARGUMENTS 16300 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET_ADDROLE 16301 /* Method */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET_ADDROLE_INPUTARGUMENTS 16302 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET_ADDROLE_OUTPUTARGUMENTS 16303 /* Variable */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET_REMOVEROLE 16304 /* Method */ +#define UA_NS0ID_SERVER_SERVERCAPABILITIES_ROLESET_REMOVEROLE_INPUTARGUMENTS 16305 /* Variable */ +#define UA_NS0ID_DEFAULTINPUTVALUES 16306 /* Variable */ +#define UA_NS0ID_AUDIODATATYPE 16307 /* DataType */ +#define UA_NS0ID_SUBSCRIBEDDATASETDATATYPE_ENCODING_DEFAULTJSON 16308 /* Object */ +#define UA_NS0ID_SELECTIONLISTTYPE 16309 /* VariableType */ +#define UA_NS0ID_TARGETVARIABLESDATATYPE_ENCODING_DEFAULTJSON 16310 /* Object */ +#define UA_NS0ID_SUBSCRIBEDDATASETMIRRORDATATYPE_ENCODING_DEFAULTJSON 16311 /* Object */ +#define UA_NS0ID_SELECTIONLISTTYPE_RESTRICTTOLIST 16312 /* Variable */ +#define UA_NS0ID_ADDITIONALPARAMETERSTYPE 16313 /* DataType */ +#define UA_NS0ID_FILESYSTEM 16314 /* Object */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER 16315 /* Object */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY 16316 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY_INPUTARGUMENTS 16317 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEDIRECTORY_OUTPUTARGUMENTS 16318 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE 16319 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE_INPUTARGUMENTS 16320 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_CREATEFILE_OUTPUTARGUMENTS 16321 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 16322 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16323 /* Object */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY 16324 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY_INPUTARGUMENTS 16325 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_MOVEORCOPY_OUTPUTARGUMENTS 16326 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER 16327 /* Object */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_SIZE 16328 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_WRITABLE 16329 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_USERWRITABLE 16330 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_OPENCOUNT 16331 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_MIMETYPE 16332 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_OPEN 16333 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_OPEN_INPUTARGUMENTS 16334 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_OPEN_OUTPUTARGUMENTS 16335 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_CLOSE 16336 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_CLOSE_INPUTARGUMENTS 16337 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_READ 16338 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_READ_INPUTARGUMENTS 16339 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_READ_OUTPUTARGUMENTS 16340 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_WRITE 16341 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_WRITE_INPUTARGUMENTS 16342 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_GETPOSITION 16343 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_GETPOSITION_INPUTARGUMENTS 16344 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_GETPOSITION_OUTPUTARGUMENTS 16345 /* Variable */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_SETPOSITION 16346 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILENAME_PLACEHOLDER_SETPOSITION_INPUTARGUMENTS 16347 /* Variable */ +#define UA_NS0ID_FILESYSTEM_CREATEDIRECTORY 16348 /* Method */ +#define UA_NS0ID_FILESYSTEM_CREATEDIRECTORY_INPUTARGUMENTS 16349 /* Variable */ +#define UA_NS0ID_FILESYSTEM_CREATEDIRECTORY_OUTPUTARGUMENTS 16350 /* Variable */ +#define UA_NS0ID_FILESYSTEM_CREATEFILE 16351 /* Method */ +#define UA_NS0ID_FILESYSTEM_CREATEFILE_INPUTARGUMENTS 16352 /* Variable */ +#define UA_NS0ID_FILESYSTEM_CREATEFILE_OUTPUTARGUMENTS 16353 /* Variable */ +#define UA_NS0ID_FILESYSTEM_DELETEFILESYSTEMOBJECT 16354 /* Method */ +#define UA_NS0ID_FILESYSTEM_DELETEFILESYSTEMOBJECT_INPUTARGUMENTS 16355 /* Variable */ +#define UA_NS0ID_FILESYSTEM_MOVEORCOPY 16356 /* Method */ +#define UA_NS0ID_FILESYSTEM_MOVEORCOPY_INPUTARGUMENTS 16357 /* Variable */ +#define UA_NS0ID_FILESYSTEM_MOVEORCOPY_OUTPUTARGUMENTS 16358 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_GENERATEFILEFORWRITE_INPUTARGUMENTS 16359 /* Variable */ +#define UA_NS0ID_GENERATEFILEFORWRITEMETHODTYPE_INPUTARGUMENTS 16360 /* Variable */ +#define UA_NS0ID_HASALARMSUPPRESSIONGROUP 16361 /* ReferenceType */ +#define UA_NS0ID_ALARMGROUPMEMBER 16362 /* ReferenceType */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONSUBCLASSID 16363 /* Variable */ +#define UA_NS0ID_CONDITIONTYPE_CONDITIONSUBCLASSNAME 16364 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONSUBCLASSID 16365 /* Variable */ +#define UA_NS0ID_DIALOGCONDITIONTYPE_CONDITIONSUBCLASSNAME 16366 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONSUBCLASSID 16367 /* Variable */ +#define UA_NS0ID_ACKNOWLEDGEABLECONDITIONTYPE_CONDITIONSUBCLASSNAME 16368 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONSUBCLASSID 16369 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_CONDITIONSUBCLASSNAME 16370 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE 16371 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_ID 16372 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_NAME 16373 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_NUMBER 16374 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16375 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16376 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16377 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_TRUESTATE 16378 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OUTOFSERVICESTATE_FALSESTATE 16379 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE 16380 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_ID 16381 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_NAME 16382 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_NUMBER 16383 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16384 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_TRANSITIONTIME 16385 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16386 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_TRUESTATE 16387 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCESTATE_FALSESTATE 16388 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_AUDIBLEENABLED 16389 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_AUDIBLESOUND 16390 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16391 /* Object */ +#define UA_NS0ID_UADPDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16392 /* Object */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16393 /* Object */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16394 /* Object */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ONDELAY 16395 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_OFFDELAY 16396 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_FIRSTINGROUPFLAG 16397 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_FIRSTINGROUP 16398 /* Object */ +#define UA_NS0ID_ALARMCONDITIONTYPE_ALARMGROUP_PLACEHOLDER 16399 /* Object */ +#define UA_NS0ID_ALARMCONDITIONTYPE_REALARMTIME 16400 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_REALARMREPEATCOUNT 16401 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SILENCE 16402 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SUPPRESS 16403 /* Method */ +#define UA_NS0ID_JSONDATASETREADERMESSAGEDATATYPE_ENCODING_DEFAULTJSON 16404 /* Object */ +#define UA_NS0ID_ALARMGROUPTYPE 16405 /* ObjectType */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER 16406 /* Object */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_EVENTID 16407 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_EVENTTYPE 16408 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SOURCENODE 16409 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SOURCENAME 16410 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_TIME 16411 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_RECEIVETIME 16412 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LOCALTIME 16413 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_MESSAGE 16414 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SEVERITY 16415 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONDITIONCLASSID 16416 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONDITIONCLASSNAME 16417 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONDITIONSUBCLASSID 16418 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONDITIONSUBCLASSNAME 16419 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONDITIONNAME 16420 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_BRANCHID 16421 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_RETAIN 16422 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE 16423 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_ID 16424 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_NAME 16425 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_NUMBER 16426 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 16427 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_TRANSITIONTIME 16428 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 16429 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_TRUESTATE 16430 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLEDSTATE_FALSESTATE 16431 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_QUALITY 16432 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_QUALITY_SOURCETIMESTAMP 16433 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LASTSEVERITY 16434 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LASTSEVERITY_SOURCETIMESTAMP 16435 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_COMMENT 16436 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_COMMENT_SOURCETIMESTAMP 16437 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CLIENTUSERID 16438 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_DISABLE 16439 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ENABLE 16440 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ADDCOMMENT 16441 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ADDCOMMENT_INPUTARGUMENTS 16442 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE 16443 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_ID 16444 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_NAME 16445 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_NUMBER 16446 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_EFFECTIVEDISPLAYNAME 16447 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_TRANSITIONTIME 16448 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_EFFECTIVETRANSITIONTIME 16449 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_TRUESTATE 16450 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKEDSTATE_FALSESTATE 16451 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE 16452 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_ID 16453 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_NAME 16454 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_NUMBER 16455 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 16456 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_TRANSITIONTIME 16457 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 16458 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_TRUESTATE 16459 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRMEDSTATE_FALSESTATE 16460 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKNOWLEDGE 16461 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACKNOWLEDGE_INPUTARGUMENTS 16462 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRM 16463 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_CONFIRM_INPUTARGUMENTS 16464 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE 16465 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_ID 16466 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_NAME 16467 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_NUMBER 16468 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_EFFECTIVEDISPLAYNAME 16469 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_TRANSITIONTIME 16470 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_EFFECTIVETRANSITIONTIME 16471 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_TRUESTATE 16472 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ACTIVESTATE_FALSESTATE 16473 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_INPUTNODE 16474 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE 16475 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_ID 16476 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_NAME 16477 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_NUMBER 16478 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 16479 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_TRANSITIONTIME 16480 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 16481 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_TRUESTATE 16482 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDSTATE_FALSESTATE 16483 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE 16484 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_ID 16485 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_NAME 16486 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_NUMBER 16487 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16488 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_TRANSITIONTIME 16489 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16490 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_TRUESTATE 16491 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OUTOFSERVICESTATE_FALSESTATE 16492 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE 16493 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_ID 16494 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_NAME 16495 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_NUMBER 16496 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_EFFECTIVEDISPLAYNAME 16497 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_TRANSITIONTIME 16498 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_EFFECTIVETRANSITIONTIME 16499 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_TRUESTATE 16500 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCESTATE_FALSESTATE 16501 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE 16502 /* Object */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_CURRENTSTATE 16503 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_CURRENTSTATE_ID 16504 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_CURRENTSTATE_NAME 16505 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_CURRENTSTATE_NUMBER 16506 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 16507 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION 16508 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION_ID 16509 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION_NAME 16510 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION_NUMBER 16511 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 16512 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 16513 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_UNSHELVETIME 16514 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_UNSHELVE 16515 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_ONESHOTSHELVE 16516 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_TIMEDSHELVE 16517 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 16518 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESSEDORSHELVED 16519 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_MAXTIMESHELVED 16520 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_AUDIBLEENABLED 16521 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_AUDIBLESOUND 16522 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 16523 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16524 /* Object */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16525 /* Object */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 16526 /* Object */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_ONDELAY 16527 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_OFFDELAY 16528 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_FIRSTINGROUPFLAG 16529 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_FIRSTINGROUP 16530 /* Object */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_REALARMTIME 16531 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_REALARMREPEATCOUNT 16532 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SILENCE 16533 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SUPPRESS 16534 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP 16535 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONSUBCLASSID 16536 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_CONDITIONSUBCLASSNAME 16537 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE 16538 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_ID 16539 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_NAME 16540 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_NUMBER 16541 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16542 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16543 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16544 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16545 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16546 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE 16547 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_ID 16548 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_NAME 16549 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_NUMBER 16550 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16551 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_TRANSITIONTIME 16552 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16553 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_TRUESTATE 16554 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCESTATE_FALSESTATE 16555 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_AUDIBLEENABLED 16556 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_AUDIBLESOUND 16557 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP_INPUTARGUMENTS 16558 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP_OUTPUTARGUMENTS 16559 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP 16560 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP_INPUTARGUMENTS 16561 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_ONDELAY 16562 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_OFFDELAY 16563 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_FIRSTINGROUPFLAG 16564 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_FIRSTINGROUP 16565 /* Object */ +#define UA_NS0ID_LIMITALARMTYPE_ALARMGROUP_PLACEHOLDER 16566 /* Object */ +#define UA_NS0ID_LIMITALARMTYPE_REALARMTIME 16567 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_REALARMREPEATCOUNT 16568 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SILENCE 16569 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_SUPPRESS 16570 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP_OUTPUTARGUMENTS 16571 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_BASEHIGHHIGHLIMIT 16572 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_BASEHIGHLIMIT 16573 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_BASELOWLIMIT 16574 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_BASELOWLOWLIMIT 16575 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONSUBCLASSID 16576 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_CONDITIONSUBCLASSNAME 16577 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE 16578 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_ID 16579 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_NAME 16580 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_NUMBER 16581 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16582 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16583 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16584 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16585 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16586 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE 16587 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_ID 16588 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_NAME 16589 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_NUMBER 16590 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16591 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_TRANSITIONTIME 16592 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16593 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_TRUESTATE 16594 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCESTATE_FALSESTATE 16595 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_AUDIBLEENABLED 16596 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_AUDIBLESOUND 16597 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_ADDCONNECTION 16598 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_ADDCONNECTION_INPUTARGUMENTS 16599 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_ADDCONNECTION_OUTPUTARGUMENTS 16600 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE 16601 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ONDELAY 16602 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_OFFDELAY 16603 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_FIRSTINGROUPFLAG 16604 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_FIRSTINGROUP 16605 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_ALARMGROUP_PLACEHOLDER 16606 /* Object */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_REALARMTIME 16607 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_REALARMREPEATCOUNT 16608 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SILENCE 16609 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SUPPRESS 16610 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE_INPUTARGUMENTS 16611 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_BASEHIGHHIGHLIMIT 16612 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_BASEHIGHLIMIT 16613 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_BASELOWLIMIT 16614 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_BASELOWLOWLIMIT 16615 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONSUBCLASSID 16616 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_CONDITIONSUBCLASSNAME 16617 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE 16618 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_ID 16619 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_NAME 16620 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_NUMBER 16621 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16622 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16623 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16624 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16625 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16626 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE 16627 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_ID 16628 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_NAME 16629 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_NUMBER 16630 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16631 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_TRANSITIONTIME 16632 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16633 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_TRUESTATE 16634 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCESTATE_FALSESTATE 16635 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_AUDIBLEENABLED 16636 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_AUDIBLESOUND 16637 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE_OUTPUTARGUMENTS 16638 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE 16639 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE_INPUTARGUMENTS 16640 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE_OUTPUTARGUMENTS 16641 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ONDELAY 16642 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_OFFDELAY 16643 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_FIRSTINGROUPFLAG 16644 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_FIRSTINGROUP 16645 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_ALARMGROUP_PLACEHOLDER 16646 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_REALARMTIME 16647 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_REALARMREPEATCOUNT 16648 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SILENCE 16649 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SUPPRESS 16650 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDDATASETFOLDER 16651 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_BASEHIGHHIGHLIMIT 16652 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_BASEHIGHLIMIT 16653 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_BASELOWLIMIT 16654 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_BASELOWLOWLIMIT 16655 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONSUBCLASSID 16656 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_CONDITIONSUBCLASSNAME 16657 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE 16658 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_ID 16659 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_NAME 16660 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_NUMBER 16661 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16662 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16663 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16664 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16665 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16666 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE 16667 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_ID 16668 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_NAME 16669 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_NUMBER 16670 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16671 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_TRANSITIONTIME 16672 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16673 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_TRUESTATE 16674 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCESTATE_FALSESTATE 16675 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_AUDIBLEENABLED 16676 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_AUDIBLESOUND 16677 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDDATASETFOLDER_INPUTARGUMENTS 16678 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_ADDDATASETFOLDER_OUTPUTARGUMENTS 16679 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_REMOVEDATASETFOLDER 16680 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_PUBLISHEDDATASETS_REMOVEDATASETFOLDER_INPUTARGUMENTS 16681 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ONDELAY 16682 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_OFFDELAY 16683 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_FIRSTINGROUPFLAG 16684 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_FIRSTINGROUP 16685 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_ALARMGROUP_PLACEHOLDER 16686 /* Object */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_REALARMTIME 16687 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_REALARMREPEATCOUNT 16688 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SILENCE 16689 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SUPPRESS 16690 /* Method */ +#define UA_NS0ID_ADDCONNECTIONMETHODTYPE 16691 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_BASEHIGHHIGHLIMIT 16692 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_BASEHIGHLIMIT 16693 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_BASELOWLIMIT 16694 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_BASELOWLOWLIMIT 16695 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONSUBCLASSID 16696 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_CONDITIONSUBCLASSNAME 16697 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE 16698 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_ID 16699 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_NAME 16700 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_NUMBER 16701 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16702 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16703 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16704 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16705 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16706 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE 16707 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_ID 16708 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_NAME 16709 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_NUMBER 16710 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16711 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_TRANSITIONTIME 16712 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16713 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_TRUESTATE 16714 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCESTATE_FALSESTATE 16715 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_AUDIBLEENABLED 16716 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_AUDIBLESOUND 16717 /* Variable */ +#define UA_NS0ID_ADDCONNECTIONMETHODTYPE_INPUTARGUMENTS 16718 /* Variable */ +#define UA_NS0ID_ADDCONNECTIONMETHODTYPE_OUTPUTARGUMENTS 16719 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERID 16720 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETFIELDCONTENTMASK 16721 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ONDELAY 16722 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_OFFDELAY 16723 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_FIRSTINGROUPFLAG 16724 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_FIRSTINGROUP 16725 /* Object */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_ALARMGROUP_PLACEHOLDER 16726 /* Object */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_REALARMTIME 16727 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_REALARMREPEATCOUNT 16728 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SILENCE 16729 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SUPPRESS 16730 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_KEYFRAMECOUNT 16731 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_BASEHIGHHIGHLIMIT 16732 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_BASEHIGHLIMIT 16733 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_BASELOWLIMIT 16734 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_BASELOWLOWLIMIT 16735 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONSUBCLASSID 16736 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_CONDITIONSUBCLASSNAME 16737 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE 16738 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_ID 16739 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_NAME 16740 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_NUMBER 16741 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16742 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16743 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16744 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16745 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16746 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE 16747 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_ID 16748 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_NAME 16749 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_NUMBER 16750 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16751 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_TRANSITIONTIME 16752 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16753 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_TRUESTATE 16754 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_FALSESTATE 16755 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_AUDIBLEENABLED 16756 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND 16757 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_MESSAGESETTINGS 16758 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETCLASSID 16759 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERID 16760 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETFIELDCONTENTMASK 16761 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ONDELAY 16762 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_OFFDELAY 16763 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_FIRSTINGROUPFLAG 16764 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_FIRSTINGROUP 16765 /* Object */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_ALARMGROUP_PLACEHOLDER 16766 /* Object */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_REALARMTIME 16767 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_REALARMREPEATCOUNT 16768 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SILENCE 16769 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SUPPRESS 16770 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_KEYFRAMECOUNT 16771 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BASEHIGHHIGHLIMIT 16772 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BASEHIGHLIMIT 16773 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BASELOWLIMIT 16774 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BASELOWLOWLIMIT 16775 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_BASESETPOINTNODE 16776 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONSUBCLASSID 16777 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_CONDITIONSUBCLASSNAME 16778 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE 16779 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_ID 16780 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_NAME 16781 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_NUMBER 16782 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16783 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16784 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16785 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16786 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16787 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE 16788 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_ID 16789 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_NAME 16790 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_NUMBER 16791 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16792 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_TRANSITIONTIME 16793 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16794 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_TRUESTATE 16795 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCESTATE_FALSESTATE 16796 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_AUDIBLEENABLED 16797 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND 16798 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_MESSAGESETTINGS 16799 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETCLASSID 16800 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERID 16801 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETFIELDCONTENTMASK 16802 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ONDELAY 16803 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_OFFDELAY 16804 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_FIRSTINGROUPFLAG 16805 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_FIRSTINGROUP 16806 /* Object */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_ALARMGROUP_PLACEHOLDER 16807 /* Object */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_REALARMTIME 16808 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_REALARMREPEATCOUNT 16809 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SILENCE 16810 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SUPPRESS 16811 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_KEYFRAMECOUNT 16812 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BASEHIGHHIGHLIMIT 16813 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BASEHIGHLIMIT 16814 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BASELOWLIMIT 16815 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BASELOWLOWLIMIT 16816 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_BASESETPOINTNODE 16817 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONSUBCLASSID 16818 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONSUBCLASSNAME 16819 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE 16820 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_ID 16821 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_NAME 16822 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_NUMBER 16823 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16824 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16825 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16826 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16827 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16828 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE 16829 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_ID 16830 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_NAME 16831 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_NUMBER 16832 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16833 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_TRANSITIONTIME 16834 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16835 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_TRUESTATE 16836 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_FALSESTATE 16837 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLEENABLED 16838 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND 16839 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_MESSAGESETTINGS 16840 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETCLASSID 16841 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMSTEMPLATE 16842 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMSTEMPLATE_INPUTARGUMENTS 16843 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ONDELAY 16844 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_OFFDELAY 16845 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_FIRSTINGROUPFLAG 16846 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_FIRSTINGROUP 16847 /* Object */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ALARMGROUP_PLACEHOLDER 16848 /* Object */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_REALARMTIME 16849 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_REALARMREPEATCOUNT 16850 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SILENCE 16851 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESS 16852 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDDATAITEMSTEMPLATE_OUTPUTARGUMENTS 16853 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_BASEHIGHHIGHLIMIT 16854 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_BASEHIGHLIMIT 16855 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_BASELOWLIMIT 16856 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_BASELOWLOWLIMIT 16857 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_ENGINEERINGUNITS 16858 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONSUBCLASSID 16859 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_CONDITIONSUBCLASSNAME 16860 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE 16861 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_ID 16862 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_NAME 16863 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_NUMBER 16864 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16865 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16866 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16867 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16868 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16869 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE 16870 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_ID 16871 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_NAME 16872 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_NUMBER 16873 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16874 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_TRANSITIONTIME 16875 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16876 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_TRUESTATE 16877 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCESTATE_FALSESTATE 16878 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLEENABLED 16879 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND 16880 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTSTEMPLATE 16881 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTSTEMPLATE_INPUTARGUMENTS 16882 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDPUBLISHEDEVENTSTEMPLATE_OUTPUTARGUMENTS 16883 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDDATASETFOLDER 16884 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ONDELAY 16885 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_OFFDELAY 16886 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_FIRSTINGROUPFLAG 16887 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_FIRSTINGROUP 16888 /* Object */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ALARMGROUP_PLACEHOLDER 16889 /* Object */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_REALARMTIME 16890 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_REALARMREPEATCOUNT 16891 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SILENCE 16892 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SUPPRESS 16893 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDDATASETFOLDER_INPUTARGUMENTS 16894 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_BASEHIGHHIGHLIMIT 16895 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_BASEHIGHLIMIT 16896 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_BASELOWLIMIT 16897 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_BASELOWLOWLIMIT 16898 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_ENGINEERINGUNITS 16899 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONSUBCLASSID 16900 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_CONDITIONSUBCLASSNAME 16901 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE 16902 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_ID 16903 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_NAME 16904 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_NUMBER 16905 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16906 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16907 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16908 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16909 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16910 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE 16911 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_ID 16912 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_NAME 16913 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_NUMBER 16914 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16915 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_TRANSITIONTIME 16916 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16917 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_TRUESTATE 16918 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCESTATE_FALSESTATE 16919 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_AUDIBLEENABLED 16920 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_AUDIBLESOUND 16921 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_ADDDATASETFOLDER_OUTPUTARGUMENTS 16922 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_REMOVEDATASETFOLDER 16923 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_DATASETFOLDERNAME_PLACEHOLDER_REMOVEDATASETFOLDER_INPUTARGUMENTS 16924 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_PUBLISHEDDATASETNAME_PLACEHOLDER_DATASETCLASSID 16925 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_ONDELAY 16926 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_OFFDELAY 16927 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_FIRSTINGROUPFLAG 16928 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_FIRSTINGROUP 16929 /* Object */ +#define UA_NS0ID_DISCRETEALARMTYPE_ALARMGROUP_PLACEHOLDER 16930 /* Object */ +#define UA_NS0ID_DISCRETEALARMTYPE_REALARMTIME 16931 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_REALARMREPEATCOUNT 16932 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SILENCE 16933 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_SUPPRESS 16934 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMSTEMPLATE 16935 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONSUBCLASSID 16936 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_CONDITIONSUBCLASSNAME 16937 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE 16938 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_ID 16939 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_NAME 16940 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_NUMBER 16941 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16942 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16943 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16944 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16945 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16946 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE 16947 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_ID 16948 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_NAME 16949 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_NUMBER 16950 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16951 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_TRANSITIONTIME 16952 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16953 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_TRUESTATE 16954 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCESTATE_FALSESTATE 16955 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_AUDIBLEENABLED 16956 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_AUDIBLESOUND 16957 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMSTEMPLATE_INPUTARGUMENTS 16958 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDDATAITEMSTEMPLATE_OUTPUTARGUMENTS 16959 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTSTEMPLATE 16960 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTSTEMPLATE_INPUTARGUMENTS 16961 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ONDELAY 16962 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_OFFDELAY 16963 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_FIRSTINGROUPFLAG 16964 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_FIRSTINGROUP 16965 /* Object */ +#define UA_NS0ID_OFFNORMALALARMTYPE_ALARMGROUP_PLACEHOLDER 16966 /* Object */ +#define UA_NS0ID_OFFNORMALALARMTYPE_REALARMTIME 16967 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_REALARMREPEATCOUNT 16968 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SILENCE 16969 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SUPPRESS 16970 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDPUBLISHEDEVENTSTEMPLATE_OUTPUTARGUMENTS 16971 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONSUBCLASSID 16972 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_CONDITIONSUBCLASSNAME 16973 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE 16974 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_ID 16975 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_NAME 16976 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_NUMBER 16977 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 16978 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 16979 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 16980 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 16981 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 16982 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE 16983 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_ID 16984 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_NAME 16985 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_NUMBER 16986 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 16987 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_TRANSITIONTIME 16988 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 16989 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_TRUESTATE 16990 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCESTATE_FALSESTATE 16991 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_AUDIBLEENABLED 16992 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_AUDIBLESOUND 16993 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER 16994 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER_INPUTARGUMENTS 16995 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_ADDDATASETFOLDER_OUTPUTARGUMENTS 16996 /* Variable */ +#define UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER 16997 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ONDELAY 16998 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_OFFDELAY 16999 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_FIRSTINGROUPFLAG 17000 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_FIRSTINGROUP 17001 /* Object */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_ALARMGROUP_PLACEHOLDER 17002 /* Object */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_REALARMTIME 17003 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_REALARMREPEATCOUNT 17004 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SILENCE 17005 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SUPPRESS 17006 /* Method */ +#define UA_NS0ID_DATASETFOLDERTYPE_REMOVEDATASETFOLDER_INPUTARGUMENTS 17007 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONSUBCLASSID 17008 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_CONDITIONSUBCLASSNAME 17009 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE 17010 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_ID 17011 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_NAME 17012 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_NUMBER 17013 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 17014 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 17015 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 17016 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 17017 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 17018 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE 17019 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_ID 17020 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_NAME 17021 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_NUMBER 17022 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 17023 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_TRANSITIONTIME 17024 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 17025 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_TRUESTATE 17026 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCESTATE_FALSESTATE 17027 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_AUDIBLEENABLED 17028 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_AUDIBLESOUND 17029 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSTEMPLATEMETHODTYPE 17030 /* Method */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSTEMPLATEMETHODTYPE_INPUTARGUMENTS 17031 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDDATAITEMSTEMPLATEMETHODTYPE_OUTPUTARGUMENTS 17032 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSTEMPLATEMETHODTYPE 17033 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_ONDELAY 17034 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_OFFDELAY 17035 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_FIRSTINGROUPFLAG 17036 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_FIRSTINGROUP 17037 /* Object */ +#define UA_NS0ID_TRIPALARMTYPE_ALARMGROUP_PLACEHOLDER 17038 /* Object */ +#define UA_NS0ID_TRIPALARMTYPE_REALARMTIME 17039 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_REALARMREPEATCOUNT 17040 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SILENCE 17041 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_SUPPRESS 17042 /* Method */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSTEMPLATEMETHODTYPE_INPUTARGUMENTS 17043 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONSUBCLASSID 17044 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_CONDITIONSUBCLASSNAME 17045 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE 17046 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_ID 17047 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_NAME 17048 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_NUMBER 17049 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 17050 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 17051 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 17052 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 17053 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 17054 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE 17055 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_ID 17056 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_NAME 17057 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_NUMBER 17058 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 17059 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_TRANSITIONTIME 17060 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 17061 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_TRUESTATE 17062 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCESTATE_FALSESTATE 17063 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_AUDIBLEENABLED 17064 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_AUDIBLESOUND 17065 /* Variable */ +#define UA_NS0ID_ADDPUBLISHEDEVENTSTEMPLATEMETHODTYPE_OUTPUTARGUMENTS 17066 /* Variable */ +#define UA_NS0ID_ADDDATASETFOLDERMETHODTYPE 17067 /* Method */ +#define UA_NS0ID_ADDDATASETFOLDERMETHODTYPE_INPUTARGUMENTS 17068 /* Variable */ +#define UA_NS0ID_ADDDATASETFOLDERMETHODTYPE_OUTPUTARGUMENTS 17069 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ONDELAY 17070 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_OFFDELAY 17071 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_FIRSTINGROUPFLAG 17072 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_FIRSTINGROUP 17073 /* Object */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_ALARMGROUP_PLACEHOLDER 17074 /* Object */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_REALARMTIME 17075 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_REALARMREPEATCOUNT 17076 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SILENCE 17077 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SUPPRESS 17078 /* Method */ +#define UA_NS0ID_REMOVEDATASETFOLDERMETHODTYPE 17079 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE 17080 /* ObjectType */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_EVENTID 17081 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_EVENTTYPE 17082 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SOURCENODE 17083 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SOURCENAME 17084 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_TIME 17085 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_RECEIVETIME 17086 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LOCALTIME 17087 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_MESSAGE 17088 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SEVERITY 17089 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONCLASSID 17090 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONCLASSNAME 17091 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONSUBCLASSID 17092 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONSUBCLASSNAME 17093 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONNAME 17094 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_BRANCHID 17095 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_RETAIN 17096 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE 17097 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_ID 17098 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_NAME 17099 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_NUMBER 17100 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 17101 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 17102 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 17103 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_TRUESTATE 17104 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLEDSTATE_FALSESTATE 17105 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_QUALITY 17106 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_QUALITY_SOURCETIMESTAMP 17107 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LASTSEVERITY 17108 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 17109 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_COMMENT 17110 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_COMMENT_SOURCETIMESTAMP 17111 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CLIENTUSERID 17112 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_DISABLE 17113 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ENABLE 17114 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ADDCOMMENT 17115 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 17116 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONREFRESH 17117 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 17118 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONREFRESH2 17119 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 17120 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE 17121 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_ID 17122 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_NAME 17123 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_NUMBER 17124 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 17125 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_TRANSITIONTIME 17126 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 17127 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_TRUESTATE 17128 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKEDSTATE_FALSESTATE 17129 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE 17130 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_ID 17131 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_NAME 17132 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_NUMBER 17133 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 17134 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 17135 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 17136 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_TRUESTATE 17137 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRMEDSTATE_FALSESTATE 17138 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKNOWLEDGE 17139 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 17140 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRM 17141 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_CONFIRM_INPUTARGUMENTS 17142 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE 17143 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_ID 17144 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_NAME 17145 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_NUMBER 17146 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 17147 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_TRANSITIONTIME 17148 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 17149 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_TRUESTATE 17150 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ACTIVESTATE_FALSESTATE 17151 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_INPUTNODE 17152 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE 17153 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_ID 17154 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_NAME 17155 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_NUMBER 17156 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 17157 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 17158 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 17159 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 17160 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 17161 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE 17162 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_ID 17163 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_NAME 17164 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_NUMBER 17165 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 17166 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 17167 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 17168 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 17169 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 17170 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE 17171 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_ID 17172 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_NAME 17173 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_NUMBER 17174 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 17175 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_TRANSITIONTIME 17176 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 17177 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_TRUESTATE 17178 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCESTATE_FALSESTATE 17179 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE 17180 /* Object */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_CURRENTSTATE 17181 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 17182 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 17183 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 17184 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 17185 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION 17186 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 17187 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 17188 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 17189 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 17190 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 17191 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_UNSHELVETIME 17192 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_UNSHELVE 17193 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 17194 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 17195 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 17196 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESSEDORSHELVED 17197 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_MAXTIMESHELVED 17198 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_AUDIBLEENABLED 17199 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_AUDIBLESOUND 17200 /* Variable */ +#define UA_NS0ID_REMOVEDATASETFOLDERMETHODTYPE_INPUTARGUMENTS 17201 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDRESS_NETWORKINTERFACE 17202 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_TRANSPORTSETTINGS 17203 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_MAXNETWORKMESSAGESIZE 17204 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ONDELAY 17205 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_OFFDELAY 17206 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_FIRSTINGROUPFLAG 17207 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_FIRSTINGROUP 17208 /* Object */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_ALARMGROUP_PLACEHOLDER 17209 /* Object */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_REALARMTIME 17210 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_REALARMREPEATCOUNT 17211 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SILENCE 17212 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SUPPRESS 17213 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_WRITERGROUPID 17214 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_TARGETVALUENODE 17215 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_EXPECTEDTIME 17216 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_TOLERANCE 17217 /* Variable */ +#define UA_NS0ID_SAFETYCONDITIONCLASSTYPE 17218 /* ObjectType */ +#define UA_NS0ID_HIGHLYMANAGEDALARMCONDITIONCLASSTYPE 17219 /* ObjectType */ +#define UA_NS0ID_TRAININGCONDITIONCLASSTYPE 17220 /* ObjectType */ +#define UA_NS0ID_TESTINGCONDITIONSUBCLASSTYPE 17221 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONCOMMENTEVENTTYPE_CONDITIONEVENTID 17222 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONACKNOWLEDGEEVENTTYPE_CONDITIONEVENTID 17223 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONCONFIRMEVENTTYPE_CONDITIONEVENTID 17224 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE 17225 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_EVENTID 17226 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_EVENTTYPE 17227 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_SOURCENODE 17228 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_SOURCENAME 17229 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_TIME 17230 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_RECEIVETIME 17231 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_LOCALTIME 17232 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_MESSAGE 17233 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_SEVERITY 17234 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_ACTIONTIMESTAMP 17235 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_STATUS 17236 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_SERVERID 17237 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_CLIENTAUDITENTRYID 17238 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_CLIENTUSERID 17239 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_METHODID 17240 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSUPPRESSIONEVENTTYPE_INPUTARGUMENTS 17241 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE 17242 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_EVENTID 17243 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_EVENTTYPE 17244 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_SOURCENODE 17245 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_SOURCENAME 17246 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_TIME 17247 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_RECEIVETIME 17248 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_LOCALTIME 17249 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_MESSAGE 17250 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_SEVERITY 17251 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_ACTIONTIMESTAMP 17252 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_STATUS 17253 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_SERVERID 17254 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_CLIENTAUDITENTRYID 17255 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_CLIENTUSERID 17256 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_METHODID 17257 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONSILENCEEVENTTYPE_INPUTARGUMENTS 17258 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE 17259 /* ObjectType */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_EVENTID 17260 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_EVENTTYPE 17261 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_SOURCENODE 17262 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_SOURCENAME 17263 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_TIME 17264 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_RECEIVETIME 17265 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_LOCALTIME 17266 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_MESSAGE 17267 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_SEVERITY 17268 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_ACTIONTIMESTAMP 17269 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_STATUS 17270 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_SERVERID 17271 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_CLIENTAUDITENTRYID 17272 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_CLIENTUSERID 17273 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_METHODID 17274 /* Variable */ +#define UA_NS0ID_AUDITCONDITIONOUTOFSERVICEEVENTTYPE_INPUTARGUMENTS 17275 /* Variable */ +#define UA_NS0ID_HASEFFECTDISABLE 17276 /* ReferenceType */ +#define UA_NS0ID_ALARMRATEVARIABLETYPE 17277 /* VariableType */ +#define UA_NS0ID_ALARMRATEVARIABLETYPE_RATE 17278 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE 17279 /* ObjectType */ +#define UA_NS0ID_ALARMMETRICSTYPE_ALARMCOUNT 17280 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_MAXIMUMACTIVESTATE 17281 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_MAXIMUMUNACK 17282 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_MAXIMUMREALARMCOUNT 17283 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_CURRENTALARMRATE 17284 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_CURRENTALARMRATE_RATE 17285 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_MAXIMUMALARMRATE 17286 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_MAXIMUMALARMRATE_RATE 17287 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_AVERAGEALARMRATE 17288 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_AVERAGEALARMRATE_RATE 17289 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_TRANSPORTSETTINGS 17290 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_MESSAGESETTINGS 17291 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI 17292 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_ADDDATASETWRITER 17293 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_ADDDATASETWRITER_INPUTARGUMENTS 17294 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_RESTRICTTOLIST 17295 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SETSECURITYKEYS 17296 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SETSECURITYKEYS_INPUTARGUMENTS 17297 /* Variable */ +#define UA_NS0ID_SETSECURITYKEYSMETHODTYPE 17298 /* Method */ +#define UA_NS0ID_SETSECURITYKEYSMETHODTYPE_INPUTARGUMENTS 17299 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 17300 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_ADDDATASETWRITER_OUTPUTARGUMENTS 17301 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_MAXNETWORKMESSAGESIZE 17302 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 17303 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 17304 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 17305 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_TRANSPORTPROFILEURI 17306 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_TRANSPORTSETTINGS 17307 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_MESSAGESETTINGS 17308 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_TRANSPORTPROFILEURI_RESTRICTTOLIST 17309 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER 17310 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_SECURITYMODE 17311 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_SECURITYGROUPID 17312 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_SECURITYKEYSERVICES 17313 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_STATUS 17314 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_STATUS_STATE 17315 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_STATUS_ENABLE 17316 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_STATUS_DISABLE 17317 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_PUBLISHINGINTERVAL 17318 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_KEEPALIVETIME 17319 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 17320 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_PRIORITY 17321 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_LOCALEIDS 17322 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_REMOVEDATASETWRITER 17323 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_REMOVEDATASETWRITER_INPUTARGUMENTS 17324 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER 17325 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_SECURITYMODE 17326 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_SECURITYGROUPID 17327 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_SECURITYKEYSERVICES 17328 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_STATUS 17329 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_STATUS_STATE 17330 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_STATUS_ENABLE 17331 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_STATUS_DISABLE 17332 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_REMOVEDATASETREADER 17333 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_REMOVEDATASETREADER_INPUTARGUMENTS 17334 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 17335 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 17336 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 17337 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 17338 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 17339 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 17340 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 17341 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 17342 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 17343 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 17344 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 17345 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 17346 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 17347 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 17348 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 17349 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 17350 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 17351 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 17352 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS 17353 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS_DIAGNOSTICSLEVEL 17354 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_ADDDATASETREADER 17355 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP 17356 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP_INPUTARGUMENTS 17357 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDWRITERGROUP_OUTPUTARGUMENTS 17358 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP 17359 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP_INPUTARGUMENTS 17360 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDREADERGROUP_OUTPUTARGUMENTS 17361 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_REMOVEGROUP 17362 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_REMOVEGROUP_INPUTARGUMENTS 17363 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SETSECURITYKEYS 17364 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SETSECURITYKEYS_INPUTARGUMENTS 17365 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_ADDCONNECTION 17366 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_ADDCONNECTION_INPUTARGUMENTS 17367 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_ADDCONNECTION_OUTPUTARGUMENTS 17368 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_REMOVECONNECTION 17369 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_REMOVECONNECTION_INPUTARGUMENTS 17370 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS 17371 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS 17372 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS_INPUTARGUMENTS 17373 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMS_OUTPUTARGUMENTS 17374 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS 17375 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS_INPUTARGUMENTS 17376 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTS_OUTPUTARGUMENTS 17377 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE 17378 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE_INPUTARGUMENTS 17379 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDDATAITEMSTEMPLATE_OUTPUTARGUMENTS 17380 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE 17381 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE_INPUTARGUMENTS 17382 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDPUBLISHEDEVENTSTEMPLATE_OUTPUTARGUMENTS 17383 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_REMOVEPUBLISHEDDATASET 17384 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_REMOVEPUBLISHEDDATASET_INPUTARGUMENTS 17385 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_CREATETARGETVARIABLES 17386 /* Method */ +#define UA_NS0ID_DATASETREADERTYPE_CREATETARGETVARIABLES_INPUTARGUMENTS 17387 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_CREATETARGETVARIABLES_OUTPUTARGUMENTS 17388 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_CREATEDATASETMIRROR 17389 /* Method */ +#define UA_NS0ID_DATASETREADERTYPE_CREATEDATASETMIRROR_INPUTARGUMENTS 17390 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_CREATEDATASETMIRROR_OUTPUTARGUMENTS 17391 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPECREATETARGETVARIABLESMETHODTYPE 17392 /* Method */ +#define UA_NS0ID_DATASETREADERTYPECREATETARGETVARIABLESMETHODTYPE_INPUTARGUMENTS 17393 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPECREATETARGETVARIABLESMETHODTYPE_OUTPUTARGUMENTS 17394 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPECREATEDATASETMIRRORMETHODTYPE 17395 /* Method */ +#define UA_NS0ID_DATASETREADERTYPECREATEDATASETMIRRORMETHODTYPE_INPUTARGUMENTS 17396 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPECREATEDATASETMIRRORMETHODTYPE_OUTPUTARGUMENTS 17397 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDDATASETFOLDER 17398 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_ADDDATASETREADER_INPUTARGUMENTS 17399 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_ADDDATASETREADER_OUTPUTARGUMENTS 17400 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDDATASETFOLDER_INPUTARGUMENTS 17401 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_ADDDATASETFOLDER_OUTPUTARGUMENTS 17402 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_REMOVEDATASETFOLDER 17403 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_PUBLISHEDDATASETS_REMOVEDATASETFOLDER_INPUTARGUMENTS 17404 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_STATUS 17405 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_STATUS_STATE 17406 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_STATUS_ENABLE 17407 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_STATUS_DISABLE 17408 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS 17409 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_DIAGNOSTICSLEVEL 17410 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALINFORMATION 17411 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 17412 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 17413 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 17414 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 17415 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALERROR 17416 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALERROR_ACTIVE 17417 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 17418 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 17419 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 17420 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_RESET 17421 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_SUBERROR 17422 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS 17423 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEERROR 17424 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 17425 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 17426 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP 17427 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP_INPUTARGUMENTS 17428 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 17429 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 17430 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 17431 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 17432 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 17433 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 17434 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 17435 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 17436 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 17437 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 17438 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 17439 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 17440 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 17441 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 17442 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 17443 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 17444 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 17445 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 17446 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 17447 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 17448 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 17449 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 17450 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 17451 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 17452 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 17453 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 17454 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 17455 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDWRITERGROUP_OUTPUTARGUMENTS 17456 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES 17457 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS 17458 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 17459 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS 17460 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 17461 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS 17462 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 17463 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS 17464 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP 17465 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 17466 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTDATATYPE 17467 /* DataType */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 17468 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE 17469 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 17470 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 17471 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTXML 17472 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE 17473 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE_DATATYPEVERSION 17474 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMCONNECTIONTRANSPORTDATATYPE_DICTIONARYFRAGMENT 17475 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 17476 /* Object */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_DATASETOFFSET 17477 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_CONNECTIONPROPERTIES 17478 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_SUPPORTEDTRANSPORTPROFILES 17479 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_CONNECTIONPROPERTIES 17480 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_SUPPORTEDTRANSPORTPROFILES 17481 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERPROPERTIES 17482 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERPROPERTIES 17483 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERPROPERTIES 17484 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_CONNECTIONPROPERTIES 17485 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_GROUPPROPERTIES 17486 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_GROUPPROPERTIES 17487 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_GROUPPROPERTIES 17488 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_GROUPPROPERTIES 17489 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERPROPERTIES 17490 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_GROUPPROPERTIES 17491 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DATASETREADERPROPERTIES 17492 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DATASETWRITERPROPERTIES 17493 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DATASETREADERPROPERTIES 17494 /* Variable */ +#define UA_NS0ID_CREATECREDENTIALMETHODTYPE_OUTPUTARGUMENTS 17495 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE 17496 /* ObjectType */ +#define UA_NS0ID_ANALOGUNITTYPE 17497 /* VariableType */ +#define UA_NS0ID_ANALOGUNITTYPE_DEFINITION 17498 /* Variable */ +#define UA_NS0ID_ANALOGUNITTYPE_VALUEPRECISION 17499 /* Variable */ +#define UA_NS0ID_ANALOGUNITTYPE_INSTRUMENTRANGE 17500 /* Variable */ +#define UA_NS0ID_ANALOGUNITTYPE_EURANGE 17501 /* Variable */ +#define UA_NS0ID_ANALOGUNITTYPE_ENGINEERINGUNITS 17502 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_SELECTIONS 17503 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17504 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_RESTRICTTOLIST 17505 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_SELECTIONS 17506 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP_INPUTARGUMENTS 17507 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDREADERGROUP_OUTPUTARGUMENTS 17508 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17509 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBE_CONNECTIONNAME_PLACEHOLDER_ADDRESS_NETWORKINTERFACE_RESTRICTTOLIST 17510 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER 17511 /* Object */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_RESOURCEURI 17512 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_PROFILEURI 17513 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_ENDPOINTURLS 17514 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_SERVICESTATUS 17515 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY 17516 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY_INPUTARGUMENTS 17517 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY_OUTPUTARGUMENTS 17518 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_UPDATECREDENTIAL 17519 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_UPDATECREDENTIAL_INPUTARGUMENTS 17520 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_SERVICENAME_PLACEHOLDER_DELETECREDENTIAL 17521 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_CREATECREDENTIAL 17522 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_CREATECREDENTIAL_INPUTARGUMENTS 17523 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONFOLDERTYPE_CREATECREDENTIAL_OUTPUTARGUMENTS 17524 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY 17525 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY_INPUTARGUMENTS 17526 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_GETENCRYPTINGKEY_OUTPUTARGUMENTS 17527 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_CREATECREDENTIAL 17528 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_CREATECREDENTIAL_INPUTARGUMENTS 17529 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_CREATECREDENTIAL_OUTPUTARGUMENTS 17530 /* Variable */ +#define UA_NS0ID_GETENCRYPTINGKEYMETHODTYPE 17531 /* Method */ +#define UA_NS0ID_GETENCRYPTINGKEYMETHODTYPE_INPUTARGUMENTS 17532 /* Variable */ +#define UA_NS0ID_GETENCRYPTINGKEYMETHODTYPE_OUTPUTARGUMENTS 17533 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_GETENCRYPTINGKEY 17534 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_GETENCRYPTINGKEY_INPUTARGUMENTS 17535 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_GETENCRYPTINGKEY_OUTPUTARGUMENTS 17536 /* Variable */ +#define UA_NS0ID_ADDITIONALPARAMETERSTYPE_ENCODING_DEFAULTBINARY 17537 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDITIONALPARAMETERSTYPE 17538 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDITIONALPARAMETERSTYPE_DATATYPEVERSION 17539 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ADDITIONALPARAMETERSTYPE_DICTIONARYFRAGMENT 17540 /* Variable */ +#define UA_NS0ID_ADDITIONALPARAMETERSTYPE_ENCODING_DEFAULTXML 17541 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDITIONALPARAMETERSTYPE 17542 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDITIONALPARAMETERSTYPE_DATATYPEVERSION 17543 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ADDITIONALPARAMETERSTYPE_DICTIONARYFRAGMENT 17544 /* Variable */ +#define UA_NS0ID_RSAENCRYPTEDSECRET 17545 /* DataType */ +#define UA_NS0ID_ECCENCRYPTEDSECRET 17546 /* DataType */ +#define UA_NS0ID_ADDITIONALPARAMETERSTYPE_ENCODING_DEFAULTJSON 17547 /* Object */ +#define UA_NS0ID_EPHEMERALKEYTYPE 17548 /* DataType */ +#define UA_NS0ID_EPHEMERALKEYTYPE_ENCODING_DEFAULTBINARY 17549 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EPHEMERALKEYTYPE 17550 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EPHEMERALKEYTYPE_DATATYPEVERSION 17551 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_EPHEMERALKEYTYPE_DICTIONARYFRAGMENT 17552 /* Variable */ +#define UA_NS0ID_EPHEMERALKEYTYPE_ENCODING_DEFAULTXML 17553 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EPHEMERALKEYTYPE 17554 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EPHEMERALKEYTYPE_DATATYPEVERSION 17555 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_EPHEMERALKEYTYPE_DICTIONARYFRAGMENT 17556 /* Variable */ +#define UA_NS0ID_EPHEMERALKEYTYPE_ENCODING_DEFAULTJSON 17557 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_HEADERLAYOUTURI 17558 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_HEADERLAYOUTURI 17559 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_KEYFRAMECOUNT 17560 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPEADDWRITERGROUPMETHODTYPE 17561 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_HEADERLAYOUTURI 17562 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_KEYFRAMECOUNT 17563 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_HEADERLAYOUTURI 17564 /* Variable */ +#define UA_NS0ID_BASEANALOGTYPE_DEFINITION 17565 /* Variable */ +#define UA_NS0ID_BASEANALOGTYPE_VALUEPRECISION 17566 /* Variable */ +#define UA_NS0ID_BASEANALOGTYPE_INSTRUMENTRANGE 17567 /* Variable */ +#define UA_NS0ID_BASEANALOGTYPE_EURANGE 17568 /* Variable */ +#define UA_NS0ID_BASEANALOGTYPE_ENGINEERINGUNITS 17569 /* Variable */ +#define UA_NS0ID_ANALOGUNITRANGETYPE 17570 /* VariableType */ +#define UA_NS0ID_ANALOGUNITRANGETYPE_DEFINITION 17571 /* Variable */ +#define UA_NS0ID_ANALOGUNITRANGETYPE_VALUEPRECISION 17572 /* Variable */ +#define UA_NS0ID_ANALOGUNITRANGETYPE_INSTRUMENTRANGE 17573 /* Variable */ +#define UA_NS0ID_ANALOGUNITRANGETYPE_EURANGE 17574 /* Variable */ +#define UA_NS0ID_ANALOGUNITRANGETYPE_ENGINEERINGUNITS 17575 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDRESS_NETWORKINTERFACE_SELECTIONS 17576 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDRESS_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17577 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_ADDRESS_NETWORKINTERFACE_RESTRICTTOLIST 17578 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE_DISCOVERYADDRESS_NETWORKINTERFACE_SELECTIONS 17579 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE_DISCOVERYADDRESS_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17580 /* Variable */ +#define UA_NS0ID_DATAGRAMCONNECTIONTRANSPORTTYPE_DISCOVERYADDRESS_NETWORKINTERFACE_RESTRICTTOLIST 17581 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSTYPE_NETWORKINTERFACE_SELECTIONS 17582 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSTYPE_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17583 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSTYPE_NETWORKINTERFACE_RESTRICTTOLIST 17584 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE_NETWORKINTERFACE_SELECTIONS 17585 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE_NETWORKINTERFACE_SELECTIONDESCRIPTIONS 17586 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE_NETWORKINTERFACE_RESTRICTTOLIST 17587 /* Variable */ +#define UA_NS0ID_INDEX 17588 /* DataType */ +#define UA_NS0ID_DICTIONARYENTRYTYPE 17589 /* ObjectType */ +#define UA_NS0ID_DICTIONARYENTRYTYPE_DICTIONARYENTRYNAME_PLACEHOLDER 17590 /* Object */ +#define UA_NS0ID_DICTIONARYFOLDERTYPE 17591 /* ObjectType */ +#define UA_NS0ID_DICTIONARYFOLDERTYPE_DICTIONARYFOLDERNAME_PLACEHOLDER 17592 /* Object */ +#define UA_NS0ID_DICTIONARYFOLDERTYPE_DICTIONARYENTRYNAME_PLACEHOLDER 17593 /* Object */ +#define UA_NS0ID_DICTIONARIES 17594 /* Object */ +#define UA_NS0ID_DICTIONARIES_DICTIONARYFOLDERNAME_PLACEHOLDER 17595 /* Object */ +#define UA_NS0ID_DICTIONARIES_DICTIONARYENTRYNAME_PLACEHOLDER 17596 /* Object */ +#define UA_NS0ID_HASDICTIONARYENTRY 17597 /* ReferenceType */ +#define UA_NS0ID_IRDIDICTIONARYENTRYTYPE 17598 /* ObjectType */ +#define UA_NS0ID_IRDIDICTIONARYENTRYTYPE_DICTIONARYENTRYNAME_PLACEHOLDER 17599 /* Object */ +#define UA_NS0ID_URIDICTIONARYENTRYTYPE 17600 /* ObjectType */ +#define UA_NS0ID_URIDICTIONARYENTRYTYPE_DICTIONARYENTRYNAME_PLACEHOLDER 17601 /* Object */ +#define UA_NS0ID_BASEINTERFACETYPE 17602 /* ObjectType */ +#define UA_NS0ID_HASINTERFACE 17603 /* ReferenceType */ +#define UA_NS0ID_HASADDIN 17604 /* ReferenceType */ +#define UA_NS0ID_DEFAULTINSTANCEBROWSENAME 17605 /* Variable */ +#define UA_NS0ID_GENERICATTRIBUTEVALUE 17606 /* DataType */ +#define UA_NS0ID_GENERICATTRIBUTES 17607 /* DataType */ +#define UA_NS0ID_GENERICATTRIBUTEVALUE_ENCODING_DEFAULTXML 17608 /* Object */ +#define UA_NS0ID_GENERICATTRIBUTES_ENCODING_DEFAULTXML 17609 /* Object */ +#define UA_NS0ID_GENERICATTRIBUTEVALUE_ENCODING_DEFAULTBINARY 17610 /* Object */ +#define UA_NS0ID_GENERICATTRIBUTES_ENCODING_DEFAULTBINARY 17611 /* Object */ +#define UA_NS0ID_SERVERTYPE_LOCALTIME 17612 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPEADDWRITERGROUPMETHODTYPE_INPUTARGUMENTS 17613 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPEADDWRITERGROUPMETHODTYPE_OUTPUTARGUMENTS 17614 /* Variable */ +#define UA_NS0ID_AUDITSECURITYEVENTTYPE_STATUSCODEID 17615 /* Variable */ +#define UA_NS0ID_AUDITCHANNELEVENTTYPE_STATUSCODEID 17616 /* Variable */ +#define UA_NS0ID_AUDITOPENSECURECHANNELEVENTTYPE_STATUSCODEID 17617 /* Variable */ +#define UA_NS0ID_AUDITSESSIONEVENTTYPE_STATUSCODEID 17618 /* Variable */ +#define UA_NS0ID_AUDITCREATESESSIONEVENTTYPE_STATUSCODEID 17619 /* Variable */ +#define UA_NS0ID_AUDITURLMISMATCHEVENTTYPE_STATUSCODEID 17620 /* Variable */ +#define UA_NS0ID_AUDITACTIVATESESSIONEVENTTYPE_STATUSCODEID 17621 /* Variable */ +#define UA_NS0ID_AUDITCANCELEVENTTYPE_STATUSCODEID 17622 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEVENTTYPE_STATUSCODEID 17623 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEDATAMISMATCHEVENTTYPE_STATUSCODEID 17624 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEEXPIREDEVENTTYPE_STATUSCODEID 17625 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEINVALIDEVENTTYPE_STATUSCODEID 17626 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEUNTRUSTEDEVENTTYPE_STATUSCODEID 17627 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEREVOKEDEVENTTYPE_STATUSCODEID 17628 /* Variable */ +#define UA_NS0ID_AUDITCERTIFICATEMISMATCHEVENTTYPE_STATUSCODEID 17629 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONADDREADERGROUPGROUPMETHODTYPE 17630 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONADDREADERGROUPGROUPMETHODTYPE_INPUTARGUMENTS 17631 /* Variable */ +#define UA_NS0ID_SELECTIONLISTTYPE_SELECTIONS 17632 /* Variable */ +#define UA_NS0ID_SELECTIONLISTTYPE_SELECTIONDESCRIPTIONS 17633 /* Variable */ +#define UA_NS0ID_SERVER_LOCALTIME 17634 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_AVAILABLESTATES 17635 /* Variable */ +#define UA_NS0ID_FINITESTATEMACHINETYPE_AVAILABLETRANSITIONS 17636 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_AVAILABLESTATES 17637 /* Variable */ +#define UA_NS0ID_TEMPORARYFILETRANSFERTYPE_TRANSFERSTATE_PLACEHOLDER_AVAILABLETRANSITIONS 17638 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_AVAILABLESTATES 17639 /* Variable */ +#define UA_NS0ID_FILETRANSFERSTATEMACHINETYPE_AVAILABLETRANSITIONS 17640 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE 17641 /* ObjectType */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_EVENTID 17642 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_EVENTTYPE 17643 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_SOURCENODE 17644 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_SOURCENAME 17645 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_TIME 17646 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_RECEIVETIME 17647 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_LOCALTIME 17648 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_MESSAGE 17649 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_SEVERITY 17650 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_ACTIONTIMESTAMP 17651 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_STATUS 17652 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_SERVERID 17653 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_CLIENTAUDITENTRYID 17654 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_CLIENTUSERID 17655 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_METHODID 17656 /* Variable */ +#define UA_NS0ID_ROLEMAPPINGRULECHANGEDAUDITEVENTTYPE_INPUTARGUMENTS 17657 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_AVAILABLESTATES 17658 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17659 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_AVAILABLESTATES 17660 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_SHELVINGSTATE_AVAILABLETRANSITIONS 17661 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_AVAILABLESTATES 17662 /* Variable */ +#define UA_NS0ID_SHELVEDSTATEMACHINETYPE_AVAILABLETRANSITIONS 17663 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17664 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17665 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_AVAILABLESTATES 17666 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITSTATEMACHINETYPE_AVAILABLETRANSITIONS 17667 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17668 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17669 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_AVAILABLESTATES 17670 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LIMITSTATE_AVAILABLETRANSITIONS 17671 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17672 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17673 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17674 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17675 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17676 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17677 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_AVAILABLESTATES 17678 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LIMITSTATE_AVAILABLETRANSITIONS 17679 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17680 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17681 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17682 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17683 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_AVAILABLESTATES 17684 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LIMITSTATE_AVAILABLETRANSITIONS 17685 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17686 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17687 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17688 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17689 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_AVAILABLESTATES 17690 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LIMITSTATE_AVAILABLETRANSITIONS 17691 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17692 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17693 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17694 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17695 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17696 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17697 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17698 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17699 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17700 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17701 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 17702 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 17703 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_AVAILABLESTATES 17704 /* Variable */ +#define UA_NS0ID_PROGRAMSTATEMACHINETYPE_AVAILABLETRANSITIONS 17705 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_SELECTIONS 17706 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_TRANSPORTPROFILEURI_SELECTIONDESCRIPTIONS 17707 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_TRANSPORTPROFILEURI_SELECTIONS 17710 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_TRANSPORTPROFILEURI_SELECTIONDESCRIPTIONS 17711 /* Variable */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_DELETEFILESYSTEMOBJECT 17718 /* Method */ +#define UA_NS0ID_FILEDIRECTORYTYPE_FILEDIRECTORYNAME_PLACEHOLDER_DELETEFILESYSTEMOBJECT_INPUTARGUMENTS 17719 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONADDREADERGROUPGROUPMETHODTYPE_OUTPUTARGUMENTS 17720 /* Variable */ +#define UA_NS0ID_CONNECTIONTRANSPORTTYPE 17721 /* ObjectType */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_DELETEFILESYSTEMOBJECT 17722 /* Method */ +#define UA_NS0ID_FILESYSTEM_FILEDIRECTORYNAME_PLACEHOLDER_DELETEFILESYSTEMOBJECT_INPUTARGUMENTS 17723 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPE_MAXNETWORKMESSAGESIZE 17724 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE 17725 /* ObjectType */ +#define UA_NS0ID_WRITERGROUPTYPE_SECURITYMODE 17726 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_SECURITYGROUPID 17727 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_SECURITYKEYSERVICES 17728 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_MAXNETWORKMESSAGESIZE 17729 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_STATUS 17730 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_STATUS_STATE 17731 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICES 17732 /* Object */ +#define UA_NS0ID_AUTHORIZATIONSERVICES_SERVICENAME_PLACEHOLDER 17733 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_STATUS_ENABLE 17734 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_STATUS_DISABLE 17735 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_WRITERGROUPID 17736 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_PUBLISHINGINTERVAL 17737 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_KEEPALIVETIME 17738 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_PRIORITY 17739 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_LOCALEIDS 17740 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_TRANSPORTSETTINGS 17741 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_MESSAGESETTINGS 17742 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER 17743 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETWRITERID 17744 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DATASETFIELDCONTENTMASK 17745 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_KEYFRAMECOUNT 17746 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_TRANSPORTSETTINGS 17747 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_MESSAGESETTINGS 17748 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS 17749 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_STATE 17750 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_ENABLE 17751 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_STATUS_DISABLE 17752 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS 17753 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 17754 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 17755 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 17756 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 17757 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 17758 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 17759 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 17760 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 17761 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 17762 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 17763 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 17764 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_RESET 17765 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 17766 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 17767 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 17768 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 17769 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 17770 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 17771 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 17772 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 17773 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 17774 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 17775 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 17776 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 17777 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 17778 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 17779 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 17780 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 17781 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 17782 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 17783 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 17784 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 17785 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 17786 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 17787 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 17788 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 17789 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 17790 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 17791 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 17792 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 17793 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 17794 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 17795 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 17796 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 17797 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 17798 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 17799 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 17800 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 17801 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 17802 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 17803 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 17804 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 17805 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE 17806 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 17807 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 17808 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 17809 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION 17810 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 17811 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS 17812 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 17813 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION 17814 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 17815 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 17816 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 17817 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 17818 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALERROR 17819 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 17820 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 17821 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 17822 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 17823 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_RESET 17824 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_SUBERROR 17825 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS 17826 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR 17827 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 17828 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 17829 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 17830 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 17831 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 17832 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 17833 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 17834 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 17835 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 17836 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 17837 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 17838 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 17839 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 17840 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 17841 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 17842 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 17843 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 17844 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 17845 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 17846 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 17847 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 17848 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 17849 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 17850 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 17851 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICECONFIGURATIONTYPE 17852 /* ObjectType */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 17853 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 17854 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 17855 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 17856 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 17857 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES 17858 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES 17859 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICECONFIGURATIONTYPE_SERVICECERTIFICATE 17860 /* Variable */ +#define UA_NS0ID_DECIMALDATATYPE 17861 /* DataType */ +#define UA_NS0ID_DECIMALDATATYPE_ENCODING_DEFAULTXML 17862 /* Object */ +#define UA_NS0ID_DECIMALDATATYPE_ENCODING_DEFAULTBINARY 17863 /* Object */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_ACTIVE 17864 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_AUDIBLESOUND_LISTID 17865 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_AUDIBLESOUND_AGENCYID 17866 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_AUDIBLESOUND_VERSIONID 17867 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_UNSUPPRESS 17868 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_REMOVEFROMSERVICE 17869 /* Method */ +#define UA_NS0ID_ALARMCONDITIONTYPE_PLACEINSERVICE 17870 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_CLASSIFICATION 17871 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_DIAGNOSTICSLEVEL 17872 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_TIMEFIRSTCHANGE 17873 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS 17874 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_UNSUPPRESS 17875 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_REMOVEFROMSERVICE 17876 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_PLACEINSERVICE 17877 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_ACTIVE 17878 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_AUDIBLESOUND_LISTID 17879 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_AUDIBLESOUND_AGENCYID 17880 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_AUDIBLESOUND_VERSIONID 17881 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_UNSUPPRESS 17882 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_REMOVEFROMSERVICE 17883 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_PLACEINSERVICE 17884 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_CLASSIFICATION 17885 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_LISTID 17886 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_AGENCYID 17887 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_VERSIONID 17888 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_UNSUPPRESS 17889 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_REMOVEFROMSERVICE 17890 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_PLACEINSERVICE 17891 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_DIAGNOSTICSLEVEL 17892 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_LISTID 17893 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_AGENCYID 17894 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_AUDIBLESOUND_VERSIONID 17895 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_UNSUPPRESS 17896 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_REMOVEFROMSERVICE 17897 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_PLACEINSERVICE 17898 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_TIMEFIRSTCHANGE 17899 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS 17900 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_ACTIVE 17901 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_CLASSIFICATION 17902 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_DIAGNOSTICSLEVEL 17903 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_REMOVEFROMSERVICE 17904 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_PLACEINSERVICE 17905 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_TIMEFIRSTCHANGE 17906 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_LISTID 17907 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_AGENCYID 17908 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_VERSIONID 17909 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_UNSUPPRESS 17910 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_REMOVEFROMSERVICE 17911 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_PLACEINSERVICE 17912 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS 17913 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_LISTID 17914 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_AGENCYID 17915 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_VERSIONID 17916 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_UNSUPPRESS 17917 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_REMOVEFROMSERVICE 17918 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_PLACEINSERVICE 17919 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 17920 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_LISTID 17921 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_AGENCYID 17922 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_VERSIONID 17923 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_UNSUPPRESS 17924 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_REMOVEFROMSERVICE 17925 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_PLACEINSERVICE 17926 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS 17927 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_LISTID 17928 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_AGENCYID 17929 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_AUDIBLESOUND_VERSIONID 17930 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_UNSUPPRESS 17931 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_REMOVEFROMSERVICE 17932 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_PLACEINSERVICE 17933 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 17934 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_LISTID 17935 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_AGENCYID 17936 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_AUDIBLESOUND_VERSIONID 17937 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_UNSUPPRESS 17938 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_REMOVEFROMSERVICE 17939 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_PLACEINSERVICE 17940 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID 17941 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_AUDIBLESOUND_LISTID 17942 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_AUDIBLESOUND_AGENCYID 17943 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_AUDIBLESOUND_VERSIONID 17944 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_UNSUPPRESS 17945 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_REMOVEFROMSERVICE 17946 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_PLACEINSERVICE 17947 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 17948 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_AUDIBLESOUND_LISTID 17949 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_AUDIBLESOUND_AGENCYID 17950 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_AUDIBLESOUND_VERSIONID 17951 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_UNSUPPRESS 17952 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_REMOVEFROMSERVICE 17953 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_PLACEINSERVICE 17954 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID 17955 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_AUDIBLESOUND_LISTID 17956 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_AUDIBLESOUND_AGENCYID 17957 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_AUDIBLESOUND_VERSIONID 17958 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_UNSUPPRESS 17959 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_REMOVEFROMSERVICE 17960 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_PLACEINSERVICE 17961 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 17962 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_AUDIBLESOUND_LISTID 17963 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_AUDIBLESOUND_AGENCYID 17964 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_AUDIBLESOUND_VERSIONID 17965 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_UNSUPPRESS 17966 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_REMOVEFROMSERVICE 17967 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_PLACEINSERVICE 17968 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_ADDDATASETWRITER 17969 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_AUDIBLESOUND_LISTID 17970 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_AUDIBLESOUND_AGENCYID 17971 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_AUDIBLESOUND_VERSIONID 17972 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_UNSUPPRESS 17973 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_REMOVEFROMSERVICE 17974 /* Method */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_PLACEINSERVICE 17975 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_ADDDATASETWRITER_INPUTARGUMENTS 17976 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_AUDIBLESOUND_LISTID 17977 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_AUDIBLESOUND_AGENCYID 17978 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_AUDIBLESOUND_VERSIONID 17979 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_UNSUPPRESS 17980 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_REMOVEFROMSERVICE 17981 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_PLACEINSERVICE 17982 /* Method */ +#define UA_NS0ID_HASEFFECTENABLE 17983 /* ReferenceType */ +#define UA_NS0ID_HASEFFECTSUPPRESSED 17984 /* ReferenceType */ +#define UA_NS0ID_HASEFFECTUNSUPPRESSED 17985 /* ReferenceType */ +#define UA_NS0ID_AUDIOVARIABLETYPE 17986 /* VariableType */ +#define UA_NS0ID_WRITERGROUPTYPE_ADDDATASETWRITER_OUTPUTARGUMENTS 17987 /* Variable */ +#define UA_NS0ID_AUDIOVARIABLETYPE_LISTID 17988 /* Variable */ +#define UA_NS0ID_AUDIOVARIABLETYPE_AGENCYID 17989 /* Variable */ +#define UA_NS0ID_AUDIOVARIABLETYPE_VERSIONID 17990 /* Variable */ +#define UA_NS0ID_ALARMMETRICSTYPE_STARTTIME 17991 /* Variable */ +#define UA_NS0ID_WRITERGROUPTYPE_REMOVEDATASETWRITER 17992 /* Method */ +#define UA_NS0ID_WRITERGROUPTYPE_REMOVEDATASETWRITER_INPUTARGUMENTS 17993 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDWRITERRMETHODTYPE 17994 /* Method */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDWRITERRMETHODTYPE_INPUTARGUMENTS 17995 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDWRITERRMETHODTYPE_OUTPUTARGUMENTS 17996 /* Variable */ +#define UA_NS0ID_WRITERGROUPTRANSPORTTYPE 17997 /* ObjectType */ +#define UA_NS0ID_WRITERGROUPMESSAGETYPE 17998 /* ObjectType */ +#define UA_NS0ID_READERGROUPTYPE 17999 /* ObjectType */ +#define UA_NS0ID_READERGROUPTYPE_SECURITYMODE 18000 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE 18001 /* ObjectType */ +#define UA_NS0ID_READERGROUPTYPE_SECURITYGROUPID 18002 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_SECURITYKEYSERVICES 18003 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_ENDPOINTURLS 18004 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_SERVICESTATUS 18005 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_UPDATECREDENTIAL 18006 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_UPDATECREDENTIAL_INPUTARGUMENTS 18007 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_DELETECREDENTIAL 18008 /* Method */ +#define UA_NS0ID_KEYCREDENTIALUPDATEMETHODTYPE 18009 /* Method */ +#define UA_NS0ID_KEYCREDENTIALUPDATEMETHODTYPE_INPUTARGUMENTS 18010 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE 18011 /* ObjectType */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_EVENTID 18012 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_EVENTTYPE 18013 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_SOURCENODE 18014 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_SOURCENAME 18015 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_TIME 18016 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_RECEIVETIME 18017 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_LOCALTIME 18018 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_MESSAGE 18019 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_SEVERITY 18020 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_ACTIONTIMESTAMP 18021 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_STATUS 18022 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_SERVERID 18023 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_CLIENTAUDITENTRYID 18024 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_CLIENTUSERID 18025 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_METHODID 18026 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_INPUTARGUMENTS 18027 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALAUDITEVENTTYPE_RESOURCEURI 18028 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE 18029 /* ObjectType */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_EVENTID 18030 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_EVENTTYPE 18031 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_SOURCENODE 18032 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_SOURCENAME 18033 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_TIME 18034 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_RECEIVETIME 18035 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_LOCALTIME 18036 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_MESSAGE 18037 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_SEVERITY 18038 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_ACTIONTIMESTAMP 18039 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_STATUS 18040 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_SERVERID 18041 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_CLIENTAUDITENTRYID 18042 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_CLIENTUSERID 18043 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_METHODID 18044 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_INPUTARGUMENTS 18045 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALUPDATEDAUDITEVENTTYPE_RESOURCEURI 18046 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE 18047 /* ObjectType */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_EVENTID 18048 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_EVENTTYPE 18049 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_SOURCENODE 18050 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_SOURCENAME 18051 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_TIME 18052 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_RECEIVETIME 18053 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_LOCALTIME 18054 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_MESSAGE 18055 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_SEVERITY 18056 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_ACTIONTIMESTAMP 18057 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_STATUS 18058 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_SERVERID 18059 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_CLIENTAUDITENTRYID 18060 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_CLIENTUSERID 18061 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_METHODID 18062 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_INPUTARGUMENTS 18063 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALDELETEDAUDITEVENTTYPE_RESOURCEURI 18064 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_MAXNETWORKMESSAGESIZE 18065 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICES_SERVICENAME_PLACEHOLDER_SERVICECERTIFICATE 18066 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_STATUS 18067 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_STATUS_STATE 18068 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_RESOURCEURI 18069 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICES_SERVICENAME_PLACEHOLDER_SERVICEURI 18070 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICES_SERVICENAME_PLACEHOLDER_ISSUERENDPOINTURL 18071 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICECONFIGURATIONTYPE_SERVICEURI 18072 /* Variable */ +#define UA_NS0ID_AUTHORIZATIONSERVICECONFIGURATIONTYPE_ISSUERENDPOINTURL 18073 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_STATUS_ENABLE 18074 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_STATUS_DISABLE 18075 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER 18076 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_PUBLISHERID 18077 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_WRITERGROUPID 18078 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DATASETWRITERID 18079 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DATASETMETADATA 18080 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DATASETFIELDCONTENTMASK 18081 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_MESSAGERECEIVETIMEOUT 18082 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_SECURITYMODE 18083 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_SECURITYGROUPID 18084 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_SECURITYKEYSERVICES 18085 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_TRANSPORTSETTINGS 18086 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_MESSAGESETTINGS 18087 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_STATUS 18088 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_STATUS_STATE 18089 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_STATUS_ENABLE 18090 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_STATUS_DISABLE 18091 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS 18092 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 18093 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 18094 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18095 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18096 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18097 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18098 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 18099 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 18100 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18101 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18102 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 18103 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_RESET 18104 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 18105 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 18106 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 18107 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 18108 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 18109 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 18110 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 18111 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 18112 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 18113 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 18114 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 18115 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 18116 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 18117 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 18118 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 18119 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 18120 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 18121 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 18122 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 18123 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 18124 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 18125 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 18126 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 18127 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 18128 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 18129 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 18130 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 18131 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 18132 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 18133 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 18134 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 18135 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 18136 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 18137 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 18138 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 18139 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 18140 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 18141 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 18142 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS 18143 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_ACTIVE 18144 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 18145 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 18146 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 18147 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 18148 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 18149 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE 18150 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 18151 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 18152 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 18153 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION 18154 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION 18155 /* Object */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER 18156 /* Object */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_RESOURCEURI 18157 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 18158 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_ENDPOINTURLS 18159 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_SERVICESTATUS 18160 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_UPDATECREDENTIAL 18161 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_UPDATECREDENTIAL_INPUTARGUMENTS 18162 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_DELETECREDENTIAL 18163 /* Method */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATION_SERVICENAME_PLACEHOLDER_PROFILEURI 18164 /* Variable */ +#define UA_NS0ID_KEYCREDENTIALCONFIGURATIONTYPE_PROFILEURI 18165 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDEFINITION 18166 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDEFINITION_DATATYPEVERSION 18167 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATATYPEDEFINITION_DICTIONARYFRAGMENT 18168 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREFIELD 18169 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREFIELD_DATATYPEVERSION 18170 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREFIELD_DICTIONARYFRAGMENT 18171 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDEFINITION 18172 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDEFINITION_DATATYPEVERSION 18173 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_STRUCTUREDEFINITION_DICTIONARYFRAGMENT 18174 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDEFINITION 18175 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDEFINITION_DATATYPEVERSION 18176 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_ENUMDEFINITION_DICTIONARYFRAGMENT 18177 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDEFINITION 18178 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDEFINITION_DATATYPEVERSION 18179 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATATYPEDEFINITION_DICTIONARYFRAGMENT 18180 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREFIELD 18181 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREFIELD_DATATYPEVERSION 18182 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREFIELD_DICTIONARYFRAGMENT 18183 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDEFINITION 18184 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDEFINITION_DATATYPEVERSION 18185 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_STRUCTUREDEFINITION_DICTIONARYFRAGMENT 18186 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDEFINITION 18187 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDEFINITION_DATATYPEVERSION 18188 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_ENUMDEFINITION_DICTIONARYFRAGMENT 18189 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE 18190 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_ID 18191 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_NAME 18192 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_NUMBER 18193 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18194 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_TRANSITIONTIME 18195 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18196 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_TRUESTATE 18197 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_LATCHEDSTATE_FALSESTATE 18198 /* Variable */ +#define UA_NS0ID_ALARMCONDITIONTYPE_RESET 18199 /* Method */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_AUDIBLESOUND_LISTID 18200 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_AUDIBLESOUND_AGENCYID 18201 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_AUDIBLESOUND_VERSIONID 18202 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE 18203 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_ID 18204 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_NAME 18205 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_NUMBER 18206 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18207 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_TRANSITIONTIME 18208 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18209 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_TRUESTATE 18210 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_LATCHEDSTATE_FALSESTATE 18211 /* Variable */ +#define UA_NS0ID_ALARMGROUPTYPE_ALARMCONDITIONINSTANCE_PLACEHOLDER_RESET 18212 /* Method */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE 18213 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_ID 18214 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_NAME 18215 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_NUMBER 18216 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18217 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18218 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18219 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_TRUESTATE 18220 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_LATCHEDSTATE_FALSESTATE 18221 /* Variable */ +#define UA_NS0ID_LIMITALARMTYPE_RESET 18222 /* Method */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE 18223 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_ID 18224 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_NAME 18225 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_NUMBER 18226 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18227 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18228 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18229 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_TRUESTATE 18230 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_FALSESTATE 18231 /* Variable */ +#define UA_NS0ID_EXCLUSIVELIMITALARMTYPE_RESET 18232 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE 18233 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_ID 18234 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_NAME 18235 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_NUMBER 18236 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18237 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18238 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18239 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_TRUESTATE 18240 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_LATCHEDSTATE_FALSESTATE 18241 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELIMITALARMTYPE_RESET 18242 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_LISTID 18243 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_AGENCYID 18244 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_AUDIBLESOUND_VERSIONID 18245 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE 18246 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_ID 18247 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_NAME 18248 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_NUMBER 18249 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18250 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18251 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18252 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_TRUESTATE 18253 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_FALSESTATE 18254 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_UNSUPPRESS 18255 /* Method */ +#define UA_NS0ID_NONEXCLUSIVELEVELALARMTYPE_RESET 18256 /* Method */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE 18257 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_ID 18258 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_NAME 18259 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_NUMBER 18260 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18261 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18262 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18263 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_TRUESTATE 18264 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_LATCHEDSTATE_FALSESTATE 18265 /* Variable */ +#define UA_NS0ID_EXCLUSIVELEVELALARMTYPE_RESET 18266 /* Method */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE 18267 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_ID 18268 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_NAME 18269 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_NUMBER 18270 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18271 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18272 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18273 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_TRUESTATE 18274 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_FALSESTATE 18275 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVEDEVIATIONALARMTYPE_RESET 18276 /* Method */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE 18277 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_ID 18278 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_NAME 18279 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_NUMBER 18280 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18281 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18282 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18283 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_TRUESTATE 18284 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_FALSESTATE 18285 /* Variable */ +#define UA_NS0ID_NONEXCLUSIVERATEOFCHANGEALARMTYPE_RESET 18286 /* Method */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE 18287 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_ID 18288 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_NAME 18289 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_NUMBER 18290 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18291 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18292 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18293 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_TRUESTATE 18294 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_LATCHEDSTATE_FALSESTATE 18295 /* Variable */ +#define UA_NS0ID_EXCLUSIVEDEVIATIONALARMTYPE_RESET 18296 /* Method */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE 18297 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_ID 18298 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_NAME 18299 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_NUMBER 18300 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18301 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18302 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18303 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_TRUESTATE 18304 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_LATCHEDSTATE_FALSESTATE 18305 /* Variable */ +#define UA_NS0ID_EXCLUSIVERATEOFCHANGEALARMTYPE_RESET 18306 /* Method */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE 18307 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_ID 18308 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_NAME 18309 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_NUMBER 18310 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18311 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18312 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18313 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_TRUESTATE 18314 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_LATCHEDSTATE_FALSESTATE 18315 /* Variable */ +#define UA_NS0ID_DISCRETEALARMTYPE_RESET 18316 /* Method */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE 18317 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_ID 18318 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_NAME 18319 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_NUMBER 18320 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18321 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18322 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18323 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_TRUESTATE 18324 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_LATCHEDSTATE_FALSESTATE 18325 /* Variable */ +#define UA_NS0ID_OFFNORMALALARMTYPE_RESET 18326 /* Method */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE 18327 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_ID 18328 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_NAME 18329 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_NUMBER 18330 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18331 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18332 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18333 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_TRUESTATE 18334 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_LATCHEDSTATE_FALSESTATE 18335 /* Variable */ +#define UA_NS0ID_SYSTEMOFFNORMALALARMTYPE_RESET 18336 /* Method */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE 18337 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_ID 18338 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_NAME 18339 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_NUMBER 18340 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18341 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18342 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18343 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_TRUESTATE 18344 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_LATCHEDSTATE_FALSESTATE 18345 /* Variable */ +#define UA_NS0ID_TRIPALARMTYPE_RESET 18346 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE 18347 /* ObjectType */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_EVENTID 18348 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_EVENTTYPE 18349 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SOURCENODE 18350 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SOURCENAME 18351 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_TIME 18352 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_RECEIVETIME 18353 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LOCALTIME 18354 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_MESSAGE 18355 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SEVERITY 18356 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONCLASSID 18357 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONCLASSNAME 18358 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONSUBCLASSID 18359 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONSUBCLASSNAME 18360 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONNAME 18361 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_BRANCHID 18362 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_RETAIN 18363 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE 18364 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_ID 18365 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_NAME 18366 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_NUMBER 18367 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 18368 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 18369 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 18370 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_TRUESTATE 18371 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLEDSTATE_FALSESTATE 18372 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_QUALITY 18373 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_QUALITY_SOURCETIMESTAMP 18374 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LASTSEVERITY 18375 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 18376 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_COMMENT 18377 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_COMMENT_SOURCETIMESTAMP 18378 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CLIENTUSERID 18379 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_DISABLE 18380 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ENABLE 18381 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ADDCOMMENT 18382 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 18383 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONREFRESH 18384 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 18385 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONREFRESH2 18386 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 18387 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE 18388 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_ID 18389 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_NAME 18390 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_NUMBER 18391 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 18392 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_TRANSITIONTIME 18393 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 18394 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_TRUESTATE 18395 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKEDSTATE_FALSESTATE 18396 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE 18397 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_ID 18398 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_NAME 18399 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_NUMBER 18400 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 18401 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 18402 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 18403 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_TRUESTATE 18404 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_FALSESTATE 18405 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKNOWLEDGE 18406 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 18407 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRM 18408 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_CONFIRM_INPUTARGUMENTS 18409 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE 18410 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_ID 18411 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_NAME 18412 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_NUMBER 18413 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 18414 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_TRANSITIONTIME 18415 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 18416 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_TRUESTATE 18417 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ACTIVESTATE_FALSESTATE 18418 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_INPUTNODE 18419 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE 18420 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_ID 18421 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_NAME 18422 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_NUMBER 18423 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 18424 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 18425 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 18426 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 18427 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 18428 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE 18429 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_ID 18430 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_NAME 18431 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_NUMBER 18432 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 18433 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 18434 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 18435 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 18436 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 18437 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE 18438 /* Object */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE 18439 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 18440 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 18441 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 18442 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 18443 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION 18444 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 18445 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 18446 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 18447 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 18448 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 18449 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 18450 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 18451 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_UNSHELVETIME 18452 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 18453 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 18454 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_UNSHELVE 18455 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 18456 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESSEDORSHELVED 18457 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_MAXTIMESHELVED 18458 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_AUDIBLEENABLED 18459 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_AUDIBLESOUND 18460 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_AUDIBLESOUND_LISTID 18461 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_AUDIBLESOUND_AGENCYID 18462 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_AUDIBLESOUND_VERSIONID 18463 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE 18464 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_ID 18465 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_NAME 18466 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_NUMBER 18467 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 18468 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_TRANSITIONTIME 18469 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 18470 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_TRUESTATE 18471 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCESTATE_FALSESTATE 18472 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ONDELAY 18473 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_OFFDELAY 18474 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_FIRSTINGROUPFLAG 18475 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_FIRSTINGROUP 18476 /* Object */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE 18477 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_ID 18478 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_NAME 18479 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_NUMBER 18480 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18481 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18482 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18483 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_TRUESTATE 18484 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_LATCHEDSTATE_FALSESTATE 18485 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_ALARMGROUP_PLACEHOLDER 18486 /* Object */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_REALARMTIME 18487 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_REALARMREPEATCOUNT 18488 /* Variable */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SILENCE 18489 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_SUPPRESS 18490 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_UNSUPPRESS 18491 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_REMOVEFROMSERVICE 18492 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_PLACEINSERVICE 18493 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_RESET 18494 /* Method */ +#define UA_NS0ID_INSTRUMENTDIAGNOSTICALARMTYPE_NORMALSTATE 18495 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE 18496 /* ObjectType */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_EVENTID 18497 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_EVENTTYPE 18498 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SOURCENODE 18499 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SOURCENAME 18500 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_TIME 18501 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_RECEIVETIME 18502 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LOCALTIME 18503 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_MESSAGE 18504 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SEVERITY 18505 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONCLASSID 18506 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONCLASSNAME 18507 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONSUBCLASSID 18508 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONSUBCLASSNAME 18509 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONNAME 18510 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_BRANCHID 18511 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_RETAIN 18512 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE 18513 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_ID 18514 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_NAME 18515 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_NUMBER 18516 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_EFFECTIVEDISPLAYNAME 18517 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_TRANSITIONTIME 18518 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_EFFECTIVETRANSITIONTIME 18519 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_TRUESTATE 18520 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLEDSTATE_FALSESTATE 18521 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_QUALITY 18522 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_QUALITY_SOURCETIMESTAMP 18523 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LASTSEVERITY 18524 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LASTSEVERITY_SOURCETIMESTAMP 18525 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_COMMENT 18526 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_COMMENT_SOURCETIMESTAMP 18527 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CLIENTUSERID 18528 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_DISABLE 18529 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ENABLE 18530 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ADDCOMMENT 18531 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ADDCOMMENT_INPUTARGUMENTS 18532 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONREFRESH 18533 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONREFRESH_INPUTARGUMENTS 18534 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONREFRESH2 18535 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONDITIONREFRESH2_INPUTARGUMENTS 18536 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE 18537 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_ID 18538 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_NAME 18539 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_NUMBER 18540 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_EFFECTIVEDISPLAYNAME 18541 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_TRANSITIONTIME 18542 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_EFFECTIVETRANSITIONTIME 18543 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_TRUESTATE 18544 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKEDSTATE_FALSESTATE 18545 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE 18546 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_ID 18547 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_NAME 18548 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_NUMBER 18549 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_EFFECTIVEDISPLAYNAME 18550 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_TRANSITIONTIME 18551 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_EFFECTIVETRANSITIONTIME 18552 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_TRUESTATE 18553 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRMEDSTATE_FALSESTATE 18554 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKNOWLEDGE 18555 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACKNOWLEDGE_INPUTARGUMENTS 18556 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRM 18557 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_CONFIRM_INPUTARGUMENTS 18558 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE 18559 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_ID 18560 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_NAME 18561 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_NUMBER 18562 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_EFFECTIVEDISPLAYNAME 18563 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_TRANSITIONTIME 18564 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_EFFECTIVETRANSITIONTIME 18565 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_TRUESTATE 18566 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ACTIVESTATE_FALSESTATE 18567 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_INPUTNODE 18568 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE 18569 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_ID 18570 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_NAME 18571 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_NUMBER 18572 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_EFFECTIVEDISPLAYNAME 18573 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_TRANSITIONTIME 18574 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_EFFECTIVETRANSITIONTIME 18575 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_TRUESTATE 18576 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDSTATE_FALSESTATE 18577 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE 18578 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_ID 18579 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_NAME 18580 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_NUMBER 18581 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_EFFECTIVEDISPLAYNAME 18582 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_TRANSITIONTIME 18583 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_EFFECTIVETRANSITIONTIME 18584 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_TRUESTATE 18585 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OUTOFSERVICESTATE_FALSESTATE 18586 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE 18587 /* Object */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE 18588 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_ID 18589 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NAME 18590 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_NUMBER 18591 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_CURRENTSTATE_EFFECTIVEDISPLAYNAME 18592 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION 18593 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_ID 18594 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NAME 18595 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_NUMBER 18596 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_TRANSITIONTIME 18597 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_LASTTRANSITION_EFFECTIVETRANSITIONTIME 18598 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_AVAILABLESTATES 18599 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_AVAILABLETRANSITIONS 18600 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_UNSHELVETIME 18601 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_TIMEDSHELVE 18602 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_TIMEDSHELVE_INPUTARGUMENTS 18603 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_UNSHELVE 18604 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SHELVINGSTATE_ONESHOTSHELVE 18605 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESSEDORSHELVED 18606 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_MAXTIMESHELVED 18607 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_AUDIBLEENABLED 18608 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_AUDIBLESOUND 18609 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_AUDIBLESOUND_LISTID 18610 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_AUDIBLESOUND_AGENCYID 18611 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_AUDIBLESOUND_VERSIONID 18612 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE 18613 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_ID 18614 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_NAME 18615 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_NUMBER 18616 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_EFFECTIVEDISPLAYNAME 18617 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_TRANSITIONTIME 18618 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_EFFECTIVETRANSITIONTIME 18619 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_TRUESTATE 18620 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCESTATE_FALSESTATE 18621 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ONDELAY 18622 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_OFFDELAY 18623 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_FIRSTINGROUPFLAG 18624 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_FIRSTINGROUP 18625 /* Object */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE 18626 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_ID 18627 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_NAME 18628 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_NUMBER 18629 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18630 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18631 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18632 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_TRUESTATE 18633 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_LATCHEDSTATE_FALSESTATE 18634 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_ALARMGROUP_PLACEHOLDER 18635 /* Object */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_REALARMTIME 18636 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_REALARMREPEATCOUNT 18637 /* Variable */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SILENCE 18638 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_SUPPRESS 18639 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_UNSUPPRESS 18640 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_REMOVEFROMSERVICE 18641 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_PLACEINSERVICE 18642 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_RESET 18643 /* Method */ +#define UA_NS0ID_SYSTEMDIAGNOSTICALARMTYPE_NORMALSTATE 18644 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE 18645 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_ID 18646 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_NAME 18647 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_NUMBER 18648 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18649 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18650 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18651 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_TRUESTATE 18652 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_LATCHEDSTATE_FALSESTATE 18653 /* Variable */ +#define UA_NS0ID_CERTIFICATEEXPIRATIONALARMTYPE_RESET 18654 /* Method */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE 18655 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_ID 18656 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_NAME 18657 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_NUMBER 18658 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_EFFECTIVEDISPLAYNAME 18659 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_TRANSITIONTIME 18660 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_EFFECTIVETRANSITIONTIME 18661 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_TRUESTATE 18662 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_LATCHEDSTATE_FALSESTATE 18663 /* Variable */ +#define UA_NS0ID_DISCREPANCYALARMTYPE_RESET 18664 /* Method */ +#define UA_NS0ID_STATISTICALCONDITIONCLASSTYPE 18665 /* ObjectType */ +#define UA_NS0ID_ALARMMETRICSTYPE_RESET 18666 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS 18667 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 18668 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 18669 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18670 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18671 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18672 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18673 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 18674 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 18675 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18676 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18677 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 18678 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_RESET 18679 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 18680 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 18681 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 18682 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 18683 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 18684 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 18685 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 18686 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 18687 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 18688 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 18689 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 18690 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 18691 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 18692 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 18693 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 18694 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 18695 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 18696 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 18697 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 18698 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 18699 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 18700 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 18701 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 18702 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 18703 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 18704 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 18705 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 18706 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 18707 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 18708 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 18709 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 18710 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 18711 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 18712 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS 18713 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_CONNECTIONNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS_DIAGNOSTICSLEVEL 18714 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS 18715 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 18716 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALINFORMATION 18717 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18718 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18719 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18720 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18721 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALERROR 18722 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 18723 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18724 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18725 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 18726 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_RESET 18727 /* Method */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_SUBERROR 18728 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS 18729 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEERROR 18730 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 18731 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 18732 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 18733 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 18734 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 18735 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 18736 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 18737 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 18738 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 18739 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 18740 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 18741 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 18742 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 18743 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 18744 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 18745 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 18746 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 18747 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 18748 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 18749 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 18750 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 18751 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 18752 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 18753 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 18754 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 18755 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 18756 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 18757 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 18758 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 18759 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES 18760 /* Object */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS 18761 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 18762 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS 18763 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 18764 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS 18765 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 18766 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS 18767 /* Variable */ +#define UA_NS0ID_PUBLISHSUBSCRIBETYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 18768 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS 18871 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 18872 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 18873 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18874 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18875 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18876 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18877 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 18878 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 18879 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18880 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18881 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 18882 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_RESET 18883 /* Method */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 18884 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 18885 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 18886 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 18887 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 18888 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 18889 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 18890 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 18891 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 18892 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 18893 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 18894 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 18895 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 18896 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 18897 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 18898 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 18899 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 18900 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 18901 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 18902 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 18903 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 18904 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 18905 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 18906 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 18907 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 18908 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 18909 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 18910 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 18911 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 18912 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 18913 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 18914 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 18915 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 18916 /* Object */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 18917 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 18918 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 18919 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 18920 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 18921 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 18922 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 18923 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE 18924 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 18925 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 18926 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 18927 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION 18928 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATASETTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 18929 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS 18930 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 18931 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 18932 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18933 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18934 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18935 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18936 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 18937 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 18938 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18939 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18940 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 18941 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_RESET 18942 /* Method */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 18943 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 18944 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 18945 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 18946 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 18947 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 18948 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 18949 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 18950 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 18951 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 18952 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 18953 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 18954 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 18955 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 18956 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 18957 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 18958 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 18959 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 18960 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 18961 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 18962 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 18963 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 18964 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 18965 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 18966 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 18967 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 18968 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 18969 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 18970 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 18971 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 18972 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 18973 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 18974 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 18975 /* Object */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 18976 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 18977 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 18978 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 18979 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 18980 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 18981 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 18982 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE 18983 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 18984 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 18985 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 18986 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION 18987 /* Variable */ +#define UA_NS0ID_PUBLISHEDDATAITEMSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 18988 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS 18989 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 18990 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 18991 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 18992 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 18993 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 18994 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 18995 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 18996 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 18997 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 18998 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 18999 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19000 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_RESET 19001 /* Method */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 19002 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 19003 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 19004 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19005 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19006 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19007 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19008 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19009 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19010 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19011 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19012 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19013 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19014 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19015 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19016 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19017 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19018 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19019 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19020 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19021 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19022 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19023 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19024 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19025 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19026 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19027 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19028 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19029 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19030 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19031 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19032 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19033 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 19034 /* Object */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 19035 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 19036 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 19037 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 19038 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 19039 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 19040 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 19041 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE 19042 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 19043 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 19044 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 19045 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION 19046 /* Variable */ +#define UA_NS0ID_PUBLISHEDEVENTSTYPE_DATASETWRITERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 19047 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS 19107 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 19108 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 19109 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 19110 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 19111 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 19112 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 19113 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 19114 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 19115 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 19116 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 19117 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19118 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_RESET 19119 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 19120 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 19121 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 19122 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19123 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19124 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19125 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19126 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19127 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19128 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19129 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19130 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19131 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19132 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19133 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19134 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19135 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19136 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19137 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19138 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19139 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19140 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19141 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19142 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19143 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19144 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19145 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19146 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19147 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19148 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19149 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19150 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19151 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 19152 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES 19153 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_ACTIVE 19154 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_CLASSIFICATION 19155 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_DIAGNOSTICSLEVEL 19156 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_SENTNETWORKMESSAGES_TIMEFIRSTCHANGE 19157 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS 19158 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_ACTIVE 19159 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_CLASSIFICATION 19160 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_DIAGNOSTICSLEVEL 19161 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_FAILEDTRANSMISSIONS_TIMEFIRSTCHANGE 19162 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS 19163 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_ACTIVE 19164 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_CLASSIFICATION 19165 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_DIAGNOSTICSLEVEL 19166 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_ENCRYPTIONERRORS_TIMEFIRSTCHANGE 19167 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS 19168 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 19169 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS 19170 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 19171 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID 19172 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 19173 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID 19174 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_WRITERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 19175 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS 19176 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_DIAGNOSTICSLEVEL 19177 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION 19178 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 19179 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 19180 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 19181 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 19182 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR 19183 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_ACTIVE 19184 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 19185 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 19186 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19187 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_RESET 19188 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_SUBERROR 19189 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS 19190 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR 19191 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19192 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19193 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19194 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19195 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19196 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19197 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19198 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19199 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19200 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19201 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19202 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19203 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19204 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19205 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19206 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19207 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19208 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19209 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19210 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19211 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19212 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19213 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19214 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19215 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19216 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19217 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19218 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19219 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19220 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES 19221 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES 19222 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_ACTIVE 19223 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_CLASSIFICATION 19224 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_DIAGNOSTICSLEVEL 19225 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_TIMEFIRSTCHANGE 19226 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES 19227 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_ACTIVE 19228 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_CLASSIFICATION 19229 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_DIAGNOSTICSLEVEL 19230 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_TIMEFIRSTCHANGE 19231 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS 19232 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_ACTIVE 19233 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 19234 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 19235 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 19236 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS 19237 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 19238 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS 19239 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_READERGROUPNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 19240 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS 19241 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 19242 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALINFORMATION 19243 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 19244 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 19245 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 19246 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 19247 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALERROR 19248 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 19249 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 19250 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 19251 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19252 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_RESET 19253 /* Method */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_SUBERROR 19254 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS 19255 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEERROR 19256 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19257 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19258 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19259 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19260 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19261 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19262 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19263 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19264 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19265 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19266 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19267 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19268 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19269 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19270 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19271 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19272 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19273 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19274 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19275 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19276 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19277 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19278 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19279 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19280 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19281 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19282 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19283 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19284 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19285 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_LIVEVALUES 19286 /* Object */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS 19287 /* Variable */ +#define UA_NS0ID_PUBSUBCONNECTIONTYPE_DIAGNOSTICS_LIVEVALUES_RESOLVEDADDRESS_DIAGNOSTICSLEVEL 19288 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS 19550 /* Object */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 19551 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALINFORMATION 19552 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 19553 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 19554 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 19555 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 19556 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALERROR 19557 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 19558 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 19559 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 19560 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19561 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_RESET 19562 /* Method */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_SUBERROR 19563 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS 19564 /* Object */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR 19565 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19566 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19567 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19568 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19569 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19570 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19571 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19572 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19573 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19574 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19575 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19576 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19577 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19578 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19579 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19580 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19581 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19582 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19583 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19584 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19585 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19586 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19587 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19588 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19589 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19590 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19591 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19592 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19593 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19594 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES 19595 /* Object */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 19596 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 19597 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 19598 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 19599 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 19600 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 19601 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 19602 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_STATUSCODE 19603 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 19604 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 19605 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 19606 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MINORVERSION 19607 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 19608 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS 19609 /* Object */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 19610 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALINFORMATION 19611 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 19612 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 19613 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 19614 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 19615 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALERROR 19616 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 19617 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 19618 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 19619 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 19620 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_RESET 19621 /* Method */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_SUBERROR 19622 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS 19623 /* Object */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR 19624 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 19625 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 19626 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19627 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19628 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 19629 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19630 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19631 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19632 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19633 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 19634 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19635 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19636 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19637 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19638 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 19639 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19640 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19641 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19642 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19643 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 19644 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19645 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19646 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19647 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19648 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 19649 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19650 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19651 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19652 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19653 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES 19654 /* Object */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES 19655 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 19656 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 19657 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 19658 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 19659 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS 19660 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_ACTIVE 19661 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 19662 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 19663 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 19664 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER 19665 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 19666 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_STATUSCODE 19667 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 19668 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MAJORVERSION 19669 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 19670 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MINORVERSION 19671 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 19672 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID 19673 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 19674 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID 19675 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 19676 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE 19677 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_DIAGNOSTICSLEVEL 19678 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALINFORMATION 19679 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALINFORMATION_ACTIVE 19680 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALINFORMATION_CLASSIFICATION 19681 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19682 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19683 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALERROR 19684 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALERROR_ACTIVE 19685 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALERROR_CLASSIFICATION 19686 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19687 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_TOTALERROR_TIMEFIRSTCHANGE 19688 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_RESET 19689 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_SUBERROR 19690 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS 19691 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEERROR 19692 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEERROR_ACTIVE 19693 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19694 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19695 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19696 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19697 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19698 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19699 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19700 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19701 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19702 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19703 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19704 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19705 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19706 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19707 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19708 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19709 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19710 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19711 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEPAUSEDBYPARENT 19712 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19713 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19714 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19715 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19716 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEDISABLEDBYMETHOD 19717 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19718 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19719 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19720 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19721 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSTYPE_LIVEVALUES 19722 /* Object */ +#define UA_NS0ID_DIAGNOSTICSLEVEL 19723 /* DataType */ +#define UA_NS0ID_DIAGNOSTICSLEVEL_ENUMSTRINGS 19724 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERTYPE 19725 /* VariableType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERTYPE_ACTIVE 19726 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERTYPE_CLASSIFICATION 19727 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERTYPE_DIAGNOSTICSLEVEL 19728 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERTYPE_TIMEFIRSTCHANGE 19729 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERCLASSIFICATION 19730 /* DataType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCOUNTERCLASSIFICATION_ENUMSTRINGS 19731 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE 19732 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_DIAGNOSTICSLEVEL 19733 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALINFORMATION 19734 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALINFORMATION_ACTIVE 19735 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALINFORMATION_CLASSIFICATION 19736 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19737 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19738 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALERROR 19739 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALERROR_ACTIVE 19740 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALERROR_CLASSIFICATION 19741 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19742 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_TOTALERROR_TIMEFIRSTCHANGE 19743 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_RESET 19744 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_SUBERROR 19745 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS 19746 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEERROR 19747 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEERROR_ACTIVE 19748 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19749 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19750 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19751 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19752 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19753 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19754 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19755 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19756 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19757 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19758 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19759 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19760 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19761 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19762 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19763 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19764 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19765 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19766 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEPAUSEDBYPARENT 19767 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19768 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19769 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19770 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19771 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEDISABLEDBYMETHOD 19772 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19773 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19774 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19775 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19776 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES 19777 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_CONFIGUREDDATASETWRITERS 19778 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 19779 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_CONFIGUREDDATASETREADERS 19780 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 19781 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_OPERATIONALDATASETWRITERS 19782 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 19783 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_OPERATIONALDATASETREADERS 19784 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSROOTTYPE_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 19785 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE 19786 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_DIAGNOSTICSLEVEL 19787 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALINFORMATION 19788 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALINFORMATION_ACTIVE 19789 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALINFORMATION_CLASSIFICATION 19790 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19791 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19792 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALERROR 19793 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALERROR_ACTIVE 19794 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALERROR_CLASSIFICATION 19795 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19796 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_TOTALERROR_TIMEFIRSTCHANGE 19797 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_RESET 19798 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_SUBERROR 19799 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS 19800 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEERROR 19801 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEERROR_ACTIVE 19802 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19803 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19804 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19805 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19806 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19807 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19808 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19809 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19810 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19811 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19812 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19813 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19814 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19815 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19816 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19817 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19818 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19819 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19820 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEPAUSEDBYPARENT 19821 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19822 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19823 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19824 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19825 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEDISABLEDBYMETHOD 19826 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19827 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19828 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19829 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19830 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_LIVEVALUES 19831 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_LIVEVALUES_RESOLVEDADDRESS 19832 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSCONNECTIONTYPE_LIVEVALUES_RESOLVEDADDRESS_DIAGNOSTICSLEVEL 19833 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE 19834 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_DIAGNOSTICSLEVEL 19835 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALINFORMATION 19836 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALINFORMATION_ACTIVE 19837 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALINFORMATION_CLASSIFICATION 19838 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19839 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19840 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALERROR 19841 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALERROR_ACTIVE 19842 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALERROR_CLASSIFICATION 19843 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19844 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_TOTALERROR_TIMEFIRSTCHANGE 19845 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_RESET 19846 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_SUBERROR 19847 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS 19848 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEERROR 19849 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEERROR_ACTIVE 19850 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19851 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19852 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19853 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19854 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19855 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19856 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19857 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19858 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19859 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19860 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19861 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19862 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19863 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19864 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19865 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19866 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19867 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19868 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT 19869 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19870 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19871 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19872 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19873 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD 19874 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19875 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19876 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19877 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19878 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES 19879 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_SENTNETWORKMESSAGES 19880 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_SENTNETWORKMESSAGES_ACTIVE 19881 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_SENTNETWORKMESSAGES_CLASSIFICATION 19882 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_SENTNETWORKMESSAGES_DIAGNOSTICSLEVEL 19883 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_SENTNETWORKMESSAGES_TIMEFIRSTCHANGE 19884 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_FAILEDTRANSMISSIONS 19885 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_FAILEDTRANSMISSIONS_ACTIVE 19886 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_FAILEDTRANSMISSIONS_CLASSIFICATION 19887 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_FAILEDTRANSMISSIONS_DIAGNOSTICSLEVEL 19888 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_FAILEDTRANSMISSIONS_TIMEFIRSTCHANGE 19889 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_ENCRYPTIONERRORS 19890 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_ENCRYPTIONERRORS_ACTIVE 19891 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_ENCRYPTIONERRORS_CLASSIFICATION 19892 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_ENCRYPTIONERRORS_DIAGNOSTICSLEVEL 19893 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_COUNTERS_ENCRYPTIONERRORS_TIMEFIRSTCHANGE 19894 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_CONFIGUREDDATASETWRITERS 19895 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_CONFIGUREDDATASETWRITERS_DIAGNOSTICSLEVEL 19896 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_OPERATIONALDATASETWRITERS 19897 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_OPERATIONALDATASETWRITERS_DIAGNOSTICSLEVEL 19898 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_SECURITYTOKENID 19899 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 19900 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_TIMETONEXTTOKENID 19901 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSWRITERGROUPTYPE_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 19902 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE 19903 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_DIAGNOSTICSLEVEL 19904 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALINFORMATION 19905 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALINFORMATION_ACTIVE 19906 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALINFORMATION_CLASSIFICATION 19907 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19908 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19909 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALERROR 19910 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALERROR_ACTIVE 19911 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALERROR_CLASSIFICATION 19912 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19913 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_TOTALERROR_TIMEFIRSTCHANGE 19914 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_RESET 19915 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_SUBERROR 19916 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS 19917 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEERROR 19918 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEERROR_ACTIVE 19919 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19920 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19921 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19922 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19923 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19924 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19925 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19926 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19927 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19928 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19929 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19930 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19931 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19932 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19933 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19934 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 19935 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 19936 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 19937 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT 19938 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 19939 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 19940 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 19941 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 19942 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD 19943 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 19944 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 19945 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 19946 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 19947 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_LIVEVALUES 19948 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDNETWORKMESSAGES 19949 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDNETWORKMESSAGES_ACTIVE 19950 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDNETWORKMESSAGES_CLASSIFICATION 19951 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDNETWORKMESSAGES_DIAGNOSTICSLEVEL 19952 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDNETWORKMESSAGES_TIMEFIRSTCHANGE 19953 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES 19954 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_ACTIVE 19955 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_CLASSIFICATION 19956 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_DIAGNOSTICSLEVEL 19957 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_TIMEFIRSTCHANGE 19958 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_DECRYPTIONERRORS 19959 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_DECRYPTIONERRORS_ACTIVE 19960 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 19961 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 19962 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 19963 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_LIVEVALUES_CONFIGUREDDATASETREADERS 19964 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 19965 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_LIVEVALUES_OPERATIONALDATASETREADERS 19966 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSREADERGROUPTYPE_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 19967 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE 19968 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_DIAGNOSTICSLEVEL 19969 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALINFORMATION 19970 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALINFORMATION_ACTIVE 19971 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALINFORMATION_CLASSIFICATION 19972 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 19973 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 19974 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALERROR 19975 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALERROR_ACTIVE 19976 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALERROR_CLASSIFICATION 19977 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALERROR_DIAGNOSTICSLEVEL 19978 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_TOTALERROR_TIMEFIRSTCHANGE 19979 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_RESET 19980 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_SUBERROR 19981 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS 19982 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEERROR 19983 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEERROR_ACTIVE 19984 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEERROR_CLASSIFICATION 19985 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 19986 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 19987 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 19988 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 19989 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 19990 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 19991 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 19992 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYPARENT 19993 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 19994 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 19995 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 19996 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 19997 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALFROMERROR 19998 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 19999 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 20000 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 20001 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 20002 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEPAUSEDBYPARENT 20003 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 20004 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 20005 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 20006 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 20007 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEDISABLEDBYMETHOD 20008 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 20009 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 20010 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 20011 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 20012 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES 20013 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_FAILEDDATASETMESSAGES 20014 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 20015 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 20016 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 20017 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 20018 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MESSAGESEQUENCENUMBER 20019 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 20020 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_STATUSCODE 20021 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 20022 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MAJORVERSION 20023 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 20024 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MINORVERSION 20025 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETWRITERTYPE_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 20026 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE 20027 /* ObjectType */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_DIAGNOSTICSLEVEL 20028 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALINFORMATION 20029 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALINFORMATION_ACTIVE 20030 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALINFORMATION_CLASSIFICATION 20031 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALINFORMATION_DIAGNOSTICSLEVEL 20032 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALINFORMATION_TIMEFIRSTCHANGE 20033 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALERROR 20034 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALERROR_ACTIVE 20035 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALERROR_CLASSIFICATION 20036 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALERROR_DIAGNOSTICSLEVEL 20037 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_TOTALERROR_TIMEFIRSTCHANGE 20038 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_RESET 20039 /* Method */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_SUBERROR 20040 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS 20041 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEERROR 20042 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEERROR_ACTIVE 20043 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEERROR_CLASSIFICATION 20044 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 20045 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 20046 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD 20047 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 20048 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 20049 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 20050 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 20051 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYPARENT 20052 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 20053 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 20054 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 20055 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 20056 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALFROMERROR 20057 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 20058 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 20059 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 20060 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 20061 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEPAUSEDBYPARENT 20062 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 20063 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 20064 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 20065 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 20066 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEDISABLEDBYMETHOD 20067 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 20068 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 20069 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 20070 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 20071 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES 20072 /* Object */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_FAILEDDATASETMESSAGES 20073 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_FAILEDDATASETMESSAGES_ACTIVE 20074 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_FAILEDDATASETMESSAGES_CLASSIFICATION 20075 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_FAILEDDATASETMESSAGES_DIAGNOSTICSLEVEL 20076 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_FAILEDDATASETMESSAGES_TIMEFIRSTCHANGE 20077 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_DECRYPTIONERRORS 20078 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_DECRYPTIONERRORS_ACTIVE 20079 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 20080 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 20081 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 20082 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MESSAGESEQUENCENUMBER 20083 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MESSAGESEQUENCENUMBER_DIAGNOSTICSLEVEL 20084 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_STATUSCODE 20085 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_STATUSCODE_DIAGNOSTICSLEVEL 20086 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MAJORVERSION 20087 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MAJORVERSION_DIAGNOSTICSLEVEL 20088 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MINORVERSION 20089 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_MINORVERSION_DIAGNOSTICSLEVEL 20090 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_SECURITYTOKENID 20091 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 20092 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_TIMETONEXTTOKENID 20093 /* Variable */ +#define UA_NS0ID_PUBSUBDIAGNOSTICSDATASETREADERTYPE_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 20094 /* Variable */ +#define UA_NS0ID_DATASETORDERINGTYPE 20408 /* DataType */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID 20409 /* Variable */ +#define UA_NS0ID_VERSIONTIME 20998 /* DataType */ +#define UA_NS0ID_SESSIONLESSINVOKERESPONSETYPE 20999 /* DataType */ +#define UA_NS0ID_SESSIONLESSINVOKERESPONSETYPE_ENCODING_DEFAULTXML 21000 /* Object */ +#define UA_NS0ID_SESSIONLESSINVOKERESPONSETYPE_ENCODING_DEFAULTBINARY 21001 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_FIELDTARGETDATATYPE 21002 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_SECURITYTOKENID_DIAGNOSTICSLEVEL 21003 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID 21004 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_DIAGNOSTICS_LIVEVALUES_TIMETONEXTTOKENID_DIAGNOSTICSLEVEL 21005 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_SUBSCRIBEDDATASET 21006 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATETARGETVARIABLES 21009 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATETARGETVARIABLES_INPUTARGUMENTS 21010 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATETARGETVARIABLES_OUTPUTARGUMENTS 21011 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATEDATASETMIRROR 21012 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATEDATASETMIRROR_INPUTARGUMENTS 21013 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DATASETREADERNAME_PLACEHOLDER_CREATEDATASETMIRROR_OUTPUTARGUMENTS 21014 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS 21015 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_DIAGNOSTICSLEVEL 21016 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION 21017 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_ACTIVE 21018 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_CLASSIFICATION 21019 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_DIAGNOSTICSLEVEL 21020 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALINFORMATION_TIMEFIRSTCHANGE 21021 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALERROR 21022 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALERROR_ACTIVE 21023 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALERROR_CLASSIFICATION 21024 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALERROR_DIAGNOSTICSLEVEL 21025 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_TOTALERROR_TIMEFIRSTCHANGE 21026 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_RESET 21027 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_SUBERROR 21028 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS 21029 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR 21030 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_ACTIVE 21031 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_CLASSIFICATION 21032 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_DIAGNOSTICSLEVEL 21033 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEERROR_TIMEFIRSTCHANGE 21034 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD 21035 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_ACTIVE 21036 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_CLASSIFICATION 21037 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_DIAGNOSTICSLEVEL 21038 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYMETHOD_TIMEFIRSTCHANGE 21039 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT 21040 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_ACTIVE 21041 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_CLASSIFICATION 21042 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_DIAGNOSTICSLEVEL 21043 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALBYPARENT_TIMEFIRSTCHANGE 21044 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR 21045 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_ACTIVE 21046 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_CLASSIFICATION 21047 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_DIAGNOSTICSLEVEL 21048 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEOPERATIONALFROMERROR_TIMEFIRSTCHANGE 21049 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT 21050 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_ACTIVE 21051 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_CLASSIFICATION 21052 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_DIAGNOSTICSLEVEL 21053 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEPAUSEDBYPARENT_TIMEFIRSTCHANGE 21054 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD 21055 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_ACTIVE 21056 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_CLASSIFICATION 21057 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_DIAGNOSTICSLEVEL 21058 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_STATEDISABLEDBYMETHOD_TIMEFIRSTCHANGE 21059 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_LIVEVALUES 21060 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES 21061 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_ACTIVE 21062 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_CLASSIFICATION 21063 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_DIAGNOSTICSLEVEL 21064 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDNETWORKMESSAGES_TIMEFIRSTCHANGE 21065 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES 21066 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_ACTIVE 21067 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_CLASSIFICATION 21068 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_DIAGNOSTICSLEVEL 21069 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_RECEIVEDINVALIDNETWORKMESSAGES_TIMEFIRSTCHANGE 21070 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS 21071 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_ACTIVE 21072 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_CLASSIFICATION 21073 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_DIAGNOSTICSLEVEL 21074 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_COUNTERS_DECRYPTIONERRORS_TIMEFIRSTCHANGE 21075 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS 21076 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_CONFIGUREDDATASETREADERS_DIAGNOSTICSLEVEL 21077 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS 21078 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_DIAGNOSTICS_LIVEVALUES_OPERATIONALDATASETREADERS_DIAGNOSTICSLEVEL 21079 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_TRANSPORTSETTINGS 21080 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_MESSAGESETTINGS 21081 /* Object */ +#define UA_NS0ID_READERGROUPTYPE_ADDDATASETREADER 21082 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_ADDDATASETREADER_INPUTARGUMENTS 21083 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_ADDDATASETREADER_OUTPUTARGUMENTS 21084 /* Variable */ +#define UA_NS0ID_READERGROUPTYPE_REMOVEDATASETREADER 21085 /* Method */ +#define UA_NS0ID_READERGROUPTYPE_REMOVEDATASETREADER_INPUTARGUMENTS 21086 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDREADERMETHODTYPE 21087 /* Method */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDREADERMETHODTYPE_INPUTARGUMENTS 21088 /* Variable */ +#define UA_NS0ID_PUBSUBGROUPTYPEADDREADERMETHODTYPE_OUTPUTARGUMENTS 21089 /* Variable */ +#define UA_NS0ID_READERGROUPTRANSPORTTYPE 21090 /* ObjectType */ +#define UA_NS0ID_READERGROUPMESSAGETYPE 21091 /* ObjectType */ +#define UA_NS0ID_DATASETWRITERTYPE_DATASETWRITERID 21092 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_DATASETFIELDCONTENTMASK 21093 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_KEYFRAMECOUNT 21094 /* Variable */ +#define UA_NS0ID_DATASETWRITERTYPE_MESSAGESETTINGS 21095 /* Object */ +#define UA_NS0ID_DATASETWRITERMESSAGETYPE 21096 /* ObjectType */ +#define UA_NS0ID_DATASETREADERTYPE_PUBLISHERID 21097 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_WRITERGROUPID 21098 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DATASETWRITERID 21099 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DATASETMETADATA 21100 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_DATASETFIELDCONTENTMASK 21101 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_MESSAGERECEIVETIMEOUT 21102 /* Variable */ +#define UA_NS0ID_DATASETREADERTYPE_MESSAGESETTINGS 21103 /* Object */ +#define UA_NS0ID_DATASETREADERMESSAGETYPE 21104 /* ObjectType */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE 21105 /* ObjectType */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE_GROUPVERSION 21106 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE_DATASETORDERING 21107 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE_NETWORKMESSAGECONTENTMASK 21108 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE_SAMPLINGOFFSET 21109 /* Variable */ +#define UA_NS0ID_UADPWRITERGROUPMESSAGETYPE_PUBLISHINGOFFSET 21110 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGETYPE 21111 /* ObjectType */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGETYPE_DATASETMESSAGECONTENTMASK 21112 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGETYPE_CONFIGUREDSIZE 21113 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGETYPE_NETWORKMESSAGENUMBER 21114 /* Variable */ +#define UA_NS0ID_UADPDATASETWRITERMESSAGETYPE_DATASETOFFSET 21115 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE 21116 /* ObjectType */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_GROUPVERSION 21117 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_NETWORKMESSAGENUMBER 21119 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_DATASETCLASSID 21120 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_NETWORKMESSAGECONTENTMASK 21121 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_DATASETMESSAGECONTENTMASK 21122 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_PUBLISHINGINTERVAL 21123 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_PROCESSINGOFFSET 21124 /* Variable */ +#define UA_NS0ID_UADPDATASETREADERMESSAGETYPE_RECEIVEOFFSET 21125 /* Variable */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGETYPE 21126 /* ObjectType */ +#define UA_NS0ID_JSONWRITERGROUPMESSAGETYPE_NETWORKMESSAGECONTENTMASK 21127 /* Variable */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGETYPE 21128 /* ObjectType */ +#define UA_NS0ID_JSONDATASETWRITERMESSAGETYPE_DATASETMESSAGECONTENTMASK 21129 /* Variable */ +#define UA_NS0ID_JSONDATASETREADERMESSAGETYPE 21130 /* ObjectType */ +#define UA_NS0ID_JSONDATASETREADERMESSAGETYPE_NETWORKMESSAGECONTENTMASK 21131 /* Variable */ +#define UA_NS0ID_JSONDATASETREADERMESSAGETYPE_DATASETMESSAGECONTENTMASK 21132 /* Variable */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTTYPE 21133 /* ObjectType */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTTYPE_MESSAGEREPEATCOUNT 21134 /* Variable */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTTYPE_MESSAGEREPEATDELAY 21135 /* Variable */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTTYPE 21136 /* ObjectType */ +#define UA_NS0ID_BROKERWRITERGROUPTRANSPORTTYPE_QUEUENAME 21137 /* Variable */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE 21138 /* ObjectType */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_QUEUENAME 21139 /* Variable */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_METADATAQUEUENAME 21140 /* Variable */ +#define UA_NS0ID_BROKERDATASETWRITERTRANSPORTTYPE_METADATAUPDATETIME 21141 /* Variable */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE 21142 /* ObjectType */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE_QUEUENAME 21143 /* Variable */ +#define UA_NS0ID_BROKERDATASETREADERTRANSPORTTYPE_METADATAQUEUENAME 21144 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSTYPE 21145 /* ObjectType */ +#define UA_NS0ID_NETWORKADDRESSTYPE_NETWORKINTERFACE 21146 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE 21147 /* ObjectType */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE_NETWORKINTERFACE 21148 /* Variable */ +#define UA_NS0ID_NETWORKADDRESSURLTYPE_URL 21149 /* Variable */ +#define UA_NS0ID_WRITERGROUPDATATYPE_ENCODING_DEFAULTBINARY 21150 /* Object */ +#define UA_NS0ID_NETWORKADDRESSDATATYPE_ENCODING_DEFAULTBINARY 21151 /* Object */ +#define UA_NS0ID_NETWORKADDRESSURLDATATYPE_ENCODING_DEFAULTBINARY 21152 /* Object */ +#define UA_NS0ID_READERGROUPDATATYPE_ENCODING_DEFAULTBINARY 21153 /* Object */ +#define UA_NS0ID_PUBSUBCONFIGURATIONDATATYPE_ENCODING_DEFAULTBINARY 21154 /* Object */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTBINARY 21155 /* Object */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPDATATYPE 21156 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPDATATYPE_DATATYPEVERSION 21157 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_WRITERGROUPDATATYPE_DICTIONARYFRAGMENT 21158 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSDATATYPE 21159 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSDATATYPE_DATATYPEVERSION 21160 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSDATATYPE_DICTIONARYFRAGMENT 21161 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSURLDATATYPE 21162 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSURLDATATYPE_DATATYPEVERSION 21163 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_NETWORKADDRESSURLDATATYPE_DICTIONARYFRAGMENT 21164 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPDATATYPE 21165 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPDATATYPE_DATATYPEVERSION 21166 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_READERGROUPDATATYPE_DICTIONARYFRAGMENT 21167 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONFIGURATIONDATATYPE 21168 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONFIGURATIONDATATYPE_DATATYPEVERSION 21169 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_PUBSUBCONFIGURATIONDATATYPE_DICTIONARYFRAGMENT 21170 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE 21171 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 21172 /* Variable */ +#define UA_NS0ID_OPCUA_BINARYSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 21173 /* Variable */ +#define UA_NS0ID_WRITERGROUPDATATYPE_ENCODING_DEFAULTXML 21174 /* Object */ +#define UA_NS0ID_NETWORKADDRESSDATATYPE_ENCODING_DEFAULTXML 21175 /* Object */ +#define UA_NS0ID_NETWORKADDRESSURLDATATYPE_ENCODING_DEFAULTXML 21176 /* Object */ +#define UA_NS0ID_READERGROUPDATATYPE_ENCODING_DEFAULTXML 21177 /* Object */ +#define UA_NS0ID_PUBSUBCONFIGURATIONDATATYPE_ENCODING_DEFAULTXML 21178 /* Object */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTXML 21179 /* Object */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPDATATYPE 21180 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPDATATYPE_DATATYPEVERSION 21181 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_WRITERGROUPDATATYPE_DICTIONARYFRAGMENT 21182 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSDATATYPE 21183 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSDATATYPE_DATATYPEVERSION 21184 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSDATATYPE_DICTIONARYFRAGMENT 21185 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSURLDATATYPE 21186 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSURLDATATYPE_DATATYPEVERSION 21187 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_NETWORKADDRESSURLDATATYPE_DICTIONARYFRAGMENT 21188 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPDATATYPE 21189 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPDATATYPE_DATATYPEVERSION 21190 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_READERGROUPDATATYPE_DICTIONARYFRAGMENT 21191 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONFIGURATIONDATATYPE 21192 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONFIGURATIONDATATYPE_DATATYPEVERSION 21193 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_PUBSUBCONFIGURATIONDATATYPE_DICTIONARYFRAGMENT 21194 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE 21195 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_DATATYPEVERSION 21196 /* Variable */ +#define UA_NS0ID_OPCUA_XMLSCHEMA_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_DICTIONARYFRAGMENT 21197 /* Variable */ +#define UA_NS0ID_WRITERGROUPDATATYPE_ENCODING_DEFAULTJSON 21198 /* Object */ +#define UA_NS0ID_NETWORKADDRESSDATATYPE_ENCODING_DEFAULTJSON 21199 /* Object */ +#define UA_NS0ID_NETWORKADDRESSURLDATATYPE_ENCODING_DEFAULTJSON 21200 /* Object */ +#define UA_NS0ID_READERGROUPDATATYPE_ENCODING_DEFAULTJSON 21201 /* Object */ +#define UA_NS0ID_PUBSUBCONFIGURATIONDATATYPE_ENCODING_DEFAULTJSON 21202 /* Object */ +#define UA_NS0ID_DATAGRAMWRITERGROUPTRANSPORTDATATYPE_ENCODING_DEFAULTJSON 21203 /* Object */ +#endif /* UA_NODEIDS_NS0_H_ */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/common.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2016-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2016 (c) Sten Grüner + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Florian Palm + * Copyright 2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + +_UA_BEGIN_DECLS + +/** + * Common Definitions + * ================== + * + * Common definitions for Client, Server and PubSub. + * + * .. _attribute-id: + * + * Attribute Id + * ------------ + * Every node in an OPC UA information model contains attributes depending on + * the node type. Possible attributes are as follows: */ + +typedef enum { + UA_ATTRIBUTEID_NODEID = 1, + UA_ATTRIBUTEID_NODECLASS = 2, + UA_ATTRIBUTEID_BROWSENAME = 3, + UA_ATTRIBUTEID_DISPLAYNAME = 4, + UA_ATTRIBUTEID_DESCRIPTION = 5, + UA_ATTRIBUTEID_WRITEMASK = 6, + UA_ATTRIBUTEID_USERWRITEMASK = 7, + UA_ATTRIBUTEID_ISABSTRACT = 8, + UA_ATTRIBUTEID_SYMMETRIC = 9, + UA_ATTRIBUTEID_INVERSENAME = 10, + UA_ATTRIBUTEID_CONTAINSNOLOOPS = 11, + UA_ATTRIBUTEID_EVENTNOTIFIER = 12, + UA_ATTRIBUTEID_VALUE = 13, + UA_ATTRIBUTEID_DATATYPE = 14, + UA_ATTRIBUTEID_VALUERANK = 15, + UA_ATTRIBUTEID_ARRAYDIMENSIONS = 16, + UA_ATTRIBUTEID_ACCESSLEVEL = 17, + UA_ATTRIBUTEID_USERACCESSLEVEL = 18, + UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL = 19, + UA_ATTRIBUTEID_HISTORIZING = 20, + UA_ATTRIBUTEID_EXECUTABLE = 21, + UA_ATTRIBUTEID_USEREXECUTABLE = 22, + UA_ATTRIBUTEID_DATATYPEDEFINITION = 23, + UA_ATTRIBUTEID_ROLEPERMISSIONS = 24, + UA_ATTRIBUTEID_USERROLEPERMISSIONS = 25, + UA_ATTRIBUTEID_ACCESSRESTRICTIONS = 26, + UA_ATTRIBUTEID_ACCESSLEVELEX = 27 +} UA_AttributeId; + +/** + * Access Level Masks + * ------------------ + * The access level to a node is given by the following constants that are ANDed + * with the overall access level. */ + +#define UA_ACCESSLEVELMASK_READ (0x01u << 0u) +#define UA_ACCESSLEVELMASK_WRITE (0x01u << 1u) +#define UA_ACCESSLEVELMASK_HISTORYREAD (0x01u << 2u) +#define UA_ACCESSLEVELMASK_HISTORYWRITE (0x01u << 3u) +#define UA_ACCESSLEVELMASK_SEMANTICCHANGE (0x01u << 4u) +#define UA_ACCESSLEVELMASK_STATUSWRITE (0x01u << 5u) +#define UA_ACCESSLEVELMASK_TIMESTAMPWRITE (0x01u << 6u) + +/** + * Write Masks + * ----------- + * The write mask and user write mask is given by the following constants that + * are ANDed for the overall write mask. Part 3: 5.2.7 Table 2 */ + +#define UA_WRITEMASK_ACCESSLEVEL (0x01u << 0u) +#define UA_WRITEMASK_ARRRAYDIMENSIONS (0x01u << 1u) +#define UA_WRITEMASK_BROWSENAME (0x01u << 2u) +#define UA_WRITEMASK_CONTAINSNOLOOPS (0x01u << 3u) +#define UA_WRITEMASK_DATATYPE (0x01u << 4u) +#define UA_WRITEMASK_DESCRIPTION (0x01u << 5u) +#define UA_WRITEMASK_DISPLAYNAME (0x01u << 6u) +#define UA_WRITEMASK_EVENTNOTIFIER (0x01u << 7u) +#define UA_WRITEMASK_EXECUTABLE (0x01u << 8u) +#define UA_WRITEMASK_HISTORIZING (0x01u << 9u) +#define UA_WRITEMASK_INVERSENAME (0x01u << 10u) +#define UA_WRITEMASK_ISABSTRACT (0x01u << 11u) +#define UA_WRITEMASK_MINIMUMSAMPLINGINTERVAL (0x01u << 12u) +#define UA_WRITEMASK_NODECLASS (0x01u << 13u) +#define UA_WRITEMASK_NODEID (0x01u << 14u) +#define UA_WRITEMASK_SYMMETRIC (0x01u << 15u) +#define UA_WRITEMASK_USERACCESSLEVEL (0x01u << 16u) +#define UA_WRITEMASK_USEREXECUTABLE (0x01u << 17u) +#define UA_WRITEMASK_USERWRITEMASK (0x01u << 18u) +#define UA_WRITEMASK_VALUERANK (0x01u << 19u) +#define UA_WRITEMASK_WRITEMASK (0x01u << 20u) +#define UA_WRITEMASK_VALUEFORVARIABLETYPE (0x01u << 21u) + +/** + * ValueRanks + * ---------- + * The following are the most common ValueRanks used for Variables, + * VariableTypes and method arguments. ValueRanks higher than 3 are valid as + * well (but less common). */ + +#define UA_VALUERANK_SCALAR_OR_ONE_DIMENSION -3 +#define UA_VALUERANK_ANY -2 +#define UA_VALUERANK_SCALAR -1 +#define UA_VALUERANK_ONE_OR_MORE_DIMENSIONS 0 +#define UA_VALUERANK_ONE_DIMENSION 1 +#define UA_VALUERANK_TWO_DIMENSIONS 2 +#define UA_VALUERANK_THREE_DIMENSIONS 3 + +/** + * Rule Handling + * ------------- + * + * The RuleHanding settings define how error cases that result from rules in the + * OPC UA specification shall be handled. The rule handling can be softened, + * e.g. to workaround misbehaving implementations or to mitigate the impact of + * additional rules that are introduced in later versions of the OPC UA + * specification. */ +typedef enum { + UA_RULEHANDLING_DEFAULT = 0, + UA_RULEHANDLING_ABORT, /* Abort the operation and return an error code */ + UA_RULEHANDLING_WARN, /* Print a message in the logs and continue */ + UA_RULEHANDLING_ACCEPT, /* Continue and disregard the broken rule */ +} UA_RuleHandling; + +/** + * Order + * ----- + * + * The Order enum is used to establish an absolute ordering between elements. + */ + +typedef enum { + UA_ORDER_LESS = -1, + UA_ORDER_EQ = 0, + UA_ORDER_MORE = 1 +} UA_Order; + +/** + * Connection State + * ---------------- */ + +typedef enum { + UA_SECURECHANNELSTATE_FRESH = 0, + UA_SECURECHANNELSTATE_HEL_SENT, + UA_SECURECHANNELSTATE_HEL_RECEIVED, + UA_SECURECHANNELSTATE_ACK_SENT, + UA_SECURECHANNELSTATE_ACK_RECEIVED, + UA_SECURECHANNELSTATE_OPN_SENT, + UA_SECURECHANNELSTATE_OPEN, + UA_SECURECHANNELSTATE_CLOSING, + UA_SECURECHANNELSTATE_CLOSED +} UA_SecureChannelState; + +typedef enum { + UA_SESSIONSTATE_CLOSED, + UA_SESSIONSTATE_CREATE_REQUESTED, + UA_SESSIONSTATE_CREATED, + UA_SESSIONSTATE_ACTIVATE_REQUESTED, + UA_SESSIONSTATE_ACTIVATED, + UA_SESSIONSTATE_CLOSING +} UA_SessionState; + +/** + * Statistic counters + * ------------------ + * + * The stack manage statistic counter for the following layers: + * + * - Network + * - Secure channel + * - Session + * + * The session layer counters are matching the counters of the + * ServerDiagnosticsSummaryDataType that are defined in the OPC UA Part 5 + * specification. Counter of the other layers are not specified by OPC UA but + * are harmonized with the session layer counters if possible. */ + +typedef struct { + size_t currentConnectionCount; + size_t cumulatedConnectionCount; + size_t rejectedConnectionCount; + size_t connectionTimeoutCount; + size_t connectionAbortCount; +} UA_NetworkStatistics; + +typedef struct { + size_t currentChannelCount; + size_t cumulatedChannelCount; + size_t rejectedChannelCount; + size_t channelTimeoutCount; /* only used by servers */ + size_t channelAbortCount; + size_t channelPurgeCount; /* only used by servers */ +} UA_SecureChannelStatistics; + +typedef struct { + size_t currentSessionCount; + size_t cumulatedSessionCount; + size_t securityRejectedSessionCount; /* only used by servers */ + size_t rejectedSessionCount; + size_t sessionTimeoutCount; /* only used by servers */ + size_t sessionAbortCount; /* only used by servers */ +} UA_SessionStatistics; + +/** + * .. include:: util.rst */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/types.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014 (c) Leon Urbas + * Copyright 2014, 2016-2017 (c) Florian Palm + * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015 (c) Nick Goossens + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Thomas Stalder, Blue Time Concept SA + */ + + + +_UA_BEGIN_DECLS + +#define UA_BUILTIN_TYPES_COUNT 25U + +/** + * .. _types: + * + * Data Types + * ========== + * + * The OPC UA protocol defines 25 builtin data types and three ways of combining + * them into higher-order types: arrays, structures and unions. In open62541, + * only the builtin data types are defined manually. All other data types are + * generated from standard XML definitions. Their exact definitions can be + * looked up at https://opcfoundation.org/UA/schemas/Opc.Ua.Types.bsd. + * + * For users that are new to open62541, take a look at the :ref:`tutorial for + * working with data types<types-tutorial>` before diving into the + * implementation details. + * + * Builtin Types + * ------------- + * + * Boolean + * ^^^^^^^ + * A two-state logical value (true or false). */ +typedef bool UA_Boolean; +#define UA_TRUE true UA_INTERNAL_DEPRECATED +#define UA_FALSE false UA_INTERNAL_DEPRECATED + +/** + * SByte + * ^^^^^ + * An integer value between -128 and 127. */ +typedef int8_t UA_SByte; +#define UA_SBYTE_MIN (-128) +#define UA_SBYTE_MAX 127 + +/** + * Byte + * ^^^^ + * An integer value between 0 and 255. */ +typedef uint8_t UA_Byte; +#define UA_BYTE_MIN 0 +#define UA_BYTE_MAX 255 + +/** + * Int16 + * ^^^^^ + * An integer value between -32 768 and 32 767. */ +typedef int16_t UA_Int16; +#define UA_INT16_MIN (-32768) +#define UA_INT16_MAX 32767 + +/** + * UInt16 + * ^^^^^^ + * An integer value between 0 and 65 535. */ +typedef uint16_t UA_UInt16; +#define UA_UINT16_MIN 0 +#define UA_UINT16_MAX 65535 + +/** + * Int32 + * ^^^^^ + * An integer value between -2 147 483 648 and 2 147 483 647. */ +typedef int32_t UA_Int32; +#define UA_INT32_MIN (-2147483648) +#define UA_INT32_MAX 2147483647 + +/** + * UInt32 + * ^^^^^^ + * An integer value between 0 and 4 294 967 295. */ +typedef uint32_t UA_UInt32; +#define UA_UINT32_MIN 0 +#define UA_UINT32_MAX 4294967295 + +/** + * Int64 + * ^^^^^ + * An integer value between -9 223 372 036 854 775 808 and + * 9 223 372 036 854 775 807. */ +typedef int64_t UA_Int64; +#define UA_INT64_MAX (int64_t)9223372036854775807LL +#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL) + +/** + * UInt64 + * ^^^^^^ + * An integer value between 0 and 18 446 744 073 709 551 615. */ +typedef uint64_t UA_UInt64; +#define UA_UINT64_MIN (uint64_t)0 +#define UA_UINT64_MAX (uint64_t)18446744073709551615ULL + +/** + * Float + * ^^^^^ + * An IEEE single precision (32 bit) floating point value. */ +typedef float UA_Float; + +/** + * Double + * ^^^^^^ + * An IEEE double precision (64 bit) floating point value. */ +typedef double UA_Double; + +/** + * .. _statuscode: + * + * StatusCode + * ^^^^^^^^^^ + * A numeric identifier for a error or condition that is associated with a value + * or an operation. See the section :ref:`statuscodes` for the meaning of a + * specific code. */ +typedef uint32_t UA_StatusCode; + +/* Returns the human-readable name of the StatusCode. If no matching StatusCode + * is found, a default string for "Unknown" is returned. This feature might be + * disabled to create a smaller binary with the + * UA_ENABLE_STATUSCODE_DESCRIPTIONS build-flag. Then the function returns an + * empty string for every StatusCode. */ +UA_EXPORT const char * +UA_StatusCode_name(UA_StatusCode code); + +/** + * String + * ^^^^^^ + * A sequence of Unicode characters. Strings are just an array of UA_Byte. */ +typedef struct { + size_t length; /* The length of the string */ + UA_Byte *data; /* The content (not null-terminated) */ +} UA_String; + +/* Copies the content on the heap. Returns a null-string when alloc fails */ +UA_String UA_EXPORT +UA_String_fromChars(const char *src) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +UA_Boolean UA_EXPORT +UA_String_equal(const UA_String *s1, const UA_String *s2); + +UA_EXPORT extern const UA_String UA_STRING_NULL; + +/** + * ``UA_STRING`` returns a string pointing to the original char-array. + * ``UA_STRING_ALLOC`` is shorthand for ``UA_String_fromChars`` and makes a copy + * of the char-array. */ +static UA_INLINE UA_String +UA_STRING(char *chars) { + UA_String s; s.length = 0; s.data = NULL; + if(!chars) + return s; + s.length = strlen(chars); s.data = (UA_Byte*)chars; return s; +} + +#define UA_STRING_ALLOC(CHARS) UA_String_fromChars(CHARS) + +/* Define strings at compile time (in ROM) */ +#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS} + +/** + * .. _datetime: + * + * DateTime + * ^^^^^^^^ + * An instance in time. A DateTime value is encoded as a 64-bit signed integer + * which represents the number of 100 nanosecond intervals since January 1, 1601 + * (UTC). + * + * The methods providing an interface to the system clock are architecture- + * specific. Usually, they provide a UTC clock that includes leap seconds. The + * OPC UA standard allows the use of International Atomic Time (TAI) for the + * DateTime instead. But this is still unusual and not implemented for most + * SDKs. Currently (2019), UTC and TAI are 37 seconds apart due to leap + * seconds. */ + +typedef int64_t UA_DateTime; + +/* Multiples to convert durations to DateTime */ +#define UA_DATETIME_USEC 10LL +#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL) +#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL) + +/* The current time in UTC time */ +UA_DateTime UA_EXPORT UA_DateTime_now(void); + +/* Offset between local time and UTC time */ +UA_Int64 UA_EXPORT UA_DateTime_localTimeUtcOffset(void); + +/* CPU clock invariant to system time changes. Use only to measure durations, + * not absolute time. */ +UA_DateTime UA_EXPORT UA_DateTime_nowMonotonic(void); + +/* Represents a Datetime as a structure */ +typedef struct UA_DateTimeStruct { + UA_UInt16 nanoSec; + UA_UInt16 microSec; + UA_UInt16 milliSec; + UA_UInt16 sec; + UA_UInt16 min; + UA_UInt16 hour; + UA_UInt16 day; /* From 1 to 31 */ + UA_UInt16 month; /* From 1 to 12 */ + UA_UInt16 year; +} UA_DateTimeStruct; + +UA_DateTimeStruct UA_EXPORT UA_DateTime_toStruct(UA_DateTime t); +UA_DateTime UA_EXPORT UA_DateTime_fromStruct(UA_DateTimeStruct ts); + +/* The C99 standard (7.23.1) says: "The range and precision of times + * representable in clock_t and time_t are implementation-defined." On most + * systems, time_t is a 4 or 8 byte integer counting seconds since the UTC Unix + * epoch. The following methods are used for conversion. */ + +/* Datetime of 1 Jan 1970 00:00 */ +#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC) + +static UA_INLINE UA_Int64 +UA_DateTime_toUnixTime(UA_DateTime date) { + return (date - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC; +} + +static UA_INLINE UA_DateTime +UA_DateTime_fromUnixTime(UA_Int64 unixDate) { + return (unixDate * UA_DATETIME_SEC) + UA_DATETIME_UNIX_EPOCH; +} + +/** + * Guid + * ^^^^ + * A 16 byte value that can be used as a globally unique identifier. */ +typedef struct { + UA_UInt32 data1; + UA_UInt16 data2; + UA_UInt16 data3; + UA_Byte data4[8]; +} UA_Guid; + +UA_EXPORT extern const UA_Guid UA_GUID_NULL; + +UA_Boolean UA_EXPORT UA_Guid_equal(const UA_Guid *g1, const UA_Guid *g2); + +#ifdef UA_ENABLE_PARSING +/* Parse the Guid format defined in Part 6, 5.1.3. + * Format: C496578A-0DFE-4B8F-870A-745238C6AEAE + * | | | | | | + * 0 8 13 18 23 36 */ +UA_StatusCode UA_EXPORT +UA_Guid_parse(UA_Guid *guid, const UA_String str); + +static UA_INLINE UA_Guid +UA_GUID(const char *chars) { + UA_Guid guid; + UA_Guid_parse(&guid, UA_STRING((char*)(uintptr_t)chars)); + return guid; +} +#endif + +/** + * ByteString + * ^^^^^^^^^^ + * A sequence of octets. */ +typedef UA_String UA_ByteString; + +UA_EXPORT extern const UA_ByteString UA_BYTESTRING_NULL; + +/* Allocates memory of size length for the bytestring. + * The content is not set to zero. */ +UA_StatusCode UA_EXPORT +UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length); + +/* Converts a ByteString to the corresponding + * base64 representation */ +UA_StatusCode UA_EXPORT +UA_ByteString_toBase64(const UA_ByteString *bs, + UA_String *output); + +/* Parse a ByteString from a base64 representation */ +UA_StatusCode UA_EXPORT +UA_ByteString_fromBase64(UA_ByteString *bs, + const UA_String *input); + +static UA_INLINE UA_ByteString +UA_BYTESTRING(char *chars) { + UA_ByteString bs; bs.length = 0; bs.data = NULL; + if(!chars) + return bs; + bs.length = strlen(chars); bs.data = (UA_Byte*)chars; return bs; +} + +static UA_INLINE UA_ByteString +UA_BYTESTRING_ALLOC(const char *chars) { + UA_String str = UA_String_fromChars(chars); UA_ByteString bstr; + bstr.length = str.length; bstr.data = str.data; return bstr; +} + +static UA_INLINE UA_Boolean +UA_ByteString_equal(const UA_ByteString *string1, + const UA_ByteString *string2) { + return UA_String_equal((const UA_String*)string1, + (const UA_String*)string2); +} + +/* Returns a non-cryptographic hash for the String. + * Uses FNV non-cryptographic hash function. See + * https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function */ +UA_UInt32 UA_EXPORT +UA_ByteString_hash(UA_UInt32 initialHashValue, + const UA_Byte *data, size_t size); + +/** + * XmlElement + * ^^^^^^^^^^ + * An XML element. */ +typedef UA_String UA_XmlElement; + +/** + * .. _nodeid: + * + * NodeId + * ^^^^^^ + * An identifier for a node in the address space of an OPC UA Server. */ +enum UA_NodeIdType { + UA_NODEIDTYPE_NUMERIC = 0, /* In the binary encoding, this can also + * become 1 or 2 (two-byte and four-byte + * encoding of small numeric nodeids) */ + UA_NODEIDTYPE_STRING = 3, + UA_NODEIDTYPE_GUID = 4, + UA_NODEIDTYPE_BYTESTRING = 5 +}; + +typedef struct { + UA_UInt16 namespaceIndex; + enum UA_NodeIdType identifierType; + union { + UA_UInt32 numeric; + UA_String string; + UA_Guid guid; + UA_ByteString byteString; + } identifier; +} UA_NodeId; + +UA_EXPORT extern const UA_NodeId UA_NODEID_NULL; + +UA_Boolean UA_EXPORT UA_NodeId_isNull(const UA_NodeId *p); + +/* Print the NodeId in the human-readable format defined in Part 6, + * 5.3.1.10. + * + * Examples: + * UA_NODEID("i=13") + * UA_NODEID("ns=10;i=1") + * UA_NODEID("ns=10;s=Hello:World") + * UA_NODEID("g=09087e75-8e5e-499b-954f-f2a9603db28a") + * UA_NODEID("ns=1;b=b3BlbjYyNTQxIQ==") // base64 + * */ +UA_StatusCode UA_EXPORT +UA_NodeId_print(const UA_NodeId *id, UA_String *output); + +#ifdef UA_ENABLE_PARSING +/* Parse the human-readable NodeId format. Attention! String and + * ByteString NodeIds have their identifier malloc'ed and need to be + * cleaned up. */ +UA_StatusCode UA_EXPORT +UA_NodeId_parse(UA_NodeId *id, const UA_String str); + +static UA_INLINE UA_NodeId +UA_NODEID(const char *chars) { + UA_NodeId id; + UA_NodeId_parse(&id, UA_STRING((char*)(uintptr_t)chars)); + return id; +} +#endif + +/** The following functions are shorthand for creating NodeIds. */ +static UA_INLINE UA_NodeId +UA_NODEID_NUMERIC(UA_UInt16 nsIndex, UA_UInt32 identifier) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_NUMERIC; + id.identifier.numeric = identifier; return id; +} + +static UA_INLINE UA_NodeId +UA_NODEID_STRING(UA_UInt16 nsIndex, char *chars) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_STRING; + id.identifier.string = UA_STRING(chars); return id; +} + +static UA_INLINE UA_NodeId +UA_NODEID_STRING_ALLOC(UA_UInt16 nsIndex, const char *chars) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_STRING; + id.identifier.string = UA_STRING_ALLOC(chars); return id; +} + +static UA_INLINE UA_NodeId +UA_NODEID_GUID(UA_UInt16 nsIndex, UA_Guid guid) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_GUID; + id.identifier.guid = guid; return id; +} + +static UA_INLINE UA_NodeId +UA_NODEID_BYTESTRING(UA_UInt16 nsIndex, char *chars) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_BYTESTRING; + id.identifier.byteString = UA_BYTESTRING(chars); return id; +} + +static UA_INLINE UA_NodeId +UA_NODEID_BYTESTRING_ALLOC(UA_UInt16 nsIndex, const char *chars) { + UA_NodeId id; id.namespaceIndex = nsIndex; + id.identifierType = UA_NODEIDTYPE_BYTESTRING; + id.identifier.byteString = UA_BYTESTRING_ALLOC(chars); return id; +} + +/* Total ordering of NodeId */ +UA_Order UA_EXPORT +UA_NodeId_order(const UA_NodeId *n1, const UA_NodeId *n2); + +/* Check for equality */ +static UA_INLINE UA_Boolean +UA_NodeId_equal(const UA_NodeId *n1, const UA_NodeId *n2) { + return (UA_NodeId_order(n1, n2) == UA_ORDER_EQ); +} + +/* Returns a non-cryptographic hash for NodeId */ +UA_UInt32 UA_EXPORT UA_NodeId_hash(const UA_NodeId *n); + +/** + * ExpandedNodeId + * ^^^^^^^^^^^^^^ + * A NodeId that allows the namespace URI to be specified instead of an index. */ +typedef struct { + UA_NodeId nodeId; + UA_String namespaceUri; + UA_UInt32 serverIndex; +} UA_ExpandedNodeId; + +UA_EXPORT extern const UA_ExpandedNodeId UA_EXPANDEDNODEID_NULL; + +UA_StatusCode UA_EXPORT +UA_ExpandedNodeId_print(const UA_ExpandedNodeId *id, UA_String *output); + +#ifdef UA_ENABLE_PARSING +/* Parse the ExpandedNodeId format defined in Part 6, 5.3.1.11: + * + * svr=<serverindex>;ns=<namespaceindex>;<type>=<value> + * or + * svr=<serverindex>;nsu=<uri>;<type>=<value> + * + * The definitions for svr, ns and nsu can be omitted and will be set to zero / + * the empty string.*/ +UA_StatusCode UA_EXPORT +UA_ExpandedNodeId_parse(UA_ExpandedNodeId *id, const UA_String str); + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID(const char *chars) { + UA_ExpandedNodeId id; + UA_ExpandedNodeId_parse(&id, UA_STRING((char*)(uintptr_t)chars)); + return id; +} +#endif + +/** The following functions are shorthand for creating ExpandedNodeIds. */ +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_NUMERIC(UA_UInt16 nsIndex, UA_UInt32 identifier) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_NUMERIC(nsIndex, identifier); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_STRING(UA_UInt16 nsIndex, char *chars) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_STRING(nsIndex, chars); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_STRING_ALLOC(UA_UInt16 nsIndex, const char *chars) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_STRING_ALLOC(nsIndex, chars); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_STRING_GUID(UA_UInt16 nsIndex, UA_Guid guid) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_GUID(nsIndex, guid); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_BYTESTRING(UA_UInt16 nsIndex, char *chars) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_BYTESTRING(nsIndex, chars); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +static UA_INLINE UA_ExpandedNodeId +UA_EXPANDEDNODEID_BYTESTRING_ALLOC(UA_UInt16 nsIndex, const char *chars) { + UA_ExpandedNodeId id; id.nodeId = UA_NODEID_BYTESTRING_ALLOC(nsIndex, chars); + id.serverIndex = 0; id.namespaceUri = UA_STRING_NULL; return id; +} + +/* Does the ExpandedNodeId point to a local node? That is, are namespaceUri and + * serverIndex empty? */ +UA_Boolean UA_EXPORT +UA_ExpandedNodeId_isLocal(const UA_ExpandedNodeId *n); + +/* Total ordering of ExpandedNodeId */ +UA_Order UA_EXPORT +UA_ExpandedNodeId_order(const UA_ExpandedNodeId *n1, const UA_ExpandedNodeId *n2); + +/* Check for equality */ +static UA_INLINE UA_Boolean +UA_ExpandedNodeId_equal(const UA_ExpandedNodeId *n1, const UA_ExpandedNodeId *n2) { + return (UA_ExpandedNodeId_order(n1, n2) == UA_ORDER_EQ); +} + +/* Returns a non-cryptographic hash for ExpandedNodeId. The hash of an + * ExpandedNodeId is identical to the hash of the embedded (simple) NodeId if + * the ServerIndex is zero and no NamespaceUri is set. */ +UA_UInt32 UA_EXPORT UA_ExpandedNodeId_hash(const UA_ExpandedNodeId *n); + +/** + * .. _qualifiedname: + * + * QualifiedName + * ^^^^^^^^^^^^^ + * A name qualified by a namespace. */ +typedef struct { + UA_UInt16 namespaceIndex; + UA_String name; +} UA_QualifiedName; + +static UA_INLINE UA_Boolean +UA_QualifiedName_isNull(const UA_QualifiedName *q) { + return (q->namespaceIndex == 0 && q->name.length == 0); +} + +/* Returns a non-cryptographic hash for QualifiedName */ +UA_UInt32 UA_EXPORT +UA_QualifiedName_hash(const UA_QualifiedName *q); + +static UA_INLINE UA_QualifiedName +UA_QUALIFIEDNAME(UA_UInt16 nsIndex, char *chars) { + UA_QualifiedName qn; qn.namespaceIndex = nsIndex; + qn.name = UA_STRING(chars); return qn; +} + +static UA_INLINE UA_QualifiedName +UA_QUALIFIEDNAME_ALLOC(UA_UInt16 nsIndex, const char *chars) { + UA_QualifiedName qn; qn.namespaceIndex = nsIndex; + qn.name = UA_STRING_ALLOC(chars); return qn; +} + +UA_Boolean UA_EXPORT +UA_QualifiedName_equal(const UA_QualifiedName *qn1, + const UA_QualifiedName *qn2); + +/** + * LocalizedText + * ^^^^^^^^^^^^^ + * Human readable text with an optional locale identifier. */ +typedef struct { + UA_String locale; + UA_String text; +} UA_LocalizedText; + +static UA_INLINE UA_LocalizedText +UA_LOCALIZEDTEXT(char *locale, char *text) { + UA_LocalizedText lt; lt.locale = UA_STRING(locale); + lt.text = UA_STRING(text); return lt; +} + +static UA_INLINE UA_LocalizedText +UA_LOCALIZEDTEXT_ALLOC(const char *locale, const char *text) { + UA_LocalizedText lt; lt.locale = UA_STRING_ALLOC(locale); + lt.text = UA_STRING_ALLOC(text); return lt; +} + +/* + * Check if the StatusCode is bad. + * @return Returns UA_TRUE if StatusCode is bad, else UA_FALSE. */ +UA_EXPORT UA_Boolean +UA_StatusCode_isBad(const UA_StatusCode code); + +/** + * .. _numericrange: + * + * NumericRange + * ^^^^^^^^^^^^ + * + * NumericRanges are used to indicate subsets of a (multidimensional) array. + * They no official data type in the OPC UA standard and are transmitted only + * with a string encoding, such as "1:2,0:3,5". The colon separates min/max + * index and the comma separates dimensions. A single value indicates a range + * with a single element (min==max). */ +typedef struct { + UA_UInt32 min; + UA_UInt32 max; +} UA_NumericRangeDimension; + +typedef struct { + size_t dimensionsSize; + UA_NumericRangeDimension *dimensions; +} UA_NumericRange; + +UA_StatusCode UA_EXPORT +UA_NumericRange_parse(UA_NumericRange *range, const UA_String str); + +static UA_INLINE UA_NumericRange +UA_NUMERICRANGE(const char *s) { + UA_NumericRange nr; nr.dimensionsSize = 0; nr.dimensions = NULL; + UA_NumericRange_parse(&nr, UA_STRING((char*)(uintptr_t)s)); return nr; +} + +UA_DEPRECATED static UA_INLINE UA_StatusCode +UA_NumericRange_parseFromString(UA_NumericRange *range, const UA_String *str) { + return UA_NumericRange_parse(range, *str); +} + +/** + * .. _variant: + * + * Variant + * ^^^^^^^ + * + * Variants may contain values of any type together with a description of the + * content. See the section on :ref:`generic-types` on how types are described. + * The standard mandates that variants contain built-in data types only. If the + * value is not of a builtin type, it is wrapped into an :ref:`extensionobject`. + * open62541 hides this wrapping transparently in the encoding layer. If the + * data type is unknown to the receiver, the variant contains the original + * ExtensionObject in binary or XML encoding. + * + * Variants may contain a scalar value or an array. For details on the handling + * of arrays, see the section on :ref:`array-handling`. Array variants can have + * an additional dimensionality (matrix, 3-tensor, ...) defined in an array of + * dimension lengths. The actual values are kept in an array of dimensions one. + * For users who work with higher-dimensions arrays directly, keep in mind that + * dimensions of higher rank are serialized first (the highest rank dimension + * has stride 1 and elements follow each other directly). Usually it is simplest + * to interact with higher-dimensional arrays via ``UA_NumericRange`` + * descriptions (see :ref:`array-handling`). + * + * To differentiate between scalar / array variants, the following definition is + * used. ``UA_Variant_isScalar`` provides simplified access to these checks. + * + * - ``arrayLength == 0 && data == NULL``: undefined array of length -1 + * - ``arrayLength == 0 && data == UA_EMPTY_ARRAY_SENTINEL``: array of length 0 + * - ``arrayLength == 0 && data > UA_EMPTY_ARRAY_SENTINEL``: scalar value + * - ``arrayLength > 0``: array of the given length + * + * Variants can also be *empty*. Then, the pointer to the type description is + * ``NULL``. */ +/* Forward declaration. See the section on Generic Type Handling */ +struct UA_DataType; +typedef struct UA_DataType UA_DataType; + +#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01) + +typedef enum { + UA_VARIANT_DATA, /* The data has the same lifecycle as the + variant */ + UA_VARIANT_DATA_NODELETE /* The data is "borrowed" by the variant and + shall not be deleted at the end of the + variant's lifecycle. */ +} UA_VariantStorageType; + +typedef struct { + const UA_DataType *type; /* The data type description */ + UA_VariantStorageType storageType; + size_t arrayLength; /* The number of elements in the data array */ + void *data; /* Points to the scalar or array data */ + size_t arrayDimensionsSize; /* The number of dimensions */ + UA_UInt32 *arrayDimensions; /* The length of each dimension */ +} UA_Variant; + +/* Returns true if the variant has no value defined (contains neither an array + * nor a scalar value). + * + * @param v The variant + * @return Is the variant empty */ +static UA_INLINE UA_Boolean +UA_Variant_isEmpty(const UA_Variant *v) { + return v->type == NULL; +} + +/* Returns true if the variant contains a scalar value. Note that empty variants + * contain an array of length -1 (undefined). + * + * @param v The variant + * @return Does the variant contain a scalar value */ +static UA_INLINE UA_Boolean +UA_Variant_isScalar(const UA_Variant *v) { + return (v->arrayLength == 0 && v->data > UA_EMPTY_ARRAY_SENTINEL); +} + +/* Returns true if the variant contains a scalar value of the given type. + * + * @param v The variant + * @param type The data type + * @return Does the variant contain a scalar value of the given type */ +static UA_INLINE UA_Boolean +UA_Variant_hasScalarType(const UA_Variant *v, const UA_DataType *type) { + return UA_Variant_isScalar(v) && type == v->type; +} + +/* Returns true if the variant contains an array of the given type. + * + * @param v The variant + * @param type The data type + * @return Does the variant contain an array of the given type */ +static UA_INLINE UA_Boolean +UA_Variant_hasArrayType(const UA_Variant *v, const UA_DataType *type) { + return (!UA_Variant_isScalar(v)) && type == v->type; +} + +/* Set the variant to a scalar value that already resides in memory. The value + * takes on the lifecycle of the variant and is deleted with it. + * + * @param v The variant + * @param p A pointer to the value data + * @param type The datatype of the value in question */ +void UA_EXPORT +UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, + const UA_DataType *type); + +/* Set the variant to a scalar value that is copied from an existing variable. + * @param v The variant + * @param p A pointer to the value data + * @param type The datatype of the value + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Variant_setScalarCopy(UA_Variant *v, const void * UA_RESTRICT p, + const UA_DataType *type); + +/* Set the variant to an array that already resides in memory. The array takes + * on the lifecycle of the variant and is deleted with it. + * + * @param v The variant + * @param array A pointer to the array data + * @param arraySize The size of the array + * @param type The datatype of the array */ +void UA_EXPORT +UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array, + size_t arraySize, const UA_DataType *type); + +/* Set the variant to an array that is copied from an existing array. + * + * @param v The variant + * @param array A pointer to the array data + * @param arraySize The size of the array + * @param type The datatype of the array + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Variant_setArrayCopy(UA_Variant *v, const void * UA_RESTRICT array, + size_t arraySize, const UA_DataType *type); + +/* Copy the variant, but use only a subset of the (multidimensional) array into + * a variant. Returns an error code if the variant is not an array or if the + * indicated range does not fit. + * + * @param src The source variant + * @param dst The target variant + * @param range The range of the copied data + * @return Returns UA_STATUSCODE_GOOD or an error code */ +UA_StatusCode UA_EXPORT +UA_Variant_copyRange(const UA_Variant *src, UA_Variant * UA_RESTRICT dst, + const UA_NumericRange range); + +/* Insert a range of data into an existing variant. The data array can't be + * reused afterwards if it contains types without a fixed size (e.g. strings) + * since the members are moved into the variant and take on its lifecycle. + * + * @param v The variant + * @param dataArray The data array. The type must match the variant + * @param dataArraySize The length of the data array. This is checked to match + * the range size. + * @param range The range of where the new data is inserted + * @return Returns UA_STATUSCODE_GOOD or an error code */ +UA_StatusCode UA_EXPORT +UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array, + size_t arraySize, const UA_NumericRange range); + +/* Deep-copy a range of data into an existing variant. + * + * @param v The variant + * @param dataArray The data array. The type must match the variant + * @param dataArraySize The length of the data array. This is checked to match + * the range size. + * @param range The range of where the new data is inserted + * @return Returns UA_STATUSCODE_GOOD or an error code */ +UA_StatusCode UA_EXPORT +UA_Variant_setRangeCopy(UA_Variant *v, const void * UA_RESTRICT array, + size_t arraySize, const UA_NumericRange range); + +/** + * .. _extensionobject: + * + * ExtensionObject + * ^^^^^^^^^^^^^^^ + * + * ExtensionObjects may contain scalars of any data type. Even those that are + * unknown to the receiver. See the section on :ref:`generic-types` on how types + * are described. If the received data type is unknown, the encoded string and + * target NodeId is stored instead of the decoded value. */ +typedef enum { + UA_EXTENSIONOBJECT_ENCODED_NOBODY = 0, + UA_EXTENSIONOBJECT_ENCODED_BYTESTRING = 1, + UA_EXTENSIONOBJECT_ENCODED_XML = 2, + UA_EXTENSIONOBJECT_DECODED = 3, + UA_EXTENSIONOBJECT_DECODED_NODELETE = 4 /* Don't delete the content + together with the + ExtensionObject */ +} UA_ExtensionObjectEncoding; + +typedef struct { + UA_ExtensionObjectEncoding encoding; + union { + struct { + UA_NodeId typeId; /* The nodeid of the datatype */ + UA_ByteString body; /* The bytestring of the encoded data */ + } encoded; + struct { + const UA_DataType *type; + void *data; + } decoded; + } content; +} UA_ExtensionObject; + +/* Initialize the ExtensionObject and set the "decoded" value to the given + * pointer. The value will be deleted when the ExtensionObject is cleared. */ +void UA_EXPORT +UA_ExtensionObject_setValue(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type); + +/* Initialize the ExtensionObject and set the "decoded" value to the given + * pointer. The value will *not* be deleted when the ExtensionObject is + * cleared. */ +void UA_EXPORT +UA_ExtensionObject_setValueNoDelete(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type); + +/* Initialize the ExtensionObject and set the "decoded" value to a fresh copy of + * the given value pointer. The value will be deleted when the ExtensionObject + * is cleared. */ +UA_StatusCode UA_EXPORT +UA_ExtensionObject_setValueCopy(UA_ExtensionObject *eo, + void * UA_RESTRICT p, + const UA_DataType *type); + +/** + * .. _datavalue: + * + * DataValue + * ^^^^^^^^^ + * A data value with an associated status code and timestamps. */ +typedef struct { + UA_Variant value; + UA_DateTime sourceTimestamp; + UA_DateTime serverTimestamp; + UA_UInt16 sourcePicoseconds; + UA_UInt16 serverPicoseconds; + UA_StatusCode status; + UA_Boolean hasValue : 1; + UA_Boolean hasStatus : 1; + UA_Boolean hasSourceTimestamp : 1; + UA_Boolean hasServerTimestamp : 1; + UA_Boolean hasSourcePicoseconds : 1; + UA_Boolean hasServerPicoseconds : 1; +} UA_DataValue; + +/** + * DiagnosticInfo + * ^^^^^^^^^^^^^^ + * A structure that contains detailed error and diagnostic information + * associated with a StatusCode. */ +typedef struct UA_DiagnosticInfo { + UA_Boolean hasSymbolicId : 1; + UA_Boolean hasNamespaceUri : 1; + UA_Boolean hasLocalizedText : 1; + UA_Boolean hasLocale : 1; + UA_Boolean hasAdditionalInfo : 1; + UA_Boolean hasInnerStatusCode : 1; + UA_Boolean hasInnerDiagnosticInfo : 1; + UA_Int32 symbolicId; + UA_Int32 namespaceUri; + UA_Int32 localizedText; + UA_Int32 locale; + UA_String additionalInfo; + UA_StatusCode innerStatusCode; + struct UA_DiagnosticInfo *innerDiagnosticInfo; +} UA_DiagnosticInfo; + +/** + * .. _generic-types: + * + * Generic Type Handling + * --------------------- + * + * All information about a (builtin/structured) data type is stored in a + * ``UA_DataType``. The array ``UA_TYPES`` contains the description of all + * standard-defined types. This type description is used for the following + * generic operations that work on all types: + * + * - ``void T_init(T *ptr)``: Initialize the data type. This is synonymous with + * zeroing out the memory, i.e. ``memset(ptr, 0, sizeof(T))``. + * - ``T* T_new()``: Allocate and return the memory for the data type. The + * value is already initialized. + * - ``UA_StatusCode T_copy(const T *src, T *dst)``: Copy the content of the + * data type. Returns ``UA_STATUSCODE_GOOD`` or + * ``UA_STATUSCODE_BADOUTOFMEMORY``. + * - ``void T_clear(T *ptr)``: Delete the dynamically allocated content + * of the data type and perform a ``T_init`` to reset the type. + * - ``void T_delete(T *ptr)``: Delete the content of the data type and the + * memory for the data type itself. + * + * Specializations, such as ``UA_Int32_new()`` are derived from the generic + * type operations as static inline functions. */ + +typedef struct { + UA_UInt16 memberTypeIndex; /* Index of the member in the array of data + types */ + UA_Byte padding; /* How much padding is there before this + member element? For arrays this is the + padding before the size_t length member. + (No padding between size_t and the + following ptr.) For unions, the padding + includes the size of the switchfield (the + offset from the start of the union + type). */ + UA_Boolean namespaceZero : 1; /* The type of the member is defined in + namespace zero. In this implementation, + types from custom namespace may contain + members from the same namespace or + namespace zero only.*/ + UA_Boolean isArray : 1; /* The member is an array */ + UA_Boolean isOptional : 1; /* The member is an optional field */ +#ifdef UA_ENABLE_TYPEDESCRIPTION + const char *memberName; /* Human-readable member name */ +#endif +} UA_DataTypeMember; + +/* The DataType "kind" is an internal type classification. It is used to + * dispatch handling to the correct routines. */ +#define UA_DATATYPEKINDS 31 +typedef enum { + UA_DATATYPEKIND_BOOLEAN = 0, + UA_DATATYPEKIND_SBYTE = 1, + UA_DATATYPEKIND_BYTE = 2, + UA_DATATYPEKIND_INT16 = 3, + UA_DATATYPEKIND_UINT16 = 4, + UA_DATATYPEKIND_INT32 = 5, + UA_DATATYPEKIND_UINT32 = 6, + UA_DATATYPEKIND_INT64 = 7, + UA_DATATYPEKIND_UINT64 = 8, + UA_DATATYPEKIND_FLOAT = 9, + UA_DATATYPEKIND_DOUBLE = 10, + UA_DATATYPEKIND_STRING = 11, + UA_DATATYPEKIND_DATETIME = 12, + UA_DATATYPEKIND_GUID = 13, + UA_DATATYPEKIND_BYTESTRING = 14, + UA_DATATYPEKIND_XMLELEMENT = 15, + UA_DATATYPEKIND_NODEID = 16, + UA_DATATYPEKIND_EXPANDEDNODEID = 17, + UA_DATATYPEKIND_STATUSCODE = 18, + UA_DATATYPEKIND_QUALIFIEDNAME = 19, + UA_DATATYPEKIND_LOCALIZEDTEXT = 20, + UA_DATATYPEKIND_EXTENSIONOBJECT = 21, + UA_DATATYPEKIND_DATAVALUE = 22, + UA_DATATYPEKIND_VARIANT = 23, + UA_DATATYPEKIND_DIAGNOSTICINFO = 24, + UA_DATATYPEKIND_DECIMAL = 25, + UA_DATATYPEKIND_ENUM = 26, + UA_DATATYPEKIND_STRUCTURE = 27, + UA_DATATYPEKIND_OPTSTRUCT = 28, /* struct with optional fields */ + UA_DATATYPEKIND_UNION = 29, + UA_DATATYPEKIND_BITFIELDCLUSTER = 30 /* bitfields + padding */ +} UA_DataTypeKind; + +struct UA_DataType { + UA_NodeId typeId; /* The nodeid of the type */ + UA_NodeId binaryEncodingId; /* NodeId of datatype when encoded as binary */ + //UA_NodeId xmlEncodingId; /* NodeId of datatype when encoded as XML */ + UA_UInt16 memSize; /* Size of the struct in memory */ + UA_UInt16 typeIndex; /* Index of the type in the datatypetable */ + UA_UInt32 typeKind : 6; /* Dispatch index for the handling routines */ + UA_UInt32 pointerFree : 1; /* The type (and its members) contains no + * pointers that need to be freed */ + UA_UInt32 overlayable : 1; /* The type has the identical memory layout + * in memory and on the binary stream. */ + UA_UInt32 membersSize : 8; /* How many members does the type have? */ + UA_DataTypeMember *members; + + /* The typename is only for debugging. Move last so the members pointers + * stays within the cacheline. */ +#ifdef UA_ENABLE_TYPEDESCRIPTION + const char *typeName; +#endif +}; + +/* Test if the data type is a numeric builtin data type. This includes Boolean, + * integers and floating point numbers. Not included are DateTime and + * StatusCode. */ +UA_Boolean +UA_DataType_isNumeric(const UA_DataType *type); + +/** + * Builtin data types can be accessed as UA_TYPES[UA_TYPES_XXX], where XXX is + * the name of the data type. If only the NodeId of a type is known, use the + * following method to retrieve the data type description. */ + +/* Returns the data type description for the type's identifier or NULL if no + * matching data type was found. */ +const UA_DataType UA_EXPORT * +UA_findDataType(const UA_NodeId *typeId); + +/** The following functions are used for generic handling of data types. */ + +/* Allocates and initializes a variable of type dataType + * + * @param type The datatype description + * @return Returns the memory location of the variable or NULL if no + * memory could be allocated */ +void UA_EXPORT * UA_new(const UA_DataType *type) UA_FUNC_ATTR_MALLOC; + +/* Initializes a variable to default values + * + * @param p The memory location of the variable + * @param type The datatype description */ +static UA_INLINE void +UA_init(void *p, const UA_DataType *type) { + memset(p, 0, type->memSize); +} + +/* Copies the content of two variables. If copying fails (e.g. because no memory + * was available for an array), then dst is emptied and initialized to prevent + * memory leaks. + * + * @param src The memory location of the source variable + * @param dst The memory location of the destination variable + * @param type The datatype description + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_copy(const void *src, void *dst, const UA_DataType *type); + +/* Deletes the dynamically allocated content of a variable (e.g. resets all + * arrays to undefined arrays). Afterwards, the variable can be safely deleted + * without causing memory leaks. But the variable is not initialized and may + * contain old data that is not memory-relevant. + * + * @param p The memory location of the variable + * @param type The datatype description of the variable */ +void UA_EXPORT UA_clear(void *p, const UA_DataType *type); + +#define UA_deleteMembers(p, type) UA_clear(p, type) + +/* Frees a variable and all of its content. + * + * @param p The memory location of the variable + * @param type The datatype description of the variable */ +void UA_EXPORT UA_delete(void *p, const UA_DataType *type); + +#ifdef UA_ENABLE_TYPEDESCRIPTION +/* Pretty-print the value from the datatype. + * + * @param p The memory location of the variable + * @param type The datatype description of the variable + * @param output A string that is memory-allocated for the pretty-printed output + * @return Indicates whether the operation succeeded*/ +UA_StatusCode UA_EXPORT +UA_print(const void *p, const UA_DataType *type, UA_String *output); +#endif + +/** + * .. _array-handling: + * + * Array handling + * -------------- + * In OPC UA, arrays can have a length of zero or more with the usual meaning. + * In addition, arrays can be undefined. Then, they don't even have a length. In + * the binary encoding, this is indicated by an array of length -1. + * + * In open62541 however, we use ``size_t`` for array lengths. An undefined array + * has length 0 and the data pointer is ``NULL``. An array of length 0 also has + * length 0 but a data pointer ``UA_EMPTY_ARRAY_SENTINEL``. */ + +/* Allocates and initializes an array of variables of a specific type + * + * @param size The requested array length + * @param type The datatype description + * @return Returns the memory location of the variable or NULL if no memory + could be allocated */ +void UA_EXPORT * +UA_Array_new(size_t size, const UA_DataType *type) UA_FUNC_ATTR_MALLOC; + +/* Allocates and copies an array + * + * @param src The memory location of the source array + * @param size The size of the array + * @param dst The location of the pointer to the new array + * @param type The datatype of the array members + * @return Returns UA_STATUSCODE_GOOD or UA_STATUSCODE_BADOUTOFMEMORY */ +UA_StatusCode UA_EXPORT +UA_Array_copy(const void *src, size_t size, void **dst, + const UA_DataType *type) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + +/* Deletes an array. + * + * @param p The memory location of the array + * @param size The size of the array + * @param type The datatype of the array members */ +void UA_EXPORT UA_Array_delete(void *p, size_t size, const UA_DataType *type); + +/** + * Random Number Generator + * ----------------------- + * If UA_MULTITHREADING is defined, then the seed is stored in thread + * local storage. The seed is initialized for every thread in the + * server/client. */ +void UA_EXPORT UA_random_seed(UA_UInt64 seed); +UA_UInt32 UA_EXPORT UA_UInt32_random(void); /* no cryptographic entropy */ +UA_Guid UA_EXPORT UA_Guid_random(void); /* no cryptographic entropy */ + +/** + * .. _generated-types: + * + * Generated Data Type Definitions + * ------------------------------- + * + * The following data types were auto-generated from a definition in XML format. + */ + +/* The following is used to exclude type names in the definition of UA_DataType + * structures if the feature is disabled. */ +#ifdef UA_ENABLE_TYPEDESCRIPTION +# define UA_TYPENAME(name) , name +#else +# define UA_TYPENAME(name) +#endif + +/* Datatype arrays with custom type definitions can be added in a linked list to + * the client or server configuration. Datatype members can point to types in + * the same array via the ``memberTypeIndex``. If ``namespaceZero`` is set to + * true, the member datatype is looked up in the array of builtin datatypes + * instead. */ +typedef struct UA_DataTypeArray { + const struct UA_DataTypeArray *next; + const size_t typesSize; + const UA_DataType *types; +} UA_DataTypeArray; + +/** + * .. include:: types_generated.rst */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/types_generated.h" ***********************************/ + +/* Generated from Opc.Ua.Types.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py * on host ci0011853 by user rosselliot at 2021-03-15 09:02:02 */ + + +#ifdef UA_ENABLE_AMALGAMATION +#else + +#endif + +_UA_BEGIN_DECLS + + +/** + * Every type is assigned an index in an array containing the type descriptions. + * These descriptions are used during type handling (copying, deletion, + * binary encoding, ...). */ +#define UA_TYPES_COUNT 190 +extern UA_EXPORT const UA_DataType UA_TYPES[UA_TYPES_COUNT]; + +/** + * Boolean + * ^^^^^^^ + */ +#define UA_TYPES_BOOLEAN 0 + +/** + * SByte + * ^^^^^ + */ +#define UA_TYPES_SBYTE 1 + +/** + * Byte + * ^^^^ + */ +#define UA_TYPES_BYTE 2 + +/** + * Int16 + * ^^^^^ + */ +#define UA_TYPES_INT16 3 + +/** + * UInt16 + * ^^^^^^ + */ +#define UA_TYPES_UINT16 4 + +/** + * Int32 + * ^^^^^ + */ +#define UA_TYPES_INT32 5 + +/** + * UInt32 + * ^^^^^^ + */ +#define UA_TYPES_UINT32 6 + +/** + * Int64 + * ^^^^^ + */ +#define UA_TYPES_INT64 7 + +/** + * UInt64 + * ^^^^^^ + */ +#define UA_TYPES_UINT64 8 + +/** + * Float + * ^^^^^ + */ +#define UA_TYPES_FLOAT 9 + +/** + * Double + * ^^^^^^ + */ +#define UA_TYPES_DOUBLE 10 + +/** + * String + * ^^^^^^ + */ +#define UA_TYPES_STRING 11 + +/** + * DateTime + * ^^^^^^^^ + */ +#define UA_TYPES_DATETIME 12 + +/** + * Guid + * ^^^^ + */ +#define UA_TYPES_GUID 13 + +/** + * ByteString + * ^^^^^^^^^^ + */ +#define UA_TYPES_BYTESTRING 14 + +/** + * XmlElement + * ^^^^^^^^^^ + */ +#define UA_TYPES_XMLELEMENT 15 + +/** + * NodeId + * ^^^^^^ + */ +#define UA_TYPES_NODEID 16 + +/** + * ExpandedNodeId + * ^^^^^^^^^^^^^^ + */ +#define UA_TYPES_EXPANDEDNODEID 17 + +/** + * StatusCode + * ^^^^^^^^^^ + */ +#define UA_TYPES_STATUSCODE 18 + +/** + * QualifiedName + * ^^^^^^^^^^^^^ + */ +#define UA_TYPES_QUALIFIEDNAME 19 + +/** + * LocalizedText + * ^^^^^^^^^^^^^ + */ +#define UA_TYPES_LOCALIZEDTEXT 20 + +/** + * ExtensionObject + * ^^^^^^^^^^^^^^^ + */ +#define UA_TYPES_EXTENSIONOBJECT 21 + +/** + * DataValue + * ^^^^^^^^^ + */ +#define UA_TYPES_DATAVALUE 22 + +/** + * Variant + * ^^^^^^^ + */ +#define UA_TYPES_VARIANT 23 + +/** + * DiagnosticInfo + * ^^^^^^^^^^^^^^ + */ +#define UA_TYPES_DIAGNOSTICINFO 24 + +/** + * ViewAttributes + * ^^^^^^^^^^^^^^ + * The attributes for a view node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Boolean containsNoLoops; + UA_Byte eventNotifier; +} UA_ViewAttributes; + +#define UA_TYPES_VIEWATTRIBUTES 25 + +/** + * XVType + * ^^^^^^ + */ +typedef struct { + UA_Double x; + UA_Float value; +} UA_XVType; + +#define UA_TYPES_XVTYPE 26 + +/** + * ElementOperand + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 index; +} UA_ElementOperand; + +#define UA_TYPES_ELEMENTOPERAND 27 + +/** + * VariableAttributes + * ^^^^^^^^^^^^^^^^^^ + * The attributes for a variable node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Variant value; + UA_NodeId dataType; + UA_Int32 valueRank; + size_t arrayDimensionsSize; + UA_UInt32 *arrayDimensions; + UA_Byte accessLevel; + UA_Byte userAccessLevel; + UA_Double minimumSamplingInterval; + UA_Boolean historizing; +} UA_VariableAttributes; + +#define UA_TYPES_VARIABLEATTRIBUTES 28 + +/** + * EnumValueType + * ^^^^^^^^^^^^^ + * A mapping between a value of an enumerated type and a name and description. */ +typedef struct { + UA_Int64 value; + UA_LocalizedText displayName; + UA_LocalizedText description; +} UA_EnumValueType; + +#define UA_TYPES_ENUMVALUETYPE 29 + +/** + * EventFieldList + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 clientHandle; + size_t eventFieldsSize; + UA_Variant *eventFields; +} UA_EventFieldList; + +#define UA_TYPES_EVENTFIELDLIST 30 + +/** + * MonitoredItemCreateResult + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode statusCode; + UA_UInt32 monitoredItemId; + UA_Double revisedSamplingInterval; + UA_UInt32 revisedQueueSize; + UA_ExtensionObject filterResult; +} UA_MonitoredItemCreateResult; + +#define UA_TYPES_MONITOREDITEMCREATERESULT 31 + +/** + * EUInformation + * ^^^^^^^^^^^^^ + */ +typedef struct { + UA_String namespaceUri; + UA_Int32 unitId; + UA_LocalizedText displayName; + UA_LocalizedText description; +} UA_EUInformation; + +#define UA_TYPES_EUINFORMATION 32 + +/** + * ServerDiagnosticsSummaryDataType + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 serverViewCount; + UA_UInt32 currentSessionCount; + UA_UInt32 cumulatedSessionCount; + UA_UInt32 securityRejectedSessionCount; + UA_UInt32 rejectedSessionCount; + UA_UInt32 sessionTimeoutCount; + UA_UInt32 sessionAbortCount; + UA_UInt32 currentSubscriptionCount; + UA_UInt32 cumulatedSubscriptionCount; + UA_UInt32 publishingIntervalCount; + UA_UInt32 securityRejectedRequestsCount; + UA_UInt32 rejectedRequestsCount; +} UA_ServerDiagnosticsSummaryDataType; + +#define UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE 33 + +/** + * ContentFilterElementResult + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode statusCode; + size_t operandStatusCodesSize; + UA_StatusCode *operandStatusCodes; + size_t operandDiagnosticInfosSize; + UA_DiagnosticInfo *operandDiagnosticInfos; +} UA_ContentFilterElementResult; + +#define UA_TYPES_CONTENTFILTERELEMENTRESULT 34 + +/** + * LiteralOperand + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_Variant value; +} UA_LiteralOperand; + +#define UA_TYPES_LITERALOPERAND 35 + +/** + * MessageSecurityMode + * ^^^^^^^^^^^^^^^^^^^ + * The type of security to use on a message. */ +typedef enum { + UA_MESSAGESECURITYMODE_INVALID = 0, + UA_MESSAGESECURITYMODE_NONE = 1, + UA_MESSAGESECURITYMODE_SIGN = 2, + UA_MESSAGESECURITYMODE_SIGNANDENCRYPT = 3, + __UA_MESSAGESECURITYMODE_FORCE32BIT = 0x7fffffff +} UA_MessageSecurityMode; +UA_STATIC_ASSERT(sizeof(UA_MessageSecurityMode) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_MESSAGESECURITYMODE 36 + +/** + * UtcTime + * ^^^^^^^ + * A date/time value specified in Universal Coordinated Time (UTC). */ +typedef UA_DateTime UA_UtcTime; + +#define UA_TYPES_UTCTIME 37 + +/** + * UserIdentityToken + * ^^^^^^^^^^^^^^^^^ + * A base type for a user identity token. */ +typedef struct { + UA_String policyId; +} UA_UserIdentityToken; + +#define UA_TYPES_USERIDENTITYTOKEN 38 + +/** + * X509IdentityToken + * ^^^^^^^^^^^^^^^^^ + * A token representing a user identified by an X509 certificate. */ +typedef struct { + UA_String policyId; + UA_ByteString certificateData; +} UA_X509IdentityToken; + +#define UA_TYPES_X509IDENTITYTOKEN 39 + +/** + * MonitoredItemNotification + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 clientHandle; + UA_DataValue value; +} UA_MonitoredItemNotification; + +#define UA_TYPES_MONITOREDITEMNOTIFICATION 40 + +/** + * StructureType + * ^^^^^^^^^^^^^ + */ +typedef enum { + UA_STRUCTURETYPE_STRUCTURE = 0, + UA_STRUCTURETYPE_STRUCTUREWITHOPTIONALFIELDS = 1, + UA_STRUCTURETYPE_UNION = 2, + __UA_STRUCTURETYPE_FORCE32BIT = 0x7fffffff +} UA_StructureType; +UA_STATIC_ASSERT(sizeof(UA_StructureType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_STRUCTURETYPE 41 + +/** + * ResponseHeader + * ^^^^^^^^^^^^^^ + * The header passed with every server response. */ +typedef struct { + UA_DateTime timestamp; + UA_UInt32 requestHandle; + UA_StatusCode serviceResult; + UA_DiagnosticInfo serviceDiagnostics; + size_t stringTableSize; + UA_String *stringTable; + UA_ExtensionObject additionalHeader; +} UA_ResponseHeader; + +#define UA_TYPES_RESPONSEHEADER 42 + +/** + * SignatureData + * ^^^^^^^^^^^^^ + * A digital signature. */ +typedef struct { + UA_String algorithm; + UA_ByteString signature; +} UA_SignatureData; + +#define UA_TYPES_SIGNATUREDATA 43 + +/** + * ModifySubscriptionResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_Double revisedPublishingInterval; + UA_UInt32 revisedLifetimeCount; + UA_UInt32 revisedMaxKeepAliveCount; +} UA_ModifySubscriptionResponse; + +#define UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE 44 + +/** + * NodeAttributes + * ^^^^^^^^^^^^^^ + * The base attributes for all nodes. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; +} UA_NodeAttributes; + +#define UA_TYPES_NODEATTRIBUTES 45 + +/** + * ActivateSessionResponse + * ^^^^^^^^^^^^^^^^^^^^^^^ + * Activates a session with the server. */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_ByteString serverNonce; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_ActivateSessionResponse; + +#define UA_TYPES_ACTIVATESESSIONRESPONSE 46 + +/** + * EnumField + * ^^^^^^^^^ + */ +typedef struct { + UA_Int64 value; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_String name; +} UA_EnumField; + +#define UA_TYPES_ENUMFIELD 47 + +/** + * VariableTypeAttributes + * ^^^^^^^^^^^^^^^^^^^^^^ + * The attributes for a variable type node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Variant value; + UA_NodeId dataType; + UA_Int32 valueRank; + size_t arrayDimensionsSize; + UA_UInt32 *arrayDimensions; + UA_Boolean isAbstract; +} UA_VariableTypeAttributes; + +#define UA_TYPES_VARIABLETYPEATTRIBUTES 48 + +/** + * CallMethodResult + * ^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode statusCode; + size_t inputArgumentResultsSize; + UA_StatusCode *inputArgumentResults; + size_t inputArgumentDiagnosticInfosSize; + UA_DiagnosticInfo *inputArgumentDiagnosticInfos; + size_t outputArgumentsSize; + UA_Variant *outputArguments; +} UA_CallMethodResult; + +#define UA_TYPES_CALLMETHODRESULT 49 + +/** + * MonitoringMode + * ^^^^^^^^^^^^^^ + */ +typedef enum { + UA_MONITORINGMODE_DISABLED = 0, + UA_MONITORINGMODE_SAMPLING = 1, + UA_MONITORINGMODE_REPORTING = 2, + __UA_MONITORINGMODE_FORCE32BIT = 0x7fffffff +} UA_MonitoringMode; +UA_STATIC_ASSERT(sizeof(UA_MonitoringMode) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_MONITORINGMODE 50 + +/** + * SetMonitoringModeResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_SetMonitoringModeResponse; + +#define UA_TYPES_SETMONITORINGMODERESPONSE 51 + +/** + * BrowseResultMask + * ^^^^^^^^^^^^^^^^ + * A bit mask which specifies what should be returned in a browse response. */ +typedef enum { + UA_BROWSERESULTMASK_NONE = 0, + UA_BROWSERESULTMASK_REFERENCETYPEID = 1, + UA_BROWSERESULTMASK_ISFORWARD = 2, + UA_BROWSERESULTMASK_NODECLASS = 4, + UA_BROWSERESULTMASK_BROWSENAME = 8, + UA_BROWSERESULTMASK_DISPLAYNAME = 16, + UA_BROWSERESULTMASK_TYPEDEFINITION = 32, + UA_BROWSERESULTMASK_ALL = 63, + UA_BROWSERESULTMASK_REFERENCETYPEINFO = 3, + UA_BROWSERESULTMASK_TARGETINFO = 60, + __UA_BROWSERESULTMASK_FORCE32BIT = 0x7fffffff +} UA_BrowseResultMask; +UA_STATIC_ASSERT(sizeof(UA_BrowseResultMask) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_BROWSERESULTMASK 52 + +/** + * RequestHeader + * ^^^^^^^^^^^^^ + * The header passed with every server request. */ +typedef struct { + UA_NodeId authenticationToken; + UA_DateTime timestamp; + UA_UInt32 requestHandle; + UA_UInt32 returnDiagnostics; + UA_String auditEntryId; + UA_UInt32 timeoutHint; + UA_ExtensionObject additionalHeader; +} UA_RequestHeader; + +#define UA_TYPES_REQUESTHEADER 53 + +/** + * MonitoredItemModifyResult + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode statusCode; + UA_Double revisedSamplingInterval; + UA_UInt32 revisedQueueSize; + UA_ExtensionObject filterResult; +} UA_MonitoredItemModifyResult; + +#define UA_TYPES_MONITOREDITEMMODIFYRESULT 54 + +/** + * CloseSecureChannelRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * Closes a secure channel. */ +typedef struct { + UA_RequestHeader requestHeader; +} UA_CloseSecureChannelRequest; + +#define UA_TYPES_CLOSESECURECHANNELREQUEST 55 + +/** + * NotificationMessage + * ^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 sequenceNumber; + UA_DateTime publishTime; + size_t notificationDataSize; + UA_ExtensionObject *notificationData; +} UA_NotificationMessage; + +#define UA_TYPES_NOTIFICATIONMESSAGE 56 + +/** + * CreateSubscriptionResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_UInt32 subscriptionId; + UA_Double revisedPublishingInterval; + UA_UInt32 revisedLifetimeCount; + UA_UInt32 revisedMaxKeepAliveCount; +} UA_CreateSubscriptionResponse; + +#define UA_TYPES_CREATESUBSCRIPTIONRESPONSE 57 + +/** + * EnumDefinition + * ^^^^^^^^^^^^^^ + */ +typedef struct { + size_t fieldsSize; + UA_EnumField *fields; +} UA_EnumDefinition; + +#define UA_TYPES_ENUMDEFINITION 58 + +/** + * AxisScaleEnumeration + * ^^^^^^^^^^^^^^^^^^^^ + */ +typedef enum { + UA_AXISSCALEENUMERATION_LINEAR = 0, + UA_AXISSCALEENUMERATION_LOG = 1, + UA_AXISSCALEENUMERATION_LN = 2, + __UA_AXISSCALEENUMERATION_FORCE32BIT = 0x7fffffff +} UA_AxisScaleEnumeration; +UA_STATIC_ASSERT(sizeof(UA_AxisScaleEnumeration) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_AXISSCALEENUMERATION 59 + +/** + * BrowseDirection + * ^^^^^^^^^^^^^^^ + * The directions of the references to return. */ +typedef enum { + UA_BROWSEDIRECTION_FORWARD = 0, + UA_BROWSEDIRECTION_INVERSE = 1, + UA_BROWSEDIRECTION_BOTH = 2, + UA_BROWSEDIRECTION_INVALID = 3, + __UA_BROWSEDIRECTION_FORCE32BIT = 0x7fffffff +} UA_BrowseDirection; +UA_STATIC_ASSERT(sizeof(UA_BrowseDirection) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_BROWSEDIRECTION 60 + +/** + * CallMethodRequest + * ^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_NodeId objectId; + UA_NodeId methodId; + size_t inputArgumentsSize; + UA_Variant *inputArguments; +} UA_CallMethodRequest; + +#define UA_TYPES_CALLMETHODREQUEST 61 + +/** + * ReadResponse + * ^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_DataValue *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_ReadResponse; + +#define UA_TYPES_READRESPONSE 62 + +/** + * TimestampsToReturn + * ^^^^^^^^^^^^^^^^^^ + */ +typedef enum { + UA_TIMESTAMPSTORETURN_SOURCE = 0, + UA_TIMESTAMPSTORETURN_SERVER = 1, + UA_TIMESTAMPSTORETURN_BOTH = 2, + UA_TIMESTAMPSTORETURN_NEITHER = 3, + UA_TIMESTAMPSTORETURN_INVALID = 4, + __UA_TIMESTAMPSTORETURN_FORCE32BIT = 0x7fffffff +} UA_TimestampsToReturn; +UA_STATIC_ASSERT(sizeof(UA_TimestampsToReturn) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_TIMESTAMPSTORETURN 63 + +/** + * NodeClass + * ^^^^^^^^^ + * A mask specifying the class of the node. */ +typedef enum { + UA_NODECLASS_UNSPECIFIED = 0, + UA_NODECLASS_OBJECT = 1, + UA_NODECLASS_VARIABLE = 2, + UA_NODECLASS_METHOD = 4, + UA_NODECLASS_OBJECTTYPE = 8, + UA_NODECLASS_VARIABLETYPE = 16, + UA_NODECLASS_REFERENCETYPE = 32, + UA_NODECLASS_DATATYPE = 64, + UA_NODECLASS_VIEW = 128, + __UA_NODECLASS_FORCE32BIT = 0x7fffffff +} UA_NodeClass; +UA_STATIC_ASSERT(sizeof(UA_NodeClass) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_NODECLASS 64 + +/** + * ObjectTypeAttributes + * ^^^^^^^^^^^^^^^^^^^^ + * The attributes for an object type node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Boolean isAbstract; +} UA_ObjectTypeAttributes; + +#define UA_TYPES_OBJECTTYPEATTRIBUTES 65 + +/** + * SecurityTokenRequestType + * ^^^^^^^^^^^^^^^^^^^^^^^^ + * Indicates whether a token if being created or renewed. */ +typedef enum { + UA_SECURITYTOKENREQUESTTYPE_ISSUE = 0, + UA_SECURITYTOKENREQUESTTYPE_RENEW = 1, + __UA_SECURITYTOKENREQUESTTYPE_FORCE32BIT = 0x7fffffff +} UA_SecurityTokenRequestType; +UA_STATIC_ASSERT(sizeof(UA_SecurityTokenRequestType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_SECURITYTOKENREQUESTTYPE 66 + +/** + * CloseSessionResponse + * ^^^^^^^^^^^^^^^^^^^^ + * Closes a session with the server. */ +typedef struct { + UA_ResponseHeader responseHeader; +} UA_CloseSessionResponse; + +#define UA_TYPES_CLOSESESSIONRESPONSE 67 + +/** + * SetPublishingModeRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_Boolean publishingEnabled; + size_t subscriptionIdsSize; + UA_UInt32 *subscriptionIds; +} UA_SetPublishingModeRequest; + +#define UA_TYPES_SETPUBLISHINGMODEREQUEST 68 + +/** + * IssuedIdentityToken + * ^^^^^^^^^^^^^^^^^^^ + * A token representing a user identified by a WS-Security XML token. */ +typedef struct { + UA_String policyId; + UA_ByteString tokenData; + UA_String encryptionAlgorithm; +} UA_IssuedIdentityToken; + +#define UA_TYPES_ISSUEDIDENTITYTOKEN 69 + +/** + * DeleteMonitoredItemsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_DeleteMonitoredItemsResponse; + +#define UA_TYPES_DELETEMONITOREDITEMSRESPONSE 70 + +/** + * ApplicationType + * ^^^^^^^^^^^^^^^ + * The types of applications. */ +typedef enum { + UA_APPLICATIONTYPE_SERVER = 0, + UA_APPLICATIONTYPE_CLIENT = 1, + UA_APPLICATIONTYPE_CLIENTANDSERVER = 2, + UA_APPLICATIONTYPE_DISCOVERYSERVER = 3, + __UA_APPLICATIONTYPE_FORCE32BIT = 0x7fffffff +} UA_ApplicationType; +UA_STATIC_ASSERT(sizeof(UA_ApplicationType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_APPLICATIONTYPE 71 + +/** + * BrowseNextRequest + * ^^^^^^^^^^^^^^^^^ + * Continues one or more browse operations. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_Boolean releaseContinuationPoints; + size_t continuationPointsSize; + UA_ByteString *continuationPoints; +} UA_BrowseNextRequest; + +#define UA_TYPES_BROWSENEXTREQUEST 72 + +/** + * ModifySubscriptionRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_Double requestedPublishingInterval; + UA_UInt32 requestedLifetimeCount; + UA_UInt32 requestedMaxKeepAliveCount; + UA_UInt32 maxNotificationsPerPublish; + UA_Byte priority; +} UA_ModifySubscriptionRequest; + +#define UA_TYPES_MODIFYSUBSCRIPTIONREQUEST 73 + +/** + * BrowseDescription + * ^^^^^^^^^^^^^^^^^ + * A request to browse the the references from a node. */ +typedef struct { + UA_NodeId nodeId; + UA_BrowseDirection browseDirection; + UA_NodeId referenceTypeId; + UA_Boolean includeSubtypes; + UA_UInt32 nodeClassMask; + UA_UInt32 resultMask; +} UA_BrowseDescription; + +#define UA_TYPES_BROWSEDESCRIPTION 74 + +/** + * SignedSoftwareCertificate + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * A software certificate with a digital signature. */ +typedef struct { + UA_ByteString certificateData; + UA_ByteString signature; +} UA_SignedSoftwareCertificate; + +#define UA_TYPES_SIGNEDSOFTWARECERTIFICATE 75 + +/** + * BrowsePathTarget + * ^^^^^^^^^^^^^^^^ + * The target of the translated path. */ +typedef struct { + UA_ExpandedNodeId targetId; + UA_UInt32 remainingPathIndex; +} UA_BrowsePathTarget; + +#define UA_TYPES_BROWSEPATHTARGET 76 + +/** + * WriteResponse + * ^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_WriteResponse; + +#define UA_TYPES_WRITERESPONSE 77 + +/** + * AddNodesResult + * ^^^^^^^^^^^^^^ + * A result of an add node operation. */ +typedef struct { + UA_StatusCode statusCode; + UA_NodeId addedNodeId; +} UA_AddNodesResult; + +#define UA_TYPES_ADDNODESRESULT 78 + +/** + * AddReferencesItem + * ^^^^^^^^^^^^^^^^^ + * A request to add a reference to the server address space. */ +typedef struct { + UA_NodeId sourceNodeId; + UA_NodeId referenceTypeId; + UA_Boolean isForward; + UA_String targetServerUri; + UA_ExpandedNodeId targetNodeId; + UA_NodeClass targetNodeClass; +} UA_AddReferencesItem; + +#define UA_TYPES_ADDREFERENCESITEM 79 + +/** + * DeleteReferencesResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^ + * Delete one or more references from the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_DeleteReferencesResponse; + +#define UA_TYPES_DELETEREFERENCESRESPONSE 80 + +/** + * RelativePathElement + * ^^^^^^^^^^^^^^^^^^^ + * An element in a relative path. */ +typedef struct { + UA_NodeId referenceTypeId; + UA_Boolean isInverse; + UA_Boolean includeSubtypes; + UA_QualifiedName targetName; +} UA_RelativePathElement; + +#define UA_TYPES_RELATIVEPATHELEMENT 81 + +/** + * SubscriptionAcknowledgement + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 subscriptionId; + UA_UInt32 sequenceNumber; +} UA_SubscriptionAcknowledgement; + +#define UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT 82 + +/** + * TransferResult + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode statusCode; + size_t availableSequenceNumbersSize; + UA_UInt32 *availableSequenceNumbers; +} UA_TransferResult; + +#define UA_TYPES_TRANSFERRESULT 83 + +/** + * CreateMonitoredItemsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_MonitoredItemCreateResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_CreateMonitoredItemsResponse; + +#define UA_TYPES_CREATEMONITOREDITEMSRESPONSE 84 + +/** + * DeleteReferencesItem + * ^^^^^^^^^^^^^^^^^^^^ + * A request to delete a node from the server address space. */ +typedef struct { + UA_NodeId sourceNodeId; + UA_NodeId referenceTypeId; + UA_Boolean isForward; + UA_ExpandedNodeId targetNodeId; + UA_Boolean deleteBidirectional; +} UA_DeleteReferencesItem; + +#define UA_TYPES_DELETEREFERENCESITEM 85 + +/** + * WriteValue + * ^^^^^^^^^^ + */ +typedef struct { + UA_NodeId nodeId; + UA_UInt32 attributeId; + UA_String indexRange; + UA_DataValue value; +} UA_WriteValue; + +#define UA_TYPES_WRITEVALUE 86 + +/** + * DataTypeAttributes + * ^^^^^^^^^^^^^^^^^^ + * The attributes for a data type node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Boolean isAbstract; +} UA_DataTypeAttributes; + +#define UA_TYPES_DATATYPEATTRIBUTES 87 + +/** + * TransferSubscriptionsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_TransferResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_TransferSubscriptionsResponse; + +#define UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE 88 + +/** + * AddReferencesResponse + * ^^^^^^^^^^^^^^^^^^^^^ + * Adds one or more references to the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_AddReferencesResponse; + +#define UA_TYPES_ADDREFERENCESRESPONSE 89 + +/** + * DeadbandType + * ^^^^^^^^^^^^ + */ +typedef enum { + UA_DEADBANDTYPE_NONE = 0, + UA_DEADBANDTYPE_ABSOLUTE = 1, + UA_DEADBANDTYPE_PERCENT = 2, + __UA_DEADBANDTYPE_FORCE32BIT = 0x7fffffff +} UA_DeadbandType; +UA_STATIC_ASSERT(sizeof(UA_DeadbandType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_DEADBANDTYPE 90 + +/** + * DataChangeTrigger + * ^^^^^^^^^^^^^^^^^ + */ +typedef enum { + UA_DATACHANGETRIGGER_STATUS = 0, + UA_DATACHANGETRIGGER_STATUSVALUE = 1, + UA_DATACHANGETRIGGER_STATUSVALUETIMESTAMP = 2, + __UA_DATACHANGETRIGGER_FORCE32BIT = 0x7fffffff +} UA_DataChangeTrigger; +UA_STATIC_ASSERT(sizeof(UA_DataChangeTrigger) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_DATACHANGETRIGGER 91 + +/** + * BuildInfo + * ^^^^^^^^^ + */ +typedef struct { + UA_String productUri; + UA_String manufacturerName; + UA_String productName; + UA_String softwareVersion; + UA_String buildNumber; + UA_DateTime buildDate; +} UA_BuildInfo; + +#define UA_TYPES_BUILDINFO 92 + +/** + * FilterOperand + * ^^^^^^^^^^^^^ + */ +typedef void * UA_FilterOperand; + +#define UA_TYPES_FILTEROPERAND 93 + +/** + * MonitoringParameters + * ^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 clientHandle; + UA_Double samplingInterval; + UA_ExtensionObject filter; + UA_UInt32 queueSize; + UA_Boolean discardOldest; +} UA_MonitoringParameters; + +#define UA_TYPES_MONITORINGPARAMETERS 94 + +/** + * DoubleComplexNumberType + * ^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_Double real; + UA_Double imaginary; +} UA_DoubleComplexNumberType; + +#define UA_TYPES_DOUBLECOMPLEXNUMBERTYPE 95 + +/** + * DeleteNodesItem + * ^^^^^^^^^^^^^^^ + * A request to delete a node to the server address space. */ +typedef struct { + UA_NodeId nodeId; + UA_Boolean deleteTargetReferences; +} UA_DeleteNodesItem; + +#define UA_TYPES_DELETENODESITEM 96 + +/** + * ReadValueId + * ^^^^^^^^^^^ + */ +typedef struct { + UA_NodeId nodeId; + UA_UInt32 attributeId; + UA_String indexRange; + UA_QualifiedName dataEncoding; +} UA_ReadValueId; + +#define UA_TYPES_READVALUEID 97 + +/** + * CallRequest + * ^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + size_t methodsToCallSize; + UA_CallMethodRequest *methodsToCall; +} UA_CallRequest; + +#define UA_TYPES_CALLREQUEST 98 + +/** + * RelativePath + * ^^^^^^^^^^^^ + * A relative path constructed from reference types and browse names. */ +typedef struct { + size_t elementsSize; + UA_RelativePathElement *elements; +} UA_RelativePath; + +#define UA_TYPES_RELATIVEPATH 99 + +/** + * DeleteNodesRequest + * ^^^^^^^^^^^^^^^^^^ + * Delete one or more nodes from the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t nodesToDeleteSize; + UA_DeleteNodesItem *nodesToDelete; +} UA_DeleteNodesRequest; + +#define UA_TYPES_DELETENODESREQUEST 100 + +/** + * MonitoredItemModifyRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_UInt32 monitoredItemId; + UA_MonitoringParameters requestedParameters; +} UA_MonitoredItemModifyRequest; + +#define UA_TYPES_MONITOREDITEMMODIFYREQUEST 101 + +/** + * UserTokenType + * ^^^^^^^^^^^^^ + * The possible user token types. */ +typedef enum { + UA_USERTOKENTYPE_ANONYMOUS = 0, + UA_USERTOKENTYPE_USERNAME = 1, + UA_USERTOKENTYPE_CERTIFICATE = 2, + UA_USERTOKENTYPE_ISSUEDTOKEN = 3, + __UA_USERTOKENTYPE_FORCE32BIT = 0x7fffffff +} UA_UserTokenType; +UA_STATIC_ASSERT(sizeof(UA_UserTokenType) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_USERTOKENTYPE 102 + +/** + * AggregateConfiguration + * ^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_Boolean useServerCapabilitiesDefaults; + UA_Boolean treatUncertainAsBad; + UA_Byte percentDataBad; + UA_Byte percentDataGood; + UA_Boolean useSlopedExtrapolation; +} UA_AggregateConfiguration; + +#define UA_TYPES_AGGREGATECONFIGURATION 103 + +/** + * LocaleId + * ^^^^^^^^ + * An identifier for a user locale. */ +typedef UA_String UA_LocaleId; + +#define UA_TYPES_LOCALEID 104 + +/** + * UnregisterNodesResponse + * ^^^^^^^^^^^^^^^^^^^^^^^ + * Unregisters one or more previously registered nodes. */ +typedef struct { + UA_ResponseHeader responseHeader; +} UA_UnregisterNodesResponse; + +#define UA_TYPES_UNREGISTERNODESRESPONSE 105 + +/** + * ContentFilterResult + * ^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + size_t elementResultsSize; + UA_ContentFilterElementResult *elementResults; + size_t elementDiagnosticInfosSize; + UA_DiagnosticInfo *elementDiagnosticInfos; +} UA_ContentFilterResult; + +#define UA_TYPES_CONTENTFILTERRESULT 106 + +/** + * UserTokenPolicy + * ^^^^^^^^^^^^^^^ + * Describes a user token that can be used with a server. */ +typedef struct { + UA_String policyId; + UA_UserTokenType tokenType; + UA_String issuedTokenType; + UA_String issuerEndpointUrl; + UA_String securityPolicyUri; +} UA_UserTokenPolicy; + +#define UA_TYPES_USERTOKENPOLICY 107 + +/** + * DeleteMonitoredItemsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + size_t monitoredItemIdsSize; + UA_UInt32 *monitoredItemIds; +} UA_DeleteMonitoredItemsRequest; + +#define UA_TYPES_DELETEMONITOREDITEMSREQUEST 108 + +/** + * SetMonitoringModeRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_MonitoringMode monitoringMode; + size_t monitoredItemIdsSize; + UA_UInt32 *monitoredItemIds; +} UA_SetMonitoringModeRequest; + +#define UA_TYPES_SETMONITORINGMODEREQUEST 109 + +/** + * Duration + * ^^^^^^^^ + * A period of time measured in milliseconds. */ +typedef UA_Double UA_Duration; + +#define UA_TYPES_DURATION 110 + +/** + * ReferenceTypeAttributes + * ^^^^^^^^^^^^^^^^^^^^^^^ + * The attributes for a reference type node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Boolean isAbstract; + UA_Boolean symmetric; + UA_LocalizedText inverseName; +} UA_ReferenceTypeAttributes; + +#define UA_TYPES_REFERENCETYPEATTRIBUTES 111 + +/** + * GetEndpointsRequest + * ^^^^^^^^^^^^^^^^^^^ + * Gets the endpoints used by the server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_String endpointUrl; + size_t localeIdsSize; + UA_String *localeIds; + size_t profileUrisSize; + UA_String *profileUris; +} UA_GetEndpointsRequest; + +#define UA_TYPES_GETENDPOINTSREQUEST 112 + +/** + * CloseSecureChannelResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Closes a secure channel. */ +typedef struct { + UA_ResponseHeader responseHeader; +} UA_CloseSecureChannelResponse; + +#define UA_TYPES_CLOSESECURECHANNELRESPONSE 113 + +/** + * ViewDescription + * ^^^^^^^^^^^^^^^ + * The view to browse. */ +typedef struct { + UA_NodeId viewId; + UA_DateTime timestamp; + UA_UInt32 viewVersion; +} UA_ViewDescription; + +#define UA_TYPES_VIEWDESCRIPTION 114 + +/** + * SetPublishingModeResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_SetPublishingModeResponse; + +#define UA_TYPES_SETPUBLISHINGMODERESPONSE 115 + +/** + * StatusChangeNotification + * ^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_StatusCode status; + UA_DiagnosticInfo diagnosticInfo; +} UA_StatusChangeNotification; + +#define UA_TYPES_STATUSCHANGENOTIFICATION 116 + +/** + * StructureField + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_String name; + UA_LocalizedText description; + UA_NodeId dataType; + UA_Int32 valueRank; + size_t arrayDimensionsSize; + UA_UInt32 *arrayDimensions; + UA_UInt32 maxStringLength; + UA_Boolean isOptional; +} UA_StructureField; + +#define UA_TYPES_STRUCTUREFIELD 117 + +/** + * NodeAttributesMask + * ^^^^^^^^^^^^^^^^^^ + * The bits used to specify default attributes for a new node. */ +typedef enum { + UA_NODEATTRIBUTESMASK_NONE = 0, + UA_NODEATTRIBUTESMASK_ACCESSLEVEL = 1, + UA_NODEATTRIBUTESMASK_ARRAYDIMENSIONS = 2, + UA_NODEATTRIBUTESMASK_BROWSENAME = 4, + UA_NODEATTRIBUTESMASK_CONTAINSNOLOOPS = 8, + UA_NODEATTRIBUTESMASK_DATATYPE = 16, + UA_NODEATTRIBUTESMASK_DESCRIPTION = 32, + UA_NODEATTRIBUTESMASK_DISPLAYNAME = 64, + UA_NODEATTRIBUTESMASK_EVENTNOTIFIER = 128, + UA_NODEATTRIBUTESMASK_EXECUTABLE = 256, + UA_NODEATTRIBUTESMASK_HISTORIZING = 512, + UA_NODEATTRIBUTESMASK_INVERSENAME = 1024, + UA_NODEATTRIBUTESMASK_ISABSTRACT = 2048, + UA_NODEATTRIBUTESMASK_MINIMUMSAMPLINGINTERVAL = 4096, + UA_NODEATTRIBUTESMASK_NODECLASS = 8192, + UA_NODEATTRIBUTESMASK_NODEID = 16384, + UA_NODEATTRIBUTESMASK_SYMMETRIC = 32768, + UA_NODEATTRIBUTESMASK_USERACCESSLEVEL = 65536, + UA_NODEATTRIBUTESMASK_USEREXECUTABLE = 131072, + UA_NODEATTRIBUTESMASK_USERWRITEMASK = 262144, + UA_NODEATTRIBUTESMASK_VALUERANK = 524288, + UA_NODEATTRIBUTESMASK_WRITEMASK = 1048576, + UA_NODEATTRIBUTESMASK_VALUE = 2097152, + UA_NODEATTRIBUTESMASK_DATATYPEDEFINITION = 4194304, + UA_NODEATTRIBUTESMASK_ROLEPERMISSIONS = 8388608, + UA_NODEATTRIBUTESMASK_ACCESSRESTRICTIONS = 16777216, + UA_NODEATTRIBUTESMASK_ALL = 33554431, + UA_NODEATTRIBUTESMASK_BASENODE = 26501220, + UA_NODEATTRIBUTESMASK_OBJECT = 26501348, + UA_NODEATTRIBUTESMASK_OBJECTTYPE = 26503268, + UA_NODEATTRIBUTESMASK_VARIABLE = 26571383, + UA_NODEATTRIBUTESMASK_VARIABLETYPE = 28600438, + UA_NODEATTRIBUTESMASK_METHOD = 26632548, + UA_NODEATTRIBUTESMASK_REFERENCETYPE = 26537060, + UA_NODEATTRIBUTESMASK_VIEW = 26501356, + __UA_NODEATTRIBUTESMASK_FORCE32BIT = 0x7fffffff +} UA_NodeAttributesMask; +UA_STATIC_ASSERT(sizeof(UA_NodeAttributesMask) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_NODEATTRIBUTESMASK 118 + +/** + * EventFilterResult + * ^^^^^^^^^^^^^^^^^ + */ +typedef struct { + size_t selectClauseResultsSize; + UA_StatusCode *selectClauseResults; + size_t selectClauseDiagnosticInfosSize; + UA_DiagnosticInfo *selectClauseDiagnosticInfos; + UA_ContentFilterResult whereClauseResult; +} UA_EventFilterResult; + +#define UA_TYPES_EVENTFILTERRESULT 119 + +/** + * MonitoredItemCreateRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ReadValueId itemToMonitor; + UA_MonitoringMode monitoringMode; + UA_MonitoringParameters requestedParameters; +} UA_MonitoredItemCreateRequest; + +#define UA_TYPES_MONITOREDITEMCREATEREQUEST 120 + +/** + * ComplexNumberType + * ^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_Float real; + UA_Float imaginary; +} UA_ComplexNumberType; + +#define UA_TYPES_COMPLEXNUMBERTYPE 121 + +/** + * Range + * ^^^^^ + */ +typedef struct { + UA_Double low; + UA_Double high; +} UA_Range; + +#define UA_TYPES_RANGE 122 + +/** + * DataChangeNotification + * ^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + size_t monitoredItemsSize; + UA_MonitoredItemNotification *monitoredItems; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_DataChangeNotification; + +#define UA_TYPES_DATACHANGENOTIFICATION 123 + +/** + * Argument + * ^^^^^^^^ + * An argument for a method. */ +typedef struct { + UA_String name; + UA_NodeId dataType; + UA_Int32 valueRank; + size_t arrayDimensionsSize; + UA_UInt32 *arrayDimensions; + UA_LocalizedText description; +} UA_Argument; + +#define UA_TYPES_ARGUMENT 124 + +/** + * TransferSubscriptionsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + size_t subscriptionIdsSize; + UA_UInt32 *subscriptionIds; + UA_Boolean sendInitialValues; +} UA_TransferSubscriptionsRequest; + +#define UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST 125 + +/** + * ChannelSecurityToken + * ^^^^^^^^^^^^^^^^^^^^ + * The token that identifies a set of keys for an active secure channel. */ +typedef struct { + UA_UInt32 channelId; + UA_UInt32 tokenId; + UA_DateTime createdAt; + UA_UInt32 revisedLifetime; +} UA_ChannelSecurityToken; + +#define UA_TYPES_CHANNELSECURITYTOKEN 126 + +/** + * ServerState + * ^^^^^^^^^^^ + */ +typedef enum { + UA_SERVERSTATE_RUNNING = 0, + UA_SERVERSTATE_FAILED = 1, + UA_SERVERSTATE_NOCONFIGURATION = 2, + UA_SERVERSTATE_SUSPENDED = 3, + UA_SERVERSTATE_SHUTDOWN = 4, + UA_SERVERSTATE_TEST = 5, + UA_SERVERSTATE_COMMUNICATIONFAULT = 6, + UA_SERVERSTATE_UNKNOWN = 7, + __UA_SERVERSTATE_FORCE32BIT = 0x7fffffff +} UA_ServerState; +UA_STATIC_ASSERT(sizeof(UA_ServerState) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_SERVERSTATE 127 + +/** + * EventNotificationList + * ^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + size_t eventsSize; + UA_EventFieldList *events; +} UA_EventNotificationList; + +#define UA_TYPES_EVENTNOTIFICATIONLIST 128 + +/** + * AnonymousIdentityToken + * ^^^^^^^^^^^^^^^^^^^^^^ + * A token representing an anonymous user. */ +typedef struct { + UA_String policyId; +} UA_AnonymousIdentityToken; + +#define UA_TYPES_ANONYMOUSIDENTITYTOKEN 129 + +/** + * FilterOperator + * ^^^^^^^^^^^^^^ + */ +typedef enum { + UA_FILTEROPERATOR_EQUALS = 0, + UA_FILTEROPERATOR_ISNULL = 1, + UA_FILTEROPERATOR_GREATERTHAN = 2, + UA_FILTEROPERATOR_LESSTHAN = 3, + UA_FILTEROPERATOR_GREATERTHANOREQUAL = 4, + UA_FILTEROPERATOR_LESSTHANOREQUAL = 5, + UA_FILTEROPERATOR_LIKE = 6, + UA_FILTEROPERATOR_NOT = 7, + UA_FILTEROPERATOR_BETWEEN = 8, + UA_FILTEROPERATOR_INLIST = 9, + UA_FILTEROPERATOR_AND = 10, + UA_FILTEROPERATOR_OR = 11, + UA_FILTEROPERATOR_CAST = 12, + UA_FILTEROPERATOR_INVIEW = 13, + UA_FILTEROPERATOR_OFTYPE = 14, + UA_FILTEROPERATOR_RELATEDTO = 15, + UA_FILTEROPERATOR_BITWISEAND = 16, + UA_FILTEROPERATOR_BITWISEOR = 17, + __UA_FILTEROPERATOR_FORCE32BIT = 0x7fffffff +} UA_FilterOperator; +UA_STATIC_ASSERT(sizeof(UA_FilterOperator) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_FILTEROPERATOR 130 + +/** + * AggregateFilter + * ^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_DateTime startTime; + UA_NodeId aggregateType; + UA_Double processingInterval; + UA_AggregateConfiguration aggregateConfiguration; +} UA_AggregateFilter; + +#define UA_TYPES_AGGREGATEFILTER 131 + +/** + * RepublishResponse + * ^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_NotificationMessage notificationMessage; +} UA_RepublishResponse; + +#define UA_TYPES_REPUBLISHRESPONSE 132 + +/** + * DeleteSubscriptionsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_DeleteSubscriptionsResponse; + +#define UA_TYPES_DELETESUBSCRIPTIONSRESPONSE 133 + +/** + * RegisterNodesRequest + * ^^^^^^^^^^^^^^^^^^^^ + * Registers one or more nodes for repeated use within a session. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t nodesToRegisterSize; + UA_NodeId *nodesToRegister; +} UA_RegisterNodesRequest; + +#define UA_TYPES_REGISTERNODESREQUEST 134 + +/** + * StructureDefinition + * ^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_NodeId defaultEncodingId; + UA_NodeId baseDataType; + UA_StructureType structureType; + size_t fieldsSize; + UA_StructureField *fields; +} UA_StructureDefinition; + +#define UA_TYPES_STRUCTUREDEFINITION 135 + +/** + * MethodAttributes + * ^^^^^^^^^^^^^^^^ + * The attributes for a method node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Boolean executable; + UA_Boolean userExecutable; +} UA_MethodAttributes; + +#define UA_TYPES_METHODATTRIBUTES 136 + +/** + * UserNameIdentityToken + * ^^^^^^^^^^^^^^^^^^^^^ + * A token representing a user identified by a user name and password. */ +typedef struct { + UA_String policyId; + UA_String userName; + UA_ByteString password; + UA_String encryptionAlgorithm; +} UA_UserNameIdentityToken; + +#define UA_TYPES_USERNAMEIDENTITYTOKEN 137 + +/** + * UnregisterNodesRequest + * ^^^^^^^^^^^^^^^^^^^^^^ + * Unregisters one or more previously registered nodes. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t nodesToUnregisterSize; + UA_NodeId *nodesToUnregister; +} UA_UnregisterNodesRequest; + +#define UA_TYPES_UNREGISTERNODESREQUEST 138 + +/** + * OpenSecureChannelResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + * Creates a secure channel with a server. */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_UInt32 serverProtocolVersion; + UA_ChannelSecurityToken securityToken; + UA_ByteString serverNonce; +} UA_OpenSecureChannelResponse; + +#define UA_TYPES_OPENSECURECHANNELRESPONSE 139 + +/** + * SetTriggeringResponse + * ^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t addResultsSize; + UA_StatusCode *addResults; + size_t addDiagnosticInfosSize; + UA_DiagnosticInfo *addDiagnosticInfos; + size_t removeResultsSize; + UA_StatusCode *removeResults; + size_t removeDiagnosticInfosSize; + UA_DiagnosticInfo *removeDiagnosticInfos; +} UA_SetTriggeringResponse; + +#define UA_TYPES_SETTRIGGERINGRESPONSE 140 + +/** + * SimpleAttributeOperand + * ^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_NodeId typeDefinitionId; + size_t browsePathSize; + UA_QualifiedName *browsePath; + UA_UInt32 attributeId; + UA_String indexRange; +} UA_SimpleAttributeOperand; + +#define UA_TYPES_SIMPLEATTRIBUTEOPERAND 141 + +/** + * RepublishRequest + * ^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_UInt32 retransmitSequenceNumber; +} UA_RepublishRequest; + +#define UA_TYPES_REPUBLISHREQUEST 142 + +/** + * RegisterNodesResponse + * ^^^^^^^^^^^^^^^^^^^^^ + * Registers one or more nodes for repeated use within a session. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t registeredNodeIdsSize; + UA_NodeId *registeredNodeIds; +} UA_RegisterNodesResponse; + +#define UA_TYPES_REGISTERNODESRESPONSE 143 + +/** + * ModifyMonitoredItemsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_MonitoredItemModifyResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_ModifyMonitoredItemsResponse; + +#define UA_TYPES_MODIFYMONITOREDITEMSRESPONSE 144 + +/** + * DeleteSubscriptionsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + size_t subscriptionIdsSize; + UA_UInt32 *subscriptionIds; +} UA_DeleteSubscriptionsRequest; + +#define UA_TYPES_DELETESUBSCRIPTIONSREQUEST 145 + +/** + * RedundancySupport + * ^^^^^^^^^^^^^^^^^ + */ +typedef enum { + UA_REDUNDANCYSUPPORT_NONE = 0, + UA_REDUNDANCYSUPPORT_COLD = 1, + UA_REDUNDANCYSUPPORT_WARM = 2, + UA_REDUNDANCYSUPPORT_HOT = 3, + UA_REDUNDANCYSUPPORT_TRANSPARENT = 4, + UA_REDUNDANCYSUPPORT_HOTANDMIRRORED = 5, + __UA_REDUNDANCYSUPPORT_FORCE32BIT = 0x7fffffff +} UA_RedundancySupport; +UA_STATIC_ASSERT(sizeof(UA_RedundancySupport) == sizeof(UA_Int32), enum_must_be_32bit); + +#define UA_TYPES_REDUNDANCYSUPPORT 146 + +/** + * BrowsePath + * ^^^^^^^^^^ + * A request to translate a path into a node id. */ +typedef struct { + UA_NodeId startingNode; + UA_RelativePath relativePath; +} UA_BrowsePath; + +#define UA_TYPES_BROWSEPATH 147 + +/** + * ObjectAttributes + * ^^^^^^^^^^^^^^^^ + * The attributes for an object node. */ +typedef struct { + UA_UInt32 specifiedAttributes; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + UA_UInt32 userWriteMask; + UA_Byte eventNotifier; +} UA_ObjectAttributes; + +#define UA_TYPES_OBJECTATTRIBUTES 148 + +/** + * PublishRequest + * ^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + size_t subscriptionAcknowledgementsSize; + UA_SubscriptionAcknowledgement *subscriptionAcknowledgements; +} UA_PublishRequest; + +#define UA_TYPES_PUBLISHREQUEST 149 + +/** + * FindServersRequest + * ^^^^^^^^^^^^^^^^^^ + * Finds the servers known to the discovery server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_String endpointUrl; + size_t localeIdsSize; + UA_String *localeIds; + size_t serverUrisSize; + UA_String *serverUris; +} UA_FindServersRequest; + +#define UA_TYPES_FINDSERVERSREQUEST 150 + +/** + * ReferenceDescription + * ^^^^^^^^^^^^^^^^^^^^ + * The description of a reference. */ +typedef struct { + UA_NodeId referenceTypeId; + UA_Boolean isForward; + UA_ExpandedNodeId nodeId; + UA_QualifiedName browseName; + UA_LocalizedText displayName; + UA_NodeClass nodeClass; + UA_ExpandedNodeId typeDefinition; +} UA_ReferenceDescription; + +#define UA_TYPES_REFERENCEDESCRIPTION 151 + +/** + * CreateSubscriptionRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_Double requestedPublishingInterval; + UA_UInt32 requestedLifetimeCount; + UA_UInt32 requestedMaxKeepAliveCount; + UA_UInt32 maxNotificationsPerPublish; + UA_Boolean publishingEnabled; + UA_Byte priority; +} UA_CreateSubscriptionRequest; + +#define UA_TYPES_CREATESUBSCRIPTIONREQUEST 152 + +/** + * CallResponse + * ^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_CallMethodResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_CallResponse; + +#define UA_TYPES_CALLRESPONSE 153 + +/** + * DeleteNodesResponse + * ^^^^^^^^^^^^^^^^^^^ + * Delete one or more nodes from the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_DeleteNodesResponse; + +#define UA_TYPES_DELETENODESRESPONSE 154 + +/** + * ModifyMonitoredItemsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_TimestampsToReturn timestampsToReturn; + size_t itemsToModifySize; + UA_MonitoredItemModifyRequest *itemsToModify; +} UA_ModifyMonitoredItemsRequest; + +#define UA_TYPES_MODIFYMONITOREDITEMSREQUEST 155 + +/** + * ServiceFault + * ^^^^^^^^^^^^ + * The response returned by all services when there is a service level error. */ +typedef struct { + UA_ResponseHeader responseHeader; +} UA_ServiceFault; + +#define UA_TYPES_SERVICEFAULT 156 + +/** + * PublishResponse + * ^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_UInt32 subscriptionId; + size_t availableSequenceNumbersSize; + UA_UInt32 *availableSequenceNumbers; + UA_Boolean moreNotifications; + UA_NotificationMessage notificationMessage; + size_t resultsSize; + UA_StatusCode *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_PublishResponse; + +#define UA_TYPES_PUBLISHRESPONSE 157 + +/** + * CreateMonitoredItemsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_TimestampsToReturn timestampsToReturn; + size_t itemsToCreateSize; + UA_MonitoredItemCreateRequest *itemsToCreate; +} UA_CreateMonitoredItemsRequest; + +#define UA_TYPES_CREATEMONITOREDITEMSREQUEST 158 + +/** + * OpenSecureChannelRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^ + * Creates a secure channel with a server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 clientProtocolVersion; + UA_SecurityTokenRequestType requestType; + UA_MessageSecurityMode securityMode; + UA_ByteString clientNonce; + UA_UInt32 requestedLifetime; +} UA_OpenSecureChannelRequest; + +#define UA_TYPES_OPENSECURECHANNELREQUEST 159 + +/** + * CloseSessionRequest + * ^^^^^^^^^^^^^^^^^^^ + * Closes a session with the server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_Boolean deleteSubscriptions; +} UA_CloseSessionRequest; + +#define UA_TYPES_CLOSESESSIONREQUEST 160 + +/** + * SetTriggeringRequest + * ^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_UInt32 subscriptionId; + UA_UInt32 triggeringItemId; + size_t linksToAddSize; + UA_UInt32 *linksToAdd; + size_t linksToRemoveSize; + UA_UInt32 *linksToRemove; +} UA_SetTriggeringRequest; + +#define UA_TYPES_SETTRIGGERINGREQUEST 161 + +/** + * BrowseResult + * ^^^^^^^^^^^^ + * The result of a browse operation. */ +typedef struct { + UA_StatusCode statusCode; + UA_ByteString continuationPoint; + size_t referencesSize; + UA_ReferenceDescription *references; +} UA_BrowseResult; + +#define UA_TYPES_BROWSERESULT 162 + +/** + * AddReferencesRequest + * ^^^^^^^^^^^^^^^^^^^^ + * Adds one or more references to the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t referencesToAddSize; + UA_AddReferencesItem *referencesToAdd; +} UA_AddReferencesRequest; + +#define UA_TYPES_ADDREFERENCESREQUEST 163 + +/** + * AddNodesItem + * ^^^^^^^^^^^^ + * A request to add a node to the server address space. */ +typedef struct { + UA_ExpandedNodeId parentNodeId; + UA_NodeId referenceTypeId; + UA_ExpandedNodeId requestedNewNodeId; + UA_QualifiedName browseName; + UA_NodeClass nodeClass; + UA_ExtensionObject nodeAttributes; + UA_ExpandedNodeId typeDefinition; +} UA_AddNodesItem; + +#define UA_TYPES_ADDNODESITEM 164 + +/** + * ServerStatusDataType + * ^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_DateTime startTime; + UA_DateTime currentTime; + UA_ServerState state; + UA_BuildInfo buildInfo; + UA_UInt32 secondsTillShutdown; + UA_LocalizedText shutdownReason; +} UA_ServerStatusDataType; + +#define UA_TYPES_SERVERSTATUSDATATYPE 165 + +/** + * BrowseNextResponse + * ^^^^^^^^^^^^^^^^^^ + * Continues one or more browse operations. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_BrowseResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_BrowseNextResponse; + +#define UA_TYPES_BROWSENEXTRESPONSE 166 + +/** + * AxisInformation + * ^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_EUInformation engineeringUnits; + UA_Range eURange; + UA_LocalizedText title; + UA_AxisScaleEnumeration axisScaleType; + size_t axisStepsSize; + UA_Double *axisSteps; +} UA_AxisInformation; + +#define UA_TYPES_AXISINFORMATION 167 + +/** + * ApplicationDescription + * ^^^^^^^^^^^^^^^^^^^^^^ + * Describes an application and how to find it. */ +typedef struct { + UA_String applicationUri; + UA_String productUri; + UA_LocalizedText applicationName; + UA_ApplicationType applicationType; + UA_String gatewayServerUri; + UA_String discoveryProfileUri; + size_t discoveryUrlsSize; + UA_String *discoveryUrls; +} UA_ApplicationDescription; + +#define UA_TYPES_APPLICATIONDESCRIPTION 168 + +/** + * ReadRequest + * ^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + UA_Double maxAge; + UA_TimestampsToReturn timestampsToReturn; + size_t nodesToReadSize; + UA_ReadValueId *nodesToRead; +} UA_ReadRequest; + +#define UA_TYPES_READREQUEST 169 + +/** + * ActivateSessionRequest + * ^^^^^^^^^^^^^^^^^^^^^^ + * Activates a session with the server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_SignatureData clientSignature; + size_t clientSoftwareCertificatesSize; + UA_SignedSoftwareCertificate *clientSoftwareCertificates; + size_t localeIdsSize; + UA_String *localeIds; + UA_ExtensionObject userIdentityToken; + UA_SignatureData userTokenSignature; +} UA_ActivateSessionRequest; + +#define UA_TYPES_ACTIVATESESSIONREQUEST 170 + +/** + * BrowsePathResult + * ^^^^^^^^^^^^^^^^ + * The result of a translate opearation. */ +typedef struct { + UA_StatusCode statusCode; + size_t targetsSize; + UA_BrowsePathTarget *targets; +} UA_BrowsePathResult; + +#define UA_TYPES_BROWSEPATHRESULT 171 + +/** + * AddNodesRequest + * ^^^^^^^^^^^^^^^ + * Adds one or more nodes to the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t nodesToAddSize; + UA_AddNodesItem *nodesToAdd; +} UA_AddNodesRequest; + +#define UA_TYPES_ADDNODESREQUEST 172 + +/** + * BrowseRequest + * ^^^^^^^^^^^^^ + * Browse the references for one or more nodes from the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_ViewDescription view; + UA_UInt32 requestedMaxReferencesPerNode; + size_t nodesToBrowseSize; + UA_BrowseDescription *nodesToBrowse; +} UA_BrowseRequest; + +#define UA_TYPES_BROWSEREQUEST 173 + +/** + * WriteRequest + * ^^^^^^^^^^^^ + */ +typedef struct { + UA_RequestHeader requestHeader; + size_t nodesToWriteSize; + UA_WriteValue *nodesToWrite; +} UA_WriteRequest; + +#define UA_TYPES_WRITEREQUEST 174 + +/** + * AddNodesResponse + * ^^^^^^^^^^^^^^^^ + * Adds one or more nodes to the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_AddNodesResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_AddNodesResponse; + +#define UA_TYPES_ADDNODESRESPONSE 175 + +/** + * AttributeOperand + * ^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_NodeId nodeId; + UA_String alias; + UA_RelativePath browsePath; + UA_UInt32 attributeId; + UA_String indexRange; +} UA_AttributeOperand; + +#define UA_TYPES_ATTRIBUTEOPERAND 176 + +/** + * DataChangeFilter + * ^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_DataChangeTrigger trigger; + UA_UInt32 deadbandType; + UA_Double deadbandValue; +} UA_DataChangeFilter; + +#define UA_TYPES_DATACHANGEFILTER 177 + +/** + * EndpointDescription + * ^^^^^^^^^^^^^^^^^^^ + * The description of a endpoint that can be used to access a server. */ +typedef struct { + UA_String endpointUrl; + UA_ApplicationDescription server; + UA_ByteString serverCertificate; + UA_MessageSecurityMode securityMode; + UA_String securityPolicyUri; + size_t userIdentityTokensSize; + UA_UserTokenPolicy *userIdentityTokens; + UA_String transportProfileUri; + UA_Byte securityLevel; +} UA_EndpointDescription; + +#define UA_TYPES_ENDPOINTDESCRIPTION 178 + +/** + * DeleteReferencesRequest + * ^^^^^^^^^^^^^^^^^^^^^^^ + * Delete one or more references from the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t referencesToDeleteSize; + UA_DeleteReferencesItem *referencesToDelete; +} UA_DeleteReferencesRequest; + +#define UA_TYPES_DELETEREFERENCESREQUEST 179 + +/** + * TranslateBrowsePathsToNodeIdsRequest + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Translates one or more paths in the server address space. */ +typedef struct { + UA_RequestHeader requestHeader; + size_t browsePathsSize; + UA_BrowsePath *browsePaths; +} UA_TranslateBrowsePathsToNodeIdsRequest; + +#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST 180 + +/** + * FindServersResponse + * ^^^^^^^^^^^^^^^^^^^ + * Finds the servers known to the discovery server. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t serversSize; + UA_ApplicationDescription *servers; +} UA_FindServersResponse; + +#define UA_TYPES_FINDSERVERSRESPONSE 181 + +/** + * CreateSessionRequest + * ^^^^^^^^^^^^^^^^^^^^ + * Creates a new session with the server. */ +typedef struct { + UA_RequestHeader requestHeader; + UA_ApplicationDescription clientDescription; + UA_String serverUri; + UA_String endpointUrl; + UA_String sessionName; + UA_ByteString clientNonce; + UA_ByteString clientCertificate; + UA_Double requestedSessionTimeout; + UA_UInt32 maxResponseMessageSize; +} UA_CreateSessionRequest; + +#define UA_TYPES_CREATESESSIONREQUEST 182 + +/** + * ContentFilterElement + * ^^^^^^^^^^^^^^^^^^^^ + */ +typedef struct { + UA_FilterOperator filterOperator; + size_t filterOperandsSize; + UA_ExtensionObject *filterOperands; +} UA_ContentFilterElement; + +#define UA_TYPES_CONTENTFILTERELEMENT 183 + +/** + * TranslateBrowsePathsToNodeIdsResponse + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * Translates one or more paths in the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_BrowsePathResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_TranslateBrowsePathsToNodeIdsResponse; + +#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE 184 + +/** + * BrowseResponse + * ^^^^^^^^^^^^^^ + * Browse the references for one or more nodes from the server address space. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t resultsSize; + UA_BrowseResult *results; + size_t diagnosticInfosSize; + UA_DiagnosticInfo *diagnosticInfos; +} UA_BrowseResponse; + +#define UA_TYPES_BROWSERESPONSE 185 + +/** + * CreateSessionResponse + * ^^^^^^^^^^^^^^^^^^^^^ + * Creates a new session with the server. */ +typedef struct { + UA_ResponseHeader responseHeader; + UA_NodeId sessionId; + UA_NodeId authenticationToken; + UA_Double revisedSessionTimeout; + UA_ByteString serverNonce; + UA_ByteString serverCertificate; + size_t serverEndpointsSize; + UA_EndpointDescription *serverEndpoints; + size_t serverSoftwareCertificatesSize; + UA_SignedSoftwareCertificate *serverSoftwareCertificates; + UA_SignatureData serverSignature; + UA_UInt32 maxRequestMessageSize; +} UA_CreateSessionResponse; + +#define UA_TYPES_CREATESESSIONRESPONSE 186 + +/** + * ContentFilter + * ^^^^^^^^^^^^^ + */ +typedef struct { + size_t elementsSize; + UA_ContentFilterElement *elements; +} UA_ContentFilter; + +#define UA_TYPES_CONTENTFILTER 187 + +/** + * GetEndpointsResponse + * ^^^^^^^^^^^^^^^^^^^^ + * Gets the endpoints used by the server. */ +typedef struct { + UA_ResponseHeader responseHeader; + size_t endpointsSize; + UA_EndpointDescription *endpoints; +} UA_GetEndpointsResponse; + +#define UA_TYPES_GETENDPOINTSRESPONSE 188 + +/** + * EventFilter + * ^^^^^^^^^^^ + */ +typedef struct { + size_t selectClausesSize; + UA_SimpleAttributeOperand *selectClauses; + UA_ContentFilter whereClause; +} UA_EventFilter; + +#define UA_TYPES_EVENTFILTER 189 + + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/build/src_generated/open62541/types_generated_handling.h" ***********************************/ + +/* Generated from Opc.Ua.Types.bsd with script /home/rosselliot/sandbox/open62541/tools/generate_datatypes.py + * on host ci0011853 by user rosselliot at 2021-03-15 09:02:02 */ + + + +_UA_BEGIN_DECLS + +#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + + +/* Boolean */ +static UA_INLINE void +UA_Boolean_init(UA_Boolean *p) { + memset(p, 0, sizeof(UA_Boolean)); +} + +static UA_INLINE UA_Boolean * +UA_Boolean_new(void) { + return (UA_Boolean*)UA_new(&UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Boolean_copy(const UA_Boolean *src, UA_Boolean *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Boolean_deleteMembers(UA_Boolean *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE void +UA_Boolean_clear(UA_Boolean *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE void +UA_Boolean_delete(UA_Boolean *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +/* SByte */ +static UA_INLINE void +UA_SByte_init(UA_SByte *p) { + memset(p, 0, sizeof(UA_SByte)); +} + +static UA_INLINE UA_SByte * +UA_SByte_new(void) { + return (UA_SByte*)UA_new(&UA_TYPES[UA_TYPES_SBYTE]); +} + +static UA_INLINE UA_StatusCode +UA_SByte_copy(const UA_SByte *src, UA_SByte *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SBYTE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SByte_deleteMembers(UA_SByte *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SBYTE]); +} + +static UA_INLINE void +UA_SByte_clear(UA_SByte *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SBYTE]); +} + +static UA_INLINE void +UA_SByte_delete(UA_SByte *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SBYTE]); +} + +/* Byte */ +static UA_INLINE void +UA_Byte_init(UA_Byte *p) { + memset(p, 0, sizeof(UA_Byte)); +} + +static UA_INLINE UA_Byte * +UA_Byte_new(void) { + return (UA_Byte*)UA_new(&UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Byte_copy(const UA_Byte *src, UA_Byte *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BYTE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Byte_deleteMembers(UA_Byte *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE void +UA_Byte_clear(UA_Byte *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE void +UA_Byte_delete(UA_Byte *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BYTE]); +} + +/* Int16 */ +static UA_INLINE void +UA_Int16_init(UA_Int16 *p) { + memset(p, 0, sizeof(UA_Int16)); +} + +static UA_INLINE UA_Int16 * +UA_Int16_new(void) { + return (UA_Int16*)UA_new(&UA_TYPES[UA_TYPES_INT16]); +} + +static UA_INLINE UA_StatusCode +UA_Int16_copy(const UA_Int16 *src, UA_Int16 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_INT16]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Int16_deleteMembers(UA_Int16 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT16]); +} + +static UA_INLINE void +UA_Int16_clear(UA_Int16 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT16]); +} + +static UA_INLINE void +UA_Int16_delete(UA_Int16 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_INT16]); +} + +/* UInt16 */ +static UA_INLINE void +UA_UInt16_init(UA_UInt16 *p) { + memset(p, 0, sizeof(UA_UInt16)); +} + +static UA_INLINE UA_UInt16 * +UA_UInt16_new(void) { + return (UA_UInt16*)UA_new(&UA_TYPES[UA_TYPES_UINT16]); +} + +static UA_INLINE UA_StatusCode +UA_UInt16_copy(const UA_UInt16 *src, UA_UInt16 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UINT16]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UInt16_deleteMembers(UA_UInt16 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT16]); +} + +static UA_INLINE void +UA_UInt16_clear(UA_UInt16 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT16]); +} + +static UA_INLINE void +UA_UInt16_delete(UA_UInt16 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UINT16]); +} + +/* Int32 */ +static UA_INLINE void +UA_Int32_init(UA_Int32 *p) { + memset(p, 0, sizeof(UA_Int32)); +} + +static UA_INLINE UA_Int32 * +UA_Int32_new(void) { + return (UA_Int32*)UA_new(&UA_TYPES[UA_TYPES_INT32]); +} + +static UA_INLINE UA_StatusCode +UA_Int32_copy(const UA_Int32 *src, UA_Int32 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_INT32]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Int32_deleteMembers(UA_Int32 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT32]); +} + +static UA_INLINE void +UA_Int32_clear(UA_Int32 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT32]); +} + +static UA_INLINE void +UA_Int32_delete(UA_Int32 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_INT32]); +} + +/* UInt32 */ +static UA_INLINE void +UA_UInt32_init(UA_UInt32 *p) { + memset(p, 0, sizeof(UA_UInt32)); +} + +static UA_INLINE UA_UInt32 * +UA_UInt32_new(void) { + return (UA_UInt32*)UA_new(&UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE UA_StatusCode +UA_UInt32_copy(const UA_UInt32 *src, UA_UInt32 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UINT32]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UInt32_deleteMembers(UA_UInt32 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE void +UA_UInt32_clear(UA_UInt32 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE void +UA_UInt32_delete(UA_UInt32 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UINT32]); +} + +/* Int64 */ +static UA_INLINE void +UA_Int64_init(UA_Int64 *p) { + memset(p, 0, sizeof(UA_Int64)); +} + +static UA_INLINE UA_Int64 * +UA_Int64_new(void) { + return (UA_Int64*)UA_new(&UA_TYPES[UA_TYPES_INT64]); +} + +static UA_INLINE UA_StatusCode +UA_Int64_copy(const UA_Int64 *src, UA_Int64 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_INT64]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Int64_deleteMembers(UA_Int64 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT64]); +} + +static UA_INLINE void +UA_Int64_clear(UA_Int64 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_INT64]); +} + +static UA_INLINE void +UA_Int64_delete(UA_Int64 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_INT64]); +} + +/* UInt64 */ +static UA_INLINE void +UA_UInt64_init(UA_UInt64 *p) { + memset(p, 0, sizeof(UA_UInt64)); +} + +static UA_INLINE UA_UInt64 * +UA_UInt64_new(void) { + return (UA_UInt64*)UA_new(&UA_TYPES[UA_TYPES_UINT64]); +} + +static UA_INLINE UA_StatusCode +UA_UInt64_copy(const UA_UInt64 *src, UA_UInt64 *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UINT64]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UInt64_deleteMembers(UA_UInt64 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT64]); +} + +static UA_INLINE void +UA_UInt64_clear(UA_UInt64 *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UINT64]); +} + +static UA_INLINE void +UA_UInt64_delete(UA_UInt64 *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UINT64]); +} + +/* Float */ +static UA_INLINE void +UA_Float_init(UA_Float *p) { + memset(p, 0, sizeof(UA_Float)); +} + +static UA_INLINE UA_Float * +UA_Float_new(void) { + return (UA_Float*)UA_new(&UA_TYPES[UA_TYPES_FLOAT]); +} + +static UA_INLINE UA_StatusCode +UA_Float_copy(const UA_Float *src, UA_Float *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_FLOAT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Float_deleteMembers(UA_Float *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FLOAT]); +} + +static UA_INLINE void +UA_Float_clear(UA_Float *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FLOAT]); +} + +static UA_INLINE void +UA_Float_delete(UA_Float *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_FLOAT]); +} + +/* Double */ +static UA_INLINE void +UA_Double_init(UA_Double *p) { + memset(p, 0, sizeof(UA_Double)); +} + +static UA_INLINE UA_Double * +UA_Double_new(void) { + return (UA_Double*)UA_new(&UA_TYPES[UA_TYPES_DOUBLE]); +} + +static UA_INLINE UA_StatusCode +UA_Double_copy(const UA_Double *src, UA_Double *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DOUBLE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Double_deleteMembers(UA_Double *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DOUBLE]); +} + +static UA_INLINE void +UA_Double_clear(UA_Double *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DOUBLE]); +} + +static UA_INLINE void +UA_Double_delete(UA_Double *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DOUBLE]); +} + +/* String */ +static UA_INLINE void +UA_String_init(UA_String *p) { + memset(p, 0, sizeof(UA_String)); +} + +static UA_INLINE UA_String * +UA_String_new(void) { + return (UA_String*)UA_new(&UA_TYPES[UA_TYPES_STRING]); +} + +static UA_INLINE UA_StatusCode +UA_String_copy(const UA_String *src, UA_String *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STRING]); +} + +UA_DEPRECATED static UA_INLINE void +UA_String_deleteMembers(UA_String *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRING]); +} + +static UA_INLINE void +UA_String_clear(UA_String *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRING]); +} + +static UA_INLINE void +UA_String_delete(UA_String *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STRING]); +} + +/* DateTime */ +static UA_INLINE void +UA_DateTime_init(UA_DateTime *p) { + memset(p, 0, sizeof(UA_DateTime)); +} + +static UA_INLINE UA_DateTime * +UA_DateTime_new(void) { + return (UA_DateTime*)UA_new(&UA_TYPES[UA_TYPES_DATETIME]); +} + +static UA_INLINE UA_StatusCode +UA_DateTime_copy(const UA_DateTime *src, UA_DateTime *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATETIME]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DateTime_deleteMembers(UA_DateTime *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATETIME]); +} + +static UA_INLINE void +UA_DateTime_clear(UA_DateTime *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATETIME]); +} + +static UA_INLINE void +UA_DateTime_delete(UA_DateTime *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATETIME]); +} + +/* Guid */ +static UA_INLINE void +UA_Guid_init(UA_Guid *p) { + memset(p, 0, sizeof(UA_Guid)); +} + +static UA_INLINE UA_Guid * +UA_Guid_new(void) { + return (UA_Guid*)UA_new(&UA_TYPES[UA_TYPES_GUID]); +} + +static UA_INLINE UA_StatusCode +UA_Guid_copy(const UA_Guid *src, UA_Guid *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_GUID]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Guid_deleteMembers(UA_Guid *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GUID]); +} + +static UA_INLINE void +UA_Guid_clear(UA_Guid *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GUID]); +} + +static UA_INLINE void +UA_Guid_delete(UA_Guid *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_GUID]); +} + +/* ByteString */ +static UA_INLINE void +UA_ByteString_init(UA_ByteString *p) { + memset(p, 0, sizeof(UA_ByteString)); +} + +static UA_INLINE UA_ByteString * +UA_ByteString_new(void) { + return (UA_ByteString*)UA_new(&UA_TYPES[UA_TYPES_BYTESTRING]); +} + +static UA_INLINE UA_StatusCode +UA_ByteString_copy(const UA_ByteString *src, UA_ByteString *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BYTESTRING]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ByteString_deleteMembers(UA_ByteString *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BYTESTRING]); +} + +static UA_INLINE void +UA_ByteString_clear(UA_ByteString *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BYTESTRING]); +} + +static UA_INLINE void +UA_ByteString_delete(UA_ByteString *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BYTESTRING]); +} + +/* XmlElement */ +static UA_INLINE void +UA_XmlElement_init(UA_XmlElement *p) { + memset(p, 0, sizeof(UA_XmlElement)); +} + +static UA_INLINE UA_XmlElement * +UA_XmlElement_new(void) { + return (UA_XmlElement*)UA_new(&UA_TYPES[UA_TYPES_XMLELEMENT]); +} + +static UA_INLINE UA_StatusCode +UA_XmlElement_copy(const UA_XmlElement *src, UA_XmlElement *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_XMLELEMENT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_XmlElement_deleteMembers(UA_XmlElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_XMLELEMENT]); +} + +static UA_INLINE void +UA_XmlElement_clear(UA_XmlElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_XMLELEMENT]); +} + +static UA_INLINE void +UA_XmlElement_delete(UA_XmlElement *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_XMLELEMENT]); +} + +/* NodeId */ +static UA_INLINE void +UA_NodeId_init(UA_NodeId *p) { + memset(p, 0, sizeof(UA_NodeId)); +} + +static UA_INLINE UA_NodeId * +UA_NodeId_new(void) { + return (UA_NodeId*)UA_new(&UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE UA_StatusCode +UA_NodeId_copy(const UA_NodeId *src, UA_NodeId *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_NODEID]); +} + +UA_DEPRECATED static UA_INLINE void +UA_NodeId_deleteMembers(UA_NodeId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE void +UA_NodeId_clear(UA_NodeId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE void +UA_NodeId_delete(UA_NodeId *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_NODEID]); +} + +/* ExpandedNodeId */ +static UA_INLINE void +UA_ExpandedNodeId_init(UA_ExpandedNodeId *p) { + memset(p, 0, sizeof(UA_ExpandedNodeId)); +} + +static UA_INLINE UA_ExpandedNodeId * +UA_ExpandedNodeId_new(void) { + return (UA_ExpandedNodeId*)UA_new(&UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} + +static UA_INLINE UA_StatusCode +UA_ExpandedNodeId_copy(const UA_ExpandedNodeId *src, UA_ExpandedNodeId *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ExpandedNodeId_deleteMembers(UA_ExpandedNodeId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} + +static UA_INLINE void +UA_ExpandedNodeId_clear(UA_ExpandedNodeId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} + +static UA_INLINE void +UA_ExpandedNodeId_delete(UA_ExpandedNodeId *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EXPANDEDNODEID]); +} + +/* StatusCode */ +static UA_INLINE void +UA_StatusCode_init(UA_StatusCode *p) { + memset(p, 0, sizeof(UA_StatusCode)); +} + +static UA_INLINE UA_StatusCode * +UA_StatusCode_new(void) { + return (UA_StatusCode*)UA_new(&UA_TYPES[UA_TYPES_STATUSCODE]); +} + +static UA_INLINE UA_StatusCode +UA_StatusCode_copy(const UA_StatusCode *src, UA_StatusCode *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_StatusCode_deleteMembers(UA_StatusCode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +static UA_INLINE void +UA_StatusCode_clear(UA_StatusCode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +static UA_INLINE void +UA_StatusCode_delete(UA_StatusCode *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STATUSCODE]); +} + +/* QualifiedName */ +static UA_INLINE void +UA_QualifiedName_init(UA_QualifiedName *p) { + memset(p, 0, sizeof(UA_QualifiedName)); +} + +static UA_INLINE UA_QualifiedName * +UA_QualifiedName_new(void) { + return (UA_QualifiedName*)UA_new(&UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +static UA_INLINE UA_StatusCode +UA_QualifiedName_copy(const UA_QualifiedName *src, UA_QualifiedName *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +UA_DEPRECATED static UA_INLINE void +UA_QualifiedName_deleteMembers(UA_QualifiedName *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +static UA_INLINE void +UA_QualifiedName_clear(UA_QualifiedName *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +static UA_INLINE void +UA_QualifiedName_delete(UA_QualifiedName *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +/* LocalizedText */ +static UA_INLINE void +UA_LocalizedText_init(UA_LocalizedText *p) { + memset(p, 0, sizeof(UA_LocalizedText)); +} + +static UA_INLINE UA_LocalizedText * +UA_LocalizedText_new(void) { + return (UA_LocalizedText*)UA_new(&UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_LocalizedText_copy(const UA_LocalizedText *src, UA_LocalizedText *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_LocalizedText_deleteMembers(UA_LocalizedText *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE void +UA_LocalizedText_clear(UA_LocalizedText *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE void +UA_LocalizedText_delete(UA_LocalizedText *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +/* ExtensionObject */ +static UA_INLINE void +UA_ExtensionObject_init(UA_ExtensionObject *p) { + memset(p, 0, sizeof(UA_ExtensionObject)); +} + +static UA_INLINE UA_ExtensionObject * +UA_ExtensionObject_new(void) { + return (UA_ExtensionObject*)UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} + +static UA_INLINE UA_StatusCode +UA_ExtensionObject_copy(const UA_ExtensionObject *src, UA_ExtensionObject *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ExtensionObject_deleteMembers(UA_ExtensionObject *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} + +static UA_INLINE void +UA_ExtensionObject_clear(UA_ExtensionObject *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} + +static UA_INLINE void +UA_ExtensionObject_delete(UA_ExtensionObject *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]); +} + +/* DataValue */ +static UA_INLINE void +UA_DataValue_init(UA_DataValue *p) { + memset(p, 0, sizeof(UA_DataValue)); +} + +static UA_INLINE UA_DataValue * +UA_DataValue_new(void) { + return (UA_DataValue*)UA_new(&UA_TYPES[UA_TYPES_DATAVALUE]); +} + +static UA_INLINE UA_StatusCode +UA_DataValue_copy(const UA_DataValue *src, UA_DataValue *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATAVALUE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DataValue_deleteMembers(UA_DataValue *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATAVALUE]); +} + +static UA_INLINE void +UA_DataValue_clear(UA_DataValue *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATAVALUE]); +} + +static UA_INLINE void +UA_DataValue_delete(UA_DataValue *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATAVALUE]); +} + +/* Variant */ +static UA_INLINE void +UA_Variant_init(UA_Variant *p) { + memset(p, 0, sizeof(UA_Variant)); +} + +static UA_INLINE UA_Variant * +UA_Variant_new(void) { + return (UA_Variant*)UA_new(&UA_TYPES[UA_TYPES_VARIANT]); +} + +static UA_INLINE UA_StatusCode +UA_Variant_copy(const UA_Variant *src, UA_Variant *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_VARIANT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Variant_deleteMembers(UA_Variant *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIANT]); +} + +static UA_INLINE void +UA_Variant_clear(UA_Variant *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIANT]); +} + +static UA_INLINE void +UA_Variant_delete(UA_Variant *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_VARIANT]); +} + +/* DiagnosticInfo */ +static UA_INLINE void +UA_DiagnosticInfo_init(UA_DiagnosticInfo *p) { + memset(p, 0, sizeof(UA_DiagnosticInfo)); +} + +static UA_INLINE UA_DiagnosticInfo * +UA_DiagnosticInfo_new(void) { + return (UA_DiagnosticInfo*)UA_new(&UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} + +static UA_INLINE UA_StatusCode +UA_DiagnosticInfo_copy(const UA_DiagnosticInfo *src, UA_DiagnosticInfo *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DiagnosticInfo_deleteMembers(UA_DiagnosticInfo *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} + +static UA_INLINE void +UA_DiagnosticInfo_clear(UA_DiagnosticInfo *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} + +static UA_INLINE void +UA_DiagnosticInfo_delete(UA_DiagnosticInfo *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]); +} + +/* ViewAttributes */ +static UA_INLINE void +UA_ViewAttributes_init(UA_ViewAttributes *p) { + memset(p, 0, sizeof(UA_ViewAttributes)); +} + +static UA_INLINE UA_ViewAttributes * +UA_ViewAttributes_new(void) { + return (UA_ViewAttributes*)UA_new(&UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_ViewAttributes_copy(const UA_ViewAttributes *src, UA_ViewAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ViewAttributes_deleteMembers(UA_ViewAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} + +static UA_INLINE void +UA_ViewAttributes_clear(UA_ViewAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} + +static UA_INLINE void +UA_ViewAttributes_delete(UA_ViewAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES]); +} + +/* XVType */ +static UA_INLINE void +UA_XVType_init(UA_XVType *p) { + memset(p, 0, sizeof(UA_XVType)); +} + +static UA_INLINE UA_XVType * +UA_XVType_new(void) { + return (UA_XVType*)UA_new(&UA_TYPES[UA_TYPES_XVTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_XVType_copy(const UA_XVType *src, UA_XVType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_XVTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_XVType_deleteMembers(UA_XVType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_XVTYPE]); +} + +static UA_INLINE void +UA_XVType_clear(UA_XVType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_XVTYPE]); +} + +static UA_INLINE void +UA_XVType_delete(UA_XVType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_XVTYPE]); +} + +/* ElementOperand */ +static UA_INLINE void +UA_ElementOperand_init(UA_ElementOperand *p) { + memset(p, 0, sizeof(UA_ElementOperand)); +} + +static UA_INLINE UA_ElementOperand * +UA_ElementOperand_new(void) { + return (UA_ElementOperand*)UA_new(&UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} + +static UA_INLINE UA_StatusCode +UA_ElementOperand_copy(const UA_ElementOperand *src, UA_ElementOperand *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ElementOperand_deleteMembers(UA_ElementOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} + +static UA_INLINE void +UA_ElementOperand_clear(UA_ElementOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} + +static UA_INLINE void +UA_ElementOperand_delete(UA_ElementOperand *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ELEMENTOPERAND]); +} + +/* VariableAttributes */ +static UA_INLINE void +UA_VariableAttributes_init(UA_VariableAttributes *p) { + memset(p, 0, sizeof(UA_VariableAttributes)); +} + +static UA_INLINE UA_VariableAttributes * +UA_VariableAttributes_new(void) { + return (UA_VariableAttributes*)UA_new(&UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_VariableAttributes_copy(const UA_VariableAttributes *src, UA_VariableAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_VariableAttributes_deleteMembers(UA_VariableAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} + +static UA_INLINE void +UA_VariableAttributes_clear(UA_VariableAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} + +static UA_INLINE void +UA_VariableAttributes_delete(UA_VariableAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES]); +} + +/* EnumValueType */ +static UA_INLINE void +UA_EnumValueType_init(UA_EnumValueType *p) { + memset(p, 0, sizeof(UA_EnumValueType)); +} + +static UA_INLINE UA_EnumValueType * +UA_EnumValueType_new(void) { + return (UA_EnumValueType*)UA_new(&UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} + +static UA_INLINE UA_StatusCode +UA_EnumValueType_copy(const UA_EnumValueType *src, UA_EnumValueType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EnumValueType_deleteMembers(UA_EnumValueType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} + +static UA_INLINE void +UA_EnumValueType_clear(UA_EnumValueType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} + +static UA_INLINE void +UA_EnumValueType_delete(UA_EnumValueType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ENUMVALUETYPE]); +} + +/* EventFieldList */ +static UA_INLINE void +UA_EventFieldList_init(UA_EventFieldList *p) { + memset(p, 0, sizeof(UA_EventFieldList)); +} + +static UA_INLINE UA_EventFieldList * +UA_EventFieldList_new(void) { + return (UA_EventFieldList*)UA_new(&UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} + +static UA_INLINE UA_StatusCode +UA_EventFieldList_copy(const UA_EventFieldList *src, UA_EventFieldList *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EventFieldList_deleteMembers(UA_EventFieldList *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} + +static UA_INLINE void +UA_EventFieldList_clear(UA_EventFieldList *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} + +static UA_INLINE void +UA_EventFieldList_delete(UA_EventFieldList *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EVENTFIELDLIST]); +} + +/* MonitoredItemCreateResult */ +static UA_INLINE void +UA_MonitoredItemCreateResult_init(UA_MonitoredItemCreateResult *p) { + memset(p, 0, sizeof(UA_MonitoredItemCreateResult)); +} + +static UA_INLINE UA_MonitoredItemCreateResult * +UA_MonitoredItemCreateResult_new(void) { + return (UA_MonitoredItemCreateResult*)UA_new(&UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateResult_copy(const UA_MonitoredItemCreateResult *src, UA_MonitoredItemCreateResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoredItemCreateResult_deleteMembers(UA_MonitoredItemCreateResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +static UA_INLINE void +UA_MonitoredItemCreateResult_clear(UA_MonitoredItemCreateResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +static UA_INLINE void +UA_MonitoredItemCreateResult_delete(UA_MonitoredItemCreateResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]); +} + +/* EUInformation */ +static UA_INLINE void +UA_EUInformation_init(UA_EUInformation *p) { + memset(p, 0, sizeof(UA_EUInformation)); +} + +static UA_INLINE UA_EUInformation * +UA_EUInformation_new(void) { + return (UA_EUInformation*)UA_new(&UA_TYPES[UA_TYPES_EUINFORMATION]); +} + +static UA_INLINE UA_StatusCode +UA_EUInformation_copy(const UA_EUInformation *src, UA_EUInformation *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EUINFORMATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EUInformation_deleteMembers(UA_EUInformation *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EUINFORMATION]); +} + +static UA_INLINE void +UA_EUInformation_clear(UA_EUInformation *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EUINFORMATION]); +} + +static UA_INLINE void +UA_EUInformation_delete(UA_EUInformation *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EUINFORMATION]); +} + +/* ServerDiagnosticsSummaryDataType */ +static UA_INLINE void +UA_ServerDiagnosticsSummaryDataType_init(UA_ServerDiagnosticsSummaryDataType *p) { + memset(p, 0, sizeof(UA_ServerDiagnosticsSummaryDataType)); +} + +static UA_INLINE UA_ServerDiagnosticsSummaryDataType * +UA_ServerDiagnosticsSummaryDataType_new(void) { + return (UA_ServerDiagnosticsSummaryDataType*)UA_new(&UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} + +static UA_INLINE UA_StatusCode +UA_ServerDiagnosticsSummaryDataType_copy(const UA_ServerDiagnosticsSummaryDataType *src, UA_ServerDiagnosticsSummaryDataType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ServerDiagnosticsSummaryDataType_deleteMembers(UA_ServerDiagnosticsSummaryDataType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} + +static UA_INLINE void +UA_ServerDiagnosticsSummaryDataType_clear(UA_ServerDiagnosticsSummaryDataType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} + +static UA_INLINE void +UA_ServerDiagnosticsSummaryDataType_delete(UA_ServerDiagnosticsSummaryDataType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SERVERDIAGNOSTICSSUMMARYDATATYPE]); +} + +/* ContentFilterElementResult */ +static UA_INLINE void +UA_ContentFilterElementResult_init(UA_ContentFilterElementResult *p) { + memset(p, 0, sizeof(UA_ContentFilterElementResult)); +} + +static UA_INLINE UA_ContentFilterElementResult * +UA_ContentFilterElementResult_new(void) { + return (UA_ContentFilterElementResult*)UA_new(&UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_ContentFilterElementResult_copy(const UA_ContentFilterElementResult *src, UA_ContentFilterElementResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ContentFilterElementResult_deleteMembers(UA_ContentFilterElementResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} + +static UA_INLINE void +UA_ContentFilterElementResult_clear(UA_ContentFilterElementResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} + +static UA_INLINE void +UA_ContentFilterElementResult_delete(UA_ContentFilterElementResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENTRESULT]); +} + +/* LiteralOperand */ +static UA_INLINE void +UA_LiteralOperand_init(UA_LiteralOperand *p) { + memset(p, 0, sizeof(UA_LiteralOperand)); +} + +static UA_INLINE UA_LiteralOperand * +UA_LiteralOperand_new(void) { + return (UA_LiteralOperand*)UA_new(&UA_TYPES[UA_TYPES_LITERALOPERAND]); +} + +static UA_INLINE UA_StatusCode +UA_LiteralOperand_copy(const UA_LiteralOperand *src, UA_LiteralOperand *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_LITERALOPERAND]); +} + +UA_DEPRECATED static UA_INLINE void +UA_LiteralOperand_deleteMembers(UA_LiteralOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LITERALOPERAND]); +} + +static UA_INLINE void +UA_LiteralOperand_clear(UA_LiteralOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LITERALOPERAND]); +} + +static UA_INLINE void +UA_LiteralOperand_delete(UA_LiteralOperand *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_LITERALOPERAND]); +} + +/* MessageSecurityMode */ +static UA_INLINE void +UA_MessageSecurityMode_init(UA_MessageSecurityMode *p) { + memset(p, 0, sizeof(UA_MessageSecurityMode)); +} + +static UA_INLINE UA_MessageSecurityMode * +UA_MessageSecurityMode_new(void) { + return (UA_MessageSecurityMode*)UA_new(&UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} + +static UA_INLINE UA_StatusCode +UA_MessageSecurityMode_copy(const UA_MessageSecurityMode *src, UA_MessageSecurityMode *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MessageSecurityMode_deleteMembers(UA_MessageSecurityMode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} + +static UA_INLINE void +UA_MessageSecurityMode_clear(UA_MessageSecurityMode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} + +static UA_INLINE void +UA_MessageSecurityMode_delete(UA_MessageSecurityMode *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MESSAGESECURITYMODE]); +} + +/* UtcTime */ +static UA_INLINE void +UA_UtcTime_init(UA_UtcTime *p) { + memset(p, 0, sizeof(UA_UtcTime)); +} + +static UA_INLINE UA_UtcTime * +UA_UtcTime_new(void) { + return (UA_UtcTime*)UA_new(&UA_TYPES[UA_TYPES_UTCTIME]); +} + +static UA_INLINE UA_StatusCode +UA_UtcTime_copy(const UA_UtcTime *src, UA_UtcTime *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UTCTIME]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UtcTime_deleteMembers(UA_UtcTime *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UTCTIME]); +} + +static UA_INLINE void +UA_UtcTime_clear(UA_UtcTime *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UTCTIME]); +} + +static UA_INLINE void +UA_UtcTime_delete(UA_UtcTime *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UTCTIME]); +} + +/* UserIdentityToken */ +static UA_INLINE void +UA_UserIdentityToken_init(UA_UserIdentityToken *p) { + memset(p, 0, sizeof(UA_UserIdentityToken)); +} + +static UA_INLINE UA_UserIdentityToken * +UA_UserIdentityToken_new(void) { + return (UA_UserIdentityToken*)UA_new(&UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_UserIdentityToken_copy(const UA_UserIdentityToken *src, UA_UserIdentityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UserIdentityToken_deleteMembers(UA_UserIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_UserIdentityToken_clear(UA_UserIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_UserIdentityToken_delete(UA_UserIdentityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_USERIDENTITYTOKEN]); +} + +/* X509IdentityToken */ +static UA_INLINE void +UA_X509IdentityToken_init(UA_X509IdentityToken *p) { + memset(p, 0, sizeof(UA_X509IdentityToken)); +} + +static UA_INLINE UA_X509IdentityToken * +UA_X509IdentityToken_new(void) { + return (UA_X509IdentityToken*)UA_new(&UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_X509IdentityToken_copy(const UA_X509IdentityToken *src, UA_X509IdentityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_X509IdentityToken_deleteMembers(UA_X509IdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} + +static UA_INLINE void +UA_X509IdentityToken_clear(UA_X509IdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} + +static UA_INLINE void +UA_X509IdentityToken_delete(UA_X509IdentityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_X509IDENTITYTOKEN]); +} + +/* MonitoredItemNotification */ +static UA_INLINE void +UA_MonitoredItemNotification_init(UA_MonitoredItemNotification *p) { + memset(p, 0, sizeof(UA_MonitoredItemNotification)); +} + +static UA_INLINE UA_MonitoredItemNotification * +UA_MonitoredItemNotification_new(void) { + return (UA_MonitoredItemNotification*)UA_new(&UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoredItemNotification_copy(const UA_MonitoredItemNotification *src, UA_MonitoredItemNotification *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoredItemNotification_deleteMembers(UA_MonitoredItemNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} + +static UA_INLINE void +UA_MonitoredItemNotification_clear(UA_MonitoredItemNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} + +static UA_INLINE void +UA_MonitoredItemNotification_delete(UA_MonitoredItemNotification *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITOREDITEMNOTIFICATION]); +} + +/* StructureType */ +static UA_INLINE void +UA_StructureType_init(UA_StructureType *p) { + memset(p, 0, sizeof(UA_StructureType)); +} + +static UA_INLINE UA_StructureType * +UA_StructureType_new(void) { + return (UA_StructureType*)UA_new(&UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} + +static UA_INLINE UA_StatusCode +UA_StructureType_copy(const UA_StructureType *src, UA_StructureType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_StructureType_deleteMembers(UA_StructureType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} + +static UA_INLINE void +UA_StructureType_clear(UA_StructureType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} + +static UA_INLINE void +UA_StructureType_delete(UA_StructureType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STRUCTURETYPE]); +} + +/* ResponseHeader */ +static UA_INLINE void +UA_ResponseHeader_init(UA_ResponseHeader *p) { + memset(p, 0, sizeof(UA_ResponseHeader)); +} + +static UA_INLINE UA_ResponseHeader * +UA_ResponseHeader_new(void) { + return (UA_ResponseHeader*)UA_new(&UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_ResponseHeader_copy(const UA_ResponseHeader *src, UA_ResponseHeader *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ResponseHeader_deleteMembers(UA_ResponseHeader *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} + +static UA_INLINE void +UA_ResponseHeader_clear(UA_ResponseHeader *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} + +static UA_INLINE void +UA_ResponseHeader_delete(UA_ResponseHeader *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_RESPONSEHEADER]); +} + +/* SignatureData */ +static UA_INLINE void +UA_SignatureData_init(UA_SignatureData *p) { + memset(p, 0, sizeof(UA_SignatureData)); +} + +static UA_INLINE UA_SignatureData * +UA_SignatureData_new(void) { + return (UA_SignatureData*)UA_new(&UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} + +static UA_INLINE UA_StatusCode +UA_SignatureData_copy(const UA_SignatureData *src, UA_SignatureData *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SignatureData_deleteMembers(UA_SignatureData *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} + +static UA_INLINE void +UA_SignatureData_clear(UA_SignatureData *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} + +static UA_INLINE void +UA_SignatureData_delete(UA_SignatureData *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SIGNATUREDATA]); +} + +/* ModifySubscriptionResponse */ +static UA_INLINE void +UA_ModifySubscriptionResponse_init(UA_ModifySubscriptionResponse *p) { + memset(p, 0, sizeof(UA_ModifySubscriptionResponse)); +} + +static UA_INLINE UA_ModifySubscriptionResponse * +UA_ModifySubscriptionResponse_new(void) { + return (UA_ModifySubscriptionResponse*)UA_new(&UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionResponse_copy(const UA_ModifySubscriptionResponse *src, UA_ModifySubscriptionResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ModifySubscriptionResponse_deleteMembers(UA_ModifySubscriptionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE void +UA_ModifySubscriptionResponse_clear(UA_ModifySubscriptionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE void +UA_ModifySubscriptionResponse_delete(UA_ModifySubscriptionResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE]); +} + +/* NodeAttributes */ +static UA_INLINE void +UA_NodeAttributes_init(UA_NodeAttributes *p) { + memset(p, 0, sizeof(UA_NodeAttributes)); +} + +static UA_INLINE UA_NodeAttributes * +UA_NodeAttributes_new(void) { + return (UA_NodeAttributes*)UA_new(&UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_NodeAttributes_copy(const UA_NodeAttributes *src, UA_NodeAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_NodeAttributes_deleteMembers(UA_NodeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} + +static UA_INLINE void +UA_NodeAttributes_clear(UA_NodeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} + +static UA_INLINE void +UA_NodeAttributes_delete(UA_NodeAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTES]); +} + +/* ActivateSessionResponse */ +static UA_INLINE void +UA_ActivateSessionResponse_init(UA_ActivateSessionResponse *p) { + memset(p, 0, sizeof(UA_ActivateSessionResponse)); +} + +static UA_INLINE UA_ActivateSessionResponse * +UA_ActivateSessionResponse_new(void) { + return (UA_ActivateSessionResponse*)UA_new(&UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_ActivateSessionResponse_copy(const UA_ActivateSessionResponse *src, UA_ActivateSessionResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ActivateSessionResponse_deleteMembers(UA_ActivateSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_ActivateSessionResponse_clear(UA_ActivateSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_ActivateSessionResponse_delete(UA_ActivateSessionResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONRESPONSE]); +} + +/* EnumField */ +static UA_INLINE void +UA_EnumField_init(UA_EnumField *p) { + memset(p, 0, sizeof(UA_EnumField)); +} + +static UA_INLINE UA_EnumField * +UA_EnumField_new(void) { + return (UA_EnumField*)UA_new(&UA_TYPES[UA_TYPES_ENUMFIELD]); +} + +static UA_INLINE UA_StatusCode +UA_EnumField_copy(const UA_EnumField *src, UA_EnumField *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ENUMFIELD]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EnumField_deleteMembers(UA_EnumField *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMFIELD]); +} + +static UA_INLINE void +UA_EnumField_clear(UA_EnumField *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMFIELD]); +} + +static UA_INLINE void +UA_EnumField_delete(UA_EnumField *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ENUMFIELD]); +} + +/* VariableTypeAttributes */ +static UA_INLINE void +UA_VariableTypeAttributes_init(UA_VariableTypeAttributes *p) { + memset(p, 0, sizeof(UA_VariableTypeAttributes)); +} + +static UA_INLINE UA_VariableTypeAttributes * +UA_VariableTypeAttributes_new(void) { + return (UA_VariableTypeAttributes*)UA_new(&UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_VariableTypeAttributes_copy(const UA_VariableTypeAttributes *src, UA_VariableTypeAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_VariableTypeAttributes_deleteMembers(UA_VariableTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_VariableTypeAttributes_clear(UA_VariableTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_VariableTypeAttributes_delete(UA_VariableTypeAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES]); +} + +/* CallMethodResult */ +static UA_INLINE void +UA_CallMethodResult_init(UA_CallMethodResult *p) { + memset(p, 0, sizeof(UA_CallMethodResult)); +} + +static UA_INLINE UA_CallMethodResult * +UA_CallMethodResult_new(void) { + return (UA_CallMethodResult*)UA_new(&UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_CallMethodResult_copy(const UA_CallMethodResult *src, UA_CallMethodResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CallMethodResult_deleteMembers(UA_CallMethodResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +static UA_INLINE void +UA_CallMethodResult_clear(UA_CallMethodResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +static UA_INLINE void +UA_CallMethodResult_delete(UA_CallMethodResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CALLMETHODRESULT]); +} + +/* MonitoringMode */ +static UA_INLINE void +UA_MonitoringMode_init(UA_MonitoringMode *p) { + memset(p, 0, sizeof(UA_MonitoringMode)); +} + +static UA_INLINE UA_MonitoringMode * +UA_MonitoringMode_new(void) { + return (UA_MonitoringMode*)UA_new(&UA_TYPES[UA_TYPES_MONITORINGMODE]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoringMode_copy(const UA_MonitoringMode *src, UA_MonitoringMode *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITORINGMODE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoringMode_deleteMembers(UA_MonitoringMode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITORINGMODE]); +} + +static UA_INLINE void +UA_MonitoringMode_clear(UA_MonitoringMode *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITORINGMODE]); +} + +static UA_INLINE void +UA_MonitoringMode_delete(UA_MonitoringMode *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITORINGMODE]); +} + +/* SetMonitoringModeResponse */ +static UA_INLINE void +UA_SetMonitoringModeResponse_init(UA_SetMonitoringModeResponse *p) { + memset(p, 0, sizeof(UA_SetMonitoringModeResponse)); +} + +static UA_INLINE UA_SetMonitoringModeResponse * +UA_SetMonitoringModeResponse_new(void) { + return (UA_SetMonitoringModeResponse*)UA_new(&UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeResponse_copy(const UA_SetMonitoringModeResponse *src, UA_SetMonitoringModeResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetMonitoringModeResponse_deleteMembers(UA_SetMonitoringModeResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} + +static UA_INLINE void +UA_SetMonitoringModeResponse_clear(UA_SetMonitoringModeResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} + +static UA_INLINE void +UA_SetMonitoringModeResponse_delete(UA_SetMonitoringModeResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); +} + +/* BrowseResultMask */ +static UA_INLINE void +UA_BrowseResultMask_init(UA_BrowseResultMask *p) { + memset(p, 0, sizeof(UA_BrowseResultMask)); +} + +static UA_INLINE UA_BrowseResultMask * +UA_BrowseResultMask_new(void) { + return (UA_BrowseResultMask*)UA_new(&UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseResultMask_copy(const UA_BrowseResultMask *src, UA_BrowseResultMask *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseResultMask_deleteMembers(UA_BrowseResultMask *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} + +static UA_INLINE void +UA_BrowseResultMask_clear(UA_BrowseResultMask *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} + +static UA_INLINE void +UA_BrowseResultMask_delete(UA_BrowseResultMask *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSERESULTMASK]); +} + +/* RequestHeader */ +static UA_INLINE void +UA_RequestHeader_init(UA_RequestHeader *p) { + memset(p, 0, sizeof(UA_RequestHeader)); +} + +static UA_INLINE UA_RequestHeader * +UA_RequestHeader_new(void) { + return (UA_RequestHeader*)UA_new(&UA_TYPES[UA_TYPES_REQUESTHEADER]); +} + +static UA_INLINE UA_StatusCode +UA_RequestHeader_copy(const UA_RequestHeader *src, UA_RequestHeader *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REQUESTHEADER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RequestHeader_deleteMembers(UA_RequestHeader *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REQUESTHEADER]); +} + +static UA_INLINE void +UA_RequestHeader_clear(UA_RequestHeader *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REQUESTHEADER]); +} + +static UA_INLINE void +UA_RequestHeader_delete(UA_RequestHeader *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REQUESTHEADER]); +} + +/* MonitoredItemModifyResult */ +static UA_INLINE void +UA_MonitoredItemModifyResult_init(UA_MonitoredItemModifyResult *p) { + memset(p, 0, sizeof(UA_MonitoredItemModifyResult)); +} + +static UA_INLINE UA_MonitoredItemModifyResult * +UA_MonitoredItemModifyResult_new(void) { + return (UA_MonitoredItemModifyResult*)UA_new(&UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyResult_copy(const UA_MonitoredItemModifyResult *src, UA_MonitoredItemModifyResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoredItemModifyResult_deleteMembers(UA_MonitoredItemModifyResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +static UA_INLINE void +UA_MonitoredItemModifyResult_clear(UA_MonitoredItemModifyResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +static UA_INLINE void +UA_MonitoredItemModifyResult_delete(UA_MonitoredItemModifyResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYRESULT]); +} + +/* CloseSecureChannelRequest */ +static UA_INLINE void +UA_CloseSecureChannelRequest_init(UA_CloseSecureChannelRequest *p) { + memset(p, 0, sizeof(UA_CloseSecureChannelRequest)); +} + +static UA_INLINE UA_CloseSecureChannelRequest * +UA_CloseSecureChannelRequest_new(void) { + return (UA_CloseSecureChannelRequest*)UA_new(&UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelRequest_copy(const UA_CloseSecureChannelRequest *src, UA_CloseSecureChannelRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CloseSecureChannelRequest_deleteMembers(UA_CloseSecureChannelRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} + +static UA_INLINE void +UA_CloseSecureChannelRequest_clear(UA_CloseSecureChannelRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} + +static UA_INLINE void +UA_CloseSecureChannelRequest_delete(UA_CloseSecureChannelRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELREQUEST]); +} + +/* NotificationMessage */ +static UA_INLINE void +UA_NotificationMessage_init(UA_NotificationMessage *p) { + memset(p, 0, sizeof(UA_NotificationMessage)); +} + +static UA_INLINE UA_NotificationMessage * +UA_NotificationMessage_new(void) { + return (UA_NotificationMessage*)UA_new(&UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} + +static UA_INLINE UA_StatusCode +UA_NotificationMessage_copy(const UA_NotificationMessage *src, UA_NotificationMessage *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_NotificationMessage_deleteMembers(UA_NotificationMessage *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} + +static UA_INLINE void +UA_NotificationMessage_clear(UA_NotificationMessage *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} + +static UA_INLINE void +UA_NotificationMessage_delete(UA_NotificationMessage *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_NOTIFICATIONMESSAGE]); +} + +/* CreateSubscriptionResponse */ +static UA_INLINE void +UA_CreateSubscriptionResponse_init(UA_CreateSubscriptionResponse *p) { + memset(p, 0, sizeof(UA_CreateSubscriptionResponse)); +} + +static UA_INLINE UA_CreateSubscriptionResponse * +UA_CreateSubscriptionResponse_new(void) { + return (UA_CreateSubscriptionResponse*)UA_new(&UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionResponse_copy(const UA_CreateSubscriptionResponse *src, UA_CreateSubscriptionResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateSubscriptionResponse_deleteMembers(UA_CreateSubscriptionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE void +UA_CreateSubscriptionResponse_clear(UA_CreateSubscriptionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} + +static UA_INLINE void +UA_CreateSubscriptionResponse_delete(UA_CreateSubscriptionResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONRESPONSE]); +} + +/* EnumDefinition */ +static UA_INLINE void +UA_EnumDefinition_init(UA_EnumDefinition *p) { + memset(p, 0, sizeof(UA_EnumDefinition)); +} + +static UA_INLINE UA_EnumDefinition * +UA_EnumDefinition_new(void) { + return (UA_EnumDefinition*)UA_new(&UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} + +static UA_INLINE UA_StatusCode +UA_EnumDefinition_copy(const UA_EnumDefinition *src, UA_EnumDefinition *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EnumDefinition_deleteMembers(UA_EnumDefinition *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} + +static UA_INLINE void +UA_EnumDefinition_clear(UA_EnumDefinition *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} + +static UA_INLINE void +UA_EnumDefinition_delete(UA_EnumDefinition *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ENUMDEFINITION]); +} + +/* AxisScaleEnumeration */ +static UA_INLINE void +UA_AxisScaleEnumeration_init(UA_AxisScaleEnumeration *p) { + memset(p, 0, sizeof(UA_AxisScaleEnumeration)); +} + +static UA_INLINE UA_AxisScaleEnumeration * +UA_AxisScaleEnumeration_new(void) { + return (UA_AxisScaleEnumeration*)UA_new(&UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} + +static UA_INLINE UA_StatusCode +UA_AxisScaleEnumeration_copy(const UA_AxisScaleEnumeration *src, UA_AxisScaleEnumeration *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AxisScaleEnumeration_deleteMembers(UA_AxisScaleEnumeration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} + +static UA_INLINE void +UA_AxisScaleEnumeration_clear(UA_AxisScaleEnumeration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} + +static UA_INLINE void +UA_AxisScaleEnumeration_delete(UA_AxisScaleEnumeration *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_AXISSCALEENUMERATION]); +} + +/* BrowseDirection */ +static UA_INLINE void +UA_BrowseDirection_init(UA_BrowseDirection *p) { + memset(p, 0, sizeof(UA_BrowseDirection)); +} + +static UA_INLINE UA_BrowseDirection * +UA_BrowseDirection_new(void) { + return (UA_BrowseDirection*)UA_new(&UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseDirection_copy(const UA_BrowseDirection *src, UA_BrowseDirection *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseDirection_deleteMembers(UA_BrowseDirection *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} + +static UA_INLINE void +UA_BrowseDirection_clear(UA_BrowseDirection *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} + +static UA_INLINE void +UA_BrowseDirection_delete(UA_BrowseDirection *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEDIRECTION]); +} + +/* CallMethodRequest */ +static UA_INLINE void +UA_CallMethodRequest_init(UA_CallMethodRequest *p) { + memset(p, 0, sizeof(UA_CallMethodRequest)); +} + +static UA_INLINE UA_CallMethodRequest * +UA_CallMethodRequest_new(void) { + return (UA_CallMethodRequest*)UA_new(&UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CallMethodRequest_copy(const UA_CallMethodRequest *src, UA_CallMethodRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CallMethodRequest_deleteMembers(UA_CallMethodRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} + +static UA_INLINE void +UA_CallMethodRequest_clear(UA_CallMethodRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} + +static UA_INLINE void +UA_CallMethodRequest_delete(UA_CallMethodRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CALLMETHODREQUEST]); +} + +/* ReadResponse */ +static UA_INLINE void +UA_ReadResponse_init(UA_ReadResponse *p) { + memset(p, 0, sizeof(UA_ReadResponse)); +} + +static UA_INLINE UA_ReadResponse * +UA_ReadResponse_new(void) { + return (UA_ReadResponse*)UA_new(&UA_TYPES[UA_TYPES_READRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_ReadResponse_copy(const UA_ReadResponse *src, UA_ReadResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_READRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ReadResponse_deleteMembers(UA_ReadResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READRESPONSE]); +} + +static UA_INLINE void +UA_ReadResponse_clear(UA_ReadResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READRESPONSE]); +} + +static UA_INLINE void +UA_ReadResponse_delete(UA_ReadResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_READRESPONSE]); +} + +/* TimestampsToReturn */ +static UA_INLINE void +UA_TimestampsToReturn_init(UA_TimestampsToReturn *p) { + memset(p, 0, sizeof(UA_TimestampsToReturn)); +} + +static UA_INLINE UA_TimestampsToReturn * +UA_TimestampsToReturn_new(void) { + return (UA_TimestampsToReturn*)UA_new(&UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} + +static UA_INLINE UA_StatusCode +UA_TimestampsToReturn_copy(const UA_TimestampsToReturn *src, UA_TimestampsToReturn *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TimestampsToReturn_deleteMembers(UA_TimestampsToReturn *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} + +static UA_INLINE void +UA_TimestampsToReturn_clear(UA_TimestampsToReturn *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} + +static UA_INLINE void +UA_TimestampsToReturn_delete(UA_TimestampsToReturn *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TIMESTAMPSTORETURN]); +} + +/* NodeClass */ +static UA_INLINE void +UA_NodeClass_init(UA_NodeClass *p) { + memset(p, 0, sizeof(UA_NodeClass)); +} + +static UA_INLINE UA_NodeClass * +UA_NodeClass_new(void) { + return (UA_NodeClass*)UA_new(&UA_TYPES[UA_TYPES_NODECLASS]); +} + +static UA_INLINE UA_StatusCode +UA_NodeClass_copy(const UA_NodeClass *src, UA_NodeClass *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +UA_DEPRECATED static UA_INLINE void +UA_NodeClass_deleteMembers(UA_NodeClass *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +static UA_INLINE void +UA_NodeClass_clear(UA_NodeClass *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +static UA_INLINE void +UA_NodeClass_delete(UA_NodeClass *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +/* ObjectTypeAttributes */ +static UA_INLINE void +UA_ObjectTypeAttributes_init(UA_ObjectTypeAttributes *p) { + memset(p, 0, sizeof(UA_ObjectTypeAttributes)); +} + +static UA_INLINE UA_ObjectTypeAttributes * +UA_ObjectTypeAttributes_new(void) { + return (UA_ObjectTypeAttributes*)UA_new(&UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_ObjectTypeAttributes_copy(const UA_ObjectTypeAttributes *src, UA_ObjectTypeAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ObjectTypeAttributes_deleteMembers(UA_ObjectTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_ObjectTypeAttributes_clear(UA_ObjectTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_ObjectTypeAttributes_delete(UA_ObjectTypeAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES]); +} + +/* SecurityTokenRequestType */ +static UA_INLINE void +UA_SecurityTokenRequestType_init(UA_SecurityTokenRequestType *p) { + memset(p, 0, sizeof(UA_SecurityTokenRequestType)); +} + +static UA_INLINE UA_SecurityTokenRequestType * +UA_SecurityTokenRequestType_new(void) { + return (UA_SecurityTokenRequestType*)UA_new(&UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_SecurityTokenRequestType_copy(const UA_SecurityTokenRequestType *src, UA_SecurityTokenRequestType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SecurityTokenRequestType_deleteMembers(UA_SecurityTokenRequestType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} + +static UA_INLINE void +UA_SecurityTokenRequestType_clear(UA_SecurityTokenRequestType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} + +static UA_INLINE void +UA_SecurityTokenRequestType_delete(UA_SecurityTokenRequestType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SECURITYTOKENREQUESTTYPE]); +} + +/* CloseSessionResponse */ +static UA_INLINE void +UA_CloseSessionResponse_init(UA_CloseSessionResponse *p) { + memset(p, 0, sizeof(UA_CloseSessionResponse)); +} + +static UA_INLINE UA_CloseSessionResponse * +UA_CloseSessionResponse_new(void) { + return (UA_CloseSessionResponse*)UA_new(&UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CloseSessionResponse_copy(const UA_CloseSessionResponse *src, UA_CloseSessionResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CloseSessionResponse_deleteMembers(UA_CloseSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_CloseSessionResponse_clear(UA_CloseSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_CloseSessionResponse_delete(UA_CloseSessionResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CLOSESESSIONRESPONSE]); +} + +/* SetPublishingModeRequest */ +static UA_INLINE void +UA_SetPublishingModeRequest_init(UA_SetPublishingModeRequest *p) { + memset(p, 0, sizeof(UA_SetPublishingModeRequest)); +} + +static UA_INLINE UA_SetPublishingModeRequest * +UA_SetPublishingModeRequest_new(void) { + return (UA_SetPublishingModeRequest*)UA_new(&UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_SetPublishingModeRequest_copy(const UA_SetPublishingModeRequest *src, UA_SetPublishingModeRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetPublishingModeRequest_deleteMembers(UA_SetPublishingModeRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} + +static UA_INLINE void +UA_SetPublishingModeRequest_clear(UA_SetPublishingModeRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} + +static UA_INLINE void +UA_SetPublishingModeRequest_delete(UA_SetPublishingModeRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST]); +} + +/* IssuedIdentityToken */ +static UA_INLINE void +UA_IssuedIdentityToken_init(UA_IssuedIdentityToken *p) { + memset(p, 0, sizeof(UA_IssuedIdentityToken)); +} + +static UA_INLINE UA_IssuedIdentityToken * +UA_IssuedIdentityToken_new(void) { + return (UA_IssuedIdentityToken*)UA_new(&UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_IssuedIdentityToken_copy(const UA_IssuedIdentityToken *src, UA_IssuedIdentityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_IssuedIdentityToken_deleteMembers(UA_IssuedIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_IssuedIdentityToken_clear(UA_IssuedIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_IssuedIdentityToken_delete(UA_IssuedIdentityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ISSUEDIDENTITYTOKEN]); +} + +/* DeleteMonitoredItemsResponse */ +static UA_INLINE void +UA_DeleteMonitoredItemsResponse_init(UA_DeleteMonitoredItemsResponse *p) { + memset(p, 0, sizeof(UA_DeleteMonitoredItemsResponse)); +} + +static UA_INLINE UA_DeleteMonitoredItemsResponse * +UA_DeleteMonitoredItemsResponse_new(void) { + return (UA_DeleteMonitoredItemsResponse*)UA_new(&UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsResponse_copy(const UA_DeleteMonitoredItemsResponse *src, UA_DeleteMonitoredItemsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteMonitoredItemsResponse_deleteMembers(UA_DeleteMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_DeleteMonitoredItemsResponse_clear(UA_DeleteMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_DeleteMonitoredItemsResponse_delete(UA_DeleteMonitoredItemsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSRESPONSE]); +} + +/* ApplicationType */ +static UA_INLINE void +UA_ApplicationType_init(UA_ApplicationType *p) { + memset(p, 0, sizeof(UA_ApplicationType)); +} + +static UA_INLINE UA_ApplicationType * +UA_ApplicationType_new(void) { + return (UA_ApplicationType*)UA_new(&UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_ApplicationType_copy(const UA_ApplicationType *src, UA_ApplicationType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ApplicationType_deleteMembers(UA_ApplicationType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} + +static UA_INLINE void +UA_ApplicationType_clear(UA_ApplicationType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} + +static UA_INLINE void +UA_ApplicationType_delete(UA_ApplicationType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_APPLICATIONTYPE]); +} + +/* BrowseNextRequest */ +static UA_INLINE void +UA_BrowseNextRequest_init(UA_BrowseNextRequest *p) { + memset(p, 0, sizeof(UA_BrowseNextRequest)); +} + +static UA_INLINE UA_BrowseNextRequest * +UA_BrowseNextRequest_new(void) { + return (UA_BrowseNextRequest*)UA_new(&UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseNextRequest_copy(const UA_BrowseNextRequest *src, UA_BrowseNextRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseNextRequest_deleteMembers(UA_BrowseNextRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} + +static UA_INLINE void +UA_BrowseNextRequest_clear(UA_BrowseNextRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} + +static UA_INLINE void +UA_BrowseNextRequest_delete(UA_BrowseNextRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST]); +} + +/* ModifySubscriptionRequest */ +static UA_INLINE void +UA_ModifySubscriptionRequest_init(UA_ModifySubscriptionRequest *p) { + memset(p, 0, sizeof(UA_ModifySubscriptionRequest)); +} + +static UA_INLINE UA_ModifySubscriptionRequest * +UA_ModifySubscriptionRequest_new(void) { + return (UA_ModifySubscriptionRequest*)UA_new(&UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_ModifySubscriptionRequest_copy(const UA_ModifySubscriptionRequest *src, UA_ModifySubscriptionRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ModifySubscriptionRequest_deleteMembers(UA_ModifySubscriptionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} + +static UA_INLINE void +UA_ModifySubscriptionRequest_clear(UA_ModifySubscriptionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} + +static UA_INLINE void +UA_ModifySubscriptionRequest_delete(UA_ModifySubscriptionRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MODIFYSUBSCRIPTIONREQUEST]); +} + +/* BrowseDescription */ +static UA_INLINE void +UA_BrowseDescription_init(UA_BrowseDescription *p) { + memset(p, 0, sizeof(UA_BrowseDescription)); +} + +static UA_INLINE UA_BrowseDescription * +UA_BrowseDescription_new(void) { + return (UA_BrowseDescription*)UA_new(&UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseDescription_copy(const UA_BrowseDescription *src, UA_BrowseDescription *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseDescription_deleteMembers(UA_BrowseDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} + +static UA_INLINE void +UA_BrowseDescription_clear(UA_BrowseDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} + +static UA_INLINE void +UA_BrowseDescription_delete(UA_BrowseDescription *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEDESCRIPTION]); +} + +/* SignedSoftwareCertificate */ +static UA_INLINE void +UA_SignedSoftwareCertificate_init(UA_SignedSoftwareCertificate *p) { + memset(p, 0, sizeof(UA_SignedSoftwareCertificate)); +} + +static UA_INLINE UA_SignedSoftwareCertificate * +UA_SignedSoftwareCertificate_new(void) { + return (UA_SignedSoftwareCertificate*)UA_new(&UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} + +static UA_INLINE UA_StatusCode +UA_SignedSoftwareCertificate_copy(const UA_SignedSoftwareCertificate *src, UA_SignedSoftwareCertificate *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SignedSoftwareCertificate_deleteMembers(UA_SignedSoftwareCertificate *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} + +static UA_INLINE void +UA_SignedSoftwareCertificate_clear(UA_SignedSoftwareCertificate *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} + +static UA_INLINE void +UA_SignedSoftwareCertificate_delete(UA_SignedSoftwareCertificate *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SIGNEDSOFTWARECERTIFICATE]); +} + +/* BrowsePathTarget */ +static UA_INLINE void +UA_BrowsePathTarget_init(UA_BrowsePathTarget *p) { + memset(p, 0, sizeof(UA_BrowsePathTarget)); +} + +static UA_INLINE UA_BrowsePathTarget * +UA_BrowsePathTarget_new(void) { + return (UA_BrowsePathTarget*)UA_new(&UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} + +static UA_INLINE UA_StatusCode +UA_BrowsePathTarget_copy(const UA_BrowsePathTarget *src, UA_BrowsePathTarget *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowsePathTarget_deleteMembers(UA_BrowsePathTarget *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} + +static UA_INLINE void +UA_BrowsePathTarget_clear(UA_BrowsePathTarget *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} + +static UA_INLINE void +UA_BrowsePathTarget_delete(UA_BrowsePathTarget *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEPATHTARGET]); +} + +/* WriteResponse */ +static UA_INLINE void +UA_WriteResponse_init(UA_WriteResponse *p) { + memset(p, 0, sizeof(UA_WriteResponse)); +} + +static UA_INLINE UA_WriteResponse * +UA_WriteResponse_new(void) { + return (UA_WriteResponse*)UA_new(&UA_TYPES[UA_TYPES_WRITERESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_WriteResponse_copy(const UA_WriteResponse *src, UA_WriteResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_WRITERESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_WriteResponse_deleteMembers(UA_WriteResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITERESPONSE]); +} + +static UA_INLINE void +UA_WriteResponse_clear(UA_WriteResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITERESPONSE]); +} + +static UA_INLINE void +UA_WriteResponse_delete(UA_WriteResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_WRITERESPONSE]); +} + +/* AddNodesResult */ +static UA_INLINE void +UA_AddNodesResult_init(UA_AddNodesResult *p) { + memset(p, 0, sizeof(UA_AddNodesResult)); +} + +static UA_INLINE UA_AddNodesResult * +UA_AddNodesResult_new(void) { + return (UA_AddNodesResult*)UA_new(&UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_AddNodesResult_copy(const UA_AddNodesResult *src, UA_AddNodesResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddNodesResult_deleteMembers(UA_AddNodesResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +static UA_INLINE void +UA_AddNodesResult_clear(UA_AddNodesResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +static UA_INLINE void +UA_AddNodesResult_delete(UA_AddNodesResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDNODESRESULT]); +} + +/* AddReferencesItem */ +static UA_INLINE void +UA_AddReferencesItem_init(UA_AddReferencesItem *p) { + memset(p, 0, sizeof(UA_AddReferencesItem)); +} + +static UA_INLINE UA_AddReferencesItem * +UA_AddReferencesItem_new(void) { + return (UA_AddReferencesItem*)UA_new(&UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} + +static UA_INLINE UA_StatusCode +UA_AddReferencesItem_copy(const UA_AddReferencesItem *src, UA_AddReferencesItem *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddReferencesItem_deleteMembers(UA_AddReferencesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} + +static UA_INLINE void +UA_AddReferencesItem_clear(UA_AddReferencesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} + +static UA_INLINE void +UA_AddReferencesItem_delete(UA_AddReferencesItem *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDREFERENCESITEM]); +} + +/* DeleteReferencesResponse */ +static UA_INLINE void +UA_DeleteReferencesResponse_init(UA_DeleteReferencesResponse *p) { + memset(p, 0, sizeof(UA_DeleteReferencesResponse)); +} + +static UA_INLINE UA_DeleteReferencesResponse * +UA_DeleteReferencesResponse_new(void) { + return (UA_DeleteReferencesResponse*)UA_new(&UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteReferencesResponse_copy(const UA_DeleteReferencesResponse *src, UA_DeleteReferencesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteReferencesResponse_deleteMembers(UA_DeleteReferencesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} + +static UA_INLINE void +UA_DeleteReferencesResponse_clear(UA_DeleteReferencesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} + +static UA_INLINE void +UA_DeleteReferencesResponse_delete(UA_DeleteReferencesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); +} + +/* RelativePathElement */ +static UA_INLINE void +UA_RelativePathElement_init(UA_RelativePathElement *p) { + memset(p, 0, sizeof(UA_RelativePathElement)); +} + +static UA_INLINE UA_RelativePathElement * +UA_RelativePathElement_new(void) { + return (UA_RelativePathElement*)UA_new(&UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} + +static UA_INLINE UA_StatusCode +UA_RelativePathElement_copy(const UA_RelativePathElement *src, UA_RelativePathElement *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RelativePathElement_deleteMembers(UA_RelativePathElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} + +static UA_INLINE void +UA_RelativePathElement_clear(UA_RelativePathElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} + +static UA_INLINE void +UA_RelativePathElement_delete(UA_RelativePathElement *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]); +} + +/* SubscriptionAcknowledgement */ +static UA_INLINE void +UA_SubscriptionAcknowledgement_init(UA_SubscriptionAcknowledgement *p) { + memset(p, 0, sizeof(UA_SubscriptionAcknowledgement)); +} + +static UA_INLINE UA_SubscriptionAcknowledgement * +UA_SubscriptionAcknowledgement_new(void) { + return (UA_SubscriptionAcknowledgement*)UA_new(&UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} + +static UA_INLINE UA_StatusCode +UA_SubscriptionAcknowledgement_copy(const UA_SubscriptionAcknowledgement *src, UA_SubscriptionAcknowledgement *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SubscriptionAcknowledgement_deleteMembers(UA_SubscriptionAcknowledgement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} + +static UA_INLINE void +UA_SubscriptionAcknowledgement_clear(UA_SubscriptionAcknowledgement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} + +static UA_INLINE void +UA_SubscriptionAcknowledgement_delete(UA_SubscriptionAcknowledgement *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT]); +} + +/* TransferResult */ +static UA_INLINE void +UA_TransferResult_init(UA_TransferResult *p) { + memset(p, 0, sizeof(UA_TransferResult)); +} + +static UA_INLINE UA_TransferResult * +UA_TransferResult_new(void) { + return (UA_TransferResult*)UA_new(&UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_TransferResult_copy(const UA_TransferResult *src, UA_TransferResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TransferResult_deleteMembers(UA_TransferResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +static UA_INLINE void +UA_TransferResult_clear(UA_TransferResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +static UA_INLINE void +UA_TransferResult_delete(UA_TransferResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TRANSFERRESULT]); +} + +/* CreateMonitoredItemsResponse */ +static UA_INLINE void +UA_CreateMonitoredItemsResponse_init(UA_CreateMonitoredItemsResponse *p) { + memset(p, 0, sizeof(UA_CreateMonitoredItemsResponse)); +} + +static UA_INLINE UA_CreateMonitoredItemsResponse * +UA_CreateMonitoredItemsResponse_new(void) { + return (UA_CreateMonitoredItemsResponse*)UA_new(&UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsResponse_copy(const UA_CreateMonitoredItemsResponse *src, UA_CreateMonitoredItemsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateMonitoredItemsResponse_deleteMembers(UA_CreateMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_CreateMonitoredItemsResponse_clear(UA_CreateMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_CreateMonitoredItemsResponse_delete(UA_CreateMonitoredItemsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSRESPONSE]); +} + +/* DeleteReferencesItem */ +static UA_INLINE void +UA_DeleteReferencesItem_init(UA_DeleteReferencesItem *p) { + memset(p, 0, sizeof(UA_DeleteReferencesItem)); +} + +static UA_INLINE UA_DeleteReferencesItem * +UA_DeleteReferencesItem_new(void) { + return (UA_DeleteReferencesItem*)UA_new(&UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteReferencesItem_copy(const UA_DeleteReferencesItem *src, UA_DeleteReferencesItem *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteReferencesItem_deleteMembers(UA_DeleteReferencesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} + +static UA_INLINE void +UA_DeleteReferencesItem_clear(UA_DeleteReferencesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} + +static UA_INLINE void +UA_DeleteReferencesItem_delete(UA_DeleteReferencesItem *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESITEM]); +} + +/* WriteValue */ +static UA_INLINE void +UA_WriteValue_init(UA_WriteValue *p) { + memset(p, 0, sizeof(UA_WriteValue)); +} + +static UA_INLINE UA_WriteValue * +UA_WriteValue_new(void) { + return (UA_WriteValue*)UA_new(&UA_TYPES[UA_TYPES_WRITEVALUE]); +} + +static UA_INLINE UA_StatusCode +UA_WriteValue_copy(const UA_WriteValue *src, UA_WriteValue *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_WRITEVALUE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_WriteValue_deleteMembers(UA_WriteValue *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITEVALUE]); +} + +static UA_INLINE void +UA_WriteValue_clear(UA_WriteValue *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITEVALUE]); +} + +static UA_INLINE void +UA_WriteValue_delete(UA_WriteValue *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_WRITEVALUE]); +} + +/* DataTypeAttributes */ +static UA_INLINE void +UA_DataTypeAttributes_init(UA_DataTypeAttributes *p) { + memset(p, 0, sizeof(UA_DataTypeAttributes)); +} + +static UA_INLINE UA_DataTypeAttributes * +UA_DataTypeAttributes_new(void) { + return (UA_DataTypeAttributes*)UA_new(&UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_DataTypeAttributes_copy(const UA_DataTypeAttributes *src, UA_DataTypeAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DataTypeAttributes_deleteMembers(UA_DataTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_DataTypeAttributes_clear(UA_DataTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_DataTypeAttributes_delete(UA_DataTypeAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES]); +} + +/* TransferSubscriptionsResponse */ +static UA_INLINE void +UA_TransferSubscriptionsResponse_init(UA_TransferSubscriptionsResponse *p) { + memset(p, 0, sizeof(UA_TransferSubscriptionsResponse)); +} + +static UA_INLINE UA_TransferSubscriptionsResponse * +UA_TransferSubscriptionsResponse_new(void) { + return (UA_TransferSubscriptionsResponse*)UA_new(&UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsResponse_copy(const UA_TransferSubscriptionsResponse *src, UA_TransferSubscriptionsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TransferSubscriptionsResponse_deleteMembers(UA_TransferSubscriptionsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE void +UA_TransferSubscriptionsResponse_clear(UA_TransferSubscriptionsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE void +UA_TransferSubscriptionsResponse_delete(UA_TransferSubscriptionsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSRESPONSE]); +} + +/* AddReferencesResponse */ +static UA_INLINE void +UA_AddReferencesResponse_init(UA_AddReferencesResponse *p) { + memset(p, 0, sizeof(UA_AddReferencesResponse)); +} + +static UA_INLINE UA_AddReferencesResponse * +UA_AddReferencesResponse_new(void) { + return (UA_AddReferencesResponse*)UA_new(&UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_AddReferencesResponse_copy(const UA_AddReferencesResponse *src, UA_AddReferencesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddReferencesResponse_deleteMembers(UA_AddReferencesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} + +static UA_INLINE void +UA_AddReferencesResponse_clear(UA_AddReferencesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} + +static UA_INLINE void +UA_AddReferencesResponse_delete(UA_AddReferencesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); +} + +/* DeadbandType */ +static UA_INLINE void +UA_DeadbandType_init(UA_DeadbandType *p) { + memset(p, 0, sizeof(UA_DeadbandType)); +} + +static UA_INLINE UA_DeadbandType * +UA_DeadbandType_new(void) { + return (UA_DeadbandType*)UA_new(&UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_DeadbandType_copy(const UA_DeadbandType *src, UA_DeadbandType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeadbandType_deleteMembers(UA_DeadbandType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} + +static UA_INLINE void +UA_DeadbandType_clear(UA_DeadbandType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} + +static UA_INLINE void +UA_DeadbandType_delete(UA_DeadbandType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DEADBANDTYPE]); +} + +/* DataChangeTrigger */ +static UA_INLINE void +UA_DataChangeTrigger_init(UA_DataChangeTrigger *p) { + memset(p, 0, sizeof(UA_DataChangeTrigger)); +} + +static UA_INLINE UA_DataChangeTrigger * +UA_DataChangeTrigger_new(void) { + return (UA_DataChangeTrigger*)UA_new(&UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} + +static UA_INLINE UA_StatusCode +UA_DataChangeTrigger_copy(const UA_DataChangeTrigger *src, UA_DataChangeTrigger *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DataChangeTrigger_deleteMembers(UA_DataChangeTrigger *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} + +static UA_INLINE void +UA_DataChangeTrigger_clear(UA_DataChangeTrigger *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} + +static UA_INLINE void +UA_DataChangeTrigger_delete(UA_DataChangeTrigger *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATACHANGETRIGGER]); +} + +/* BuildInfo */ +static UA_INLINE void +UA_BuildInfo_init(UA_BuildInfo *p) { + memset(p, 0, sizeof(UA_BuildInfo)); +} + +static UA_INLINE UA_BuildInfo * +UA_BuildInfo_new(void) { + return (UA_BuildInfo*)UA_new(&UA_TYPES[UA_TYPES_BUILDINFO]); +} + +static UA_INLINE UA_StatusCode +UA_BuildInfo_copy(const UA_BuildInfo *src, UA_BuildInfo *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BUILDINFO]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BuildInfo_deleteMembers(UA_BuildInfo *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BUILDINFO]); +} + +static UA_INLINE void +UA_BuildInfo_clear(UA_BuildInfo *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BUILDINFO]); +} + +static UA_INLINE void +UA_BuildInfo_delete(UA_BuildInfo *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BUILDINFO]); +} + +/* FilterOperand */ +static UA_INLINE void +UA_FilterOperand_init(UA_FilterOperand *p) { + memset(p, 0, sizeof(UA_FilterOperand)); +} + +static UA_INLINE UA_FilterOperand * +UA_FilterOperand_new(void) { + return (UA_FilterOperand*)UA_new(&UA_TYPES[UA_TYPES_FILTEROPERAND]); +} + +static UA_INLINE UA_StatusCode +UA_FilterOperand_copy(const UA_FilterOperand *src, UA_FilterOperand *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_FILTEROPERAND]); +} + +UA_DEPRECATED static UA_INLINE void +UA_FilterOperand_deleteMembers(UA_FilterOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FILTEROPERAND]); +} + +static UA_INLINE void +UA_FilterOperand_clear(UA_FilterOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FILTEROPERAND]); +} + +static UA_INLINE void +UA_FilterOperand_delete(UA_FilterOperand *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_FILTEROPERAND]); +} + +/* MonitoringParameters */ +static UA_INLINE void +UA_MonitoringParameters_init(UA_MonitoringParameters *p) { + memset(p, 0, sizeof(UA_MonitoringParameters)); +} + +static UA_INLINE UA_MonitoringParameters * +UA_MonitoringParameters_new(void) { + return (UA_MonitoringParameters*)UA_new(&UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoringParameters_copy(const UA_MonitoringParameters *src, UA_MonitoringParameters *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoringParameters_deleteMembers(UA_MonitoringParameters *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} + +static UA_INLINE void +UA_MonitoringParameters_clear(UA_MonitoringParameters *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} + +static UA_INLINE void +UA_MonitoringParameters_delete(UA_MonitoringParameters *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITORINGPARAMETERS]); +} + +/* DoubleComplexNumberType */ +static UA_INLINE void +UA_DoubleComplexNumberType_init(UA_DoubleComplexNumberType *p) { + memset(p, 0, sizeof(UA_DoubleComplexNumberType)); +} + +static UA_INLINE UA_DoubleComplexNumberType * +UA_DoubleComplexNumberType_new(void) { + return (UA_DoubleComplexNumberType*)UA_new(&UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_DoubleComplexNumberType_copy(const UA_DoubleComplexNumberType *src, UA_DoubleComplexNumberType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DoubleComplexNumberType_deleteMembers(UA_DoubleComplexNumberType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} + +static UA_INLINE void +UA_DoubleComplexNumberType_clear(UA_DoubleComplexNumberType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} + +static UA_INLINE void +UA_DoubleComplexNumberType_delete(UA_DoubleComplexNumberType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DOUBLECOMPLEXNUMBERTYPE]); +} + +/* DeleteNodesItem */ +static UA_INLINE void +UA_DeleteNodesItem_init(UA_DeleteNodesItem *p) { + memset(p, 0, sizeof(UA_DeleteNodesItem)); +} + +static UA_INLINE UA_DeleteNodesItem * +UA_DeleteNodesItem_new(void) { + return (UA_DeleteNodesItem*)UA_new(&UA_TYPES[UA_TYPES_DELETENODESITEM]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteNodesItem_copy(const UA_DeleteNodesItem *src, UA_DeleteNodesItem *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETENODESITEM]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteNodesItem_deleteMembers(UA_DeleteNodesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESITEM]); +} + +static UA_INLINE void +UA_DeleteNodesItem_clear(UA_DeleteNodesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESITEM]); +} + +static UA_INLINE void +UA_DeleteNodesItem_delete(UA_DeleteNodesItem *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETENODESITEM]); +} + +/* ReadValueId */ +static UA_INLINE void +UA_ReadValueId_init(UA_ReadValueId *p) { + memset(p, 0, sizeof(UA_ReadValueId)); +} + +static UA_INLINE UA_ReadValueId * +UA_ReadValueId_new(void) { + return (UA_ReadValueId*)UA_new(&UA_TYPES[UA_TYPES_READVALUEID]); +} + +static UA_INLINE UA_StatusCode +UA_ReadValueId_copy(const UA_ReadValueId *src, UA_ReadValueId *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_READVALUEID]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ReadValueId_deleteMembers(UA_ReadValueId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READVALUEID]); +} + +static UA_INLINE void +UA_ReadValueId_clear(UA_ReadValueId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READVALUEID]); +} + +static UA_INLINE void +UA_ReadValueId_delete(UA_ReadValueId *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_READVALUEID]); +} + +/* CallRequest */ +static UA_INLINE void +UA_CallRequest_init(UA_CallRequest *p) { + memset(p, 0, sizeof(UA_CallRequest)); +} + +static UA_INLINE UA_CallRequest * +UA_CallRequest_new(void) { + return (UA_CallRequest*)UA_new(&UA_TYPES[UA_TYPES_CALLREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CallRequest_copy(const UA_CallRequest *src, UA_CallRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CALLREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CallRequest_deleteMembers(UA_CallRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLREQUEST]); +} + +static UA_INLINE void +UA_CallRequest_clear(UA_CallRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLREQUEST]); +} + +static UA_INLINE void +UA_CallRequest_delete(UA_CallRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CALLREQUEST]); +} + +/* RelativePath */ +static UA_INLINE void +UA_RelativePath_init(UA_RelativePath *p) { + memset(p, 0, sizeof(UA_RelativePath)); +} + +static UA_INLINE UA_RelativePath * +UA_RelativePath_new(void) { + return (UA_RelativePath*)UA_new(&UA_TYPES[UA_TYPES_RELATIVEPATH]); +} + +static UA_INLINE UA_StatusCode +UA_RelativePath_copy(const UA_RelativePath *src, UA_RelativePath *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_RELATIVEPATH]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RelativePath_deleteMembers(UA_RelativePath *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RELATIVEPATH]); +} + +static UA_INLINE void +UA_RelativePath_clear(UA_RelativePath *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RELATIVEPATH]); +} + +static UA_INLINE void +UA_RelativePath_delete(UA_RelativePath *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_RELATIVEPATH]); +} + +/* DeleteNodesRequest */ +static UA_INLINE void +UA_DeleteNodesRequest_init(UA_DeleteNodesRequest *p) { + memset(p, 0, sizeof(UA_DeleteNodesRequest)); +} + +static UA_INLINE UA_DeleteNodesRequest * +UA_DeleteNodesRequest_new(void) { + return (UA_DeleteNodesRequest*)UA_new(&UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteNodesRequest_copy(const UA_DeleteNodesRequest *src, UA_DeleteNodesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteNodesRequest_deleteMembers(UA_DeleteNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} + +static UA_INLINE void +UA_DeleteNodesRequest_clear(UA_DeleteNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} + +static UA_INLINE void +UA_DeleteNodesRequest_delete(UA_DeleteNodesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETENODESREQUEST]); +} + +/* MonitoredItemModifyRequest */ +static UA_INLINE void +UA_MonitoredItemModifyRequest_init(UA_MonitoredItemModifyRequest *p) { + memset(p, 0, sizeof(UA_MonitoredItemModifyRequest)); +} + +static UA_INLINE UA_MonitoredItemModifyRequest * +UA_MonitoredItemModifyRequest_new(void) { + return (UA_MonitoredItemModifyRequest*)UA_new(&UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoredItemModifyRequest_copy(const UA_MonitoredItemModifyRequest *src, UA_MonitoredItemModifyRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoredItemModifyRequest_deleteMembers(UA_MonitoredItemModifyRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} + +static UA_INLINE void +UA_MonitoredItemModifyRequest_clear(UA_MonitoredItemModifyRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} + +static UA_INLINE void +UA_MonitoredItemModifyRequest_delete(UA_MonitoredItemModifyRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST]); +} + +/* UserTokenType */ +static UA_INLINE void +UA_UserTokenType_init(UA_UserTokenType *p) { + memset(p, 0, sizeof(UA_UserTokenType)); +} + +static UA_INLINE UA_UserTokenType * +UA_UserTokenType_new(void) { + return (UA_UserTokenType*)UA_new(&UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_UserTokenType_copy(const UA_UserTokenType *src, UA_UserTokenType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UserTokenType_deleteMembers(UA_UserTokenType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} + +static UA_INLINE void +UA_UserTokenType_clear(UA_UserTokenType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} + +static UA_INLINE void +UA_UserTokenType_delete(UA_UserTokenType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_USERTOKENTYPE]); +} + +/* AggregateConfiguration */ +static UA_INLINE void +UA_AggregateConfiguration_init(UA_AggregateConfiguration *p) { + memset(p, 0, sizeof(UA_AggregateConfiguration)); +} + +static UA_INLINE UA_AggregateConfiguration * +UA_AggregateConfiguration_new(void) { + return (UA_AggregateConfiguration*)UA_new(&UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} + +static UA_INLINE UA_StatusCode +UA_AggregateConfiguration_copy(const UA_AggregateConfiguration *src, UA_AggregateConfiguration *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AggregateConfiguration_deleteMembers(UA_AggregateConfiguration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} + +static UA_INLINE void +UA_AggregateConfiguration_clear(UA_AggregateConfiguration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} + +static UA_INLINE void +UA_AggregateConfiguration_delete(UA_AggregateConfiguration *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_AGGREGATECONFIGURATION]); +} + +/* LocaleId */ +static UA_INLINE void +UA_LocaleId_init(UA_LocaleId *p) { + memset(p, 0, sizeof(UA_LocaleId)); +} + +static UA_INLINE UA_LocaleId * +UA_LocaleId_new(void) { + return (UA_LocaleId*)UA_new(&UA_TYPES[UA_TYPES_LOCALEID]); +} + +static UA_INLINE UA_StatusCode +UA_LocaleId_copy(const UA_LocaleId *src, UA_LocaleId *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_LOCALEID]); +} + +UA_DEPRECATED static UA_INLINE void +UA_LocaleId_deleteMembers(UA_LocaleId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LOCALEID]); +} + +static UA_INLINE void +UA_LocaleId_clear(UA_LocaleId *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_LOCALEID]); +} + +static UA_INLINE void +UA_LocaleId_delete(UA_LocaleId *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_LOCALEID]); +} + +/* UnregisterNodesResponse */ +static UA_INLINE void +UA_UnregisterNodesResponse_init(UA_UnregisterNodesResponse *p) { + memset(p, 0, sizeof(UA_UnregisterNodesResponse)); +} + +static UA_INLINE UA_UnregisterNodesResponse * +UA_UnregisterNodesResponse_new(void) { + return (UA_UnregisterNodesResponse*)UA_new(&UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_UnregisterNodesResponse_copy(const UA_UnregisterNodesResponse *src, UA_UnregisterNodesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UnregisterNodesResponse_deleteMembers(UA_UnregisterNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} + +static UA_INLINE void +UA_UnregisterNodesResponse_clear(UA_UnregisterNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} + +static UA_INLINE void +UA_UnregisterNodesResponse_delete(UA_UnregisterNodesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); +} + +/* ContentFilterResult */ +static UA_INLINE void +UA_ContentFilterResult_init(UA_ContentFilterResult *p) { + memset(p, 0, sizeof(UA_ContentFilterResult)); +} + +static UA_INLINE UA_ContentFilterResult * +UA_ContentFilterResult_new(void) { + return (UA_ContentFilterResult*)UA_new(&UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_ContentFilterResult_copy(const UA_ContentFilterResult *src, UA_ContentFilterResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ContentFilterResult_deleteMembers(UA_ContentFilterResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} + +static UA_INLINE void +UA_ContentFilterResult_clear(UA_ContentFilterResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} + +static UA_INLINE void +UA_ContentFilterResult_delete(UA_ContentFilterResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CONTENTFILTERRESULT]); +} + +/* UserTokenPolicy */ +static UA_INLINE void +UA_UserTokenPolicy_init(UA_UserTokenPolicy *p) { + memset(p, 0, sizeof(UA_UserTokenPolicy)); +} + +static UA_INLINE UA_UserTokenPolicy * +UA_UserTokenPolicy_new(void) { + return (UA_UserTokenPolicy*)UA_new(&UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} + +static UA_INLINE UA_StatusCode +UA_UserTokenPolicy_copy(const UA_UserTokenPolicy *src, UA_UserTokenPolicy *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UserTokenPolicy_deleteMembers(UA_UserTokenPolicy *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} + +static UA_INLINE void +UA_UserTokenPolicy_clear(UA_UserTokenPolicy *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} + +static UA_INLINE void +UA_UserTokenPolicy_delete(UA_UserTokenPolicy *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); +} + +/* DeleteMonitoredItemsRequest */ +static UA_INLINE void +UA_DeleteMonitoredItemsRequest_init(UA_DeleteMonitoredItemsRequest *p) { + memset(p, 0, sizeof(UA_DeleteMonitoredItemsRequest)); +} + +static UA_INLINE UA_DeleteMonitoredItemsRequest * +UA_DeleteMonitoredItemsRequest_new(void) { + return (UA_DeleteMonitoredItemsRequest*)UA_new(&UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteMonitoredItemsRequest_copy(const UA_DeleteMonitoredItemsRequest *src, UA_DeleteMonitoredItemsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteMonitoredItemsRequest_deleteMembers(UA_DeleteMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_DeleteMonitoredItemsRequest_clear(UA_DeleteMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_DeleteMonitoredItemsRequest_delete(UA_DeleteMonitoredItemsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETEMONITOREDITEMSREQUEST]); +} + +/* SetMonitoringModeRequest */ +static UA_INLINE void +UA_SetMonitoringModeRequest_init(UA_SetMonitoringModeRequest *p) { + memset(p, 0, sizeof(UA_SetMonitoringModeRequest)); +} + +static UA_INLINE UA_SetMonitoringModeRequest * +UA_SetMonitoringModeRequest_new(void) { + return (UA_SetMonitoringModeRequest*)UA_new(&UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_SetMonitoringModeRequest_copy(const UA_SetMonitoringModeRequest *src, UA_SetMonitoringModeRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetMonitoringModeRequest_deleteMembers(UA_SetMonitoringModeRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} + +static UA_INLINE void +UA_SetMonitoringModeRequest_clear(UA_SetMonitoringModeRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} + +static UA_INLINE void +UA_SetMonitoringModeRequest_delete(UA_SetMonitoringModeRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST]); +} + +/* Duration */ +static UA_INLINE void +UA_Duration_init(UA_Duration *p) { + memset(p, 0, sizeof(UA_Duration)); +} + +static UA_INLINE UA_Duration * +UA_Duration_new(void) { + return (UA_Duration*)UA_new(&UA_TYPES[UA_TYPES_DURATION]); +} + +static UA_INLINE UA_StatusCode +UA_Duration_copy(const UA_Duration *src, UA_Duration *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DURATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Duration_deleteMembers(UA_Duration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DURATION]); +} + +static UA_INLINE void +UA_Duration_clear(UA_Duration *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DURATION]); +} + +static UA_INLINE void +UA_Duration_delete(UA_Duration *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DURATION]); +} + +/* ReferenceTypeAttributes */ +static UA_INLINE void +UA_ReferenceTypeAttributes_init(UA_ReferenceTypeAttributes *p) { + memset(p, 0, sizeof(UA_ReferenceTypeAttributes)); +} + +static UA_INLINE UA_ReferenceTypeAttributes * +UA_ReferenceTypeAttributes_new(void) { + return (UA_ReferenceTypeAttributes*)UA_new(&UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_ReferenceTypeAttributes_copy(const UA_ReferenceTypeAttributes *src, UA_ReferenceTypeAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ReferenceTypeAttributes_deleteMembers(UA_ReferenceTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_ReferenceTypeAttributes_clear(UA_ReferenceTypeAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} + +static UA_INLINE void +UA_ReferenceTypeAttributes_delete(UA_ReferenceTypeAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES]); +} + +/* GetEndpointsRequest */ +static UA_INLINE void +UA_GetEndpointsRequest_init(UA_GetEndpointsRequest *p) { + memset(p, 0, sizeof(UA_GetEndpointsRequest)); +} + +static UA_INLINE UA_GetEndpointsRequest * +UA_GetEndpointsRequest_new(void) { + return (UA_GetEndpointsRequest*)UA_new(&UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_GetEndpointsRequest_copy(const UA_GetEndpointsRequest *src, UA_GetEndpointsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_GetEndpointsRequest_deleteMembers(UA_GetEndpointsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} + +static UA_INLINE void +UA_GetEndpointsRequest_clear(UA_GetEndpointsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} + +static UA_INLINE void +UA_GetEndpointsRequest_delete(UA_GetEndpointsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_GETENDPOINTSREQUEST]); +} + +/* CloseSecureChannelResponse */ +static UA_INLINE void +UA_CloseSecureChannelResponse_init(UA_CloseSecureChannelResponse *p) { + memset(p, 0, sizeof(UA_CloseSecureChannelResponse)); +} + +static UA_INLINE UA_CloseSecureChannelResponse * +UA_CloseSecureChannelResponse_new(void) { + return (UA_CloseSecureChannelResponse*)UA_new(&UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CloseSecureChannelResponse_copy(const UA_CloseSecureChannelResponse *src, UA_CloseSecureChannelResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CloseSecureChannelResponse_deleteMembers(UA_CloseSecureChannelResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} + +static UA_INLINE void +UA_CloseSecureChannelResponse_clear(UA_CloseSecureChannelResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} + +static UA_INLINE void +UA_CloseSecureChannelResponse_delete(UA_CloseSecureChannelResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CLOSESECURECHANNELRESPONSE]); +} + +/* ViewDescription */ +static UA_INLINE void +UA_ViewDescription_init(UA_ViewDescription *p) { + memset(p, 0, sizeof(UA_ViewDescription)); +} + +static UA_INLINE UA_ViewDescription * +UA_ViewDescription_new(void) { + return (UA_ViewDescription*)UA_new(&UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} + +static UA_INLINE UA_StatusCode +UA_ViewDescription_copy(const UA_ViewDescription *src, UA_ViewDescription *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ViewDescription_deleteMembers(UA_ViewDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} + +static UA_INLINE void +UA_ViewDescription_clear(UA_ViewDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} + +static UA_INLINE void +UA_ViewDescription_delete(UA_ViewDescription *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_VIEWDESCRIPTION]); +} + +/* SetPublishingModeResponse */ +static UA_INLINE void +UA_SetPublishingModeResponse_init(UA_SetPublishingModeResponse *p) { + memset(p, 0, sizeof(UA_SetPublishingModeResponse)); +} + +static UA_INLINE UA_SetPublishingModeResponse * +UA_SetPublishingModeResponse_new(void) { + return (UA_SetPublishingModeResponse*)UA_new(&UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_SetPublishingModeResponse_copy(const UA_SetPublishingModeResponse *src, UA_SetPublishingModeResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetPublishingModeResponse_deleteMembers(UA_SetPublishingModeResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} + +static UA_INLINE void +UA_SetPublishingModeResponse_clear(UA_SetPublishingModeResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} + +static UA_INLINE void +UA_SetPublishingModeResponse_delete(UA_SetPublishingModeResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); +} + +/* StatusChangeNotification */ +static UA_INLINE void +UA_StatusChangeNotification_init(UA_StatusChangeNotification *p) { + memset(p, 0, sizeof(UA_StatusChangeNotification)); +} + +static UA_INLINE UA_StatusChangeNotification * +UA_StatusChangeNotification_new(void) { + return (UA_StatusChangeNotification*)UA_new(&UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} + +static UA_INLINE UA_StatusCode +UA_StatusChangeNotification_copy(const UA_StatusChangeNotification *src, UA_StatusChangeNotification *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_StatusChangeNotification_deleteMembers(UA_StatusChangeNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} + +static UA_INLINE void +UA_StatusChangeNotification_clear(UA_StatusChangeNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} + +static UA_INLINE void +UA_StatusChangeNotification_delete(UA_StatusChangeNotification *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STATUSCHANGENOTIFICATION]); +} + +/* StructureField */ +static UA_INLINE void +UA_StructureField_init(UA_StructureField *p) { + memset(p, 0, sizeof(UA_StructureField)); +} + +static UA_INLINE UA_StructureField * +UA_StructureField_new(void) { + return (UA_StructureField*)UA_new(&UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} + +static UA_INLINE UA_StatusCode +UA_StructureField_copy(const UA_StructureField *src, UA_StructureField *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} + +UA_DEPRECATED static UA_INLINE void +UA_StructureField_deleteMembers(UA_StructureField *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} + +static UA_INLINE void +UA_StructureField_clear(UA_StructureField *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} + +static UA_INLINE void +UA_StructureField_delete(UA_StructureField *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STRUCTUREFIELD]); +} + +/* NodeAttributesMask */ +static UA_INLINE void +UA_NodeAttributesMask_init(UA_NodeAttributesMask *p) { + memset(p, 0, sizeof(UA_NodeAttributesMask)); +} + +static UA_INLINE UA_NodeAttributesMask * +UA_NodeAttributesMask_new(void) { + return (UA_NodeAttributesMask*)UA_new(&UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} + +static UA_INLINE UA_StatusCode +UA_NodeAttributesMask_copy(const UA_NodeAttributesMask *src, UA_NodeAttributesMask *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} + +UA_DEPRECATED static UA_INLINE void +UA_NodeAttributesMask_deleteMembers(UA_NodeAttributesMask *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} + +static UA_INLINE void +UA_NodeAttributesMask_clear(UA_NodeAttributesMask *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} + +static UA_INLINE void +UA_NodeAttributesMask_delete(UA_NodeAttributesMask *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_NODEATTRIBUTESMASK]); +} + +/* EventFilterResult */ +static UA_INLINE void +UA_EventFilterResult_init(UA_EventFilterResult *p) { + memset(p, 0, sizeof(UA_EventFilterResult)); +} + +static UA_INLINE UA_EventFilterResult * +UA_EventFilterResult_new(void) { + return (UA_EventFilterResult*)UA_new(&UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_EventFilterResult_copy(const UA_EventFilterResult *src, UA_EventFilterResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EventFilterResult_deleteMembers(UA_EventFilterResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} + +static UA_INLINE void +UA_EventFilterResult_clear(UA_EventFilterResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} + +static UA_INLINE void +UA_EventFilterResult_delete(UA_EventFilterResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EVENTFILTERRESULT]); +} + +/* MonitoredItemCreateRequest */ +static UA_INLINE void +UA_MonitoredItemCreateRequest_init(UA_MonitoredItemCreateRequest *p) { + memset(p, 0, sizeof(UA_MonitoredItemCreateRequest)); +} + +static UA_INLINE UA_MonitoredItemCreateRequest * +UA_MonitoredItemCreateRequest_new(void) { + return (UA_MonitoredItemCreateRequest*)UA_new(&UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_MonitoredItemCreateRequest_copy(const UA_MonitoredItemCreateRequest *src, UA_MonitoredItemCreateRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MonitoredItemCreateRequest_deleteMembers(UA_MonitoredItemCreateRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} + +static UA_INLINE void +UA_MonitoredItemCreateRequest_clear(UA_MonitoredItemCreateRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} + +static UA_INLINE void +UA_MonitoredItemCreateRequest_delete(UA_MonitoredItemCreateRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST]); +} + +/* ComplexNumberType */ +static UA_INLINE void +UA_ComplexNumberType_init(UA_ComplexNumberType *p) { + memset(p, 0, sizeof(UA_ComplexNumberType)); +} + +static UA_INLINE UA_ComplexNumberType * +UA_ComplexNumberType_new(void) { + return (UA_ComplexNumberType*)UA_new(&UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} + +static UA_INLINE UA_StatusCode +UA_ComplexNumberType_copy(const UA_ComplexNumberType *src, UA_ComplexNumberType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ComplexNumberType_deleteMembers(UA_ComplexNumberType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} + +static UA_INLINE void +UA_ComplexNumberType_clear(UA_ComplexNumberType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} + +static UA_INLINE void +UA_ComplexNumberType_delete(UA_ComplexNumberType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_COMPLEXNUMBERTYPE]); +} + +/* Range */ +static UA_INLINE void +UA_Range_init(UA_Range *p) { + memset(p, 0, sizeof(UA_Range)); +} + +static UA_INLINE UA_Range * +UA_Range_new(void) { + return (UA_Range*)UA_new(&UA_TYPES[UA_TYPES_RANGE]); +} + +static UA_INLINE UA_StatusCode +UA_Range_copy(const UA_Range *src, UA_Range *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_RANGE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Range_deleteMembers(UA_Range *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RANGE]); +} + +static UA_INLINE void +UA_Range_clear(UA_Range *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_RANGE]); +} + +static UA_INLINE void +UA_Range_delete(UA_Range *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_RANGE]); +} + +/* DataChangeNotification */ +static UA_INLINE void +UA_DataChangeNotification_init(UA_DataChangeNotification *p) { + memset(p, 0, sizeof(UA_DataChangeNotification)); +} + +static UA_INLINE UA_DataChangeNotification * +UA_DataChangeNotification_new(void) { + return (UA_DataChangeNotification*)UA_new(&UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} + +static UA_INLINE UA_StatusCode +UA_DataChangeNotification_copy(const UA_DataChangeNotification *src, UA_DataChangeNotification *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DataChangeNotification_deleteMembers(UA_DataChangeNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} + +static UA_INLINE void +UA_DataChangeNotification_clear(UA_DataChangeNotification *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} + +static UA_INLINE void +UA_DataChangeNotification_delete(UA_DataChangeNotification *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATACHANGENOTIFICATION]); +} + +/* Argument */ +static UA_INLINE void +UA_Argument_init(UA_Argument *p) { + memset(p, 0, sizeof(UA_Argument)); +} + +static UA_INLINE UA_Argument * +UA_Argument_new(void) { + return (UA_Argument*)UA_new(&UA_TYPES[UA_TYPES_ARGUMENT]); +} + +static UA_INLINE UA_StatusCode +UA_Argument_copy(const UA_Argument *src, UA_Argument *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ARGUMENT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_Argument_deleteMembers(UA_Argument *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ARGUMENT]); +} + +static UA_INLINE void +UA_Argument_clear(UA_Argument *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ARGUMENT]); +} + +static UA_INLINE void +UA_Argument_delete(UA_Argument *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ARGUMENT]); +} + +/* TransferSubscriptionsRequest */ +static UA_INLINE void +UA_TransferSubscriptionsRequest_init(UA_TransferSubscriptionsRequest *p) { + memset(p, 0, sizeof(UA_TransferSubscriptionsRequest)); +} + +static UA_INLINE UA_TransferSubscriptionsRequest * +UA_TransferSubscriptionsRequest_new(void) { + return (UA_TransferSubscriptionsRequest*)UA_new(&UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_TransferSubscriptionsRequest_copy(const UA_TransferSubscriptionsRequest *src, UA_TransferSubscriptionsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TransferSubscriptionsRequest_deleteMembers(UA_TransferSubscriptionsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE void +UA_TransferSubscriptionsRequest_clear(UA_TransferSubscriptionsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE void +UA_TransferSubscriptionsRequest_delete(UA_TransferSubscriptionsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TRANSFERSUBSCRIPTIONSREQUEST]); +} + +/* ChannelSecurityToken */ +static UA_INLINE void +UA_ChannelSecurityToken_init(UA_ChannelSecurityToken *p) { + memset(p, 0, sizeof(UA_ChannelSecurityToken)); +} + +static UA_INLINE UA_ChannelSecurityToken * +UA_ChannelSecurityToken_new(void) { + return (UA_ChannelSecurityToken*)UA_new(&UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_ChannelSecurityToken_copy(const UA_ChannelSecurityToken *src, UA_ChannelSecurityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ChannelSecurityToken_deleteMembers(UA_ChannelSecurityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} + +static UA_INLINE void +UA_ChannelSecurityToken_clear(UA_ChannelSecurityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} + +static UA_INLINE void +UA_ChannelSecurityToken_delete(UA_ChannelSecurityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CHANNELSECURITYTOKEN]); +} + +/* ServerState */ +static UA_INLINE void +UA_ServerState_init(UA_ServerState *p) { + memset(p, 0, sizeof(UA_ServerState)); +} + +static UA_INLINE UA_ServerState * +UA_ServerState_new(void) { + return (UA_ServerState*)UA_new(&UA_TYPES[UA_TYPES_SERVERSTATE]); +} + +static UA_INLINE UA_StatusCode +UA_ServerState_copy(const UA_ServerState *src, UA_ServerState *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SERVERSTATE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ServerState_deleteMembers(UA_ServerState *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERSTATE]); +} + +static UA_INLINE void +UA_ServerState_clear(UA_ServerState *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERSTATE]); +} + +static UA_INLINE void +UA_ServerState_delete(UA_ServerState *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SERVERSTATE]); +} + +/* EventNotificationList */ +static UA_INLINE void +UA_EventNotificationList_init(UA_EventNotificationList *p) { + memset(p, 0, sizeof(UA_EventNotificationList)); +} + +static UA_INLINE UA_EventNotificationList * +UA_EventNotificationList_new(void) { + return (UA_EventNotificationList*)UA_new(&UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} + +static UA_INLINE UA_StatusCode +UA_EventNotificationList_copy(const UA_EventNotificationList *src, UA_EventNotificationList *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EventNotificationList_deleteMembers(UA_EventNotificationList *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} + +static UA_INLINE void +UA_EventNotificationList_clear(UA_EventNotificationList *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} + +static UA_INLINE void +UA_EventNotificationList_delete(UA_EventNotificationList *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EVENTNOTIFICATIONLIST]); +} + +/* AnonymousIdentityToken */ +static UA_INLINE void +UA_AnonymousIdentityToken_init(UA_AnonymousIdentityToken *p) { + memset(p, 0, sizeof(UA_AnonymousIdentityToken)); +} + +static UA_INLINE UA_AnonymousIdentityToken * +UA_AnonymousIdentityToken_new(void) { + return (UA_AnonymousIdentityToken*)UA_new(&UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_AnonymousIdentityToken_copy(const UA_AnonymousIdentityToken *src, UA_AnonymousIdentityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AnonymousIdentityToken_deleteMembers(UA_AnonymousIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_AnonymousIdentityToken_clear(UA_AnonymousIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_AnonymousIdentityToken_delete(UA_AnonymousIdentityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ANONYMOUSIDENTITYTOKEN]); +} + +/* FilterOperator */ +static UA_INLINE void +UA_FilterOperator_init(UA_FilterOperator *p) { + memset(p, 0, sizeof(UA_FilterOperator)); +} + +static UA_INLINE UA_FilterOperator * +UA_FilterOperator_new(void) { + return (UA_FilterOperator*)UA_new(&UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} + +static UA_INLINE UA_StatusCode +UA_FilterOperator_copy(const UA_FilterOperator *src, UA_FilterOperator *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} + +UA_DEPRECATED static UA_INLINE void +UA_FilterOperator_deleteMembers(UA_FilterOperator *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} + +static UA_INLINE void +UA_FilterOperator_clear(UA_FilterOperator *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} + +static UA_INLINE void +UA_FilterOperator_delete(UA_FilterOperator *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_FILTEROPERATOR]); +} + +/* AggregateFilter */ +static UA_INLINE void +UA_AggregateFilter_init(UA_AggregateFilter *p) { + memset(p, 0, sizeof(UA_AggregateFilter)); +} + +static UA_INLINE UA_AggregateFilter * +UA_AggregateFilter_new(void) { + return (UA_AggregateFilter*)UA_new(&UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} + +static UA_INLINE UA_StatusCode +UA_AggregateFilter_copy(const UA_AggregateFilter *src, UA_AggregateFilter *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AggregateFilter_deleteMembers(UA_AggregateFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} + +static UA_INLINE void +UA_AggregateFilter_clear(UA_AggregateFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} + +static UA_INLINE void +UA_AggregateFilter_delete(UA_AggregateFilter *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_AGGREGATEFILTER]); +} + +/* RepublishResponse */ +static UA_INLINE void +UA_RepublishResponse_init(UA_RepublishResponse *p) { + memset(p, 0, sizeof(UA_RepublishResponse)); +} + +static UA_INLINE UA_RepublishResponse * +UA_RepublishResponse_new(void) { + return (UA_RepublishResponse*)UA_new(&UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_RepublishResponse_copy(const UA_RepublishResponse *src, UA_RepublishResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RepublishResponse_deleteMembers(UA_RepublishResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} + +static UA_INLINE void +UA_RepublishResponse_clear(UA_RepublishResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} + +static UA_INLINE void +UA_RepublishResponse_delete(UA_RepublishResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REPUBLISHRESPONSE]); +} + +/* DeleteSubscriptionsResponse */ +static UA_INLINE void +UA_DeleteSubscriptionsResponse_init(UA_DeleteSubscriptionsResponse *p) { + memset(p, 0, sizeof(UA_DeleteSubscriptionsResponse)); +} + +static UA_INLINE UA_DeleteSubscriptionsResponse * +UA_DeleteSubscriptionsResponse_new(void) { + return (UA_DeleteSubscriptionsResponse*)UA_new(&UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsResponse_copy(const UA_DeleteSubscriptionsResponse *src, UA_DeleteSubscriptionsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteSubscriptionsResponse_deleteMembers(UA_DeleteSubscriptionsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE void +UA_DeleteSubscriptionsResponse_clear(UA_DeleteSubscriptionsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} + +static UA_INLINE void +UA_DeleteSubscriptionsResponse_delete(UA_DeleteSubscriptionsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSRESPONSE]); +} + +/* RegisterNodesRequest */ +static UA_INLINE void +UA_RegisterNodesRequest_init(UA_RegisterNodesRequest *p) { + memset(p, 0, sizeof(UA_RegisterNodesRequest)); +} + +static UA_INLINE UA_RegisterNodesRequest * +UA_RegisterNodesRequest_new(void) { + return (UA_RegisterNodesRequest*)UA_new(&UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_RegisterNodesRequest_copy(const UA_RegisterNodesRequest *src, UA_RegisterNodesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RegisterNodesRequest_deleteMembers(UA_RegisterNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} + +static UA_INLINE void +UA_RegisterNodesRequest_clear(UA_RegisterNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} + +static UA_INLINE void +UA_RegisterNodesRequest_delete(UA_RegisterNodesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST]); +} + +/* StructureDefinition */ +static UA_INLINE void +UA_StructureDefinition_init(UA_StructureDefinition *p) { + memset(p, 0, sizeof(UA_StructureDefinition)); +} + +static UA_INLINE UA_StructureDefinition * +UA_StructureDefinition_new(void) { + return (UA_StructureDefinition*)UA_new(&UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} + +static UA_INLINE UA_StatusCode +UA_StructureDefinition_copy(const UA_StructureDefinition *src, UA_StructureDefinition *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_StructureDefinition_deleteMembers(UA_StructureDefinition *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} + +static UA_INLINE void +UA_StructureDefinition_clear(UA_StructureDefinition *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} + +static UA_INLINE void +UA_StructureDefinition_delete(UA_StructureDefinition *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_STRUCTUREDEFINITION]); +} + +/* MethodAttributes */ +static UA_INLINE void +UA_MethodAttributes_init(UA_MethodAttributes *p) { + memset(p, 0, sizeof(UA_MethodAttributes)); +} + +static UA_INLINE UA_MethodAttributes * +UA_MethodAttributes_new(void) { + return (UA_MethodAttributes*)UA_new(&UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_MethodAttributes_copy(const UA_MethodAttributes *src, UA_MethodAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_MethodAttributes_deleteMembers(UA_MethodAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} + +static UA_INLINE void +UA_MethodAttributes_clear(UA_MethodAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} + +static UA_INLINE void +UA_MethodAttributes_delete(UA_MethodAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_METHODATTRIBUTES]); +} + +/* UserNameIdentityToken */ +static UA_INLINE void +UA_UserNameIdentityToken_init(UA_UserNameIdentityToken *p) { + memset(p, 0, sizeof(UA_UserNameIdentityToken)); +} + +static UA_INLINE UA_UserNameIdentityToken * +UA_UserNameIdentityToken_new(void) { + return (UA_UserNameIdentityToken*)UA_new(&UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} + +static UA_INLINE UA_StatusCode +UA_UserNameIdentityToken_copy(const UA_UserNameIdentityToken *src, UA_UserNameIdentityToken *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UserNameIdentityToken_deleteMembers(UA_UserNameIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_UserNameIdentityToken_clear(UA_UserNameIdentityToken *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} + +static UA_INLINE void +UA_UserNameIdentityToken_delete(UA_UserNameIdentityToken *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]); +} + +/* UnregisterNodesRequest */ +static UA_INLINE void +UA_UnregisterNodesRequest_init(UA_UnregisterNodesRequest *p) { + memset(p, 0, sizeof(UA_UnregisterNodesRequest)); +} + +static UA_INLINE UA_UnregisterNodesRequest * +UA_UnregisterNodesRequest_new(void) { + return (UA_UnregisterNodesRequest*)UA_new(&UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_UnregisterNodesRequest_copy(const UA_UnregisterNodesRequest *src, UA_UnregisterNodesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_UnregisterNodesRequest_deleteMembers(UA_UnregisterNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} + +static UA_INLINE void +UA_UnregisterNodesRequest_clear(UA_UnregisterNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} + +static UA_INLINE void +UA_UnregisterNodesRequest_delete(UA_UnregisterNodesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST]); +} + +/* OpenSecureChannelResponse */ +static UA_INLINE void +UA_OpenSecureChannelResponse_init(UA_OpenSecureChannelResponse *p) { + memset(p, 0, sizeof(UA_OpenSecureChannelResponse)); +} + +static UA_INLINE UA_OpenSecureChannelResponse * +UA_OpenSecureChannelResponse_new(void) { + return (UA_OpenSecureChannelResponse*)UA_new(&UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelResponse_copy(const UA_OpenSecureChannelResponse *src, UA_OpenSecureChannelResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_OpenSecureChannelResponse_deleteMembers(UA_OpenSecureChannelResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} + +static UA_INLINE void +UA_OpenSecureChannelResponse_clear(UA_OpenSecureChannelResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} + +static UA_INLINE void +UA_OpenSecureChannelResponse_delete(UA_OpenSecureChannelResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELRESPONSE]); +} + +/* SetTriggeringResponse */ +static UA_INLINE void +UA_SetTriggeringResponse_init(UA_SetTriggeringResponse *p) { + memset(p, 0, sizeof(UA_SetTriggeringResponse)); +} + +static UA_INLINE UA_SetTriggeringResponse * +UA_SetTriggeringResponse_new(void) { + return (UA_SetTriggeringResponse*)UA_new(&UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_SetTriggeringResponse_copy(const UA_SetTriggeringResponse *src, UA_SetTriggeringResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetTriggeringResponse_deleteMembers(UA_SetTriggeringResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} + +static UA_INLINE void +UA_SetTriggeringResponse_clear(UA_SetTriggeringResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} + +static UA_INLINE void +UA_SetTriggeringResponse_delete(UA_SetTriggeringResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); +} + +/* SimpleAttributeOperand */ +static UA_INLINE void +UA_SimpleAttributeOperand_init(UA_SimpleAttributeOperand *p) { + memset(p, 0, sizeof(UA_SimpleAttributeOperand)); +} + +static UA_INLINE UA_SimpleAttributeOperand * +UA_SimpleAttributeOperand_new(void) { + return (UA_SimpleAttributeOperand*)UA_new(&UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} + +static UA_INLINE UA_StatusCode +UA_SimpleAttributeOperand_copy(const UA_SimpleAttributeOperand *src, UA_SimpleAttributeOperand *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SimpleAttributeOperand_deleteMembers(UA_SimpleAttributeOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} + +static UA_INLINE void +UA_SimpleAttributeOperand_clear(UA_SimpleAttributeOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} + +static UA_INLINE void +UA_SimpleAttributeOperand_delete(UA_SimpleAttributeOperand *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SIMPLEATTRIBUTEOPERAND]); +} + +/* RepublishRequest */ +static UA_INLINE void +UA_RepublishRequest_init(UA_RepublishRequest *p) { + memset(p, 0, sizeof(UA_RepublishRequest)); +} + +static UA_INLINE UA_RepublishRequest * +UA_RepublishRequest_new(void) { + return (UA_RepublishRequest*)UA_new(&UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_RepublishRequest_copy(const UA_RepublishRequest *src, UA_RepublishRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RepublishRequest_deleteMembers(UA_RepublishRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} + +static UA_INLINE void +UA_RepublishRequest_clear(UA_RepublishRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} + +static UA_INLINE void +UA_RepublishRequest_delete(UA_RepublishRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REPUBLISHREQUEST]); +} + +/* RegisterNodesResponse */ +static UA_INLINE void +UA_RegisterNodesResponse_init(UA_RegisterNodesResponse *p) { + memset(p, 0, sizeof(UA_RegisterNodesResponse)); +} + +static UA_INLINE UA_RegisterNodesResponse * +UA_RegisterNodesResponse_new(void) { + return (UA_RegisterNodesResponse*)UA_new(&UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_RegisterNodesResponse_copy(const UA_RegisterNodesResponse *src, UA_RegisterNodesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RegisterNodesResponse_deleteMembers(UA_RegisterNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} + +static UA_INLINE void +UA_RegisterNodesResponse_clear(UA_RegisterNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} + +static UA_INLINE void +UA_RegisterNodesResponse_delete(UA_RegisterNodesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); +} + +/* ModifyMonitoredItemsResponse */ +static UA_INLINE void +UA_ModifyMonitoredItemsResponse_init(UA_ModifyMonitoredItemsResponse *p) { + memset(p, 0, sizeof(UA_ModifyMonitoredItemsResponse)); +} + +static UA_INLINE UA_ModifyMonitoredItemsResponse * +UA_ModifyMonitoredItemsResponse_new(void) { + return (UA_ModifyMonitoredItemsResponse*)UA_new(&UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsResponse_copy(const UA_ModifyMonitoredItemsResponse *src, UA_ModifyMonitoredItemsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ModifyMonitoredItemsResponse_deleteMembers(UA_ModifyMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_ModifyMonitoredItemsResponse_clear(UA_ModifyMonitoredItemsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} + +static UA_INLINE void +UA_ModifyMonitoredItemsResponse_delete(UA_ModifyMonitoredItemsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE]); +} + +/* DeleteSubscriptionsRequest */ +static UA_INLINE void +UA_DeleteSubscriptionsRequest_init(UA_DeleteSubscriptionsRequest *p) { + memset(p, 0, sizeof(UA_DeleteSubscriptionsRequest)); +} + +static UA_INLINE UA_DeleteSubscriptionsRequest * +UA_DeleteSubscriptionsRequest_new(void) { + return (UA_DeleteSubscriptionsRequest*)UA_new(&UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteSubscriptionsRequest_copy(const UA_DeleteSubscriptionsRequest *src, UA_DeleteSubscriptionsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteSubscriptionsRequest_deleteMembers(UA_DeleteSubscriptionsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE void +UA_DeleteSubscriptionsRequest_clear(UA_DeleteSubscriptionsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} + +static UA_INLINE void +UA_DeleteSubscriptionsRequest_delete(UA_DeleteSubscriptionsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETESUBSCRIPTIONSREQUEST]); +} + +/* RedundancySupport */ +static UA_INLINE void +UA_RedundancySupport_init(UA_RedundancySupport *p) { + memset(p, 0, sizeof(UA_RedundancySupport)); +} + +static UA_INLINE UA_RedundancySupport * +UA_RedundancySupport_new(void) { + return (UA_RedundancySupport*)UA_new(&UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} + +static UA_INLINE UA_StatusCode +UA_RedundancySupport_copy(const UA_RedundancySupport *src, UA_RedundancySupport *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_RedundancySupport_deleteMembers(UA_RedundancySupport *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} + +static UA_INLINE void +UA_RedundancySupport_clear(UA_RedundancySupport *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} + +static UA_INLINE void +UA_RedundancySupport_delete(UA_RedundancySupport *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REDUNDANCYSUPPORT]); +} + +/* BrowsePath */ +static UA_INLINE void +UA_BrowsePath_init(UA_BrowsePath *p) { + memset(p, 0, sizeof(UA_BrowsePath)); +} + +static UA_INLINE UA_BrowsePath * +UA_BrowsePath_new(void) { + return (UA_BrowsePath*)UA_new(&UA_TYPES[UA_TYPES_BROWSEPATH]); +} + +static UA_INLINE UA_StatusCode +UA_BrowsePath_copy(const UA_BrowsePath *src, UA_BrowsePath *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEPATH]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowsePath_deleteMembers(UA_BrowsePath *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATH]); +} + +static UA_INLINE void +UA_BrowsePath_clear(UA_BrowsePath *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATH]); +} + +static UA_INLINE void +UA_BrowsePath_delete(UA_BrowsePath *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEPATH]); +} + +/* ObjectAttributes */ +static UA_INLINE void +UA_ObjectAttributes_init(UA_ObjectAttributes *p) { + memset(p, 0, sizeof(UA_ObjectAttributes)); +} + +static UA_INLINE UA_ObjectAttributes * +UA_ObjectAttributes_new(void) { + return (UA_ObjectAttributes*)UA_new(&UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} + +static UA_INLINE UA_StatusCode +UA_ObjectAttributes_copy(const UA_ObjectAttributes *src, UA_ObjectAttributes *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ObjectAttributes_deleteMembers(UA_ObjectAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} + +static UA_INLINE void +UA_ObjectAttributes_clear(UA_ObjectAttributes *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} + +static UA_INLINE void +UA_ObjectAttributes_delete(UA_ObjectAttributes *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES]); +} + +/* PublishRequest */ +static UA_INLINE void +UA_PublishRequest_init(UA_PublishRequest *p) { + memset(p, 0, sizeof(UA_PublishRequest)); +} + +static UA_INLINE UA_PublishRequest * +UA_PublishRequest_new(void) { + return (UA_PublishRequest*)UA_new(&UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_PublishRequest_copy(const UA_PublishRequest *src, UA_PublishRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_PublishRequest_deleteMembers(UA_PublishRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} + +static UA_INLINE void +UA_PublishRequest_clear(UA_PublishRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} + +static UA_INLINE void +UA_PublishRequest_delete(UA_PublishRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_PUBLISHREQUEST]); +} + +/* FindServersRequest */ +static UA_INLINE void +UA_FindServersRequest_init(UA_FindServersRequest *p) { + memset(p, 0, sizeof(UA_FindServersRequest)); +} + +static UA_INLINE UA_FindServersRequest * +UA_FindServersRequest_new(void) { + return (UA_FindServersRequest*)UA_new(&UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_FindServersRequest_copy(const UA_FindServersRequest *src, UA_FindServersRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_FindServersRequest_deleteMembers(UA_FindServersRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} + +static UA_INLINE void +UA_FindServersRequest_clear(UA_FindServersRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} + +static UA_INLINE void +UA_FindServersRequest_delete(UA_FindServersRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_FINDSERVERSREQUEST]); +} + +/* ReferenceDescription */ +static UA_INLINE void +UA_ReferenceDescription_init(UA_ReferenceDescription *p) { + memset(p, 0, sizeof(UA_ReferenceDescription)); +} + +static UA_INLINE UA_ReferenceDescription * +UA_ReferenceDescription_new(void) { + return (UA_ReferenceDescription*)UA_new(&UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} + +static UA_INLINE UA_StatusCode +UA_ReferenceDescription_copy(const UA_ReferenceDescription *src, UA_ReferenceDescription *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ReferenceDescription_deleteMembers(UA_ReferenceDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} + +static UA_INLINE void +UA_ReferenceDescription_clear(UA_ReferenceDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} + +static UA_INLINE void +UA_ReferenceDescription_delete(UA_ReferenceDescription *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_REFERENCEDESCRIPTION]); +} + +/* CreateSubscriptionRequest */ +static UA_INLINE void +UA_CreateSubscriptionRequest_init(UA_CreateSubscriptionRequest *p) { + memset(p, 0, sizeof(UA_CreateSubscriptionRequest)); +} + +static UA_INLINE UA_CreateSubscriptionRequest * +UA_CreateSubscriptionRequest_new(void) { + return (UA_CreateSubscriptionRequest*)UA_new(&UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CreateSubscriptionRequest_copy(const UA_CreateSubscriptionRequest *src, UA_CreateSubscriptionRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateSubscriptionRequest_deleteMembers(UA_CreateSubscriptionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} + +static UA_INLINE void +UA_CreateSubscriptionRequest_clear(UA_CreateSubscriptionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} + +static UA_INLINE void +UA_CreateSubscriptionRequest_delete(UA_CreateSubscriptionRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST]); +} + +/* CallResponse */ +static UA_INLINE void +UA_CallResponse_init(UA_CallResponse *p) { + memset(p, 0, sizeof(UA_CallResponse)); +} + +static UA_INLINE UA_CallResponse * +UA_CallResponse_new(void) { + return (UA_CallResponse*)UA_new(&UA_TYPES[UA_TYPES_CALLRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CallResponse_copy(const UA_CallResponse *src, UA_CallResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CALLRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CallResponse_deleteMembers(UA_CallResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLRESPONSE]); +} + +static UA_INLINE void +UA_CallResponse_clear(UA_CallResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CALLRESPONSE]); +} + +static UA_INLINE void +UA_CallResponse_delete(UA_CallResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CALLRESPONSE]); +} + +/* DeleteNodesResponse */ +static UA_INLINE void +UA_DeleteNodesResponse_init(UA_DeleteNodesResponse *p) { + memset(p, 0, sizeof(UA_DeleteNodesResponse)); +} + +static UA_INLINE UA_DeleteNodesResponse * +UA_DeleteNodesResponse_new(void) { + return (UA_DeleteNodesResponse*)UA_new(&UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteNodesResponse_copy(const UA_DeleteNodesResponse *src, UA_DeleteNodesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteNodesResponse_deleteMembers(UA_DeleteNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} + +static UA_INLINE void +UA_DeleteNodesResponse_clear(UA_DeleteNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} + +static UA_INLINE void +UA_DeleteNodesResponse_delete(UA_DeleteNodesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); +} + +/* ModifyMonitoredItemsRequest */ +static UA_INLINE void +UA_ModifyMonitoredItemsRequest_init(UA_ModifyMonitoredItemsRequest *p) { + memset(p, 0, sizeof(UA_ModifyMonitoredItemsRequest)); +} + +static UA_INLINE UA_ModifyMonitoredItemsRequest * +UA_ModifyMonitoredItemsRequest_new(void) { + return (UA_ModifyMonitoredItemsRequest*)UA_new(&UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_ModifyMonitoredItemsRequest_copy(const UA_ModifyMonitoredItemsRequest *src, UA_ModifyMonitoredItemsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ModifyMonitoredItemsRequest_deleteMembers(UA_ModifyMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_ModifyMonitoredItemsRequest_clear(UA_ModifyMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_ModifyMonitoredItemsRequest_delete(UA_ModifyMonitoredItemsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST]); +} + +/* ServiceFault */ +static UA_INLINE void +UA_ServiceFault_init(UA_ServiceFault *p) { + memset(p, 0, sizeof(UA_ServiceFault)); +} + +static UA_INLINE UA_ServiceFault * +UA_ServiceFault_new(void) { + return (UA_ServiceFault*)UA_new(&UA_TYPES[UA_TYPES_SERVICEFAULT]); +} + +static UA_INLINE UA_StatusCode +UA_ServiceFault_copy(const UA_ServiceFault *src, UA_ServiceFault *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SERVICEFAULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ServiceFault_deleteMembers(UA_ServiceFault *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVICEFAULT]); +} + +static UA_INLINE void +UA_ServiceFault_clear(UA_ServiceFault *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVICEFAULT]); +} + +static UA_INLINE void +UA_ServiceFault_delete(UA_ServiceFault *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SERVICEFAULT]); +} + +/* PublishResponse */ +static UA_INLINE void +UA_PublishResponse_init(UA_PublishResponse *p) { + memset(p, 0, sizeof(UA_PublishResponse)); +} + +static UA_INLINE UA_PublishResponse * +UA_PublishResponse_new(void) { + return (UA_PublishResponse*)UA_new(&UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_PublishResponse_copy(const UA_PublishResponse *src, UA_PublishResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_PublishResponse_deleteMembers(UA_PublishResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} + +static UA_INLINE void +UA_PublishResponse_clear(UA_PublishResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} + +static UA_INLINE void +UA_PublishResponse_delete(UA_PublishResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_PUBLISHRESPONSE]); +} + +/* CreateMonitoredItemsRequest */ +static UA_INLINE void +UA_CreateMonitoredItemsRequest_init(UA_CreateMonitoredItemsRequest *p) { + memset(p, 0, sizeof(UA_CreateMonitoredItemsRequest)); +} + +static UA_INLINE UA_CreateMonitoredItemsRequest * +UA_CreateMonitoredItemsRequest_new(void) { + return (UA_CreateMonitoredItemsRequest*)UA_new(&UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CreateMonitoredItemsRequest_copy(const UA_CreateMonitoredItemsRequest *src, UA_CreateMonitoredItemsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateMonitoredItemsRequest_deleteMembers(UA_CreateMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_CreateMonitoredItemsRequest_clear(UA_CreateMonitoredItemsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} + +static UA_INLINE void +UA_CreateMonitoredItemsRequest_delete(UA_CreateMonitoredItemsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATEMONITOREDITEMSREQUEST]); +} + +/* OpenSecureChannelRequest */ +static UA_INLINE void +UA_OpenSecureChannelRequest_init(UA_OpenSecureChannelRequest *p) { + memset(p, 0, sizeof(UA_OpenSecureChannelRequest)); +} + +static UA_INLINE UA_OpenSecureChannelRequest * +UA_OpenSecureChannelRequest_new(void) { + return (UA_OpenSecureChannelRequest*)UA_new(&UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_OpenSecureChannelRequest_copy(const UA_OpenSecureChannelRequest *src, UA_OpenSecureChannelRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_OpenSecureChannelRequest_deleteMembers(UA_OpenSecureChannelRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} + +static UA_INLINE void +UA_OpenSecureChannelRequest_clear(UA_OpenSecureChannelRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} + +static UA_INLINE void +UA_OpenSecureChannelRequest_delete(UA_OpenSecureChannelRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_OPENSECURECHANNELREQUEST]); +} + +/* CloseSessionRequest */ +static UA_INLINE void +UA_CloseSessionRequest_init(UA_CloseSessionRequest *p) { + memset(p, 0, sizeof(UA_CloseSessionRequest)); +} + +static UA_INLINE UA_CloseSessionRequest * +UA_CloseSessionRequest_new(void) { + return (UA_CloseSessionRequest*)UA_new(&UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CloseSessionRequest_copy(const UA_CloseSessionRequest *src, UA_CloseSessionRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CloseSessionRequest_deleteMembers(UA_CloseSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} + +static UA_INLINE void +UA_CloseSessionRequest_clear(UA_CloseSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} + +static UA_INLINE void +UA_CloseSessionRequest_delete(UA_CloseSessionRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]); +} + +/* SetTriggeringRequest */ +static UA_INLINE void +UA_SetTriggeringRequest_init(UA_SetTriggeringRequest *p) { + memset(p, 0, sizeof(UA_SetTriggeringRequest)); +} + +static UA_INLINE UA_SetTriggeringRequest * +UA_SetTriggeringRequest_new(void) { + return (UA_SetTriggeringRequest*)UA_new(&UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_SetTriggeringRequest_copy(const UA_SetTriggeringRequest *src, UA_SetTriggeringRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_SetTriggeringRequest_deleteMembers(UA_SetTriggeringRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} + +static UA_INLINE void +UA_SetTriggeringRequest_clear(UA_SetTriggeringRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} + +static UA_INLINE void +UA_SetTriggeringRequest_delete(UA_SetTriggeringRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST]); +} + +/* BrowseResult */ +static UA_INLINE void +UA_BrowseResult_init(UA_BrowseResult *p) { + memset(p, 0, sizeof(UA_BrowseResult)); +} + +static UA_INLINE UA_BrowseResult * +UA_BrowseResult_new(void) { + return (UA_BrowseResult*)UA_new(&UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseResult_copy(const UA_BrowseResult *src, UA_BrowseResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseResult_deleteMembers(UA_BrowseResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +static UA_INLINE void +UA_BrowseResult_clear(UA_BrowseResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +static UA_INLINE void +UA_BrowseResult_delete(UA_BrowseResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSERESULT]); +} + +/* AddReferencesRequest */ +static UA_INLINE void +UA_AddReferencesRequest_init(UA_AddReferencesRequest *p) { + memset(p, 0, sizeof(UA_AddReferencesRequest)); +} + +static UA_INLINE UA_AddReferencesRequest * +UA_AddReferencesRequest_new(void) { + return (UA_AddReferencesRequest*)UA_new(&UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_AddReferencesRequest_copy(const UA_AddReferencesRequest *src, UA_AddReferencesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddReferencesRequest_deleteMembers(UA_AddReferencesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} + +static UA_INLINE void +UA_AddReferencesRequest_clear(UA_AddReferencesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} + +static UA_INLINE void +UA_AddReferencesRequest_delete(UA_AddReferencesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST]); +} + +/* AddNodesItem */ +static UA_INLINE void +UA_AddNodesItem_init(UA_AddNodesItem *p) { + memset(p, 0, sizeof(UA_AddNodesItem)); +} + +static UA_INLINE UA_AddNodesItem * +UA_AddNodesItem_new(void) { + return (UA_AddNodesItem*)UA_new(&UA_TYPES[UA_TYPES_ADDNODESITEM]); +} + +static UA_INLINE UA_StatusCode +UA_AddNodesItem_copy(const UA_AddNodesItem *src, UA_AddNodesItem *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDNODESITEM]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddNodesItem_deleteMembers(UA_AddNodesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESITEM]); +} + +static UA_INLINE void +UA_AddNodesItem_clear(UA_AddNodesItem *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESITEM]); +} + +static UA_INLINE void +UA_AddNodesItem_delete(UA_AddNodesItem *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDNODESITEM]); +} + +/* ServerStatusDataType */ +static UA_INLINE void +UA_ServerStatusDataType_init(UA_ServerStatusDataType *p) { + memset(p, 0, sizeof(UA_ServerStatusDataType)); +} + +static UA_INLINE UA_ServerStatusDataType * +UA_ServerStatusDataType_new(void) { + return (UA_ServerStatusDataType*)UA_new(&UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} + +static UA_INLINE UA_StatusCode +UA_ServerStatusDataType_copy(const UA_ServerStatusDataType *src, UA_ServerStatusDataType *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ServerStatusDataType_deleteMembers(UA_ServerStatusDataType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} + +static UA_INLINE void +UA_ServerStatusDataType_clear(UA_ServerStatusDataType *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} + +static UA_INLINE void +UA_ServerStatusDataType_delete(UA_ServerStatusDataType *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_SERVERSTATUSDATATYPE]); +} + +/* BrowseNextResponse */ +static UA_INLINE void +UA_BrowseNextResponse_init(UA_BrowseNextResponse *p) { + memset(p, 0, sizeof(UA_BrowseNextResponse)); +} + +static UA_INLINE UA_BrowseNextResponse * +UA_BrowseNextResponse_new(void) { + return (UA_BrowseNextResponse*)UA_new(&UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseNextResponse_copy(const UA_BrowseNextResponse *src, UA_BrowseNextResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseNextResponse_deleteMembers(UA_BrowseNextResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} + +static UA_INLINE void +UA_BrowseNextResponse_clear(UA_BrowseNextResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} + +static UA_INLINE void +UA_BrowseNextResponse_delete(UA_BrowseNextResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); +} + +/* AxisInformation */ +static UA_INLINE void +UA_AxisInformation_init(UA_AxisInformation *p) { + memset(p, 0, sizeof(UA_AxisInformation)); +} + +static UA_INLINE UA_AxisInformation * +UA_AxisInformation_new(void) { + return (UA_AxisInformation*)UA_new(&UA_TYPES[UA_TYPES_AXISINFORMATION]); +} + +static UA_INLINE UA_StatusCode +UA_AxisInformation_copy(const UA_AxisInformation *src, UA_AxisInformation *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_AXISINFORMATION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AxisInformation_deleteMembers(UA_AxisInformation *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AXISINFORMATION]); +} + +static UA_INLINE void +UA_AxisInformation_clear(UA_AxisInformation *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_AXISINFORMATION]); +} + +static UA_INLINE void +UA_AxisInformation_delete(UA_AxisInformation *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_AXISINFORMATION]); +} + +/* ApplicationDescription */ +static UA_INLINE void +UA_ApplicationDescription_init(UA_ApplicationDescription *p) { + memset(p, 0, sizeof(UA_ApplicationDescription)); +} + +static UA_INLINE UA_ApplicationDescription * +UA_ApplicationDescription_new(void) { + return (UA_ApplicationDescription*)UA_new(&UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} + +static UA_INLINE UA_StatusCode +UA_ApplicationDescription_copy(const UA_ApplicationDescription *src, UA_ApplicationDescription *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ApplicationDescription_deleteMembers(UA_ApplicationDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} + +static UA_INLINE void +UA_ApplicationDescription_clear(UA_ApplicationDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} + +static UA_INLINE void +UA_ApplicationDescription_delete(UA_ApplicationDescription *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]); +} + +/* ReadRequest */ +static UA_INLINE void +UA_ReadRequest_init(UA_ReadRequest *p) { + memset(p, 0, sizeof(UA_ReadRequest)); +} + +static UA_INLINE UA_ReadRequest * +UA_ReadRequest_new(void) { + return (UA_ReadRequest*)UA_new(&UA_TYPES[UA_TYPES_READREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_ReadRequest_copy(const UA_ReadRequest *src, UA_ReadRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_READREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ReadRequest_deleteMembers(UA_ReadRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READREQUEST]); +} + +static UA_INLINE void +UA_ReadRequest_clear(UA_ReadRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_READREQUEST]); +} + +static UA_INLINE void +UA_ReadRequest_delete(UA_ReadRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_READREQUEST]); +} + +/* ActivateSessionRequest */ +static UA_INLINE void +UA_ActivateSessionRequest_init(UA_ActivateSessionRequest *p) { + memset(p, 0, sizeof(UA_ActivateSessionRequest)); +} + +static UA_INLINE UA_ActivateSessionRequest * +UA_ActivateSessionRequest_new(void) { + return (UA_ActivateSessionRequest*)UA_new(&UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_ActivateSessionRequest_copy(const UA_ActivateSessionRequest *src, UA_ActivateSessionRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ActivateSessionRequest_deleteMembers(UA_ActivateSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} + +static UA_INLINE void +UA_ActivateSessionRequest_clear(UA_ActivateSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} + +static UA_INLINE void +UA_ActivateSessionRequest_delete(UA_ActivateSessionRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ACTIVATESESSIONREQUEST]); +} + +/* BrowsePathResult */ +static UA_INLINE void +UA_BrowsePathResult_init(UA_BrowsePathResult *p) { + memset(p, 0, sizeof(UA_BrowsePathResult)); +} + +static UA_INLINE UA_BrowsePathResult * +UA_BrowsePathResult_new(void) { + return (UA_BrowsePathResult*)UA_new(&UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +static UA_INLINE UA_StatusCode +UA_BrowsePathResult_copy(const UA_BrowsePathResult *src, UA_BrowsePathResult *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowsePathResult_deleteMembers(UA_BrowsePathResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +static UA_INLINE void +UA_BrowsePathResult_clear(UA_BrowsePathResult *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +static UA_INLINE void +UA_BrowsePathResult_delete(UA_BrowsePathResult *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEPATHRESULT]); +} + +/* AddNodesRequest */ +static UA_INLINE void +UA_AddNodesRequest_init(UA_AddNodesRequest *p) { + memset(p, 0, sizeof(UA_AddNodesRequest)); +} + +static UA_INLINE UA_AddNodesRequest * +UA_AddNodesRequest_new(void) { + return (UA_AddNodesRequest*)UA_new(&UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_AddNodesRequest_copy(const UA_AddNodesRequest *src, UA_AddNodesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddNodesRequest_deleteMembers(UA_AddNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} + +static UA_INLINE void +UA_AddNodesRequest_clear(UA_AddNodesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} + +static UA_INLINE void +UA_AddNodesRequest_delete(UA_AddNodesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDNODESREQUEST]); +} + +/* BrowseRequest */ +static UA_INLINE void +UA_BrowseRequest_init(UA_BrowseRequest *p) { + memset(p, 0, sizeof(UA_BrowseRequest)); +} + +static UA_INLINE UA_BrowseRequest * +UA_BrowseRequest_new(void) { + return (UA_BrowseRequest*)UA_new(&UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseRequest_copy(const UA_BrowseRequest *src, UA_BrowseRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseRequest_deleteMembers(UA_BrowseRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} + +static UA_INLINE void +UA_BrowseRequest_clear(UA_BrowseRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} + +static UA_INLINE void +UA_BrowseRequest_delete(UA_BrowseRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSEREQUEST]); +} + +/* WriteRequest */ +static UA_INLINE void +UA_WriteRequest_init(UA_WriteRequest *p) { + memset(p, 0, sizeof(UA_WriteRequest)); +} + +static UA_INLINE UA_WriteRequest * +UA_WriteRequest_new(void) { + return (UA_WriteRequest*)UA_new(&UA_TYPES[UA_TYPES_WRITEREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_WriteRequest_copy(const UA_WriteRequest *src, UA_WriteRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_WRITEREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_WriteRequest_deleteMembers(UA_WriteRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITEREQUEST]); +} + +static UA_INLINE void +UA_WriteRequest_clear(UA_WriteRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_WRITEREQUEST]); +} + +static UA_INLINE void +UA_WriteRequest_delete(UA_WriteRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_WRITEREQUEST]); +} + +/* AddNodesResponse */ +static UA_INLINE void +UA_AddNodesResponse_init(UA_AddNodesResponse *p) { + memset(p, 0, sizeof(UA_AddNodesResponse)); +} + +static UA_INLINE UA_AddNodesResponse * +UA_AddNodesResponse_new(void) { + return (UA_AddNodesResponse*)UA_new(&UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_AddNodesResponse_copy(const UA_AddNodesResponse *src, UA_AddNodesResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AddNodesResponse_deleteMembers(UA_AddNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} + +static UA_INLINE void +UA_AddNodesResponse_clear(UA_AddNodesResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} + +static UA_INLINE void +UA_AddNodesResponse_delete(UA_AddNodesResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); +} + +/* AttributeOperand */ +static UA_INLINE void +UA_AttributeOperand_init(UA_AttributeOperand *p) { + memset(p, 0, sizeof(UA_AttributeOperand)); +} + +static UA_INLINE UA_AttributeOperand * +UA_AttributeOperand_new(void) { + return (UA_AttributeOperand*)UA_new(&UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} + +static UA_INLINE UA_StatusCode +UA_AttributeOperand_copy(const UA_AttributeOperand *src, UA_AttributeOperand *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} + +UA_DEPRECATED static UA_INLINE void +UA_AttributeOperand_deleteMembers(UA_AttributeOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} + +static UA_INLINE void +UA_AttributeOperand_clear(UA_AttributeOperand *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} + +static UA_INLINE void +UA_AttributeOperand_delete(UA_AttributeOperand *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]); +} + +/* DataChangeFilter */ +static UA_INLINE void +UA_DataChangeFilter_init(UA_DataChangeFilter *p) { + memset(p, 0, sizeof(UA_DataChangeFilter)); +} + +static UA_INLINE UA_DataChangeFilter * +UA_DataChangeFilter_new(void) { + return (UA_DataChangeFilter*)UA_new(&UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} + +static UA_INLINE UA_StatusCode +UA_DataChangeFilter_copy(const UA_DataChangeFilter *src, UA_DataChangeFilter *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DataChangeFilter_deleteMembers(UA_DataChangeFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} + +static UA_INLINE void +UA_DataChangeFilter_clear(UA_DataChangeFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} + +static UA_INLINE void +UA_DataChangeFilter_delete(UA_DataChangeFilter *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DATACHANGEFILTER]); +} + +/* EndpointDescription */ +static UA_INLINE void +UA_EndpointDescription_init(UA_EndpointDescription *p) { + memset(p, 0, sizeof(UA_EndpointDescription)); +} + +static UA_INLINE UA_EndpointDescription * +UA_EndpointDescription_new(void) { + return (UA_EndpointDescription*)UA_new(&UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} + +static UA_INLINE UA_StatusCode +UA_EndpointDescription_copy(const UA_EndpointDescription *src, UA_EndpointDescription *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EndpointDescription_deleteMembers(UA_EndpointDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} + +static UA_INLINE void +UA_EndpointDescription_clear(UA_EndpointDescription *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} + +static UA_INLINE void +UA_EndpointDescription_delete(UA_EndpointDescription *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]); +} + +/* DeleteReferencesRequest */ +static UA_INLINE void +UA_DeleteReferencesRequest_init(UA_DeleteReferencesRequest *p) { + memset(p, 0, sizeof(UA_DeleteReferencesRequest)); +} + +static UA_INLINE UA_DeleteReferencesRequest * +UA_DeleteReferencesRequest_new(void) { + return (UA_DeleteReferencesRequest*)UA_new(&UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_DeleteReferencesRequest_copy(const UA_DeleteReferencesRequest *src, UA_DeleteReferencesRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_DeleteReferencesRequest_deleteMembers(UA_DeleteReferencesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} + +static UA_INLINE void +UA_DeleteReferencesRequest_clear(UA_DeleteReferencesRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} + +static UA_INLINE void +UA_DeleteReferencesRequest_delete(UA_DeleteReferencesRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST]); +} + +/* TranslateBrowsePathsToNodeIdsRequest */ +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsRequest_init(UA_TranslateBrowsePathsToNodeIdsRequest *p) { + memset(p, 0, sizeof(UA_TranslateBrowsePathsToNodeIdsRequest)); +} + +static UA_INLINE UA_TranslateBrowsePathsToNodeIdsRequest * +UA_TranslateBrowsePathsToNodeIdsRequest_new(void) { + return (UA_TranslateBrowsePathsToNodeIdsRequest*)UA_new(&UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsRequest_copy(const UA_TranslateBrowsePathsToNodeIdsRequest *src, UA_TranslateBrowsePathsToNodeIdsRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsRequest_deleteMembers(UA_TranslateBrowsePathsToNodeIdsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} + +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsRequest_clear(UA_TranslateBrowsePathsToNodeIdsRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} + +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsRequest_delete(UA_TranslateBrowsePathsToNodeIdsRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST]); +} + +/* FindServersResponse */ +static UA_INLINE void +UA_FindServersResponse_init(UA_FindServersResponse *p) { + memset(p, 0, sizeof(UA_FindServersResponse)); +} + +static UA_INLINE UA_FindServersResponse * +UA_FindServersResponse_new(void) { + return (UA_FindServersResponse*)UA_new(&UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_FindServersResponse_copy(const UA_FindServersResponse *src, UA_FindServersResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_FindServersResponse_deleteMembers(UA_FindServersResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} + +static UA_INLINE void +UA_FindServersResponse_clear(UA_FindServersResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} + +static UA_INLINE void +UA_FindServersResponse_delete(UA_FindServersResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_FINDSERVERSRESPONSE]); +} + +/* CreateSessionRequest */ +static UA_INLINE void +UA_CreateSessionRequest_init(UA_CreateSessionRequest *p) { + memset(p, 0, sizeof(UA_CreateSessionRequest)); +} + +static UA_INLINE UA_CreateSessionRequest * +UA_CreateSessionRequest_new(void) { + return (UA_CreateSessionRequest*)UA_new(&UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} + +static UA_INLINE UA_StatusCode +UA_CreateSessionRequest_copy(const UA_CreateSessionRequest *src, UA_CreateSessionRequest *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateSessionRequest_deleteMembers(UA_CreateSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} + +static UA_INLINE void +UA_CreateSessionRequest_clear(UA_CreateSessionRequest *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} + +static UA_INLINE void +UA_CreateSessionRequest_delete(UA_CreateSessionRequest *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATESESSIONREQUEST]); +} + +/* ContentFilterElement */ +static UA_INLINE void +UA_ContentFilterElement_init(UA_ContentFilterElement *p) { + memset(p, 0, sizeof(UA_ContentFilterElement)); +} + +static UA_INLINE UA_ContentFilterElement * +UA_ContentFilterElement_new(void) { + return (UA_ContentFilterElement*)UA_new(&UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} + +static UA_INLINE UA_StatusCode +UA_ContentFilterElement_copy(const UA_ContentFilterElement *src, UA_ContentFilterElement *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ContentFilterElement_deleteMembers(UA_ContentFilterElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} + +static UA_INLINE void +UA_ContentFilterElement_clear(UA_ContentFilterElement *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} + +static UA_INLINE void +UA_ContentFilterElement_delete(UA_ContentFilterElement *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CONTENTFILTERELEMENT]); +} + +/* TranslateBrowsePathsToNodeIdsResponse */ +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsResponse_init(UA_TranslateBrowsePathsToNodeIdsResponse *p) { + memset(p, 0, sizeof(UA_TranslateBrowsePathsToNodeIdsResponse)); +} + +static UA_INLINE UA_TranslateBrowsePathsToNodeIdsResponse * +UA_TranslateBrowsePathsToNodeIdsResponse_new(void) { + return (UA_TranslateBrowsePathsToNodeIdsResponse*)UA_new(&UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_TranslateBrowsePathsToNodeIdsResponse_copy(const UA_TranslateBrowsePathsToNodeIdsResponse *src, UA_TranslateBrowsePathsToNodeIdsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsResponse_deleteMembers(UA_TranslateBrowsePathsToNodeIdsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} + +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsResponse_clear(UA_TranslateBrowsePathsToNodeIdsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} + +static UA_INLINE void +UA_TranslateBrowsePathsToNodeIdsResponse_delete(UA_TranslateBrowsePathsToNodeIdsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); +} + +/* BrowseResponse */ +static UA_INLINE void +UA_BrowseResponse_init(UA_BrowseResponse *p) { + memset(p, 0, sizeof(UA_BrowseResponse)); +} + +static UA_INLINE UA_BrowseResponse * +UA_BrowseResponse_new(void) { + return (UA_BrowseResponse*)UA_new(&UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_BrowseResponse_copy(const UA_BrowseResponse *src, UA_BrowseResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_BrowseResponse_deleteMembers(UA_BrowseResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} + +static UA_INLINE void +UA_BrowseResponse_clear(UA_BrowseResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} + +static UA_INLINE void +UA_BrowseResponse_delete(UA_BrowseResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); +} + +/* CreateSessionResponse */ +static UA_INLINE void +UA_CreateSessionResponse_init(UA_CreateSessionResponse *p) { + memset(p, 0, sizeof(UA_CreateSessionResponse)); +} + +static UA_INLINE UA_CreateSessionResponse * +UA_CreateSessionResponse_new(void) { + return (UA_CreateSessionResponse*)UA_new(&UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_CreateSessionResponse_copy(const UA_CreateSessionResponse *src, UA_CreateSessionResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_CreateSessionResponse_deleteMembers(UA_CreateSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_CreateSessionResponse_clear(UA_CreateSessionResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} + +static UA_INLINE void +UA_CreateSessionResponse_delete(UA_CreateSessionResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CREATESESSIONRESPONSE]); +} + +/* ContentFilter */ +static UA_INLINE void +UA_ContentFilter_init(UA_ContentFilter *p) { + memset(p, 0, sizeof(UA_ContentFilter)); +} + +static UA_INLINE UA_ContentFilter * +UA_ContentFilter_new(void) { + return (UA_ContentFilter*)UA_new(&UA_TYPES[UA_TYPES_CONTENTFILTER]); +} + +static UA_INLINE UA_StatusCode +UA_ContentFilter_copy(const UA_ContentFilter *src, UA_ContentFilter *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_CONTENTFILTER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_ContentFilter_deleteMembers(UA_ContentFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTER]); +} + +static UA_INLINE void +UA_ContentFilter_clear(UA_ContentFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_CONTENTFILTER]); +} + +static UA_INLINE void +UA_ContentFilter_delete(UA_ContentFilter *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_CONTENTFILTER]); +} + +/* GetEndpointsResponse */ +static UA_INLINE void +UA_GetEndpointsResponse_init(UA_GetEndpointsResponse *p) { + memset(p, 0, sizeof(UA_GetEndpointsResponse)); +} + +static UA_INLINE UA_GetEndpointsResponse * +UA_GetEndpointsResponse_new(void) { + return (UA_GetEndpointsResponse*)UA_new(&UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} + +static UA_INLINE UA_StatusCode +UA_GetEndpointsResponse_copy(const UA_GetEndpointsResponse *src, UA_GetEndpointsResponse *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} + +UA_DEPRECATED static UA_INLINE void +UA_GetEndpointsResponse_deleteMembers(UA_GetEndpointsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} + +static UA_INLINE void +UA_GetEndpointsResponse_clear(UA_GetEndpointsResponse *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} + +static UA_INLINE void +UA_GetEndpointsResponse_delete(UA_GetEndpointsResponse *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_GETENDPOINTSRESPONSE]); +} + +/* EventFilter */ +static UA_INLINE void +UA_EventFilter_init(UA_EventFilter *p) { + memset(p, 0, sizeof(UA_EventFilter)); +} + +static UA_INLINE UA_EventFilter * +UA_EventFilter_new(void) { + return (UA_EventFilter*)UA_new(&UA_TYPES[UA_TYPES_EVENTFILTER]); +} + +static UA_INLINE UA_StatusCode +UA_EventFilter_copy(const UA_EventFilter *src, UA_EventFilter *dst) { + return UA_copy(src, dst, &UA_TYPES[UA_TYPES_EVENTFILTER]); +} + +UA_DEPRECATED static UA_INLINE void +UA_EventFilter_deleteMembers(UA_EventFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFILTER]); +} + +static UA_INLINE void +UA_EventFilter_clear(UA_EventFilter *p) { + UA_clear(p, &UA_TYPES[UA_TYPES_EVENTFILTER]); +} + +static UA_INLINE void +UA_EventFilter_delete(UA_EventFilter *p) { + UA_delete(p, &UA_TYPES[UA_TYPES_EVENTFILTER]); +} + +#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 +# pragma GCC diagnostic pop +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/util.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +/** + * Forward Declarations + * -------------------- + * Opaque oointers used by the plugins. */ + +struct UA_Server; +typedef struct UA_Server UA_Server; + +struct UA_ServerConfig; +typedef struct UA_ServerConfig UA_ServerConfig; + +struct UA_Client; +typedef struct UA_Client UA_Client; + +/** + * 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 + * and path may be omitted (together with the prefix colon and slash). + * + * @param endpointUrl The endpoint URL. + * @param outHostname Set to the parsed hostname. The string points into the + * original endpointUrl, so no memory is allocated. If an IPv6 address is + * given, hostname contains e.g. '[2001:0db8:85a3::8a2e:0370:7334]' + * @param outPort Set to the port of the url or left unchanged. + * @param outPath Set to the path if one is present in the endpointUrl. + * Starting or trailing '/' are NOT included in the path. The string + * points into the original endpointUrl, so no memory is allocated. + * @return Returns UA_STATUSCODE_BADTCPENDPOINTURLINVALID if parsing failed. */ +UA_StatusCode UA_EXPORT +UA_parseEndpointUrl(const UA_String *endpointUrl, UA_String *outHostname, + UA_UInt16 *outPort, UA_String *outPath); + +/* Split the given endpoint url into hostname, vid and pcp. All arguments must + * be non-NULL. EndpointUrls have the form "opc.eth://<host>[:<VID>[.PCP]]". + * The host is a MAC address, an IP address or a registered name like a + * hostname. The format of a MAC address is six groups of hexadecimal digits, + * separated by hyphens (e.g. 01-23-45-67-89-ab). A system may also accept + * hostnames and/or IP addresses if it provides means to resolve it to a MAC + * address (e.g. DNS and Reverse-ARP). + * + * Note: currently only parsing MAC address is supported. + * + * @param endpointUrl The endpoint URL. + * @param vid Set to VLAN ID. + * @param pcp Set to Priority Code Point. + * @return Returns UA_STATUSCODE_BADINTERNALERROR if parsing failed. */ +UA_StatusCode UA_EXPORT +UA_parseEndpointUrlEthernet(const UA_String *endpointUrl, UA_String *target, + UA_UInt16 *vid, UA_Byte *pcp); + +/* Convert given byte string to a positive number. Returns the number of valid + * digits. Stops if a non-digit char is found and returns the number of digits + * up to that point. */ +size_t UA_EXPORT +UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number); + +/* Same as UA_ReadNumber but with a base parameter */ +size_t UA_EXPORT +UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, + UA_UInt32 *number, UA_Byte base); + +#ifndef UA_MIN +#define UA_MIN(A, B) ((A) > (B) ? (B) : (A)) +#endif + +#ifndef UA_MAX +#define UA_MAX(A, B) ((A) > (B) ? (A) : (B)) +#endif + +/** + * Parse RelativePath Expressions + * ------------------------------ + * + * Parse a RelativePath according to the format defined in Part 4, A2. This is + * used e.g. for the BrowsePath structure. For now, only the standard + * ReferenceTypes from Namespace 0 are recognized (see Part 3). + * + * ``RelativePath := ( ReferenceType [BrowseName]? )*`` + * + * The ReferenceTypes have either of the following formats: + * + * - ``/``: *HierarchicalReferences* and subtypes + * - ``.``: *Aggregates* ReferenceTypesand subtypes + * - ``< [!#]* BrowseName >``: The ReferenceType is indicated by its BrowseName + * (a QualifiedName). Prefixed modifiers can be as follows: ``!`` switches to + * inverse References. ``#`` excludes subtypes of the ReferenceType. + * + * QualifiedNames consist of an optional NamespaceIndex and the nameitself: + * + * ``QualifiedName := ([0-9]+ ":")? Name`` + * + * The QualifiedName representation for RelativePaths uses ``&`` as the escape + * character. Occurences of the characters ``/.<>:#!&`` in a QualifiedName have + * to be escaped (prefixed with ``&``). + * + * Example RelativePaths + * ````````````````````` + * + * - ``/2:Block&.Output`` + * - ``/3:Truck.0:NodeVersion`` + * - ``<0:HasProperty>1:Boiler/1:HeatSensor`` + * - ``<0:HasChild>2:Wheel`` + * - ``<#Aggregates>1:Boiler/`` + * - ``<!HasChild>Truck`` + * - ``<HasChild>`` + */ +#ifdef UA_ENABLE_PARSING +UA_EXPORT UA_StatusCode +UA_RelativePath_parse(UA_RelativePath *rp, const UA_String str); +#endif + +/** + * Convenience macros for complex types + * ------------------------------------ */ +#define UA_PRINTF_GUID_FORMAT "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" +#define UA_PRINTF_GUID_DATA(GUID) (GUID).data1, (GUID).data2, (GUID).data3, \ + (GUID).data4[0], (GUID).data4[1], (GUID).data4[2], (GUID).data4[3], \ + (GUID).data4[4], (GUID).data4[5], (GUID).data4[6], (GUID).data4[7] + +#define UA_PRINTF_STRING_FORMAT "\"%.*s\"" +#define UA_PRINTF_STRING_DATA(STRING) (int)(STRING).length, (STRING).data + +/** + * Helper functions for converting data types + * ------------------------------------------ */ + +/* Converts a bytestring to the corresponding base64 representation */ +UA_DEPRECATED static UA_INLINE UA_StatusCode +UA_ByteString_toBase64String(const UA_ByteString *byteString, + UA_String *str) { + return UA_ByteString_toBase64(byteString, str); +} + +/* Converts a node id to the corresponding string representation. + * It can be one of: + * - Numeric: ns=0;i=123 + * - String: ns=0;s=Some String + * - Guid: ns=0;g=A123456C-0ABC-1A2B-815F-687212AAEE1B + * - ByteString: ns=0;b=AA== */ +UA_DEPRECATED static UA_INLINE UA_StatusCode +UA_NodeId_toString(const UA_NodeId *nodeId, UA_String *nodeIdStr) { + return UA_NodeId_print(nodeId, nodeIdStr); +} + +/* Compare memory in constant time to mitigate timing attacks. + * Returns true if ptr1 and ptr2 are equal for length bytes. */ +static UA_INLINE UA_Boolean +UA_constantTimeEqual(const void *ptr1, const void *ptr2, size_t length) { + volatile const UA_Byte *a = (volatile const UA_Byte *)ptr1; + volatile const UA_Byte *b = (volatile const UA_Byte *)ptr2; + volatile UA_Byte c = 0; + for(size_t i = 0; i < length; ++i) { + UA_Byte x = a[i], y = b[i]; + c |= x ^ y; + } + return !c; +} + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/log.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +#include <stdarg.h> + +_UA_BEGIN_DECLS + +/** + * Logging Plugin API + * ================== + * + * Servers and clients define a logger in their configuration. The logger is a + * plugin. A default plugin that logs to ``stdout`` is provided as an example. + * The logger plugin is stateful and can point to custom data. So it is possible + * to keep open file handlers in the logger context. + * + * Every log-message consists of a log-level, a log-category and a string + * message content. The timestamp of the log-message is created within the + * logger. */ + +typedef enum { + UA_LOGLEVEL_TRACE = 0, + UA_LOGLEVEL_DEBUG, + UA_LOGLEVEL_INFO, + UA_LOGLEVEL_WARNING, + UA_LOGLEVEL_ERROR, + UA_LOGLEVEL_FATAL +} UA_LogLevel; + +typedef enum { + UA_LOGCATEGORY_NETWORK = 0, + UA_LOGCATEGORY_SECURECHANNEL, + UA_LOGCATEGORY_SESSION, + UA_LOGCATEGORY_SERVER, + UA_LOGCATEGORY_CLIENT, + UA_LOGCATEGORY_USERLAND, + UA_LOGCATEGORY_SECURITYPOLICY +} UA_LogCategory; + +typedef struct { + /* Log a message. The message string and following varargs are formatted + * according to the rules of the printf command. Use the convenience macros + * below that take the minimum log-level defined in ua_config.h into + * account. */ + void (*log)(void *logContext, UA_LogLevel level, UA_LogCategory category, + const char *msg, va_list args); + + void *context; /* Logger state */ + + void (*clear)(void *context); /* Clean up the logger plugin */ +} UA_Logger; + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_TRACE(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 100 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_TRACE, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_DEBUG(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 200 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_DEBUG, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_INFO(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 300 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_INFO, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_WARNING(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 400 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_WARNING, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_ERROR(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 500 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_ERROR, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +static UA_INLINE UA_FORMAT(3,4) void +UA_LOG_FATAL(const UA_Logger *logger, UA_LogCategory category, const char *msg, ...) { +#if UA_LOGLEVEL <= 600 + if(!logger || !logger->log) + return; + va_list args; va_start(args, msg); + logger->log(logger->context, UA_LOGLEVEL_FATAL, category, msg, args); + va_end(args); +#else + (void) logger; + (void) category; + (void) msg; +#endif +} + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/network.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +/* Forward declarations */ +struct UA_Connection; +typedef struct UA_Connection UA_Connection; + +struct UA_SecureChannel; +typedef struct UA_SecureChannel UA_SecureChannel; + +struct UA_ServerNetworkLayer; +typedef struct UA_ServerNetworkLayer UA_ServerNetworkLayer; + +/** + * .. _networking: + * + * Networking Plugin API + * ===================== + * + * Connection + * ---------- + * Client-server connections are represented by a `UA_Connection`. The + * connection is stateful and stores partially received messages, and so on. In + * addition, the connection contains function pointers to the underlying + * networking implementation. An example for this is the `send` function. So the + * connection encapsulates all the required networking functionality. This lets + * users on embedded (or otherwise exotic) systems implement their own + * networking plugins with a clear interface to the main open62541 library. */ + +typedef struct { + UA_UInt32 protocolVersion; + UA_UInt32 recvBufferSize; + UA_UInt32 sendBufferSize; + UA_UInt32 localMaxMessageSize; /* (0 = unbounded) */ + UA_UInt32 remoteMaxMessageSize; /* (0 = unbounded) */ + UA_UInt32 localMaxChunkCount; /* (0 = unbounded) */ + UA_UInt32 remoteMaxChunkCount; /* (0 = unbounded) */ +} UA_ConnectionConfig; + +typedef enum { + UA_CONNECTIONSTATE_CLOSED, /* The socket has been closed and the connection + * will be deleted */ + UA_CONNECTIONSTATE_OPENING, /* The socket is open, but the HEL/ACK handshake + * is not done */ + UA_CONNECTIONSTATE_ESTABLISHED /* The socket is open and the connection + * configured */ +} UA_ConnectionState; + +struct UA_Connection { + UA_ConnectionState state; + UA_SecureChannel *channel; /* The securechannel that is attached to + * this connection */ + UA_SOCKET sockfd; /* Most connectivity solutions run on + * sockets. Having the socket id here + * simplifies the design. */ + UA_DateTime openingDate; /* The date the connection was created */ + void *handle; /* A pointer to internal data */ + + /* Get a buffer for sending */ + UA_StatusCode (*getSendBuffer)(UA_Connection *connection, size_t length, + UA_ByteString *buf); + + /* Release the send buffer manually */ + void (*releaseSendBuffer)(UA_Connection *connection, UA_ByteString *buf); + + /* Sends a message over the connection. The message buffer is always freed, + * even if sending fails. + * + * @param connection The connection + * @param buf The message buffer + * @return Returns an error code or UA_STATUSCODE_GOOD. */ + UA_StatusCode (*send)(UA_Connection *connection, UA_ByteString *buf); + + /* Receive a message from the remote connection + * + * @param connection The connection + + * @param response The response string. If this is empty, it will be + * allocated by the connection and needs to be freed with + * connection->releaseBuffer. If the response string is non-empty, it + * will be used as the receive buffer. If bytes are received, the + * length of the buffer is adjusted to match the length of the + * received bytes. + * @param timeout Timeout of the recv operation in milliseconds + * @return Returns UA_STATUSCODE_BADCOMMUNICATIONERROR if the recv operation + * can be repeated, UA_STATUSCODE_GOOD if it succeeded and + * UA_STATUSCODE_BADCONNECTIONCLOSED if the connection was + * closed. */ + UA_StatusCode (*recv)(UA_Connection *connection, UA_ByteString *response, + UA_UInt32 timeout); + + /* Release the buffer of a received message */ + void (*releaseRecvBuffer)(UA_Connection *connection, UA_ByteString *buf); + + /* Close the connection. The network layer closes the socket. This is picked + * up during the next 'listen' and the connection is freed in the network + * layer. */ + void (*close)(UA_Connection *connection); + + /* To be called only from within the server (and not the network layer). + * Frees up the connection's memory. */ + void (*free)(UA_Connection *connection); +}; + +/** + * Server Network Layer + * -------------------- + * The server exposes two functions to interact with remote clients: + * `processBinaryMessage` and `removeConnection`. These functions are called by + * the server network layer. + * + * It is the job of the server network layer to listen on a TCP socket, to + * accept new connections, to call the server with received messages and to + * signal closed connections to the server. + * + * The network layer is part of the server config. So users can provide a custom + * implementation if the provided example does not fit their architecture. The + * network layer is invoked only from the server's main loop. So the network + * layer does not need to be thread-safe. If the networklayer receives a + * positive duration for blocking listening, the server's main loop will block + * until a message is received or the duration times out. */ + +/* Process a binary message (TCP packet). The message can contain partial + * chunks. (TCP is a streaming protocol and packets may be split/merge during + * transport.) After processing, the message is freed with + * connection->releaseRecvBuffer. */ +void UA_EXPORT +UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, + UA_ByteString *message); + +/* The server internally cleans up the connection and then calls + * connection->free. */ +void UA_EXPORT +UA_Server_removeConnection(UA_Server *server, UA_Connection *connection); + +struct UA_ServerNetworkLayer { + void *handle; /* Internal data */ + + /* Points to external memory, i.e. handled by server or client */ + UA_NetworkStatistics *statistics; + + UA_String discoveryUrl; + + UA_ConnectionConfig localConnectionConfig; + + /* Start listening on the networklayer. + * + * @param nl The network layer + * @return Returns UA_STATUSCODE_GOOD or an error code. */ + UA_StatusCode (*start)(UA_ServerNetworkLayer *nl, const UA_Logger *logger, + const UA_String *customHostname); + + /* Listen for new and closed connections and arriving packets. Calls + * UA_Server_processBinaryMessage for the arriving packets. Closed + * connections are picked up here and forwarded to + * UA_Server_removeConnection where they are cleaned up and freed. + * + * @param nl The network layer + * @param server The server for processing the incoming packets and for + * closing connections. + * @param timeout The timeout during which an event must arrive in + * milliseconds + * @return A statuscode for the status of the network layer. */ + UA_StatusCode (*listen)(UA_ServerNetworkLayer *nl, UA_Server *server, + UA_UInt16 timeout); + + /* Close the network socket and all open connections. Afterwards, the + * network layer can be safely deleted. + * + * @param nl The network layer + * @param server The server that processes the incoming packets and for + * closing connections before deleting them. + * @return A statuscode for the status of the closing operation. */ + void (*stop)(UA_ServerNetworkLayer *nl, UA_Server *server); + + /* Deletes the network layer context. Call only after stopping. */ + void (*clear)(UA_ServerNetworkLayer *nl); +}; + +/** + * Client Network Layer + * -------------------- + * The client has only a single connection used for sending and receiving binary + * messages. */ + +/* @param config the connection config for this client + * @param endpointUrl to where to connect + * @param timeout in ms until the connection try times out if remote not reachable + * @param logger the logger to use */ +typedef UA_Connection +(*UA_ConnectClientConnection)(UA_ConnectionConfig config, UA_String endpointUrl, + UA_UInt32 timeout, const UA_Logger *logger); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/accesscontrol.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +struct UA_AccessControl; +typedef struct UA_AccessControl UA_AccessControl; + +/** + * .. _access-control: + * + * Access Control Plugin API + * ========================= + * The access control callback is used to authenticate sessions and grant access + * rights accordingly. + * + * The ``sessionId`` and ``sessionContext`` can be both NULL. This is the case + * when, for example, a MonitoredItem (the underlying Subscription) is detached + * from its Session but continues to run. */ + +struct UA_AccessControl { + void *context; + void (*clear)(UA_AccessControl *ac); + + /* Supported login mechanisms. The server endpoints are created from here. */ + size_t userTokenPoliciesSize; + UA_UserTokenPolicy *userTokenPolicies; + + /* Authenticate a session. The session context is attached to the session + * and later passed into the node-based access control callbacks. The new + * session is rejected if a StatusCode other than UA_STATUSCODE_GOOD is + * returned. */ + UA_StatusCode (*activateSession)(UA_Server *server, UA_AccessControl *ac, + const UA_EndpointDescription *endpointDescription, + const UA_ByteString *secureChannelRemoteCertificate, + const UA_NodeId *sessionId, + const UA_ExtensionObject *userIdentityToken, + void **sessionContext); + + /* Deauthenticate a session and cleanup */ + void (*closeSession)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext); + + /* Access control for all nodes*/ + UA_UInt32 (*getUserRightsMask)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext); + + /* Additional access control for variable nodes */ + UA_Byte (*getUserAccessLevel)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext); + + /* Additional access control for method nodes */ + UA_Boolean (*getUserExecutable)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *methodId, void *methodContext); + + /* Additional access control for calling a method node in the context of a + * specific object */ + UA_Boolean (*getUserExecutableOnObject)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *methodId, void *methodContext, + const UA_NodeId *objectId, void *objectContext); + + /* Allow adding a node */ + UA_Boolean (*allowAddNode)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_AddNodesItem *item); + + /* Allow adding a reference */ + UA_Boolean (*allowAddReference)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_AddReferencesItem *item); + + /* Allow deleting a node */ + UA_Boolean (*allowDeleteNode)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_DeleteNodesItem *item); + + /* Allow deleting a reference */ + UA_Boolean (*allowDeleteReference)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_DeleteReferencesItem *item); + + /* Allow browsing a node */ + UA_Boolean (*allowBrowseNode)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* Allow transfer of a subscription to another session. The Server shall + * validate that the Client of that Session is operating on behalf of the + * same user */ + UA_Boolean (*allowTransferSubscription)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *oldSessionId, void *oldSessionContext, + const UA_NodeId *newSessionId, void *newSessionContext); +#endif + +#ifdef UA_ENABLE_HISTORIZING + /* Allow insert,replace,update of historical data */ + UA_Boolean (*allowHistoryUpdateUpdateData)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, + UA_PerformUpdateType performInsertReplace, + const UA_DataValue *value); + + /* Allow delete of historical data */ + UA_Boolean (*allowHistoryUpdateDeleteRawModified)(UA_Server *server, UA_AccessControl *ac, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, + UA_DateTime startTimestamp, + UA_DateTime endTimestamp, + bool isDeleteModified); +#endif +}; + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/pki.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB + */ + + + +_UA_BEGIN_DECLS + +/** + * Public Key Infrastructure Integration + * ===================================== + * This file contains interface definitions for integration in a Public Key + * Infrastructure (PKI). Currently only one plugin interface is defined. + * + * Certificate Verification + * ------------------------ + * This plugin verifies that the origin of the certificate is trusted. It does + * not assign any access rights/roles to the holder of the certificate. + * + * Usually, implementations of the certificate verification plugin provide an + * initialization method that takes a trust-list and a revocation-list as input. + * The lifecycle of the plugin is attached to a server or client config. The + * ``clear`` method is called automatically when the config is destroyed. */ + +struct UA_CertificateVerification; +typedef struct UA_CertificateVerification UA_CertificateVerification; + +struct UA_CertificateVerification { + void *context; + + /* Verify the certificate against the configured policies and trust chain. */ + UA_StatusCode (*verifyCertificate)(void *verificationContext, + const UA_ByteString *certificate); + + /* Verify that the certificate has the applicationURI in the subject name. */ + UA_StatusCode (*verifyApplicationURI)(void *verificationContext, + const UA_ByteString *certificate, + const UA_String *applicationURI); + + /* Delete the certificate verification context */ + void (*clear)(UA_CertificateVerification *cv); +}; + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/securitypolicy.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +extern UA_EXPORT const UA_ByteString UA_SECURITY_POLICY_NONE_URI; + +struct UA_SecurityPolicy; +typedef struct UA_SecurityPolicy UA_SecurityPolicy; + +/** + * SecurityPolicy Interface Definition + * ----------------------------------- */ + +typedef struct { + UA_String uri; + + /* Verifies the signature of the message using the provided keys in the context. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the channelContext that contains the key to verify + * the supplied message with. + * @param message the message to which the signature is supposed to belong. + * @param signature the signature of the message, that should be verified. */ + UA_StatusCode (*verify)(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + const UA_ByteString *signature) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Signs the given message using this policys signing algorithm and the + * provided keys in the context. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the channelContext that contains the key to sign + * the supplied message with. + * @param message the message to sign. + * @param signature an output buffer to which the signature is written. The + * buffer needs to be allocated by the caller. The + * necessary size can be acquired with the signatureSize + * attribute of this module. */ + UA_StatusCode (*sign)(const UA_SecurityPolicy *securityPolicy, + void *channelContext, const UA_ByteString *message, + UA_ByteString *signature) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Gets the signature size that depends on the local (private) key. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the channelContext that contains the + * certificate/key. + * @return the size of the local signature. Returns 0 if no local + * certificate was set. */ + size_t (*getLocalSignatureSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Gets the signature size that depends on the remote (public) key. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the size of the remote signature. Returns 0 if no + * remote certificate was set previousely. */ + size_t (*getRemoteSignatureSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Gets the local signing key length. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the length of the signing key in bytes. Returns 0 if no length can be found. + */ + size_t (*getLocalKeyLength)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Gets the local signing key length. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the length of the signing key in bytes. Returns 0 if no length can be found. + */ + size_t (*getRemoteKeyLength)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); +} UA_SecurityPolicySignatureAlgorithm; + +typedef struct { + UA_String uri; + + /* Encrypt the given data in place using an asymmetric algorithm and keys. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the channelContext which contains information about + * the keys to encrypt data. + * @param data the data that is encrypted. The encrypted data will overwrite + * the data that was supplied. */ + UA_StatusCode (*encrypt)(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Decrypts the given ciphertext in place using an asymmetric algorithm and + * key. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the channelContext which contains information about + * the keys needed to decrypt the message. + * @param data the data to decrypt. The decryption is done in place. */ + UA_StatusCode (*decrypt)(const UA_SecurityPolicy *securityPolicy, + void *channelContext, + UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Returns the length of the key used locally to encrypt messages in bits + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the length of the local key. Returns 0 if no + * key length is known. */ + size_t (*getLocalKeyLength)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Returns the length of the key used remotely to encrypt messages in bits + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the length of the remote key. Returns 0 if no + * key length is known. */ + size_t (*getRemoteKeyLength)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Returns the size of encrypted blocks used by the local encryption algorithm. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the size of encrypted blocks in bytes. Returns 0 if no key length is known. + */ + size_t (*getLocalBlockSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Returns the size of encrypted blocks used by the remote encryption algorithm. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the size of encrypted blocks in bytes. Returns 0 if no key length is known. + */ + size_t (*getRemoteBlockSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Returns the size of plaintext blocks used by the local encryption algorithm. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the size of plaintext blocks in bytes. Returns 0 if no key length is known. + */ + size_t (*getLocalPlainTextBlockSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); + + /* Returns the size of plaintext blocks used by the remote encryption algorithm. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param channelContext the context to retrieve data from. + * @return the size of plaintext blocks in bytes. Returns 0 if no key length is known. + */ + size_t (*getRemotePlainTextBlockSize)(const UA_SecurityPolicy *securityPolicy, + const void *channelContext); +} UA_SecurityPolicyEncryptionAlgorithm; + +typedef struct { + /* The algorithm used to sign and verify certificates. */ + UA_SecurityPolicySignatureAlgorithm signatureAlgorithm; + + /* The algorithm used to encrypt and decrypt messages. */ + UA_SecurityPolicyEncryptionAlgorithm encryptionAlgorithm; + +} UA_SecurityPolicyCryptoModule; + +typedef struct { + /* Generates a thumbprint for the specified certificate. + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param certificate the certificate to make a thumbprint of. + * @param thumbprint an output buffer for the resulting thumbprint. Always + * has the length specified in the thumbprintLength in the + * asymmetricModule. */ + UA_StatusCode (*makeCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificate, + UA_ByteString *thumbprint) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Compares the supplied certificate with the certificate in the endpoint context. + * + * @param securityPolicy the policy data that contains the certificate + * to compare to. + * @param certificateThumbprint the certificate thumbprint to compare to the + * one stored in the context. + * @return if the thumbprints match UA_STATUSCODE_GOOD is returned. If they + * don't match or an error occurred an error code is returned. */ + UA_StatusCode (*compareCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *certificateThumbprint) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + UA_SecurityPolicyCryptoModule cryptoModule; +} UA_SecurityPolicyAsymmetricModule; + +typedef struct { + /* Pseudo random function that is used to generate the symmetric keys. + * + * For information on what parameters this function receives in what situation, + * refer to the OPC UA specification 1.03 Part6 Table 33 + * + * @param securityPolicy the securityPolicy the function is invoked on. + * @param secret + * @param seed + * @param out an output to write the data to. The length defines the maximum + * number of output bytes that are produced. */ + UA_StatusCode (*generateKey)(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *secret, + const UA_ByteString *seed, UA_ByteString *out) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Random generator for generating nonces. + * + * @param securityPolicy the securityPolicy this function is invoked on. + * Example: myPolicy->generateNonce(myPolicy, + * &outBuff); + * @param out pointer to a buffer to store the nonce in. Needs to be + * allocated by the caller. The buffer is filled with random + * data. */ + UA_StatusCode (*generateNonce)(const UA_SecurityPolicy *securityPolicy, + UA_ByteString *out) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* + * The length of the nonce used in the SecureChannel as specified in the standard. + */ + size_t secureChannelNonceLength; + + UA_SecurityPolicyCryptoModule cryptoModule; +} UA_SecurityPolicySymmetricModule; + +typedef struct { + /* This method creates a new context data object. + * + * The caller needs to call delete on the received object to free allocated + * memory. Memory is only allocated if the function succeeds so there is no + * need to manually free the memory pointed to by *channelContext or to + * call delete in case of failure. + * + * @param securityPolicy the policy context of the endpoint that is connected + * to. It will be stored in the channelContext for + * further access by the policy. + * @param remoteCertificate the remote certificate contains the remote + * asymmetric key. The certificate will be verified + * and then stored in the context so that its + * details may be accessed. + * @param channelContext the initialized channelContext that is passed to + * functions that work on a context. */ + UA_StatusCode (*newContext)(const UA_SecurityPolicy *securityPolicy, + const UA_ByteString *remoteCertificate, + void **channelContext) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Deletes the the security context. */ + void (*deleteContext)(void *channelContext); + + /* Sets the local encrypting key in the supplied context. + * + * @param channelContext the context to work on. + * @param key the local encrypting key to store in the context. */ + UA_StatusCode (*setLocalSymEncryptingKey)(void *channelContext, + const UA_ByteString *key) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Sets the local signing key in the supplied context. + * + * @param channelContext the context to work on. + * @param key the local signing key to store in the context. */ + UA_StatusCode (*setLocalSymSigningKey)(void *channelContext, + const UA_ByteString *key) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Sets the local initialization vector in the supplied context. + * + * @param channelContext the context to work on. + * @param iv the local initialization vector to store in the context. */ + UA_StatusCode (*setLocalSymIv)(void *channelContext, + const UA_ByteString *iv) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Sets the remote encrypting key in the supplied context. + * + * @param channelContext the context to work on. + * @param key the remote encrypting key to store in the context. */ + UA_StatusCode (*setRemoteSymEncryptingKey)(void *channelContext, + const UA_ByteString *key) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Sets the remote signing key in the supplied context. + * + * @param channelContext the context to work on. + * @param key the remote signing key to store in the context. */ + UA_StatusCode (*setRemoteSymSigningKey)(void *channelContext, + const UA_ByteString *key) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Sets the remote initialization vector in the supplied context. + * + * @param channelContext the context to work on. + * @param iv the remote initialization vector to store in the context. */ + UA_StatusCode (*setRemoteSymIv)(void *channelContext, + const UA_ByteString *iv) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; + + /* Compares the supplied certificate with the certificate in the channel + * context. + * + * @param channelContext the channel context data that contains the + * certificate to compare to. + * @param certificate the certificate to compare to the one stored in the context. + * @return if the certificates match UA_STATUSCODE_GOOD is returned. If they + * don't match or an errror occurred an error code is returned. */ + UA_StatusCode (*compareCertificate)(const void *channelContext, + const UA_ByteString *certificate) + UA_FUNC_ATTR_WARN_UNUSED_RESULT; +} UA_SecurityPolicyChannelModule; + +struct UA_SecurityPolicy { + /* Additional data */ + void *policyContext; + + /* The policy uri that identifies the implemented algorithms */ + UA_ByteString policyUri; + + /* The local certificate is specific for each SecurityPolicy since it + * depends on the used key length. */ + UA_ByteString localCertificate; + + /* Function pointers grouped into modules */ + UA_SecurityPolicyAsymmetricModule asymmetricModule; + UA_SecurityPolicySymmetricModule symmetricModule; + UA_SecurityPolicySignatureAlgorithm certificateSigningAlgorithm; + UA_SecurityPolicyChannelModule channelModule; + + const UA_Logger *logger; + + /* Updates the ApplicationInstanceCertificate and the corresponding private + * key at runtime. */ + UA_StatusCode (*updateCertificateAndPrivateKey)(UA_SecurityPolicy *policy, + const UA_ByteString newCertificate, + const UA_ByteString newPrivateKey); + + /* Deletes the dynamic content of the policy */ + void (*clear)(UA_SecurityPolicy *policy); +}; + +/* Gets the number of bytes that are needed by the encryption function in + * addition to the length of the plaintext message. This is needed, since + * most RSA encryption methods have their own padding mechanism included. + * This makes the encrypted message larger than the plainText, so we need to + * have enough room in the buffer for the overhead. + * + * @param securityPolicy the algorithms to use. + * @param channelContext the retrieve data from. + * @param maxEncryptionLength the maximum number of bytes that the data to + * encrypt can be. */ +size_t +UA_SecurityPolicy_getRemoteAsymEncryptionBufferLengthOverhead(const UA_SecurityPolicy *securityPolicy, + const void *channelContext, + size_t maxEncryptionLength); + +/* Gets the a pointer to the context of a security policy supported by the + * server matched by the security policy uri. + * + * @param server the server context. + * @param securityPolicyUri the security policy to get the context of. */ +UA_SecurityPolicy * +UA_SecurityPolicy_getSecurityPolicyByUri(const UA_Server *server, + const UA_ByteString *securityPolicyUri); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/pubsub.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + */ + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_PUBSUB + +/** + * .. _pubsub_connection: + * + * PubSub Connection Plugin API + * ============================ + * + * 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. */ + +struct UA_PubSubConnectionConfig; +typedef struct UA_PubSubConnectionConfig UA_PubSubConnectionConfig; + +struct UA_PubSubChannel; +typedef struct UA_PubSubChannel UA_PubSubChannel; + +typedef enum { + UA_PUBSUB_CHANNEL_RDY, + UA_PUBSUB_CHANNEL_PUB, + UA_PUBSUB_CHANNEL_SUB, + UA_PUBSUB_CHANNEL_PUB_SUB, + UA_PUBSUB_CHANNEL_ERROR, + UA_PUBSUB_CHANNEL_CLOSED +} UA_PubSubChannelState; + +/* Interface structure between network plugin and internal implementation */ +struct UA_PubSubChannel { + UA_UInt32 publisherId; /* unique identifier */ + UA_PubSubChannelState state; + UA_PubSubConnectionConfig *connectionConfig; /* link to parent connection config */ + UA_SOCKET sockfd; + void *handle; /* implementation specific data */ + /*@info for handle: each network implementation should provide an structure + * UA_PubSubChannelData[ImplementationName] This structure can be used by the + * network implementation to store network implementation specific data.*/ + + /* Sending out the content of the buf parameter */ + UA_StatusCode (*send)(UA_PubSubChannel *channel, UA_ExtensionObject *transportSettings, + const UA_ByteString *buf); + + /* Register to an specified message source, e.g. multicast group or topic. Callback is used for mqtt. */ + UA_StatusCode (*regist)(UA_PubSubChannel * channel, UA_ExtensionObject *transportSettings, + void (*callback)(UA_ByteString *encodedBuffer, UA_ByteString *topic)); + + /* Remove subscription to an specified message source, e.g. multicast group or topic */ + UA_StatusCode (*unregist)(UA_PubSubChannel * channel, UA_ExtensionObject *transportSettings); + + /* Receive messages. A regist to the message source is needed before. */ + UA_StatusCode (*receive)(UA_PubSubChannel * channel, UA_ByteString *, + UA_ExtensionObject *transportSettings, UA_UInt32 timeout); + + /* Closing the connection and implicit free of the channel structures. */ + UA_StatusCode (*close)(UA_PubSubChannel *channel); + + /* Giving the connection protocoll time to process inbound and outbound traffic. */ + UA_StatusCode (*yield)(UA_PubSubChannel *channel, UA_UInt16 timeout); +}; + +/** + * 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; + UA_PubSubChannel *(*createPubSubChannel)(UA_PubSubConnectionConfig *connectionConfig); +} UA_PubSubTransportLayer; + +#endif /* UA_ENABLE_PUBSUB */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/ziptree.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Julius Pfrommer + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Reusable zip tree implementation. The style is inspired by the BSD + * sys/queue.h linked list definition. + * + * Zip trees were developed in: Tarjan, R. E., Levy, C. C., and Timmel, S. "Zip + * Trees." arXiv preprint arXiv:1806.06726 (2018). The original definition was + * modified so that several elements with the same key can be inserted. However, + * ZIP_FIND will only return the topmost of these elements in the tree. + * + * The ZIP_ENTRY definitions are to be contained in the tree entries themselves. + * Use ZIP_PROTOTYPE to define the signature of the zip tree and ZIP_IMPL (in a + * .c compilation unit) for the method implementations. + * + * Zip trees are a probabilistic data structure. Entries are assigned a + * (nonzero) rank k with probability 1/2^{k+1}. This header file does not assume + * a specific random number generator. So the rank must be given when an entry + * is inserted. A fast way (with a single call to a pseudo random generator) to + * compute the rank is with ZIP_FFS32(random()). The ZIP_FFS32 returns the least + * significant nonzero bit of a 32bit number. */ + +#define ZIP_HEAD(name, type) \ +struct name { \ + struct type *zip_root; \ +} + +#define ZIP_INIT(head) do { (head)->zip_root = NULL; } while (0) +#define ZIP_ROOT(head) (head)->zip_root +#define ZIP_EMPTY(head) (ZIP_ROOT(head) == NULL) + +#define ZIP_ENTRY(type) \ +struct { \ + struct type *zip_left; \ + struct type *zip_right; \ + unsigned char rank; \ +} + +#define ZIP_LEFT(elm, field) (elm)->field.zip_left +#define ZIP_RIGHT(elm, field) (elm)->field.zip_right +#define ZIP_RANK(elm, field) (elm)->field.rank + +/* Shortcuts */ +#define ZIP_INSERT(name, head, elm, rank) name##_ZIP_INSERT(head, elm, rank) +#define ZIP_REMOVE(name, head, elm) name##_ZIP_REMOVE(head, elm) +#define ZIP_FIND(name, head, key) name##_ZIP_FIND(head, key) +#define ZIP_MIN(name, head) name##_ZIP_MIN(head) +#define ZIP_MAX(name, head) name##_ZIP_MAX(head) +#define ZIP_ITER(name, head, cb, d) name##_ZIP_ITER(head, cb, d) + +/* Zip tree method prototypes */ +#define ZIP_PROTOTYPE(name, type, keytype) \ +void name##_ZIP_INSERT(struct name *head, struct type *elm, unsigned char rank); \ +void name##_ZIP_REMOVE(struct name *head, struct type *elm); \ +struct type *name##_ZIP_FIND(struct name *head, const keytype *key); \ +struct type *name##_ZIP_MIN(struct name *head); \ +struct type *name##_ZIP_MAX(struct name *head); \ +typedef void (*name##_cb)(struct type *elm, void *data); \ +void name##_ZIP_ITER(struct name *head, name##_cb cb, void *data); \ + +/* The comparison method "cmp" defined for every zip tree has the signature + * + * enum ZIP_CMP cmpDateTime(const keytype *a, const keytype *b); + * + * The entries need an absolute ordering. So ZIP_CMP_EQ must only be returned if + * a and b point to the same memory. (E.g. assured by unique identifiers.) */ +enum ZIP_CMP { + ZIP_CMP_LESS = -1, + ZIP_CMP_EQ = 0, + ZIP_CMP_MORE = 1 +}; + +/* Find the position of the first bit in an unsigned 32bit integer */ +#ifdef _MSC_VER +static __inline +#else +static inline +#endif +unsigned char +ZIP_FFS32(unsigned int v) { + unsigned int t = 1; + unsigned char r = 1; + if(v == 0) return 0; + while((v & t) == 0) { + t = t << 1; r++; + } + return r; +} + +/* Zip tree method implementations */ +#define ZIP_IMPL(name, type, field, keytype, keyfield, cmp) \ +static struct type * \ +__##name##_ZIP_INSERT(struct type *root, struct type *elm) { \ + if(!root) { \ + ZIP_LEFT(elm, field) = NULL; \ + ZIP_RIGHT(elm, field) = NULL; \ + return elm; \ + } \ + if((cmp)(&(elm)->keyfield, &(root)->keyfield) == ZIP_CMP_LESS) { \ + if(__##name##_ZIP_INSERT(ZIP_LEFT(root, field), elm) == elm) { \ + if(ZIP_RANK(elm, field) < ZIP_RANK(root, field)) { \ + ZIP_LEFT(root, field) = elm; \ + } else { \ + ZIP_LEFT(root, field) = ZIP_RIGHT(elm, field); \ + ZIP_RIGHT(elm, field) = root; \ + return elm; \ + } \ + } \ + } else { \ + if(__##name##_ZIP_INSERT(ZIP_RIGHT(root, field), elm) == elm) { \ + if(ZIP_RANK(elm, field) <= ZIP_RANK(root, field)) { \ + ZIP_RIGHT(root, field) = elm; \ + } else { \ + ZIP_RIGHT(root, field) = ZIP_LEFT(elm, field); \ + ZIP_LEFT(elm, field) = root; \ + return elm; \ + } \ + } \ + } \ + return root; \ +} \ + \ +void \ +name##_ZIP_INSERT(struct name *head, struct type *elm, \ + unsigned char rank) { \ + ZIP_RANK(elm, field) = rank; \ + ZIP_ROOT(head) = __##name##_ZIP_INSERT(ZIP_ROOT(head), elm); \ +} \ + \ +static struct type * \ +__##name##ZIP(struct type *x, struct type *y) { \ + if(!x) return y; \ + if(!y) return x; \ + if(ZIP_RANK(x, field) < ZIP_RANK(y, field)) { \ + ZIP_LEFT(y, field) = __##name##ZIP(x, ZIP_LEFT(y, field)); \ + return y; \ + } \ + ZIP_RIGHT(x, field) = __##name##ZIP(ZIP_RIGHT(x, field), y); \ + return x; \ +} \ + \ +/* Modified from the original algorithm. Allow multiple */ \ +/* elements with the same key. */ \ +static struct type * \ +__##name##_ZIP_REMOVE(struct type *root, struct type *elm) { \ + if(root == elm) \ + return __##name##ZIP(ZIP_LEFT(root, field), \ + ZIP_RIGHT(root, field)); \ + enum ZIP_CMP eq = (cmp)(&(elm)->keyfield, &(root)->keyfield); \ + struct type *left = ZIP_LEFT(root, field); \ + struct type *right = ZIP_RIGHT(root, field); \ + if(eq == ZIP_CMP_LESS) { \ + if(elm == left) \ + ZIP_LEFT(root, field) = \ + __##name##ZIP(ZIP_LEFT(left, field), \ + ZIP_RIGHT(left, field)); \ + else if(left) \ + __##name##_ZIP_REMOVE(left, elm); \ + } else if(eq == ZIP_CMP_MORE) { \ + if(elm == right) \ + ZIP_RIGHT(root, field) = \ + __##name##ZIP(ZIP_LEFT(right, field), \ + ZIP_RIGHT(right, field)); \ + else if(right) \ + __##name##_ZIP_REMOVE(right, elm); \ + } else { /* ZIP_CMP_EQ, but root != elm */ \ + if(right) \ + ZIP_RIGHT(root, field) = __##name##_ZIP_REMOVE(right, elm); \ + if(left) \ + ZIP_LEFT(root, field) = __##name##_ZIP_REMOVE(left, elm); \ + } \ + return root; \ +} \ + \ +void \ +name##_ZIP_REMOVE(struct name *head, struct type *elm) { \ + ZIP_ROOT(head) = __##name##_ZIP_REMOVE(ZIP_ROOT(head), elm); \ +} \ + \ +static struct type * \ +__##name##_ZIP_FIND(struct type *root, const keytype *key) { \ + if(!root) \ + return NULL; \ + enum ZIP_CMP eq = (cmp)(key, &(root)->keyfield); \ + if(eq == ZIP_CMP_EQ) { \ + return root; \ + } \ + if(eq == ZIP_CMP_LESS) { \ + return __##name##_ZIP_FIND(ZIP_LEFT(root, field), key); \ + } \ + return __##name##_ZIP_FIND(ZIP_RIGHT(root, field), key); \ +} \ + \ +struct type * \ +name##_ZIP_FIND(struct name *head, const keytype *key) { \ + return __##name##_ZIP_FIND(ZIP_ROOT(head), key); \ +} \ + \ +struct type * \ +name##_ZIP_MIN(struct name *head) { \ + struct type *cur = ZIP_ROOT(head); \ + if(!cur) return NULL; \ + while(ZIP_LEFT(cur, field)) { \ + cur = ZIP_LEFT(cur, field); \ + } \ + return cur; \ +} \ + \ +struct type * \ +name##_ZIP_MAX(struct name *head) { \ + struct type *cur = ZIP_ROOT(head); \ + if(!cur) return NULL; \ + while(ZIP_RIGHT(cur, field)) { \ + cur = ZIP_RIGHT(cur, field); \ + } \ + return cur; \ +} \ + \ +static void \ +__##name##_ZIP_ITER(struct type *elm, name##_cb cb, void *data) { \ + if(!elm) \ + return; \ + __##name##_ZIP_ITER(ZIP_LEFT(elm, field), cb, data); \ + __##name##_ZIP_ITER(ZIP_RIGHT(elm, field), cb, data); \ + cb(elm, data); \ +} \ + \ +void \ +name##_ZIP_ITER(struct name *head, name##_cb cb, void *data) { \ + __##name##_ZIP_ITER(ZIP_ROOT(head), cb, data); \ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/deps/aa_tree.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +enum aa_cmp { + AA_CMP_LESS = -1, + AA_CMP_EQ = 0, + AA_CMP_MORE = 1 +}; + +struct aa_entry { + struct aa_entry *left; + struct aa_entry *right; + unsigned int level; +}; + +struct aa_head { + struct aa_entry *root; + enum aa_cmp (*cmp)(const void* a, const void* b); + /* Offset from the container element to the aa_entry and the key */ + unsigned int entry_offset; + unsigned int key_offset; +}; + +/* The AA-Tree allows duplicate entries. The first matching key is returned in + * aa_find. */ + +void aa_init(struct aa_head *head, + enum aa_cmp (*cmp)(const void*, const void*), + unsigned int entry_offset, unsigned int key_offset); +void aa_insert(struct aa_head *head, void *elem); +void aa_remove(struct aa_head *head, void *elem); +void * aa_find(const struct aa_head *head, const void *key); +void * aa_min(const struct aa_head *head); +void * aa_max(const struct aa_head *head); +void * aa_next(const struct aa_head *head, const void *elem); +void * aa_prev(const struct aa_head *head, const void *elem); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/plugin/nodestore.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Julian Grothoff + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + +/* !!! Warning !!! + * + * If you are not developing a nodestore plugin, then you should not work with + * the definitions from this file directly. The underlying node structures are + * not meant to be used directly by end users. Please use the public server API + * / OPC UA services to interact with the information model. */ + + +_UA_BEGIN_DECLS + +/* Forward declaration */ +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS +struct UA_MonitoredItem; +#endif + +/** + * .. _information-modelling: + * + * Information Modelling + * ===================== + * + * Information modelling in OPC UA combines concepts from object-orientation and + * semantic modelling. At the core, an OPC UA information model is a graph made + * up of + * + * - Nodes: There are eight possible Node types (variable, object, method, ...) + * - References: Typed and directed relations between two nodes + * + * Every node is identified by a unique (within the server) :ref:`nodeid`. + * Reference are triples of the form ``(source-nodeid, referencetype-nodeid, + * target-nodeid)``. An example reference between nodes is a + * ``hasTypeDefinition`` reference between a Variable and its VariableType. Some + * ReferenceTypes are *hierarchic* and must not form *directed loops*. See the + * section on :ref:`ReferenceTypes <referencetypenode>` for more details on + * possible references and their semantics. + * + * **Warning!!** The structures defined in this section are only relevant for + * the developers of custom Nodestores. The interaction with the information + * model is possible only via the OPC UA :ref:`services`. So the following + * sections are purely informational so that users may have a clear mental + * model of the underlying representation. + * + * .. _node-lifecycle: + * + * Node Lifecycle: Constructors, Destructors and Node Contexts + * ----------------------------------------------------------- + * + * To finalize the instantiation of a node, a (user-defined) constructor + * callback is executed. There can be both a global constructor for all nodes + * and node-type constructor specific to the TypeDefinition of the new node + * (attached to an ObjectTypeNode or VariableTypeNode). + * + * In the hierarchy of ObjectTypes and VariableTypes, only the constructor of + * the (lowest) type defined for the new node is executed. Note that every + * Object and Variable can have only one ``isTypeOf`` reference. But type-nodes + * can technically have several ``hasSubType`` references to implement multiple + * inheritance. Issues of (multiple) inheritance in the constructor need to be + * solved by the user. + * + * When a node is destroyed, the node-type destructor is called before the + * global destructor. So the overall node lifecycle is as follows: + * + * 1. Global Constructor (set in the server config) + * 2. Node-Type Constructor (for VariableType or ObjectTypes) + * 3. (Usage-period of the Node) + * 4. Node-Type Destructor + * 5. Global Destructor + * + * The constructor and destructor callbacks can be set to ``NULL`` and are not + * used in that case. If the node-type constructor fails, the global destructor + * will be called before removing the node. The destructors are assumed to never + * fail. + * + * Every node carries a user-context and a constructor-context pointer. The + * user-context is used to attach custom data to a node. But the (user-defined) + * constructors and destructors may replace the user-context pointer if they + * wish to do so. The initial value for the constructor-context is ``NULL``. + * When the ``AddNodes`` service is used over the network, the user-context + * pointer of the new node is also initially set to ``NULL``. + * + * Global Node Lifecycle + * ~~~~~~~~~~~~~~~~~~~~~~ + * Global constructor and destructor callbacks used for every node type. + * To be set in the server config. + */ + +typedef struct { + /* Can be NULL. May replace the nodeContext */ + UA_StatusCode (*constructor)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void **nodeContext); + + /* Can be NULL. The context cannot be replaced since the node is destroyed + * immediately afterwards anyway. */ + void (*destructor)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext); + + /* Can be NULL. Called during recursive node instantiation. While mandatory + * child nodes are automatically created if not already present, optional child + * nodes are not. This callback can be used to define whether an optional child + * node should be created. + * + * @param server The server executing the callback + * @param sessionId The identifier of the session + * @param sessionContext Additional data attached to the session in the + * access control layer + * @param sourceNodeId Source node from the type definition. If the new node + * shall be created, it will be a copy of this node. + * @param targetParentNodeId Parent of the potential new child node + * @param referenceTypeId Identifies the reference type which that the parent + * node has to the new node. + * @return Return UA_TRUE if the child node shall be instantiated, + * UA_FALSE otherwise. */ + UA_Boolean (*createOptionalChild)(UA_Server *server, + const UA_NodeId *sessionId, + void *sessionContext, + const UA_NodeId *sourceNodeId, + const UA_NodeId *targetParentNodeId, + const UA_NodeId *referenceTypeId); + + /* Can be NULL. Called when a node is to be copied during recursive + * node instantiation. Allows definition of the NodeId for the new node. + * If the callback is set to NULL or the resulting NodeId is UA_NODEID_NUMERIC(X,0) + * an unused nodeid in namespace X will be used. E.g. passing UA_NODEID_NULL will + * result in a NodeId in namespace 0. + * + * @param server The server executing the callback + * @param sessionId The identifier of the session + * @param sessionContext Additional data attached to the session in the + * access control layer + * @param sourceNodeId Source node of the copy operation + * @param targetParentNodeId Parent node of the new node + * @param referenceTypeId Identifies the reference type which that the parent + * node has to the new node. */ + UA_StatusCode (*generateChildNodeId)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *sourceNodeId, + const UA_NodeId *targetParentNodeId, + const UA_NodeId *referenceTypeId, + UA_NodeId *targetNodeId); +} UA_GlobalNodeLifecycle; + +/** + * Node Type Lifecycle + * ~~~~~~~~~~~~~~~~~~~ + * Constructor and destructors for specific object and variable types. */ +typedef struct { + /* Can be NULL. May replace the nodeContext */ + UA_StatusCode (*constructor)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeNodeId, void *typeNodeContext, + const UA_NodeId *nodeId, void **nodeContext); + + /* Can be NULL. May replace the nodeContext. */ + void (*destructor)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *typeNodeId, void *typeNodeContext, + const UA_NodeId *nodeId, void **nodeContext); +} UA_NodeTypeLifecycle; + +/** + * ReferenceType Bitfield Representation + * ------------------------------------- + * ReferenceTypes have an alternative represention as an index into a bitfield + * for fast comparison. The index is generated when the corresponding + * ReferenceTypeNode is added. By bounding the number of ReferenceTypes that can + * exist in the server, the bitfield can represent a set of an combination of + * ReferenceTypes. + * + * Every ReferenceTypeNode contains a bitfield with the set of all its subtypes. + * This speeds up the Browse services substantially. + * + * The following ReferenceTypes have a fixed index. The NS0 bootstrapping + * creates these ReferenceTypes in-order. */ +#define UA_REFERENCETYPEINDEX_REFERENCES 0 +#define UA_REFERENCETYPEINDEX_HASSUBTYPE 1 +#define UA_REFERENCETYPEINDEX_AGGREGATES 2 +#define UA_REFERENCETYPEINDEX_HIERARCHICALREFERENCES 3 +#define UA_REFERENCETYPEINDEX_NONHIERARCHICALREFERENCES 4 +#define UA_REFERENCETYPEINDEX_HASCHILD 5 +#define UA_REFERENCETYPEINDEX_ORGANIZES 6 +#define UA_REFERENCETYPEINDEX_HASEVENTSOURCE 7 +#define UA_REFERENCETYPEINDEX_HASMODELLINGRULE 8 +#define UA_REFERENCETYPEINDEX_HASENCODING 9 +#define UA_REFERENCETYPEINDEX_HASDESCRIPTION 10 +#define UA_REFERENCETYPEINDEX_HASTYPEDEFINITION 11 +#define UA_REFERENCETYPEINDEX_GENERATESEVENT 12 +#define UA_REFERENCETYPEINDEX_HASPROPERTY 13 +#define UA_REFERENCETYPEINDEX_HASCOMPONENT 14 +#define UA_REFERENCETYPEINDEX_HASNOTIFIER 15 +#define UA_REFERENCETYPEINDEX_HASORDEREDCOMPONENT 16 +#define UA_REFERENCETYPEINDEX_HASINTERFACE 17 + +/* The maximum number of ReferrenceTypes. Must be a multiple of 32. */ +#define UA_REFERENCETYPESET_MAX 128 +typedef struct { UA_UInt32 bits[UA_REFERENCETYPESET_MAX / 32]; } UA_ReferenceTypeSet; + +static UA_INLINE void +UA_ReferenceTypeSet_init(UA_ReferenceTypeSet *set) { + memset(set, 0, sizeof(UA_ReferenceTypeSet)); +} + +static UA_INLINE void +UA_ReferenceTypeSet_any(UA_ReferenceTypeSet *set) { + memset(set, -1, sizeof(UA_ReferenceTypeSet)); +} + +static UA_INLINE UA_ReferenceTypeSet +UA_REFTYPESET(UA_Byte index) { + UA_Byte i = index / 32, j = index % 32; + UA_ReferenceTypeSet set; + UA_ReferenceTypeSet_init(&set); + set.bits[i] |= ((UA_UInt32)1) << j; + return set; +} + +static UA_INLINE UA_ReferenceTypeSet +UA_ReferenceTypeSet_union(const UA_ReferenceTypeSet setA, + const UA_ReferenceTypeSet setB) { + UA_ReferenceTypeSet set; + for(size_t i = 0; i < UA_REFERENCETYPESET_MAX / 32; i++) + set.bits[i] = setA.bits[i] | setB.bits[i]; + return set; +} + +static UA_INLINE UA_Boolean +UA_ReferenceTypeSet_contains(const UA_ReferenceTypeSet *set, UA_Byte index) { + UA_Byte i = index / 32, j = index % 32; + return !!(set->bits[i] & (((UA_UInt32)1) << j)); +} + +/** + * Base Node Attributes + * -------------------- + * + * Nodes contain attributes according to their node type. The base node + * attributes are common to all node types. In the OPC UA :ref:`services`, + * attributes are referred to via the :ref:`nodeid` of the containing node and + * an integer :ref:`attribute-id`. + * + * Internally, open62541 uses ``UA_Node`` in places where the exact node type is + * not known or not important. The ``nodeClass`` attribute is used to ensure the + * correctness of casting from ``UA_Node`` to a specific node type. */ + +/* Ordered tree structure for fast member check */ +typedef struct UA_ReferenceTarget { + /* Binary-Tree for fast lookup */ + struct aa_entry idTreeEntry; + struct aa_entry nameTreeEntry; + UA_UInt32 targetIdHash; /* Hash of the target's NodeId */ + UA_UInt32 targetNameHash; /* Hash of the target's BrowseName */ + + /* Emulate the queue.h structure so we don't have to include it in the + * public API */ + struct { + struct UA_ReferenceTarget *tqe_next; + struct UA_ReferenceTarget **tqe_prev; + } queuePointers; + + UA_ExpandedNodeId targetId; +} UA_ReferenceTarget; + +/* List of reference targets with the same reference type and direction */ +typedef struct { + UA_Byte referenceTypeIndex; + UA_Boolean isInverse; + + /* Emulate the queue.h structure so we don't have to include it in the + * public API */ + struct { + struct UA_ReferenceTarget *tqh_first; + struct UA_ReferenceTarget **tqh_last; + } queueHead; + struct aa_entry *idTreeRoot; /* Fast lookup based on the target id */ + struct aa_entry *nameTreeRoot; /* Fast lookup based on the target browseName*/ +} UA_NodeReferenceKind; + +/* Every Node starts with these attributes */ +typedef struct { + UA_NodeId nodeId; + UA_NodeClass nodeClass; + UA_QualifiedName browseName; + UA_LocalizedText displayName; + UA_LocalizedText description; + UA_UInt32 writeMask; + size_t referencesSize; + UA_NodeReferenceKind *references; + + /* Members specific to open62541 */ + void *context; + UA_Boolean constructed; /* Constructors were called */ +} UA_NodeHead; + +/** + * VariableNode + * ------------ + * + * Variables store values in a :ref:`datavalue` together with + * metadata for introspection. Most notably, the attributes data type, value + * rank and array dimensions constrain the possible values the variable can take + * on. + * + * Variables come in two flavours: properties and datavariables. Properties are + * related to a parent with a ``hasProperty`` reference and may not have child + * nodes themselves. Datavariables may contain properties (``hasProperty``) and + * also datavariables (``hasComponents``). + * + * All variables are instances of some :ref:`variabletypenode` in return + * constraining the possible data type, value rank and array dimensions + * attributes. + * + * Data Type + * ~~~~~~~~~ + * + * The (scalar) data type of the variable is constrained to be of a specific + * type or one of its children in the type hierarchy. The data type is given as + * a NodeId pointing to a :ref:`datatypenode` in the type hierarchy. See the + * Section :ref:`datatypenode` for more details. + * + * If the data type attribute points to ``UInt32``, then the value attribute + * must be of that exact type since ``UInt32`` does not have children in the + * type hierarchy. If the data type attribute points ``Number``, then the type + * of the value attribute may still be ``UInt32``, but also ``Float`` or + * ``Byte``. + * + * Consistency between the data type attribute in the variable and its + * :ref:`VariableTypeNode` is ensured. + * + * Value Rank + * ~~~~~~~~~~ + * + * This attribute indicates whether the value attribute of the variable is an + * array and how many dimensions the array has. It may have the following + * values: + * + * - ``n >= 1``: the value is an array with the specified number of dimensions + * - ``n = 0``: the value is an array with one or more dimensions + * - ``n = -1``: the value is a scalar + * - ``n = -2``: the value can be a scalar or an array with any number of dimensions + * - ``n = -3``: the value can be a scalar or a one dimensional array + * + * Consistency between the value rank attribute in the variable and its + * :ref:`variabletypenode` is ensured. + * + * Array Dimensions + * ~~~~~~~~~~~~~~~~ + * + * If the value rank permits the value to be a (multi-dimensional) array, the + * exact length in each dimensions can be further constrained with this + * attribute. + * + * - For positive lengths, the variable value is guaranteed to be of the same + * length in this dimension. + * - The dimension length zero is a wildcard and the actual value may have any + * length in this dimension. + * + * Consistency between the array dimensions attribute in the variable and its + * :ref:`variabletypenode` is ensured. */ + +/* Indicates whether a variable contains data inline or whether it points to an + * external data source */ +typedef enum { + UA_VALUESOURCE_DATA, + UA_VALUESOURCE_DATASOURCE +} UA_ValueSource; + +typedef struct { + /* Called before the value attribute is read. It is possible to write into the + * value attribute during onRead (using the write service). The node is + * re-opened afterwards so that changes are considered in the following read + * operation. + * + * @param handle Points to user-provided data for the callback. + * @param nodeid The identifier of the node. + * @param data Points to the current node value. + * @param range Points to the numeric range the client wants to read from + * (or NULL). */ + void (*onRead)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeid, + void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *value); + + /* Called after writing the value attribute. The node is re-opened after + * writing so that the new value is visible in the callback. + * + * @param server The server executing the callback + * @sessionId The identifier of the session + * @sessionContext Additional data attached to the session + * in the access control layer + * @param nodeid The identifier of the node. + * @param nodeUserContext Additional data attached to the node by + * the user. + * @param nodeConstructorContext Additional data attached to the node + * by the type constructor(s). + * @param range Points to the numeric range the client wants to write to (or + * NULL). */ + void (*onWrite)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *data); +} UA_ValueCallback; + +typedef struct { + /* Copies the data from the source into the provided value. + * + * !! ZERO-COPY OPERATIONS POSSIBLE !! + * It is not required to return a copy of the actual content data. You can + * return a pointer to memory owned by the user. Memory can be reused + * between read callbacks of a DataSource, as the result is already encoded + * on the network buffer between each read operation. + * + * To use zero-copy reads, set the value of the `value->value` Variant + * without copying, e.g. with `UA_Variant_setScalar`. Then, also set + * `value->value.storageType` to `UA_VARIANT_DATA_NODELETE` to prevent the + * memory being cleaned up. Don't forget to also set `value->hasValue` to + * true to indicate the presence of a value. + * + * @param server The server executing the callback + * @param sessionId The identifier of the session + * @param sessionContext Additional data attached to the session in the + * access control layer + * @param nodeId The identifier of the node being read from + * @param nodeContext Additional data attached to the node by the user + * @param includeSourceTimeStamp If true, then the datasource is expected to + * set the source timestamp in the returned value + * @param range If not null, then the datasource shall return only a + * selection of the (nonscalar) data. Set + * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not + * apply + * @param value The (non-null) DataValue that is returned to the client. The + * data source sets the read data, the result status and optionally a + * sourcetimestamp. + * @return Returns a status code for logging. Error codes intended for the + * original caller are set in the value. If an error is returned, + * then no releasing of the value is done + */ + UA_StatusCode (*read)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, UA_Boolean includeSourceTimeStamp, + const UA_NumericRange *range, UA_DataValue *value); + + /* Write into a data source. This method pointer can be NULL if the + * operation is unsupported. + * + * @param server The server executing the callback + * @param sessionId The identifier of the session + * @param sessionContext Additional data attached to the session in the + * access control layer + * @param nodeId The identifier of the node being written to + * @param nodeContext Additional data attached to the node by the user + * @param range If not NULL, then the datasource shall return only a + * selection of the (nonscalar) data. Set + * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not + * apply + * @param value The (non-NULL) DataValue that has been written by the client. + * The data source contains the written data, the result status and + * optionally a sourcetimestamp + * @return Returns a status code for logging. Error codes intended for the + * original caller are set in the value. If an error is returned, + * then no releasing of the value is done + */ + UA_StatusCode (*write)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *value); +} UA_DataSource; + +/** + * .. _value-callback: + * + * Value Callback + * ~~~~~~~~~~~~~~ + * Value Callbacks can be attached to variable and variable type nodes. If + * not ``NULL``, they are called before reading and after writing respectively. */ +typedef struct { + /* Called before the value attribute is read. The external value source can be + * be updated and/or locked during this notification call. After this function returns + * to the core, the external value source is readed immediately. + */ + UA_StatusCode (*notificationRead)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeid, + void *nodeContext, const UA_NumericRange *range); + + /* Called after writing the value attribute. The node is re-opened after + * writing so that the new value is visible in the callback. + * + * @param server The server executing the callback + * @sessionId The identifier of the session + * @sessionContext Additional data attached to the session + * in the access control layer + * @param nodeid The identifier of the node. + * @param nodeUserContext Additional data attached to the node by + * the user. + * @param nodeConstructorContext Additional data attached to the node + * by the type constructor(s). + * @param range Points to the numeric range the client wants to write to (or + * NULL). */ + UA_StatusCode (*userWrite)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *nodeId, + void *nodeContext, const UA_NumericRange *range, + const UA_DataValue *data); +} UA_ExternalValueCallback; + +typedef enum { + UA_VALUEBACKENDTYPE_NONE, + UA_VALUEBACKENDTYPE_INTERNAL, + UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK, + UA_VALUEBACKENDTYPE_EXTERNAL +} UA_ValueBackendType; + +typedef struct { + UA_ValueBackendType backendType; + union { + struct { + UA_DataValue value; + UA_ValueCallback callback; + } internal; + UA_DataSource dataSource; + struct { + UA_DataValue **value; + UA_ExternalValueCallback callback; + } external; + } backend; +} UA_ValueBackend; + +#define UA_NODE_VARIABLEATTRIBUTES \ + /* Constraints on possible values */ \ + UA_NodeId dataType; \ + UA_Int32 valueRank; \ + size_t arrayDimensionsSize; \ + UA_UInt32 *arrayDimensions; \ + \ + UA_ValueBackend valueBackend; \ + \ + /* The current value */ \ + UA_ValueSource valueSource; \ + union { \ + struct { \ + UA_DataValue value; \ + UA_ValueCallback callback; \ + } data; \ + UA_DataSource dataSource; \ + } value; + +typedef struct { + UA_NodeHead head; + UA_NODE_VARIABLEATTRIBUTES + UA_Byte accessLevel; + UA_Double minimumSamplingInterval; + UA_Boolean historizing; + + /* Members specific to open62541 */ + UA_Boolean isDynamic; /* Some variables are "static" in the sense that they + * are not attached to a dynamic process in the + * background. Only dynamic variables conserve source + * and server timestamp for the value attribute. + * Static variables have timestamps of "now". */ +} UA_VariableNode; + +/** + * .. _variabletypenode: + * + * VariableTypeNode + * ---------------- + * + * VariableTypes are used to provide type definitions for variables. + * VariableTypes constrain the data type, value rank and array dimensions + * attributes of variable instances. Furthermore, instantiating from a specific + * variable type may provide semantic information. For example, an instance from + * ``MotorTemperatureVariableType`` is more meaningful than a float variable + * instantiated from ``BaseDataVariable``. */ + +typedef struct { + UA_NodeHead head; + UA_NODE_VARIABLEATTRIBUTES + UA_Boolean isAbstract; + + /* Members specific to open62541 */ + UA_NodeTypeLifecycle lifecycle; +} UA_VariableTypeNode; + +/** + * .. _methodnode: + * + * MethodNode + * ---------- + * + * Methods define callable functions and are invoked using the :ref:`Call + * <method-services>` service. MethodNodes may have special properties (variable + * children with a ``hasProperty`` reference) with the :ref:`qualifiedname` ``(0, + * "InputArguments")`` and ``(0, "OutputArguments")``. The input and output + * arguments are both described via an array of ``UA_Argument``. While the Call + * service uses a generic array of :ref:`variant` for input and output, the + * actual argument values are checked to match the signature of the MethodNode. + * + * Note that the same MethodNode may be referenced from several objects (and + * object types). For this, the NodeId of the method *and of the object + * providing context* is part of a Call request message. */ + +typedef UA_StatusCode +(*UA_MethodCallback)(UA_Server *server, const UA_NodeId *sessionId, + void *sessionContext, const UA_NodeId *methodId, + void *methodContext, const UA_NodeId *objectId, + void *objectContext, size_t inputSize, + const UA_Variant *input, size_t outputSize, + UA_Variant *output); + +typedef struct { + UA_NodeHead head; + UA_Boolean executable; + + /* Members specific to open62541 */ + UA_MethodCallback method; +#if UA_MULTITHREADING >= 100 + UA_Boolean async; /* Indicates an async method call */ +#endif +} UA_MethodNode; + +/** + * ObjectNode + * ---------- + * + * Objects are used to represent systems, system components, real-world objects + * and software objects. Objects are instances of an :ref:`object + * type<objecttypenode>` and may contain variables, methods and further + * objects. */ + +typedef struct { + UA_NodeHead head; +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + struct UA_MonitoredItem *monitoredItemQueue; +#endif + UA_Byte eventNotifier; +} UA_ObjectNode; + +/** + * .. _objecttypenode: + * + * ObjectTypeNode + * -------------- + * + * ObjectTypes provide definitions for Objects. Abstract objects cannot be + * instantiated. See :ref:`node-lifecycle` for the use of constructor and + * destructor callbacks. */ + +typedef struct { + UA_NodeHead head; + UA_Boolean isAbstract; + + /* Members specific to open62541 */ + UA_NodeTypeLifecycle lifecycle; +} UA_ObjectTypeNode; + +/** + * .. _referencetypenode: + * + * ReferenceTypeNode + * ----------------- + * + * Each reference between two nodes is typed with a ReferenceType that gives + * meaning to the relation. The OPC UA standard defines a set of ReferenceTypes + * as a mandatory part of OPC UA information models. + * + * - Abstract ReferenceTypes cannot be used in actual references and are only + * used to structure the ReferenceTypes hierarchy + * - Symmetric references have the same meaning from the perspective of the + * source and target node + * + * The figure below shows the hierarchy of the standard ReferenceTypes (arrows + * indicate a ``hasSubType`` relation). Refer to Part 3 of the OPC UA + * specification for the full semantics of each ReferenceType. + * + * .. graphviz:: + * + * digraph tree { + * + * node [height=0, shape=box, fillcolor="#E5E5E5", concentrate=true] + * + * references [label="References\n(Abstract, Symmetric)"] + * hierarchical_references [label="HierarchicalReferences\n(Abstract)"] + * references -> hierarchical_references + * + * nonhierarchical_references [label="NonHierarchicalReferences\n(Abstract, Symmetric)"] + * references -> nonhierarchical_references + * + * haschild [label="HasChild\n(Abstract)"] + * hierarchical_references -> haschild + * + * aggregates [label="Aggregates\n(Abstract)"] + * haschild -> aggregates + * + * organizes [label="Organizes"] + * hierarchical_references -> organizes + * + * hascomponent [label="HasComponent"] + * aggregates -> hascomponent + * + * hasorderedcomponent [label="HasOrderedComponent"] + * hascomponent -> hasorderedcomponent + * + * hasproperty [label="HasProperty"] + * aggregates -> hasproperty + * + * hassubtype [label="HasSubtype"] + * haschild -> hassubtype + * + * hasmodellingrule [label="HasModellingRule"] + * nonhierarchical_references -> hasmodellingrule + * + * hastypedefinition [label="HasTypeDefinition"] + * nonhierarchical_references -> hastypedefinition + * + * hasencoding [label="HasEncoding"] + * nonhierarchical_references -> hasencoding + * + * hasdescription [label="HasDescription"] + * nonhierarchical_references -> hasdescription + * + * haseventsource [label="HasEventSource"] + * hierarchical_references -> haseventsource + * + * hasnotifier [label="HasNotifier"] + * hierarchical_references -> hasnotifier + * + * generatesevent [label="GeneratesEvent"] + * nonhierarchical_references -> generatesevent + * + * alwaysgeneratesevent [label="AlwaysGeneratesEvent"] + * generatesevent -> alwaysgeneratesevent + * + * {rank=same hierarchical_references nonhierarchical_references} + * {rank=same generatesevent haseventsource hasmodellingrule + * hasencoding hassubtype} + * {rank=same alwaysgeneratesevent hasproperty} + * + * } + * + * The ReferenceType hierarchy can be extended with user-defined ReferenceTypes. + * Many Companion Specifications for OPC UA define new ReferenceTypes to be used + * in their domain of interest. + * + * For the following example of custom ReferenceTypes, we attempt to model the + * structure of a technical system. For this, we introduce two custom + * ReferenceTypes. First, the hierarchical ``contains`` ReferenceType indicates + * that a system (represented by an OPC UA object) contains a component (or + * subsystem). This gives rise to a tree-structure of containment relations. For + * example, the motor (object) is contained in the car and the crankshaft is + * contained in the motor. Second, the symmetric ``connectedTo`` ReferenceType + * indicates that two components are connected. For example, the motor's + * crankshaft is connected to the gear box. Connections are independent of the + * containment hierarchy and can induce a general graph-structure. Further + * subtypes of ``connectedTo`` could be used to differentiate between physical, + * electrical and information related connections. A client can then learn the + * layout of a (physical) system represented in an OPC UA information model + * based on a common understanding of just two custom reference types. */ + +typedef struct { + UA_NodeHead head; + UA_Boolean isAbstract; + UA_Boolean symmetric; + UA_LocalizedText inverseName; + + /* Members specific to open62541 */ + UA_Byte referenceTypeIndex; + UA_ReferenceTypeSet subTypes; /* contains the type itself as well */ +} UA_ReferenceTypeNode; + +/** + * .. _datatypenode: + * + * DataTypeNode + * ------------ + * + * DataTypes represent simple and structured data types. DataTypes may contain + * arrays. But they always describe the structure of a single instance. In + * open62541, DataTypeNodes in the information model hierarchy are matched to + * ``UA_DataType`` type descriptions for :ref:`generic-types` via their NodeId. + * + * Abstract DataTypes (e.g. ``Number``) cannot be the type of actual values. + * They are used to constrain values to possible child DataTypes (e.g. + * ``UInt32``). */ + +typedef struct { + UA_NodeHead head; + UA_Boolean isAbstract; +} UA_DataTypeNode; + +/** + * ViewNode + * -------- + * + * Each View defines a subset of the Nodes in the AddressSpace. Views can be + * used when browsing an information model to focus on a subset of nodes and + * references only. ViewNodes can be created and be interacted with. But their + * use in the :ref:`Browse<view-services>` service is currently unsupported in + * open62541. */ + +typedef struct { + UA_NodeHead head; + UA_Byte eventNotifier; + UA_Boolean containsNoLoops; +} UA_ViewNode; + +/** + * Node Union + * ---------- + * + * A union that represents any kind of node. The node head can always be used. + * Check the NodeClass before accessing specific content. + */ + +typedef union { + UA_NodeHead head; + UA_VariableNode variableNode; + UA_VariableTypeNode variableTypeNode; + UA_MethodNode methodNode; + UA_ObjectNode objectNode; + UA_ObjectTypeNode objectTypeNode; + UA_ReferenceTypeNode referenceTypeNode; + UA_DataTypeNode dataTypeNode; + UA_ViewNode viewNode; +} UA_Node; + +/** + * Nodestore Plugin API + * -------------------- + * + * The following definitions are used for implementing custom node storage + * backends. **Most users will want to use the default nodestore and don't need + * to work with the nodestore API**. + * + * Outside of custom nodestore implementations, users should not manually edit + * nodes. Please use the OPC UA services for that. Otherwise, all consistency + * checks are omitted. This can crash the application eventually. */ + +typedef void (*UA_NodestoreVisitor)(void *visitorCtx, const UA_Node *node); + +typedef struct { + /* Nodestore context and lifecycle */ + void *context; + void (*clear)(void *nsCtx); + + /* The following definitions are used to create empty nodes of the different + * node types. The memory is managed by the nodestore. Therefore, the node + * has to be removed via a special deleteNode function. (If the new node is + * not added to the nodestore.) */ + UA_Node * (*newNode)(void *nsCtx, UA_NodeClass nodeClass); + + void (*deleteNode)(void *nsCtx, UA_Node *node); + + /* ``Get`` returns a pointer to an immutable node. ``Release`` indicates + * that the pointer is no longer accessed afterwards. */ + const UA_Node * (*getNode)(void *nsCtx, const UA_NodeId *nodeId); + + void (*releaseNode)(void *nsCtx, const UA_Node *node); + + /* Returns an editable copy of a node (needs to be deleted with the + * deleteNode function or inserted / replaced into the nodestore). */ + UA_StatusCode (*getNodeCopy)(void *nsCtx, const UA_NodeId *nodeId, + UA_Node **outNode); + + /* Inserts a new node into the nodestore. If the NodeId is zero, then a + * fresh numeric NodeId is assigned. If insertion fails, the node is + * deleted. */ + UA_StatusCode (*insertNode)(void *nsCtx, UA_Node *node, + UA_NodeId *addedNodeId); + + /* To replace a node, get an editable copy of the node, edit and replace + * with this function. If the node was already replaced since the copy was + * made, UA_STATUSCODE_BADINTERNALERROR is returned. If the NodeId is not + * found, UA_STATUSCODE_BADNODEIDUNKNOWN is returned. In both error cases, + * the editable node is deleted. */ + UA_StatusCode (*replaceNode)(void *nsCtx, UA_Node *node); + + /* Removes a node from the nodestore. */ + UA_StatusCode (*removeNode)(void *nsCtx, const UA_NodeId *nodeId); + + /* Maps the ReferenceTypeIndex used for the references to the NodeId of the + * ReferenceType. The returned pointer is stable until the Nodestore is + * deleted. */ + const UA_NodeId * (*getReferenceTypeId)(void *nsCtx, UA_Byte refTypeIndex); + + /* Execute a callback for every node in the nodestore. */ + void (*iterate)(void *nsCtx, UA_NodestoreVisitor visitor, + void *visitorCtx); +} UA_Nodestore; + +/* Attributes must be of a matching type (VariableAttributes, ObjectAttributes, + * and so on). The attributes are copied. Note that the attributes structs do + * not contain NodeId, NodeClass and BrowseName. The NodeClass of the node needs + * to be correctly set before calling this method. UA_Node_clear is called on + * the node when an error occurs internally. */ +UA_StatusCode UA_EXPORT +UA_Node_setAttributes(UA_Node *node, const void *attributes, + const UA_DataType *attributeType); + +/* Reset the destination node and copy the content of the source */ +UA_StatusCode UA_EXPORT +UA_Node_copy(const UA_Node *src, UA_Node *dst); + +/* Allocate new node and copy the values from src */ +UA_EXPORT UA_Node * +UA_Node_copy_alloc(const UA_Node *src); + +/* Add a single reference to the node */ +UA_StatusCode UA_EXPORT +UA_Node_addReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, + const UA_ExpandedNodeId *targetNodeId, + UA_UInt32 targetBrowseNameHash); + +/* Delete a single reference from the node */ +UA_StatusCode UA_EXPORT +UA_Node_deleteReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, + const UA_ExpandedNodeId *targetNodeId); + +/* Deletes references from the node which are not matching any type in the given + * array. Could be used to e.g. delete all the references, except + * 'HASMODELINGRULE' */ +void UA_EXPORT +UA_Node_deleteReferencesSubset(UA_Node *node, const UA_ReferenceTypeSet *keepSet); + +/* Delete all references of the node */ +void UA_EXPORT +UA_Node_deleteReferences(UA_Node *node); + +/* Remove all malloc'ed members of the node and reset */ +void UA_EXPORT +UA_Node_clear(UA_Node *node); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/server.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2014-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2014-2015, 2017 (c) Florian Palm + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015-2016 (c) Oleksiy Vasylyev + * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Henrik Norrman + * Copyright 2018 (c) Fabian Arndt, Root-Core + * Copyright 2017-2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + * Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart (for VDW and umati) + */ + + + + +#ifdef UA_ENABLE_PUBSUB +#endif + +#ifdef UA_ENABLE_HISTORIZING +#endif + +_UA_BEGIN_DECLS + +/** + * .. _server: + * + * Server + * ====== + * + * .. _server-configuration: + * + * Server Configuration + * -------------------- + * + * The configuration structure is passed to the server during initialization. + * The server expects that the configuration is not modified during runtime. + * Currently, only one server can use a configuration at a time. During + * shutdown, the server will clean up the parts of the configuration that are + * modified at runtime through the provided API. + * + * Examples for configurations are provided in the ``/plugins`` folder. + * The usual usage is as follows: + * + * 1. Create a server configuration with default settings as a starting point + * 2. Modifiy the configuration, e.g. by adding a server certificate + * 3. Instantiate a server with it + * 4. After shutdown of the server, clean up the configuration (free memory) + * + * The :ref:`tutorials` provide a good starting point for this. */ + +struct UA_PubSubConfiguration; +typedef struct UA_PubSubConfiguration UA_PubSubConfiguration; + +typedef struct { + UA_UInt32 min; + UA_UInt32 max; +} UA_UInt32Range; + +typedef struct { + UA_Duration min; + UA_Duration max; +} UA_DurationRange; + +typedef void (*UA_Server_AsyncOperationNotifyCallback)(UA_Server *server); + +struct UA_ServerConfig { + UA_Logger logger; + + /* Server Description: + * The description must be internally consistent. + * - The ApplicationUri set in the ApplicationDescription must match the + * URI set in the server certificate */ + UA_BuildInfo buildInfo; + UA_ApplicationDescription applicationDescription; + UA_ByteString serverCertificate; + + UA_Double shutdownDelay; /* Delay in ms from the shutdown signal (ctrl-c) + until the actual shutdown. Clients need to be + able to get a notification ahead of time. */ + + /* Rule Handling */ + UA_RuleHandling verifyRequestTimestamp; /* Verify that the server sends a + * timestamp in the request header */ + UA_RuleHandling allowEmptyVariables; /* Variables (that don't have a + * DataType of BaseDataType) must not + * have an empty variant value. The + * default behaviour is to auto-create + * a matching zeroed-out value for + * empty VariableNodes when they are + * added. */ + + /* Custom DataTypes. Attention! Custom datatypes are not cleaned up together + * with the configuration. So it is possible to allocate them on ROM. */ + const UA_DataTypeArray *customDataTypes; + + /** + * .. note:: See the section on :ref:`generic-types`. Examples for working + * with custom data types are provided in + * ``/examples/custom_datatype/``. */ + + /* Networking */ + size_t networkLayersSize; + UA_ServerNetworkLayer *networkLayers; + UA_String customHostname; + +#ifdef UA_ENABLE_PUBSUB + /*PubSub network layer */ + size_t pubsubTransportLayersSize; + UA_PubSubTransportLayer *pubsubTransportLayers; + UA_PubSubConfiguration *pubsubConfiguration; +#endif /* UA_ENABLE_PUBSUB */ + + /* Available security policies */ + size_t securityPoliciesSize; + UA_SecurityPolicy* securityPolicies; + + /* Available endpoints */ + size_t endpointsSize; + UA_EndpointDescription *endpoints; + + /* Only allow the following discovery services to be executed on a + * SecureChannel with SecurityPolicyNone: GetEndpointsRequest, + * FindServersRequest and FindServersOnNetworkRequest. + * + * Only enable this option if there is no endpoint with SecurityPolicy#None + * in the endpoints list. The SecurityPolicy#None must be present in the + * securityPolicies list. */ + UA_Boolean securityPolicyNoneDiscoveryOnly; + + /* Node Lifecycle callbacks */ + UA_GlobalNodeLifecycle nodeLifecycle; + + /** + * .. note:: See the section for :ref:`node lifecycle + * handling<node-lifecycle>`. */ + + /* Access Control */ + UA_AccessControl accessControl; + + /** + * .. note:: See the section for :ref:`access-control + * handling<access-control>`. */ + + /* Async Operations */ +#if UA_MULTITHREADING >= 100 + UA_Double asyncOperationTimeout; /* in ms, 0 => unlimited */ + size_t maxAsyncOperationQueueSize; /* 0 => unlimited */ + /* Notify workers when an async operation was enqueued */ + UA_Server_AsyncOperationNotifyCallback asyncOperationNotifyCallback; +#endif + + /** + * .. note:: See the section for :ref:`async + * operations<async-operations>`. */ + + /* Nodestore */ + UA_Nodestore nodestore; + + /* Certificate Verification */ + UA_CertificateVerification certificateVerification; + + /* Limits for SecureChannels */ + UA_UInt16 maxSecureChannels; + UA_UInt32 maxSecurityTokenLifetime; /* in ms */ + + /* Limits for Sessions */ + UA_UInt16 maxSessions; + UA_Double maxSessionTimeout; /* in ms */ + + /* Operation limits */ + UA_UInt32 maxNodesPerRead; + UA_UInt32 maxNodesPerWrite; + UA_UInt32 maxNodesPerMethodCall; + UA_UInt32 maxNodesPerBrowse; + UA_UInt32 maxNodesPerRegisterNodes; + UA_UInt32 maxNodesPerTranslateBrowsePathsToNodeIds; + UA_UInt32 maxNodesPerNodeManagement; + UA_UInt32 maxMonitoredItemsPerCall; + + /* Limits for Requests */ + UA_UInt32 maxReferencesPerNode; + + /* Discovery */ +#ifdef UA_ENABLE_DISCOVERY + /* Timeout in seconds when to automatically remove a registered server from + * the list, if it doesn't re-register within the given time frame. A value + * of 0 disables automatic removal. Default is 60 Minutes (60*60). Must be + * bigger than 10 seconds, because cleanup is only triggered approximately + * every 10 seconds. The server will still be removed depending on the + * state of the semaphore file. */ + UA_UInt32 discoveryCleanupTimeout; + +# ifdef UA_ENABLE_DISCOVERY_MULTICAST + UA_Boolean mdnsEnabled; + UA_MdnsDiscoveryConfiguration mdnsConfig; + UA_String mdnsInterfaceIP; +# if !defined(UA_HAS_GETIFADDR) + size_t mdnsIpAddressListSize; + UA_UInt32 *mdnsIpAddressList; +# endif +# endif +#endif + + /* Subscriptions */ +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* Limits for Subscriptions */ + UA_UInt32 maxSubscriptions; + UA_UInt32 maxSubscriptionsPerSession; + UA_DurationRange publishingIntervalLimits; /* in ms (must not be less than 5) */ + UA_UInt32Range lifeTimeCountLimits; + UA_UInt32Range keepAliveCountLimits; + UA_UInt32 maxNotificationsPerPublish; + UA_Boolean enableRetransmissionQueue; + UA_UInt32 maxRetransmissionQueueSize; /* 0 -> unlimited size */ +# ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + UA_UInt32 maxEventsPerNode; /* 0 -> unlimited size */ +# endif + + /* Limits for MonitoredItems */ + UA_UInt32 maxMonitoredItems; + UA_UInt32 maxMonitoredItemsPerSubscription; + UA_DurationRange samplingIntervalLimits; /* in ms (must not be less than 5) */ + UA_UInt32Range queueSizeLimits; /* Negotiated with the client */ + + /* Limits for PublishRequests */ + UA_UInt32 maxPublishReqPerSession; + + /* Register MonitoredItem in Userland + * + * @param server Allows the access to the server object + * @param sessionId The session id, represented as an node id + * @param sessionContext An optional pointer to user-defined data for the specific data source + * @param nodeid Id of the node in question + * @param nodeidContext An optional pointer to user-defined data, associated + * with the node in the nodestore. Note that, if the node has already been removed, + * this value contains a NULL pointer. + * @param attributeId Identifies which attribute (value, data type etc.) is monitored + * @param removed Determines if the MonitoredItem was removed or created. */ + void (*monitoredItemRegisterCallback)(UA_Server *server, + const UA_NodeId *sessionId, void *sessionContext, + const UA_NodeId *nodeId, void *nodeContext, + UA_UInt32 attibuteId, UA_Boolean removed); +#endif + + /* Historical Access */ +#ifdef UA_ENABLE_HISTORIZING + UA_HistoryDatabase historyDatabase; + + UA_Boolean accessHistoryDataCapability; + UA_UInt32 maxReturnDataValues; /* 0 -> unlimited size */ + + UA_Boolean accessHistoryEventsCapability; + UA_UInt32 maxReturnEventValues; /* 0 -> unlimited size */ + + UA_Boolean insertDataCapability; + UA_Boolean insertEventCapability; + UA_Boolean insertAnnotationsCapability; + + UA_Boolean replaceDataCapability; + UA_Boolean replaceEventCapability; + + UA_Boolean updateDataCapability; + UA_Boolean updateEventCapability; + + UA_Boolean deleteRawCapability; + UA_Boolean deleteEventCapability; + UA_Boolean deleteAtTimeDataCapability; +#endif +}; + +void UA_EXPORT +UA_ServerConfig_clean(UA_ServerConfig *config); + +/* Set a custom hostname in server configuration */ +UA_DEPRECATED static UA_INLINE void +UA_ServerConfig_setCustomHostname(UA_ServerConfig *config, + const UA_String customHostname) { + UA_String_clear(&config->customHostname); + UA_String_copy(&customHostname, &config->customHostname); +} + +/** + * .. _server-lifecycle: + * + * Server Lifecycle + * ---------------- */ + +/* The method UA_Server_new is defined in server_config_default.h. So default + * plugins outside of the core library (for logging, etc) are already available + * during the initialization. + * + * UA_Server UA_EXPORT * UA_Server_new(void); + */ + +/* Creates a new server. Moves the config into the server with a shallow copy. + * The config content is cleared together with the server. */ +UA_Server UA_EXPORT * +UA_Server_newWithConfig(UA_ServerConfig *config); + +void UA_EXPORT UA_Server_delete(UA_Server *server); + +UA_ServerConfig UA_EXPORT * +UA_Server_getConfig(UA_Server *server); + +/* Runs the main loop of the server. In each iteration, this calls into the + * networklayers to see if messages have arrived. + * + * @param server The server object. + * @param running The loop is run as long as *running is true. + * Otherwise, the server shuts down. + * @return Returns the statuscode of the UA_Server_run_shutdown method */ +UA_StatusCode UA_EXPORT +UA_Server_run(UA_Server *server, const volatile UA_Boolean *running); + +/* The prologue part of UA_Server_run (no need to use if you call + * UA_Server_run) */ +UA_StatusCode UA_EXPORT +UA_Server_run_startup(UA_Server *server); + +/* Executes a single iteration of the server's main loop. + * + * @param server The server object. + * @param waitInternal Should we wait for messages in the networklayer? + * Otherwise, the timouts for the networklayers are set to zero. + * The default max wait time is 50millisec. + * @return Returns how long we can wait until the next scheduled + * callback (in ms) */ +UA_UInt16 UA_EXPORT +UA_Server_run_iterate(UA_Server *server, UA_Boolean waitInternal); + +/* The epilogue part of UA_Server_run (no need to use if you call + * UA_Server_run) */ +UA_StatusCode UA_EXPORT +UA_Server_run_shutdown(UA_Server *server); + +/** + * Timed Callbacks + * --------------- */ +typedef void (*UA_ServerCallback)(UA_Server *server, void *data); + +/* Add a callback for execution at a specified time. If the indicated time lies + * in the past, then the callback is executed at the next iteration of the + * server's main loop. + * + * @param server The server object. + * @param callback The callback that shall be added. + * @param data Data that is forwarded to the callback. + * @param date The timestamp for the execution time. + * @param callbackId Set to the identifier of the repeated callback . This can + * be used to cancel the callback later on. If the pointer is null, the + * identifier is not set. + * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code + * otherwise. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addTimedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_DateTime date, UA_UInt64 *callbackId); + +/* Add a callback for cyclic repetition to the server. + * + * @param server The server object. + * @param callback The callback that shall be added. + * @param data Data that is forwarded to the callback. + * @param interval_ms The callback shall be repeatedly executed with the given + * interval (in ms). The interval must be positive. The first execution + * occurs at now() + interval at the latest. + * @param callbackId Set to the identifier of the repeated callback . This can + * be used to cancel the callback later on. If the pointer is null, the + * identifier is not set. + * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code + * otherwise. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, + UA_Double interval_ms); + +/* Remove a repeated callback. Does nothing if the callback is not found. + * + * @param server The server object. + * @param callbackId The id of the callback */ +void UA_EXPORT UA_THREADSAFE +UA_Server_removeCallback(UA_Server *server, UA_UInt64 callbackId); + +#define UA_Server_removeRepeatedCallback(server, callbackId) \ + UA_Server_removeCallback(server, callbackId); + +/** + * Reading and Writing Node Attributes + * ----------------------------------- + * The functions for reading and writing node attributes call the regular read + * and write service in the background that are also used over the network. + * + * The following attributes cannot be read, since the local "admin" user always + * has full rights. + * + * - UserWriteMask + * - UserAccessLevel + * - UserExecutable */ +/* Read an attribute of a node. The specialized functions below provide a more + * concise syntax. + * + * @param server The server object. + * @param item ReadValueIds contain the NodeId of the target node, the id of the + * attribute to read and (optionally) an index range to read parts + * of an array only. See the section on NumericRange for the format + * used for array ranges. + * @param timestamps Which timestamps to return for the attribute. + * @return Returns a DataValue that contains either an error code, or a variant + * with the attribute value and the timestamps. */ +UA_DataValue UA_EXPORT UA_THREADSAFE +UA_Server_read(UA_Server *server, const UA_ReadValueId *item, + UA_TimestampsToReturn timestamps); + +/* Don't use this function. There are typed versions for every supported + * attribute. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +__UA_Server_read(UA_Server *server, const UA_NodeId *nodeId, + UA_AttributeId attributeId, void *v); + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readNodeId(UA_Server *server, const UA_NodeId nodeId, + UA_NodeId *outNodeId) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_NODEID, outNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readNodeClass(UA_Server *server, const UA_NodeId nodeId, + UA_NodeClass *outNodeClass) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_NODECLASS, + outNodeClass); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readBrowseName(UA_Server *server, const UA_NodeId nodeId, + UA_QualifiedName *outBrowseName) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_BROWSENAME, + outBrowseName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readDisplayName(UA_Server *server, const UA_NodeId nodeId, + UA_LocalizedText *outDisplayName) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, + outDisplayName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readDescription(UA_Server *server, const UA_NodeId nodeId, + UA_LocalizedText *outDescription) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, + outDescription); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readWriteMask(UA_Server *server, const UA_NodeId nodeId, + UA_UInt32 *outWriteMask) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_WRITEMASK, + outWriteMask); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readIsAbstract(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean *outIsAbstract) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, + outIsAbstract); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readSymmetric(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean *outSymmetric) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, + outSymmetric); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readInverseName(UA_Server *server, const UA_NodeId nodeId, + UA_LocalizedText *outInverseName) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_INVERSENAME, + outInverseName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readContainsNoLoops(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean *outContainsNoLoops) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS, + outContainsNoLoops); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readEventNotifier(UA_Server *server, const UA_NodeId nodeId, + UA_Byte *outEventNotifier) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, + outEventNotifier); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readValue(UA_Server *server, const UA_NodeId nodeId, + UA_Variant *outValue) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_VALUE, outValue); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readDataType(UA_Server *server, const UA_NodeId nodeId, + UA_NodeId *outDataType) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DATATYPE, + outDataType); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readValueRank(UA_Server *server, const UA_NodeId nodeId, + UA_Int32 *outValueRank) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_VALUERANK, + outValueRank); +} + +/* Returns a variant with an int32 array */ +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readArrayDimensions(UA_Server *server, const UA_NodeId nodeId, + UA_Variant *outArrayDimensions) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ARRAYDIMENSIONS, + outArrayDimensions); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readAccessLevel(UA_Server *server, const UA_NodeId nodeId, + UA_Byte *outAccessLevel) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, + outAccessLevel); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readMinimumSamplingInterval(UA_Server *server, const UA_NodeId nodeId, + UA_Double *outMinimumSamplingInterval) { + return __UA_Server_read(server, &nodeId, + UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + outMinimumSamplingInterval); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readHistorizing(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean *outHistorizing) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_HISTORIZING, + outHistorizing); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_readExecutable(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean *outExecutable) { + return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, + outExecutable); +} + +/** + * The following node attributes cannot be changed once a node has been created: + * + * - NodeClass + * - NodeId + * - Symmetric + * - ContainsNoLoops + * + * The following attributes cannot be written from the server, as they are + * specific to the different users and set by the access control callback: + * + * - UserWriteMask + * - UserAccessLevel + * - UserExecutable + */ + +/* Overwrite an attribute of a node. The specialized functions below provide a + * more concise syntax. + * + * @param server The server object. + * @param value WriteValues contain the NodeId of the target node, the id of the + * attribute to overwritten, the actual value and (optionally) an + * index range to replace parts of an array only. of an array only. + * See the section on NumericRange for the format used for array + * ranges. + * @return Returns a status code. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_write(UA_Server *server, const UA_WriteValue *value); + +/* Don't use this function. There are typed versions with no additional + * overhead. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +__UA_Server_write(UA_Server *server, const UA_NodeId *nodeId, + const UA_AttributeId attributeId, + const UA_DataType *attr_type, const void *attr); + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeBrowseName(UA_Server *server, const UA_NodeId nodeId, + const UA_QualifiedName browseName) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_BROWSENAME, + &UA_TYPES[UA_TYPES_QUALIFIEDNAME], &browseName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeDisplayName(UA_Server *server, const UA_NodeId nodeId, + const UA_LocalizedText displayName) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &displayName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeDescription(UA_Server *server, const UA_NodeId nodeId, + const UA_LocalizedText description) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &description); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeWriteMask(UA_Server *server, const UA_NodeId nodeId, + const UA_UInt32 writeMask) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_WRITEMASK, + &UA_TYPES[UA_TYPES_UINT32], &writeMask); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeIsAbstract(UA_Server *server, const UA_NodeId nodeId, + const UA_Boolean isAbstract) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, + &UA_TYPES[UA_TYPES_BOOLEAN], &isAbstract); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeInverseName(UA_Server *server, const UA_NodeId nodeId, + const UA_LocalizedText inverseName) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_INVERSENAME, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &inverseName); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeEventNotifier(UA_Server *server, const UA_NodeId nodeId, + const UA_Byte eventNotifier) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, + &UA_TYPES[UA_TYPES_BYTE], &eventNotifier); +} + +/** + * Writes an UA_Variant to a variable/variableType node. + * StatusCode is set to UA_STATUSCODE_GOOD, sourceTimestamp and + * serverTimestamp are set to UA_DateTime_now() + */ +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeValue(UA_Server *server, const UA_NodeId nodeId, + const UA_Variant value) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUE, + &UA_TYPES[UA_TYPES_VARIANT], &value); +} + +/** + * Writes an UA_DataValue to a variable/variableType node. + * In contrast to UA_Server_writeValue, this functions can also write + * sourceTimestamp, serverTimestamp and statusCode. + */ +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeDataValue(UA_Server *server, const UA_NodeId nodeId, + const UA_DataValue value) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUE, + &UA_TYPES[UA_TYPES_DATAVALUE], &value); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeDataType(UA_Server *server, const UA_NodeId nodeId, + const UA_NodeId dataType) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DATATYPE, + &UA_TYPES[UA_TYPES_NODEID], &dataType); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeValueRank(UA_Server *server, const UA_NodeId nodeId, + const UA_Int32 valueRank) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUERANK, + &UA_TYPES[UA_TYPES_INT32], &valueRank); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeArrayDimensions(UA_Server *server, const UA_NodeId nodeId, + const UA_Variant arrayDimensions) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_ARRAYDIMENSIONS, + &UA_TYPES[UA_TYPES_VARIANT], &arrayDimensions); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeAccessLevel(UA_Server *server, const UA_NodeId nodeId, + const UA_Byte accessLevel) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, + &UA_TYPES[UA_TYPES_BYTE], &accessLevel); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeMinimumSamplingInterval(UA_Server *server, const UA_NodeId nodeId, + const UA_Double miniumSamplingInterval) { + return __UA_Server_write(server, &nodeId, + UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + &UA_TYPES[UA_TYPES_DOUBLE], + &miniumSamplingInterval); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeHistorizing(UA_Server *server, const UA_NodeId nodeId, + const UA_Boolean historizing) { + return __UA_Server_write(server, &nodeId, + UA_ATTRIBUTEID_HISTORIZING, + &UA_TYPES[UA_TYPES_BOOLEAN], + &historizing); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_writeExecutable(UA_Server *server, const UA_NodeId nodeId, + const UA_Boolean executable) { + return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, + &UA_TYPES[UA_TYPES_BOOLEAN], &executable); } + +/** + * Browsing + * -------- */ + +/* Browse the references of a particular node. See the definition of + * BrowseDescription structure for details. */ +UA_BrowseResult UA_EXPORT UA_THREADSAFE +UA_Server_browse(UA_Server *server, UA_UInt32 maxReferences, + const UA_BrowseDescription *bd); + +UA_BrowseResult UA_EXPORT UA_THREADSAFE +UA_Server_browseNext(UA_Server *server, UA_Boolean releaseContinuationPoint, + const UA_ByteString *continuationPoint); + +/* Non-standard version of the Browse service that recurses into child nodes. + * + * Possible loops (that can occur for non-hierarchical references) are handled + * internally. Every node is added at most once to the results array. + * + * Nodes are only added if they match the NodeClassMask in the + * BrowseDescription. However, child nodes are still recursed into if the + * NodeClass does not match. So it is possible, for example, to get all + * VariableNodes below a certain ObjectNode, with additional objects in the + * hierarchy below. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_browseRecursive(UA_Server *server, const UA_BrowseDescription *bd, + size_t *resultsSize, UA_ExpandedNodeId **results); + +UA_BrowsePathResult UA_EXPORT UA_THREADSAFE +UA_Server_translateBrowsePathToNodeIds(UA_Server *server, + const UA_BrowsePath *browsePath); + +/* A simplified TranslateBrowsePathsToNodeIds based on the + * SimpleAttributeOperand type (Part 4, 7.4.4.5). + * + * This specifies a relative path using a list of BrowseNames instead of the + * RelativePath structure. The list of BrowseNames is equivalent to a + * RelativePath that specifies forward references which are subtypes of the + * HierarchicalReferences ReferenceType. All Nodes followed by the browsePath + * shall be of the NodeClass Object or Variable. */ +UA_BrowsePathResult UA_EXPORT UA_THREADSAFE +UA_Server_browseSimplifiedBrowsePath(UA_Server *server, const UA_NodeId origin, + size_t browsePathSize, + const UA_QualifiedName *browsePath); + +#ifndef HAVE_NODEITER_CALLBACK +#define HAVE_NODEITER_CALLBACK +/* Iterate over all nodes referenced by parentNodeId by calling the callback + * function for each child node (in ifdef because GCC/CLANG handle include order + * differently) */ +typedef UA_StatusCode +(*UA_NodeIteratorCallback)(UA_NodeId childId, UA_Boolean isInverse, + UA_NodeId referenceTypeId, void *handle); +#endif + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_forEachChildNodeCall(UA_Server *server, UA_NodeId parentNodeId, + UA_NodeIteratorCallback callback, void *handle); + +#ifdef UA_ENABLE_DISCOVERY + +/** + * Discovery + * --------- */ +/* Register the given server instance at the discovery server. + * This should be called periodically. + * The semaphoreFilePath is optional. If the given file is deleted, + * the server will automatically be unregistered. This could be + * for example a pid file which is deleted if the server crashes. + * + * When the server shuts down you need to call unregister. + * + * @param server + * @param client the client which is used to call the RegisterServer. It must + * already be connected to the correct endpoint + * @param semaphoreFilePath optional parameter pointing to semaphore file. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_register_discovery(UA_Server *server, struct UA_Client *client, + const char* semaphoreFilePath); + +/* Unregister the given server instance from the discovery server. + * This should only be called when the server is shutting down. + * @param server + * @param client the client which is used to call the RegisterServer. It must + * already be connected to the correct endpoint */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_unregister_discovery(UA_Server *server, struct UA_Client *client); + + /* Adds a periodic callback to register the server with the LDS (local + * discovery server) periodically. The interval between each register call is + * given as second parameter. It should be 10 minutes by default (= + * 10*60*1000). + * + * The delayFirstRegisterMs parameter indicates the delay for the first + * register call. If it is 0, the first register call will be after intervalMs + * milliseconds, otherwise the server's first register will be after + * delayFirstRegisterMs. + * + * When you manually unregister the server, you also need to cancel the + * periodic callback, otherwise it will be automatically be registered again. + * + * If you call this method multiple times for the same discoveryServerUrl, the + * older periodic callback will be removed. + * + * @param server + * @param client the client which is used to call the RegisterServer. It must + * not yet be connected and will be connected for every register call + * to the given discoveryServerUrl. + * @param discoveryServerUrl where this server should register itself. The + * string will be copied internally. Therefore you can free it after + * calling this method. + * @param intervalMs + * @param delayFirstRegisterMs + * @param periodicCallbackId */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addPeriodicServerRegisterCallback(UA_Server *server, struct UA_Client *client, + const char* discoveryServerUrl, + UA_Double intervalMs, + UA_Double delayFirstRegisterMs, + UA_UInt64 *periodicCallbackId); + +/* Callback for RegisterServer. Data is passed from the register call */ +typedef void (*UA_Server_registerServerCallback)(const UA_RegisteredServer *registeredServer, + void* data); + +/* Set the callback which is called if another server registeres or unregisters + * with this instance. This callback is called every time the server gets a register + * call. This especially means that for every periodic server register the callback will + * be called. + * + * @param server + * @param cb the callback + * @param data data passed to the callback + * @return UA_STATUSCODE_SUCCESS on success */ +void UA_EXPORT UA_THREADSAFE +UA_Server_setRegisterServerCallback(UA_Server *server, UA_Server_registerServerCallback cb, + void* data); + +#ifdef UA_ENABLE_DISCOVERY_MULTICAST + +/* Callback for server detected through mDNS. Data is passed from the register + * call + * + * @param isServerAnnounce indicates if the server has just been detected. If + * set to false, this means the server is shutting down. + * @param isTxtReceived indicates if we already received the corresponding TXT + * record with the path and caps data */ +typedef void (*UA_Server_serverOnNetworkCallback)(const UA_ServerOnNetwork *serverOnNetwork, + UA_Boolean isServerAnnounce, + UA_Boolean isTxtReceived, void* data); + +/* Set the callback which is called if another server is found through mDNS or + * deleted. It will be called for any mDNS message from the remote server, thus + * it may be called multiple times for the same instance. Also the SRV and TXT + * records may arrive later, therefore for the first call the server + * capabilities may not be set yet. If called multiple times, previous data will + * be overwritten. + * + * @param server + * @param cb the callback + * @param data data passed to the callback + * @return UA_STATUSCODE_SUCCESS on success */ +void UA_EXPORT UA_THREADSAFE +UA_Server_setServerOnNetworkCallback(UA_Server *server, + UA_Server_serverOnNetworkCallback cb, + void* data); + +#endif /* UA_ENABLE_DISCOVERY_MULTICAST */ + +#endif /* UA_ENABLE_DISCOVERY */ + +/** + * Information Model Callbacks + * --------------------------- + * + * There are three places where a callback from an information model to + * user-defined code can happen. + * + * - Custom node constructors and destructors + * - Linking VariableNodes with an external data source + * - MethodNode callbacks + */ + +void UA_EXPORT +UA_Server_setAdminSessionContext(UA_Server *server, + void *context); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setNodeTypeLifecycle(UA_Server *server, UA_NodeId nodeId, + UA_NodeTypeLifecycle lifecycle); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_getNodeContext(UA_Server *server, UA_NodeId nodeId, + void **nodeContext); + +/* Careful! The user has to ensure that the destructor callbacks still work. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setNodeContext(UA_Server *server, UA_NodeId nodeId, + void *nodeContext); + +/** + * .. _datasource: + * + * Data Source Callback + * ^^^^^^^^^^^^^^^^^^^^ + * + * The server has a unique way of dealing with the content of variables. Instead + * of storing a variant attached to the variable node, the node can point to a + * function with a local data provider. Whenever the value attribute is read, + * the function will be called and asked to provide a UA_DataValue return value + * that contains the value content and additional timestamps. + * + * It is expected that the read callback is implemented. The write callback can + * be set to a null-pointer. */ + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId, + const UA_DataSource dataSource); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setVariableNode_valueCallback(UA_Server *server, + const UA_NodeId nodeId, + const UA_ValueCallback callback); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setVariableNode_valueBackend(UA_Server *server, + const UA_NodeId nodeId, + const UA_ValueBackend valueBackend); + +/** + * .. _local-monitoreditems: + * + * Local MonitoredItems + * ^^^^^^^^^^^^^^^^^^^^ + * + * MonitoredItems are used with the Subscription mechanism of OPC UA to + * transported notifications for data changes and events. MonitoredItems can + * also be registered locally. Notifications are then forwarded to a + * user-defined callback instead of a remote client. */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +typedef void (*UA_Server_DataChangeNotificationCallback) + (UA_Server *server, UA_UInt32 monitoredItemId, void *monitoredItemContext, + const UA_NodeId *nodeId, void *nodeContext, UA_UInt32 attributeId, + const UA_DataValue *value); + +typedef void (*UA_Server_EventNotificationCallback) + (UA_Server *server, UA_UInt32 monId, void *monContext, + size_t nEventFields, const UA_Variant *eventFields); + +/* Create a local MonitoredItem with a sampling interval that detects data + * changes. + * + * @param server The server executing the MonitoredItem + * @timestampsToReturn Shall timestamps be added to the value for the callback? + * @item The parameters of the new MonitoredItem. Note that the attribute of the + * ReadValueId (the node that is monitored) can not be + * ``UA_ATTRIBUTEID_EVENTNOTIFIER``. A different callback type needs to be + * registered for event notifications. + * @monitoredItemContext A pointer that is forwarded with the callback + * @callback The callback that is executed on detected data changes + * + * @return Returns a description of the created MonitoredItem. The structure + * also contains a StatusCode (in case of an error) and the identifier of the + * new MonitoredItem. */ +UA_MonitoredItemCreateResult UA_EXPORT UA_THREADSAFE +UA_Server_createDataChangeMonitoredItem(UA_Server *server, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, + void *monitoredItemContext, + UA_Server_DataChangeNotificationCallback callback); + +/* UA_MonitoredItemCreateResult UA_EXPORT */ +/* UA_Server_createEventMonitoredItem(UA_Server *server, */ +/* UA_TimestampsToReturn timestampsToReturn, */ +/* const UA_MonitoredItemCreateRequest item, void *context, */ +/* UA_Server_EventNotificationCallback callback); */ + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_deleteMonitoredItem(UA_Server *server, UA_UInt32 monitoredItemId); + +#endif + +/** + * Method Callbacks + * ^^^^^^^^^^^^^^^^ + * Method callbacks are set to `NULL` (not executable) when a method node is + * added over the network. In theory, it is possible to add a callback via + * ``UA_Server_setMethodNode_callback`` within the global constructor when + * adding methods over the network is really wanted. See the Section + * :ref:`object-interaction` for calling methods on an object. */ + +#ifdef UA_ENABLE_METHODCALLS +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_setMethodNode_callback(UA_Server *server, + const UA_NodeId methodNodeId, + UA_MethodCallback methodCallback); +#endif + +/** + * .. _object-interaction: + * + * Interacting with Objects + * ------------------------ + * Objects in the information model are represented as ObjectNodes. Some + * convenience functions are provided to simplify the interaction with objects. + */ + +/* Write an object property. The property is represented as a VariableNode with + * a ``HasProperty`` reference from the ObjectNode. The VariableNode is + * identified by its BrowseName. Writing the property sets the value attribute + * of the VariableNode. + * + * @param server The server object + * @param objectId The identifier of the object (node) + * @param propertyName The name of the property + * @param value The value to be set for the event attribute + * @return The StatusCode for setting the event attribute */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_writeObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + const UA_Variant value); + +/* Directly point to the scalar value instead of a variant */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_writeObjectProperty_scalar(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + const void *value, const UA_DataType *type); + +/* Read an object property. + * + * @param server The server object + * @param objectId The identifier of the object (node) + * @param propertyName The name of the property + * @param value Contains the property value after reading. Must not be NULL. + * @return The StatusCode for setting the event attribute */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_readObjectProperty(UA_Server *server, const UA_NodeId objectId, + const UA_QualifiedName propertyName, + UA_Variant *value); + +#ifdef UA_ENABLE_METHODCALLS +UA_CallMethodResult UA_EXPORT UA_THREADSAFE +UA_Server_call(UA_Server *server, const UA_CallMethodRequest *request); +#endif + +/** + * .. _addnodes: + * + * Node Addition and Deletion + * -------------------------- + * When creating dynamic node instances at runtime, chances are that you will + * not care about the specific NodeId of the new node, as long as you can + * reference it later. When passing numeric NodeIds with a numeric identifier 0, + * the stack evaluates this as "select a random unassigned numeric NodeId in + * that namespace". To find out which NodeId was actually assigned to the new + * node, you may pass a pointer `outNewNodeId`, which will (after a successful + * node insertion) contain the nodeId of the new node. You may also pass a + * ``NULL`` pointer if this result is not needed. + * + * See the Section :ref:`node-lifecycle` on constructors and on attaching + * user-defined data to nodes. + * + * The methods for node addition and deletion take mostly const arguments that + * are not modified. When creating a node, a deep copy of the node identifier, + * node attributes, etc. is created. Therefore, it is possible to call for + * example ``UA_Server_addVariablenode`` with a value attribute (a + * :ref:`variant`) pointing to a memory location on the stack. If you need + * changes to a variable value to manifest at a specific memory location, please + * use a :ref:`datasource` or a :ref:`value-callback`. */ + +/* Protect against redundant definitions for server/client */ +#ifndef UA_DEFAULT_ATTRIBUTES_DEFINED +#define UA_DEFAULT_ATTRIBUTES_DEFINED +/* The default for variables is "BaseDataType" for the datatype, -2 for the + * valuerank and a read-accesslevel. */ +UA_EXPORT extern const UA_VariableAttributes UA_VariableAttributes_default; +UA_EXPORT extern const UA_VariableTypeAttributes UA_VariableTypeAttributes_default; +/* Methods are executable by default */ +UA_EXPORT extern const UA_MethodAttributes UA_MethodAttributes_default; +/* The remaining attribute definitions are currently all zeroed out */ +UA_EXPORT extern const UA_ObjectAttributes UA_ObjectAttributes_default; +UA_EXPORT extern const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default; +UA_EXPORT extern const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default; +UA_EXPORT extern const UA_DataTypeAttributes UA_DataTypeAttributes_default; +UA_EXPORT extern const UA_ViewAttributes UA_ViewAttributes_default; +#endif + +/* Don't use this function. There are typed versions as inline functions. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +__UA_Server_addNode(UA_Server *server, const UA_NodeClass nodeClass, + const UA_NodeId *requestedNewNodeId, + const UA_NodeId *parentNodeId, + const UA_NodeId *referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId *typeDefinition, + const UA_NodeAttributes *attr, + const UA_DataType *attributeType, + void *nodeContext, UA_NodeId *outNewNodeId); + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addVariableNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_VariableAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_VARIABLE, &requestedNewNodeId, + &parentNodeId, &referenceTypeId, browseName, + &typeDefinition, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addVariableTypeNode(UA_Server *server, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_VariableTypeAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_VARIABLETYPE, + &requestedNewNodeId, &parentNodeId, &referenceTypeId, + browseName, &typeDefinition, + (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addObjectNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_ObjectAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_OBJECT, &requestedNewNodeId, + &parentNodeId, &referenceTypeId, browseName, + &typeDefinition, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addObjectTypeNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ObjectTypeAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_OBJECTTYPE, &requestedNewNodeId, + &parentNodeId, &referenceTypeId, browseName, + &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addViewNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ViewAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_VIEW, &requestedNewNodeId, + &parentNodeId, &referenceTypeId, browseName, + &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addReferenceTypeNode(UA_Server *server, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ReferenceTypeAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_REFERENCETYPE, + &requestedNewNodeId, &parentNodeId, &referenceTypeId, + browseName, &UA_NODEID_NULL, + (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], + nodeContext, outNewNodeId); +} + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addDataTypeNode(UA_Server *server, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_DataTypeAttributes attr, + void *nodeContext, UA_NodeId *outNewNodeId) { + return __UA_Server_addNode(server, UA_NODECLASS_DATATYPE, &requestedNewNodeId, + &parentNodeId, &referenceTypeId, browseName, + &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], + nodeContext, outNewNodeId); +} + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addDataSourceVariableNode(UA_Server *server, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_VariableAttributes attr, + const UA_DataSource dataSource, + void *nodeContext, UA_NodeId *outNewNodeId); + +#ifdef UA_ENABLE_METHODCALLS + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addMethodNodeEx(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_MethodAttributes attr, UA_MethodCallback method, + size_t inputArgumentsSize, const UA_Argument *inputArguments, + const UA_NodeId inputArgumentsRequestedNewNodeId, + UA_NodeId *inputArgumentsOutNewNodeId, + size_t outputArgumentsSize, const UA_Argument *outputArguments, + const UA_NodeId outputArgumentsRequestedNewNodeId, + UA_NodeId *outputArgumentsOutNewNodeId, + void *nodeContext, UA_NodeId *outNewNodeId); + +static UA_INLINE UA_THREADSAFE UA_StatusCode +UA_Server_addMethodNode(UA_Server *server, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, const UA_MethodAttributes attr, + UA_MethodCallback method, + size_t inputArgumentsSize, const UA_Argument *inputArguments, + size_t outputArgumentsSize, const UA_Argument *outputArguments, + void *nodeContext, UA_NodeId *outNewNodeId) { + return UA_Server_addMethodNodeEx(server, requestedNewNodeId, parentNodeId, + referenceTypeId, browseName, attr, method, + inputArgumentsSize, inputArguments, UA_NODEID_NULL, NULL, + outputArgumentsSize, outputArguments, UA_NODEID_NULL, NULL, + nodeContext, outNewNodeId); +} + +#endif + + +/** + * The method pair UA_Server_addNode_begin and _finish splits the AddNodes + * service in two parts. This is useful if the node shall be modified before + * finish the instantiation. For example to add children with specific NodeIds. + * Otherwise, mandatory children (e.g. of an ObjectType) are added with + * pseudo-random unique NodeIds. Existing children are detected during the + * _finish part via their matching BrowseName. + * + * The _begin method: + * - prepares the node and adds it to the nodestore + * - copies some unassigned attributes from the TypeDefinition node internally + * - adds the references to the parent (and the TypeDefinition if applicable) + * - performs type-checking of variables. + * + * You can add an object node without a parent if you set the parentNodeId and + * referenceTypeId to UA_NODE_ID_NULL. Then you need to add the parent reference + * and hasTypeDef reference yourself before calling the _finish method. + * Not that this is only allowed for object nodes. + * + * The _finish method: + * - copies mandatory children + * - calls the node constructor(s) at the end + * - may remove the node if it encounters an error. + * + * The special UA_Server_addMethodNode_finish method needs to be used for method + * nodes, since there you need to explicitly specifiy the input and output + * arguments which are added in the finish step (if not yet already there) */ + +/* The ``attr`` argument must have a type according to the NodeClass. + * ``VariableAttributes`` for variables, ``ObjectAttributes`` for objects, and + * so on. Missing attributes are taken from the TypeDefinition node if + * applicable. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addNode_begin(UA_Server *server, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const void *attr, const UA_DataType *attributeType, + void *nodeContext, UA_NodeId *outNewNodeId); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addNode_finish(UA_Server *server, const UA_NodeId nodeId); + +#ifdef UA_ENABLE_METHODCALLS + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addMethodNode_finish(UA_Server *server, const UA_NodeId nodeId, + UA_MethodCallback method, + size_t inputArgumentsSize, const UA_Argument* inputArguments, + size_t outputArgumentsSize, const UA_Argument* outputArguments); + +#endif + +/* Deletes a node and optionally all references leading to the node. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_deleteNode(UA_Server *server, const UA_NodeId nodeId, + UA_Boolean deleteReferences); + +/** + * Reference Management + * -------------------- */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_addReference(UA_Server *server, const UA_NodeId sourceId, + const UA_NodeId refTypeId, + const UA_ExpandedNodeId targetId, UA_Boolean isForward); + +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_deleteReference(UA_Server *server, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_ExpandedNodeId targetNodeId, + UA_Boolean deleteBidirectional); + +/** + * .. _events: + * + * Events + * ------ + * The method ``UA_Server_createEvent`` creates an event and represents it as + * node. The node receives a unique `EventId` which is automatically added to + * the node. The method returns a `NodeId` to the object node which represents + * the event through ``outNodeId``. The `NodeId` can be used to set the + * attributes of the event. The generated `NodeId` is always numeric. + * ``outNodeId`` cannot be ``NULL``. + * + * Note: In order to see an event in UAExpert, the field `Time` must be given a value! + * + * The method ``UA_Server_triggerEvent`` "triggers" an event by adding it to all + * monitored items of the specified origin node and those of all its parents. + * Any filters specified by the monitored items are automatically applied. Using + * this method deletes the node generated by ``UA_Server_createEvent``. The + * `EventId` for the new event is generated automatically and is returned + * through ``outEventId``. ``NULL`` can be passed if the `EventId` is not + * needed. ``deleteEventNode`` specifies whether the node representation of the + * event should be deleted after invoking the method. This can be useful if + * events with the similar attributes are triggered frequently. ``UA_TRUE`` + * would cause the node to be deleted. */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS + +/* The EventQueueOverflowEventType is defined as abstract, therefore we can not + * create an instance of that type directly, but need to create a subtype. The + * following is an arbitrary number which shall refer to our internal overflow + * type. This is already posted on the OPC Foundation bug tracker under the + * following link for clarification: + * https://opcfoundation-onlineapplications.org/mantis/view.php?id=4206 */ +# define UA_NS0ID_SIMPLEOVERFLOWEVENTTYPE 4035 + +/* Creates a node representation of an event + * + * @param server The server object + * @param eventType The type of the event for which a node should be created + * @param outNodeId The NodeId of the newly created node for the event + * @return The StatusCode of the UA_Server_createEvent method */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_createEvent(UA_Server *server, const UA_NodeId eventType, + UA_NodeId *outNodeId); + +/* Triggers a node representation of an event by applying EventFilters and + * adding the event to the appropriate queues. + * + * @param server The server object + * @param eventNodeId The NodeId of the node representation of the event which should be triggered + * @param outEvent the EventId of the new event + * @param deleteEventNode Specifies whether the node representation of the event should be deleted + * @return The StatusCode of the UA_Server_triggerEvent method */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_triggerEvent(UA_Server *server, const UA_NodeId eventNodeId, const UA_NodeId originId, + UA_ByteString *outEventId, const UA_Boolean deleteEventNode); + +#endif /* UA_ENABLE_SUBSCRIPTIONS_EVENTS */ + +#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS +typedef enum UA_TwoStateVariableCallbackType { + UA_ENTERING_ENABLEDSTATE, + UA_ENTERING_ACKEDSTATE, + UA_ENTERING_CONFIRMEDSTATE, + UA_ENTERING_ACTIVESTATE +} UA_TwoStateVariableCallbackType; + +/* Callback prototype to set user specific callbacks */ +typedef UA_StatusCode +(*UA_TwoStateVariableChangeCallback)(UA_Server *server, const UA_NodeId *condition); + +/* Create condition instance. The function checks first whether the passed + * conditionType is a subType of ConditionType. Then checks whether the + * condition source has HasEventSource reference to its parent. If not, a + * HasEventSource reference will be created between condition source and server + * object. To expose the condition in address space, a hierarchical + * ReferenceType should be passed to create the reference to condition source. + * Otherwise, UA_NODEID_NULL should be passed to make the condition not exposed. + * + * @param server The server object + * @param conditionId The NodeId of the requested Condition Object. When passing + * UA_NODEID_NUMERIC(X,0) an unused nodeid in namespace X + * will be used. E.g. passing UA_NODEID_NULL will result in a + * NodeId in namespace 0. + * @param conditionType The NodeId of the node representation of the ConditionType + * @param conditionName The name of the condition to be created + * @param conditionSource The NodeId of the Condition Source (Parent of the Condition) + * @param hierarchialReferenceType The NodeId of Hierarchical ReferenceType + * between Condition and its source + * @param outConditionId The NodeId of the created Condition + * @return The StatusCode of the UA_Server_createCondition method */ +UA_StatusCode UA_EXPORT +UA_Server_createCondition(UA_Server *server, + const UA_NodeId conditionId, const UA_NodeId conditionType, + UA_QualifiedName conditionName, const UA_NodeId conditionSource, + const UA_NodeId hierarchialReferenceType, UA_NodeId *outConditionId); + +/* Set the value of condition field. + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param value Variant Value to be written to the Field + * @param fieldName Name of the Field in which the value should be written + * @return The StatusCode of the UA_Server_setConditionField method*/ +UA_StatusCode UA_EXPORT +UA_Server_setConditionField(UA_Server *server, + const UA_NodeId condition, + const UA_Variant* value, + const UA_QualifiedName fieldName); + +/* Set the value of property of condition field. + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param value Variant Value to be written to the Field + * @param variableFieldName Name of the Field which has a property + * @param variablePropertyName Name of the Field Property in which the value should be written + * @return The StatusCode of the UA_Server_setConditionVariableFieldProperty*/ +UA_StatusCode UA_EXPORT +UA_Server_setConditionVariableFieldProperty(UA_Server *server, + const UA_NodeId condition, + const UA_Variant* value, + const UA_QualifiedName variableFieldName, + const UA_QualifiedName variablePropertyName); + +/* Triggers an event only for an enabled condition. The condition list is + * updated then with the last generated EventId. + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param conditionSource The NodeId of the node representation of the Condition Source + * @param outEventId last generated EventId + * @return The StatusCode of the UA_Server_triggerConditionEvent method*/ +UA_StatusCode UA_EXPORT +UA_Server_triggerConditionEvent(UA_Server *server, const UA_NodeId condition, + const UA_NodeId conditionSource, + UA_ByteString *outEventId); + +/* Add an optional condition field using its name. (TODO Adding optional methods + * is not implemented yet) + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param conditionType The NodeId of the node representation of the Condition Type + * from which the optional field comes + * @param fieldName Name of the optional field + * @param outOptionalVariable The NodeId of the created field (Variable Node) + * @return The StatusCode of the UA_Server_addConditionOptionalField method*/ +UA_StatusCode UA_EXPORT +UA_Server_addConditionOptionalField(UA_Server *server, const UA_NodeId condition, + const UA_NodeId conditionType, + const UA_QualifiedName fieldName, + UA_NodeId *outOptionalVariable); + +/* Function used to set a user specific callback to TwoStateVariable Fields of a + * condition. The callbacks will be called before triggering the events when + * transition to true State of EnabledState/Id, AckedState/Id, ConfirmedState/Id + * and ActiveState/Id occurs. + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param conditionSource The NodeId of the node representation of the Condition Source + * @param removeBranch (Not Implemented yet) + * @param callback User specific callback function + * @param callbackType Callback function type, indicates where it should be called + * @return The StatusCode of the UA_Server_setConditionTwoStateVariableCallback method*/ +UA_StatusCode UA_EXPORT +UA_Server_setConditionTwoStateVariableCallback(UA_Server *server, const UA_NodeId condition, + const UA_NodeId conditionSource, + UA_Boolean removeBranch, + UA_TwoStateVariableChangeCallback callback, + UA_TwoStateVariableCallbackType callbackType); + +/* Delete a condition from the address space and the internal lists. + * + * @param server The server object + * @param condition The NodeId of the node representation of the Condition Instance + * @param conditionSource The NodeId of the node representation of the Condition Source + * @return UA_STATUSCODE_GOOD on success + */ +UA_StatusCode UA_EXPORT +UA_Server_deleteCondition(UA_Server *server, const UA_NodeId condition, + const UA_NodeId conditionSource); + +#endif /* UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */ + +UA_StatusCode UA_EXPORT +UA_Server_updateCertificate(UA_Server *server, + const UA_ByteString *oldCertificate, + const UA_ByteString *newCertificate, + const UA_ByteString *newPrivateKey, + UA_Boolean closeSessions, + UA_Boolean closeSecureChannels); + +/** + * Utility Functions + * ----------------- */ + +/* Lookup a datatype by its NodeId. Takes the custom types in the server + * configuration into account. Return NULL if none found. */ +UA_EXPORT const UA_DataType * +UA_Server_findDataType(UA_Server *server, const UA_NodeId *typeId); + +/* Add a new namespace to the server. Returns the index of the new namespace */ +UA_UInt16 UA_EXPORT UA_THREADSAFE +UA_Server_addNamespace(UA_Server *server, const char* name); + +/* Get namespace by name from the server. */ +UA_StatusCode UA_EXPORT UA_THREADSAFE +UA_Server_getNamespaceByName(UA_Server *server, const UA_String namespaceUri, + size_t* foundIndex); + +/** +* .. _async-operations: +* +* Async Operations +* ---------------- +* Some operations (such as reading out a sensor that needs to warm up) can take +* quite some time. In order not to block the server during such an operation, it +* can be "outsourced" to a worker thread. +* +* Take the example of a CallRequest. It is split into the individual method call +* operations. If the method is marked as async, then the operation is put into a +* queue where it is be retrieved by a worker. The worker returns the result when +* ready. See the examples in ``/examples/tutorial_server_method_async.c`` for +* the usage. +* +* Note that the operation can time out (see the asyncOperationTimeout setting in +* the server config) also when it has been retrieved by the worker. */ + +#if UA_MULTITHREADING >= 100 + +/* Set the async flag in a method node */ +UA_StatusCode UA_EXPORT +UA_Server_setMethodNodeAsync(UA_Server *server, const UA_NodeId id, + UA_Boolean isAsync); + +typedef enum { + UA_ASYNCOPERATIONTYPE_INVALID, /* 0, the default */ + UA_ASYNCOPERATIONTYPE_CALL + /* UA_ASYNCOPERATIONTYPE_READ, */ + /* UA_ASYNCOPERATIONTYPE_WRITE, */ +} UA_AsyncOperationType; + +typedef union { + UA_CallMethodRequest callMethodRequest; + /* UA_ReadValueId readValueId; */ + /* UA_WriteValue writeValue; */ +} UA_AsyncOperationRequest; + +typedef union { + UA_CallMethodResult callMethodResult; + /* UA_DataValue readResult; */ + /* UA_StatusCode writeResult; */ +} UA_AsyncOperationResponse; + +/* Get the next async operation without blocking + * + * @param server The server object + * @param type The type of the async operation + * @param request Receives pointer to the operation + * @param context Receives the pointer to the operation context + * @param timeout The timestamp when the operation times out and can + * no longer be returned to the client. The response has to + * be set in UA_Server_setAsyncOperationResult in any case. + * @return false if queue is empty, true else */ +UA_Boolean UA_EXPORT +UA_Server_getAsyncOperationNonBlocking(UA_Server *server, UA_AsyncOperationType *type, + const UA_AsyncOperationRequest **request, + void **context, UA_DateTime *timeout); + +/* UA_Boolean UA_EXPORT */ +/* UA_Server_getAsyncOperationBlocking(UA_Server *server, UA_AsyncOperationType *type, */ +/* const UA_AsyncOperationRequest **request, */ +/* void **context, UA_DateTime *timeout); */ + +/* Submit an async operation result + * + * @param server The server object + * @param response Pointer to the operation result + * @param context Pointer to the operation context */ +void UA_EXPORT +UA_Server_setAsyncOperationResult(UA_Server *server, + const UA_AsyncOperationResponse *response, + void *context); + +/* Get the next async operation. Attention! This method is deprecated and has + * been replaced by UA_Server_getAsyncOperationNonBlocking! */ +UA_DEPRECATED UA_Boolean UA_EXPORT +UA_Server_getAsyncOperation(UA_Server *server, UA_AsyncOperationType *type, + const UA_AsyncOperationRequest **request, + void **context); + +#endif /* !UA_MULTITHREADING >= 100 */ + +/** +* Statistics +* ---------- +* +* Statistic counters keeping track of the current state of the stack. Counters +* are structured per OPC UA communication layer. */ + +typedef struct { + UA_NetworkStatistics ns; + UA_SecureChannelStatistics scs; + UA_SessionStatistics ss; +} UA_ServerStatistics; + +UA_ServerStatistics UA_EXPORT +UA_Server_getStatistics(UA_Server *server); + +_UA_END_DECLS + +#ifdef UA_ENABLE_PUBSUB +#endif + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/server_pubsub.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner) + * Copyright (c) 2019 Kalycito Infotech Private Limited + */ + +#ifndef UA_SERVER_PUBSUB_H +#define UA_SERVER_PUBSUB_H + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_PUBSUB + +/** + * .. _pubsub: + * + * Publish/Subscribe + * ================= + * + * Work in progress! + * This part will be a new chapter later. + * + * In PubSub the participating OPC UA Applications take their roles as Publishers and Subscribers. Publishers are the + * sources of data, while Subscribers consume that data. Communication in PubSub is message-based. + * Publishers send messages to a Message Oriented Middleware, without knowledge of what, if any, Subscribers there may be. + * Similarly, Subscribers express interest in specific types of data, and process messages that contain this data, + * without knowledge of what Publishers there are. + * + * Message Oriented Middleware is software or hardware infrastructure that supports sending and receiving messages between distributed systems. + * OPC UA PubSub supports two different Message Oriented Middleware variants, namely the broker-less form and broker-based form. + * A broker-less form is where the Message Oriented Middleware is the network infrastructure that is able to route datagram-based messages. + * Subscribers and Publishers use datagram protocols like UDP. In a broker-based form, the core component of the Message Oriented Middleware + * is a message Broker. Subscribers and Publishers use standard messaging protocols like AMQP or MQTT to communicate with the Broker. + * + * This makes PubSub suitable for applications where location independence and/or scalability are required. + * + * + * The Publish/Subscribe (PubSub) extension for OPC UA enables fast and efficient + * 1:m communication. The PubSub extension is protocol agnostic and can be used + * with broker based protocols like MQTT and AMQP or brokerless implementations like UDP-Multicasting. + * + * The PubSub API uses the following scheme: + * + * 1. Create a configuration for the needed PubSub element. + * + * 2. Call the add[element] function and pass in the configuration. + * + * 3. The add[element] function returns the unique nodeId of the internally created element. + * + * Take a look on the PubSub Tutorials for more details about the API usage.:: + * + * +-----------+ + * | UA_Server | + * +-----------+ + * | | + * | | + * | | + * | | +----------------------+ + * | +--> UA_PubSubConnection | UA_Server_addPubSubConnection + * | +----------------------+ + * | | | + * | | | +----------------+ + * | | +----> UA_WriterGroup | UA_PubSubConnection_addWriterGroup + * | | +----------------+ + * | | | + * | | | +------------------+ + * | | +----> UA_DataSetWriter | UA_WriterGroup_addDataSetWriter +-+ + * | | +------------------+ | + * | | | + * | | +----------------+ | r + * | +---------> UA_ReaderGroup | UA_PubSubConnection_addReaderGroup | e + * | +----------------+ | f + * | | | + * | | +------------------+ | + * | +----> UA_DataSetReader | UA_ReaderGroup_addDataSetReader | + * | +------------------+ | + * | | | + * | | +----------------------+ | + * | +----> UA_SubscribedDataSet | | + * | +----------------------+ | + * | | | + * | | +----------------------------+ | + * | +----> UA_TargetVariablesDataType | | + * | | +----------------------------+ | + * | | | + * | | +------------------------------------+ | + * | +----> UA_SubscribedDataSetMirrorDataType | | + * | +------------------------------------+ | + * | | + * | +---------------------------+ | + * +-------> UA_PubSubPublishedDataSet | UA_Server_addPublishedDataSet <-+ + * +---------------------------+ + * | + * | +-----------------+ + * +----> UA_DataSetField | UA_PublishedDataSet_addDataSetField + * +-----------------+ + * + * PubSub compile flags + * -------------------- + * + * **UA_ENABLE_PUBSUB** + * Enable the experimental OPC UA PubSub support. The option will include the PubSub UDP multicast plugin. Disabled by default. + * **UA_ENABLE_PUBSUB_DELTAFRAMES** + * The PubSub messages differentiate between keyframe (all published values contained) and deltaframe (only changed values contained) messages. + * Deltaframe messages creation consumes some additional ressources and can be disabled with this flag. Disabled by default. + * Compile the human-readable name of the StatusCodes into the binary. Disabled by default. + * **UA_ENABLE_PUBSUB_FILE_CONFIG** + * Enable loading OPC UA PubSub configuration from File/ByteString. Enabling PubSub informationmodel methods also will add a method to the Publish/Subscribe object which allows configuring PubSub at runtime. + * **UA_ENABLE_PUBSUB_INFORMATIONMODEL** + * Enable the information model representation of the PubSub configuration. For more details take a look at the following section `PubSub Information Model Representation`. Disabled by default. + * **UA_ENABLE_PUBSUB_MONITORING** + * Enable the experimental PubSub monitoring. This feature provides a basic framework to implement monitoring/timeout checks for PubSub components. + * Initially the MessageReceiveTimeout check of a DataSetReader is provided. It uses the internal server callback implementation. + * The monitoring backend can be changed by the application to satisfy realtime requirements. + * Disabled by default. + * **UA_ENABLE_PUBSUB_ETH_UADP** + * Enable the OPC UA Ethernet PubSub support to transport UADP NetworkMessages as payload of Ethernet II frame without IP or UDP headers. This option will include Publish and Subscribe based on + * EtherType B62C. Disabled by default. + * **UA_ENABLE_PUBSUB_ETH_UADP_ETF** + * Enable ETF feature to allow the user to transmit packets at calculated transmission time with nanosecond precision, in addition to the PubSub support to transport UADP NetworkMessages as payload of Ethernet II frame. + * Disabled by default. + * **UA_ENABLE_PUBSUB_ETH_UADP_XDP** + * Enable XDP feature to allow the user to receive packets using the eXpress Data Path (XDP), which bypasses TCP/IP layers and transfers the frames from hardware/netdev to user application thereby reducing the receiving time, + * in addition to the PubSub support to transport UADP NetworkMessages as payload of Ethernet II frame. Disabled by default. + * + * PubSub Information Model Representation + * --------------------------------------- + * .. _pubsub_informationmodel: + * + * The complete PubSub configuration is available inside the information model. + * The entry point is the node 'PublishSubscribe, located under the Server node. + * The standard defines for PubSub no new Service set. The configuration can optionally + * done over methods inside the information model. The information model representation + * of the current PubSub configuration is generated automatically. This feature + * can enabled/disable by changing the UA_ENABLE_PUBSUB_INFORMATIONMODEL option. + * + * Connections + * ----------- + * The PubSub connections are the abstraction between the concrete transport protocol + * and the PubSub functionality. It is possible to create multiple connections with + * different transport protocols at runtime. + * + * Take a look on the PubSub Tutorials for mor details about the API usage. + */ + +typedef enum { + UA_PUBSUB_COMPONENT_CONNECTION, + UA_PUBSUB_COMPONENT_WRITERGROUP, + UA_PUBSUB_COMPONENT_DATASETWRITER, + UA_PUBSUB_COMPONENT_READERGROUP, + UA_PUBSUB_COMPONENT_DATASETREADER +} UA_PubSubComponentEnumType; + +typedef enum { + UA_PUBSUB_PUBLISHERID_NUMERIC, + UA_PUBSUB_PUBLISHERID_STRING +} UA_PublisherIdType; + +#ifdef UA_ENABLE_PUBSUB_ETH_UADP_ETF +typedef struct { + UA_Int32 socketPriority; + UA_Boolean sotxtimeEnabled; + /* SO_TXTIME-specific additional socket config */ + UA_Int32 sotxtimeDeadlinemode; + UA_Int32 sotxtimeReceiveerrors; +} UA_ETFConfiguration; +#endif + +struct UA_PubSubConnectionConfig { + UA_String name; + UA_Boolean enabled; + UA_PublisherIdType publisherIdType; + union { /* std: valid types UInt or String */ + UA_UInt32 numeric; + UA_String string; + } publisherId; + UA_String transportProfileUri; + UA_Variant address; + size_t connectionPropertiesSize; + UA_KeyValuePair *connectionProperties; + UA_Variant connectionTransportSettings; +#ifdef UA_ENABLE_PUBSUB_ETH_UADP_ETF + /* ETF related connection configuration - Not in PubSub specfication */ + UA_ETFConfiguration etfConfiguration; +#endif +}; + +#ifdef UA_ENABLE_PUBSUB_MONITORING + +typedef enum { + UA_PUBSUB_MONITORING_MESSAGE_RECEIVE_TIMEOUT + // extend as needed +} UA_PubSubMonitoringType; + +/* PubSub monitoring interface */ +typedef struct { + UA_StatusCode (*createMonitoring)(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data, UA_ServerCallback callback); + UA_StatusCode (*startMonitoring)(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data); + UA_StatusCode (*stopMonitoring)(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data); + UA_StatusCode (*updateMonitoringInterval)(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data); + UA_StatusCode (*deleteMonitoring)(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType, + UA_PubSubMonitoringType eMonitoringType, void *data); +} UA_PubSubMonitoringInterface; + +#endif /* UA_ENABLE_PUBSUB_MONITORING */ + +/* General PubSub configuration */ +struct UA_PubSubConfiguration { + + /* Callback for PubSub component state changes: + If provided this callback informs the application about PubSub component state changes. + E.g. state change from operational to error in case of a DataSetReader MessageReceiveTimeout. + The status code provides additional information. */ + void (*pubsubStateChangeCallback)(UA_NodeId *Id, + UA_PubSubState state, + UA_StatusCode status);// TODO: maybe status code provides not enough information about the state change +#ifdef UA_ENABLE_PUBSUB_MONITORING + UA_PubSubMonitoringInterface monitoringInterface; +#endif /* UA_ENABLE_PUBSUB_MONITORING */ +}; + + +/** + * 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. */ + +UA_StatusCode UA_EXPORT +UA_ServerConfig_addPubSubTransportLayer(UA_ServerConfig *config, + UA_PubSubTransportLayer *pubsubTransportLayer); + +UA_StatusCode UA_EXPORT +UA_Server_addPubSubConnection(UA_Server *server, + const UA_PubSubConnectionConfig *connectionConfig, + UA_NodeId *connectionIdentifier); + +/* Returns a deep copy of the config */ +UA_StatusCode UA_EXPORT +UA_Server_getPubSubConnectionConfig(UA_Server *server, + const UA_NodeId connection, + UA_PubSubConnectionConfig *config); + +/* Remove Connection, identified by the NodeId. Deletion of Connection + * removes all contained WriterGroups and Writers. */ +UA_StatusCode UA_EXPORT +UA_Server_removePubSubConnection(UA_Server *server, const UA_NodeId connection); + +/** + * PublishedDataSets + * ----------------- + * The PublishedDataSets (PDS) are containers for the published information. The + * PDS contain the published variables and meta informations. The metadata is + * commonly autogenerated or given as constant argument as part of the template + * functions. The template functions are standard defined and intended for + * configuration tools. You should normally create a empty PDS and call the + * functions to add new fields. */ + +/* The UA_PUBSUB_DATASET_PUBLISHEDITEMS has currently no additional members and + * thus no dedicated config structure. */ + +typedef enum { + UA_PUBSUB_DATASET_PUBLISHEDITEMS, + UA_PUBSUB_DATASET_PUBLISHEDEVENTS, + UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE, + UA_PUBSUB_DATASET_PUBLISHEDEVENTS_TEMPLATE, +} UA_PublishedDataSetType; + +typedef struct { + UA_DataSetMetaDataType metaData; + size_t variablesToAddSize; + UA_PublishedVariableDataType *variablesToAdd; +} UA_PublishedDataItemsTemplateConfig; + +typedef struct { + UA_NodeId eventNotfier; + UA_ContentFilter filter; +} UA_PublishedEventConfig; + +typedef struct { + UA_DataSetMetaDataType metaData; + UA_NodeId eventNotfier; + size_t selectedFieldsSize; + UA_SimpleAttributeOperand *selectedFields; + UA_ContentFilter filter; +} UA_PublishedEventTemplateConfig; + +/* Configuration structure for PublishedDataSet */ +typedef struct { + UA_String name; + UA_PublishedDataSetType publishedDataSetType; + union { + /* The UA_PUBSUB_DATASET_PUBLISHEDITEMS has currently no additional members + * and thus no dedicated config structure.*/ + UA_PublishedDataItemsTemplateConfig itemsTemplate; + UA_PublishedEventConfig event; + UA_PublishedEventTemplateConfig eventTemplate; + } config; +} UA_PublishedDataSetConfig; + +void UA_EXPORT +UA_PublishedDataSetConfig_clear(UA_PublishedDataSetConfig *pdsConfig); + +typedef struct { + UA_StatusCode addResult; + size_t fieldAddResultsSize; + UA_StatusCode *fieldAddResults; + UA_ConfigurationVersionDataType configurationVersion; +} UA_AddPublishedDataSetResult; + +UA_AddPublishedDataSetResult UA_EXPORT +UA_Server_addPublishedDataSet(UA_Server *server, + const UA_PublishedDataSetConfig *publishedDataSetConfig, + UA_NodeId *pdsIdentifier); + +/* Returns a deep copy of the config */ +UA_StatusCode UA_EXPORT +UA_Server_getPublishedDataSetConfig(UA_Server *server, const UA_NodeId pds, + UA_PublishedDataSetConfig *config); + +/* Returns a deep copy of the DataSetMetaData for an specific PDS */ +UA_StatusCode UA_EXPORT +UA_Server_getPublishedDataSetMetaData(UA_Server *server, const UA_NodeId pds, + UA_DataSetMetaDataType *metaData); + +/* Remove PublishedDataSet, identified by the NodeId. Deletion of PDS removes + * all contained and linked PDS Fields. Connected WriterGroups will be also + * removed. */ +UA_StatusCode UA_EXPORT +UA_Server_removePublishedDataSet(UA_Server *server, const UA_NodeId pds); + +/** + * DataSetFields + * ------------- + * The description of published variables is named DataSetField. Each + * DataSetField contains the selection of one information model node. The + * DataSetField has additional parameters for the publishing, sampling and error + * handling process. */ + +typedef struct{ + UA_ConfigurationVersionDataType configurationVersion; + UA_String fieldNameAlias; + UA_Boolean promotedField; + UA_PublishedVariableDataType publishParameters; + + /* non std. field */ + struct { + UA_Boolean rtFieldSourceEnabled; + /* If the rtInformationModelNode is set, the nodeid in publishParameter must point + * to a node with external data source backend defined + * */ + UA_Boolean rtInformationModelNode; + //TODO -> decide if suppress C++ warnings and use 'UA_DataValue * * const staticValueSource;' + UA_DataValue ** staticValueSource; + } rtValueSource; + + +} UA_DataSetVariableConfig; + +typedef enum { + UA_PUBSUB_DATASETFIELD_VARIABLE, + UA_PUBSUB_DATASETFIELD_EVENT +} UA_DataSetFieldType; + +typedef struct { + UA_DataSetFieldType dataSetFieldType; + union { + /* events need other config later */ + UA_DataSetVariableConfig variable; + } field; +} UA_DataSetFieldConfig; + +void UA_EXPORT +UA_DataSetFieldConfig_clear(UA_DataSetFieldConfig *dataSetFieldConfig); + +typedef struct { + UA_StatusCode result; + UA_ConfigurationVersionDataType configurationVersion; +} UA_DataSetFieldResult; + +UA_DataSetFieldResult UA_EXPORT +UA_Server_addDataSetField(UA_Server *server, + const UA_NodeId publishedDataSet, + const UA_DataSetFieldConfig *fieldConfig, + UA_NodeId *fieldIdentifier); + +/* Returns a deep copy of the config */ +UA_StatusCode UA_EXPORT +UA_Server_getDataSetFieldConfig(UA_Server *server, const UA_NodeId dsf, + UA_DataSetFieldConfig *config); + +UA_DataSetFieldResult UA_EXPORT +UA_Server_removeDataSetField(UA_Server *server, const UA_NodeId dsf); + +/** + * Custom Callback Implementation + * ------------------------------ + * The user can use his own callback implementation for publishing + * and subscribing. The user must take care of the callback to call for + * every publishing or subscibing interval */ + +typedef struct { + UA_StatusCode (*addCustomCallback)(UA_Server *server, UA_NodeId identifier, + UA_ServerCallback callback, + void *data, UA_Double interval_ms, UA_UInt64 *callbackId); + + UA_StatusCode (*changeCustomCallbackInterval)(UA_Server *server, UA_NodeId identifier, + UA_UInt64 callbackId, UA_Double interval_ms); + + void (*removeCustomCallback)(UA_Server *server, UA_NodeId identifier, UA_UInt64 callbackId); + +} UA_PubSub_CallbackLifecycle; + +/** + * WriterGroup + * ----------- + * All WriterGroups are created within a PubSubConnection and automatically + * deleted if the connection is removed. The WriterGroup is primary used as + * container for :ref:`dsw` and network message settings. The WriterGroup can be + * imagined as producer of the network messages. The creation of network + * messages is controlled by parameters like the publish interval, which is e.g. + * contained in the WriterGroup. */ + +typedef enum { + UA_PUBSUB_ENCODING_BINARY, + UA_PUBSUB_ENCODING_JSON, + UA_PUBSUB_ENCODING_UADP +} UA_PubSubEncodingType; + +/** + * WriterGroup + * ----------- + * The message publishing can be configured for realtime requirements. The RT-levels + * go along with different requirements. The below listed levels can be configured: + * + * UA_PUBSUB_RT_NONE - + * ---> Description: Default "none-RT" Mode + * ---> Requirements: - + * ---> Restrictions: - + * UA_PUBSUB_RT_DIRECT_VALUE_ACCESS (Preview - not implemented) + * ---> Description: Normally, the latest value for each DataSetField is read out of the information model. Within this RT-mode, the + * value source of each field configured as static pointer to an DataValue. The publish cycle won't use call the server read function. + * ---> Requirements: All fields must be configured with a 'staticValueSource'. + * ---> Restrictions: - + * UA_PUBSUB_RT_FIXED_LENGTH (Preview - not implemented) + * ---> Description: All DataSetFields have a known, non-changing length. The server will pre-generate some + * buffers and use only memcopy operations to generate requested PubSub packages. + * ---> Requirements: DataSetFields with variable size can't be used within this mode. + * ---> Restrictions: The configuration must be frozen and changes are not allowed while the WriterGroup is 'Operational'. + * UA_PUBSUB_RT_DETERMINISTIC (Preview - not implemented) + * ---> Description: - + * ---> Requirements: - + * ---> Restrictions: - + * + * WARNING! For hard real time requirements the underlying system must be rt-capable. + * + */ +typedef enum { + UA_PUBSUB_RT_NONE = 0, + UA_PUBSUB_RT_DIRECT_VALUE_ACCESS = 1, + UA_PUBSUB_RT_FIXED_SIZE = 2, + UA_PUBSUB_RT_DETERMINISTIC = 4, +} UA_PubSubRTLevel; + +typedef struct { + UA_String name; + UA_Boolean enabled; + UA_UInt16 writerGroupId; + UA_Duration publishingInterval; + UA_Double keepAliveTime; + UA_Byte priority; + UA_MessageSecurityMode securityMode; + UA_ExtensionObject transportSettings; + UA_ExtensionObject messageSettings; + size_t groupPropertiesSize; + UA_KeyValuePair *groupProperties; + UA_PubSubEncodingType encodingMimeType; + /* PubSub Manager Callback */ + UA_PubSub_CallbackLifecycle pubsubManagerCallback; + /* non std. config parameter. maximum count of embedded DataSetMessage in + * one NetworkMessage */ + UA_UInt16 maxEncapsulatedDataSetMessageCount; + /* non std. field */ + UA_PubSubRTLevel rtLevel; +} UA_WriterGroupConfig; + +void UA_EXPORT +UA_WriterGroupConfig_clear(UA_WriterGroupConfig *writerGroupConfig); + +/* Add a new WriterGroup to an existing Connection */ +UA_StatusCode UA_EXPORT +UA_Server_addWriterGroup(UA_Server *server, const UA_NodeId connection, + const UA_WriterGroupConfig *writerGroupConfig, + UA_NodeId *writerGroupIdentifier); + +/* Returns a deep copy of the config */ +UA_StatusCode UA_EXPORT +UA_Server_getWriterGroupConfig(UA_Server *server, const UA_NodeId writerGroup, + UA_WriterGroupConfig *config); + +UA_StatusCode UA_EXPORT +UA_Server_updateWriterGroupConfig(UA_Server *server, UA_NodeId writerGroupIdentifier, + const UA_WriterGroupConfig *config); + +/* Get state of WriterGroup */ +UA_StatusCode UA_EXPORT +UA_Server_WriterGroup_getState(UA_Server *server, UA_NodeId writerGroupIdentifier, + UA_PubSubState *state); + +UA_StatusCode UA_EXPORT +UA_Server_removeWriterGroup(UA_Server *server, const UA_NodeId writerGroup); + +UA_StatusCode UA_EXPORT +UA_Server_freezeWriterGroupConfiguration(UA_Server *server, const UA_NodeId writerGroup); + +UA_StatusCode UA_EXPORT +UA_Server_unfreezeWriterGroupConfiguration(UA_Server *server, const UA_NodeId writerGroup); + +UA_StatusCode UA_EXPORT +UA_Server_setWriterGroupOperational(UA_Server *server, const UA_NodeId writerGroup); + +UA_StatusCode UA_EXPORT +UA_Server_setWriterGroupDisabled(UA_Server *server, const UA_NodeId writerGroup); + +/** + * .. _dsw: + * + * DataSetWriter + * ------------- + * The DataSetWriters are the glue between the WriterGroups and the + * PublishedDataSets. The DataSetWriter contain configuration parameters and + * flags which influence the creation of DataSet messages. These messages are + * encapsulated inside the network message. The DataSetWriter must be linked + * with an existing PublishedDataSet and be contained within a WriterGroup. */ + +typedef struct { + UA_String name; + UA_UInt16 dataSetWriterId; + UA_DataSetFieldContentMask dataSetFieldContentMask; + UA_UInt32 keyFrameCount; + UA_ExtensionObject messageSettings; + UA_ExtensionObject transportSettings; + UA_String dataSetName; + size_t dataSetWriterPropertiesSize; + UA_KeyValuePair *dataSetWriterProperties; +} UA_DataSetWriterConfig; + +void UA_EXPORT +UA_DataSetWriterConfig_clear(UA_DataSetWriterConfig *pdsConfig); + +/* Add a new DataSetWriter to a existing WriterGroup. The DataSetWriter must be + * coupled with a PublishedDataSet on creation. + * + * Part 14, 7.1.5.2.1 defines: The link between the PublishedDataSet and + * DataSetWriter shall be created when an instance of the DataSetWriterType is + * created. */ +UA_StatusCode UA_EXPORT +UA_Server_addDataSetWriter(UA_Server *server, + const UA_NodeId writerGroup, const UA_NodeId dataSet, + const UA_DataSetWriterConfig *dataSetWriterConfig, + UA_NodeId *writerIdentifier); + +/* Returns a deep copy of the config */ +UA_StatusCode UA_EXPORT +UA_Server_getDataSetWriterConfig(UA_Server *server, const UA_NodeId dsw, + UA_DataSetWriterConfig *config); + +/* Get state of DataSetWriter */ +UA_StatusCode UA_EXPORT +UA_Server_DataSetWriter_getState(UA_Server *server, UA_NodeId dataSetWriterIdentifier, + UA_PubSubState *state); + +UA_StatusCode UA_EXPORT +UA_Server_removeDataSetWriter(UA_Server *server, const UA_NodeId dsw); + +/** + * SubscribedDataSet + * ----------------- + * SubscribedDataSet describes the processing of the received DataSet. SubscribedDataSet defines which field + * in the DataSet is mapped to which Variable in the OPC UA Application. SubscribedDataSet has two sub-types + * called the TargetVariablesType and SubscribedDataSetMirrorType. + * SubscribedDataSetMirrorType is currently not supported. SubscribedDataSet is set to TargetVariablesType + * and then the list of target Variables are created in the Subscriber AddressSpace. + * TargetVariables are a list of variables that are to be added in the Subscriber AddressSpace. + * It defines a list of Variable mappings between received DataSet fields and added Variables + * in the Subscriber AddressSpace. */ + +/* SubscribedDataSetDataType Definition */ +typedef enum { + UA_PUBSUB_SDS_TARGET, + UA_PUBSUB_SDS_MIRROR +} UA_SubscribedDataSetEnumType; + +typedef struct { + /* Standard-defined FieldTargetDataType */ + UA_FieldTargetDataType targetVariable; + + /* If realtime-handling is required, set this pointer non-NULL and it will be used + * to memcpy the value instead of using the Write service. + * If the afterWrite method pointer is set, it will be called after a memcpy update + * to the value. */ + UA_DataValue **externalDataValue; + void *targetVariableContext; /* user-defined pointer */ + void (*afterWrite)(UA_Server *server, + const UA_NodeId *readerIdentifier, + const UA_NodeId *readerGroupIdentifier, + const UA_NodeId *targetVariableIdentifier, + void *targetVariableContext, + UA_DataValue **externalDataValue); +} UA_FieldTargetVariable; + +typedef struct { + size_t targetVariablesSize; + UA_FieldTargetVariable *targetVariables; +} UA_TargetVariables; + +/* Return Status Code after creating TargetVariables in Subscriber AddressSpace */ +UA_StatusCode UA_EXPORT +UA_Server_DataSetReader_createTargetVariables(UA_Server *server, + UA_NodeId dataSetReaderIdentifier, + size_t targetVariablesSize, + const UA_FieldTargetVariable *targetVariables); + +/* To Do:Implementation of SubscribedDataSetMirrorType + * UA_StatusCode + * A_PubSubDataSetReader_createDataSetMirror(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + * UA_SubscribedDataSetMirrorDataType* mirror) */ + +/** + * DataSetReader + * ------------- + * DataSetReader can receive NetworkMessages with the DataSetMessage + * of interest sent by the Publisher. DataSetReaders represent + * the configuration necessary to receive and process DataSetMessages + * on the Subscriber side. DataSetReader must be linked with a + * SubscribedDataSet and be contained within a ReaderGroup. */ + +/* Parameters for PubSubSecurity */ +typedef struct { + UA_Int32 securityMode; /* placeholder datatype 'MessageSecurityMode' */ + UA_String securityGroupId; + size_t keyServersSize; + UA_Int32 *keyServers; +} UA_PubSubSecurityParameters; + +/* Parameters for PubSub DataSetReader Configuration */ +typedef struct { + UA_String name; + UA_Variant publisherId; + UA_UInt16 writerGroupId; + UA_UInt16 dataSetWriterId; + UA_DataSetMetaDataType dataSetMetaData; + UA_DataSetFieldContentMask dataSetFieldContentMask; + UA_Double messageReceiveTimeout; + UA_PubSubSecurityParameters securityParameters; + UA_ExtensionObject messageSettings; + UA_ExtensionObject transportSettings; + UA_SubscribedDataSetEnumType subscribedDataSetType; + /* TODO UA_SubscribedDataSetMirrorDataType subscribedDataSetMirror */ + union { + UA_TargetVariables subscribedDataSetTarget; + // UA_SubscribedDataSetMirrorDataType subscribedDataSetMirror; + } subscribedDataSet; +} UA_DataSetReaderConfig; + +/* Update configuration to the dataSetReader */ +UA_StatusCode UA_EXPORT +UA_Server_DataSetReader_updateConfig(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_NodeId readerGroupIdentifier, + const UA_DataSetReaderConfig *config); + +/* Get configuration of the dataSetReader */ +UA_StatusCode UA_EXPORT +UA_Server_DataSetReader_getConfig(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_DataSetReaderConfig *config); + +/* Get state of DataSetReader */ +UA_StatusCode UA_EXPORT +UA_Server_DataSetReader_getState(UA_Server *server, UA_NodeId dataSetReaderIdentifier, + UA_PubSubState *state); + +/** + * ReaderGroup + * ----------- + * ReaderGroup is used to group a list of DataSetReaders. All ReaderGroups are + * created within a PubSubConnection and automatically deleted if the connection + * is removed. All network message related filters are only available in the DataSetReader. + * + * The RT-levels go along with different requirements. The below listed levels can be configured + * for a ReaderGroup. + * UA_PUBSUB_RT_NONE --> No RT applied to this level + * PUBSUB_CONFIG_FASTPATH_FIXED_OFFSETS --> Extends PubSub RT functionality and implements fast path + * message decoding in the Subscriber. Uses a buffered network message and only decodes the necessary + * offsets stored in an offset buffer. */ + +/* ReaderGroup configuration */ +typedef struct { + UA_String name; + UA_PubSubSecurityParameters securityParameters; + /* PubSub Manager Callback */ + UA_PubSub_CallbackLifecycle pubsubManagerCallback; + /* non std. field */ + UA_PubSubRTLevel rtLevel; +} UA_ReaderGroupConfig; + +/* Add DataSetReader to the ReaderGroup */ +UA_StatusCode UA_EXPORT +UA_Server_addDataSetReader(UA_Server *server, UA_NodeId readerGroupIdentifier, + const UA_DataSetReaderConfig *dataSetReaderConfig, + UA_NodeId *readerIdentifier); + +/* Remove DataSetReader from ReaderGroup */ +UA_StatusCode UA_EXPORT +UA_Server_removeDataSetReader(UA_Server *server, UA_NodeId readerIdentifier); + +/* To Do: Update Configuration of ReaderGroup + * UA_StatusCode UA_EXPORT + * UA_Server_ReaderGroup_updateConfig(UA_Server *server, UA_NodeId readerGroupIdentifier, + * const UA_ReaderGroupConfig *config); + */ + +/* Get configuraiton of ReaderGroup */ +UA_StatusCode UA_EXPORT +UA_Server_ReaderGroup_getConfig(UA_Server *server, UA_NodeId readerGroupIdentifier, + UA_ReaderGroupConfig *config); + +/* Get state of ReaderGroup */ +UA_StatusCode UA_EXPORT +UA_Server_ReaderGroup_getState(UA_Server *server, UA_NodeId readerGroupIdentifier, + UA_PubSubState *state); + +/* Add ReaderGroup to the created connection */ +UA_StatusCode UA_EXPORT +UA_Server_addReaderGroup(UA_Server *server, UA_NodeId connectionIdentifier, + const UA_ReaderGroupConfig *readerGroupConfig, + UA_NodeId *readerGroupIdentifier); + +/* Remove ReaderGroup from connection */ +UA_StatusCode UA_EXPORT +UA_Server_removeReaderGroup(UA_Server *server, UA_NodeId groupIdentifier); + +UA_StatusCode UA_EXPORT +UA_Server_freezeReaderGroupConfiguration(UA_Server *server, const UA_NodeId readerGroupId); + +UA_StatusCode UA_EXPORT +UA_Server_unfreezeReaderGroupConfiguration(UA_Server *server, const UA_NodeId readerGroupId); + +UA_StatusCode UA_EXPORT +UA_Server_setReaderGroupOperational(UA_Server *server, const UA_NodeId readerGroupId); + +UA_StatusCode UA_EXPORT +UA_Server_setReaderGroupDisabled(UA_Server *server, const UA_NodeId readerGroupId); + +#endif /* UA_ENABLE_PUBSUB */ + +_UA_END_DECLS + +#endif /* UA_SERVER_PUBSUB_H */ + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/client.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015-2016 (c) Sten Grüner + * Copyright 2015-2016 (c) Chris Iatrou + * Copyright 2015-2017 (c) Florian Palm + * Copyright 2015 (c) Holger Jeromin + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Kalycito Infotech Private Limited + */ + + + + +_UA_BEGIN_DECLS + +/** + * .. _client: + * + * Client + * ====== + * + * The client implementation allows remote access to all OPC UA services. For + * convenience, some functionality has been wrapped in :ref:`high-level + * abstractions <client-highlevel>`. + * + * **However**: At this time, the client does not yet contain its own thread or + * event-driven main-loop, meaning that the client will not perform any actions + * automatically in the background. This is especially relevant for + * connection/session management and subscriptions. The user will have to + * periodically call `UA_Client_run_iterate` to ensure that asynchronous events + * are handled, including keeping a secure connection established. + * See more about :ref:`asynchronicity<client-async-services>` and + * :ref:`subscriptions<client-subscriptions>`. + * + * .. _client-config: + * + * Client Configuration + * -------------------- + * + * The client configuration is used for setting connection parameters and + * additional settings used by the client. + * The configuration should not be modified after it is passed to a client. + * Currently, only one client can use a configuration at a time. + * + * Examples for configurations are provided in the ``/plugins`` folder. + * The usual usage is as follows: + * + * 1. Create a client configuration with default settings as a starting point + * 2. Modifiy the configuration, e.g. modifying the timeout + * 3. Instantiate a client with it + * 4. After shutdown of the client, clean up the configuration (free memory) + * + * The :ref:`tutorials` provide a good starting point for this. */ + +typedef struct { + /* Basic client configuration */ + void *clientContext; /* User-defined data attached to the client */ + UA_Logger logger; /* Logger used by the client */ + UA_UInt32 timeout; /* Response timeout in ms */ + + /* The description must be internally consistent. + * - The ApplicationUri set in the ApplicationDescription must match the + * URI set in the server certificate */ + UA_ApplicationDescription clientDescription; + + /* Basic connection configuration */ + UA_ExtensionObject userIdentityToken; /* Configured User-Identity Token */ + UA_MessageSecurityMode securityMode; /* None, Sign, SignAndEncrypt. The + * default is invalid. This indicates + * the client to select any matching + * endpoint. */ + UA_String securityPolicyUri; /* SecurityPolicy for the SecureChannel. An + * empty string indicates the client to select + * any matching SecurityPolicy. */ + + /* Advanced connection configuration + * + * If either endpoint or userTokenPolicy has been set (at least one non-zero + * byte in either structure), then the selected Endpoint and UserTokenPolicy + * overwrite the settings in the basic connection configuration. The + * userTokenPolicy array in the EndpointDescription is ignored. The selected + * userTokenPolicy is set in the dedicated configuration field. + * + * If the advanced configuration is not set, the client will write to it the + * selected Endpoint and UserTokenPolicy during GetEndpoints. + * + * The information in the advanced configuration is used during reconnect + * when the SecureChannel was broken. */ + UA_EndpointDescription endpoint; + UA_UserTokenPolicy userTokenPolicy; + + /* Advanced client configuration */ + + UA_UInt32 secureChannelLifeTime; /* Lifetime in ms (then the channel needs + to be renewed) */ + UA_UInt32 requestedSessionTimeout; /* Session timeout in ms */ + UA_ConnectionConfig localConnectionConfig; + UA_UInt32 connectivityCheckInterval; /* Connectivity check interval in ms. + * 0 = background task disabled */ + const UA_DataTypeArray *customDataTypes; /* Custom DataTypes. Attention! + * Custom datatypes are not cleaned + * up together with the + * configuration. So it is possible + * to allocate them on ROM. */ + + /* Available SecurityPolicies */ + size_t securityPoliciesSize; + UA_SecurityPolicy *securityPolicies; + + /* Certificate Verification Plugin */ + UA_CertificateVerification certificateVerification; + + /* Callbacks for async connection handshakes */ + UA_ConnectClientConnection initConnectionFunc; + UA_StatusCode (*pollConnectionFunc)(UA_Connection *connection, + UA_UInt32 timeout, + const UA_Logger *logger); + + /* Callback for state changes. The client state is differentated into the + * SecureChannel state and the Session state. The connectStatus is set if + * the client connection (including reconnects) has failed and the client + * has to "give up". If the connectStatus is not set, the client still has + * hope to connect or recover. */ + void (*stateCallback)(UA_Client *client, + UA_SecureChannelState channelState, + UA_SessionState sessionState, + UA_StatusCode connectStatus); + + /* When connectivityCheckInterval is greater than 0, every + * connectivityCheckInterval (in ms), a async read request is performed on + * the server. inactivityCallback is called when the client receive no + * response for this read request The connection can be closed, this in an + * attempt to recreate a healthy connection. */ + void (*inactivityCallback)(UA_Client *client); + +#ifdef UA_ENABLE_SUBSCRIPTIONS + /* Number of PublishResponse queued up in the server */ + UA_UInt16 outStandingPublishRequests; + + /* If the client does not receive a PublishResponse after the defined delay + * of ``(sub->publishingInterval * sub->maxKeepAliveCount) + + * client->config.timeout)``, then subscriptionInactivityCallback is called + * for the subscription.. */ + void (*subscriptionInactivityCallback)(UA_Client *client, + UA_UInt32 subscriptionId, + void *subContext); +#endif +} UA_ClientConfig; + + /** + * Client Lifecycle + * ---------------- */ + +/* The method UA_Client_new is defined in client_config_default.h. So default + * plugins outside of the core library (for logging, etc) are already available + * during the initialization. + * + * UA_Client UA_EXPORT * UA_Client_new(void); + */ + +/* Creates a new client. Moves the config into the client with a shallow copy. + * The config content is cleared together with the client. */ +UA_Client UA_EXPORT * +UA_Client_newWithConfig(const UA_ClientConfig *config); + +/* Returns the current state. All arguments except ``client`` can be NULL. */ +void UA_EXPORT +UA_Client_getState(UA_Client *client, + UA_SecureChannelState *channelState, + UA_SessionState *sessionState, + UA_StatusCode *connectStatus); + +/* Get the client configuration */ +UA_EXPORT UA_ClientConfig * +UA_Client_getConfig(UA_Client *client); + +/* Get the client context */ +static UA_INLINE void * +UA_Client_getContext(UA_Client *client) { + return UA_Client_getConfig(client)->clientContext; /* Cannot fail */ +} + +/* (Disconnect and) delete the client */ +void UA_EXPORT +UA_Client_delete(UA_Client *client); + +/** + * Connect to a Server + * ------------------- + * + * Once a client is connected to an endpointUrl, it is not possible to switch to + * another server. A new client has to be created for that. + * + * Once a connection is established, the client keeps the connection open and + * reconnects if necessary. + * + * If the connection fails unrecoverably (state->connectStatus is set to an + * error), the client is no longer usable. Create a new client if required. */ + +/* Connect to the server. First a SecureChannel is opened, then a Session. The + * client configuration restricts the SecureChannel selection and contains the + * UserIdentityToken for the Session. + * + * @param client to use + * @param endpointURL to connect (for example "opc.tcp://localhost:4840") + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_connect(UA_Client *client, const char *endpointUrl); + +/* Connect async (non-blocking) to the server. After initiating the connection, + * call UA_Client_run_iterate repeatedly until the connection is fully + * established. You can set a callback to client->config.stateCallback to be + * notified when the connection status changes. Or use UA_Client_getState to get + * the state manually. */ +UA_StatusCode UA_EXPORT +UA_Client_connectAsync(UA_Client *client, const char *endpointUrl); + +/* Connect to the server without creating a session + * + * @param client to use + * @param endpointURL to connect (for example "opc.tcp://localhost:4840") + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_connectSecureChannel(UA_Client *client, const char *endpointUrl); + +/* Connect async (non-blocking) only the SecureChannel */ +UA_StatusCode UA_EXPORT +UA_Client_connectSecureChannelAsync(UA_Client *client, const char *endpointUrl); + +/* Connect to the server and create+activate a Session with the given username + * and password. This first set the UserIdentityToken in the client config and + * then calls the regular connect method. */ +static UA_INLINE UA_StatusCode +UA_Client_connectUsername(UA_Client *client, const char *endpointUrl, + const char *username, const char *password) { + UA_UserNameIdentityToken* identityToken = UA_UserNameIdentityToken_new(); + if(!identityToken) + return UA_STATUSCODE_BADOUTOFMEMORY; + identityToken->userName = UA_STRING_ALLOC(username); + identityToken->password = UA_STRING_ALLOC(password); + UA_ClientConfig *cc = UA_Client_getConfig(client); + UA_ExtensionObject_clear(&cc->userIdentityToken); + cc->userIdentityToken.encoding = UA_EXTENSIONOBJECT_DECODED; + cc->userIdentityToken.content.decoded.type = &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]; + cc->userIdentityToken.content.decoded.data = identityToken; + return UA_Client_connect(client, endpointUrl); +} + +/* Disconnect and close a connection to the selected server. Disconnection is + * always performed async (without blocking). */ +UA_StatusCode UA_EXPORT +UA_Client_disconnect(UA_Client *client); + +/* Disconnect async. Run UA_Client_run_iterate until the callback notifies that + * all connections are closed. */ +UA_StatusCode UA_EXPORT +UA_Client_disconnectAsync(UA_Client *client); + +/* Disconnect the SecureChannel but keep the Session intact (if it exists). + * This is always an async (non-blocking) operation. */ +UA_StatusCode UA_EXPORT +UA_Client_disconnectSecureChannel(UA_Client *client); + +/** + * Discovery + * --------- */ + +/* Gets a list of endpoints of a server + * + * @param client to use. Must be connected to the same endpoint given in + * serverUrl or otherwise in disconnected state. + * @param serverUrl url to connect (for example "opc.tcp://localhost:4840") + * @param endpointDescriptionsSize size of the array of endpoint descriptions + * @param endpointDescriptions array of endpoint descriptions that is allocated + * by the function (you need to free manually) + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_getEndpoints(UA_Client *client, const char *serverUrl, + size_t* endpointDescriptionsSize, + UA_EndpointDescription** endpointDescriptions); + +/* Gets a list of all registered servers at the given server. + * + * You can pass an optional filter for serverUris. If the given server is not registered, + * an empty array will be returned. If the server is registered, only that application + * description will be returned. + * + * Additionally you can optionally indicate which locale you want for the server name + * in the returned application description. The array indicates the order of preference. + * A server may have localized names. + * + * @param client to use. Must be connected to the same endpoint given in + * serverUrl or otherwise in disconnected state. + * @param serverUrl url to connect (for example "opc.tcp://localhost:4840") + * @param serverUrisSize Optional filter for specific server uris + * @param serverUris Optional filter for specific server uris + * @param localeIdsSize Optional indication which locale you prefer + * @param localeIds Optional indication which locale you prefer + * @param registeredServersSize size of returned array, i.e., number of found/registered servers + * @param registeredServers array containing found/registered servers + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_findServers(UA_Client *client, const char *serverUrl, + size_t serverUrisSize, UA_String *serverUris, + size_t localeIdsSize, UA_String *localeIds, + size_t *registeredServersSize, + UA_ApplicationDescription **registeredServers); + +#ifdef UA_ENABLE_DISCOVERY +/* Get a list of all known server in the network. Only supported by LDS servers. + * + * @param client to use. Must be connected to the same endpoint given in + * serverUrl or otherwise in disconnected state. + * @param serverUrl url to connect (for example "opc.tcp://localhost:4840") + * @param startingRecordId optional. Only return the records with an ID higher + * or equal the given. Can be used for pagination to only get a subset of + * the full list + * @param maxRecordsToReturn optional. Only return this number of records + + * @param serverCapabilityFilterSize optional. Filter the returned list to only + * get servers with given capabilities, e.g. "LDS" + * @param serverCapabilityFilter optional. Filter the returned list to only get + * servers with given capabilities, e.g. "LDS" + * @param serverOnNetworkSize size of returned array, i.e., number of + * known/registered servers + * @param serverOnNetwork array containing known/registered servers + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_findServersOnNetwork(UA_Client *client, const char *serverUrl, + UA_UInt32 startingRecordId, UA_UInt32 maxRecordsToReturn, + size_t serverCapabilityFilterSize, UA_String *serverCapabilityFilter, + size_t *serverOnNetworkSize, UA_ServerOnNetwork **serverOnNetwork); +#endif + +/** + * .. _client-services: + * + * Services + * -------- + * + * The raw OPC UA services are exposed to the client. But most of them time, it + * is better to use the convenience functions from ``ua_client_highlevel.h`` + * that wrap the raw services. */ +/* Don't use this function. Use the type versions below instead. */ +void UA_EXPORT +__UA_Client_Service(UA_Client *client, const void *request, + const UA_DataType *requestType, void *response, + const UA_DataType *responseType); + +/* + * Attribute Service Set + * ^^^^^^^^^^^^^^^^^^^^^ */ +static UA_INLINE UA_ReadResponse +UA_Client_Service_read(UA_Client *client, const UA_ReadRequest request) { + UA_ReadResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_READREQUEST], + &response, &UA_TYPES[UA_TYPES_READRESPONSE]); + return response; +} + +static UA_INLINE UA_WriteResponse +UA_Client_Service_write(UA_Client *client, const UA_WriteRequest request) { + UA_WriteResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_WRITEREQUEST], + &response, &UA_TYPES[UA_TYPES_WRITERESPONSE]); + return response; +} + +/* +* Historical Access Service Set +* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ +#ifdef UA_ENABLE_HISTORIZING +static UA_INLINE UA_HistoryReadResponse +UA_Client_Service_historyRead(UA_Client *client, const UA_HistoryReadRequest request) { + UA_HistoryReadResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_HISTORYREADREQUEST], + &response, &UA_TYPES[UA_TYPES_HISTORYREADRESPONSE]); + return response; +} + +static UA_INLINE UA_HistoryUpdateResponse +UA_Client_Service_historyUpdate(UA_Client *client, const UA_HistoryUpdateRequest request) { + UA_HistoryUpdateResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_HISTORYUPDATEREQUEST], + &response, &UA_TYPES[UA_TYPES_HISTORYUPDATERESPONSE]); + return response; +} +#endif + +/* + * Method Service Set + * ^^^^^^^^^^^^^^^^^^ */ +#ifdef UA_ENABLE_METHODCALLS +static UA_INLINE UA_CallResponse +UA_Client_Service_call(UA_Client *client, const UA_CallRequest request) { + UA_CallResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_CALLREQUEST], + &response, &UA_TYPES[UA_TYPES_CALLRESPONSE]); + return response; +} +#endif + +/* + * NodeManagement Service Set + * ^^^^^^^^^^^^^^^^^^^^^^^^^^ */ +static UA_INLINE UA_AddNodesResponse +UA_Client_Service_addNodes(UA_Client *client, const UA_AddNodesRequest request) { + UA_AddNodesResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_ADDNODESREQUEST], + &response, &UA_TYPES[UA_TYPES_ADDNODESRESPONSE]); + return response; +} + +static UA_INLINE UA_AddReferencesResponse +UA_Client_Service_addReferences(UA_Client *client, + const UA_AddReferencesRequest request) { + UA_AddReferencesResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_ADDREFERENCESREQUEST], + &response, &UA_TYPES[UA_TYPES_ADDREFERENCESRESPONSE]); + return response; +} + +static UA_INLINE UA_DeleteNodesResponse +UA_Client_Service_deleteNodes(UA_Client *client, + const UA_DeleteNodesRequest request) { + UA_DeleteNodesResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_DELETENODESREQUEST], + &response, &UA_TYPES[UA_TYPES_DELETENODESRESPONSE]); + return response; +} + +static UA_INLINE UA_DeleteReferencesResponse +UA_Client_Service_deleteReferences(UA_Client *client, + const UA_DeleteReferencesRequest request) { + UA_DeleteReferencesResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_DELETEREFERENCESREQUEST], + &response, &UA_TYPES[UA_TYPES_DELETEREFERENCESRESPONSE]); + return response; +} + +/* + * View Service Set + * ^^^^^^^^^^^^^^^^ */ +static UA_INLINE UA_BrowseResponse +UA_Client_Service_browse(UA_Client *client, const UA_BrowseRequest request) { + UA_BrowseResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_BROWSEREQUEST], + &response, &UA_TYPES[UA_TYPES_BROWSERESPONSE]); + return response; +} + +static UA_INLINE UA_BrowseNextResponse +UA_Client_Service_browseNext(UA_Client *client, + const UA_BrowseNextRequest request) { + UA_BrowseNextResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_BROWSENEXTREQUEST], + &response, &UA_TYPES[UA_TYPES_BROWSENEXTRESPONSE]); + return response; +} + +static UA_INLINE UA_TranslateBrowsePathsToNodeIdsResponse +UA_Client_Service_translateBrowsePathsToNodeIds(UA_Client *client, + const UA_TranslateBrowsePathsToNodeIdsRequest request) { + UA_TranslateBrowsePathsToNodeIdsResponse response; + __UA_Client_Service(client, &request, + &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST], + &response, + &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE]); + return response; +} + +static UA_INLINE UA_RegisterNodesResponse +UA_Client_Service_registerNodes(UA_Client *client, + const UA_RegisterNodesRequest request) { + UA_RegisterNodesResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_REGISTERNODESREQUEST], + &response, &UA_TYPES[UA_TYPES_REGISTERNODESRESPONSE]); + return response; +} + +static UA_INLINE UA_UnregisterNodesResponse +UA_Client_Service_unregisterNodes(UA_Client *client, + const UA_UnregisterNodesRequest request) { + UA_UnregisterNodesResponse response; + __UA_Client_Service(client, &request, + &UA_TYPES[UA_TYPES_UNREGISTERNODESREQUEST], + &response, &UA_TYPES[UA_TYPES_UNREGISTERNODESRESPONSE]); + return response; +} + +/* + * Query Service Set + * ^^^^^^^^^^^^^^^^^ */ +#ifdef UA_ENABLE_QUERY + +static UA_INLINE UA_QueryFirstResponse +UA_Client_Service_queryFirst(UA_Client *client, + const UA_QueryFirstRequest request) { + UA_QueryFirstResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_QUERYFIRSTREQUEST], + &response, &UA_TYPES[UA_TYPES_QUERYFIRSTRESPONSE]); + return response; +} + +static UA_INLINE UA_QueryNextResponse +UA_Client_Service_queryNext(UA_Client *client, + const UA_QueryNextRequest request) { + UA_QueryNextResponse response; + __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_QUERYFIRSTREQUEST], + &response, &UA_TYPES[UA_TYPES_QUERYFIRSTRESPONSE]); + return response; +} + +#endif + +/** + * .. _client-async-services: + * + * Asynchronous Services + * --------------------- + * All OPC UA services are asynchronous in nature. So several service calls can + * be made without waiting for the individual responses. Depending on the + * server's priorities responses may come in a different ordering than sent. + * + * As noted in :ref:`the client overview<client>` currently no means + * of handling asynchronous events automatically is provided. However, some + * synchronous function calls will trigger handling, but to ensure this + * happens a client should periodically call `UA_Client_run_iterate` + * explicitly. + * + * Connection and session management are also performed in + * `UA_Client_run_iterate`, so to keep a connection healthy any client need to + * consider how and when it is appropriate to do the call. + * This is especially true for the periodic renewal of a SecureChannel's + * SecurityToken which is designed to have a limited lifetime and will + * invalidate the connection if not renewed. + */ + +/* Use the type versions of this method. See below. However, the general + * mechanism of async service calls is explained here. + * + * We say that an async service call has been dispatched once this method + * returns UA_STATUSCODE_GOOD. If there is an error after an async service has + * been dispatched, the callback is called with an "empty" response where the + * statusCode has been set accordingly. This is also done if the client is + * shutting down and the list of dispatched async services is emptied. + * + * The statusCode received when the client is shutting down is + * UA_STATUSCODE_BADSHUTDOWN. + * + * The statusCode received when the client don't receive response + * after specified config->timeout (in ms) is + * UA_STATUSCODE_BADTIMEOUT. + * + * Instead, you can use __UA_Client_AsyncServiceEx to specify + * a custom timeout + * + * The userdata and requestId arguments can be NULL. */ + +typedef void (*UA_ClientAsyncServiceCallback)(UA_Client *client, void *userdata, + UA_UInt32 requestId, void *response); + +UA_StatusCode UA_EXPORT +__UA_Client_AsyncService(UA_Client *client, const void *request, + const UA_DataType *requestType, + UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, + void *userdata, UA_UInt32 *requestId); + +UA_StatusCode UA_EXPORT +UA_Client_sendAsyncRequest(UA_Client *client, const void *request, + const UA_DataType *requestType, UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, void *userdata, UA_UInt32 *requestId); + +/* Listen on the network and process arriving asynchronous responses in the + * background. Internal housekeeping, renewal of SecureChannels and subscription + * management is done as well. */ +UA_StatusCode UA_EXPORT +UA_Client_run_iterate(UA_Client *client, UA_UInt32 timeout); + +/* Force the manual renewal of the SecureChannel. This is useful to renew the + * SecureChannel during a downtime when no time-critical operations are + * performed. This method is asynchronous. The renewal is triggered (the OPN + * message is sent) but not completed. The OPN response is handled with + * ``UA_Client_run_iterate`` or a synchronous servica-call operation. + * + * @return The return value is UA_STATUSCODE_GOODCALLAGAIN if the SecureChannel + * has not elapsed at least 75% of its lifetime. Otherwise the + * ``connectStatus`` is returned. */ +UA_StatusCode UA_EXPORT +UA_Client_renewSecureChannel(UA_Client *client); + +/* Use the type versions of this method. See below. However, the general + * mechanism of async service calls is explained here. + * + * We say that an async service call has been dispatched once this method + * returns UA_STATUSCODE_GOOD. If there is an error after an async service has + * been dispatched, the callback is called with an "empty" response where the + * statusCode has been set accordingly. This is also done if the client is + * shutting down and the list of dispatched async services is emptied. + * + * The statusCode received when the client is shutting down is + * UA_STATUSCODE_BADSHUTDOWN. + * + * The statusCode received when the client don't receive response + * after specified timeout (in ms) is + * UA_STATUSCODE_BADTIMEOUT. + * + * The timeout can be disabled by setting timeout to 0 + * + * The userdata and requestId arguments can be NULL. */ +UA_StatusCode UA_EXPORT +__UA_Client_AsyncServiceEx(UA_Client *client, const void *request, + const UA_DataType *requestType, + UA_ClientAsyncServiceCallback callback, + const UA_DataType *responseType, + void *userdata, UA_UInt32 *requestId, + UA_UInt32 timeout); + +/** + * Timed Callbacks + * --------------- + * Repeated callbacks can be attached to a client and will be executed in the + * defined interval. */ + +typedef void (*UA_ClientCallback)(UA_Client *client, void *data); + +/* Add a callback for execution at a specified time. If the indicated time lies + * in the past, then the callback is executed at the next iteration of the + * server's main loop. + * + * @param client The client object. + * @param callback The callback that shall be added. + * @param data Data that is forwarded to the callback. + * @param date The timestamp for the execution time. + * @param callbackId Set to the identifier of the repeated callback . This can + * be used to cancel the callback later on. If the pointer is null, the + * identifier is not set. + * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code + * otherwise. */ +UA_StatusCode UA_EXPORT +UA_Client_addTimedCallback(UA_Client *client, UA_ClientCallback callback, + void *data, UA_DateTime date, UA_UInt64 *callbackId); + +/* Add a callback for cyclic repetition to the client. + * + * @param client The client object. + * @param callback The callback that shall be added. + * @param data Data that is forwarded to the callback. + * @param interval_ms The callback shall be repeatedly executed with the given + * interval (in ms). The interval must be positive. The first execution + * occurs at now() + interval at the latest. + * @param callbackId Set to the identifier of the repeated callback . This can + * be used to cancel the callback later on. If the pointer is null, the + * identifier is not set. + * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code + * otherwise. */ +UA_StatusCode UA_EXPORT +UA_Client_addRepeatedCallback(UA_Client *client, UA_ClientCallback callback, + void *data, UA_Double interval_ms, + UA_UInt64 *callbackId); + +UA_StatusCode UA_EXPORT +UA_Client_changeRepeatedCallbackInterval(UA_Client *client, + UA_UInt64 callbackId, + UA_Double interval_ms); + +void UA_EXPORT +UA_Client_removeCallback(UA_Client *client, UA_UInt64 callbackId); + +/** + * Client Utility Functions + * ------------------------ */ + +/* Lookup a datatype by its NodeId. Takes the custom types in the client + * configuration into account. Return NULL if none found. */ +UA_EXPORT const UA_DataType * +UA_Client_findDataType(UA_Client *client, const UA_NodeId *typeId); + +/** + * .. toctree:: + * + * client_highlevel + * client_subscriptions */ + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/client_highlevel.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2015-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2015 (c) Oleksiy Vasylyev + * Copyright 2017 (c) Florian Palm + * Copyright 2016 (c) Chris Iatrou + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2017 (c) Frank Meerkötter + * Copyright 2018 (c) Fabian Arndt + * Copyright 2018 (c) Peter Rustler, basyskom GmbH + */ + + + +_UA_BEGIN_DECLS + +/** + * .. _client-highlevel: + * + * Highlevel Client Functionality + * ------------------------------ + * + * The following definitions are convenience functions making use of the + * standard OPC UA services in the background. This is a less flexible way of + * handling the stack, because at many places sensible defaults are presumed; at + * the same time using these functions is the easiest way of implementing an OPC + * UA application, as you will not have to consider all the details that go into + * the OPC UA services. If more flexibility is needed, you can always achieve + * the same functionality using the raw :ref:`OPC UA services + * <client-services>`. + * + * Read Attributes + * ^^^^^^^^^^^^^^^ + * The following functions can be used to retrieve a single node attribute. Use + * the regular service to read several attributes at once. */ + +/* Don't call this function, use the typed versions */ +UA_StatusCode UA_EXPORT +__UA_Client_readAttribute(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, void *out, + const UA_DataType *outDataType); + +static UA_INLINE UA_StatusCode +UA_Client_readNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_NodeId *outNodeId) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID, + outNodeId, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_NodeClass *outNodeClass) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS, + outNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_QualifiedName *outBrowseName) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, + outBrowseName, + &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_LocalizedText *outDisplayName) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, + outDisplayName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_LocalizedText *outDescription) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, + outDescription, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_UInt32 *outWriteMask) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, + outWriteMask, &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_UInt32 *outUserWriteMask) { + return __UA_Client_readAttribute(client, &nodeId, + UA_ATTRIBUTEID_USERWRITEMASK, + outUserWriteMask, + &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outIsAbstract) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, + outIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outSymmetric) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, + outSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_LocalizedText *outInverseName) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, + outInverseName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outContainsNoLoops) { + return __UA_Client_readAttribute(client, &nodeId, + UA_ATTRIBUTEID_CONTAINSNOLOOPS, + outContainsNoLoops, + &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Byte *outEventNotifier) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, + outEventNotifier, &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readValueAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Variant *outValue) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE, + outValue, &UA_TYPES[UA_TYPES_VARIANT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_NodeId *outDataType) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE, + outDataType, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readValueRankAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Int32 *outValueRank) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK, + outValueRank, &UA_TYPES[UA_TYPES_INT32]); +} + +UA_StatusCode UA_EXPORT +UA_Client_readArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId, + size_t *outArrayDimensionsSize, + UA_UInt32 **outArrayDimensions); + +static UA_INLINE UA_StatusCode +UA_Client_readAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Byte *outAccessLevel) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, + outAccessLevel, &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Byte *outUserAccessLevel) { + return __UA_Client_readAttribute(client, &nodeId, + UA_ATTRIBUTEID_USERACCESSLEVEL, + outUserAccessLevel, + &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readMinimumSamplingIntervalAttribute(UA_Client *client, + const UA_NodeId nodeId, + UA_Double *outMinSamplingInterval) { + return __UA_Client_readAttribute(client, &nodeId, + UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + outMinSamplingInterval, + &UA_TYPES[UA_TYPES_DOUBLE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outHistorizing) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, + outHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outExecutable) { + return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, + outExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_readUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean *outUserExecutable) { + return __UA_Client_readAttribute(client, &nodeId, + UA_ATTRIBUTEID_USEREXECUTABLE, + outUserExecutable, + &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +/** + * Historical Access + * ^^^^^^^^^^^^^^^^^ + * The following functions can be used to read a single node historically. + * Use the regular service to read several nodes at once. */ + +#ifdef UA_ENABLE_HISTORIZING +typedef UA_Boolean +(*UA_HistoricalIteratorCallback)(UA_Client *client, + const UA_NodeId *nodeId, + UA_Boolean moreDataAvailable, + const UA_ExtensionObject *data, void *callbackContext); + +#ifdef UA_ENABLE_EXPERIMENTAL_HISTORIZING +UA_StatusCode UA_EXPORT +UA_Client_HistoryRead_events(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, const UA_EventFilter filter, UA_UInt32 numValuesPerNode, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext); +#endif // UA_ENABLE_EXPERIMENTAL_HISTORIZING + +UA_StatusCode UA_EXPORT +UA_Client_HistoryRead_raw(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, UA_Boolean returnBounds, UA_UInt32 numValuesPerNode, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext); + +#ifdef UA_ENABLE_EXPERIMENTAL_HISTORIZING +UA_StatusCode UA_EXPORT +UA_Client_HistoryRead_modified(UA_Client *client, const UA_NodeId *nodeId, + const UA_HistoricalIteratorCallback callback, + UA_DateTime startTime, UA_DateTime endTime, + UA_String indexRange, UA_Boolean returnBounds, UA_UInt32 numValuesPerNode, + UA_TimestampsToReturn timestampsToReturn, void *callbackContext); +#endif // UA_ENABLE_EXPERIMENTAL_HISTORIZING + +UA_StatusCode UA_EXPORT +UA_Client_HistoryUpdate_insert(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value); + +UA_StatusCode UA_EXPORT +UA_Client_HistoryUpdate_replace(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value); + +UA_StatusCode UA_EXPORT +UA_Client_HistoryUpdate_update(UA_Client *client, + const UA_NodeId *nodeId, + UA_DataValue *value); + +UA_StatusCode UA_EXPORT +UA_Client_HistoryUpdate_deleteRaw(UA_Client *client, + const UA_NodeId *nodeId, + UA_DateTime startTimestamp, + UA_DateTime endTimestamp); + +#endif // UA_ENABLE_HISTORIZING + +/** + * Write Attributes + * ^^^^^^^^^^^^^^^^ + * + * The following functions can be use to write a single node attribute at a + * time. Use the regular write service to write several attributes at once. */ + +/* Don't call this function, use the typed versions */ +UA_StatusCode UA_EXPORT +__UA_Client_writeAttribute(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, const void *in, + const UA_DataType *inDataType); + +static UA_INLINE UA_StatusCode +UA_Client_writeNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeId *newNodeId) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID, + newNodeId, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeClass *newNodeClass) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS, + newNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_QualifiedName *newBrowseName) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, + newBrowseName, + &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *newDisplayName) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, + newDisplayName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *newDescription) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, + newDescription, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_UInt32 *newWriteMask) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, + newWriteMask, &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_UInt32 *newUserWriteMask) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_USERWRITEMASK, + newUserWriteMask, + &UA_TYPES[UA_TYPES_UINT32]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newIsAbstract) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, + newIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newSymmetric) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, + newSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *newInverseName) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, + newInverseName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newContainsNoLoops) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_CONTAINSNOLOOPS, + newContainsNoLoops, + &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *newEventNotifier) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_EVENTNOTIFIER, + newEventNotifier, + &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeValueAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Variant *newValue) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE, + newValue, &UA_TYPES[UA_TYPES_VARIANT]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeId *newDataType) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE, + newDataType, &UA_TYPES[UA_TYPES_NODEID]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeValueRankAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Int32 *newValueRank) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK, + newValueRank, &UA_TYPES[UA_TYPES_INT32]); +} + +UA_StatusCode UA_EXPORT +UA_Client_writeArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId, + size_t newArrayDimensionsSize, + const UA_UInt32 *newArrayDimensions); + +static UA_INLINE UA_StatusCode +UA_Client_writeAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *newAccessLevel) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, + newAccessLevel, &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *newUserAccessLevel) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_USERACCESSLEVEL, + newUserAccessLevel, + &UA_TYPES[UA_TYPES_BYTE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeMinimumSamplingIntervalAttribute(UA_Client *client, + const UA_NodeId nodeId, + const UA_Double *newMinInterval) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + newMinInterval, &UA_TYPES[UA_TYPES_DOUBLE]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newHistorizing) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, + newHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newExecutable) { + return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, + newExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *newUserExecutable) { + return __UA_Client_writeAttribute(client, &nodeId, + UA_ATTRIBUTEID_USEREXECUTABLE, + newUserExecutable, + &UA_TYPES[UA_TYPES_BOOLEAN]); +} + +/** + * Method Calling + * ^^^^^^^^^^^^^^ */ + +#ifdef UA_ENABLE_METHODCALLS +UA_StatusCode UA_EXPORT +UA_Client_call(UA_Client *client, const UA_NodeId objectId, + const UA_NodeId methodId, size_t inputSize, const UA_Variant *input, + size_t *outputSize, UA_Variant **output); +#endif + +/** + * Node Management + * ^^^^^^^^^^^^^^^ + * See the section on :ref:`server-side node management <addnodes>`. */ + +UA_StatusCode UA_EXPORT +UA_Client_addReference(UA_Client *client, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_String targetServerUri, + const UA_ExpandedNodeId targetNodeId, + UA_NodeClass targetNodeClass); + +UA_StatusCode UA_EXPORT +UA_Client_deleteReference(UA_Client *client, const UA_NodeId sourceNodeId, + const UA_NodeId referenceTypeId, UA_Boolean isForward, + const UA_ExpandedNodeId targetNodeId, + UA_Boolean deleteBidirectional); + +UA_StatusCode UA_EXPORT +UA_Client_deleteNode(UA_Client *client, const UA_NodeId nodeId, + UA_Boolean deleteTargetReferences); + +/* Protect against redundant definitions for server/client */ +#ifndef UA_DEFAULT_ATTRIBUTES_DEFINED +#define UA_DEFAULT_ATTRIBUTES_DEFINED +/* The default for variables is "BaseDataType" for the datatype, -2 for the + * valuerank and a read-accesslevel. */ +UA_EXPORT extern const UA_VariableAttributes UA_VariableAttributes_default; +UA_EXPORT extern const UA_VariableTypeAttributes UA_VariableTypeAttributes_default; +/* Methods are executable by default */ +UA_EXPORT extern const UA_MethodAttributes UA_MethodAttributes_default; +/* The remaining attribute definitions are currently all zeroed out */ +UA_EXPORT extern const UA_ObjectAttributes UA_ObjectAttributes_default; +UA_EXPORT extern const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default; +UA_EXPORT extern const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default; +UA_EXPORT extern const UA_DataTypeAttributes UA_DataTypeAttributes_default; +UA_EXPORT extern const UA_ViewAttributes UA_ViewAttributes_default; +#endif + +/* Don't call this function, use the typed versions */ +UA_StatusCode UA_EXPORT +__UA_Client_addNode(UA_Client *client, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, const UA_NodeAttributes *attr, + const UA_DataType *attributeType, UA_NodeId *outNewNodeId); + +static UA_INLINE UA_StatusCode +UA_Client_addVariableNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_VariableAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_VARIABLE, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + typeDefinition, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], + outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addVariableTypeNode(UA_Client *client, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_VariableTypeAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_VARIABLETYPE, + requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], + outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addObjectNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_ObjectAttributes attr, UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_OBJECT, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + typeDefinition, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addObjectTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ObjectTypeAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_OBJECTTYPE, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], + outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addViewNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ViewAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_VIEW, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addReferenceTypeNode(UA_Client *client, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ReferenceTypeAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_REFERENCETYPE, + requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], + outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addDataTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_DataTypeAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_DATATYPE, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], + outNewNodeId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addMethodNode(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_MethodAttributes attr, + UA_NodeId *outNewNodeId) { + return __UA_Client_addNode(client, UA_NODECLASS_METHOD, requestedNewNodeId, + parentNodeId, referenceTypeId, browseName, + UA_NODEID_NULL, (const UA_NodeAttributes*)&attr, + &UA_TYPES[UA_TYPES_METHODATTRIBUTES], outNewNodeId); +} + +/** + * Misc Highlevel Functionality + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + +/* Get the namespace-index of a namespace-URI + * + * @param client The UA_Client struct for this connection + * @param namespaceUri The interested namespace URI + * @param namespaceIndex The namespace index of the URI. The value is unchanged + * in case of an error + * @return Indicates whether the operation succeeded or returns an error code */ +UA_StatusCode UA_EXPORT +UA_Client_NamespaceGetIndex(UA_Client *client, UA_String *namespaceUri, + UA_UInt16 *namespaceIndex); + +#ifndef HAVE_NODEITER_CALLBACK +#define HAVE_NODEITER_CALLBACK +/* Iterate over all nodes referenced by parentNodeId by calling the callback + function for each child node */ +typedef UA_StatusCode (*UA_NodeIteratorCallback)(UA_NodeId childId, UA_Boolean isInverse, + UA_NodeId referenceTypeId, void *handle); +#endif + +UA_StatusCode UA_EXPORT +UA_Client_forEachChildNodeCall(UA_Client *client, UA_NodeId parentNodeId, + UA_NodeIteratorCallback callback, void *handle); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/client_subscriptions.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + + + +_UA_BEGIN_DECLS + +#ifdef UA_ENABLE_SUBSCRIPTIONS + +/** + * .. _client-subscriptions: + * + * Subscriptions + * ------------- + * + * Subscriptions in OPC UA are asynchronous. That is, the client sends several + * PublishRequests to the server. The server returns PublishResponses with + * notifications. But only when a notification has been generated. The client + * does not wait for the responses and continues normal operations. + * + * Note the difference between Subscriptions and MonitoredItems. Subscriptions + * are used to report back notifications. MonitoredItems are used to generate + * notifications. Every MonitoredItem is attached to exactly one Subscription. + * And a Subscription can contain many MonitoredItems. + * + * The client automatically processes PublishResponses (with a callback) in the + * background and keeps enough PublishRequests in transit. The PublishResponses + * may be recieved during a synchronous service call or in + * ``UA_Client_run_iterate``. See more about + * :ref:`asynchronicity<client-async-services>`. + */ + +/* Callbacks defined for Subscriptions */ +typedef void (*UA_Client_DeleteSubscriptionCallback) + (UA_Client *client, UA_UInt32 subId, void *subContext); + +typedef void (*UA_Client_StatusChangeNotificationCallback) + (UA_Client *client, UA_UInt32 subId, void *subContext, + UA_StatusChangeNotification *notification); + +/* Provides default values for a new subscription. + * + * RequestedPublishingInterval: 500.0 [ms] + * RequestedLifetimeCount: 10000 + * RequestedMaxKeepAliveCount: 10 + * MaxNotificationsPerPublish: 0 (unlimited) + * PublishingEnabled: true + * Priority: 0 */ +static UA_INLINE UA_CreateSubscriptionRequest +UA_CreateSubscriptionRequest_default(void) { + UA_CreateSubscriptionRequest request; + UA_CreateSubscriptionRequest_init(&request); + + request.requestedPublishingInterval = 500.0; + request.requestedLifetimeCount = 10000; + request.requestedMaxKeepAliveCount = 10; + request.maxNotificationsPerPublish = 0; + request.publishingEnabled = true; + request.priority = 0; + return request; +} + +UA_CreateSubscriptionResponse UA_EXPORT +UA_Client_Subscriptions_create(UA_Client *client, + const UA_CreateSubscriptionRequest request, + void *subscriptionContext, + UA_Client_StatusChangeNotificationCallback statusChangeCallback, + UA_Client_DeleteSubscriptionCallback deleteCallback); + +UA_StatusCode UA_EXPORT +UA_Client_Subscriptions_create_async(UA_Client *client, + const UA_CreateSubscriptionRequest request, + void *subscriptionContext, + UA_Client_StatusChangeNotificationCallback statusChangeCallback, + UA_Client_DeleteSubscriptionCallback deleteCallback, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId); + +UA_ModifySubscriptionResponse UA_EXPORT +UA_Client_Subscriptions_modify(UA_Client *client, + const UA_ModifySubscriptionRequest request); + +UA_StatusCode UA_EXPORT +UA_Client_Subscriptions_modify_async(UA_Client *client, + const UA_ModifySubscriptionRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId); + +UA_DeleteSubscriptionsResponse UA_EXPORT +UA_Client_Subscriptions_delete(UA_Client *client, + const UA_DeleteSubscriptionsRequest request); + +UA_StatusCode UA_EXPORT +UA_Client_Subscriptions_delete_async(UA_Client *client, + const UA_DeleteSubscriptionsRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId); + +/* Delete a single subscription */ +UA_StatusCode UA_EXPORT +UA_Client_Subscriptions_deleteSingle(UA_Client *client, UA_UInt32 subscriptionId); + +static UA_INLINE UA_SetPublishingModeResponse +UA_Client_Subscriptions_setPublishingMode(UA_Client *client, + const UA_SetPublishingModeRequest request) { + UA_SetPublishingModeResponse response; + __UA_Client_Service(client, + &request, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODEREQUEST], + &response, &UA_TYPES[UA_TYPES_SETPUBLISHINGMODERESPONSE]); + return response; +} + +/** + * MonitoredItems + * -------------- + * + * MonitoredItems for Events indicate the ``EventNotifier`` attribute. This + * indicates to the server not to monitor changes of the attribute, but to + * forward Event notifications from that node. + * + * During the creation of a MonitoredItem, the server may return changed + * adjusted parameters. Check the returned ``UA_CreateMonitoredItemsResponse`` + * to get the current parameters. */ + +/* Provides default values for a new monitored item. */ +static UA_INLINE UA_MonitoredItemCreateRequest +UA_MonitoredItemCreateRequest_default(UA_NodeId nodeId) { + UA_MonitoredItemCreateRequest request; + UA_MonitoredItemCreateRequest_init(&request); + request.itemToMonitor.nodeId = nodeId; + request.itemToMonitor.attributeId = UA_ATTRIBUTEID_VALUE; + request.monitoringMode = UA_MONITORINGMODE_REPORTING; + request.requestedParameters.samplingInterval = 250; + request.requestedParameters.discardOldest = true; + request.requestedParameters.queueSize = 1; + return request; +} + +/** + * The clientHandle parameter can't be set by the user, any value will be replaced + * by the client before sending the request to the server. */ + +/* Callback for the deletion of a MonitoredItem */ +typedef void (*UA_Client_DeleteMonitoredItemCallback) + (UA_Client *client, UA_UInt32 subId, void *subContext, + UA_UInt32 monId, void *monContext); + +/* Callback for DataChange notifications */ +typedef void (*UA_Client_DataChangeNotificationCallback) + (UA_Client *client, UA_UInt32 subId, void *subContext, + UA_UInt32 monId, void *monContext, + UA_DataValue *value); + +/* Callback for Event notifications */ +typedef void (*UA_Client_EventNotificationCallback) + (UA_Client *client, UA_UInt32 subId, void *subContext, + UA_UInt32 monId, void *monContext, + size_t nEventFields, UA_Variant *eventFields); + +/* Don't use to monitor the EventNotifier attribute */ +UA_CreateMonitoredItemsResponse UA_EXPORT +UA_Client_MonitoredItems_createDataChanges(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, void **contexts, + UA_Client_DataChangeNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks); + +UA_StatusCode UA_EXPORT +UA_Client_MonitoredItems_createDataChanges_async(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, void **contexts, + UA_Client_DataChangeNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_ClientAsyncServiceCallback createCallback, + void *userdata, UA_UInt32 *requestId); + +UA_MonitoredItemCreateResult UA_EXPORT +UA_Client_MonitoredItems_createDataChange(UA_Client *client, + UA_UInt32 subscriptionId, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, + void *context, UA_Client_DataChangeNotificationCallback callback, + UA_Client_DeleteMonitoredItemCallback deleteCallback); + +/* Monitor the EventNotifier attribute only */ +UA_CreateMonitoredItemsResponse UA_EXPORT +UA_Client_MonitoredItems_createEvents(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, void **contexts, + UA_Client_EventNotificationCallback *callback, + UA_Client_DeleteMonitoredItemCallback *deleteCallback); + +/* Monitor the EventNotifier attribute only */ +UA_StatusCode UA_EXPORT +UA_Client_MonitoredItems_createEvents_async(UA_Client *client, + const UA_CreateMonitoredItemsRequest request, void **contexts, + UA_Client_EventNotificationCallback *callbacks, + UA_Client_DeleteMonitoredItemCallback *deleteCallbacks, + UA_ClientAsyncServiceCallback createCallback, + void *userdata, UA_UInt32 *requestId); + +UA_MonitoredItemCreateResult UA_EXPORT +UA_Client_MonitoredItems_createEvent(UA_Client *client, + UA_UInt32 subscriptionId, + UA_TimestampsToReturn timestampsToReturn, + const UA_MonitoredItemCreateRequest item, + void *context, UA_Client_EventNotificationCallback callback, + UA_Client_DeleteMonitoredItemCallback deleteCallback); + +UA_DeleteMonitoredItemsResponse UA_EXPORT +UA_Client_MonitoredItems_delete(UA_Client *client, + const UA_DeleteMonitoredItemsRequest); + +UA_StatusCode UA_EXPORT +UA_Client_MonitoredItems_delete_async(UA_Client *client, + const UA_DeleteMonitoredItemsRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId); + +UA_StatusCode UA_EXPORT +UA_Client_MonitoredItems_deleteSingle(UA_Client *client, + UA_UInt32 subscriptionId, UA_UInt32 monitoredItemId); + +/* The clientHandle parameter will be filled automatically */ +UA_ModifyMonitoredItemsResponse UA_EXPORT +UA_Client_MonitoredItems_modify(UA_Client *client, + const UA_ModifyMonitoredItemsRequest request); + +/** + * The following service calls go directly to the server. The MonitoredItem + * settings are not stored in the client. */ + +static UA_INLINE UA_SetMonitoringModeResponse +UA_Client_MonitoredItems_setMonitoringMode(UA_Client *client, + const UA_SetMonitoringModeRequest request) { + UA_SetMonitoringModeResponse response; + __UA_Client_Service(client, + &request, &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST], + &response, &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE]); + return response; +} + +static UA_INLINE UA_SetTriggeringResponse +UA_Client_MonitoredItems_setTriggering(UA_Client *client, + const UA_SetTriggeringRequest request) { + UA_SetTriggeringResponse response; + __UA_Client_Service(client, + &request, &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST], + &response, &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE]); + return response; +} + +static UA_INLINE UA_StatusCode +UA_Client_MonitoredItems_modify_async(UA_Client *client, + const UA_ModifyMonitoredItemsRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSREQUEST], callback, + &UA_TYPES[UA_TYPES_MODIFYMONITOREDITEMSRESPONSE], + userdata, requestId); +} + +static UA_INLINE UA_StatusCode +UA_Client_MonitoredItems_setMonitoringMode_async(UA_Client *client, + const UA_SetMonitoringModeRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_SETMONITORINGMODEREQUEST], callback, + &UA_TYPES[UA_TYPES_SETMONITORINGMODERESPONSE], + userdata, requestId); +} + +static UA_INLINE UA_StatusCode +UA_Client_MonitoredItems_setTriggering_async(UA_Client *client, + const UA_SetTriggeringRequest request, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *requestId) { + return __UA_Client_AsyncService(client, &request, + &UA_TYPES[UA_TYPES_SETTRIGGERINGREQUEST], callback, + &UA_TYPES[UA_TYPES_SETTRIGGERINGRESPONSE], + userdata, requestId); +} + +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/client_highlevel_async.h" ***********************************/ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA + * Copyright 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + + +_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 +UA_Client_sendAsyncReadRequest(UA_Client *client, UA_ReadRequest *request, + UA_ClientAsyncReadCallback readCallback, void *userdata, + UA_UInt32 *reqId) { + return UA_Client_sendAsyncRequest(client, request, &UA_TYPES[UA_TYPES_READREQUEST], + (UA_ClientAsyncServiceCallback)readCallback, + &UA_TYPES[UA_TYPES_READRESPONSE], userdata, reqId); +} + +typedef void (*UA_ClientAsyncWriteCallback)(UA_Client *client, void *userdata, + UA_UInt32 requestId, UA_WriteResponse *wr); +static UA_INLINE UA_StatusCode +UA_Client_sendAsyncWriteRequest(UA_Client *client, UA_WriteRequest *request, + UA_ClientAsyncWriteCallback writeCallback, void *userdata, + UA_UInt32 *reqId) { + return UA_Client_sendAsyncRequest(client, request, &UA_TYPES[UA_TYPES_WRITEREQUEST], + (UA_ClientAsyncServiceCallback)writeCallback, + &UA_TYPES[UA_TYPES_WRITERESPONSE], userdata, reqId); +} + +typedef void (*UA_ClientAsyncBrowseCallback)(UA_Client *client, void *userdata, + UA_UInt32 requestId, UA_BrowseResponse *wr); +static UA_INLINE UA_StatusCode +UA_Client_sendAsyncBrowseRequest(UA_Client *client, UA_BrowseRequest *request, + UA_ClientAsyncBrowseCallback browseCallback, + void *userdata, UA_UInt32 *reqId) { + return UA_Client_sendAsyncRequest(client, request, &UA_TYPES[UA_TYPES_BROWSEREQUEST], + (UA_ClientAsyncServiceCallback)browseCallback, + &UA_TYPES[UA_TYPES_BROWSERESPONSE], userdata, + reqId); +} + +/** + * Read Attribute + * ^^^^^^^^^^^^^^ */ +UA_StatusCode UA_EXPORT +__UA_Client_readAttribute_async(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, + const UA_DataType *outDataType, + UA_ClientAsyncServiceCallback callback, void *userdata, + UA_UInt32 *reqId); + +typedef void (*UA_ClientAsyncReadDataTypeAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_NodeId *var); +static UA_INLINE UA_StatusCode +UA_Client_readDataTypeAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadDataTypeAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_DATATYPE, &UA_TYPES[UA_TYPES_NODEID], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +typedef void (*UA_ClientAsyncReadValueAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Variant *var); +static UA_INLINE UA_StatusCode +UA_Client_readValueAttribute_async(UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadValueAttributeCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_VALUE, &UA_TYPES[UA_TYPES_VARIANT], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +typedef void (*UA_ClientAsyncReadNodeIdAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_NodeId *out); +static UA_INLINE UA_StatusCode +UA_Client_readNodeIdAttribute_async(UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadNodeIdAttributeCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_NODEID, &UA_TYPES[UA_TYPES_NODEID], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadNodeClassAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_NodeClass *out); +static UA_INLINE UA_StatusCode +UA_Client_readNodeClassAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadNodeClassAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_NODECLASS, &UA_TYPES[UA_TYPES_NODECLASS], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadBrowseNameAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_QualifiedName *out); +static UA_INLINE UA_StatusCode +UA_Client_readBrowseNameAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadBrowseNameAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, &UA_TYPES[UA_TYPES_QUALIFIEDNAME], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadDisplayNameAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_LocalizedText *out); +static UA_INLINE UA_StatusCode +UA_Client_readDisplayNameAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadDisplayNameAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadDescriptionAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_LocalizedText *out); +static UA_INLINE UA_StatusCode +UA_Client_readDescriptionAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadDescriptionAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadWriteMaskAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_UInt32 *out); +static UA_INLINE UA_StatusCode +UA_Client_readWriteMaskAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadWriteMaskAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, &UA_TYPES[UA_TYPES_UINT32], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadUserWriteMaskAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_UInt32 *out); +static UA_INLINE UA_StatusCode +UA_Client_readUserWriteMaskAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadUserWriteMaskAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_USERWRITEMASK, &UA_TYPES[UA_TYPES_UINT32], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadIsAbstractAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readIsAbstractAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadIsAbstractAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadSymmetricAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readSymmetricAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadSymmetricAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadInverseNameAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_LocalizedText *out); +static UA_INLINE UA_StatusCode +UA_Client_readInverseNameAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadInverseNameAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadContainsNoLoopsAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readContainsNoLoopsAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadContainsNoLoopsAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadEventNotifierAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Byte *out); +static UA_INLINE UA_StatusCode +UA_Client_readEventNotifierAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadEventNotifierAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, &UA_TYPES[UA_TYPES_BYTE], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadValueRankAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Int32 *out); +static UA_INLINE UA_StatusCode +UA_Client_readValueRankAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadValueRankAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_VALUERANK, &UA_TYPES[UA_TYPES_INT32], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadAccessLevelAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Byte *out); +static UA_INLINE UA_StatusCode +UA_Client_readAccessLevelAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadAccessLevelAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, &UA_TYPES[UA_TYPES_BYTE], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadUserAccessLevelAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Byte *out); +static UA_INLINE UA_StatusCode +UA_Client_readUserAccessLevelAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadUserAccessLevelAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_USERACCESSLEVEL, &UA_TYPES[UA_TYPES_BYTE], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadMinimumSamplingIntervalAttributeCallback)( + UA_Client *client, void *userdata, UA_UInt32 requestId, UA_Double *out); +static UA_INLINE UA_StatusCode +UA_Client_readMinimumSamplingIntervalAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadMinimumSamplingIntervalAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + &UA_TYPES[UA_TYPES_DOUBLE], (UA_ClientAsyncServiceCallback)callback, userdata, + reqId); +} +typedef void (*UA_ClientAsyncReadHistorizingAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readHistorizingAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadHistorizingAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadExecutableAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readExecutableAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadExecutableAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +typedef void (*UA_ClientAsyncReadUserExecutableAttributeCallback)(UA_Client *client, + void *userdata, + UA_UInt32 requestId, + UA_Boolean *out); +static UA_INLINE UA_StatusCode +UA_Client_readUserExecutableAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + UA_ClientAsyncReadUserExecutableAttributeCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_readAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_USEREXECUTABLE, &UA_TYPES[UA_TYPES_BOOLEAN], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} +/** + * Write Attribute + * ^^^^^^^^^^^^^^ */ + +UA_StatusCode UA_EXPORT +__UA_Client_writeAttribute_async(UA_Client *client, const UA_NodeId *nodeId, + UA_AttributeId attributeId, const void *in, + const UA_DataType *inDataType, + UA_ClientAsyncServiceCallback callback, void *userdata, + UA_UInt32 *reqId); + +static UA_INLINE UA_StatusCode +UA_Client_writeValueAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Variant *newValue, + UA_ClientAsyncWriteCallback callback, void *userdata, + UA_UInt32 *reqId) { + + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_VALUE, newValue, &UA_TYPES[UA_TYPES_VARIANT], + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_writeNodeIdAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeId *outNodeId, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_NODEID, + outNodeId, &UA_TYPES[UA_TYPES_NODEID], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeNodeClassAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeClass *outNodeClass, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_NODECLASS, + outNodeClass, &UA_TYPES[UA_TYPES_NODECLASS], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeBrowseNameAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_QualifiedName *outBrowseName, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, outBrowseName, + &UA_TYPES[UA_TYPES_QUALIFIEDNAME], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeDisplayNameAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *outDisplayName, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, outDisplayName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeDescriptionAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *outDescription, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, outDescription, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeWriteMaskAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_UInt32 *outWriteMask, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, + outWriteMask, &UA_TYPES[UA_TYPES_UINT32], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeUserWriteMaskAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_UInt32 *outUserWriteMask, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_USERWRITEMASK, + outUserWriteMask, &UA_TYPES[UA_TYPES_UINT32], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeIsAbstractAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outIsAbstract, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, + outIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeSymmetricAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outSymmetric, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, + outSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeInverseNameAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_LocalizedText *outInverseName, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, outInverseName, + &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeContainsNoLoopsAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outContainsNoLoops, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS, outContainsNoLoops, + &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeEventNotifierAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *outEventNotifier, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, + outEventNotifier, &UA_TYPES[UA_TYPES_BYTE], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeDataTypeAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_NodeId *outDataType, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_DATATYPE, + outDataType, &UA_TYPES[UA_TYPES_NODEID], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeValueRankAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Int32 *outValueRank, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_VALUERANK, + outValueRank, &UA_TYPES[UA_TYPES_INT32], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeAccessLevelAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *outAccessLevel, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, + outAccessLevel, &UA_TYPES[UA_TYPES_BYTE], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeUserAccessLevelAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Byte *outUserAccessLevel, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_USERACCESSLEVEL, outUserAccessLevel, + &UA_TYPES[UA_TYPES_BYTE], callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeMinimumSamplingIntervalAttribute_async( + UA_Client *client, const UA_NodeId nodeId, + const UA_Double *outMinimumSamplingInterval, UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, + outMinimumSamplingInterval, &UA_TYPES[UA_TYPES_DOUBLE], callback, userdata, + reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeHistorizingAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outHistorizing, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, + outHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeExecutableAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outExecutable, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, + outExecutable, &UA_TYPES[UA_TYPES_BOOLEAN], + callback, userdata, reqId); +} +static UA_INLINE UA_StatusCode +UA_Client_writeUserExecutableAttribute_async(UA_Client *client, const UA_NodeId nodeId, + const UA_Boolean *outUserExecutable, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId) { + return __UA_Client_writeAttribute_async( + client, &nodeId, UA_ATTRIBUTEID_USEREXECUTABLE, outUserExecutable, + &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId); +} + +/** + * Method Calling + * ^^^^^^^^^^^^^^ */ +#ifdef UA_ENABLE_METHODCALLS +UA_StatusCode UA_EXPORT +__UA_Client_call_async(UA_Client *client, const UA_NodeId objectId, + const UA_NodeId methodId, size_t inputSize, + const UA_Variant *input, UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId); + +typedef void (*UA_ClientAsyncCallCallback)(UA_Client *client, void *userdata, + UA_UInt32 requestId, UA_CallResponse *cr); + +static UA_INLINE UA_StatusCode +UA_Client_call_async(UA_Client *client, const UA_NodeId objectId, + const UA_NodeId methodId, size_t inputSize, const UA_Variant *input, + UA_ClientAsyncCallCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_call_async(client, objectId, methodId, inputSize, input, + (UA_ClientAsyncServiceCallback)callback, userdata, + reqId); +} +#endif + +/** + * Node Management + * ^^^^^^^^^^^^^^^ */ +typedef void (*UA_ClientAsyncAddNodesCallback)(UA_Client *client, void *userdata, + UA_UInt32 requestId, + UA_AddNodesResponse *ar); + +UA_StatusCode UA_EXPORT +__UA_Client_addNode_async(UA_Client *client, const UA_NodeClass nodeClass, + const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, const UA_NodeAttributes *attr, + const UA_DataType *attributeType, UA_NodeId *outNewNodeId, + UA_ClientAsyncServiceCallback callback, void *userdata, + UA_UInt32 *reqId); + +static UA_INLINE UA_StatusCode +UA_Client_addVariableNode_async(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_VariableAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_VARIABLE, requestedNewNodeId, parentNodeId, referenceTypeId, + browseName, typeDefinition, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addVariableTypeNode_async( + UA_Client *client, const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_VariableTypeAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_VARIABLETYPE, requestedNewNodeId, parentNodeId, + referenceTypeId, browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addObjectNode_async(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_NodeId typeDefinition, + const UA_ObjectAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_OBJECT, requestedNewNodeId, parentNodeId, referenceTypeId, + browseName, typeDefinition, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addObjectTypeNode_async( + UA_Client *client, const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_ObjectTypeAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_OBJECTTYPE, requestedNewNodeId, parentNodeId, + referenceTypeId, browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addViewNode_async(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_ViewAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_VIEW, requestedNewNodeId, parentNodeId, referenceTypeId, + browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addReferenceTypeNode_async( + UA_Client *client, const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, const UA_QualifiedName browseName, + const UA_ReferenceTypeAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_REFERENCETYPE, requestedNewNodeId, parentNodeId, + referenceTypeId, browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addDataTypeNode_async(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_DataTypeAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_DATATYPE, requestedNewNodeId, parentNodeId, referenceTypeId, + browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +static UA_INLINE UA_StatusCode +UA_Client_addMethodNode_async(UA_Client *client, const UA_NodeId requestedNewNodeId, + const UA_NodeId parentNodeId, + const UA_NodeId referenceTypeId, + const UA_QualifiedName browseName, + const UA_MethodAttributes attr, UA_NodeId *outNewNodeId, + UA_ClientAsyncAddNodesCallback callback, void *userdata, + UA_UInt32 *reqId) { + return __UA_Client_addNode_async( + client, UA_NODECLASS_METHOD, requestedNewNodeId, parentNodeId, referenceTypeId, + browseName, UA_NODEID_NULL, (const UA_NodeAttributes *)&attr, + &UA_TYPES[UA_TYPES_METHODATTRIBUTES], outNewNodeId, + (UA_ClientAsyncServiceCallback)callback, userdata, reqId); +} + +/** + * Misc Functionalities + * ^^^^^^^^^^^^^^^^^^^^ */ + +UA_DEPRECATED UA_StatusCode UA_EXPORT +__UA_Client_translateBrowsePathsToNodeIds_async(UA_Client *client, char *paths[], + UA_UInt32 ids[], size_t pathSize, + UA_ClientAsyncServiceCallback callback, + void *userdata, UA_UInt32 *reqId); + +typedef void (*UA_ClientAsyncTranslateCallback)( + UA_Client *client, void *userdata, UA_UInt32 requestId, + UA_TranslateBrowsePathsToNodeIdsResponse *tr); + +UA_DEPRECATED UA_StatusCode UA_EXPORT +UA_Cient_translateBrowsePathsToNodeIds_async(UA_Client *client, char **paths, + UA_UInt32 *ids, size_t pathSize, + UA_ClientAsyncTranslateCallback callback, + void *userdata, UA_UInt32 *reqId); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/accesscontrol_default.h" ***********************************/ + +/* 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 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + */ + + + +_UA_BEGIN_DECLS + +typedef struct { + UA_String username; + UA_String password; +} UA_UsernamePasswordLogin; + +/* Default access control. The log-in can be anonymous or username-password. A + * logged-in user has all access rights. */ +UA_EXPORT UA_StatusCode +UA_AccessControl_default(UA_ServerConfig *config, UA_Boolean allowAnonymous, + const UA_ByteString *userTokenPolicyUri, + size_t usernamePasswordLoginSize, + const UA_UsernamePasswordLogin *usernamePasswordLogin); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/pki_default.h" ***********************************/ + +/* 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 2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + + +_UA_BEGIN_DECLS + +/* Default implementation that accepts all certificates */ +UA_EXPORT void +UA_CertificateVerification_AcceptAll(UA_CertificateVerification *cv); + +#ifdef UA_ENABLE_ENCRYPTION + +/* Accept certificates based on a trust-list and a revocation-list. Based on + * mbedTLS. */ +UA_EXPORT UA_StatusCode +UA_CertificateVerification_Trustlist(UA_CertificateVerification *cv, + const UA_ByteString *certificateTrustList, + size_t certificateTrustListSize, + const UA_ByteString *certificateIssuerList, + size_t certificateIssuerListSize, + const UA_ByteString *certificateRevocationList, + size_t certificateRevocationListSize); + +#ifdef __linux__ /* Linux only so far */ +UA_EXPORT UA_StatusCode +UA_CertificateVerification_CertFolders(UA_CertificateVerification *cv, + const char *trustListFolder, + const char *issuerListFolder, + const char *revocationListFolder); +#endif + +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/log_stdout.h" ***********************************/ + +/* 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 2016, 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + + +_UA_BEGIN_DECLS + +extern UA_EXPORT const UA_Logger UA_Log_Stdout_; /* Logger structure */ +extern UA_EXPORT const UA_Logger *UA_Log_Stdout; /* Shorthand pointer */ + +/* Don't use these definitions. They are only exported as long as the client + * config is static and required compile-time */ +UA_EXPORT void +UA_Log_Stdout_log(void *_, UA_LogLevel level, UA_LogCategory category, + const char *msg, va_list args); +UA_EXPORT void +UA_Log_Stdout_clear(void *logContext); + +/* By default the client and server is configured with UA_Log_Stdout + This constructs a logger with a configurable max log level */ + +UA_EXPORT UA_Logger UA_Log_Stdout_withLevel(UA_LogLevel minlevel); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/nodestore_default.h" ***********************************/ + +/* 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 2019 (c) Julius Pfrommer, Fraunhofer IOSB + */ + + + +_UA_BEGIN_DECLS + +/* The HashMap Nodestore holds all nodes in RAM in single hash-map. Lookip is + * done based on hashing/comparison of the NodeId with close to O(1) lookup + * time. However, sometimes the underlying array has to be resized when nodes + * are added/removed. This can take O(n) time. */ +UA_EXPORT UA_StatusCode +UA_Nodestore_HashMap(UA_Nodestore *ns); + +/* The ZipTree Nodestore holds all nodes in RAM in a tree structure. The lookup + * time is about O(log n). Adding/removing nodes does not require resizing of + * the underlying array with the linear overhead. + * + * For most usage scenarios the hash-map Nodestore will be faster. + */ +UA_EXPORT UA_StatusCode +UA_Nodestore_ZipTree(UA_Nodestore *ns); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/server_config_default.h" ***********************************/ + +/* 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 + * Copyright 2019 (c) Kalycito Infotech Private Limited + */ + + + +_UA_BEGIN_DECLS + +/* Create a new server with default plugins for logging etc. used during + * initialization. No network layer and SecurityPolicies are set so far. */ +UA_Server UA_EXPORT * UA_Server_new(void); + +/**********************/ +/* Default Connection */ +/**********************/ + +extern const UA_EXPORT +UA_ConnectionConfig UA_ConnectionConfig_default; + +/*************************/ +/* Default Server Config */ +/*************************/ + +/* Creates a new server config with one endpoint and custom buffer size. + * + * The config will set the tcp network layer to the given port and adds a single + * endpoint with the security policy ``SecurityPolicy#None`` to the server. A + * server certificate may be supplied but is optional. + * Additionally you can define a custom buffer size for send and receive buffer. + * + * @param portNumber The port number for the tcp network layer + * @param certificate Optional certificate for the server endpoint. Can be + * ``NULL``. + * @param sendBufferSize The size in bytes for the network send buffer + * @param recvBufferSize The size in bytes for the network receive buffer + * + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, + UA_UInt16 portNumber, + const UA_ByteString *certificate, + UA_UInt32 sendBufferSize, + UA_UInt32 recvBufferSize); + +/* Creates a new server config with one endpoint. + * + * The config will set the tcp network layer to the given port and adds a single + * endpoint with the security policy ``SecurityPolicy#None`` to the server. A + * server certificate may be supplied but is optional. */ +static UA_INLINE UA_StatusCode +UA_ServerConfig_setMinimal(UA_ServerConfig *config, UA_UInt16 portNumber, + const UA_ByteString *certificate) { + return UA_ServerConfig_setMinimalCustomBuffer(config, portNumber, + certificate, 0, 0); +} + +#ifdef UA_ENABLE_ENCRYPTION + +UA_EXPORT UA_StatusCode +UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, + UA_UInt16 portNumber, + const UA_ByteString *certificate, + const UA_ByteString *privateKey, + const UA_ByteString *trustList, + size_t trustListSize, + const UA_ByteString *issuerList, + size_t issuerListSize, + const UA_ByteString *revocationList, + size_t revocationListSize); + +#endif + +/* Creates a server config on the default port 4840 with no server + * certificate. */ +static UA_INLINE UA_StatusCode +UA_ServerConfig_setDefault(UA_ServerConfig *config) { + return UA_ServerConfig_setMinimal(config, 4840, NULL); +} + +/* Creates a new server config with no network layer and no endpoints. + * + * It initializes reasonable defaults for many things, but does not + * add any network layer, security policies and endpoints. + * Use the various UA_ServerConfig_addXxx functions to add them. + * + * @param conf The configuration to manipulate + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_setBasics(UA_ServerConfig *conf); + +/* Adds a TCP network layer with custom buffer sizes + * + * @param conf The configuration to manipulate + * @param portNumber The port number for the tcp network layer + * @param sendBufferSize The size in bytes for the network send buffer. Pass 0 + * to use defaults. + * @param recvBufferSize The size in bytes for the network receive buffer. + * Pass 0 to use defaults. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize); + +#ifdef UA_ENABLE_WEBSOCKET_SERVER +/* Adds a Websocket network layer with custom buffer sizes + * + * @param conf The configuration to manipulate + * @param portNumber The port number for the tcp network layer + * @param sendBufferSize The size in bytes for the network send buffer. Pass 0 + * to use defaults. + * @param recvBufferSize The size in bytes for the network receive buffer. + * Pass 0 to use defaults. + * @param certificate certificate data. Pass NULL to disable WS security + * @param privateKey privateKey data. Pass NULL to disable WS security + */ + +UA_EXPORT UA_StatusCode +UA_ServerConfig_addNetworkLayerWS(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize, const UA_ByteString* certificate, const UA_ByteString* privateKey); +#endif + +/* Adds the security policy ``SecurityPolicy#None`` to the server. A + * server certificate may be supplied but is optional. + * + * @param config The configuration to manipulate + * @param certificate The optional server certificate. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + const UA_ByteString *certificate); + +#ifdef UA_ENABLE_ENCRYPTION + +/* Adds the security policy ``SecurityPolicy#Basic128Rsa15`` to the server. A + * server certificate may be supplied but is optional. + * + * Certificate verification should be configured before calling this + * function. See PKI plugin. + * + * @param config The configuration to manipulate + * @param certificate The server certificate. + * @param privateKey The private key that corresponds to the certificate. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey); + +/* Adds the security policy ``SecurityPolicy#Basic256`` to the server. A + * server certificate may be supplied but is optional. + * + * Certificate verification should be configured before calling this + * function. See PKI plugin. + * + * @param config The configuration to manipulate + * @param certificate The server certificate. + * @param privateKey The private key that corresponds to the certificate. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey); + +/* Adds the security policy ``SecurityPolicy#Basic256Sha256`` to the server. A + * server certificate may be supplied but is optional. + * + * Certificate verification should be configured before calling this + * function. See PKI plugin. + * + * @param config The configuration to manipulate + * @param certificate The server certificate. + * @param privateKey The private key that corresponds to the certificate. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey); + +/* Adds the security policy ``SecurityPolicy#Aes128Sha256RsaOaep`` to the server. A + * server certificate may be supplied but is optional. + * + * Certificate verification should be configured before calling this + * function. See PKI plugin. + * + * @param config The configuration to manipulate + * @param certificate The server certificate. + * @param privateKey The private key that corresponds to the certificate. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addSecurityPolicyAes128Sha256RsaOaep(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey); + +/* Adds all supported security policies and sets up certificate + * validation procedures. + * + * Certificate verification should be configured before calling this + * function. See PKI plugin. + * + * @param config The configuration to manipulate + * @param certificate The server certificate. + * @param privateKey The private key that corresponds to the certificate. + * @param trustList The trustList for client certificate validation. + * @param trustListSize The trustList size. + * @param revocationList The revocationList for client certificate validation. + * @param revocationListSize The revocationList size. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey); + +#endif + +/* Adds an endpoint for the given security policy and mode. The security + * policy has to be added already. See UA_ServerConfig_addXxx functions. + * + * @param config The configuration to manipulate + * @param securityPolicyUri The security policy for which to add the endpoint. + * @param securityMode The security mode for which to add the endpoint. + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, + UA_MessageSecurityMode securityMode); + +/* Adds endpoints for all configured security policies in each mode. + * + * @param config The configuration to manipulate + */ +UA_EXPORT UA_StatusCode +UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/client_config_default.h" ***********************************/ + +/* 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 + */ + + + +_UA_BEGIN_DECLS + +UA_Client UA_EXPORT * UA_Client_new(void); + +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 + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/securitypolicy_default.h" ***********************************/ + +/* 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-2018 (c) Mark Giraud, Fraunhofer IOSB + * Copyright 2017 (c) Stefan Profanter, fortiss GmbH + * Copyright 2018 (c) Daniel Feist, Precitec GmbH & Co. KG + */ + + + +_UA_BEGIN_DECLS + +UA_EXPORT UA_StatusCode +UA_SecurityPolicy_None(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_Logger *logger); + +#ifdef UA_ENABLE_ENCRYPTION + +UA_EXPORT UA_StatusCode +UA_SecurityPolicy_Basic128Rsa15(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger *logger); + +UA_EXPORT UA_StatusCode +UA_SecurityPolicy_Basic256(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger *logger); + +UA_EXPORT UA_StatusCode +UA_SecurityPolicy_Basic256Sha256(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger *logger); + +UA_EXPORT UA_StatusCode +UA_SecurityPolicy_Aes128Sha256RsaOaep(UA_SecurityPolicy *policy, + const UA_ByteString localCertificate, + const UA_ByteString localPrivateKey, + const UA_Logger *logger); + +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/plugins/include/open62541/plugin/log_syslog.h" ***********************************/ + +/* 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 2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + */ + + + +_UA_BEGIN_DECLS + +/* Syslog-logging is available only for Linux/Unices. + * + * open62541 log-levels are translated to syslog-levels as follows: + * + * UA_LOGLEVEL_TRACE => not available for syslog + * UA_LOGLEVEL_DEBUG => LOG_DEBUG + * UA_LOGLEVEL_INFO => LOG_INFO + * UA_LOGLEVEL_WARNING => LOG_WARNING + * UA_LOGLEVEL_ERROR => LOG_ERR + * UA_LOGLEVEL_FATAL => LOG_CRIT + */ + +#if defined(__linux__) || defined(__unix__) + +/* Returns a syslog-logger for messages up to the specified level. + * The programm must call openlog(3) before using this logger. */ +UA_EXPORT UA_Logger +UA_Log_Syslog_withLevel(UA_LogLevel minlevel); + +/* Log all warning levels supported by syslog (no trace-warnings). + * The programm must call openlog(3) before using this logger. */ +UA_EXPORT UA_Logger +UA_Log_Syslog(void); + +#endif + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/network_tcp.h" ***********************************/ + +/* 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 2016 (c) Fraunhofer IOSB (Author: Julius Pfrommer) + * Copyright 2020 (c) HMS Industrial Networks AB (Author: Jonas Green) + */ + + + +_UA_BEGIN_DECLS + +/* Initializes a TCP network layer. + * + * @param config The connection config. + * @param port The TCP port to listen to. + * @param maxConnections Maximum number of TCP connections this network layer + * instance is allowed to allocate. Set to 0 for unlimited + * number of connections. + * @param logger Pointer to a logger + * @return Returns the network layer instance */ +UA_ServerNetworkLayer UA_EXPORT +UA_ServerNetworkLayerTCP(UA_ConnectionConfig config, UA_UInt16 port, + UA_UInt16 maxConnections); + +/* Open a non-blocking client TCP socket. The connection might not be fully + * opened yet. Drop into the _poll function withe a timeout to complete the + * connection. */ +UA_Connection UA_EXPORT +UA_ClientConnectionTCP_init(UA_ConnectionConfig config, const UA_String endpointUrl, + UA_UInt32 timeout, const UA_Logger *logger); + +/* Wait for a half-opened connection to fully open. Returns UA_STATUSCODE_GOOD + * even if the timeout was hit. Returns UA_STATUSCODE_BADDISCONNECT if the + * connection is lost. */ +UA_StatusCode UA_EXPORT +UA_ClientConnectionTCP_poll(UA_Connection *connection, UA_UInt32 timeout, + const UA_Logger *logger); + +_UA_END_DECLS + + +/*********************************** amalgamated original file "/home/rosselliot/sandbox/open62541/include/open62541/architecture_functions.h" ***********************************/ + +/* 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 2018 (c) Jose Cabral, fortiss GmbH + */ + +/* + * This header has all the functions that are architecture dependent. The + * declaration is behind a ifndef since they can be previously defined in the + * ua_architecture.h which include this files at the end + */ + + + +_UA_BEGIN_DECLS + +/* Allocation functions */ +#ifndef UA_malloc +void* UA_malloc(size_t size); //allocate memory in the heap with size bytes +#endif + +#ifndef UA_calloc +void* UA_calloc(size_t num, size_t size); //allocate memory in the heap with size*num bytes and set the memory to zero +#endif + +#ifndef UA_realloc +void* UA_realloc(void *ptr, size_t new_size);//re-allocate memory in the heap with new_size bytes from previously allocated memory ptr +#endif + +#ifndef UA_free +void UA_free(void* ptr); //de-allocate memory previously allocated with UA_malloc, UA_calloc or UA_realloc +#endif + +/* Sleep function */ +#ifndef UA_sleep_ms +int UA_sleep_ms(unsigned int miliSeconds); //suspend the thread for a certain amount of mili seconds +#endif + +/* Socket functions */ +#ifndef UA_send +ssize_t UA_send(UA_SOCKET sockfd, const void *buf, size_t len, int flags); //equivalent to posix send implementation +#endif + +#ifndef UA_sendto +ssize_t sendto(UA_SOCKET sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); //equivalent to posix sendto implementation +#endif + +#ifndef UA_select +int UA_select(UA_SOCKET nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); //equivalent to posix select implementation +#endif + +#ifndef UA_recv +ssize_t UA_recv(UA_SOCKET sockfd, void *buf, size_t len, int flags); //equivalent to posix recv implementation +#endif + +#ifndef UA_recvfrom +ssize_t recvfrom(UA_SOCKET sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); +#endif + +#ifndef UA_shutdown +int UA_shutdown(UA_SOCKET sockfd, int how); //equivalent to posix shutdown implementation +#endif + +#ifndef UA_socket +UA_SOCKET UA_socket(int domain, int type, int protocol);//equivalent to posix socket implementation +#endif + +#ifndef UA_bind +int UA_bind(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);//equivalent to posix bind implementation +#endif + +#ifndef UA_listen +int UA_listen(UA_SOCKET sockfd, int backlog);//equivalent to posix listen implementation +#endif + +#ifndef UA_accept +int UA_accept(UA_SOCKET sockfd, struct sockaddr *addr, socklen_t *addrlen);//equivalent to posix accept implementation +#endif + +#ifndef UA_close +int UA_close(UA_SOCKET sockfd);//equivalent to posix close implementation +#endif + +#ifndef UA_connect +int UA_connect(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);//equivalent to posix connect implementation +#endif + +#ifndef UA_fd_set +void UA_fd_set(UA_SOCKET fd, fd_set *set); //equivalent to posix FD_SET implementation +#endif + +#ifndef UA_fd_isset +int UA_fd_isset(UA_SOCKET fd, fd_set *set);//equivalent to posix FD_ISSET implementation +#endif + +#ifndef UA_getaddrinfo +int UA_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);//equivalent to posix getaddrinfo implementation +#endif + +#ifndef UA_htonl +uint32_t UA_htonl(uint32_t hostlong);//equivalent to posix UA_htonl implementation +#endif + +#ifndef UA_ntohl +uint32_t UA_ntohl(uint32_t netlong);//equivalent to posix ntohl implementation +#endif + +#ifndef UA_inet_pton +int UA_inet_pton(int af, const char *src, void *dst);//equivalent to ANSI inet_pton implementation +#endif + +#if UA_IPV6 +# ifndef UA_if_nametoindex +unsigned int UA_if_nametoindex(const char *ifname);//equivalent to posix if_nametoindex implementation +# endif +#endif + +#ifndef UA_socket_set_blocking +unsigned int UA_socket_set_blocking(UA_SOCKET sockfd);//set a socket as blocking. Returns 0 if OK, other value otherwise +#endif + +#ifndef UA_socket_set_nonblocking +unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd);//set a socket as non-blocking. Returns 0 if OK, other value otherwise +#endif + +#ifndef UA_getsockopt +int UA_getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); //equivalent to posix getsockopt implementation. Only in non windows architectures +#endif + +#ifndef UA_setsockopt +int UA_setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);//equivalent to posix setsockopt implementation +#endif + +#ifndef UA_freeaddrinfo +void UA_freeaddrinfo(struct addrinfo *res);//equivalent to posix freeaddrinfo implementatio +#endif + +#ifndef UA_gethostname +int UA_gethostname(char *name, size_t len);//equivalent to posix gethostname implementation +#endif + +#ifndef UA_getsockname +int UA_getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);//equivalent to posix getsockname implementation +#endif + +#ifndef UA_initialize_architecture_network +void UA_initialize_architecture_network(void);//initializes all needed for using the network interfaces +#endif + +#ifndef UA_deinitialize_architecture_network +void UA_deinitialize_architecture_network(void);//de-initializes the network interfaces +#endif + +/* Print function */ +#ifndef UA_snprintf +int UA_snprintf(char* pa_stream, size_t pa_size, const char* pa_format, ...); //prints text to output +#endif + +#ifndef UA_strncasecmp +int UA_strncasecmp(const char* s1, const char* s2, size_t n); +#endif + +/* Access to file function */ +#ifndef UA_access +int UA_access(const char *pathname, int mode); //equivalent implementation of https://linux.die.net/man/2/access +#endif + +#ifndef UA_fileExists +#define UA_fileExists(X) ( UA_access(X, 0) == 0) +#endif + + +_UA_END_DECLS + +#endif /* OPEN62541_H_ */ diff --git a/test/server/xml/opcuaTestServer.NodeSet2.xml b/test/server/xml/opcuaTestServer.NodeSet2.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb0b2c9ba8707a4c8ec24486be0c4f90651f8813 --- /dev/null +++ b/test/server/xml/opcuaTestServer.NodeSet2.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="utf-8"?> +<UANodeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd" xmlns="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd" xmlns:s1="http://ess.eu/OpcUa/Types.xsd" xmlns:ua="http://unifiedautomation.com/Configuration/NodeSet.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <NamespaceUris> + <Uri>http://ess.eu/OpcUa</Uri> + </NamespaceUris> + <Aliases> + <Alias Alias="Boolean">i=1</Alias> + <Alias Alias="SByte">i=2</Alias> + <Alias Alias="Byte">i=3</Alias> + <Alias Alias="Int16">i=4</Alias> + <Alias Alias="UInt16">i=5</Alias> + <Alias Alias="Int32">i=6</Alias> + <Alias Alias="UInt32">i=7</Alias> + <Alias Alias="Int64">i=8</Alias> + <Alias Alias="UInt64">i=9</Alias> + <Alias Alias="Float">i=10</Alias> + <Alias Alias="Double">i=11</Alias> + <Alias Alias="String">i=12</Alias> + <Alias Alias="Organizes">i=35</Alias> + <Alias Alias="HasTypeDefinition">i=40</Alias> + <Alias Alias="HasComponent">i=47</Alias> + </Aliases> + <Extensions> + <Extension> + <ua:ModelInfo Tool="UaModeler" Hash="SVwTedOTHHXFHws0S2tgsQ==" Version="1.6.5"/> + </Extension> + </Extensions> + <UAObject NodeId="ns=1;s=Sim" BrowseName="1:Simulation"> + <DisplayName>Simulation</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=61</Reference> + <Reference ReferenceType="Organizes" IsForward="false">i=85</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestRamp</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarDouble</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarFloat</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarInt32</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarInt64</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarIUInt16</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarString</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarUInt32</Reference> + <Reference ReferenceType="HasComponent">ns=1;s=Sim.TestVarUInt64</Reference> + </References> + </UAObject> + <UAVariable DataType="Double" NodeId="ns=1;s=Sim.TestRamp" BrowseName="1:TestRamp" AccessLevel="3"> + <DisplayName>TestRamp</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Double>0</uax:Double> + </Value> + </UAVariable> + <UAVariable DataType="Boolean" NodeId="ns=1;s=Sim.TestVarBool" BrowseName="1:TestVarBool" AccessLevel="3"> + <DisplayName>TestVarBool</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Boolean>true</uax:Boolean> + </Value> + </UAVariable> + <UAVariable DataType="Byte" NodeId="ns=1;s=Sim.TestVarByte" BrowseName="1:TestVarByte" AccessLevel="3"> + <DisplayName>TestVarByte</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Byte>255</uax:Byte> + </Value> + </UAVariable> + <UAVariable DataType="Int16" NodeId="ns=1;s=Sim.TestVarInt16" BrowseName="1:TestVarInt16" AccessLevel="3"> + <DisplayName>TestVarInt16</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Int16>-32768</uax:Int16> + </Value> + </UAVariable> + <UAVariable DataType="UInt16" NodeId="ns=1;s=Sim.TestVarUInt16" BrowseName="1:TestVarUInt16" AccessLevel="3"> + <DisplayName>TestVarUInt16</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:UInt16>65535</uax:UInt16> + </Value> + </UAVariable> + <UAVariable DataType="SByte" NodeId="ns=1;s=Sim.TestVarSByte" BrowseName="1:TestVarSByte" AccessLevel="3"> + <DisplayName>TestVarSByte</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:SByte>-128</uax:SByte> + </Value> + </UAVariable> + <UAVariable DataType="Double" NodeId="ns=1;s=Sim.TestVarDouble" BrowseName="1:TestVarDouble" AccessLevel="3"> + <DisplayName>TestVarDouble</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Double>0.002</uax:Double> + </Value> + </UAVariable> + <UAVariable DataType="Float" NodeId="ns=1;s=Sim.TestVarFloat" BrowseName="1:TestVarFloat" AccessLevel="3"> + <DisplayName>TestVarFloat</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Float>-0.0625</uax:Float> + </Value> + </UAVariable> + <UAVariable DataType="Int32" NodeId="ns=1;s=Sim.TestVarInt32" BrowseName="1:TestVarInt32" AccessLevel="3"> + <DisplayName>TestVarInt32</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Int32>-2147483648</uax:Int32> + </Value> + </UAVariable> + <UAVariable DataType="Int64" NodeId="ns=1;s=Sim.TestVarInt64" BrowseName="1:TestVarInt64" AccessLevel="3"> + <DisplayName>TestVarInt64</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:Int64>-1294967296</uax:Int64> + </Value> + </UAVariable> + <UAVariable DataType="String" NodeId="ns=1;s=Sim.TestVarString" BrowseName="1:TestVarString" AccessLevel="3"> + <DisplayName>TestVarString</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:String>TestString01</uax:String> + </Value> + </UAVariable> + <UAVariable DataType="UInt32" NodeId="ns=1;s=Sim.TestVarUInt32" BrowseName="1:TestVarUInt32" AccessLevel="3"> + <DisplayName>TestVarUInt32</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:UInt32>4294967295</uax:UInt32> + </Value> + </UAVariable> + <UAVariable DataType="UInt64" NodeId="ns=1;s=Sim.TestVarUInt64" BrowseName="1:TestVarUInt64" AccessLevel="3"> + <DisplayName>TestVarUInt64</DisplayName> + <References> + <Reference ReferenceType="HasTypeDefinition">i=63</Reference> + <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=Sim</Reference> + </References> + <Value> + <uax:UInt64>18446744073709551615</uax:UInt64> + </Value> + </UAVariable> +</UANodeSet>