ua_config_standard.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  2. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
  3. #include "ua_config_standard.h"
  4. #include "ua_log_stdout.h"
  5. #include "ua_network_tcp.h"
  6. #include "ua_accesscontrol_default.h"
  7. /*******************************/
  8. /* Default Connection Settings */
  9. /*******************************/
  10. const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_standard = {
  11. 0, /* .protocolVersion */
  12. 65535, /* .sendBufferSize, 64k per chunk */
  13. 65535, /* .recvBufferSize, 64k per chunk */
  14. 0, /* .maxMessageSize, 0 -> unlimited */
  15. 0 /* .maxChunkCount, 0 -> unlimited */
  16. };
  17. /***************************/
  18. /* Default Server Settings */
  19. /***************************/
  20. #define MANUFACTURER_NAME "open62541"
  21. #define PRODUCT_NAME "open62541 OPC UA Server"
  22. #define PRODUCT_URI "http://open62541.org"
  23. #define APPLICATION_NAME "open62541-based OPC UA Application"
  24. #define APPLICATION_URI "urn:unconfigured:application"
  25. #define UA_STRING_STATIC(s) {sizeof(s)-1, (UA_Byte*)s}
  26. #define UA_STRING_STATIC_NULL {0, NULL}
  27. #define STRINGIFY(arg) #arg
  28. #define VERSION(MAJOR, MINOR, PATCH, LABEL) \
  29. STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL
  30. /* Access Control. The following definitions are defined as "extern" in
  31. ua_accesscontrol_default.h */
  32. #define ENABLEANONYMOUSLOGIN true
  33. #define ENABLEUSERNAMEPASSWORDLOGIN true
  34. const UA_Boolean enableAnonymousLogin = ENABLEANONYMOUSLOGIN;
  35. const UA_Boolean enableUsernamePasswordLogin = ENABLEUSERNAMEPASSWORDLOGIN;
  36. const size_t usernamePasswordsSize = 2;
  37. UA_UsernamePasswordLogin UsernamePasswordLogin[2] = {
  38. { UA_STRING_STATIC("user1"), UA_STRING_STATIC("password") },
  39. { UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1") } };
  40. const UA_UsernamePasswordLogin *usernamePasswords = UsernamePasswordLogin;
  41. const UA_EXPORT UA_ServerConfig UA_ServerConfig_standard = {
  42. 1, /* .nThreads */
  43. UA_Log_Stdout, /* .logger */
  44. /* Server Description */
  45. {UA_STRING_STATIC(PRODUCT_URI),
  46. UA_STRING_STATIC(MANUFACTURER_NAME),
  47. UA_STRING_STATIC(PRODUCT_NAME),
  48. UA_STRING_STATIC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR,
  49. UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)),
  50. UA_STRING_STATIC(__DATE__ " " __TIME__), 0 }, /* .buildInfo */
  51. {UA_STRING_STATIC(APPLICATION_URI),
  52. UA_STRING_STATIC(PRODUCT_URI),
  53. {UA_STRING_STATIC("en"),UA_STRING_STATIC(APPLICATION_NAME) },
  54. UA_APPLICATIONTYPE_SERVER,
  55. UA_STRING_STATIC_NULL,
  56. UA_STRING_STATIC_NULL,
  57. 0, NULL }, /* .applicationDescription */
  58. UA_STRING_STATIC_NULL, /* .serverCertificate */
  59. #ifdef UA_ENABLE_DISCOVERY
  60. UA_STRING_STATIC_NULL, /* mdnsServerName */
  61. 0, /* serverCapabilitiesSize */
  62. NULL, /* serverCapabilities */
  63. #endif
  64. /* Custom DataTypes */
  65. 0, /* .customDataTypesSize */
  66. NULL, /* .customDataTypes */
  67. /* Networking */
  68. 0, /* .networkLayersSize */
  69. NULL, /* .networkLayers */
  70. /* Access Control */
  71. {ENABLEANONYMOUSLOGIN, ENABLEUSERNAMEPASSWORDLOGIN,
  72. activateSession_default, closeSession_default,
  73. getUserRightsMask_default, getUserAccessLevel_default,
  74. getUserExecutable_default, getUserExecutableOnObject_default,
  75. allowAddNode_default, allowAddReference_default,
  76. allowDeleteNode_default, allowDeleteReference_default},
  77. /* Limits for SecureChannels */
  78. 40, /* .maxSecureChannels */
  79. 10 * 60 * 1000, /* .maxSecurityTokenLifetime, 10 minutes */
  80. /* Limits for Sessions */
  81. 100, /* .maxSessions */
  82. 60.0 * 60.0 * 1000.0, /* .maxSessionTimeout, 1h */
  83. /* Limits for Subscriptions */
  84. {100.0,3600.0 * 1000.0 }, /* .publishingIntervalLimits */
  85. {3, 15000 }, /* .lifeTimeCountLimits */
  86. {1,100}, /* .keepAliveCountLimits */
  87. 1000, /* .maxNotificationsPerPublish */
  88. 0, /* .maxRetransmissionQueueSize, unlimited */
  89. /* Limits for MonitoredItems */
  90. {50.0, 24.0 * 3600.0 * 1000.0 }, /* .samplingIntervalLimits */
  91. {1,100} /* .queueSizeLimits */
  92. #ifdef UA_ENABLE_DISCOVERY
  93. , 60*60 /* .discoveryCleanupTimeout */
  94. #endif
  95. };
  96. /***************************/
  97. /* Default Client Settings */
  98. /***************************/
  99. const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
  100. 5000, /* .timeout, 5 seconds */
  101. 10 * 60 * 1000, /* .secureChannelLifeTime, 10 minutes */
  102. UA_Log_Stdout, /* .logger */
  103. /* .localConnectionConfig */
  104. {0, /* .protocolVersion */
  105. 65535, /* .sendBufferSize, 64k per chunk */
  106. 65535, /* .recvBufferSize, 64k per chunk */
  107. 0, /* .maxMessageSize, 0 -> unlimited */
  108. 0 }, /* .maxChunkCount, 0 -> unlimited */
  109. UA_ClientConnectionTCP, /* .connectionFunc */
  110. 0, /* .customDataTypesSize */
  111. NULL /*.customDataTypes */
  112. };
  113. /****************************************/
  114. /* Default Client Subscription Settings */
  115. /****************************************/
  116. #ifdef UA_ENABLE_SUBSCRIPTIONS
  117. const UA_SubscriptionSettings UA_SubscriptionSettings_standard = {
  118. 500.0, /* .requestedPublishingInterval */
  119. 10000, /* .requestedLifetimeCount */
  120. 1, /* .requestedMaxKeepAliveCount */
  121. 10, /* .maxNotificationsPerPublish */
  122. true, /* .publishingEnabled */
  123. 0 /* .priority */
  124. };
  125. #endif