summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-03 11:02:41 +0000
committerrubidium <rubidium@openttd.org>2009-04-03 11:02:41 +0000
commit11723c40b2af93baab87868853f42ce0f17c364b (patch)
tree4d97eb5554d0691ee6509cefa6c03808fea399e5 /src/network/core/address.h
parent47602d7b60e40821c364dbd07161caaf30803d52 (diff)
downloadopenttd-11723c40b2af93baab87868853f42ce0f17c364b.tar.xz
(svn r15926) -Codechange: make the broadcast IP list less AF dependent.
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r--src/network/core/address.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h
index eea66cabb..30e79f7a4 100644
--- a/src/network/core/address.h
+++ b/src/network/core/address.h
@@ -64,6 +64,18 @@ public:
}
/**
+ * Create a network address based on a resolved IP and port
+ * @param address the IP address with port
+ */
+ NetworkAddress(sockaddr *address, size_t address_length) :
+ hostname(NULL),
+ address_length(address_length)
+ {
+ memset(&this->address, 0, sizeof(this->address));
+ memcpy(&this->address, address, address_length);
+ }
+
+ /**
* Create a network address based on a unresolved host and port
* @param ip the unresolved hostname
* @param port the port