#include <ipv4_address.h>
Public Types | |
typedef ConexusPointer< Address > | pointer |
Class scope smart pointer typedef. | |
Public Member Functions | |
Address (uint32_t host=INADDR_ANY, uint16_t port=0) | |
Default constructor, or if parameters are used constructs an address from a numeric address and an optional port number. | |
Address (const std::string &host, uint16_t port=0) | |
Address (const struct sockaddr_in &addr) | |
Constructs from an IPv4 sockaddr. | |
Address (const struct sockaddr_storage &addr) | |
Constructs from a generic sockaddr_storage. | |
Address (const struct sockaddr &addr) | |
Constructs from a generic sockaddr. | |
Address (const IPv6::Address &addr) | |
Constructs from an IPv6 address if the IPv6 address is IPv4 compatible. | |
virtual | ~Address () |
Destructor. | |
uint32_t | host () const |
Returns the IPv4 host. | |
std::string | host_string () const |
Returns the IPv4 host as a string. | |
uint32_t | subnet_mask () const |
Returns the subnet mask associated with this address. | |
std::string | subnet_mask_string () const |
Returns the netmask associated with this address as a string. | |
unsigned | prefix_length () const |
Returns the prefix length of the subnet mask associated with this address. | |
std::string | prefix_length_string () const |
Returns the prefix length of the subnet mask associated with this address as a string. | |
std::string | host_subnet_mask_string () const |
Returns the IPv4 host as an host/subnetmask string. | |
std::string | cidr_host_string () const |
Returns the IPv4 host as a CIDR host/prefixlen string. | |
uint32_t | prefix () const |
Returns the prefix part of this address. | |
std::string | prefix_string () const |
Returns the prefix part of this address as a string. | |
uint32_t | broadcast_address () const |
Returns the broadcast address for this address. | |
std::string | broadcast_address_string () const |
Returns the broadcast address for this address as a string. | |
uint32_t | local_address () const |
Returns the local part of this address. | |
std::string | local_address_string () const |
Returns the local part of this address as a string. | |
uint16_t | port () const |
Returns the port number associated with this address. | |
std::string | port_string () const |
Returns the port number associated with this address as a string. | |
void | set_host (uint32_t host) |
Set the host to the specified value. | |
void | set_host (const std::string &host) |
Sets the address to the specified value. | |
virtual void | set_host (const std::string &host, uint16_t port) |
Sets the host and port to the specified value. | |
void | set_host_subnet_mask (uint32_t host, uint32_t subnet_mask) |
Sets the host to an absolute value with a specified subnet mask. | |
void | set_host_prefix_length (uint32_t host, unsigned prefix_length) |
Sets the host to an absolute value with a specified CIDR prefix length. | |
void | set_subnet_mask (uint32_t subnet_mask) |
Sets the subnet mask to the specified value. | |
void | set_subnet_mask (const std::string &subnet_mask) |
Sets the subnet mask to the specified value. | |
void | set_prefix_length (unsigned prefix_length) |
Sets the prefix length to the specified value. | |
void | set_prefix_length (const std::string &prefix_length) |
Sets the prefix length to the specified value. | |
void | set_port (uint16_t port) |
Sets the port portion of this address. | |
void | set_port (const std::string &port) |
Sets the port to the specified value. | |
bool | is_valid_hostname (const std::string &) const |
Determine whether the provided string is a valid hostname by performing a DNS query. | |
std::string | hostname () const |
Performs a DNS query on the currently set host and returns the hostname string. | |
std::string | servicename () const |
Performs a service name lookup on the currently set port and returns the servicename string. | |
bool | is_private () const |
True if this address specifies a private network. | |
bool | is_reserved () const |
True if this address is a reserved address specified as either 0.0.0.0/16 or class E (11110). | |
bool | is_loopback () const |
True of this address is the loopback address with prefix 127.0.0.1/24. | |
bool | is_broadcast () const |
True if this is a valid broadcast address. | |
bool | is_multicast () const |
True if this is a valid multicast address. | |
bool | is_any () const |
True if this is the any address. | |
socklen_t | sockaddr_size () const |
Overrides the virtual parent method and provides the size in bytes of the underlying sockaddr_in structure. | |
struct sockaddr_in & | sockaddr_in () |
Provides a non-constant reference to the underlying sockaddr_in structure. | |
struct sockaddr_in * | sockaddr_in_ptr () |
Provides a non-constant pointer to the underlying sockaddr_in structure. | |
operator struct sockaddr_in * () | |
Address & | operator= (const Address &other) |
Address & | operator= (const Conexus::Address &other) |
bool | operator== (const Address &other) const |
True if the port and host are the same. | |
virtual sigc::signal< void > & | signal_changed () |
virtual sigc::signal< void > & | signal_host_changed () |
virtual sigc::signal< void > & | signal_port_changed () |
virtual sigc::signal< void > & | signal_prefix_changed () |
virtual bool | is_ipv4 () |
Always true for IPv4::Address. | |
virtual bool | is_ipv6 () |
Never true. | |
Static Public Member Functions | |
static pointer | create (uint32_t host=INADDR_ANY, uint16_t port=0) |
Creates a smart pointer from an host and port number. | |
static pointer | create (const std::string &host, uint16_t port) |
static pointer | create (const struct sockaddr_in &addr) |
Creates a smart pointer from an IPv4 sockaddr_in. | |
static pointer | create (const struct sockaddr_storage &addr) |
Creates a smart pointer from a generic sockaddr_storage. | |
static pointer | create (const struct sockaddr &addr) |
Creates a smart pointer from a generic sockaddr. | |
static pointer | create (const IPv6::Address &ipv6addr) |
Creates a smart pointer from an IPv6 address if the IPv6 address is IPv4 compatible. | |
Protected Attributes | |
uint32_t | m_host |
uint16_t | m_port |
unsigned | m_prefix_length |
Netmask prefix length. | |
sigc::signal< void > | m_signal_host_changed |
sigc::signal< void > | m_signal_port_changed |
sigc::signal< void > | m_signal_prefix_changed |
sigc::signal< void > | m_signal_changed |
Related Functions | |
(Note that these are not member functions.) | |
enum | IPV4_EMBEDDED_TYPE { IPV4_COMPATIBLE, IPV4_MAPPED } |
std::string | host_to_string (uint32_t) |
Convert a host byte order 32-bit host to a string. | |
uint32_t | string_to_host (const std::string &) |
Convert a string to a host byte order 32-bit host. | |
void | string_to_host_prefix (const std::string &, uint32_t &host, int &prefix) |
Convert a string to an host and a prefix length. | |
bool | is_valid_hostname (const std::string &) |
Determine whether the provided string is a valid hostname by performing a DNS query. | |
std::string | host_to_hostname (uint32_t host) throw(address_exception) |
Convert a host byte order 32-bit host to a hostname string. | |
std::string | service_to_servicename (uint16_t service) throw(address_exception) |
Convert a host byte order 16-bit port number to a service name string. | |
uint32_t | hostname_to_host (const std::string &hostname) throw(address_exception) |
Convert a hostname string to a 32-bit host byte order host. | |
uint16_t | servicename_to_service (const std::string &servicename) throw(address_exception) |
Convert a service name string to a 16-bit host byte order port number. | |
bool | validate_subnet_mask (uint32_t subnet_mask) throw() |
Checks to make sure this is a valid subnet mask; i.e. | |
uint32_t | create_subnet_mask (unsigned prefix_length) |
Given a prefix length, return a subnet mask. | |
unsigned | subnet_mask_length (uint32_t subnet_mask) throw() |
Given a CIDR subnet mask, return the number of prefix bits. | |
struct in6_addr | operator& (const struct in6_addr &first, const struct in6_addr &second) |
struct in6_addr | operator| (const struct in6_addr &first, const struct in6_addr &second) |
struct in6_addr | operator^ (const struct in6_addr &first, const struct in6_addr &second) |
struct in6_addr | operator~ (const struct in6_addr &addr) |
struct in6_addr & | operator&= (struct in6_addr &first, const struct in6_addr &second) |
struct in6_addr & | operator|= (struct in6_addr &first, const struct in6_addr &second) |
struct in6_addr & | operator^= (struct in6_addr &first, const struct in6_addr &second) |
bool | operator== (const struct in6_addr &, const struct in6_addr &) |
bool | operator< (const struct in6_addr &, const struct in6_addr &) |
bool | operator!= (const struct in6_addr &, const struct in6_addr &) |
std::string | host_to_string (const struct in6_addr &) |
void | string_to_host_prefix (const std::string &, struct in6_addr &host, int &prefix) |
std::string | host_to_hostname (const struct in6_addr &host) throw(address_exception) |
bool | validate_subnet_mask (const struct in6_addr &subnet_mask) throw() |
This class represents an IPv4 address and includes support for accessing the address as a traditional sockaddr_in (a BSD socket API IPv4 network address C structure).
Host byte order and network byte order: all methods expect parameters and return values in host byte order with the following exception; if you request a sockaddr_in representation of this address, the sockaddr_in C structure will be filled with values that are already in network byte order and ready for use with raw BSD API socket calls.
factory_client.cpp, file_client.cpp, ipv4_multicast_client.cpp, ipv4_udp_client.cpp, ll_client.cpp, ll_server.cpp, and registry_client.cpp.
typedef ConexusPointer<Address> Conexus::IPv4::Address::pointer |
Conexus::IPv4::Address::Address | ( | uint32_t | host = INADDR_ANY , |
|
uint16_t | port = 0 | |||
) |
Default constructor, or if parameters are used constructs an address from a numeric address and an optional port number.
Sets default family to AF_INET.
address | Numeric address in local host byte order. | |
port | Port number in local host byte order. |
References Conexus::Address::m_sockaddr.
Conexus::IPv4::Address::Address | ( | const std::string & | host, | |
uint16_t | port = 0 | |||
) |
References Conexus::Address::m_sockaddr, and set_host().
Conexus::IPv4::Address::Address | ( | const struct sockaddr_in & | addr | ) |
Conexus::IPv4::Address::Address | ( | const struct sockaddr_storage & | addr | ) |
Constructs from a generic sockaddr_storage.
Reimplemented from Conexus::Address.
References m_host, m_port, and Conexus::Address::m_sockaddr.
Conexus::IPv4::Address::Address | ( | const struct sockaddr & | addr | ) |
Conexus::IPv4::Address::Address | ( | const IPv6::Address & | addr | ) |
Constructs from an IPv6 address if the IPv6 address is IPv4 compatible.
References Conexus::Address::m_sockaddr, and set_host().
Conexus::IPv4::Address::~Address | ( | ) | [virtual] |
uint32_t Conexus::IPv4::Address::broadcast_address | ( | ) | const |
Returns the broadcast address for this address.
References host(), and subnet_mask().
Referenced by broadcast_address_string().
std::string Conexus::IPv4::Address::broadcast_address_string | ( | ) | const |
Returns the broadcast address for this address as a string.
References broadcast_address(), and host_to_string().
std::string Conexus::IPv4::Address::cidr_host_string | ( | ) | const [virtual] |
Returns the IPv4 host as a CIDR host/prefixlen string.
Implements Conexus::IPAddressInterface.
References host_string(), and prefix_length_string().
Address::pointer Conexus::IPv4::Address::create | ( | const IPv6::Address & | ipv6addr | ) | [static] |
Creates a smart pointer from an IPv6 address if the IPv6 address is IPv4 compatible.
References Conexus::Address::Address().
Address::pointer Conexus::IPv4::Address::create | ( | const struct sockaddr & | addr | ) | [static] |
Address::pointer Conexus::IPv4::Address::create | ( | const struct sockaddr_storage & | addr | ) | [static] |
Address::pointer Conexus::IPv4::Address::create | ( | const struct sockaddr_in & | addr | ) | [static] |
Address::pointer Conexus::IPv4::Address::create | ( | const std::string & | host, | |
uint16_t | port | |||
) | [static] |
References Conexus::Address::Address().
Address::pointer Conexus::IPv4::Address::create | ( | uint32_t | host = INADDR_ANY , |
|
uint16_t | port = 0 | |||
) | [static] |
uint32_t Conexus::IPv4::Address::host | ( | ) | const |
Returns the IPv4 host.
References m_host.
Referenced by broadcast_address(), local_address(), and prefix().
std::string Conexus::IPv4::Address::host_string | ( | ) | const [virtual] |
Returns the IPv4 host as a string.
Implements Conexus::IPAddressInterface.
References host_to_string(), and m_host.
Referenced by cidr_host_string(), and host_subnet_mask_string().
std::string Conexus::IPv4::Address::host_subnet_mask_string | ( | ) | const [virtual] |
Returns the IPv4 host as an host/subnetmask string.
Implements Conexus::IPAddressInterface.
References host_string(), and subnet_mask_string().
std::string Conexus::IPv4::Address::hostname | ( | ) | const [virtual] |
Performs a DNS query on the currently set host and returns the hostname string.
Implements Conexus::IPAddressInterface.
References host_to_hostname(), and m_host.
bool Conexus::IPv4::Address::is_any | ( | ) | const [virtual] |
bool Conexus::IPv4::Address::is_broadcast | ( | ) | const [virtual] |
True if this is a valid broadcast address.
Reimplemented from Conexus::Address.
References m_host, and subnet_mask().
Referenced by Conexus::IPv4::UDPPoset::add_destination(), and Conexus::IPv4::UDP::bind().
bool Conexus::IPv4::Address::is_ipv4 | ( | ) | [virtual] |
bool Conexus::IPv4::Address::is_ipv6 | ( | ) | [virtual] |
bool Conexus::IPv4::Address::is_loopback | ( | ) | const [virtual] |
True of this address is the loopback address with prefix 127.0.0.1/24.
Implements Conexus::IPAddressInterface.
References m_host.
bool Conexus::IPv4::Address::is_multicast | ( | ) | const [virtual] |
True if this is a valid multicast address.
Implements Conexus::IPAddressInterface.
References m_host.
Referenced by Conexus::IPv4::UDPPoset::add_destination(), Conexus::NSPR::UDP::bind(), Conexus::IPv4::UDP::bind(), Conexus::IPv4::UDP::connect(), Conexus::IPv4::UDP::join(), and Conexus::IPv4::UDP::leave().
bool Conexus::IPv4::Address::is_private | ( | ) | const |
True if this address specifies a private network.
For reference, private networks are defined as:
References m_host.
bool Conexus::IPv4::Address::is_reserved | ( | ) | const |
True if this address is a reserved address specified as either 0.0.0.0/16 or class E (11110).
References m_host.
bool Conexus::IPv4::Address::is_valid_hostname | ( | const std::string & | name | ) | const |
Determine whether the provided string is a valid hostname by performing a DNS query.
References hostname_to_host().
uint32_t Conexus::IPv4::Address::local_address | ( | ) | const |
Returns the local part of this address.
References host(), and subnet_mask().
Referenced by local_address_string().
std::string Conexus::IPv4::Address::local_address_string | ( | ) | const [virtual] |
Returns the local part of this address as a string.
Implements Conexus::IPAddressInterface.
References host_to_string(), and local_address().
Conexus::IPv4::Address::operator struct sockaddr_in * | ( | ) |
References Conexus::Address::m_sockaddr.
Address & Conexus::IPv4::Address::operator= | ( | const Conexus::Address & | other | ) |
bool Conexus::IPv4::Address::operator== | ( | const Address & | other | ) | const |
uint16_t Conexus::IPv4::Address::port | ( | ) | const [virtual] |
Returns the port number associated with this address.
Implements Conexus::IPAddressInterface.
References m_port.
Referenced by Conexus::NSPR::UDP::bind().
std::string Conexus::IPv4::Address::port_string | ( | ) | const [virtual] |
Returns the port number associated with this address as a string.
Implements Conexus::IPAddressInterface.
References m_port.
uint32_t Conexus::IPv4::Address::prefix | ( | ) | const |
Returns the prefix part of this address.
References host(), and subnet_mask().
Referenced by prefix_string(), and set_host().
unsigned Conexus::IPv4::Address::prefix_length | ( | ) | const [virtual] |
Returns the prefix length of the subnet mask associated with this address.
Implements Conexus::IPAddressInterface.
References m_prefix_length.
Referenced by prefix_length_string().
std::string Conexus::IPv4::Address::prefix_length_string | ( | ) | const [virtual] |
Returns the prefix length of the subnet mask associated with this address as a string.
Implements Conexus::IPAddressInterface.
References prefix_length().
Referenced by cidr_host_string().
std::string Conexus::IPv4::Address::prefix_string | ( | ) | const [virtual] |
Returns the prefix part of this address as a string.
Implements Conexus::IPAddressInterface.
References host_to_string(), and prefix().
std::string Conexus::IPv4::Address::servicename | ( | ) | const [virtual] |
Performs a service name lookup on the currently set port and returns the servicename string.
Implements Conexus::IPAddressInterface.
References m_port, and service_to_servicename().
void Conexus::IPv4::Address::set_host | ( | const std::string & | host, | |
uint16_t | port | |||
) | [virtual] |
Sets the host and port to the specified value.
Implements Conexus::IPAddressInterface.
References m_host, m_port, m_prefix_length, m_signal_changed, m_signal_host_changed, m_signal_port_changed, m_signal_prefix_changed, Conexus::Address::m_sockaddr, prefix(), and string_to_host_prefix().
void Conexus::IPv4::Address::set_host | ( | const std::string & | host | ) | [virtual] |
Sets the address to the specified value.
If this is not a numeric specification, a DNS query will be performed. Accepts addresses of the following forms: # aaa.aaa.aaa.aaa[/nnn.nnn.nnn.nnn | /bb][:ppppp | :servicename] # hostname[/nnn.nnn.nnn.nnn | /bb][:ppppp | :servicename] Where:
Implements Conexus::IPAddressInterface.
References m_host, m_prefix_length, m_signal_changed, m_signal_host_changed, m_signal_prefix_changed, Conexus::Address::m_sockaddr, prefix(), and string_to_host_prefix().
void Conexus::IPv4::Address::set_host | ( | uint32_t | host | ) |
Set the host to the specified value.
References m_host, m_signal_changed, m_signal_host_changed, and Conexus::Address::m_sockaddr.
Referenced by Address(), Conexus::NSPR::TCP::TCP(), Conexus::IPv4::TCP::TCP(), Conexus::NSPR::UDP::UDP(), and Conexus::IPv4::UDP::UDP().
void Conexus::IPv4::Address::set_host_prefix_length | ( | uint32_t | host, | |
unsigned | prefix_length | |||
) |
Sets the host to an absolute value with a specified CIDR prefix length.
References m_host, m_prefix_length, m_signal_changed, m_signal_host_changed, m_signal_prefix_changed, and Conexus::Address::m_sockaddr.
void Conexus::IPv4::Address::set_host_subnet_mask | ( | uint32_t | host, | |
uint32_t | subnet_mask | |||
) |
Sets the host to an absolute value with a specified subnet mask.
References m_host, m_prefix_length, m_signal_changed, m_signal_host_changed, m_signal_prefix_changed, Conexus::Address::m_sockaddr, and subnet_mask_length().
void Conexus::IPv4::Address::set_port | ( | const std::string & | port | ) | [virtual] |
Sets the port to the specified value.
Implements Conexus::IPAddressInterface.
References m_port, m_signal_changed, m_signal_port_changed, Conexus::Address::m_sockaddr, and servicename_to_service().
void Conexus::IPv4::Address::set_port | ( | uint16_t | port | ) | [virtual] |
Sets the port portion of this address.
Implements Conexus::IPAddressInterface.
References m_port, m_signal_changed, m_signal_port_changed, and Conexus::Address::m_sockaddr.
Referenced by Conexus::NSPR::TCP::TCP(), Conexus::IPv4::TCP::TCP(), Conexus::NSPR::UDP::UDP(), and Conexus::IPv4::UDP::UDP().
void Conexus::IPv4::Address::set_prefix_length | ( | const std::string & | prefix_length | ) | [virtual] |
Sets the prefix length to the specified value.
Implements Conexus::IPAddressInterface.
References m_prefix_length, m_signal_changed, and m_signal_prefix_changed.
void Conexus::IPv4::Address::set_prefix_length | ( | unsigned | prefix_length | ) | [virtual] |
Sets the prefix length to the specified value.
Implements Conexus::IPAddressInterface.
References m_prefix_length, m_signal_changed, and m_signal_prefix_changed.
Referenced by set_subnet_mask().
void Conexus::IPv4::Address::set_subnet_mask | ( | const std::string & | subnet_mask | ) |
Sets the subnet mask to the specified value.
References set_prefix_length(), string_to_host(), and subnet_mask_length().
void Conexus::IPv4::Address::set_subnet_mask | ( | uint32_t | subnet_mask | ) |
Sets the subnet mask to the specified value.
References set_prefix_length(), and subnet_mask_length().
sigc::signal< void > & Conexus::IPv4::Address::signal_changed | ( | ) | [virtual] |
Implements Conexus::IPAddressInterface.
References m_signal_changed.
Referenced by Conexus::IPv4::IP::IP(), and Conexus::NSPR::Socket::Socket().
sigc::signal< void > & Conexus::IPv4::Address::signal_host_changed | ( | ) | [virtual] |
sigc::signal< void > & Conexus::IPv4::Address::signal_port_changed | ( | ) | [virtual] |
sigc::signal< void > & Conexus::IPv4::Address::signal_prefix_changed | ( | ) | [virtual] |
struct sockaddr_in & Conexus::IPv4::Address::sockaddr_in | ( | ) | [read] |
Provides a non-constant reference to the underlying sockaddr_in structure.
References Conexus::Address::m_sockaddr.
Referenced by Conexus::IPv4::UDP::join(), Conexus::IPv4::UDP::leave(), operator=(), and sockaddr_size().
struct sockaddr_in * Conexus::IPv4::Address::sockaddr_in_ptr | ( | ) | [read] |
Provides a non-constant pointer to the underlying sockaddr_in structure.
References Conexus::Address::m_sockaddr.
socklen_t Conexus::IPv4::Address::sockaddr_size | ( | ) | const [virtual] |
Overrides the virtual parent method and provides the size in bytes of the underlying sockaddr_in structure.
Reimplemented from Conexus::Address.
References sockaddr_in().
uint32_t Conexus::IPv4::Address::subnet_mask | ( | ) | const |
Returns the subnet mask associated with this address.
References create_subnet_mask(), and m_prefix_length.
Referenced by broadcast_address(), is_broadcast(), local_address(), prefix(), and subnet_mask_string().
std::string Conexus::IPv4::Address::subnet_mask_string | ( | ) | const [virtual] |
Returns the netmask associated with this address as a string.
Implements Conexus::IPAddressInterface.
References host_to_string(), and subnet_mask().
Referenced by host_subnet_mask_string().
struct in6_addr create_subnet_mask | ( | unsigned | prefix_length | ) | [related] |
Given a prefix length, return a subnet mask.
Given a prefix length, return a subnet mask.
Referenced by subnet_mask().
std::string host_to_hostname | ( | const struct in6_addr & | host | ) | throw(address_exception) [related] |
Given an host, look up the hostname. Unlike the other functions in this section, this is not quite a thin wrapper around getnameinfo(). This function will try to first look for the name in the IPv6 domain. However, getnameinfo() returns a success on an IPv4 mapped host, but returns the host string rather than the hostname. Therefore, this function checks to see if any ':' characters are present in the returned name and tries an IPv4 lookup to get the IPv4 hostname.
std::string host_to_hostname | ( | uint32_t | host | ) | throw(address_exception) [related] |
std::string host_to_string | ( | const struct in6_addr & | ) | [related] |
std::string host_to_string | ( | uint32_t | ) | [related] |
Convert a host byte order 32-bit host to a string.
Referenced by broadcast_address_string(), host_string(), local_address_string(), prefix_string(), and subnet_mask_string().
struct in6_addr hostname_to_host | ( | const std::string & | hostname | ) | throw(address_exception) [related] |
Convert a hostname string to a 32-bit host byte order host.
Given a hostname, get the IPv6 host. This function will performa a hostname lookup and return either the IPv6 host of the host, or an IPv4 mapped host if an IPv6 host is not available.
Referenced by is_valid_hostname().
enum IPV4_EMBEDDED_TYPE [related] |
bool is_valid_hostname | ( | const std::string & | ) | [related] |
Determine whether the provided string is a valid hostname by performing a DNS query.
Determine whether the provided string is a valid hostname by performing a DNS query.
bool operator!= | ( | const struct in6_addr & | , | |
const struct in6_addr & | ||||
) | [related] |
struct in6_addr operator& | ( | const struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
struct in6_addr & operator&= | ( | struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
bool operator< | ( | const struct in6_addr & | , | |
const struct in6_addr & | ||||
) | [related] |
bool operator== | ( | const struct in6_addr & | , | |
const struct in6_addr & | ||||
) | [related] |
struct in6_addr operator^ | ( | const struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
struct in6_addr & operator^= | ( | struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
struct in6_addr operator| | ( | const struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
struct in6_addr & operator|= | ( | struct in6_addr & | first, | |
const struct in6_addr & | second | |||
) | [related] |
struct in6_addr operator~ | ( | const struct in6_addr & | addr | ) | [related] |
std::string service_to_servicename | ( | uint16_t | service | ) | throw(address_exception) [related] |
Convert a host byte order 16-bit port number to a service name string.
Given a service port number, returns a string name of the service. This is just a very thin convenience wrapper around getnameinfo().
Referenced by servicename().
uint16_t servicename_to_service | ( | const std::string & | servicename | ) | throw(address_exception) [related] |
Convert a service name string to a 16-bit host byte order port number.
Given a service name, returns the port number of the service. This is just a very thin convenience wrapper around getaddrinfo().
Referenced by set_port().
struct in6_addr string_to_host | ( | const std::string & | ) | [related] |
Convert a string to a host byte order 32-bit host.
Given a string, converts to an IPv6 host. This is just a very thin convenience wrapper around inet_pton() for IPv6 addresses.
Referenced by set_subnet_mask().
void string_to_host_prefix | ( | const std::string & | , | |
struct in6_addr & | host, | |||
int & | prefix | |||
) | [related] |
Convert a string to an host and a prefix length
void string_to_host_prefix | ( | const std::string & | , | |
uint32_t & | host, | |||
int & | prefix | |||
) | [related] |
unsigned subnet_mask_length | ( | uint32_t | subnet_mask | ) | throw() [related] |
Given a CIDR subnet mask, return the number of prefix bits.
Referenced by set_host_subnet_mask(), and set_subnet_mask().
bool validate_subnet_mask | ( | const struct in6_addr & | subnet_mask | ) | throw() [related] |
Checks to make sure this is a valid subnet mask; i.e. all 1's followed by all 0's
bool validate_subnet_mask | ( | uint32_t | subnet_mask | ) | throw() [related] |
Checks to make sure this is a valid subnet mask; i.e.
all 1's followed by all 0's
uint32_t Conexus::IPv4::Address::m_host [protected] |
uint16_t Conexus::IPv4::Address::m_port [protected] |
Referenced by Address(), operator=(), operator==(), port(), port_string(), servicename(), set_host(), and set_port().
unsigned Conexus::IPv4::Address::m_prefix_length [protected] |
Netmask prefix length.
Referenced by operator=(), prefix_length(), set_host(), set_host_prefix_length(), set_host_subnet_mask(), set_prefix_length(), and subnet_mask().
sigc::signal<void> Conexus::IPv4::Address::m_signal_changed [protected] |
Referenced by operator=(), set_host(), set_host_prefix_length(), set_host_subnet_mask(), set_port(), set_prefix_length(), and signal_changed().
sigc::signal<void> Conexus::IPv4::Address::m_signal_host_changed [protected] |
Referenced by operator=(), set_host(), set_host_prefix_length(), set_host_subnet_mask(), and signal_host_changed().
sigc::signal<void> Conexus::IPv4::Address::m_signal_port_changed [protected] |
Referenced by operator=(), set_host(), set_port(), and signal_port_changed().
sigc::signal<void> Conexus::IPv4::Address::m_signal_prefix_changed [protected] |
Referenced by operator=(), set_host(), set_host_prefix_length(), set_host_subnet_mask(), set_prefix_length(), and signal_prefix_changed().