#include <address_service.h>
Public Member Functions | |
| address_service (kernel::module &module) | |
| virtual | ~address_service () |
| void | parse_addresses (const std::string &addresses, bool default_value_is_host, const std::string &default_value, const struct addrinfo &address_options) |
| void | lookup_addresses (const std::string &host, const std::string &port, const struct addrinfo &address_options) |
| virtual bool | add_addresses (const struct addrinfo *addresses)=0 |
Protected Attributes | |
| kernel::module & | _module |
Private Member Functions | |
| address_service (const address_service &) | |
| address_service & | operator= (const address_service &) |
Private Attributes | |
| struct addrinfo * | _addresses |
This class parses IP address lists for other protocol modules like TCP and UDP.
Definition at line 51 of file address_service.h.
| scalestack::network::ip::address_service::address_service | ( | kernel::module & | module | ) |
Definition at line 46 of file address_service.cc.
| scalestack::network::ip::address_service::~address_service | ( | ) | [virtual] |
Definition at line 52 of file address_service.cc.
| scalestack::network::ip::address_service::address_service | ( | const address_service & | ) | [private] |
Don't allow copying of objects.
| void scalestack::network::ip::address_service::parse_addresses | ( | const std::string & | addresses, | |
| bool | default_value_is_host, | |||
| const std::string & | default_value, | |||
| const struct addrinfo & | address_options | |||
| ) |
Parse a string containing a list of addresses. For each pair found, lookup_addresses() is called. The list will be a simple comma separated [HOST][:PORT]... pair. For example, the string:
10.0.0.1:12345,:12346
Would parse as two different addresses, one with a specific IP address and one without (no hostname means INADDR_ANY and is usually the default for listening sockets that should bind to all interfaces).
| [in] | addresses | List of addresses to parse. |
| [in] | default_value_is_host | Whether the default value is a host or port. |
| [in] | default_value | The default host or port, depending on what default_value_is_host is set to. |
| [in] | address_options | Options to use when looking up the addresses. |
Definition at line 58 of file address_service.cc.
| void scalestack::network::ip::address_service::lookup_addresses | ( | const std::string & | host, | |
| const std::string & | port, | |||
| const struct addrinfo & | address_options | |||
| ) |
Lookup a host:port pair and call add_addresses() with the result.
| [in] | host | Host to use in lookup. |
| [in] | port | Port to use in lookup. |
| [in] | address_options | Options to use when looking up the addresses. |
Definition at line 89 of file address_service.cc.
| virtual bool scalestack::network::ip::address_service::add_addresses | ( | const struct addrinfo * | addresses | ) | [pure virtual] |
Method that gets called from lookup_addresses() with the list of addresses in the form of addrinfo structs (as getaddrinfo() returns).
| [in] | addresses | List of addresses found. |
Implemented in scalestack::network::ip::tcp::connection_address_service, scalestack::network::ip::tcp::listener_address_service, and scalestack::network::ip::udp::socket_address_service.
| address_service& scalestack::network::ip::address_service::operator= | ( | const address_service & | ) | [private] |
Don't allow assignment of objects.
Definition at line 105 of file address_service.h.
struct addrinfo* scalestack::network::ip::address_service::_addresses [private] |
Definition at line 121 of file address_service.h.
1.6.3