]> git.tdb.fi Git - libs/net.git/blobdiff - source/inet.h
Add missing virtual keywords
[libs/net.git] / source / inet.h
index be67dee56bd71db14c8fef146d6b487fa77c352c..20f433ad2996418106e38f4ef675f949114c7e28 100644 (file)
@@ -1,18 +1,6 @@
-/* $Id$
-
-This file is part of libmspnet
-Copyright © 2008, 2011  Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
 #ifndef MSP_NET_INET_H_
 #define MSP_NET_INET_H_
 
-#ifdef WIN32
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#endif
 #include "sockaddr.h"
 
 namespace Msp {
@@ -24,25 +12,19 @@ Address class for IPv4 sockets.
 class InetAddr: public SockAddr
 {
 private:
-#ifdef WIN32
-       typedef u_long in_addr_t;
-       typedef u_short in_port_t;
-#endif
-
-       in_addr_t   addr;
-       in_port_t   port;
+       unsigned char addr[4];
+       unsigned port;
 
 public:
        InetAddr();
-       InetAddr(const sockaddr_in &);
-       InetAddr(in_addr_t, in_port_t);
-
-       Family      get_family() const { return INET; }
-       in_addr_t   get_addr() const { return ntohl(addr); }
-       in_port_t   get_port() const { return ntohs(port); }
-       std::string str() const;
-       virtual unsigned fill_sockaddr(sockaddr &) const;
+       InetAddr(const SysAddr &);
+
        virtual InetAddr *copy() const { return new InetAddr(*this); }
+
+       virtual SysAddr to_sys() const;
+
+       virtual Family get_family() const { return INET; }
+       virtual std::string str() const;
 };
 
 } // namespace Net