Rudiments
|
Inherits object.
Public Member Functions | |
protocolentry () | |
~protocolentry () | |
bool | open (const char *protocolname) |
bool | open (int32_t number) |
const char * | getName () |
const char *const * | getAliasList () |
int32_t | getNumber () |
Public Member Functions inherited from object | |
virtual | ~object () |
Static Public Member Functions | |
static int32_t | getNumber (const char *protocolname) |
static char * | getName (int32_t number) |
static bool | getNeedsMutex () |
static void | setMutex (threadmutex *mtx) |
The protocolentry class provides methods for retrieving entries from the protocol file (/etc/protocols on unix).
protocolentry::protocolentry | ( | ) |
Creates an instance of the protocolentry class.
protocolentry::~protocolentry | ( | ) |
Deletes this instance of the protocolentry class.
const char* const* protocolentry::getAliasList | ( | ) |
Returns a NULL-terminated list of aliases for the protocol entry.
const char* protocolentry::getName | ( | ) |
Returns the name of the protocol entry.
|
static |
Convenience method. Returns the name of the protocol associated with "number".
Note that the return value is allocated internally and returned. The calling program must free the buffer.
Returns NULL if an error occurred or if "number" is invalid.
|
static |
Returns true if this class needs a mutex to operate safely in a threaded environment and false otherwise.
int32_t protocolentry::getNumber | ( | ) |
Returns the number associated with the protocol entry.
|
static |
Convenience method. Returns the number associated with "protocolname".
Returns -1 if an error occurred or if "protocolname" is invalid.
bool protocolentry::open | ( | const char * | protocolname | ) |
Opens a protocol entry by name. Returns true on success and false on failure.
bool protocolentry::open | ( | int32_t | number | ) |
Opens a protocol entry by number. Returns true on success and false on failure.
|
static |
Allows you to supply a mutex is the class needs it. (see getNeedsMutex()). If your application is not multithreaded, then there is no need to supply a mutex.