]> git.tdb.fi Git - libs/net.git/blob - source/inet6.h
Add function to check if handshake is done
[libs/net.git] / source / inet6.h
1 /* $Id$
2
3 This file is part of libmspnet
4 Copyright © 2011  Mikkosoft Productions, Mikko Rasa
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_NET_INET6_H_
9 #define NSP_NET_INET6_H_
10
11 #ifdef WIN32
12 #include <winsock2.h>
13 #include <ws2tcpip.h>
14 #else
15 #include <netinet/in.h>
16 #endif
17 #include "sockaddr.h"
18
19 namespace Msp {
20 namespace Net {
21
22 class Inet6Addr: public SockAddr
23 {
24 private:
25 #ifdef WIN32
26         typedef u_short in_port_t;
27 #endif
28
29         in6_addr addr;
30         in_port_t port;
31
32 public:
33         Inet6Addr();
34         Inet6Addr(const sockaddr_in6 &);
35         Inet6Addr(unsigned char [16], in_port_t);
36
37         virtual Family get_family() const { return INET6; }
38         virtual std::string str() const;
39
40         virtual unsigned fill_sockaddr(sockaddr &) const;
41         virtual unsigned fill_sockaddr(sockaddr_storage &) const;
42
43         virtual Inet6Addr *copy() const { return new Inet6Addr(*this); }
44 };
45
46 } // namespace Net
47 } // namespace Msp
48
49 #endif