ua_config_standard.c 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #define MANUFACTURER_NAME "open62541"
  7. #define PRODUCT_NAME "open62541 OPC UA Server"
  8. #define PRODUCT_URI "http://open62541.org"
  9. #define APPLICATION_NAME "open62541-based OPC UA Application"
  10. #define APPLICATION_URI "urn:unconfigured:application"
  11. #define UA_STRING_STATIC(s) {sizeof(s)-1, (UA_Byte*)s}
  12. #define UA_STRING_STATIC_NULL {0, NULL}
  13. UA_UsernamePasswordLogin usernamePasswords[2] = {
  14. { UA_STRING_STATIC("user1"), UA_STRING_STATIC("password") },
  15. { UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1") } };
  16. const UA_ServerConfig UA_ServerConfig_standard = {
  17. .nThreads = 1,
  18. .logger = UA_Log_Stdout,
  19. /* Server Description */
  20. .buildInfo = {
  21. .productUri = UA_STRING_STATIC(PRODUCT_URI),
  22. .manufacturerName = UA_STRING_STATIC(MANUFACTURER_NAME),
  23. .productName = UA_STRING_STATIC(PRODUCT_NAME),
  24. .softwareVersion = UA_STRING_STATIC(UA_GIT_COMMIT_ID),
  25. .buildNumber = UA_STRING_STATIC(__DATE__ " " __TIME__),
  26. .buildDate = 0 },
  27. .applicationDescription = {
  28. .applicationUri = UA_STRING_STATIC(APPLICATION_URI),
  29. .productUri = UA_STRING_STATIC(PRODUCT_URI),
  30. .applicationName = { .locale = UA_STRING_STATIC("en"),
  31. .text = UA_STRING_STATIC(APPLICATION_NAME) },
  32. .applicationType = UA_APPLICATIONTYPE_SERVER,
  33. .gatewayServerUri = UA_STRING_STATIC_NULL,
  34. .discoveryProfileUri = UA_STRING_STATIC_NULL,
  35. .discoveryUrlsSize = 0,
  36. .discoveryUrls = NULL },
  37. .serverCertificate = UA_STRING_STATIC_NULL,
  38. /* Networking */
  39. .networkLayersSize = 0,
  40. .networkLayers = NULL,
  41. /* Login */
  42. .enableAnonymousLogin = true,
  43. .enableUsernamePasswordLogin = true,
  44. .usernamePasswordLogins = usernamePasswords,
  45. .usernamePasswordLoginsSize = 2,
  46. /* Limits for SecureChannels */
  47. .maxSecureChannels = 40,
  48. .maxSecurityTokenLifetime = 10 * 60 * 1000, /* 10 minutes */
  49. /* Limits for Sessions */
  50. .maxSessions = 100,
  51. .maxSessionTimeout = 60.0 * 60.0 * 1000.0, /* 1h */
  52. /* Limits for Subscriptions */
  53. .publishingIntervalLimits = { .min = 100.0, .max = 3600.0 * 1000.0 },
  54. .lifeTimeCountLimits = { .max = 15000, .min = 3 },
  55. .keepAliveCountLimits = { .max = 100, .min = 1 },
  56. .maxNotificationsPerPublish = 1000,
  57. /* Limits for MonitoredItems */
  58. .samplingIntervalLimits = { .min = 50.0, .max = 24.0 * 3600.0 * 1000.0 },
  59. .queueSizeLimits = { .max = 100, .min = 1 }
  60. };
  61. const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
  62. .timeout = 5000,
  63. .secureChannelLifeTime = 600000,
  64. .logger = UA_Log_Stdout,
  65. .localConnectionConfig = {
  66. .protocolVersion = 0,
  67. .sendBufferSize = 65535,
  68. .recvBufferSize = 65535,
  69. .maxMessageSize = 65535,
  70. .maxChunkCount = 1 },
  71. .connectionFunc = UA_ClientConnectionTCP
  72. };