|
CPN
Computational Process Networks
|
An abstraction of a socket address with convenience methods. More...
#include <SocketAddress.h>
Collaboration diagram for SocketAddress:Classes | |
| union | address_ |
Public Types | |
| enum | Type_t { IPV4, IPV6, LOCAL } |
Public Member Functions | |
| SocketAddress () | |
| SocketAddress (addrinfo *info) | |
| SocketAddress (addrinfo *info, unsigned portnum) | |
| SocketAddress (sockaddr *addr, socklen_t len) | |
| ~SocketAddress () | |
| std::string | GetHostName (bool numerichost=true) const |
| std::string | GetServName () const |
| unsigned | GetServ () const |
| Type_t | GetType () const |
| sockaddr * | GetAddr () |
| socklen_t & | GetLen () |
| sa_family_t & | Family () |
| sa_family_t | Family () const |
| void | SetFromSockName (int fd) |
| Fill this SocketAddress with data from this side of the connection represented by fd. More... | |
| void | SetFromPeerName (int fd) |
| Fill this SocketAddress with data from the other side of the connection represented by fd. More... | |
Static Public Member Functions | |
| static SockAddrList | CreateIPFromServ (const char *servname) |
| Return a list of valid socket addresses for the given service name All CreateIP functions create IP addresses. More... | |
| static SockAddrList | CreateIPFromServ (const std::string &servname) |
| static SockAddrList | CreateIPFromHost (const char *hostname) |
| static SockAddrList | CreateIPFromHost (const std::string &hostname) |
| static SockAddrList | CreateIP (unsigned serv) |
| Return a list of valid socket address for the given service number or port number. More... | |
| static SockAddrList | CreateIP (const char *hostname, const char *servname) |
| static SockAddrList | CreateIP (const std::string &hostname, const std::string &servname) |
| static SockAddrList | CreateIP (const char *hostname, unsigned serv) |
| static SockAddrList | CreateIP (const std::string &hostname, unsigned serv) |
| static SockAddrList | CreateIP (const std::string &hostname) |
Static Private Member Functions | |
| static SockAddrList | Lookup (const char *const hostname, const char *const port, int family, unsigned portnum) |
Private Attributes | |
| socklen_t | length |
| union SocketAddress::address_ | address |
An abstraction of a socket address with convenience methods.
Definition at line 42 of file SocketAddress.h.
| Enumerator | |
|---|---|
| IPV4 | |
| IPV6 | |
| LOCAL | |
Definition at line 45 of file SocketAddress.h.
| SocketAddress::SocketAddress | ( | ) |
Definition at line 33 of file SocketAddress.cc.
References address.
Referenced by Lookup().
Here is the caller graph for this function:| SocketAddress::SocketAddress | ( | addrinfo * | info | ) |
Definition at line 174 of file SocketAddress.cc.
References address, and length.
| SocketAddress::SocketAddress | ( | addrinfo * | info, |
| unsigned | portnum | ||
| ) |
Definition at line 179 of file SocketAddress.cc.
References address, Family(), SocketAddress::address_::in, SocketAddress::address_::in6, and length.
Here is the call graph for this function:| SocketAddress::SocketAddress | ( | sockaddr * | addr, |
| socklen_t | len | ||
| ) |
Create a SocketAddress from the underlying sockaddr and length
| addr | pointer tot he address structure |
| len | the length of the address structure |
Definition at line 196 of file SocketAddress.cc.
References address, and length.
|
inline |
Definition at line 94 of file SocketAddress.h.
|
static |
Return a list of valid socket address for the given service number or port number.
Definition at line 103 of file SocketAddress.cc.
References address, Family(), SocketAddress::address_::in, and length.
Referenced by CPN::ConnectionServer::ConnectWriter(), CPN::Kernel::Kernel(), and CPN::VariantCPNLoader::LoadContext().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| hostname | The hostname to lookup |
| servname | the service name to lookup, may be a number string for the port |
Definition at line 114 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Definition at line 118 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
| hostname | the hostname to lookup |
| serv | the port number |
Definition at line 122 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Definition at line 126 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Create socket addresses from hostname:port, [hostname]:port type strings as described in RFC 2732.
| hostname |
Definition at line 130 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Definition at line 95 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Definition at line 99 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Return a list of valid socket addresses for the given service name All CreateIP functions create IP addresses.
Definition at line 87 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
static |
Definition at line 91 of file SocketAddress.cc.
References Lookup().
Here is the call graph for this function:
|
inline |
Definition at line 115 of file SocketAddress.h.
References address, and SocketAddress::address_::storage.
Referenced by SocketHandle::Connect(), CreateIP(), GetServ(), GetType(), ServerSocketHandle::Listen(), and SocketAddress().
Here is the caller graph for this function:
|
inline |
Definition at line 116 of file SocketAddress.h.
References address, and SocketAddress::address_::storage.
|
inline |
Definition at line 113 of file SocketAddress.h.
References SocketAddress::address_::addr, and address.
Referenced by ServerSocketHandle::Accept(), SocketHandle::Connect(), ServerSocketHandle::Listen(), SetFromPeerName(), and SetFromSockName().
Here is the caller graph for this function:| std::string SocketAddress::GetHostName | ( | bool | numerichost = true | ) | const |
| numerichost | true to force no resolution of host names and just return the number |
Definition at line 201 of file SocketAddress.cc.
References SocketAddress::address_::addr, address, and length.
Referenced by CPN::RemoteContextDaemon::Client::Client(), CPN::Kernel::Kernel(), and CPN::RemoteContextDaemon::Run().
Here is the caller graph for this function:
|
inline |
Definition at line 114 of file SocketAddress.h.
References length.
Referenced by ServerSocketHandle::Accept(), SocketHandle::Connect(), ServerSocketHandle::Listen(), SetFromPeerName(), and SetFromSockName().
Here is the caller graph for this function:| unsigned SocketAddress::GetServ | ( | ) | const |
Definition at line 271 of file SocketAddress.cc.
References address, Family(), SocketAddress::address_::in, and SocketAddress::address_::in6.
Here is the call graph for this function:| std::string SocketAddress::GetServName | ( | ) | const |
Definition at line 237 of file SocketAddress.cc.
References SocketAddress::address_::addr, address, and length.
Referenced by CPN::RemoteContextDaemon::Client::Client(), CPN::Kernel::Kernel(), and CPN::RemoteContextDaemon::Run().
Here is the caller graph for this function:| SocketAddress::Type_t SocketAddress::GetType | ( | ) | const |
Definition at line 286 of file SocketAddress.cc.
References ASSERT, Family(), IPV4, IPV6, and LOCAL.
Here is the call graph for this function:
|
staticprivate |
Definition at line 39 of file SocketAddress.cc.
References SocketAddress().
Referenced by CreateIP(), CreateIPFromHost(), and CreateIPFromServ().
Here is the call graph for this function:
Here is the caller graph for this function:| void SocketAddress::SetFromPeerName | ( | int | fd | ) |
Fill this SocketAddress with data from the other side of the connection represented by fd.
| fd | the socket to use |
Definition at line 311 of file SocketAddress.cc.
References GetAddr(), and GetLen().
Referenced by CPN::RemoteContextDaemon::Client::Client().
Here is the call graph for this function:
Here is the caller graph for this function:| void SocketAddress::SetFromSockName | ( | int | fd | ) |
Fill this SocketAddress with data from this side of the connection represented by fd.
| fd | the socket to use |
Definition at line 304 of file SocketAddress.cc.
References GetAddr(), and GetLen().
Referenced by CPN::ConnectionServer::GetAddress(), and CPN::RemoteContextDaemon::Run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by CreateIP(), Family(), GetAddr(), GetHostName(), GetServ(), GetServName(), and SocketAddress().
|
private |
Definition at line 135 of file SocketAddress.h.
Referenced by CreateIP(), GetHostName(), GetLen(), GetServName(), and SocketAddress().
1.8.5