Communication.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * @brief Defines the communication configuration
  3. * @file aman/types/Communication.h
  4. * @author Sven Czarnian <devel@svcz.de>
  5. * @copyright Copyright 2021 Sven Czarnian
  6. * @license This project is published under the GNU General Public License v3 (GPLv3)
  7. */
  8. #pragma once
  9. #include <string>
  10. namespace aman {
  11. /**
  12. * @brief Defines the communication structure
  13. * @ingroup types
  14. */
  15. struct Communication {
  16. bool valid; /**< Marks if the configuration is valid */
  17. bool httpsProtocol; /**< Marks if the server uses HTTPS */
  18. std::string address; /**< The address of the backend */
  19. std::uint16_t portBackend; /**< The reported port of the backend */
  20. std::uint16_t portRestAPI; /**< The notification port of the backend */
  21. std::string serverPublicIdentifier; /**< The server's public identifier */
  22. std::string clientPublicIdentifier; /**< The client's public identifier */
  23. std::string clientPrivateIdentifier; /**< The client's private identifier */
  24. /**
  25. * @brief Initializes an invalid configuration
  26. */
  27. Communication() :
  28. valid(false),
  29. httpsProtocol(false),
  30. address(),
  31. portBackend(0),
  32. portRestAPI(0),
  33. serverPublicIdentifier(),
  34. clientPublicIdentifier(),
  35. clientPrivateIdentifier() { }
  36. };
  37. }