config.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. uint16_t tot_weight;
  23. uint8_t m_priv_out;
  24. uint8_t m_priv_in;
  25. uint8_t m_pub_out;
  26. uint8_t m_pub_in;
  27. uint8_t my_weight;
  28. bool private_routing;
  29. std::vector<uint8_t> roles;
  30. std::vector<NodeWeight> weights;
  31. std::vector<nodenum_t> ingestion_nodes;
  32. std::vector<nodenum_t> routing_nodes;
  33. std::vector<nodenum_t> storage_nodes;
  34. sgx_aes_gcm_128bit_key_t master_secret;
  35. // storage_map[i] is the node number of the storage node responsible
  36. // for the destination adddresses with storage node field i.
  37. std::vector<nodenum_t> storage_map;
  38. sgx_aes_gcm_128bit_key_t ESK;
  39. sgx_aes_gcm_128bit_key_t TSK;
  40. };
  41. extern Config g_teems_config;
  42. extern unsigned long ingestion_epoch;
  43. extern unsigned long storage_epoch;
  44. #endif