(svn r15914) -Codechange: let the content handling make use of NetworkAddress.

This commit is contained in:
rubidium
2009-04-02 18:35:59 +00:00
parent 129586388d
commit 822ff14d73
5 changed files with 29 additions and 12 deletions

View File

@@ -7,7 +7,9 @@
#ifdef ENABLE_NETWORK
#include "address.h"
#include "config.h"
#include "host.h"
#include "../../string_func.h"
const char *NetworkAddress::GetHostname() const
{
@@ -27,4 +29,13 @@ uint32 NetworkAddress::GetIP()
return this->ip;
}
const char *NetworkAddress::GetAddressAsString() const
{
/* 6 = for the : and 5 for the decimal port number */
static char buf[NETWORK_HOSTNAME_LENGTH + 6];
seprintf(buf, lastof(buf), "%s:%d", this->GetHostname(), this->GetPort());
return buf;
}
#endif /* ENABLE_NETWORK */