ua_config_standard.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef UA_CONFIG_STANDARD_H_
  4. #define UA_CONFIG_STANDARD_H_
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #include "ua_server.h"
  9. #include "ua_client.h"
  10. #include "ua_client_highlevel.h"
  11. /**********************/
  12. /* Default Connection */
  13. /**********************/
  14. extern const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_default;
  15. /*************************/
  16. /* Default Server Config */
  17. /*************************/
  18. /* Creates a new server config with one endpoint.
  19. *
  20. * The config will set the tcp network layer to the given port and adds a single
  21. * endpoint with the security policy ``SecurityPolicy#None`` to the server. A
  22. * server certificate may be supplied but is optional.
  23. *
  24. * @param portNumber The port number for the tcp network layer
  25. * @param certificate Optional certificate for the server endpoint. Can be
  26. * ``NULL``. */
  27. UA_EXPORT UA_ServerConfig *
  28. UA_ServerConfig_new_minimal(UA_UInt16 portNumber,
  29. const UA_ByteString *certificate);
  30. /* Creates a server config on the standard port 4840 with no server
  31. * certificate. */
  32. static UA_INLINE UA_ServerConfig *
  33. UA_ServerConfig_new_default(void) {
  34. return UA_ServerConfig_new_minimal(4840, NULL);
  35. }
  36. /* Frees allocated memory in the server config */
  37. UA_EXPORT void
  38. UA_ServerConfig_delete(UA_ServerConfig *config);
  39. /*************************/
  40. /* Default Client Config */
  41. /*************************/
  42. extern const UA_EXPORT UA_ClientConfig UA_ClientConfig_default;
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif /* UA_CONFIG_STANDARD_H_ */