#include <time.h>
#include "../../str.h"
#include "../../sr_module.h"


Go to the source code of this file.
Functions | |
| int | convertStrToCharString (str *strToConvert, char **copiedString) |
| char * | convertTMToSNMPDateAndTime (struct tm *timeStructure) |
| int | get_statistic (char *statName) |
| int | stringHandlerSanityCheck (modparam_t type, void *val, char *parameterName) |
This file was created to group together utility functions that were useful throughout the SNMPStats module, without belonging to any file in particular.
Definition in file utilities.h.
| int convertStrToCharString | ( | str * | strToConvert, | |
| char ** | copiedString | |||
| ) |
This function copies an OpenSER "str" datatype into a '\0' terminated char* string.
Definition at line 57 of file utilities.c.
References _str::len, NULL, _str::s, and shm_malloc().
Referenced by handleContactCallbacks().
| char* convertTMToSNMPDateAndTime | ( | struct tm * | timeStructure | ) |
Returns a pointer to an SNMP DateAndTime OCTET STRING representation of the time structure. Note that the pointer is to static data, so it shouldn't be counted on to be around if this function is called again.
Definition at line 127 of file utilities.c.
Referenced by openserSIPContactTable_get_value().
| int get_statistic | ( | char * | statName | ) |
This function is a wrapper around the standard statistic framework. It will return the value of the statistic denoted with statName, or zero if the statistic was not found.
Definition at line 104 of file utilities.c.
References get_stat, get_stat_val, _str::len, LM_INFO, and _str::s.
Referenced by check_dialog_alarm(), handle_openserCurNumDialogs(), handle_openserCurNumDialogsInProgress(), handle_openserCurNumDialogsInSetup(), handle_openserDialogUsageState(), handle_openserSIPCurrentTransactions(), handle_openserSIPNumProxyRequireFailures(), handle_openserSIPNumUnsupportedMethods(), handle_openserSIPNumUnsupportedUris(), handle_openserSIPOtherwiseDiscardedMsgs(), handle_openserSIPRegAcceptedRegistrations(), handle_openserSIPRegCurrentUsers(), handle_openserSIPRegDfltRegActiveInterval(), handle_openserSIPRegMaxContactExpiryDuration(), handle_openserSIPRegRejectedRegistrations(), handle_openserSIPSummaryInRequests(), handle_openserSIPSummaryInResponses(), handle_openserSIPSummaryOutRequests(), handle_openserSIPSummaryOutResponses(), handle_openserSIPSummaryTotalTransactions(), and handle_openserTotalNumFailedDialogSetups().
| int stringHandlerSanityCheck | ( | modparam_t | type, | |
| void * | val, | |||
| char * | parameterName | |||
| ) |
Performs sanity checks on the parameters passed to a string configuration file parameter handler.
Silently returns 1 if the supplied parameters are sane. Otherwise, an error message is logged for parameterName, and 0 returned.
Definition at line 76 of file utilities.c.
References LM_ERR, and STR_PARAM.
Referenced by handleSipEntityType(), set_snmp_community(), and set_snmpget_path().
1.5.6