2014-01-30 03:28:07 +00:00
|
|
|
#ifndef UTIL_H
|
|
|
|
#define UTIL_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2014-12-23 02:20:39 +00:00
|
|
|
#include <iostream>
|
2014-10-31 18:17:52 +00:00
|
|
|
#include <boost/asio.hpp>
|
2014-02-01 03:09:55 +00:00
|
|
|
|
2016-06-14 15:55:44 +00:00
|
|
|
#ifdef ANDROID
|
2016-10-26 00:00:00 +00:00
|
|
|
#include <boost/lexical_cast.hpp>
|
2016-06-14 15:55:44 +00:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
template <typename T>
|
|
|
|
std::string to_string(T value)
|
|
|
|
{
|
|
|
|
return boost::lexical_cast<std::string>(value);
|
|
|
|
}
|
2016-10-26 20:19:32 +00:00
|
|
|
|
|
|
|
inline int stoi(const std::string& str)
|
|
|
|
{
|
|
|
|
return boost::lexical_cast<int>(str);
|
|
|
|
}
|
2016-06-14 15:55:44 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-01-30 03:28:07 +00:00
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace util
|
|
|
|
{
|
2014-10-31 18:17:52 +00:00
|
|
|
namespace net
|
|
|
|
{
|
|
|
|
int GetMTU (const boost::asio::ip::address& localAddress);
|
2016-06-29 15:06:51 +00:00
|
|
|
const boost::asio::ip::address GetInterfaceAddress(const std::string & ifname, bool ipv6=false);
|
2014-10-31 18:17:52 +00:00
|
|
|
}
|
2014-01-30 03:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|