config.hpp 965 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. threadid_t nthreads;
  15. nodenum_t num_nodes;
  16. nodenum_t num_ingestion_nodes;
  17. nodenum_t num_routing_nodes;
  18. nodenum_t num_storage_nodes;
  19. nodenum_t my_node_num;
  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. std::vector<NodeWeight> weights;
  28. std::vector<nodenum_t> ingestion_nodes;
  29. std::vector<nodenum_t> routing_nodes;
  30. std::vector<nodenum_t> storage_nodes;
  31. };
  32. extern Config g_teems_config;
  33. #endif