Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

inplug.h File Reference

Header for Input Plugins. More...

#include "plugin.h"
#include "packet.h"

Go to the source code of this file.

Functions

int pluginRegister (INPLUG **, ANPLUG **, PROTOPLUG **, OUTPLUG **, int(*DecodeCallback)(PACKET*,PROTO))
 Registration function. More...

int pluginInit (int ct, char **inits)
 Initialise the plugin. More...

int pluginCleanup (int reason)
 Cleanup the plugin. More...

int pluginGetPacket (int iSrc, char *sSrc, PACKET **)
 Gets a packet. More...


Detailed Description

Header for Input Plugins.

Definition in file inplug.h.


Function Documentation

int pluginCleanup ( int reason )
 

Cleanup the plugin.

Parameters:
reason   (int) The reason for the cleanup.

This call should always be made before closing the program, or reinitialising the plugin. It frees all the memory allocated and still held internally (i.e. it doesn't free memory that it has a pointer to but has passed elsewhere). Additionally, files are closed etc.

Definition at line 90 of file rubicon_snort.c.

int pluginGetPacket ( int iSrc,
char * sSrc,
PACKET ** p )
 

Gets a packet.

Parameters:
iSrc   (int) Integer representing which source to select from
sSrc   (char*) String stating which source to get the packet from
p   (PACKET**) Placeholder for the received packet.
Returns:
(int) 1 on success, 0 on failure (due to timeout), -1 on failure due to an error

This function retrieves a packet from whatever source. It must not block. The iSrc variable takes precedence over the sSrc when selecting the input source. If iSrc should be ignored, it's value must be set to -1.

Definition at line 116 of file rubicon_ipq.c.

int pluginInit ( int ct,
char ** inits )
 

Initialise the plugin.

Parameters:
ct   (int) Number of initialisation strings
inits   (char **) Array of ct initialisation strings

Definition at line 73 of file rubicon_snort.c.

int pluginRegister ( INPLUG ** inp,
ANPLUG ** anp,
PROTOPLUG ** protop,
OUTPLUG ** outp,
int(* DecodeCallback)(PACKET *,PROTO) )
 

Registration function.

Parameters:
inp   (INPLUG**) Placeholder for input plugin descriptor
anp   (ANPLUG**) Placeholder for analysis plugin descriptor
protop   (PROTOPLUG**) Placeholder for protocol plugin descriptor
outp   (OUTPLUG**) Placeholder for output plugin descriptor
DecodeCallback   (function ptr) Pointer to generic decode function

This function is called by the main process in order to register the plugin. The function then populates the placeholders for the plugin types it supports, and sets all others to null. The DecodeCallback function is stored in case the plugin ever wants to decode anything.

Definition at line 39 of file rubicon_snort.c.


Generated at Mon Jul 8 15:16:50 2002 for RUBICON by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000