FairMQ  1.3.9
C++ Message Passing Framework
Network.h
1 /********************************************************************************
2  * Copyright (C) 2017 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_H
10 #define FAIR_MQ_TOOLS_NETWORK_H
11 
12 #include <map>
13 #include <string>
14 
15 // forward declarations
16 namespace boost
17 {
18 namespace asio
19 {
20 
21 #ifdef FAIR_MQ_HAS_NO_ASIO_IO_CONTEXT
22 class io_service;
23 #else
24 class io_context;
25 typedef class io_context io_service;
26 #endif
27 
28 } // namespace asio
29 } // namespace boost
30 
31 namespace fair
32 {
33 namespace mq
34 {
35 namespace tools
36 {
37 
38 // returns a map with network interface names as keys and their IP addresses as values
39 std::map<std::string, std::string> getHostIPs();
40 
41 // get IP address of a given interface name
42 std::string getInterfaceIP(const std::string& interface);
43 
44 // get name of the default route interface
45 std::string getDefaultRouteNetworkInterface();
46 
47 std::string getIpFromHostname(const std::string& hostname);
48 
49 std::string getIpFromHostname(const std::string& hostname, boost::asio::io_service& ios);
50 
51 } /* namespace tools */
52 } /* namespace mq */
53 } /* namespace fair */
54 
55 #endif /* FAIR_MQ_TOOLS_NETWORK_H */
Tools for interfacing containers to the transport via polymorphic allocators.
Definition: DeviceRunner.h:23

privacy