tests/test.c File Reference

#include "test.h"
#include "../engine/bits.h"
#include "../decoders/decode.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "test_interface_name.h"
#include "test_ethernet_type.h"
#include "test_ethernet_src.h"
#include "test_ethernet_dst.h"
#include "test_ip_src.h"
#include "test_ip_dst.h"
#include "test_ip_proto.h"
#include "test_ip_ttl.h"
#include "test_icmp_type.h"
#include "test_icmp_code.h"
#include "test_tcp_port.h"
#include "test_tcp_src.h"
#include "test_tcp_dst.h"
#include "test_tcp_content.h"
#include "test_tcp_nocase.h"
#include "test_tcp_listcontent.h"
#include "test_tcp_listnocase.h"
#include "test_tcp_flags.h"
#include "test_tcp_offset.h"
#include "test_tcp_regex.h"
#include "test_udp_regex.h"
#include "test_udp_src.h"
#include "test_udp_dst.h"
#include "test_udp_content.h"
#include "test_udp_nocase.h"

Go to the source code of this file.

Defines

#define DEBUG1

Functions

int InitTests ()
int GetTestByName (char *Name)
int CreateTest (char *Name)
int BindTestToDecoder (int TestID, char *Decoder)
int TestSetDependency (int TestID, int RuleID)
int TestAddNode (int TestID, int RuleNum, void *Data)
int TestsFinishSetup ()

Variables

GlobalVars Globals


Define Documentation

#define DEBUG1

Definition at line 41 of file test.c.


Function Documentation

int BindTestToDecoder ( int  TestID,
char *  Decoder 
)

Definition at line 133 of file test.c.

References DECODER_NONE, DecoderAddTest(), test_rec::DecoderID, FALSE, GetDecoderByName(), Globals, and global_vars::Tests.

Referenced by InitTestEthernetDst(), InitTestEthernetSrc(), InitTestEthernetType(), InitTestICMPCode(), InitTestICMPType(), InitTestInterfaceName(), InitTestIPCheck(), InitTestIPDst(), InitTestIPProto(), InitTestIPSrc(), InitTestIPTTL(), InitTestTCPContent(), InitTestTCPDst(), InitTestTCPFlags(), InitTestTCPListContent(), InitTestTCPListNoCase(), InitTestTCPNoCase(), InitTestTCPOffset(), InitTestTCPPort(), InitTestTCPRegExp(), InitTestTCPSrc(), InitTestUDPContent(), InitTestUDPDst(), InitTestUDPNoCase(), InitTestUDPRegExp(), and InitTestUDPSrc().

int CreateTest ( char *  Name  ) 

Definition at line 103 of file test.c.

References GetTestByName(), Globals, test_rec::ID, MAX_NAME_LEN, test_rec::Name, global_vars::NumTests, TEST_NONE, and global_vars::Tests.

Referenced by InitTestEthernetDst(), InitTestEthernetSrc(), InitTestEthernetType(), InitTestICMPCode(), InitTestICMPType(), InitTestInterfaceName(), InitTestIPCheck(), InitTestIPDst(), InitTestIPProto(), InitTestIPSrc(), InitTestIPTTL(), InitTestTCPContent(), InitTestTCPDst(), InitTestTCPFlags(), InitTestTCPListContent(), InitTestTCPListNoCase(), InitTestTCPNoCase(), InitTestTCPOffset(), InitTestTCPPort(), InitTestTCPRegExp(), InitTestTCPSrc(), InitTestUDPContent(), InitTestUDPDst(), InitTestUDPNoCase(), InitTestUDPRegExp(), and InitTestUDPSrc().

int GetTestByName ( char *  Name  ) 

Definition at line 87 of file test.c.

References Globals, test_rec::Name, global_vars::NumTests, TEST_NONE, and global_vars::Tests.

Referenced by CreateTest().

int InitTests (  ) 

Add all the tests to the tree Calls every test's initializer function (every test must have one and have it declared here)

Definition at line 48 of file test.c.

References FALSE, InitTestEthernetDst(), InitTestEthernetSrc(), InitTestEthernetType(), InitTestICMPCode(), InitTestICMPType(), InitTestInterfaceName(), InitTestIPDst(), InitTestIPProto(), InitTestIPSrc(), InitTestIPTTL(), InitTestTCPContent(), InitTestTCPDst(), InitTestTCPFlags(), InitTestTCPListContent(), InitTestTCPListNoCase(), InitTestTCPNoCase(), InitTestTCPOffset(), InitTestTCPPort(), InitTestTCPRegExp(), InitTestTCPSrc(), InitTestUDPContent(), InitTestUDPDst(), InitTestUDPNoCase(), InitTestUDPRegExp(), InitTestUDPSrc(), and TRUE.

Referenced by main().

int TestAddNode ( int  TestID,
int  RuleNum,
void *  Data 
)

Definition at line 168 of file test.c.

References test_rec::Active, decoder_rec::Active, test_node::Data, test_rec::DecoderID, global_vars::Decoders, DecoderSetDependency(), Globals, decoder_rec::ID, test_rec::Name, decoder_rec::Name, test_node::Next, decoder_rec::Parent, test_node::RuleID, test_rec::TestNodes, global_vars::Tests, TestSetDependency(), and TRUE.

Referenced by EthernetDstAddNode(), EthernetSrcAddNode(), EthernetTypeAddNode(), ICMPCodeAddNode(), ICMPTypeAddNode(), InterfaceNameAddNode(), IPCheckAddNode(), IPDstAddNode(), IPProtoAddNode(), IPSrcAddNode(), IPTTLAddNode(), TCPContentAddNode(), TCPDstAddNode(), TCPFlagsAddNode(), TCPListContentAddNode(), TCPListNoCaseAddNode(), TCPNoCaseAddNode(), TCPOffsetAddNode(), TCPPortAddNode(), TCPRegExpAddNode(), TCPSrcAddNode(), UDPContentAddNode(), UDPDstAddNode(), UDPNoCaseAddNode(), UDPRegExpAddNode(), and UDPSrcAddNode().

int TestSetDependency ( int  TestID,
int  RuleID 
)

Definition at line 152 of file test.c.

References test_rec::DependencyMask, FALSE, Globals, global_vars::NumRules, global_vars::NumTests, SetBit(), global_vars::Tests, and TRUE.

Referenced by TestAddNode().

int TestsFinishSetup (  ) 

Definition at line 213 of file test.c.

References test_rec::FinishedSetup, Globals, global_vars::NumTests, global_vars::Tests, and TRUE.

Referenced by main().


Variable Documentation

GlobalVars Globals

Definition at line 41 of file hlbr.c.


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