#include <source/ariba/utility/transport/tcpip/protlib/address.h>
Inherits protlib::hostaddress.
Public Member Functions | |
virtual appladdress * | new_instance () const |
virtual appladdress * | copy () const |
virtual bool | operator== (const address &ie) const |
virtual size_t | get_hash () const |
hash function | |
appladdress () | |
constructor | |
appladdress (const appladdress &app) | |
copy constructor | |
appladdress (string socket) | |
constructor for use as Unix Domain Address | |
appladdress (int socket) | |
constructor for use to specify a explicit socket number (used when no addressing for peer can be derived) | |
appladdress (const hostaddress &h, protocol_t prot, port_t p) | |
constructor from hostaddress, protocol ID and port | |
appladdress (const sockaddr_in6 &sockaddr, protocol_t prot) | |
constructor from sockaddr_in6 sockaddr | |
appladdress (const hostaddress &h, const char *pname, port_t p, bool *res=NULL) | |
constructor from hostaddress, protocol name and port | |
appladdress (const char *str, protocol_t prot, port_t p, bool *res=NULL) | |
constructor from string, protocol ID and port | |
appladdress (const char *str, const char *pname, port_t p, bool *res=NULL) | |
constructor from string, protocol name and port | |
appladdress (const char *str, const char *pname, const char *portname, bool *res=NULL) | |
constructor from string, protocol name and port name | |
appladdress & | operator= (const appladdress &app) |
assignment | |
virtual | ~appladdress () |
virtual destructor | |
port_t | set_port (port_t p) |
set port | |
port_t | set_port (const char *pname, bool *res=NULL) |
set port | |
port_t | set_port (const string &pname, bool *res=NULL) |
set port | |
port_t | get_port () const |
get port | |
void | get_sockaddr (struct sockaddr_in6 &sockaddr) const |
get sockaddr_in6 | |
string | get_port_name (bool *res=NULL) const |
get port name | |
protocol_t | set_protocol (protocol_t p) |
set protocol by ID | |
protocol_t | set_protocol (const char *pname, bool *res=NULL) |
set protocol by name | |
protocol_t | set_protocol (const string &pname, bool *res=NULL) |
set protocol by name | |
protocol_t | get_protocol () const |
get protocol ID | |
string | get_protocol_name (bool *res=NULL) const |
get protocol name | |
uint8 | get_prefix () const |
get prefix | |
void | set_prefix (uint8 prfx) |
set prefix | |
void | set_ip_ttl (uint16 ttl) |
set IP TTL | |
void | unset_ip_ttl () |
unset IP TTL | |
uint16 | get_ip_ttl () const |
get IP TTL, if == 0, no IP TTL should be set | |
void | set_rao (uint16 value) |
set RAO value | |
void | unset_rao () |
unset RAO value | |
uint16 | get_rao () const |
get RAO value | |
bool | rao_present () const |
test if RAO present | |
void | set_if_index (uint16 value) |
set outgoing Interface index | |
uint16 | get_if_index () const |
get outgoing Interface index | |
void | unset_if_index () |
unset outgoing Interface index | |
Protected Member Functions | |
virtual void | set_subtype (bool ipv4) |
set subtype and IPv4 flag | |
Private Attributes | |
protocol_t | proto |
port_t | port |
uint8 | prefix |
uint16 | rao |
uint16 | ip_ttl |
bool | rao_presence |
uint16 | if_index |
Definition at line 216 of file address.h.
protlib::appladdress::appladdress | ( | ) | [inline] |
constructor
Constructor sets address type and clears port sets prefix to 32 (ipv4).
Definition at line 386 of file address.h.
References protlib::hostaddress::ipv4flag, and set_subtype().
Referenced by copy(), and new_instance().
protlib::appladdress::appladdress | ( | const appladdress & | app | ) | [inline] |
copy constructor
Definition at line 401 of file address.h.
References protlib::hostaddress::ipv4flag, and set_subtype().
protlib::appladdress::appladdress | ( | string | socket | ) |
constructor for use as Unix Domain Address
protlib::appladdress::appladdress | ( | int | socket | ) |
constructor for use to specify a explicit socket number (used when no addressing for peer can be derived)
protlib::appladdress::appladdress | ( | const hostaddress & | h, | |
protocol_t | prot, | |||
port_t | p | |||
) | [inline] |
constructor from hostaddress, protocol ID and port
Initialize with the given host address, protocol ID and port number.
Definition at line 421 of file address.h.
References protlib::hostaddress::ipv4flag, and set_subtype().
protlib::appladdress::appladdress | ( | const sockaddr_in6 & | sockaddr, | |
protocol_t | prot | |||
) | [inline] |
protlib::appladdress::appladdress | ( | const hostaddress & | h, | |
const char * | pname, | |||
port_t | p, | |||
bool * | res = NULL | |||
) | [inline] |
constructor from hostaddress, protocol name and port
Initialize with the given host address, protocol name and port number. If no protocol ID can be found in the protocol database, it is set to 0.
Definition at line 440 of file address.h.
References protlib::hostaddress::ipv4flag, and set_subtype().
protlib::appladdress::appladdress | ( | const char * | str, | |
protocol_t | prot, | |||
port_t | p, | |||
bool * | res = NULL | |||
) | [inline] |
constructor from string, protocol ID and port
Initialize from string, protocol ID and port. If the string does not contain a vaild IP address, it is set to all 0 by the hostaddress constructor.
Definition at line 461 of file address.h.
References protlib::hostaddress::ipv4flag, and set_subtype().
protlib::appladdress::appladdress | ( | const char * | str, | |
const char * | pname, | |||
port_t | p, | |||
bool * | res = NULL | |||
) | [inline] |
constructor from string, protocol name and port
Initialize from string, protocol name and port. If the string does not contain a vaild IP address, it is set to all 0 by the hostaddress constructor. If no protocol ID can be found in the protocol database, it is set to 0.
Definition at line 480 of file address.h.
References protlib::tsdb::getprotobyname(), protlib::hostaddress::ipv4flag, proto, and set_subtype().
protlib::appladdress::appladdress | ( | const char * | str, | |
const char * | pname, | |||
const char * | portname, | |||
bool * | res = NULL | |||
) | [inline] |
constructor from string, protocol name and port name
Initialize from string, protocol name and port name. If the string does not contain a vaild IP address, it is set to all 0 by the hostaddress constructor. If no protocol ID can be found in the protocol database, it is set to 0. If no port number can be found in the service database, it is set to 0.
Definition at line 504 of file address.h.
References protlib::tsdb::get_portnumber(), protlib::tsdb::getprotobyname(), protlib::hostaddress::ipv4flag, port, prefix, proto, and set_subtype().
virtual protlib::appladdress::~appladdress | ( | ) | [inline, virtual] |
size_t protlib::appladdress::get_hash | ( | ) | const [inline, virtual] |
hash function
Reimplemented from protlib::hostaddress.
Definition at line 615 of file address.h.
References protlib::hostaddress::get_hash(), port, and proto.
Referenced by __gnu_cxx::hash< protlib::appladdress >::operator()().
uint16 protlib::appladdress::get_if_index | ( | ) | const [inline] |
get outgoing Interface index
Definition at line 350 of file address.h.
References if_index.
Referenced by protlib::TPoverUDP::udpsend().
uint16 protlib::appladdress::get_ip_ttl | ( | ) | const [inline] |
get IP TTL, if == 0, no IP TTL should be set
Definition at line 310 of file address.h.
References ip_ttl.
Referenced by protlib::TPoverUDP::udpsend().
port_t protlib::appladdress::get_port | ( | ) | const [inline] |
get port
Definition at line 571 of file address.h.
References port.
Referenced by ariba::transport::convert(), protlib::TPoverTCP::get_connection_to(), protlib::TPoverTCP::master_listener_thread(), protlib::operator<<(), protlib::TPoverTCP::tcpsend(), and protlib::TPoverUDP::udpsend().
string protlib::appladdress::get_port_name | ( | bool * | res = NULL |
) | const [inline] |
get port name
Definition at line 574 of file address.h.
References protlib::tsdb::get_portname(), port, and proto.
uint8 protlib::appladdress::get_prefix | ( | ) | const [inline] |
protocol_t protlib::appladdress::get_protocol | ( | ) | const [inline] |
string protlib::appladdress::get_protocol_name | ( | bool * | res = NULL |
) | const [inline] |
get protocol name
Definition at line 610 of file address.h.
References protlib::tsdb::getprotobynumber(), and proto.
Referenced by protlib::operator<<().
uint16 protlib::appladdress::get_rao | ( | ) | const [inline] |
void protlib::appladdress::get_sockaddr | ( | struct sockaddr_in6 & | sockaddr | ) | const [inline] |
get sockaddr_in6
Definition at line 622 of file address.h.
References protlib::hostaddress::ipv4flag, protlib::hostaddress::ipv6addr, and port.
Referenced by protlib::TPoverTCP::get_connection_to().
appladdress & protlib::appladdress::operator= | ( | const appladdress & | app | ) | [inline] |
bool protlib::appladdress::rao_present | ( | ) | const [inline] |
void protlib::appladdress::set_if_index | ( | uint16 | value | ) | [inline] |
void protlib::appladdress::set_ip_ttl | ( | uint16 | ttl | ) | [inline] |
port_t protlib::appladdress::set_port | ( | const string & | pname, | |
bool * | res = NULL | |||
) | [inline] |
set port
Set port and return old value. If the port name is not found in the service database, port is set to 0.
Definition at line 564 of file address.h.
References protlib::tsdb::get_portnumber(), port, and proto.
port_t protlib::appladdress::set_port | ( | const char * | pname, | |
bool * | res = NULL | |||
) | [inline] |
set port
Set port and return old value. If the port name is not found in the service database, port is set to 0.
Definition at line 554 of file address.h.
References protlib::tsdb::get_portnumber(), port, and proto.
set port
are they equivalent virtual bool equiv(const appladdress& h) const { return hostaddress::equiv(h); }
Set port and return old value.
Definition at line 542 of file address.h.
References port.
Referenced by protlib::TPoverUDP::listener_thread().
void protlib::appladdress::set_prefix | ( | uint8 | prfx | ) | [inline] |
protocol_t protlib::appladdress::set_protocol | ( | const string & | pname, | |
bool * | res = NULL | |||
) | [inline] |
set protocol by name
Set protocol ID and return old value. If no protocol ID can be found in the protocol database, it is set to 0.
Definition at line 600 of file address.h.
References protlib::tsdb::getprotobyname(), and proto.
protocol_t protlib::appladdress::set_protocol | ( | const char * | pname, | |
bool * | res = NULL | |||
) | [inline] |
set protocol by name
Set protocol ID and return old value. If no protocol ID can be found in the protocol database, it is set to 0.
Definition at line 590 of file address.h.
References protlib::tsdb::getprotobyname(), and proto.
protocol_t protlib::appladdress::set_protocol | ( | protocol_t | p | ) | [inline] |
set protocol by ID
Set protocol ID and return old value.
Definition at line 580 of file address.h.
References proto.
Referenced by protlib::TPoverUDP::listener_thread().
void protlib::appladdress::set_rao | ( | uint16 | value | ) | [inline] |
void protlib::appladdress::set_subtype | ( | bool | ipv4 | ) | [inline, protected, virtual] |
set subtype and IPv4 flag
Set subtype and IPv4 flag. This does NOT clear the outstring buffer. Use clear_ip().
Reimplemented from protlib::hostaddress.
Definition at line 1351 of file address.h.
References protlib::address::IPv4ApplAddress, protlib::hostaddress::ipv4flag, protlib::address::IPv6ApplAddress, and protlib::address::subtype.
Referenced by appladdress().
void protlib::appladdress::unset_if_index | ( | ) | [inline] |
void protlib::appladdress::unset_ip_ttl | ( | ) | [inline] |
void protlib::appladdress::unset_rao | ( | ) | [inline] |
uint16 protlib::appladdress::if_index [private] |
Definition at line 372 of file address.h.
Referenced by get_if_index(), operator=(), set_if_index(), and unset_if_index().
uint16 protlib::appladdress::ip_ttl [private] |
Definition at line 370 of file address.h.
Referenced by get_ip_ttl(), operator=(), set_ip_ttl(), and unset_ip_ttl().
port_t protlib::appladdress::port [private] |
Definition at line 366 of file address.h.
Referenced by appladdress(), get_hash(), get_port(), get_port_name(), get_sockaddr(), operator=(), operator==(), and set_port().
uint8 protlib::appladdress::prefix [private] |
Definition at line 367 of file address.h.
Referenced by appladdress(), get_prefix(), operator=(), and set_prefix().
protocol_t protlib::appladdress::proto [private] |
Definition at line 365 of file address.h.
Referenced by appladdress(), get_hash(), get_port_name(), get_protocol(), get_protocol_name(), operator=(), operator==(), set_port(), and set_protocol().
uint16 protlib::appladdress::rao [private] |
Definition at line 369 of file address.h.
Referenced by get_rao(), operator=(), set_rao(), and unset_rao().
bool protlib::appladdress::rao_presence [private] |
Definition at line 371 of file address.h.
Referenced by operator=(), rao_present(), set_rao(), and unset_rao().