]> git.tdb.fi Git - libs/net.git/blob - source/sockaddr.h
Fix a comparison operator on win32
[libs/net.git] / source / sockaddr.h
1 /* $Id$
2
3 This file is part of libmspnet
4 Copyright © 2008  Mikkosoft Productions, Mikko Rasa
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_NET_SOCKADDR_H_
9 #define MSP_NET_SOCKADDR_H_
10
11 #ifndef WIN32
12 #include <sys/socket.h>
13 #endif
14 #include "constants.h"
15
16 namespace Msp {
17 namespace Net {
18
19 class SockAddr
20 {
21 public:
22         virtual Family get_family() const =0;
23         virtual std::string str() const =0;
24
25         /**
26         Fills the given struct sockaddr with information from this SockAddr.
27
28         @return  Number of bytes used
29         */
30         virtual unsigned fill_sockaddr(sockaddr &) const =0;
31
32         virtual SockAddr *copy() const =0;
33
34         virtual ~SockAddr() { }
35
36         static SockAddr *create(sockaddr &);
37 protected:
38         SockAddr() { }
39 };
40
41 } // namespace Net
42 } // namespace Msp
43
44 #endif