]> git.tdb.fi Git - libs/net.git/blobdiff - source/sockaddr.h
Add IPv6 support
[libs/net.git] / source / sockaddr.h
index 63f2ab48db1462b9f201737208477d95a7a42763..0f7a7468170b816edda4f13580019fccee232e1b 100644 (file)
@@ -1,13 +1,14 @@
 /* $Id$
 
 This file is part of libmspnet
-Copyright © 2008  Mikkosoft Productions, Mikko Rasa
+Copyright © 2008, 2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the LGPL
 */
 
 #ifndef MSP_NET_SOCKADDR_H_
 #define MSP_NET_SOCKADDR_H_
 
+#include <string>
 #ifndef WIN32
 #include <sys/socket.h>
 #endif
@@ -28,12 +29,14 @@ public:
        @return  Number of bytes used
        */
        virtual unsigned fill_sockaddr(sockaddr &) const =0;
+       virtual unsigned fill_sockaddr(sockaddr_storage &) const;
 
        virtual SockAddr *copy() const =0;
 
        virtual ~SockAddr() { }
 
-       static SockAddr *create(sockaddr &);
+       static SockAddr *create(const sockaddr &sa) { return create(reinterpret_cast<const sockaddr_storage &>(sa)); }
+       static SockAddr *create(const sockaddr_storage &);
 protected:
        SockAddr() { }
 };