1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef __CONFIG_HPP__
- #define __CONFIG_HPP__
- #include <string>
- #include <vector>
- #include <cstdint>
- #include "sgx_tcrypto.h"
- #include "../Enclave/enclave_api.h"
- #define CLIENT_AUTHENTICATE 0x00
- #define CLIENT_MESSAGE_BUNDLE 0x01
- // The per-node config
- struct NodeConfig {
- std::string name;
- sgx_ec256_public_t pubkey;
- std::string listenhost, listenport;
- std::string clistenhost, clistenport;
- std::string slistenhost, slistenport;
- uint8_t weight;
- uint8_t roles;
- };
- // The global config
- struct Config {
- // global params
- uint32_t user_count;
- uint16_t msg_size;
- uint8_t m_priv_out;
- uint8_t m_priv_in;
- uint8_t m_pub_out;
- uint8_t m_pub_in;
- bool private_routing;
- uint16_t nthreads;
- // config for each node
- std::vector<NodeConfig> nodes;
- // Which node is this one?
- nodenum_t my_node_num;
- // Stub hardcoded master secret to generate keys for client <->
- // server communication (in reality, a key exchange would be done)
- sgx_aes_gcm_128bit_key_t master_secret;
- };
- bool config_parse(Config &config, const std::string configstr,
- const std::string &myname, threadid_t nthreads);
- #endif
|