Loading...
Searching...
No Matches
sockaddr.h
/*
* psocksxx - A C++ wrapper for POSIX sockets
* Copyright (C) 2013 Uditha Atukorala
*
* This software library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This software library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PSOCKSXX_SOCKADDR_H
#define PSOCKSXX_SOCKADDR_H
#include <sys/socket.h>
namespace psocksxx {
class sockaddr {
public:
enum address_t {
af_unspec = AF_UNSPEC,
af_local = AF_LOCAL,
af_inet = AF_INET
};
virtual ~sockaddr() { };
virtual socklen_t size() const throw() =0;
virtual ::sockaddr * psockaddr() const throw() =0;
};
} /* end of namespace psocksxx */
#endif /* !PSOCKSXX_SOCKADDR_H */
psocksxx::sockaddr
Socket address base class.
Definition sockaddr.h:35
psocksxx::sockaddr::psockaddr
virtual ::sockaddr * psockaddr() const =0
get a POSIX socket address structure
psocksxx::sockaddr::~sockaddr
virtual ~sockaddr()
destructor
Definition sockaddr.h:49
psocksxx::sockaddr::size
virtual socklen_t size() const =0
get POSIX socket address size
psocksxx::sockaddr::address_t
address_t
Definition sockaddr.h:39
psocksxx::sockaddr::af_inet
@ af_inet
Definition sockaddr.h:42
psocksxx::sockaddr::af_local
@ af_local
Definition sockaddr.h:41