![]() |
Classes | |
class | protlib::tsdb |
Thread-safe DB. More... | |
Namespaces | |
namespace | protlib |
Functions | |
static void | protlib::tsdb::init (bool noresolving=false) |
initialize netdb | |
static void | protlib::tsdb::end () |
cleanup netdb resources | |
static uint32 | protlib::tsdb::get_new_id32 () |
get new 32bit-ID | |
static uint64 | protlib::tsdb::get_new_id64 () |
get new 64bit-ID | |
static string | protlib::tsdb::getprotobynumber (protocol_t proto, bool *res=NULL) |
get protocol name by number | |
static protocol_t | protlib::tsdb::getprotobyname (const string &pname, bool *res=NULL) |
get protocol number by name | |
static protocol_t | protlib::tsdb::getprotobyname (const char *pname, bool *res=NULL) |
get protocol number by name | |
static string | protlib::tsdb::get_username (uid_t uid, bool *res=NULL) |
get user name | |
static uid_t | protlib::tsdb::get_userid (const char *uname, bool *res=NULL) |
get user ID | |
static uid_t | protlib::tsdb::get_userid (const string &uname, bool *res=NULL) |
get user ID | |
static string | protlib::tsdb::get_portname (port_t port, protocol_t prot, bool *res=NULL) |
get port name | |
static port_t | protlib::tsdb::get_portnumber (const char *pname, protocol_t prot, bool *res=NULL) |
get port number | |
static port_t | protlib::tsdb::get_portnumber (const string &pname, protocol_t prot, bool *res=NULL) |
get port number | |
static string | protlib::tsdb::get_hostname (const struct sockaddr *sa, bool *res) |
lookup host name | |
static string | protlib::tsdb::get_hostname (const in_addr &in, bool *res=NULL) |
static string | protlib::tsdb::get_hostname (const in6_addr &in, bool *res=NULL) |
Variables | |
static uint32 | protlib::tsdb::id32 = 1 |
last used IDs | |
static uint64 | protlib::tsdb::id64 = 1 |
static bool | protlib::tsdb::is_init = false |
init state | |
static bool | protlib::tsdb::resolvenames = true |
enable/disable name resolving via DNS | |
static pthread_mutex_t | protlib::tsdb::mutex |
netdb mutex | |
static protocol_t | protlib::tsdb::udp_id = 17 |
static protocol_t | protlib::tsdb::tcp_id = 6 |
static protocol_t | protlib::tsdb::sctp_id = 132 |
void protlib::tsdb::end | ( | ) | [static, inherited] |
cleanup netdb resources
Definition at line 94 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by ariba::transport::tcpip::stop().
string protlib::tsdb::get_hostname | ( | const in6_addr & | in, | |
bool * | res = NULL | |||
) | [static, inherited] |
lookup of hostname for ipv6 address
in | ipv6 address structure | |
res | returns true if name lookup was successful, otherwise false |
Definition at line 344 of file threadsafe_db.cpp.
References protlib::tsdb::get_hostname().
string protlib::tsdb::get_hostname | ( | const in_addr & | in, | |
bool * | res = NULL | |||
) | [static, inherited] |
lookup of hostname for an ipv4 address
in | ipv4 address structure | |
res | returns true if name lookup was successful, otherwise false |
Definition at line 326 of file threadsafe_db.cpp.
References protlib::tsdb::get_hostname().
string protlib::tsdb::get_hostname | ( | const struct sockaddr * | sa, | |
bool * | res | |||
) | [static, inherited] |
lookup host name
Definition at line 267 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::log::INFO_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, protlib::tsdb::mutex, and protlib::tsdb::resolvenames.
Referenced by protlib::hostaddress::get_host_name(), and protlib::tsdb::get_hostname().
uint32 protlib::tsdb::get_new_id32 | ( | ) | [static, inherited] |
get new 32bit-ID
Definition at line 103 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::id32, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
uint64 protlib::tsdb::get_new_id64 | ( | ) | [static, inherited] |
get new 64bit-ID
Definition at line 115 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::id64, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::message::new_id().
string protlib::tsdb::get_portname | ( | port_t | port, | |
protocol_t | prot, | |||
bool * | res = NULL | |||
) | [static, inherited] |
get port name
Definition at line 212 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::getprotobynumber(), protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::appladdress::get_port_name().
port_t protlib::tsdb::get_portnumber | ( | const string & | pname, | |
protocol_t | prot, | |||
bool * | res = NULL | |||
) | [static, inherited] |
get port number
Definition at line 261 of file threadsafe_db.cpp.
References protlib::tsdb::get_portnumber().
port_t protlib::tsdb::get_portnumber | ( | const char * | pname, | |
protocol_t | prot, | |||
bool * | res = NULL | |||
) | [static, inherited] |
get port number
Definition at line 236 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::getprotobynumber(), protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::appladdress::appladdress(), protlib::tsdb::get_portnumber(), and protlib::appladdress::set_port().
uid_t protlib::tsdb::get_userid | ( | const string & | uname, | |
bool * | res = NULL | |||
) | [static, inherited] |
get user ID
Definition at line 208 of file threadsafe_db.cpp.
References protlib::tsdb::get_userid().
uid_t protlib::tsdb::get_userid | ( | const char * | uname, | |
bool * | res = NULL | |||
) | [static, inherited] |
get user ID
Definition at line 190 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::tsdb::get_userid().
string protlib::tsdb::get_username | ( | uid_t | uid, | |
bool * | res = NULL | |||
) | [static, inherited] |
get user name
Definition at line 173 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::setuid::init().
protocol_t protlib::tsdb::getprotobyname | ( | const char * | pname, | |
bool * | res = NULL | |||
) | [static, inherited] |
get protocol number by name
Definition at line 155 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::getprotobyname(), protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
protocol_t protlib::tsdb::getprotobyname | ( | const string & | pname, | |
bool * | res = NULL | |||
) | [static, inherited] |
get protocol number by name
Definition at line 151 of file threadsafe_db.cpp.
Referenced by protlib::appladdress::appladdress(), protlib::tsdb::getprotobyname(), protlib::tsdb::init(), and protlib::appladdress::set_protocol().
string protlib::tsdb::getprotobynumber | ( | protocol_t | proto, | |
bool * | res = NULL | |||
) | [static, inherited] |
get protocol name by number
Definition at line 127 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, and protlib::tsdb::mutex.
Referenced by protlib::tsdb::get_portname(), protlib::tsdb::get_portnumber(), and protlib::appladdress::get_protocol_name().
void protlib::tsdb::init | ( | bool | noresolving = false |
) | [static, inherited] |
initialize netdb
Definition at line 73 of file threadsafe_db.cpp.
References protlib::log::ERROR_LOG, protlib::tsdb::getprotobyname(), protlib::log::INFO_LOG, protlib::tsdb::is_init, Log, protlib::log::LOG_NORMAL, protlib::tsdb::mutex, protlib::tsdb::resolvenames, protlib::tsdb::sctp_id, protlib::tsdb::tcp_id, and protlib::tsdb::udp_id.
Referenced by ariba::transport::tcpip::start().
uint32 protlib::tsdb::id32 = 1 [static, private, inherited] |
last used IDs
Definition at line 70 of file threadsafe_db.h.
Referenced by protlib::tsdb::get_new_id32().
uint64 protlib::tsdb::id64 = 1 [static, private, inherited] |
bool protlib::tsdb::is_init = false [static, private, inherited] |
init state
Definition at line 62 of file threadsafe_db.h.
Referenced by protlib::tsdb::end(), protlib::tsdb::get_hostname(), protlib::tsdb::get_new_id32(), protlib::tsdb::get_new_id64(), protlib::tsdb::get_portname(), protlib::tsdb::get_portnumber(), protlib::tsdb::get_userid(), protlib::tsdb::get_username(), protlib::tsdb::getprotobyname(), protlib::tsdb::getprotobynumber(), and protlib::tsdb::init().
pthread_mutex_t protlib::tsdb::mutex [static, private, inherited] |
Initial value:
PTHREAD_MUTEX_INITIALIZER
Definition at line 67 of file threadsafe_db.h.
Referenced by protlib::tsdb::end(), protlib::tsdb::get_hostname(), protlib::tsdb::get_new_id32(), protlib::tsdb::get_new_id64(), protlib::tsdb::get_portname(), protlib::tsdb::get_portnumber(), protlib::tsdb::get_userid(), protlib::tsdb::get_username(), protlib::tsdb::getprotobyname(), protlib::tsdb::getprotobynumber(), and protlib::tsdb::init().
bool protlib::tsdb::resolvenames = true [static, private, inherited] |
enable/disable name resolving via DNS
Definition at line 64 of file threadsafe_db.h.
Referenced by protlib::tsdb::get_hostname(), and protlib::tsdb::init().
protocol_t protlib::tsdb::sctp_id = 132 [static, private, inherited] |
Definition at line 77 of file threadsafe_db.h.
Referenced by protlib::tsdb::get_sctp_id(), and protlib::tsdb::init().
protocol_t protlib::tsdb::tcp_id = 6 [static, private, inherited] |
Definition at line 76 of file threadsafe_db.h.
Referenced by protlib::tsdb::get_tcp_id(), and protlib::tsdb::init().
protocol_t protlib::tsdb::udp_id = 17 [static, private, inherited] |
Definition at line 75 of file threadsafe_db.h.
Referenced by protlib::tsdb::get_udp_id(), and protlib::tsdb::init().