aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-18 17:21:36 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-18 17:21:36 +0100
commit02e518fd27b43d0d452a264304de7b3d38a58ef6 (patch)
tree6083c3d5bc6e78edfe33933d18ad09fb5f8dfca5 /src/common.h
parent80aa098905cd7925cf6b665bba9d69621c44cc04 (diff)
downloadBobinkCOpcUa-02e518fd27b43d0d452a264304de7b3d38a58ef6.tar.gz
BobinkCOpcUa-02e518fd27b43d0d452a264304de7b3d38a58ef6.zip
Make discovery-only None endpoint a createServer option
Add a discoveryOnly parameter to createServer(). All secure servers still get the None security policy (needed for the client's initial GetEndpoints handshake) and securityPolicyNoneDiscoveryOnly, but only the LDS registers a None endpoint so purely unencrypted clients can discover it. ServerRegister no longer advertises a None endpoint.
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/common.h b/src/common.h
index 6d5294a..8c3c9d6 100644
--- a/src/common.h
+++ b/src/common.h
@@ -52,11 +52,12 @@ void freeTrustStore (char **paths, size_t size);
* @brief Creates a UA_Server, optionally configured with security policies.
*
* When @p certPath is non-NULL the server is initialized with encryption
- * (certificate, private key, trustlist) and also adds SecurityPolicy#None
- * restricted to discovery services (FindServers, GetEndpoints) so that
- * unencrypted clients can still discover the server. When @p certPath is
- * NULL the server runs with SecurityPolicy#None only (keyPath and trustPaths
- * are ignored). The applicationUri is set in both cases.
+ * (certificate, private key, trustlist). When @p discoveryOnly is true
+ * the server additionally offers SecurityPolicy#None restricted to
+ * discovery services (FindServers, GetEndpoints) so that unencrypted
+ * clients can still discover the server. When @p certPath is NULL the
+ * server runs with SecurityPolicy#None only (keyPath, trustPaths and
+ * discoveryOnly are ignored). The applicationUri is set in both cases.
*
* @param port Server port number.
* @param applicationUri OPC UA application URI.
@@ -64,13 +65,15 @@ void freeTrustStore (char **paths, size_t size);
* @param keyPath Path to private key (.der), or NULL when certPath is NULL.
* @param trustPaths Array of trustlist file paths (may be NULL).
* @param trustSize Number of entries in trustPaths.
+ * @param discoveryOnly When true and certPath is non-NULL, add a None
+ * endpoint restricted to discovery services.
* @param retval Output parameter set to the status code on failure.
* @return A configured UA_Server, or NULL on error.
*/
UA_Server *createServer (UA_UInt16 port, const char *applicationUri,
const char *certPath, const char *keyPath,
char **trustPaths, size_t trustSize,
- UA_StatusCode *retval);
+ UA_Boolean discoveryOnly, UA_StatusCode *retval);
/**
* @brief Parses a log-level name into the corresponding UA_LogLevel value.