diff --git a/tools/dhtnode.cpp b/tools/dhtnode.cpp index fc9e220dd89afd4dad1b2e17370a130151bcc9c0..84ce1d025c991279bd4db5e55cc1e4a19ca78396 100644 --- a/tools/dhtnode.cpp +++ b/tools/dhtnode.cpp @@ -196,7 +196,7 @@ void cmd_loop(std::shared_ptr<DhtRunner>& node, dht_params& params try { auto addr = splitPort(idstr); if (not addr.first.empty() and addr.second.empty()) - addr.second = std::to_string(DHT_DEFAULT_PORT); + addr.second = std::to_string(dht::net::DHT_DEFAULT_PORT); node->bootstrap(addr.first.c_str(), addr.second.c_str()); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; diff --git a/tools/tools_common.h b/tools/tools_common.h index 66cc57922c8ce43528e4bdb45e4be1f31541354a..f97268593670f636e88b5b6c48368745099b55a4 100644 --- a/tools/tools_common.h +++ b/tools/tools_common.h @@ -24,6 +24,7 @@ #include <opendht.h> #include <opendht/log.h> #include <opendht/crypto.h> +#include <opendht/network_utils.h> #ifndef WIN32_NATIVE #include <getopt.h> #include <readline/readline.h> @@ -106,8 +107,6 @@ loadFile(const std::string& path) return buffer; } -static const constexpr in_port_t DHT_DEFAULT_PORT = 4222; - struct dht_params { bool help {false}; // print help and exit bool version {false}; @@ -200,7 +199,7 @@ parseArgs(int argc, char **argv) { case 'b': params.bootstrap = dht::splitPort((optarg[0] == '=') ? optarg+1 : optarg); if (not params.bootstrap.first.empty() and params.bootstrap.second.empty()) { - params.bootstrap.second = std::to_string(DHT_DEFAULT_PORT); + params.bootstrap.second = std::to_string(dht::net::DHT_DEFAULT_PORT); } break; case 'V':