]> git.tdb.fi Git - libs/net.git/blob - source/net/sockaddr.h
Move the address family enum into sockaddr.h
[libs/net.git] / source / net / sockaddr.h
1 #ifndef MSP_NET_SOCKADDR_H_
2 #define MSP_NET_SOCKADDR_H_
3
4 #include <string>
5
6 namespace Msp {
7 namespace Net {
8
9 enum Family
10 {
11         UNSPEC,
12         INET,
13         INET6,
14         UNIX
15 };
16
17
18 class SockAddr
19 {
20 public:
21         struct SysAddr;
22
23 protected:
24         SockAddr() = default;
25 public:
26         virtual ~SockAddr() = default;
27
28         virtual SockAddr *copy() const = 0;
29
30         static SockAddr *new_from_sys(const SysAddr &);
31         virtual SysAddr to_sys() const = 0;
32
33         virtual Family get_family() const = 0;
34         virtual std::string str() const = 0;
35 };
36
37 } // namespace Net
38 } // namespace Msp
39
40 #endif