Commit Graph

62 Commits

Author SHA1 Message Date
Vasilij Strassheim a8930fd50a refactor(server): Clean up mDNS module
Separate mDNS related code from discovery module to enable easier integration
of different mDNS implementations. Add new API functions and make other functions
static to reflect their use in the mDNS module only.
The libmdnsd implementation uses an ip entry for the server and selects the
interface to be used for establishing the connection. This is not required for
avahi as the avahi daemon is normally configured externally. Make the server
configuration of the mDNS IP list and the interface dependent on the use of
libmdnsd.

Signed-off-by: Vasilij Strassheim <vasilij.strassheim@linutronix.de>
2025-01-01 11:57:50 +01:00
Julius Pfrommer 1f8e9f04fa Merge remote-tracking branch 'origin/1.4' into merge_14_master_18 2024-07-27 11:07:53 +02:00
Julius Pfrommer 705801a55c refactor(examples): Use the NS0ID shorthand in the examples 2024-07-26 08:30:16 +02:00
Florian La Roche 253fc8abd5 refactor(examples): do not set an invalid IP in server_multicast.c
Currently an IP 42.42.42.42 is set and the comment suggests that
the network stack resets this to 0.0.0.0 in server_multicast.c.
Just set 0.0.0.0 directly.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2024-07-24 12:19:08 +02:00
Florian La Roche 711b032384 refactor(examples,tests): avoid spaces for mDNS records
Avoid spaces in mdnsServerName as this is used for mDNS records.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2024-07-09 11:23:00 +02:00
Florian La Roche 94ce469a89 refactor(examples): server_multicast.c: remove "NA" from server capabilities
server_multicast.c: remove "NA" from server capabilities and
only keep "LDS" as server capability.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2024-07-06 11:44:52 +02:00
Julius Pfrommer 0c13cc61c2 refactor(server): Instantiate an internal client to register at a DiscoveryServer 2023-10-25 14:07:35 +02:00
Julius Pfrommer 928931ec36 refactor(core): Move architecture-specific definition out of the public headers 2023-07-28 21:42:56 +02:00
basyskom-dege 0f055942b7 feat(CI): Added support for arguments in the examples workflow (#5760)
* CI: Added support for arguments in the examples workflow

* Fixed memory leaks in examples. Add ApplicationUri

* Arguments and server/client for all examples. Small fixes

* outsource/blacklist some examples. Fix memory leak in example.

* Remove Shlex. Remove false UA_Client_delete

* Removed raw examples from ci. Fix leak in client.c and mqtt_publish

* Fix memory leak in mqtt subscriber
2023-07-02 02:58:40 +02:00
Julius Pfrommer bd588da43a fix(examples): Correctly shut down server before delete in discovery/server_multicast.c 2023-03-26 19:05:36 +02:00
Julius Pfrommer 4d5ceb378c Merge remote-tracking branch 'origin/1.3' into merge_13_master_12 2023-03-26 10:21:49 +02:00
Julius Pfrommer 3dc93eaa90 refactor(examples): Return EXIT_SUCCESS for the valgrind run 2023-02-20 02:11:56 +01:00
Muddasir shakil d94f2b5fb9 fix(example): Correctly set port in register and multicast examples (#5341)
Until 1.2 it was possible to set Port address dynamically but in version 1.3
it is not possible. Setting it to 0 will resolve to 4840, which will conflict
with port assinged by default to LDS server in the example. Also the comment is
misleading in the example. Therefore the comment is deleted and a fixed port
4841 is assinged to register and multicast server examples.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>
2022-09-19 15:43:20 +02:00
Mark Giraud 3e5bb3a9a5 refactor: Use correct format specifiers 2021-07-01 16:41:00 +02:00
Julius Pfrommer 9bf44bfb4d fix(examples): Make server_multicast.c clang-analyzer clean 2021-02-28 07:05:05 +01:00
Julius Pfrommer d02dbfd9d6 fix(examples): Remove warnings in newer cppcheck versions 2021-01-04 11:20:23 +01:00
Martin Lang b26c8d1998 fix(core): Remove double ";" at end of line (#3938) 2020-10-06 10:47:07 +02:00
ar8384 d7b673ed81 Fix (discovery example): server_register.c
Fix to: Could not remove mDNS record #3789
2020-07-27 09:36:43 +02:00
Julius Pfrommer e02f267f1c refactor(server): Clean up the mDNS discovery config 2020-07-03 23:26:23 +02:00
Sten Grüner 1de8b24ac0 First attempt of mDNS interface selection (#2856)
fixes #2774
2019-07-02 17:16:02 +02:00
Stefan Profanter 6fe8453249 Untabify
Used command:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`
2019-05-25 09:09:46 +02:00
Stefan Profanter d419a00a6b Stack: Add additional config flag to enable mDNS and fix UaExpert not showing LDS Server 2019-05-06 18:05:09 +02:00
Stefan Profanter f2a151bc01 Stack: Refactor server config to separated discovery and mDNS settings 2019-05-06 18:05:09 +02:00
Stefan Profanter 4a9bcf38c0 Stack: Add support for dynamic port assigning
Fixes #2416
2019-05-06 09:33:15 +02:00
Julius Pfrommer fd08d012d9 Server: Initialize the config in the server 2019-04-23 00:41:32 +02:00
Stefan Profanter 63f3653ff1 Additional header cleanup and consistent name of ns generated files 2019-03-21 20:16:31 +01:00
Julius Pfrommer c9c818868f Move header files to a more unix-like structure
This commit drops the 'ua_' prefix and changes the public includes
to the form `#include <open62541/server.h>` instead of the old
`#include <ua_server.h>`
2019-03-21 20:16:31 +01:00
Stefan Profanter f295562a11 Untabify
Used command:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`
2019-03-14 16:44:34 +01:00
Frank Meerkoetter 1648fb8aaa Use EXIT_SUCCESS/FAILURE for the examples
Make use of EXIT_SUCCESS and EXIT_FAILURE from stdlib.h.
The previous approach of returning a value from UA_StatusCode
was often broken as an exit code can (portably) only be between 0 and 125.
2019-02-09 09:34:46 +01:00
Frank Meerkoetter 9b9ecfee5d Resolve port conflict
Registering server complains that the port 4840 is already in use (as the LDS is
running there).

./discovery_server_register
[...]
[2019-02-04 22:45:20.070 (UTC+0100)] info/userland      Node read the.answer
[2019-02-04 22:45:20.070 (UTC+0100)] info/userland      read value 42
[2019-02-04 22:45:20.070 (UTC+0100)] warn/network       Error binding a server socket: Address already in use
[2019-02-04 22:45:20.070 (UTC+0100)] warn/network       Error binding a server socket: Address already in use
[2019-02-04 22:45:20.070 (UTC+0100)] info/network       TCP network layer listening on opc.tcp://prokyon:4840/
2019-02-06 11:58:17 +01:00
Frank Meerkoetter ba2616e0f1 Spelling and whitespace fixes 2019-02-05 07:58:15 +01:00
Julius Pfrommer bcaa6695c0 Client: Store SecurityPolicies in the client config; Refactor connection logic 2019-01-30 18:45:42 +01:00
Julius Pfrommer b4c9fc37eb Client: Initialize client config inside the client structure
Temporarily disable encyrption
2019-01-30 18:45:42 +01:00
Stefan Profanter d715db1057 Stack: Use non-amalgamated headers in all the examples
For consistency we recommend using non-amalgamation install, thus the
examples should also use the non-amalgamated headers.
2018-12-17 22:40:07 +01:00
Stefan Profanter 0c62edab47 Avoid MinGW warning unknown conversion type character 'z' in format 2018-12-17 22:35:55 +01:00
Julius Pfrommer eb9409b435 Examples: Use _clear instead of _deleteMembers for the examples 2018-12-09 19:40:02 +01:00
Julius Pfrommer 89f728aee1 Logging: Make logging a proper plugin with state and cleanup method 2018-12-04 18:39:12 +01:00
Jose Cabral 1605455a74 Fixes #1925 and clean examples 2018-07-25 08:17:51 +02:00
Stefan Profanter 473c0e960b Use hostname resolving to correctly handle mDNS SRV target announces 2018-07-16 11:59:22 +02:00
Stefan Profanter b6b58a8ea2 Use correct format specifier 2018-07-11 14:21:30 +02:00
StalderT 047c5e4098 WIP client : timed async service & async highlevel functions with client worker for 0.4 (#1598)
This commit adds asynchronous services to open62541 on client side

* Asynchronous service (highlevel read/write) are available through the API that is defined in
ua_client_highlevel_async.h

* Besides the services, the connection procedure is asynchronous as well.

* A client Application that uses the asynchronous API 
adds requests by calling an asynchronous service (e.g., UA_Client_sendAsyncReadRequest(), UA_Client_sendAsyncBrowseRequest() )
checks for response with UA_Client_run_iterate() repeatedly
and processes the responses with user-defined callbacks
2018-05-15 10:54:15 +02:00
StalderT da64add5c0 client basic 256sha256 / server sample / tests / various fixes (#1691)
* client basic 256sha256 / tests / various fixes

* fix server basic256sha256

* remove duplicated loadFile

* Fix fuzzing by making backup of message buffer

* Disable sonarcloud on PRs
2018-03-29 19:15:20 +02:00
Stefan Profanter dd9696dede Support OPC Foundation LDS server
Since client encryption landed into master, this was an open todo for
a long time. The multicast server example was updated to use the encryption
client.

Fixes #938
2018-03-28 23:41:09 +02:00
StalderT 7e30f66b0b fix if/while/for/switch typo 2018-01-22 22:00:55 +01:00
Stefan Profanter 2c62703613 Fix #1360 socket error messages and mDNS socket on windows 2017-11-19 10:44:57 +01:00
Julius Pfrommer e2fbdeab5c fix a gcc-7 warning 2017-09-11 19:51:04 +02:00
Stefan Profanter 61f5018854 Merge remote-tracking branch 'upstream/master' into hotfix/localeid
# Conflicts:
#	examples/client.c
#	examples/discovery/server_multicast.c
#	examples/discovery/server_register.c
#	examples/server.c
#	examples/server_inheritance.c
#	examples/tutorial_server_datasource.c
#	examples/tutorial_server_variabletype.c
2017-09-07 10:28:44 +02:00
Julius Pfrommer 215b077f57 use _default attributes in all examples 2017-09-06 01:08:05 +02:00
Jonas Green 7a58e6c0a5 Corrected format of LocaleId in LocalizedText attributes
The LocaleIds was formatted with an underscore as separator between
the language and region. According to the OPC UA specification the
language and the region shall be separated by a hyphen.
Also removed LocaleId in those cases where a specific language is not
addressed, i.e. when presenting a type name.
2017-08-29 10:08:15 +02:00
Julius Pfrommer 394df3be8d finish nodeContext pointer for every node 2017-08-18 15:00:00 +02:00