ua_config_standard.h 1.7 KB

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