Main Page | Modules | Data Structures | File List | Data Fields | Globals

# callbacks.c File Reference

## Detailed Description

IPS callback API's.

These are the functions that IPS makes available to installed Hooks. You can call these functions directly from your hook functions.

Revision
  1.1

Author:
  Harald Eilertsen (haraldei@anduin.net)

## Functions

IPSBOOL IPSCALL | IpsGetValue (PIPSHOOKINFO pHookInfo, int type, char *ident, char *buf, int size)
| Retreive a value from IPS.
IPSBOOL IPSCALL | IpsSetValue (PIPSHOOKINFO pHookInfo, int type, char *ident, char *text)
| Set a value in IPS.
IPSBOOL IPSCALL | IpsSend (PIPSHOOKINFO pHookInfo, void *buf, int size)
| Send data to client.
IPSBOOL IPSCALL | IpsRecv (PIPSHOOKINFO pHookInfo, void *buf, int size)
| Receive data from client.
IPSBOOL IPSCALL | IpsLog (PIPSHOOKINFO pHookInfo, unsigned code, int level, char *text)
| Add a message to the logs.

## Function Documentation

IPSBOOL IPSCALL IpsGetValue | ( | PIPSHOOKINFO | pHookInfo,
|  | int | type,
|  | char * | ident,
|  | char * | buf,
|  | int | size
| ) |

| Retreive a value from IPS.

Parameters:

  pHookInfo | IN Pointer to IPS Hook information.
  type | IN Type of value requested. (See Types of values)
  ident | IN A string that identifies the value.
  buf | OUT Pointer to a buffer to receive the requested value.
  size | IN Size of supplied buffer.

Returns:
  TRUE if the value was found, FALSE otherwise.

IPSBOOL IPSCALL IpsSetValue | ( | PIPSHOOKINFO | pHookInfo,
|  | int | type,
|  | char * | ident,
|  | char * | text
| ) |

| Set a value in IPS.

Parameters:

  pHookInfo | IN Pointer to IPS Hook information.
  type | IN Type of value requested.
  ident | IN A string that identifies the value.
  text | IN Pointer to zero terminated string to assign the value.

Returns:
  TRUE if the value was set, FALSE if an error occured.

IPSBOOL IPSCALL IpsSend | ( | PIPSHOOKINFO | pHookInfo,
|  | void * | buf,
|  | int | size
| ) |

| Send data to client. This function sends data to the client using the connection set up by IPS.

Parameters:

  pHookInfo | IN Pointer to IPS Hook information.
  buf | IN Pointer to buffer containing data to send.
  size | IN Size of supplied buffer.

Returns:
  TRUE if data was successfully sent, FALSE otherwise.

IPSBOOL IPSCALL IpsRecv | ( | PIPSHOOKINFO | pHookInfo,
|  | void * | buf,
|  | int | size
| ) |

| Receive data from client. This function is not yet implemented.

Parameters:

  pHookInfo | IN Pointer to IPS Hook information.
  buf | OUT Pointer to buffer to receive data to.
  size | IN Size of supplied buffer.

Returns:
  TRUE if data was successfully received, FALSE otherwise.

IPSBOOL IPSCALL IpsLog | ( | PIPSHOOKINFO | pHookInfo,
|  | unsigned | code,
|  | int | level,
|  | char * | text
| ) |

| Add a message to the logs. This functin will write the supplied message to one or more of the IPS log-files. Which log file the message is written to may depend on the `code` param, as well as the session where `Log` is called.

Parameters:

  pHookInfo | IN Pointer to IPS Hook information.
  code | IN Logging code. (See Logging codes)
  level | IN Level of the message, used by LogLevel to filter messages based on log level.
  text | IN Zero terminated ascii string to append to the log.

Returns:
  TRUE on success, FALSE on failure.