mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
feat(Core): replace ACE network with Boost.Asio (#6574)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "Containers.h"
|
||||
#include "Define.h"
|
||||
#include "Errors.h"
|
||||
#include <ace/INET_Addr.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cctype>
|
||||
@@ -18,6 +17,9 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <array>
|
||||
|
||||
// Searcher for map of structs
|
||||
template<typename T, class S> struct Finder
|
||||
@@ -383,12 +385,6 @@ bool Utf8ToUpperOnlyLatin(std::string& utf8String);
|
||||
|
||||
bool IsIPAddress(char const* ipaddress);
|
||||
|
||||
/// Checks if address belongs to the a network with specified submask
|
||||
bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask);
|
||||
|
||||
/// Transforms ACE_INET_Addr address into string format "dotted_ip:port"
|
||||
std::string GetAddressString(ACE_INET_Addr const& addr);
|
||||
|
||||
uint32 CreatePIDFile(const std::string& filename);
|
||||
uint32 GetPID();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user