diff options
Diffstat (limited to 'src/common/Utilities/Util.cpp')
-rw-r--r-- | src/common/Utilities/Util.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 3df1616898..5628323251 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -7,9 +7,9 @@ #include "Util.h" #include "Common.h" #include "Containers.h" +#include "IpAddress.h" #include "StringConvert.h" #include "StringFormat.h" -#include <ace/Default_Constants.h> #include <algorithm> #include <cctype> #include <cstdarg> @@ -17,8 +17,10 @@ #include <iomanip> #include <sstream> #include <string> +#include <cctype> +#include <cstdarg> +#include <ctime> #include <utf8.h> -// #include "IpAddress.h" Tokenizer::Tokenizer(const std::string& src, const char sep, uint32 vectorReserve) { @@ -295,26 +297,9 @@ bool IsIPAddress(char const* ipaddress) return false; } - // Let the big boys do it. - // Drawback: all valid ip address formats are recognized e.g.: 12.23, 121234, 0xABCD) - return inet_addr(ipaddress) != INADDR_NONE; -} - -std::string GetAddressString(ACE_INET_Addr const& addr) -{ - char buf[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16]; - addr.addr_to_string(buf, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16); - return buf; -} - -bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask) -{ - uint32 mask = subnetMask.get_ip_address(); - if ((net.get_ip_address() & mask) == (addr.get_ip_address() & mask)) - { - return true; - } - return false; + boost::system::error_code error; + Acore::Net::make_address(ipaddress, error); + return !error; } /// create PID file |