config.hpp 914 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __CONFIG_HPP__
  2. #define __CONFIG_HPP__
  3. #include <vector>
  4. #include "enclave_api.h"
  5. // startweight is the running total of all the weight entries of nodes
  6. // lower numbered than this one. E.g., if the weights of nodes 0, 1,
  7. // ..., etc. are [1, 2, 4, 1, 2, ...], the startweight values will be
  8. // [0, 1, 3, 7, 8, ...].
  9. struct NodeWeight {
  10. uint16_t startweight;
  11. uint8_t weight;
  12. };
  13. struct Config {
  14. nodenum_t num_nodes;
  15. nodenum_t num_ingestion_nodes;
  16. nodenum_t num_routing_nodes;
  17. nodenum_t num_storage_nodes;
  18. nodenum_t my_node_num;
  19. uint32_t user_count;
  20. uint16_t msg_size;
  21. uint8_t m_priv_out;
  22. uint8_t m_priv_in;
  23. uint8_t m_pub_out;
  24. uint8_t m_pub_in;
  25. std::vector<NodeWeight> weights;
  26. std::vector<nodenum_t> ingestion_nodes;
  27. std::vector<nodenum_t> routing_nodes;
  28. std::vector<nodenum_t> storage_nodes;
  29. };
  30. extern Config g_teems_config;
  31. #endif