123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- /* 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) Henrik Norrman
- */
- #ifndef UA_SERVER_CONFIG_H_
- #define UA_SERVER_CONFIG_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "ua_server.h"
- #include "ua_plugin_log.h"
- #include "ua_plugin_network.h"
- #include "ua_plugin_access_control.h"
- #include "ua_plugin_pki.h"
- #include "ua_plugin_securitypolicy.h"
- #include "ua_plugin_nodestore.h"
- /**
- * .. _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. */
- typedef struct {
- UA_UInt32 min;
- UA_UInt32 max;
- } UA_UInt32Range;
- typedef struct {
- UA_Duration min;
- UA_Duration max;
- } UA_DurationRange;
- struct UA_ServerConfig {
- UA_UInt16 nThreads; /* only if multithreading is enabled */
- UA_Logger logger;
- /* Server Description */
- UA_BuildInfo buildInfo;
- UA_ApplicationDescription applicationDescription;
- UA_ByteString serverCertificate;
- /* MDNS Discovery */
- #ifdef UA_ENABLE_DISCOVERY
- UA_String mdnsServerName;
- size_t serverCapabilitiesSize;
- UA_String *serverCapabilities;
- #endif
- /* Custom DataTypes */
- size_t customDataTypesSize;
- UA_DataType *customDataTypes;
- /**
- * .. note:: See the section on :ref:`generic-types`. Examples for working
- * with custom data types are provided in
- * ``/examples/custom_datatype/``. */
- /* Nodestore */
- UA_Nodestore nodestore;
- /* Networking */
- size_t networkLayersSize;
- UA_ServerNetworkLayer *networkLayers;
- UA_String customHostname;
- /* Available endpoints */
- size_t endpointsSize;
- UA_Endpoint *endpoints;
- /* 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>`. */
- /* 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;
- /* Limits for Subscriptions */
- UA_UInt32 maxSubscriptionsPerSession;
- UA_DurationRange publishingIntervalLimits;
- UA_UInt32Range lifeTimeCountLimits;
- UA_UInt32Range keepAliveCountLimits;
- UA_UInt32 maxNotificationsPerPublish;
- UA_UInt32 maxRetransmissionQueueSize; /* 0 -> unlimited size */
- /* Limits for MonitoredItems */
- UA_UInt32 maxMonitoredItemsPerSubscription;
- UA_DurationRange samplingIntervalLimits;
- UA_UInt32Range queueSizeLimits; /* Negotiated with the client */
- /* Limits for PublishRequests */
- UA_UInt32 maxPublishReqPerSession;
- /* 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
- * ervery 10 seconds. The server will still be removed depending on the
- * state of the semaphore file. */
- UA_UInt32 discoveryCleanupTimeout;
- #endif
- };
- #ifdef __cplusplus
- }
- #endif
- #endif /* UA_SERVER_CONFIG_H_ */
|