]> git.tdb.fi Git - libs/net.git/blob - source/inet6.h
Use maputils
[libs/net.git] / source / inet6.h
1 #ifndef MSP_NET_INET6_H_
2 #define NSP_NET_INET6_H_
3
4 #ifdef WIN32
5 #include <winsock2.h>
6 #include <ws2tcpip.h>
7 #else
8 #include <netinet/in.h>
9 #endif
10 #include "sockaddr.h"
11
12 namespace Msp {
13 namespace Net {
14
15 class Inet6Addr: public SockAddr
16 {
17 private:
18 #ifdef WIN32
19         typedef u_short in_port_t;
20 #endif
21
22         in6_addr addr;
23         in_port_t port;
24
25 public:
26         Inet6Addr();
27         Inet6Addr(const sockaddr_in6 &);
28         Inet6Addr(unsigned char [16], in_port_t);
29
30         virtual Inet6Addr *copy() const { return new Inet6Addr(*this); }
31
32         virtual Family get_family() const { return INET6; }
33         virtual std::string str() const;
34
35         virtual unsigned fill_sockaddr(sockaddr &) const;
36         virtual unsigned fill_sockaddr(sockaddr_storage &) const;
37 };
38
39 } // namespace Net
40 } // namespace Msp
41
42 #endif