tests/test_tcp_listcontent.c File Reference

Implements the 'tcp listcontent()' test. The parameter for this test in the rule file is the file name of a word list. The words are added as if in a big OR statement of 'tcp content()' clauses. More...

#include "test_tcp_listcontent.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../decoders/decode_tcp.h"
#include "../packets/packet.h"
#include "../engine/jtree.h"
#include "../engine/parse_config.h"
#include <arpa/inet.h>

Go to the source code of this file.

Data Structures

struct  tcp_content_data

Typedefs

typedef tcp_content_data TCPListContentData

Functions

int TestTCPListContent (int PacketSlot, TestNode *Nodes)
int TCPListContentAddNode (int TestID, int RuleID, char *Args)
int TestTCPListContentFinishedSetup ()
int InitTestTCPListContent ()

Variables

GlobalVars Globals
int TCPDecoderID
JTree TCPListContentTree


Detailed Description

Implements the 'tcp listcontent()' test. The parameter for this test in the rule file is the file name of a word list. The words are added as if in a big OR statement of 'tcp content()' clauses.

Author:
Arkanoid
Date:
Sun Jan 22 19:42:53 2006

Definition in file test_tcp_listcontent.c.


Typedef Documentation

typedef struct tcp_content_data TCPListContentData


Function Documentation

int InitTestTCPListContent (  ) 

Set up the TCP ListContent test

Returns:
TRUE if successful or FALSE in case of failure

Definition at line 157 of file test_tcp_listcontent.c.

References test_rec::AddNode, BindTestToDecoder(), CreateTest(), FALSE, test_rec::FinishedSetup, GetDecoderByName(), Globals, InitJTree(), MAX_NAME_LEN, test_rec::ShortName, TCPDecoderID, TCPListContentAddNode(), TCPListContentTree, TEST_NONE, test_rec::TestFunc, global_vars::Tests, TestTCPListContent(), TestTCPListContentFinishedSetup(), and TRUE.

Referenced by InitTests().

int TCPListContentAddNode ( int  TestID,
int  RuleID,
char *  Args 
)

Add a rule node to this test

Parameters:
TestID Number of this test in the Globals.Tests[] array
RuleID Number of the rule in the Globals.Rules[] array
Args File name of the word list
Returns:
TRUE if successful or FALSE in case of failure

Definition at line 95 of file test_tcp_listcontent.c.

References AddStringJTree(), FALSE, GetLine(), NULL, TCPListContentTree, and TestAddNode().

Referenced by InitTestTCPListContent().

int TestTCPListContent ( int  PacketSlot,
TestNode Nodes 
)

Apply the Test

Parameters:
PacketSlot Number of the packet in the Globals.Packets[] array
Nodes Data from the rules parameters stored for this test
Returns:
TRUE if successful or FALSE in case of failure

Definition at line 42 of file test_tcp_listcontent.c.

References packet_rec::BeginData, FALSE, Globals, MatchStrings(), global_vars::NumRules, packet_rec::PacketLen, global_vars::Packets, packet_rec::RawPacket, packet_rec::RuleBits, RuleIsActive(), TCPListContentTree, and TRUE.

Referenced by InitTestTCPListContent().

int TestTCPListContentFinishedSetup (  ) 

Called when we're all done adding rules

Returns:
Result of FinalizeJTree()

Definition at line 142 of file test_tcp_listcontent.c.

References FinalizeJTree(), and TCPListContentTree.

Referenced by InitTestTCPListContent().


Variable Documentation

GlobalVars Globals

Definition at line 41 of file hlbr.c.

int TCPDecoderID

Definition at line 31 of file test_tcp_listcontent.c.

JTree TCPListContentTree

Definition at line 32 of file test_tcp_listcontent.c.

Referenced by InitTestTCPListContent(), TCPListContentAddNode(), TestTCPListContent(), and TestTCPListContentFinishedSetup().


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