ua_config_standard.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. const UA_EXPORT UA_ServerConfig UA_ServerConfig_standard = {
  31. 1, /* .nThreads */
  32. UA_Log_Stdout, /* .logger */
  33. /* Server Description */
  34. {UA_STRING_STATIC(PRODUCT_URI),
  35. UA_STRING_STATIC(MANUFACTURER_NAME),
  36. UA_STRING_STATIC(PRODUCT_NAME),
  37. UA_STRING_STATIC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR,
  38. UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)),
  39. UA_STRING_STATIC(__DATE__ " " __TIME__), 0 }, /* .buildInfo */
  40. {UA_STRING_STATIC(APPLICATION_URI),
  41. UA_STRING_STATIC(PRODUCT_URI),
  42. {UA_STRING_STATIC("en"),UA_STRING_STATIC(APPLICATION_NAME) },
  43. UA_APPLICATIONTYPE_SERVER,
  44. UA_STRING_STATIC_NULL,
  45. UA_STRING_STATIC_NULL,
  46. 0, NULL }, /* .applicationDescription */
  47. UA_STRING_STATIC_NULL, /* .serverCertificate */
  48. #ifdef UA_ENABLE_DISCOVERY
  49. UA_STRING_STATIC_NULL, /* mdnsServerName */
  50. 0, /* serverCapabilitiesSize */
  51. NULL, /* serverCapabilities */
  52. #endif
  53. /* Custom DataTypes */
  54. 0, /* .customDataTypesSize */
  55. NULL, /* .customDataTypes */
  56. /* Networking */
  57. 0, /* .networkLayersSize */
  58. NULL, /* .networkLayers */
  59. /* Access Control */
  60. {true, true,
  61. activateSession_default, closeSession_default,
  62. getUserRightsMask_default, getUserAccessLevel_default,
  63. getUserExecutable_default, getUserExecutableOnObject_default,
  64. allowAddNode_default, allowAddReference_default,
  65. allowDeleteNode_default, allowDeleteReference_default},
  66. /* Limits for SecureChannels */
  67. 40, /* .maxSecureChannels */
  68. 10 * 60 * 1000, /* .maxSecurityTokenLifetime, 10 minutes */
  69. /* Limits for Sessions */
  70. 100, /* .maxSessions */
  71. 60.0 * 60.0 * 1000.0, /* .maxSessionTimeout, 1h */
  72. /* Limits for Subscriptions */
  73. {100.0,3600.0 * 1000.0 }, /* .publishingIntervalLimits */
  74. {3, 15000 }, /* .lifeTimeCountLimits */
  75. {1,100}, /* .keepAliveCountLimits */
  76. 1000, /* .maxNotificationsPerPublish */
  77. 0, /* .maxRetransmissionQueueSize, unlimited */
  78. /* Limits for MonitoredItems */
  79. {50.0, 24.0 * 3600.0 * 1000.0 }, /* .samplingIntervalLimits */
  80. {1,100} /* .queueSizeLimits */
  81. #ifdef UA_ENABLE_DISCOVERY
  82. , 60*60 /* .discoveryCleanupTimeout */
  83. #endif
  84. };
  85. /***************************/
  86. /* Default Client Settings */
  87. /***************************/
  88. const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
  89. 5000, /* .timeout, 5 seconds */
  90. 10 * 60 * 1000, /* .secureChannelLifeTime, 10 minutes */
  91. UA_Log_Stdout, /* .logger */
  92. /* .localConnectionConfig */
  93. {0, /* .protocolVersion */
  94. 65535, /* .sendBufferSize, 64k per chunk */
  95. 65535, /* .recvBufferSize, 64k per chunk */
  96. 0, /* .maxMessageSize, 0 -> unlimited */
  97. 0 }, /* .maxChunkCount, 0 -> unlimited */
  98. UA_ClientConnectionTCP, /* .connectionFunc */
  99. 0, /* .customDataTypesSize */
  100. NULL /*.customDataTypes */
  101. };
  102. /****************************************/
  103. /* Default Client Subscription Settings */
  104. /****************************************/
  105. #ifdef UA_ENABLE_SUBSCRIPTIONS
  106. const UA_SubscriptionSettings UA_SubscriptionSettings_standard = {
  107. 500.0, /* .requestedPublishingInterval */
  108. 10000, /* .requestedLifetimeCount */
  109. 1, /* .requestedMaxKeepAliveCount */
  110. 10, /* .maxNotificationsPerPublish */
  111. true, /* .publishingEnabled */
  112. 0 /* .priority */
  113. };
  114. #endif