Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

pcrm.h File Reference

#include "bitop.h"

Go to the source code of this file.

Defines

#define MAX_PORTS   64*1024
#define ANYPORT   -1
#define PRM_GET_FIRST_GROUP_NODE(pg)   (pg->pgHead)
#define PRM_GET_NEXT_GROUP_NODE(rn)   (rn->rnNext)
#define PRM_GETRULE_FROM_NODE(rn)   (rn->rnRuleData)
#define PRM_GET_FIRST_GROUP_NODE_NC(pg)   (pg->pgHeadNC)
#define PRM_GET_NEXT_GROUP_NODE_NC(rn)   (rn->rnNext)

Typedefs

typedef void * RULE_PTR
typedef _not_rule_node_ NOT_RULE_NODE
typedef _rule_node_ RULE_NODE

Functions

PORT_RULE_MAPprmNewMap ()
BYTE_RULE_MAPprmNewByteMap ()
void prmFreeMap (PORT_RULE_MAP *p)
void prmFreeByteMap (BYTE_RULE_MAP *p)
int prmAddRule (PORT_RULE_MAP *p, int dport, int sport, RULE_PTR rd)
int prmAddByteRule (BYTE_RULE_MAP *p, int dport, RULE_PTR rd)
int prmAddRuleUri (PORT_RULE_MAP *p, int dport, int sport, RULE_PTR rd)
int prmAddRuleNC (PORT_RULE_MAP *p, int dport, int sport, RULE_PTR rd)
int prmAddByteRuleNC (BYTE_RULE_MAP *p, int dport, RULE_PTR rd)
void prmAddNotNode (PORT_GROUP *pg, int id)
int prmCompileGroups (PORT_RULE_MAP *p)
int prmCompileByteGroups (BYTE_RULE_MAP *p)
int prmShowStats (PORT_RULE_MAP *p)
int prmShowByteStats (BYTE_RULE_MAP *p)
int prmShowEventStats (PORT_RULE_MAP *p)
int prmShowEventByteStats (BYTE_RULE_MAP *p)
RULE_PTR prmGetFirstRule (PORT_GROUP *pg)
RULE_PTR prmGetNextRule (PORT_GROUP *pg)
RULE_PTR prmGetFirstRuleUri (PORT_GROUP *pg)
RULE_PTR prmGetNextRuleUri (PORT_GROUP *pg)
RULE_PTR prmGetFirstRuleNC (PORT_GROUP *pg)
RULE_PTR prmGetNextRuleNC (PORT_GROUP *pg)
int prmFindRuleGroup (PORT_RULE_MAP *p, int dport, int sport, PORT_GROUP **src, PORT_GROUP **dst, PORT_GROUP **gen)
int prmFindByteRuleGroup (BYTE_RULE_MAP *p, int dport, PORT_GROUP **dst, PORT_GROUP **gen)
PORT_GROUPprmFindDstRuleGroup (PORT_RULE_MAP *p, int port)
PORT_GROUPprmFindSrcRuleGroup (PORT_RULE_MAP *p, int port)
PORT_GROUPprmFindByteRuleGroupUnique (BYTE_RULE_MAP *p, int port)
int prmSetGroupPatData (PORT_GROUP *pg, void *data)
void * prmGetGroupPatData (PORT_GROUP *pg)


Define Documentation

#define ANYPORT   -1
 

Definition at line 37 of file pcrm.h.

Referenced by prmAddByteRule(), prmAddByteRuleNC(), prmAddRule(), prmAddRuleNC(), prmAddRuleUri(), prmFindByteRuleGroup(), and prmFindRuleGroup().

#define MAX_PORTS   64*1024
 

Definition at line 36 of file pcrm.h.

Referenced by BuildMultiPatternGroups(), InitIgnorePorts(), prmAddRule(), prmAddRuleNC(), prmAddRuleUri(), prmCompileGroups(), prmFindByteRuleGroupUnique(), prmFindDstRuleGroup(), prmFindRuleGroup(), prmFindSrcRuleGroup(), prmFreeMap(), prmShowEventStats(), and prmShowStats().

#define PRM_GET_FIRST_GROUP_NODE pg   )     (pg->pgHead)
 

Definition at line 45 of file pcrm.h.

#define PRM_GET_FIRST_GROUP_NODE_NC pg   )     (pg->pgHeadNC)
 

Definition at line 50 of file pcrm.h.

#define PRM_GET_NEXT_GROUP_NODE rn   )     (rn->rnNext)
 

Definition at line 46 of file pcrm.h.

#define PRM_GET_NEXT_GROUP_NODE_NC rn   )     (rn->rnNext)
 

Definition at line 51 of file pcrm.h.

#define PRM_GETRULE_FROM_NODE rn   )     (rn->rnRuleData)
 

Definition at line 48 of file pcrm.h.


Typedef Documentation

typedef struct _not_rule_node_ NOT_RULE_NODE
 

typedef struct _rule_node_ RULE_NODE
 

typedef void* RULE_PTR
 

Definition at line 34 of file pcrm.h.


Function Documentation

int prmAddByteRule BYTE_RULE_MAP p,
int  dport,
RULE_PTR  rd
 

Definition at line 843 of file pcrm.c.

References ANYPORT, PORT_GROUP::pgCount, BYTE_RULE_MAP::prmByteGroup, BYTE_RULE_MAP::prmGeneric, BYTE_RULE_MAP::prmNumGenericRules, BYTE_RULE_MAP::prmNumGroups, BYTE_RULE_MAP::prmNumRules, and prmxAddPortRule().

int prmAddByteRuleNC BYTE_RULE_MAP p,
int  dport,
RULE_PTR  rd
 

Definition at line 1056 of file pcrm.c.

References ANYPORT, PORT_GROUP::pgCount, BYTE_RULE_MAP::prmByteGroup, BYTE_RULE_MAP::prmGeneric, BYTE_RULE_MAP::prmNumGenericRules, BYTE_RULE_MAP::prmNumGroups, BYTE_RULE_MAP::prmNumRules, and prmxAddPortRuleNC().

void prmAddNotNode PORT_GROUP pg,
int  id
 

Definition at line 567 of file pcrm.c.

References _not_rule_node_::iPos, _not_rule_node_::next, and PORT_GROUP::pgNotRuleList.

Referenced by BuildMultiPatGroup().

int prmAddRule PORT_RULE_MAP p,
int  dport,
int  sport,
RULE_PTR  rd
 

Definition at line 777 of file pcrm.c.

References ANYPORT, MAX_PORTS, NULL, PORT_GROUP::pgCount, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmNumDstGroups, PORT_RULE_MAP::prmNumDstRules, PORT_RULE_MAP::prmNumGenericRules, PORT_RULE_MAP::prmNumSrcGroups, PORT_RULE_MAP::prmNumSrcRules, PORT_RULE_MAP::prmSrcPort, and prmxAddPortRule().

Referenced by fpCreateFastPacketDetection().

int prmAddRuleNC PORT_RULE_MAP p,
int  dport,
int  sport,
RULE_PTR  rd
 

Definition at line 989 of file pcrm.c.

References ANYPORT, MAX_PORTS, NULL, PORT_GROUP::pgCount, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmNumDstGroups, PORT_RULE_MAP::prmNumDstRules, PORT_RULE_MAP::prmNumGenericRules, PORT_RULE_MAP::prmNumSrcGroups, PORT_RULE_MAP::prmNumSrcRules, PORT_RULE_MAP::prmSrcPort, and prmxAddPortRuleNC().

Referenced by fpCreateFastPacketDetection().

int prmAddRuleUri PORT_RULE_MAP p,
int  dport,
int  sport,
RULE_PTR  rd
 

Definition at line 893 of file pcrm.c.

References ANYPORT, MAX_PORTS, NULL, PORT_GROUP::pgCount, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmNumDstGroups, PORT_RULE_MAP::prmNumDstRules, PORT_RULE_MAP::prmNumGenericRules, PORT_RULE_MAP::prmNumSrcGroups, PORT_RULE_MAP::prmNumSrcRules, PORT_RULE_MAP::prmSrcPort, and prmxAddPortRuleUri().

Referenced by fpCreateFastPacketDetection().

int prmCompileByteGroups BYTE_RULE_MAP p  ) 
 

Definition at line 1348 of file pcrm.c.

References PORT_GROUP::pgCount, BYTE_RULE_MAP::prmByteGroup, BYTE_RULE_MAP::prmGeneric, prmGetFirstRule(), prmGetFirstRuleNC(), prmGetNextRule(), prmGetNextRuleNC(), prmxAddPortRule(), and prmxAddPortRuleNC().

int prmCompileGroups PORT_RULE_MAP p  ) 
 

Definition at line 1264 of file pcrm.c.

References MAX_PORTS, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, prmGetFirstRule(), prmGetFirstRuleNC(), prmGetFirstRuleUri(), prmGetNextRule(), prmGetNextRuleNC(), prmGetNextRuleUri(), PORT_RULE_MAP::prmSrcPort, prmxAddPortRule(), prmxAddPortRuleNC(), and prmxAddPortRuleUri().

Referenced by fpCreateFastPacketDetection().

int prmFindByteRuleGroup BYTE_RULE_MAP p,
int  dport,
PORT_GROUP **  dst,
PORT_GROUP **  gen
 

Definition at line 1157 of file pcrm.c.

References ANYPORT, PORT_GROUP::pgCount, BYTE_RULE_MAP::prmByteGroup, and BYTE_RULE_MAP::prmGeneric.

PORT_GROUP* prmFindByteRuleGroupUnique BYTE_RULE_MAP p,
int  port
 

Definition at line 1215 of file pcrm.c.

References MAX_PORTS, PORT_GROUP::pgCount, and BYTE_RULE_MAP::prmByteGroup.

Referenced by prmShowByteStats(), and prmShowEventByteStats().

PORT_GROUP* prmFindDstRuleGroup PORT_RULE_MAP p,
int  port
 

Definition at line 1189 of file pcrm.c.

References MAX_PORTS, and PORT_RULE_MAP::prmDstPort.

Referenced by BuildMultiPatternGroups(), prmShowEventStats(), and prmShowStats().

int prmFindRuleGroup PORT_RULE_MAP p,
int  dport,
int  sport,
PORT_GROUP **  src,
PORT_GROUP **  dst,
PORT_GROUP **  gen
 

Definition at line 1116 of file pcrm.c.

References ANYPORT, MAX_PORTS, NULL, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, and PORT_RULE_MAP::prmSrcPort.

Referenced by prmFindRuleGroupIcmp(), prmFindRuleGroupIp(), prmFindRuleGroupTcp(), and prmFindRuleGroupUdp().

PORT_GROUP* prmFindSrcRuleGroup PORT_RULE_MAP p,
int  port
 

Definition at line 1202 of file pcrm.c.

References MAX_PORTS, and PORT_RULE_MAP::prmSrcPort.

Referenced by BuildMultiPatternGroups(), prmShowEventStats(), and prmShowStats().

void prmFreeByteMap BYTE_RULE_MAP p  ) 
 

Definition at line 350 of file pcrm.c.

References BYTE_RULE_MAP::prmByteGroup, BYTE_RULE_MAP::prmGeneric, and prmxFreeGroup().

void prmFreeMap PORT_RULE_MAP p  ) 
 

Definition at line 301 of file pcrm.c.

References MAX_PORTS, PORT_RULE_MAP::prmDstPort, PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmSrcPort, and prmxFreeGroup().

RULE_PTR prmGetFirstRule PORT_GROUP pg  ) 
 

Definition at line 604 of file pcrm.c.

References PORT_GROUP::pgCur, PORT_GROUP::pgHead, and _rule_node_::rnRuleData.

Referenced by BuildMultiPatGroup(), prmCompileByteGroups(), and prmCompileGroups().

RULE_PTR prmGetFirstRuleNC PORT_GROUP pg  ) 
 

Definition at line 710 of file pcrm.c.

References PORT_GROUP::pgCurNC, PORT_GROUP::pgHeadNC, and _rule_node_::rnRuleData.

Referenced by prmCompileByteGroups(), and prmCompileGroups().

RULE_PTR prmGetFirstRuleUri PORT_GROUP pg  ) 
 

Definition at line 657 of file pcrm.c.

References PORT_GROUP::pgUriCur, PORT_GROUP::pgUriHead, and _rule_node_::rnRuleData.

Referenced by BuildMultiPatGroupsUri(), and prmCompileGroups().

void* prmGetGroupPatData PORT_GROUP pg  ) 
 

Definition at line 1238 of file pcrm.c.

References PORT_GROUP::pgPatData.

RULE_PTR prmGetNextRule PORT_GROUP pg  ) 
 

Definition at line 630 of file pcrm.c.

References PORT_GROUP::pgCur, _rule_node_::rnNext, and _rule_node_::rnRuleData.

Referenced by prmCompileByteGroups(), and prmCompileGroups().

RULE_PTR prmGetNextRuleNC PORT_GROUP pg  ) 
 

Definition at line 736 of file pcrm.c.

References PORT_GROUP::pgCurNC, _rule_node_::rnNext, and _rule_node_::rnRuleData.

Referenced by prmCompileByteGroups(), and prmCompileGroups().

RULE_PTR prmGetNextRuleUri PORT_GROUP pg  ) 
 

Definition at line 683 of file pcrm.c.

References PORT_GROUP::pgUriCur, _rule_node_::rnNext, and _rule_node_::rnRuleData.

Referenced by prmCompileGroups().

BYTE_RULE_MAP* prmNewByteMap  ) 
 

Definition at line 247 of file pcrm.c.

PORT_RULE_MAP* prmNewMap  ) 
 

Definition at line 223 of file pcrm.c.

Referenced by fpCreateFastPacketDetection().

int prmSetGroupPatData PORT_GROUP pg,
void *  data
 

Definition at line 1229 of file pcrm.c.

References PORT_GROUP::pgPatData.

int prmShowByteStats BYTE_RULE_MAP p  ) 
 

Definition at line 1477 of file pcrm.c.

References PORT_GROUP::avgLen, PORT_GROUP::c1, PORT_GROUP::c2, PORT_GROUP::c3, PORT_GROUP::c4, PORT_GROUP::maxLen, PORT_GROUP::minLen, PORT_GROUP::pgContentCount, PORT_GROUP::pgNoContentCount, prmFindByteRuleGroupUnique(), BYTE_RULE_MAP::prmGeneric, BYTE_RULE_MAP::prmNumGenericRules, BYTE_RULE_MAP::prmNumGroups, and BYTE_RULE_MAP::prmNumRules.

int prmShowEventByteStats BYTE_RULE_MAP p  ) 
 

Definition at line 1633 of file pcrm.c.

References PORT_GROUP::pgCount, PORT_GROUP::pgNQEvents, PORT_GROUP::pgQEvents, prmFindByteRuleGroupUnique(), BYTE_RULE_MAP::prmGeneric, BYTE_RULE_MAP::prmNumGenericRules, BYTE_RULE_MAP::prmNumGroups, and BYTE_RULE_MAP::prmNumRules.

int prmShowEventStats PORT_RULE_MAP p  ) 
 

Definition at line 1559 of file pcrm.c.

References MAX_PORTS, PORT_GROUP::pgCount, PORT_GROUP::pgNQEvents, PORT_GROUP::pgQEvents, prmFindDstRuleGroup(), prmFindSrcRuleGroup(), PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmNumDstGroups, PORT_RULE_MAP::prmNumDstRules, PORT_RULE_MAP::prmNumGenericRules, PORT_RULE_MAP::prmNumSrcGroups, and PORT_RULE_MAP::prmNumSrcRules.

Referenced by fpShowEventStats().

int prmShowStats PORT_RULE_MAP p  ) 
 

Definition at line 1405 of file pcrm.c.

References PORT_GROUP::avgLen, PORT_GROUP::c1, PORT_GROUP::c2, PORT_GROUP::c3, PORT_GROUP::c4, MAX_PORTS, PORT_GROUP::maxLen, PORT_GROUP::minLen, PORT_GROUP::pgContentCount, PORT_GROUP::pgNoContentCount, PORT_GROUP::pgUriContentCount, prmFindDstRuleGroup(), prmFindSrcRuleGroup(), PORT_RULE_MAP::prmGeneric, PORT_RULE_MAP::prmNumDstGroups, PORT_RULE_MAP::prmNumDstRules, PORT_RULE_MAP::prmNumGenericRules, PORT_RULE_MAP::prmNumSrcGroups, and PORT_RULE_MAP::prmNumSrcRules.

Referenced by fpCreateFastPacketDetection().


Generated on Sun May 14 14:51:23 2006 by  doxygen 1.4.2