engine/jtree.h File Reference

#include "hlbr.h"

Go to the source code of this file.

Data Structures

struct  short_jnode
struct  jnode
struct  jtree

Defines

#define MAX_STRING_LEN   1024
#define NODE_TYPE_NORMAL   1
#define NODE_TYPE_SHORT   2

Typedefs

typedef short_jnode SJNode
typedef jnode JNode
typedef jtree JTree

Functions

int InitJTree (JTree *j, char NoCase)
int AddStringJTree (JTree *j, unsigned char *String, int SLen, int RuleID)
int FinalizeJTree (JTree *j)
int MatchStrings (JTree *j, unsigned char *PacketRuleBits, unsigned char *String, int SLen)


Define Documentation

#define MAX_STRING_LEN   1024

Definition at line 6 of file jtree.h.

Referenced by AddStringJTree(), and AddStringJTreeReal().

#define NODE_TYPE_NORMAL   1

Definition at line 8 of file jtree.h.

#define NODE_TYPE_SHORT   2

Definition at line 9 of file jtree.h.

Referenced by ConvertNode().


Typedef Documentation

typedef struct jnode JNode

typedef struct jtree JTree

typedef struct short_jnode SJNode


Function Documentation

int AddStringJTree ( JTree j,
unsigned char *  String,
int  SLen,
int  RuleID 
)

Add a string to the tree. Decode binary sections (defined between ||).

Definition at line 126 of file jtree.c.

References AddStringJTreeReal(), DBGESCAPE, DEBUGPATH, FALSE, MAX_STRING_LEN, NULL, PRINTERROR, PRINTERROR1, and TRUE.

Referenced by TCPContentAddNode(), TCPListContentAddNode(), TCPListNoCaseAddNode(), TCPNoCaseAddNode(), UDPContentAddNode(), and UDPNoCaseAddNode().

int FinalizeJTree ( JTree j  ) 

Definition at line 370 of file jtree.c.

References DEBUGPATH, jnode::FailNode, FALSE, FindOptimalNode(), jtree::Head, NULL, and TRUE.

Referenced by TestTCPContentFinishedSetup(), TestTCPListContentFinishedSetup(), TestTCPListNoCaseFinishedSetup(), TestTCPNoCaseFinishedSetup(), TestUDPContentFinishedSetup(), and TestUDPNoCaseFinishedSetup().

int InitJTree ( JTree j,
char  NoCase 
)

Set up the tree.

Definition at line 42 of file jtree.c.

References DEBUGPATH, jtree::NoCase, and TRUE.

Referenced by InitTestTCPContent(), InitTestTCPListContent(), InitTestTCPListNoCase(), InitTestTCPNoCase(), InitTestUDPContent(), and InitTestUDPNoCase().

int MatchStrings ( JTree j,
unsigned char *  PacketRuleBits,
unsigned char *  String,
int  SLen 
)

Definition at line 401 of file jtree.c.

References jnode::Bytes, DEBUGPATH, jtree::DependMask, Globals, jtree::Head, jnode::IsTerminal, MAX_RULES, global_vars::NumRules, SetBit(), jnode::temp, and jnode::TerminalRuleID.

Referenced by TestTCPContent(), TestTCPListContent(), TestTCPListNoCase(), TestTCPNoCase(), TestUDPContent(), and TestUDPNoCase().


Generated on Sat Jul 7 23:33:10 2007 for HLBR by  doxygen 1.5.2