X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsockaddr.h;fp=source%2Fsockaddr.h;h=bf7547778dbf80cca68f85d2117bf8c74fbf2204;hb=dbfb303f336037cf7ca4fca3d8bfe504c624b501;hp=ff2f88a9b7be650064d4528f18ba3ff88ddd510e;hpb=bdd968802348fae7a7a407616cb3744e4877601a;p=libs%2Fnet.git diff --git a/source/sockaddr.h b/source/sockaddr.h index ff2f88a..bf75477 100644 --- a/source/sockaddr.h +++ b/source/sockaddr.h @@ -2,9 +2,6 @@ #define MSP_NET_SOCKADDR_H_ #include -#ifndef WIN32 -#include -#endif #include "constants.h" namespace Msp { @@ -12,23 +9,21 @@ namespace Net { class SockAddr { +public: + struct SysAddr; + protected: SockAddr() { } public: virtual ~SockAddr() { } - static SockAddr *create(const sockaddr &sa) { return create(reinterpret_cast(sa)); } - static SockAddr *create(const sockaddr_storage &); - virtual SockAddr *copy() const = 0; + static SockAddr *from_sys(const SysAddr &); + virtual SysAddr to_sys() const = 0; + virtual Family get_family() const = 0; virtual std::string str() const = 0; - - /** Fills a struct sockaddr with information from this SockAddr. Returns - the number of bytes used. */ - virtual unsigned fill_sockaddr(sockaddr &) const = 0; - virtual unsigned fill_sockaddr(sockaddr_storage &) const; }; } // namespace Net