Thread-safe DB. More...
#include <source/ariba/utility/transport/tcpip/protlib/threadsafe_db.h>
Static Public Member Functions | |
| static void | init (bool noresolving=false) |
| initialize netdb | |
| static void | end () |
| cleanup netdb resources | |
| static uint32 | get_new_id32 () |
| get new 32bit-ID | |
| static uint64 | get_new_id64 () |
| get new 64bit-ID | |
| static string | getprotobynumber (protocol_t proto, bool *res=NULL) |
| get protocol name by number | |
| static protocol_t | getprotobyname (const string &pname, bool *res=NULL) |
| get protocol number by name | |
| static protocol_t | getprotobyname (const char *pname, bool *res=NULL) |
| get protocol number by name | |
| static protocol_t | get_udp_id () |
| get frequently used protocol numbers | |
| static protocol_t | get_tcp_id () |
| static protocol_t | get_sctp_id () |
| static string | get_username (uid_t uid, bool *res=NULL) |
| get user name | |
| static uid_t | get_userid (const char *uname, bool *res=NULL) |
| get user ID | |
| static uid_t | get_userid (const string &uname, bool *res=NULL) |
| get user ID | |
| static string | get_portname (port_t port, protocol_t prot, bool *res=NULL) |
| get port name | |
| static port_t | get_portnumber (const char *pname, protocol_t prot, bool *res=NULL) |
| get port number | |
| static port_t | get_portnumber (const string &pname, protocol_t prot, bool *res=NULL) |
| get port number | |
| static string | get_hostname (const struct sockaddr *sa, bool *res) |
| lookup host name | |
| static string | get_hostname (const in_addr &in, bool *res=NULL) |
| static string | get_hostname (const in6_addr &in, bool *res=NULL) |
Static Private Attributes | |
| static bool | is_init = false |
| init state | |
| static bool | resolvenames = true |
| enable/disable name resolving via DNS | |
| static pthread_mutex_t | mutex |
| netdb mutex | |
| static uint32 | id32 = 1 |
| last used IDs | |
| static uint64 | id64 = 1 |
| static protocol_t | udp_id = 17 |
| static protocol_t | tcp_id = 6 |
| static protocol_t | sctp_id = 132 |
Thread-safe DB.
This class provides class methods for accessing the protocol database and maybe other services from netdb.h in a thread-safe way.
Definition at line 59 of file threadsafe_db.h.
| static protocol_t protlib::tsdb::get_sctp_id | ( | ) | [inline, static] |
Definition at line 97 of file threadsafe_db.h.
References sctp_id.
| static protocol_t protlib::tsdb::get_tcp_id | ( | ) | [inline, static] |
Definition at line 96 of file threadsafe_db.h.
References tcp_id.
| static protocol_t protlib::tsdb::get_udp_id | ( | ) | [inline, static] |
get frequently used protocol numbers
Definition at line 95 of file threadsafe_db.h.
References udp_id.
1.6.1