123456789101112131415161718192021222324252627282930 |
- #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;
- };
- bool config_parse(Config &config, const std::string configstr,
- const std::string &myname);
- #endif
|