2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Ux::SockAddr Class Reference
[C++ Wrapper for Standard UNIX Functions]

Inheritance diagram for Ux::SockAddr:

Ux::Base Ux::SockAddrIn Ux::SockAddrUn List of all members.

Detailed Description

Definition at line 76 of file uxsocket.hpp.

Public Member Functions

 SockAddr (void)
const struct sockaddr * get_addr (void) const
sockaddr * get_addr (void)
socklen_t get_len (void) const
socklen_t * get_len_ptr (void)
void set_len (socklen_t len)
void set_protocol (int protocol)
int get_protocol (void)
void set_server (const char *nodename, const char *servname="80")

Static Public Member Functions

void getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hint, struct addrinfo **infop)
void getaddrinfo (const char *nodename, const char *servname, int family, int type, int flags, struct addrinfo **infop)
void freeaddrinfo (struct addrinfo *infop)
void getnameinfo (const struct sockaddr *sa, socklen_t sa_len, char *nodename, socklen_t nodelen, char *servname, socklen_t servlen, unsigned flags)

Protected Attributes

sockaddr_storage sa_storage
socklen_t sa_len
int sa_protocol


Constructor & Destructor Documentation

Ux::SockAddr::SockAddr void   )  [inline]
 

Definition at line 83 of file uxsocket.hpp.


Member Function Documentation

void Ux::SockAddr::freeaddrinfo struct addrinfo *  infop  )  [inline, static]
 

Definition at line 104 of file uxsocket.hpp.

struct sockaddr* Ux::SockAddr::get_addr void   )  [inline]
 

Definition at line 88 of file uxsocket.hpp.

const struct sockaddr* Ux::SockAddr::get_addr void   )  const [inline]
 

Definition at line 86 of file uxsocket.hpp.

Referenced by Ux::Socket::accept(), Ux::Socket::bind(), Ux::Socket::connect(), Ux::Socket::getpeername(), and Ux::Socket::getsockname().

socklen_t Ux::SockAddr::get_len void   )  const [inline]
 

Definition at line 90 of file uxsocket.hpp.

Referenced by Ux::Socket::bind(), and Ux::Socket::connect().

socklen_t* Ux::SockAddr::get_len_ptr void   )  [inline]
 

Definition at line 92 of file uxsocket.hpp.

Referenced by Ux::Socket::accept(), Ux::Socket::getpeername(), and Ux::Socket::getsockname().

int Ux::SockAddr::get_protocol void   )  [inline]
 

Definition at line 98 of file uxsocket.hpp.

void SockAddr::getaddrinfo const char *  nodename,
const char *  servname,
int  family,
int  type,
int  flags,
struct addrinfo **  infop
[static]
 

Calls getaddrinfo, but doesn't require setting up a separate hint structure.

Definition at line 142 of file uxsocket.cpp.

References addrinfo::ai_family, addrinfo::ai_flags, addrinfo::ai_socktype, and getaddrinfo().

void SockAddr::getaddrinfo const char *  nodename,
const char *  servname,
const struct addrinfo *  hint,
struct addrinfo **  infop
[static]
 

Calls getaddrinfo.

Definition at line 130 of file uxsocket.cpp.

References EC_EAI.

Referenced by getaddrinfo(), and set_server().

void SockAddr::getnameinfo const struct sockaddr *  sa,
socklen_t  sa_len,
char *  nodename,
socklen_t  nodelen,
char *  servname,
socklen_t  servlen,
unsigned  flags
[static]
 

Calls getnameinfo.

Definition at line 170 of file uxsocket.cpp.

References EC_EAI.

void Ux::SockAddr::set_len socklen_t  len  )  [inline]
 

Definition at line 94 of file uxsocket.hpp.

Referenced by Ux::SockAddrIn::set(), Ux::SockAddrUn::set(), and set_server().

void Ux::SockAddr::set_protocol int  protocol  )  [inline]
 

Definition at line 96 of file uxsocket.hpp.

Referenced by set_server().

void SockAddr::set_server const char *  nodename,
const char *  servname = "80"
 

Calls getaddrinfo and then sets up the socket address from a nodename and servname (port).

Definition at line 157 of file uxsocket.cpp.

References addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_protocol, getaddrinfo(), sa_storage, set_len(), and set_protocol().


Member Data Documentation

socklen_t Ux::SockAddr::sa_len [protected]
 

Definition at line 79 of file uxsocket.hpp.

int Ux::SockAddr::sa_protocol [protected]
 

Definition at line 80 of file uxsocket.hpp.

struct sockaddr_storage Ux::SockAddr::sa_storage [protected]
 

Definition at line 78 of file uxsocket.hpp.

Referenced by set_server().


The documentation for this class was generated from the following files:
Generated on Fri Apr 23 10:57:17 2004 for AUP2 Example Source by doxygen 1.3.1