#include <ipv4_ip.h>
Public Types | |
typedef ConexusPointer< IP > | pointer |
Class typedef to smart pointer. | |
Public Member Functions | |
virtual | ~IP () throw () |
virtual void | bind () throw ( bind_exception ) |
Binds to the local address. | |
virtual void | bind (const Conexus::Address &a) throw ( bind_exception ) |
Sets the local address to. | |
virtual void | connect () throw ( connect_exception ) |
Connects to the remote address. | |
virtual void | connect (const Address &a) throw ( connect_exception ) |
Sets the remote address to. | |
virtual Address & | local_address () |
Returns the current local address. | |
virtual Address & | remote_address () |
Returns the current remote address. | |
virtual IPAddressInterface & | generic_local_address () |
virtual IPAddressInterface & | generic_remote_address () |
virtual void | set_remote_address (const Address &addr) |
virtual void | set_remote_address (uint32_t addr, uint16_t port) |
virtual void | set_remote_address (const std::string &addr, uint16_t port) |
virtual void | unset_remote_address () |
virtual void | set_local_address (const Address &addr) |
virtual void | set_local_address (uint32_t addr, uint16_t port) |
virtual void | set_local_address (const std::string &addr, uint16_t port) |
Protected Member Functions | |
IP (int type=-1, int protocol=0) | |
Default constructor which sets the socket domain to PF_INET but does not provide a socket type or protocol. | |
virtual void | on_local_address_changed () |
virtual void | on_remote_address_changed () |
void | on_local_address_changed_proxy () |
void | on_remote_address_changed_proxy () |
Protected Attributes | |
Address | m_local_address |
Address | m_remote_address |
bool | m_remote_address_set |
All child classes such as UDP and TCP inherit the association of a local host address from this class as well as the concept of interface association, multicasting capabilities and of course, ports.
This class also stores an internal address object representing a local interface object. All BSD socket API functions (such as bind) that require a sockaddr_in structure will be provided this internal attribute. Therefore, it is the responsibility of children such as UDP and TCP to make the appropriate modifications to this protected attribute.
typedef ConexusPointer<IP> Conexus::IPv4::IP::pointer |
Class typedef to smart pointer.
Reimplemented from Conexus::IP.
Reimplemented in Conexus::IPv4::TCP, Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::SSL::IPv4::TCP, and Conexus::SSL::IPv4::UDP.
Conexus::IPv4::IP::IP | ( | int | type = -1 , |
|
int | protocol = 0 | |||
) | [protected] |
Default constructor which sets the socket domain to PF_INET but does not provide a socket type or protocol.
References m_local_address, m_remote_address, on_local_address_changed_proxy(), on_remote_address_changed_proxy(), and Conexus::IPv4::Address::signal_changed().
Conexus::IPv4::IP::~IP | ( | ) | throw () [virtual] |
Reimplemented from Conexus::IP.
void Conexus::IPv4::IP::bind | ( | const Conexus::Address & | a | ) | throw ( bind_exception ) [virtual] |
Sets the local address to.
a | and binds to the local address. |
Reimplemented from Conexus::Socket.
Reimplemented in Conexus::IPv4::UDP, and Conexus::IPv4::UDPPoset.
References Conexus::Socket::bind().
void Conexus::IPv4::IP::bind | ( | ) | throw ( bind_exception ) [virtual] |
Binds to the local address.
Reimplemented from Conexus::Socket.
Reimplemented in Conexus::IPv4::UDP, and Conexus::IPv4::UDPPoset.
References m_local_address.
Referenced by Conexus::IPv4::UDPPoset::bind(), and Conexus::IPv4::UDP::bind().
void Conexus::IPv4::IP::connect | ( | const Address & | a | ) | throw ( connect_exception ) [virtual] |
Sets the remote address to.
a | and connects to the remote address |
Reimplemented in Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::SSL::IPv4::TCP, and Conexus::SSL::IPv4::UDP.
References Conexus::Socket::connect().
void Conexus::IPv4::IP::connect | ( | ) | throw ( connect_exception ) [virtual] |
Connects to the remote address.
Reimplemented from Conexus::Socket.
Reimplemented in Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::SSL::IPv4::TCP, and Conexus::SSL::IPv4::UDP.
References m_remote_address, and m_remote_address_set.
Referenced by Conexus::IPv4::UDP::connect(), and Conexus::SSL::IPv4::TCP::connect().
IPAddressInterface & Conexus::IPv4::IP::generic_local_address | ( | ) | [virtual] |
IPAddressInterface & Conexus::IPv4::IP::generic_remote_address | ( | ) | [virtual] |
Address & Conexus::IPv4::IP::local_address | ( | ) | [virtual] |
void Conexus::IPv4::IP::on_local_address_changed | ( | ) | [protected, virtual] |
Reimplemented in Conexus::IPv4::TCP, and Conexus::IPv4::UDP.
Referenced by on_local_address_changed_proxy().
void Conexus::IPv4::IP::on_local_address_changed_proxy | ( | ) | [protected] |
void Conexus::IPv4::IP::on_remote_address_changed | ( | ) | [protected, virtual] |
Reimplemented in Conexus::IPv4::TCP, and Conexus::IPv4::UDP.
Referenced by on_remote_address_changed_proxy().
void Conexus::IPv4::IP::on_remote_address_changed_proxy | ( | ) | [protected] |
Address & Conexus::IPv4::IP::remote_address | ( | ) | [virtual] |
void Conexus::IPv4::IP::set_local_address | ( | const std::string & | addr, | |
uint16_t | port | |||
) | [virtual] |
References m_local_address.
void Conexus::IPv4::IP::set_local_address | ( | uint32_t | addr, | |
uint16_t | port | |||
) | [virtual] |
References m_local_address.
void Conexus::IPv4::IP::set_local_address | ( | const Address & | addr | ) | [virtual] |
References m_local_address.
void Conexus::IPv4::IP::set_remote_address | ( | const std::string & | addr, | |
uint16_t | port | |||
) | [virtual] |
References m_remote_address, and m_remote_address_set.
void Conexus::IPv4::IP::set_remote_address | ( | uint32_t | addr, | |
uint16_t | port | |||
) | [virtual] |
References m_remote_address, and m_remote_address_set.
void Conexus::IPv4::IP::set_remote_address | ( | const Address & | addr | ) | [virtual] |
References m_remote_address, and m_remote_address_set.
void Conexus::IPv4::IP::unset_remote_address | ( | ) | [virtual] |
References m_remote_address, and m_remote_address_set.
Address Conexus::IPv4::IP::m_local_address [protected] |
Address Conexus::IPv4::IP::m_remote_address [protected] |
bool Conexus::IPv4::IP::m_remote_address_set [protected] |
Referenced by connect(), on_remote_address_changed_proxy(), set_remote_address(), and unset_remote_address().