aboutsummaryrefslogtreecommitdiff
path: root/src/IpAddress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/IpAddress.cpp')
-rw-r--r--src/IpAddress.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/IpAddress.cpp b/src/IpAddress.cpp
index 22e81e5..38f758d 100644
--- a/src/IpAddress.cpp
+++ b/src/IpAddress.cpp
@@ -3,6 +3,11 @@
namespace sibs
{
+ Ipv4::Ipv4() : Ipv4(nullptr, 0)
+ {
+
+ }
+
Ipv4::Ipv4(const char *ip, unsigned short port)
{
address.sin_family = AF_INET;
@@ -25,6 +30,17 @@ namespace sibs
memset(address.sin_zero, 0, sizeof(address.sin_zero));
}
+ Ipv4::Ipv4(const Ipv4 &other)
+ {
+ memcpy(&address, &other.address, sizeof(address));
+ }
+
+ Ipv4& Ipv4::operator = (const Ipv4 &other)
+ {
+ memcpy(&address, &other.address, sizeof(address));
+ return *this;
+ }
+
std::string Ipv4::getAddress() const
{
std::string result;