appconfig.hpp 674 B

1234567891011121314151617181920212223242526272829303132
  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. };
  16. // The global config
  17. struct Config {
  18. // global params
  19. uint16_t msgsize;
  20. // config for each node
  21. std::vector<NodeConfig> nodes;
  22. // Which node is this one?
  23. nodenum_t my_node_num;
  24. };
  25. bool config_parse(Config &config, const std::string configstr,
  26. const std::string &myname);
  27. #endif