Skip to content

Source · fairmq/tools/

Network.hpublic header

Defines struct fair::mq::tools::DefaultRouteDetectionError.

Described in Configure channels, Helpers in fair::mq::tools.

fairmq/tools/Network.h34 lines · C++API: DefaultRouteDetectionErrorGitHub ↗
1/********************************************************************************2 * Copyright (C) 2017-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH  *3 *                                                                              *4 *              This software is distributed under the terms of the             *5 *              GNU Lesser General Public Licence (LGPL) version 3,             *6 *                  copied verbatim in the file "LICENSE"                       *7 ********************************************************************************/8 9#ifndef FAIR_MQ_TOOLS_NETWORK_H10#define FAIR_MQ_TOOLS_NETWORK_H11 12#include <map>13#include <string>14#include <stdexcept>15 16namespace fair::mq::tools17{18 19struct DefaultRouteDetectionError : std::runtime_error { using std::runtime_error::runtime_error; };20 21// returns a map with network interface names as keys and their IP addresses as values22std::map<std::string, std::string> getHostIPs();23 24// get IP address of a given interface name25std::string getInterfaceIP(const std::string& interface);26 27// get name of the default route interface28std::string getDefaultRouteNetworkInterface();29 30std::string getIpFromHostname(const std::string& hostname);31 32} // namespace fair::mq::tools33 34#endif /* FAIR_MQ_TOOLS_NETWORK_H */