Functions

utilities.c File Reference

SNMP statistic module, utilities. More...

#include <stdlib.h>
#include <string.h>
#include "utilities.h"
#include "../../str.h"
#include "../../locking.h"
#include "../../mem/mem.h"
#include "../../lib/kcore/kstats_wrapper.h"
Include dependency graph for utilities.c:

Go to the source code of this file.

Functions


Detailed Description

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.c.


Function Documentation

int convertStrToCharString ( str strToConvert,
char **  copiedString 
)
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 59 of file utilities.c.

References _str::len, and _str::s.

Referenced by handleContactCallbacks().

Here is the caller graph for this function:

char* convertTMToSNMPDateAndTime ( struct tm *  timeStructure  ) 

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 129 of file utilities.c.

int get_statistic ( char *  statName  ) 

It will return the value of the statistic denoted with statName, or zero if the statistic was not found.

Definition at line 106 of file utilities.c.

References _str::len, and _str::s.

Referenced by check_dialog_alarm().

Here is the caller graph for this function:

int stringHandlerSanityCheck ( modparam_t  type,
void *  val,
char *  parameterName 
)

Performs sanity checks on the parameters passed to a string configuration file parameter handler.

Otherwise, an error message is logged for parameterName, and 0 returned.

Definition at line 78 of file utilities.c.

Referenced by handleSipEntityType(), set_snmp_community(), and set_snmpget_path().

Here is the caller graph for this function: