psocksxx  1.0.0
sockaddr.h
1 /*
2 * psocksxx - A C++ wrapper for POSIX sockets
3 * Copyright (C) 2013 Uditha Atukorala
4 *
5 * This software library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This software library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this software library. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19 
20 #ifndef PSOCKSXX_SOCKADDR_H
21 #define PSOCKSXX_SOCKADDR_H
22 
23 #include <sys/socket.h>
24 
25 
26 namespace psocksxx {
27 
35  class sockaddr {
36  public:
37 
39  enum address_t {
40  af_unspec = AF_UNSPEC,
41  af_local = AF_LOCAL,
42  af_inet = AF_INET
43  };
44 
45 
49  virtual ~sockaddr() { };
50 
59  virtual socklen_t size() const throw() =0;
60 
69  virtual ::sockaddr * psockaddr() const throw() =0;
70 
71  };
72 
73 } /* end of namespace psocksxx */
74 
75 #endif /* !PSOCKSXX_SOCKADDR_H */
76 
Definition: sockaddr.h:41
Definition: sockaddr.h:42
Definition: iosocks.cpp:23
virtual ~sockaddr()
destructor
Definition: sockaddr.h:49
virtual ::sockaddr * psockaddr() const =0
get a POSIX socket address structure
virtual socklen_t size() const =0
get POSIX socket address size
Socket address base class.
Definition: sockaddr.h:35
address_t
Definition: sockaddr.h:39