void set_conf_path(const char *confpath) { conf_path = confpath; hostname = os::exec("hostname"); // workaround until init works module::module_config mconf(confpath); module_info = ""; for (auto &m : mconf.module_map()) { module_info += "<a href=\"" + m.first + "/\">" + m.first + "</a><br>"; } }
/* parses membership.conf into map from nodeid to port num containing nodeid and port number*/ map<int,int> parseMembers() { int num; map<int,int> members; ifstream mconf("membership.conf"); if(!mconf) perror("failed to open membership.conf"); int nodeid,port; while (mconf >> nodeid) { mconf >> port; members[nodeid] = port; } return members; }