xorp

Iptuple Class Reference

Store the Local Interface, IP, Local Server Port, Peer IP and Peer Server Port tuple. More...

#include <iptuple.hh>

List of all members.

Public Member Functions

 Iptuple (const char *local_dev, const char *local_addr, uint16_t local_port, const char *peer_addr, uint16_t peer_port) throw (UnresolvableHost,AddressFamilyMismatch)
 Iptuple (const Iptuple &)
Iptupleoperator= (const Iptuple &)
void copy (const Iptuple &)
bool operator== (const Iptuple &) const
struct sockaddr * get_local_socket (size_t &len) const
string get_local_addr () const
bool get_local_addr (IPv4 &addr) const
bool get_local_addr (IPv6 &addr) const
uint16_t get_local_port () const
struct sockaddr * get_bind_socket (size_t &len) const
struct sockaddr * get_peer_socket (size_t &len) const
string get_peer_addr () const
const string & get_local_interface () const
bool get_peer_addr (IPv4 &addr) const
bool get_peer_addr (IPv6 &addr) const
uint16_t get_peer_port () const
string str () const

Private Member Functions

void fill_address (const char *addr, uint16_t local_port, struct sockaddr_storage &ss, size_t &len, string &addr_numeric) throw (UnresolvableHost)

Private Attributes

string _local_dev
string _local_addr
string _peer_addr
struct sockaddr_storage _local_sock
size_t _local_sock_len
struct sockaddr_storage _bind_sock
size_t _bind_sock_len
struct sockaddr_storage _peer_sock
size_t _peer_sock_len
string _local_address
IPvX _local_address_ipvx
string _peer_address
IPvX _peer_address_ipvx
uint16_t _local_port
uint16_t _peer_port

Detailed Description

Store the Local Interface, IP, Local Server Port, Peer IP and Peer Server Port tuple.

Also create the socket buffers to be used by the socket code. All the IP protocol family differences can therefore be hidden in here.

The endpoint addresses can be presented as either numeric addresses or symbolic addresses. Symbolic addresses are converted to numeric addresses and held as such. The symbolic address are kept to aid debugging but are never accessed after the initial conversion to the numeric form. Only in the constructor is there a possibility of a DNS / Yellow pages interaction taking place. After this as we are dealing with IP addresses there should be no danger.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations