| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- File List
- File Members

# utils.h File Reference

## Detailed Description

This file contains the declarations of some helper methods for ApMon.

Definition in file utils.h.

`#include <stdexcept>`
`#include <ctype.h>`

Include dependency graph for utils.h:

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

Go to the source code of this file.

## Namespaces
namespace | apmon_utils
## Defines
#define | FATAL 0
| Logging level with minimum number of messages.
#define | WARNING 1
| Intermediate logging level.
#define | INFO 2
| Intermediate logging level.
#define | FINE 3
| Logging level with detailed information.
#define | DEBUG 4
| Logging level for debugging.
## Functions
bool | apmon_utils::urlModified (char *url, char *lastModified) throw (runtime_error)
| Returns true if the page with the specified URL was modified since the last check.
int | apmon_utils::httpRequest (char *url, char *reqType, char *temp_filename) throw (runtime_error)
| Performs a HTTP request and puts the result into a temporary file.
char * | apmon_utils::findIP (char *address) throw (runtime_error)
| If "address" is a hostname, it returns the corresponding IP address; if "address" is an IP address, it just returns a copy of the address.
void | apmon_utils::parse_URL (char *url, char *hostname, int *port, char *identifier) throw (runtime_error)
| Parses an URL and determines the hostname, the port and the file name.
void | apmon_utils::freeMat (char **mat, int nRows)
| Frees the memory for a 2-dimensional character array.
char * | apmon_utils::trimString (char *s)
| Removes the leading and trailing white spaces from a string and puts the result into a malloc'ed string.
int | apmon_utils::xdrSize (int type, char *value)
| Determines the size of the XDR representation for a data item.
int | apmon_utils::sizeEval (int type, char *value)
| Determines the size of a data item.
void | apmon_utils::logParameters (int level, int nParams, char **paramNames, int *valueTypes, char **paramValues)
| Logs the parameters included in a datagram.
bool | apmon_utils::isPrivateAddress (char *addr)
| Verifies whether an IP address is private.
int | apmon_utils::getVectIndex (char *item, char **vect, int vectDim)
| Finds the index of a string in a string array.
void | apmon_utils::logger (int msgLevel, const char *msg, int newLevel=-1)
| If the newLevel parameter is not specified, log the message given as argument if the current logging level is greater than or equal to msgLevel.

## Define Documentation

#define DEBUG 4

Logging level for debugging.

Definition at line 56 of file utils.h.

Referenced by Message::decodeFormat(), apmon_mon_utils::getChildren(), and ApMon::shouldSend().

#define FATAL 0

Logging level with minimum number of messages.

Definition at line 52 of file utils.h.

Referenced by ApMon::arrayInit(), Message::decodeFormat(), and ApMon::initMonitoring().

#define FINE 3

Logging level with detailed information.

Definition at line 55 of file utils.h.

Referenced by ApMon::arrayInit(), ProcUtils::countOpenFiles(), and ApMon::sendTimedParameters().

#define INFO 2

Intermediate logging level.

Definition at line 54 of file utils.h.

Referenced by ApMon::arrayInit(), bkTask(), Message::decodeFormat(), apmon_utils::httpRequest(), ApMon::initialize(), ApMon::initMonitoring(), ApMon::loadFile(), apmon_utils::logger(), ApMon::sendGeneralInfo(), ApMon::sendJobInfo(), ApMon::sendSysInfo(), ApMon::setBackgroundThread(), ApMon::setConfRecheck(), ApMon::setGenMonitoring(), ApMon::setJobMonitoring(), and ApMon::setSysMonitoring().

#define WARNING 1

Intermediate logging level.

Definition at line 53 of file utils.h.

Referenced by ApMon::arrayInit(), bkTask(), Message::decodeFormat(), ApMon::encodeParams(), ProcUtils::getNetInfo(), ProcUtils::getNetstatInfo(), ApMon::initialize(), ApMon::initMonitoring(), ApMon::parseXApMonLine(), apmon_mon_utils::readJobInfo(), ApMon::sendGeneralInfo(), ApMon::sendJobInfo(), ApMon::sendOneJobInfo(), ApMon::sendSysInfo(), ApMon::setConfRecheck(), ApMon::setLogLevel(), ApMon::updateGeneralInfo(), ApMon::updateJobInfo(), ApMon::updateSysInfo(), and apmon_utils::xdrSize().