E-MailRelay
|
Represents a set of listening inputs which can be file-descriptor, interface or network address. More...
#include <glisteners.h>
Public Member Functions | |
Listeners (const Interfaces &, const G::StringArray &listener_spec_list, unsigned int port) | |
Constructor. More... | |
bool | defunct () const |
Returns true if no inputs and static. More... | |
bool | idle () const |
Returns true if no inputs but some interfaces might come up. More... | |
bool | hasBad () const |
Returns true if one or more inputs are invalid. More... | |
std::string | badName () const |
Returns the first invalid input. More... | |
bool | hasEmpties () const |
Returns true if some named interfaces have no addresses. More... | |
std::string | logEmpties () const |
Returns a log-line snippet for hasEmpties(). More... | |
bool | noUpdates () const |
Returns true if some inputs are interfaces but GNet::Interfaces is not active(). More... | |
const std::vector< int > & | fds () const |
Exposes the list of fd inputs. More... | |
const std::vector< Address > & | fixed () const |
Exposes the list of address inputs. More... | |
const std::vector< Address > & | dynamic () const |
Exposes the list of interface addresses. More... | |
Represents a set of listening inputs which can be file-descriptor, interface or network address.
Definition at line 41 of file glisteners.h.
GNet::Listeners::Listeners | ( | const Interfaces & | if_, |
const G::StringArray & | listener_spec_list, | ||
unsigned int | port | ||
) |
Constructor.
The specification strings can be like "fd#3" for a file descriptor, "127.0.0.1" for a fixed address, or "ppp0-ipv4" for an interface. If the specification list is empty then the two fixed wildcard addresses are added.
Definition at line 27 of file glisteners.cpp.
std::string GNet::Listeners::badName | ( | ) | const |
Returns the first invalid input.
Definition at line 135 of file glisteners.cpp.
bool GNet::Listeners::defunct | ( | ) | const |
Returns true if no inputs and static.
Definition at line 106 of file glisteners.cpp.
const std::vector< GNet::Address > & GNet::Listeners::dynamic | ( | ) | const |
Exposes the list of interface addresses.
Definition at line 160 of file glisteners.cpp.
const std::vector< int > & GNet::Listeners::fds | ( | ) | const |
Exposes the list of fd inputs.
Definition at line 150 of file glisteners.cpp.
const std::vector< GNet::Address > & GNet::Listeners::fixed | ( | ) | const |
Exposes the list of address inputs.
Definition at line 155 of file glisteners.cpp.
bool GNet::Listeners::hasBad | ( | ) | const |
Returns true if one or more inputs are invalid.
Definition at line 130 of file glisteners.cpp.
bool GNet::Listeners::hasEmpties | ( | ) | const |
Returns true if some named interfaces have no addresses.
Definition at line 140 of file glisteners.cpp.
bool GNet::Listeners::idle | ( | ) | const |
Returns true if no inputs but some interfaces might come up.
Definition at line 111 of file glisteners.cpp.
std::string GNet::Listeners::logEmpties | ( | ) | const |
Returns a log-line snippet for hasEmpties().
Definition at line 145 of file glisteners.cpp.
bool GNet::Listeners::noUpdates | ( | ) | const |
Returns true if some inputs are interfaces but GNet::Interfaces is not active().
Definition at line 116 of file glisteners.cpp.