forked from open62541/open62541
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ua_config_standard.c
130 lines (109 loc) · 4.59 KB
/
ua_config_standard.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* 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"
/*******************************/
/* 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
UA_UsernamePasswordLogin usernamePasswords[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,
/* Networking */
.networkLayersSize = 0,
.networkLayers = NULL,
/* Login */
.enableAnonymousLogin = true,
.enableUsernamePasswordLogin = true,
.usernamePasswordLogins = usernamePasswords,
.usernamePasswordLoginsSize = 2,
/* 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 }
};
/***************************/
/* 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
};
/****************************************/
/* 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