]> git.tdb.fi Git - libs/net.git/blob - source/net/inet6.h
38cba337e436309754c3d1e5d631b45038fcaa5f
[libs/net.git] / source / net / inet6.h
1 #ifndef MSP_NET_INET6_H_
2 #define MSP_NET_INET6_H_
3
4 #include "mspnet_api.h"
5 #include "sockaddr.h"
6
7 namespace Msp {
8 namespace Net {
9
10 class MSPNET_API Inet6Addr: public SockAddr
11 {
12 private:
13         unsigned char addr[16] = { };
14         unsigned port = 0;
15
16 public:
17         Inet6Addr() = default;
18         Inet6Addr(const SysAddr &);
19
20         Inet6Addr *copy() const override { return new Inet6Addr(*this); }
21
22         SysAddr to_sys() const override;
23
24         Family get_family() const override { return INET6; }
25         unsigned get_port() const { return port; }
26         std::string str() const override;
27 };
28
29 } // namespace Net
30 } // namespace Msp
31
32 #endif