ua_config_standard.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. /* Custom DataTypes */
  60. 0, /* .customDataTypesSize */
  61. NULL, /* .customDataTypes */
  62. /* Networking */
  63. 0, /* .networkLayersSize */
  64. NULL, /* .networkLayers */
  65. /* Access Control */
  66. {ENABLEANONYMOUSLOGIN, ENABLEUSERNAMEPASSWORDLOGIN,
  67. activateSession_default, closeSession_default,
  68. getUserRightsMask_default, getUserAccessLevel_default,
  69. getUserExecutable_default, getUserExecutableOnObject_default,
  70. allowAddNode_default, allowAddReference_default,
  71. allowDeleteNode_default, allowDeleteReference_default},
  72. /* Limits for SecureChannels */
  73. 40, /* .maxSecureChannels */
  74. 10 * 60 * 1000, /* .maxSecurityTokenLifetime, 10 minutes */
  75. /* Limits for Sessions */
  76. 100, /* .maxSessions */
  77. 60.0 * 60.0 * 1000.0, /* .maxSessionTimeout, 1h */
  78. /* Limits for Subscriptions */
  79. {100.0,3600.0 * 1000.0 }, /* .publishingIntervalLimits */
  80. {3, 15000 }, /* .lifeTimeCountLimits */
  81. {1,100}, /* .keepAliveCountLimits */
  82. 1000, /* .maxNotificationsPerPublish */
  83. 0, /* .maxRetransmissionQueueSize, unlimited */
  84. /* Limits for MonitoredItems */
  85. {50.0, 24.0 * 3600.0 * 1000.0 }, /* .samplingIntervalLimits */
  86. {1,100} /* .queueSizeLimits */
  87. #ifdef UA_ENABLE_DISCOVERY
  88. , 60*60 /* .discoveryCleanupTimeout */
  89. #endif
  90. };
  91. /***************************/
  92. /* Default Client Settings */
  93. /***************************/
  94. const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
  95. 5000, /* .timeout, 5 seconds */
  96. 10 * 60 * 1000, /* .secureChannelLifeTime, 10 minutes */
  97. UA_Log_Stdout, /* .logger */
  98. /* .localConnectionConfig */
  99. {0, /* .protocolVersion */
  100. 65535, /* .sendBufferSize, 64k per chunk */
  101. 65535, /* .recvBufferSize, 64k per chunk */
  102. 0, /* .maxMessageSize, 0 -> unlimited */
  103. 0 }, /* .maxChunkCount, 0 -> unlimited */
  104. UA_ClientConnectionTCP, /* .connectionFunc */
  105. 0, /* .customDataTypesSize */
  106. NULL /*.customDataTypes */
  107. };
  108. /****************************************/
  109. /* Default Client Subscription Settings */
  110. /****************************************/
  111. #ifdef UA_ENABLE_SUBSCRIPTIONS
  112. const UA_SubscriptionSettings UA_SubscriptionSettings_standard = {
  113. 500.0, /* .requestedPublishingInterval */
  114. 10000, /* .requestedLifetimeCount */
  115. 1, /* .requestedMaxKeepAliveCount */
  116. 10, /* .maxNotificationsPerPublish */
  117. true, /* .publishingEnabled */
  118. 0 /* .priority */
  119. };
  120. #endif