|
@@ -72,8 +72,18 @@ bool config_parse(Config &config, const std::string configstr,
|
|
for (auto & entry : conftree) {
|
|
for (auto & entry : conftree) {
|
|
if (!entry.first.compare("params")) {
|
|
if (!entry.first.compare("params")) {
|
|
for (auto & pentry : entry.second) {
|
|
for (auto & pentry : entry.second) {
|
|
- if (!pentry.first.compare("msgsize")) {
|
|
|
|
- config.msgsize = pentry.second.get_value<uint16_t>();
|
|
|
|
|
|
+ if (!pentry.first.compare("msg_size")) {
|
|
|
|
+ config.msg_size = pentry.second.get_value<uint16_t>();
|
|
|
|
+ } else if (!pentry.first.compare("user_count")) {
|
|
|
|
+ config.user_count = pentry.second.get_value<uint32_t>();
|
|
|
|
+ } else if (!pentry.first.compare("priv_out")) {
|
|
|
|
+ config.m_priv_out = pentry.second.get_value<uint8_t>();
|
|
|
|
+ } else if (!pentry.first.compare("priv_in")) {
|
|
|
|
+ config.m_priv_in = pentry.second.get_value<uint8_t>();
|
|
|
|
+ } else if (!pentry.first.compare("pub_out")) {
|
|
|
|
+ config.m_pub_out = pentry.second.get_value<uint8_t>();
|
|
|
|
+ } else if (!pentry.first.compare("pub_in")) {
|
|
|
|
+ config.m_pub_in = pentry.second.get_value<uint8_t>();
|
|
} else {
|
|
} else {
|
|
std::cerr << "Unknown field in params: " <<
|
|
std::cerr << "Unknown field in params: " <<
|
|
pentry.first << "\n";
|
|
pentry.first << "\n";
|
|
@@ -84,7 +94,9 @@ bool config_parse(Config &config, const std::string configstr,
|
|
} else if (!entry.first.compare("nodes")) {
|
|
} else if (!entry.first.compare("nodes")) {
|
|
for (auto & node : entry.second) {
|
|
for (auto & node : entry.second) {
|
|
NodeConfig nc;
|
|
NodeConfig nc;
|
|
- nc.weight = 1; // default
|
|
|
|
|
|
+ // defaults
|
|
|
|
+ nc.weight = 1;
|
|
|
|
+ nc.roles = ROLE_INGESTION | ROLE_ROUTING | ROLE_STORAGE;
|
|
for (auto & nentry : node.second) {
|
|
for (auto & nentry : node.second) {
|
|
if (!nentry.first.compare("name")) {
|
|
if (!nentry.first.compare("name")) {
|
|
nc.name = nentry.second.get_value<std::string>();
|
|
nc.name = nentry.second.get_value<std::string>();
|
|
@@ -133,7 +145,12 @@ bool config_parse(Config &config, const std::string configstr,
|
|
|
|
|
|
// Now load the config into the enclave
|
|
// Now load the config into the enclave
|
|
EnclaveAPIParams apiparams;
|
|
EnclaveAPIParams apiparams;
|
|
- apiparams.msgsize = config.msgsize;
|
|
|
|
|
|
+ apiparams.user_count = config.user_count;
|
|
|
|
+ apiparams.msg_size = config.msg_size;
|
|
|
|
+ apiparams.m_priv_out = config.m_priv_out;
|
|
|
|
+ apiparams.m_priv_in = config.m_priv_in;
|
|
|
|
+ apiparams.m_pub_out = config.m_pub_out;
|
|
|
|
+ apiparams.m_pub_in = config.m_pub_in;
|
|
nodenum_t num_nodes = (nodenum_t)(config.nodes.size());
|
|
nodenum_t num_nodes = (nodenum_t)(config.nodes.size());
|
|
std::vector<EnclaveAPINodeConfig> apinodeconfigs;
|
|
std::vector<EnclaveAPINodeConfig> apinodeconfigs;
|
|
apinodeconfigs.resize(num_nodes);
|
|
apinodeconfigs.resize(num_nodes);
|
|
@@ -141,6 +158,7 @@ bool config_parse(Config &config, const std::string configstr,
|
|
memmove(&apinodeconfigs[i].pubkey,
|
|
memmove(&apinodeconfigs[i].pubkey,
|
|
&config.nodes[i].pubkey, sizeof(apinodeconfigs[i].pubkey));
|
|
&config.nodes[i].pubkey, sizeof(apinodeconfigs[i].pubkey));
|
|
apinodeconfigs[i].weight = config.nodes[i].weight;
|
|
apinodeconfigs[i].weight = config.nodes[i].weight;
|
|
|
|
+ apinodeconfigs[i].roles = config.nodes[i].roles;
|
|
}
|
|
}
|
|
ret &= ecall_config_load(&apiparams, apinodeconfigs.data(),
|
|
ret &= ecall_config_load(&apiparams, apinodeconfigs.data(),
|
|
num_nodes, config.my_node_num);
|
|
num_nodes, config.my_node_num);
|