| 12345678910111213141516171819202122232425262728293031 |
- #ifndef __CONFIG_HPP__
- #define __CONFIG_HPP__
- #include <string>
- #include <vector>
- #include <cstdint>
- // The per-node config
- struct NodeConfig {
- std::string name;
- std::string pubkey; // a 128-character hex string
- std::string listenhost, listenport;
- std::string clistenhost, clistenport;
- uint8_t weight;
- };
- // The global config
- struct Config {
- // global params
- uint16_t msgsize;
- // config for each node
- std::vector<NodeConfig> nodes;
- // Which node is this one?
- size_t mynodenum;
- };
- extern Config g_config;
- bool config_parse(const std::string configstr, const std::string &myname);
- #endif
|