123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
- * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
- #include "ua_config_standard.h"
- #include "ua_log_stdout.h"
- #include "ua_network_tcp.h"
- #include "ua_accesscontrol_default.h"
- /*******************************/
- /* Default Connection Settings */
- /*******************************/
- const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_standard = {
- .protocolVersion = 0,
- .sendBufferSize = 65535, /* 64k per chunk */
- .recvBufferSize = 65535, /* 64k per chunk */
- .maxMessageSize = 0, /* 0 -> unlimited */
- .maxChunkCount = 0 /* 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 UA_STRING_STATIC(s) {sizeof(s)-1, (UA_Byte*)s}
- #define UA_STRING_STATIC_NULL {0, NULL}
- #define STRINGIFY(arg) #arg
- #define VERSION(MAJOR, MINOR, PATCH, LABEL) \
- STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL
- /* Access Control. The following definitions are defined as "extern" in
- ua_accesscontrol_default.h */
- #define ENABLEANONYMOUSLOGIN true
- #define ENABLEUSERNAMEPASSWORDLOGIN true
- const UA_Boolean enableAnonymousLogin = ENABLEANONYMOUSLOGIN;
- const UA_Boolean enableUsernamePasswordLogin = ENABLEUSERNAMEPASSWORDLOGIN;
- const size_t usernamePasswordsSize = 2;
- const UA_UsernamePasswordLogin *usernamePasswords = (UA_UsernamePasswordLogin[2]){
- { UA_STRING_STATIC("user1"), UA_STRING_STATIC("password") },
- { UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1") } };
- const UA_EXPORT UA_ServerConfig UA_ServerConfig_standard = {
- .nThreads = 1,
- .logger = UA_Log_Stdout,
- /* Server Description */
- .buildInfo = {
- .productUri = UA_STRING_STATIC(PRODUCT_URI),
- .manufacturerName = UA_STRING_STATIC(MANUFACTURER_NAME),
- .productName = UA_STRING_STATIC(PRODUCT_NAME),
- .softwareVersion = UA_STRING_STATIC(VERSION(UA_OPEN62541_VER_MAJOR,
- UA_OPEN62541_VER_MINOR,
- UA_OPEN62541_VER_PATCH,
- UA_OPEN62541_VER_LABEL)),
- .buildNumber = UA_STRING_STATIC(__DATE__ " " __TIME__),
- .buildDate = 0 },
- .applicationDescription = {
- .applicationUri = UA_STRING_STATIC(APPLICATION_URI),
- .productUri = UA_STRING_STATIC(PRODUCT_URI),
- .applicationName = { .locale = UA_STRING_STATIC("en"),
- .text = UA_STRING_STATIC(APPLICATION_NAME) },
- .applicationType = UA_APPLICATIONTYPE_SERVER,
- .gatewayServerUri = UA_STRING_STATIC_NULL,
- .discoveryProfileUri = UA_STRING_STATIC_NULL,
- .discoveryUrlsSize = 0,
- .discoveryUrls = NULL },
- .serverCertificate = UA_STRING_STATIC_NULL,
- /* Custom DataTypes */
- .customDataTypesSize = 0,
- .customDataTypes = NULL,
- /* Networking */
- .networkLayersSize = 0,
- .networkLayers = NULL,
- /* Access Control */
- .accessControl = {
- .enableAnonymousLogin = ENABLEANONYMOUSLOGIN,
- .enableUsernamePasswordLogin = ENABLEUSERNAMEPASSWORDLOGIN,
- .activateSession = activateSession_default,
- .closeSession = closeSession_default,
- .getUserRightsMask = getUserRightsMask_default,
- .getUserAccessLevel = getUserAccessLevel_default,
- .getUserExecutable = getUserExecutable_default,
- .getUserExecutableOnObject = getUserExecutableOnObject_default,
- .allowAddNode = allowAddNode_default,
- .allowAddReference = allowAddReference_default,
- .allowDeleteNode = allowDeleteNode_default,
- .allowDeleteReference = allowDeleteReference_default
- },
- /* Limits for SecureChannels */
- .maxSecureChannels = 40,
- .maxSecurityTokenLifetime = 10 * 60 * 1000, /* 10 minutes */
- /* Limits for Sessions */
- .maxSessions = 100,
- .maxSessionTimeout = 60.0 * 60.0 * 1000.0, /* 1h */
- /* Limits for Subscriptions */
- .publishingIntervalLimits = { .min = 100.0, .max = 3600.0 * 1000.0 },
- .lifeTimeCountLimits = { .max = 15000, .min = 3 },
- .keepAliveCountLimits = { .max = 100, .min = 1 },
- .maxNotificationsPerPublish = 1000,
- .maxRetransmissionQueueSize = 0, /* unlimited */
- /* Limits for MonitoredItems */
- .samplingIntervalLimits = { .min = 50.0, .max = 24.0 * 3600.0 * 1000.0 },
- .queueSizeLimits = { .max = 100, .min = 1 }
- #ifdef UA_ENABLE_DISCOVERY
- ,.discoveryCleanupTimeout = 60*60
- #endif
- };
- /***************************/
- /* Default Client Settings */
- /***************************/
- const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
- .timeout = 5000, /* 5 seconds */
- .secureChannelLifeTime = 10 * 60 * 1000, /* 10 minutes */
- .logger = UA_Log_Stdout,
- .localConnectionConfig = {
- .protocolVersion = 0,
- .sendBufferSize = 65535, /* 64k per chunk */
- .recvBufferSize = 65535, /* 64k per chunk */
- .maxMessageSize = 0, /* 0 -> unlimited */
- .maxChunkCount = 0 /* 0 -> unlimited */
- },
- .connectionFunc = UA_ClientConnectionTCP,
- /* Custom DataTypes */
- .customDataTypesSize = 0,
- .customDataTypes = NULL
- };
- /****************************************/
- /* Default Client Subscription Settings */
- /****************************************/
- #ifdef UA_ENABLE_SUBSCRIPTIONS
- const UA_SubscriptionSettings UA_SubscriptionSettings_standard = {
- .requestedPublishingInterval = 500.0,
- .requestedLifetimeCount = 10000,
- .requestedMaxKeepAliveCount = 1,
- .maxNotificationsPerPublish = 10,
- .publishingEnabled = true,
- .priority = 0
- };
- #endif
|