1 #ifndef MSP_NET_SOCKADDR_H_
2 #define MSP_NET_SOCKADDR_H_
6 #include <sys/socket.h>
16 virtual Family get_family() const =0;
17 virtual std::string str() const =0;
20 Fills the given struct sockaddr with information from this SockAddr.
22 @return Number of bytes used
24 virtual unsigned fill_sockaddr(sockaddr &) const =0;
25 virtual unsigned fill_sockaddr(sockaddr_storage &) const;
27 virtual SockAddr *copy() const =0;
29 virtual ~SockAddr() { }
31 static SockAddr *create(const sockaddr &sa) { return create(reinterpret_cast<const sockaddr_storage &>(sa)); }
32 static SockAddr *create(const sockaddr_storage &);