X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsockaddr.h;fp=source%2Fsockaddr.h;h=63f2ab48db1462b9f201737208477d95a7a42763;hb=f59eded7c3e162bbdfc6db424c9badc730017698;hp=0000000000000000000000000000000000000000;hpb=fab500d5bff644bb5637abd2f5e78baeb26b7f26;p=libs%2Fnet.git diff --git a/source/sockaddr.h b/source/sockaddr.h new file mode 100644 index 0000000..63f2ab4 --- /dev/null +++ b/source/sockaddr.h @@ -0,0 +1,44 @@ +/* $Id$ + +This file is part of libmspnet +Copyright © 2008 Mikkosoft Productions, Mikko Rasa +Distributed under the LGPL +*/ + +#ifndef MSP_NET_SOCKADDR_H_ +#define MSP_NET_SOCKADDR_H_ + +#ifndef WIN32 +#include +#endif +#include "constants.h" + +namespace Msp { +namespace Net { + +class SockAddr +{ +public: + virtual Family get_family() const =0; + virtual std::string str() const =0; + + /** + Fills the given struct sockaddr with information from this SockAddr. + + @return Number of bytes used + */ + virtual unsigned fill_sockaddr(sockaddr &) const =0; + + virtual SockAddr *copy() const =0; + + virtual ~SockAddr() { } + + static SockAddr *create(sockaddr &); +protected: + SockAddr() { } +}; + +} // namespace Net +} // namespace Msp + +#endif