appconfig.hpp 881 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __CONFIG_HPP__
  2. #define __CONFIG_HPP__
  3. #include <string>
  4. #include <vector>
  5. #include <cstdint>
  6. #include "sgx_tcrypto.h"
  7. #include "../Enclave/enclave_api.h"
  8. // The per-node config
  9. struct NodeConfig {
  10. std::string name;
  11. sgx_ec256_public_t pubkey;
  12. std::string listenhost, listenport;
  13. std::string clistenhost, clistenport;
  14. uint8_t weight;
  15. uint8_t roles;
  16. };
  17. // The global config
  18. struct Config {
  19. // global params
  20. uint32_t user_count;
  21. uint16_t msg_size;
  22. uint8_t m_priv_out;
  23. uint8_t m_priv_in;
  24. uint8_t m_pub_out;
  25. uint8_t m_pub_in;
  26. bool private_routing;
  27. uint16_t nthreads;
  28. // config for each node
  29. std::vector<NodeConfig> nodes;
  30. // Which node is this one?
  31. nodenum_t my_node_num;
  32. };
  33. bool config_parse(Config &config, const std::string configstr,
  34. const std::string &myname, threadid_t nthreads);
  35. #endif