574 Commits

Author SHA1 Message Date
Julius Pfrommer 6f003c5fee fix(arch): match lwIP socket callback signatures 2026-10-12 17:08:39 +02:00
Julius Pfrommer 120f74136e fix(arch): match lwIP lifecycle callback signatures 2026-10-12 17:08:39 +02:00
Julius Pfrommer 9bb9b345df fix(arch): give the default lwIP TAP interface process lifetime 2026-10-12 17:08:39 +02:00
Julius Pfrommer 6901aedc07 Merge remote-tracking branch 'origin/1.5' into merge_15_master
Port keyless certificate validation into the GDS receiver driver instead
of restoring the removed server implementation. Preserve master's timer
batching, PubSub lifecycle and client HTTP configuration handling.

Adapt Publish cancellation to response tokens and the HEL/fuzz harnesses
to the explicit TCP driver. Keep SKS policy history and custom datatype
ownership intact, including failed replacement configuration cleanup.
Retain TPM error cleanup while enforcing key-handle and nonce lengths.

Validation:
- Full mbedTLS unit-test build with full namespace, GDS, SKS and Query.
- 21 affected suites passed with ASan/UBSan, plus 9 isolated SKS ownership
  and lifecycle checks.
- OpenSSL certificate update, GDS information model and client encryption
  suites passed with sanitizers.
- OPN, MSG and binary-message fuzzers each completed 100 sanitizer runs.
- Both TPM PubSub policy sources passed compilation checks.

The full SKS client suite timed out after multicast UDP sends reported
"No route to host" on this machine; its affected ownership and lifecycle
cases passed separately. No live TPM hardware validation was performed.
2026-10-04 16:49:17 +02:00
Andreas Ebner 918f2cfd4b fix(docs): typos in comments, docs and messages
Fix misspellings found with codespell across headers, sources, examples,
tests and the documentation, including "propably" in the nodeset
compiler docs. Identifiers, companion spec names and generated code are
left untouched.
2026-09-28 16:20:44 +02:00
StalderT 68352ed713 fix(arch): keep the timer batching state per call (#8491)
batchTimerEntry passed the search window and the batching candidate to the ZIP tree iteration through three file-static variables. The comment above them claims they are only used behind the mutex, but that mutex belongs to a single UA_Timer while the variables belong to the process, and with UA_MULTITHREADING below 100 the lock macros expand to nothing at all. Two timers driven from two threads therefore overwrite each other's state, which is exactly the arrangement the library recommends: one UA_Server and one UA_Client in the same process, each iterated from its own thread, with no instance ever shared.

The effect is silent in a release build. A cyclic callback picks up the nextTime computed for an unrelated timer and fires up to one second early or late, since the batching window is capped at UA_DATETIME_SEC. In a debug build the assertion in findTimer2Batch trips first, because the window it checks against no longer belongs to the entry being iterated.

The window and the candidate now live in a context on the stack of batchTimerEntry. The window doubles as the ZIP_ITER_KEY key, which is how cmpBatchWindow receives both bounds without static state.

No regression test: the overwrite only appears when two batchTimerEntry
calls interleave across threads, and the valgrind stage serialises them.
A threaded probe caught it 10 times out of 10 natively and 0 out of 3
under valgrind, at 240 to 400 seconds a run.
2026-09-25 14:16:44 +02:00
Julius Pfrommer e01e2310af Merge remote-tracking branch 'origin/1.4' into merge_14_15 2026-09-24 12:31:21 +02:00
Julius Pfrommer 98e092c004 fix(arch): preserve simultaneous socket readiness
Forward read and write readiness together in the POSIX and GLib backends.
Prioritizing input can starve MQTT/TLS progress while both directions are
ready. Let the TCP callback recognize combined events as well.

Pass combined readiness and socket errors to libwebsockets in one service
call, so the library can also finish closing failed TLS connections.

Add a socket-pair regression for simultaneous readiness and allow the MQTT
test peer to queue TLS records between event-loop iterations.
2026-09-21 16:23:09 +02:00
Julius Pfrommer 56fd60d55e fix(arch): compute timezone offsets without mktime
Compare local and UTC representations of the same instant instead of interpreting UTC as local time through mktime. This avoids timezone-cache churn reported by TSan during concurrent logging and handles fractional offsets and date rollover.

Add coverage for positive, negative and fractional-hour timezone offsets.
2026-09-21 16:23:09 +02:00
Julius Pfrommer 400145255d fix(arch): keep timer batching state local to each search
Timer instances have separate mutexes, so global batching-window variables race when independent event loops add or reschedule timers concurrently.

Walk the time tree with stack-local window bounds and preserve interval matching. Cover concurrent independent timers and the batching window boundary.
2026-09-21 16:23:09 +02:00
Julius Pfrommer 39731b8c1c fix(arch): load concurrent delayed-queue links atomically
Async completion can append delayed callbacks from another thread. Use atomic loads for queue-head
and next-link reads to match the atomic writes.
2026-09-21 16:23:09 +02:00
Julius Pfrommer 9a43b33a4b Merge remote-tracking branch 'origin/1.5' into merge_15_master
# Conflicts:
#	plugins/crypto/mbedtls/create_certificate.c
#	plugins/crypto/mbedtls/securitypolicy_aes256sha256rsapss.c
#	plugins/crypto/mbedtls/securitypolicy_common.c
#	src/client/ua_client.c
#	src/pubsub/ua_pubsub_config.c
#	src/pubsub/ua_pubsub_keystorage.c
#	src/pubsub/ua_pubsub_keystorage.h
#	src/pubsub/ua_pubsub_ns0.c
#	src/pubsub/ua_pubsub_ns0_sks.c
#	src/pubsub/ua_pubsub_securitygroup.c
#	src/pubsub/ua_pubsub_writer.c
#	src/pubsub/ua_pubsub_writergroup.c
#	src/server/ua_server_ns0.c
#	src/server/ua_server_ns0_gds.c
#	src/server/ua_server_utils.c
#	src/server/ua_services_session.c
#	src/server/ua_subscription_alarms_conditions.c
#	src/ua_types_encoding_xml.c
#	tests/check_types_builtin_xml.c
#	tests/encryption/check_cert_generation.c
#	tests/pubsub/check_pubsub_configuration.c
#	tests/pubsub/check_pubsub_informationmodel_methods.c
#	tests/pubsub/check_pubsub_publish.c
#	tests/pubsub/check_pubsub_sks_client.c
#	tests/pubsub/check_pubsub_sks_keystorage.c
#	tests/pubsub/check_pubsub_sks_push.c
#	tests/pubsub/check_pubsub_sks_securitygroups.c
#	tests/server/check_server_alarmsconditions.c
2026-09-20 10:02:09 +02:00
Julius Pfrommer bb94bfa58f fix(network): bound lwIP UDP interface-name stack use
Reject multicast interface values that do not fit UA_MAXHOSTNAME_LENGTH and replace the request-sized stack allocation with a fixed-size array.
2026-09-18 07:41:09 +02:00
Julius Pfrommer 66447fcb30 fix(network): bound UDP interface-name stack use
Reject multicast interface values that do not fit UA_MAXHOSTNAME_LENGTH and replace the request-sized stack allocation with a fixed-size array.
2026-09-17 22:50:36 +02:00
StalderT 1a67cf7ab0 fix(arch,plugins): remove the non-threadsafe gmtime and inet_ntoa calls
gmtime and inet_ntoa return a pointer to a static buffer shared by all threads. The mbedTLS certificate creation now derives its validity dates from UA_DateTime_now/UA_DateTime_toStruct, which also keeps the expiry date in UTC (mktime interpreted the gmtime result as local time). Zephyr uses gmtime_r and lwIP ip4addr_ntoa_r.

Fixes #7997
2026-09-13 17:54:16 +02:00
Julius Pfrommer 58ed00f074 Merge origin/1.5 into master
Preserve master XML and node-management behavior, adapt regression tests to the driver and built-in NodeSet loader APIs, and extend compatibility with older Check releases.
2026-09-06 22:55:12 +02:00
Julius Pfrommer ee9a098f16 Fix/lwip netif lookup 1.5 (#8377)
Co-authored-by: Thomas Mair <thomas.mair@at.abb.com>
2026-09-06 21:42:26 +02:00
Julius Pfrommer d3e968d143 feat(nodeset-loader): move loader into core utility 2026-09-05 19:31:54 +02:00
Julius Pfrommer a476806541 Merge remote-tracking branch 'origin/1.5' into merge_15_master
# Conflicts:
#	.github/workflows/build_linux.yml
#	CHANGES.md
#	arch/common/eventloop_mqtt.c
#	examples/encryption/server_encryption_filestore.c
#	plugins/crypto/ua_certificategroup_filestore.c
#	src/pubsub/ua_pubsub_networkmessage_json.c
#	src/server/ua_discovery.h
#	src/server/ua_discovery_mdns.c
#	src/server/ua_discovery_mdns_avahi.c
#	src/server/ua_services_attribute.c
#	src/server/ua_services_discovery.c
#	src/server/ua_services_monitoreditem.c
#	src/server/ua_services_nodemanagement.c
#	src/server/ua_subscription.c
#	src/server/ua_subscription.h
#	src/server/ua_subscription_alarms_conditions.c
#	src/server/ua_subscription_event.c
#	src/ua_types_encoding_json_105.c
#	tests/client/check_activateSessionAsync.c
#	tests/server/check_local_monitored_item.c
#	tests/server/check_services_subscriptions.c
2026-09-03 14:33:21 +02:00
Julius Pfrommer 16cf337dae fix(pubsub): harden transport and message encoding 2026-09-03 12:50:25 +02:00
Andreas Ebner a8292e704c fix(pubsub): Fix EtherType slot, VLAN ID 3, MQTT keepalive, calloc checks, frame limit, UDP port init 2026-09-03 12:50:25 +02:00
Andreas Ebner ab9d13257b fix(pubsub): Fix Eth send freeing interior pointer to heap 2026-09-03 12:50:25 +02:00
Andreas Ebner 538eeccb09 fix(pubsub): Fix MQTT broker-connection reuse comparing params to itself 2026-09-03 12:50:25 +02:00
Julius Pfrommer 721cb245d1 fix(arch): use per-entry address lengths in new backends 2026-09-02 16:09:21 +02:00
Julius Pfrommer c2423a2897 Merge remote-tracking branch 'origin/1.4' into merge_14_15
# Conflicts:
#	CMakeLists.txt
#	examples/nodeset/server_nodeset_powerlink.c
#	src/server/ua_services_discovery.c
#	src/ua_securechannel_crypto.c
#	src/ua_types.c
#	src/ua_types_encoding_binary.c
#	tests/check_securechannel.c
2026-09-02 16:08:44 +02:00
Julius Pfrommer e8d9bfd558 fix(core): use per-entry lengths for TCP/UDP address arrays 2026-08-29 12:44:43 +02:00
Georg Graßnick 1c6c71abee fix(arch): fix monotonic clock unit on zephyr
k_uptime_get() returns milliseconds, but UA_DateTime is measured in
100ns intervals, so the monotonic clock ran 10000x slow.
Derive the value from k_uptime_ticks() converted to nanoseconds instead.
See
https://docs.zephyrproject.org/latest/kernel/services/timing/clocks.html
2026-08-28 19:09:52 +02:00
Julius Pfrommer 25bd81a1e7 refactor(server): fold binary protocol into TCP transport 2026-08-17 22:17:22 +02:00
Julius Pfrommer c698eaf2eb refactor: add missing o6 Automation copyright headers 2026-08-17 22:17:22 +02:00
Julius Pfrommer 112cc8fdfd feat(arch): extend and harden HTTP connection manager 2026-08-17 15:19:52 +02:00
Julius Pfrommer cd69204f38 fix(arch): harden libwebsockets adapter compatibility 2026-08-17 15:19:52 +02:00
Julius Pfrommer 236f79b489 feat(eventloop): implement Win32 IOCP backend 2026-08-10 19:31:57 +02:00
Julius Pfrommer 2bdaccaef5 refactor(posix): remove Win32 event loop compatibility 2026-08-10 19:31:57 +02:00
Julius Pfrommer 25d231f796 refactor(arch): fork Win32 event loop before IOCP conversion 2026-08-10 19:31:57 +02:00
Daniil Mordanov 2c9beadfcd fix(posix): remove non-portable stdio_lim include 2026-08-09 22:40:08 +02:00
Julius Pfrommer 7ecdeaf633 test(interop): Add experimental WebSocket coverage 2026-08-04 07:28:29 +02:00
Julius Pfrommer 12c5e0fa50 feat(client): Support OPC UA Binary over WebSockets 2026-08-04 07:28:29 +02:00
Julius Pfrommer 5a0ddc7180 feat(server): Implement Websockets server driver 2026-08-04 07:28:29 +02:00
Julius Pfrommer e0d37a1f51 feat(arch): The websockets ConnectionManager can be constrained for binary-only and specific protocol tags 2026-08-04 07:28:29 +02:00
Julius Pfrommer efd04e8ff5 refactor(arch): Use native TLS verification for MQTT 2026-08-04 07:28:29 +02:00
Julian Weiß 3cd815eba0 feat(eventloop): add a native GLib InterruptManager
Registers each interrupt as a GLib GSource (g_unix_signal_source_new)
attached to the owning EventLoop's GMainContext, so GLib itself handles
signal delivery instead of the POSIX InterruptManager's sigaction +
self-pipe. Documents two GLib-inherent semantics this implies: async
delivery via GLib's worker thread, and no fan-out of one signal to
multiple independent watchers of the same signum.

Claude-Session: https://claude.ai/code/session_0184Hjzh21f51SYHg2bdbhz4
2026-08-03 20:22:20 +02:00
Julian Weiß 89850bdda2 feat(eventloop): add a GLib-backed EventLoop implementation
Adds UA_EventLoop_new_GLib, an alternative to UA_EventLoop_new_POSIX that
attaches a GSource to a GMainContext instead of calling select()/epoll_wait()
directly. Once started, the EventLoop's sockets and timers are serviced
whenever the attached GMainContext is iterated (e.g. g_main_loop_run(),
gtk_main(), g_application_run()), so a GLib-based application can drive the
whole open62541 stack without ever calling the EventLoop's own run() method.

To share the existing TCP/UDP/Ethernet/Interrupt ConnectionManagers between
both backends without duplicating their logic, UA_EventLoopPOSIX now
dispatches FD registration through per-instance registerFD/modifyFD/
deregisterFD function pointers instead of hardcoded select/epoll functions.
The timer, delayed-callback queue, EventSource lifecycle and DateTime
handling are also factored out for reuse by the GLib backend.

Enable via the new UA_ENABLE_EVENTLOOP_GLIB CMake option (requires
glib-2.0). check_eventloop_tcp_glib.c exercises the same TCP scenarios as
check_eventloop_tcp.c against the GLib backend.

Claude-Session: https://claude.ai/code/session_01FLwAbeM7su3EabJw4q51ap
2026-08-03 20:22:20 +02:00
Jannis Völker 517522ad8a fix(build): The file bits/stdio_lim.h doesn't exist on Harmony OS 2026-07-31 20:48:49 +02:00
Julius Pfrommer e4d98cf474 refactor(arch): Remove method-pointer casting from the ETH ConnectionManager 2026-07-28 21:14:43 +02:00
Julius Pfrommer 49142bc7e3 refactor(arch): Remove method-pointer casts from the MQTT ConnectionManager 2026-07-28 21:14:43 +02:00
Julius Pfrommer 006ad81972 refactor(arch): Remove method-pointer casting in the POSIX eventloop 2026-07-28 21:14:43 +02:00
Julius Pfrommer 41942b9a1b feat(arch): Add CertificateGroup to connection manager (for websockets and MQTT) 2026-07-23 15:01:50 +02:00
Julius Pfrommer a8c7b237e4 feat(arch): Implement websockets connectionmanager based on libwebsockets 2026-07-23 15:01:50 +02:00
Julius Pfrommer aed5c7731d feat(arch): Add libwebsockets-based MQTT subscriber ConnectionManager 2026-07-23 15:01:50 +02:00
Julius Pfrommer 05f1f5f323 refactor(arch): Remove casting warning in eventloop_posix.c 2026-07-22 10:24:38 +02:00