X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finet6.h;fp=source%2Finet6.h;h=02ec4503b660c724ec94f93e9cf765555053f0cf;hb=1b2aabf076169e6d2049227188e464e95ac40514;hp=0000000000000000000000000000000000000000;hpb=35009eb3f51a6fd0f9261f892a85d97d81e69886;p=libs%2Fnet.git diff --git a/source/inet6.h b/source/inet6.h new file mode 100644 index 0000000..02ec450 --- /dev/null +++ b/source/inet6.h @@ -0,0 +1,49 @@ +/* $Id$ + +This file is part of libmspnet +Copyright © 2011 Mikkosoft Productions, Mikko Rasa +Distributed under the LGPL +*/ + +#ifndef MSP_NET_INET6_H_ +#define NSP_NET_INET6_H_ + +#ifdef WIN32 +#include +#include +#else +#include +#endif +#include "sockaddr.h" + +namespace Msp { +namespace Net { + +class Inet6Addr: public SockAddr +{ +private: +#ifdef WIN32 + typedef u_short in_port_t; +#endif + + in6_addr addr; + in_port_t port; + +public: + Inet6Addr(); + Inet6Addr(const sockaddr_in6 &); + Inet6Addr(unsigned char [16], in_port_t); + + virtual Family get_family() const { return INET6; } + virtual std::string str() const; + + virtual unsigned fill_sockaddr(sockaddr &) const; + virtual unsigned fill_sockaddr(sockaddr_storage &) const; + + virtual Inet6Addr *copy() const { return new Inet6Addr(*this); } +}; + +} // namespace Net +} // namespace Msp + +#endif