hmbdc
simplify-high-performance-messaging-programming
Misc.hpp
1 #include "hmbdc/Copyright.hpp"
2 #pragma once
3 
4 #include "hmbdc/Exception.hpp"
5 
6 #include <string>
7 
8 struct msghdr;
9 namespace hmbdc { namespace comm { namespace inet {
10 /**
11  * @brief resolve a local ip interface using a mask
12  *
13  * @param mask in this format: "192.168.0.1/24" or "192.168.0.101" which is the same as "192.168.0.101/32"
14  * when using 192.168.0.1/0
15  * @param includeLoopback if it is false, the loopback address is excluded from the result
16  * @return a local ip matches the mask if no exception is thrown
17  */
18 std::string getLocalIpMatchMask(std::string const& mask);
19 std::string getLocalIpThruName(std::string const& name);
20 std::pair<std::string, uint16_t> getPeerIpPort(int fd);
21 void extractRelicTo(msghdr& to, msghdr const& from, int sent);
22 }}}
Definition: Base.hpp:13