ua_config_standard.c 2.8 KB

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