utilities.h File Reference

SNMP statistic module, utilities. More...

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

Include dependency graph for utilities.h:

This graph shows which files directly or indirectly include this file:

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)


Detailed Description

SNMP statistic module, utilities.

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.


Function Documentation

int convertStrToCharString ( str strToConvert,
char **  copiedString 
)

This function copies an OpenSER "str" datatype into a '\0' terminated char* string.

Note:
Make sure to free the memory allocated to *copiedString, when you no longer have any use for it. (It is allocated with shm_malloc(), so make sure to deallocate it with shm_free())

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  ) 

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().


Generated on Thu May 24 22:00:46 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6