appconfig.hpp 832 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. // config for each node
  27. std::vector<NodeConfig> nodes;
  28. // Which node is this one?
  29. nodenum_t my_node_num;
  30. };
  31. bool config_parse(Config &config, const std::string configstr,
  32. const std::string &myname, threadid_t nthreads);
  33. #endif