engine/bits.c File Reference

#include "bits.h"
#include <stdio.h>

Go to the source code of this file.

Functions

int GetBit (unsigned char *BitField, int BitFieldLen, int BitNum)
void SetBit (unsigned char *BitField, int BitFieldLen, int BitNum, char Value)
void SetBits (unsigned char *BitField, int BitFieldLen, int StartBit, int EndBit, char Value)
void NotAndBitFields (unsigned char *BitField1, unsigned char *BitField2, unsigned char *TargetBitField, int BitFieldLen)
void AndBitFields (unsigned char *BitField1, unsigned char *BitField2, unsigned char *TargetBitField, int BitFieldLen)
void OrBitFields (unsigned char *BitField1, unsigned char *BitField2, unsigned char *TargetBitField, int BitFieldLen)
int CountBits (unsigned char *BitField, int BitFieldLen)
int CountBitsNot (unsigned char *BitField, int BitFieldLen)
int BitFieldIsEmpty (unsigned char *BitField, int BitFieldLen)


Function Documentation

void AndBitFields ( unsigned char *  BitField1,
unsigned char *  BitField2,
unsigned char *  TargetBitField,
int  BitFieldLen 
) [inline]

Definition at line 144 of file bits.c.

int BitFieldIsEmpty ( unsigned char *  BitField,
int  BitFieldLen 
)

Definition at line 264 of file bits.c.

References FALSE, GetBit(), and TRUE.

Referenced by Decode(), and ProcessPacket().

int CountBits ( unsigned char *  BitField,
int  BitFieldLen 
)

Definition at line 164 of file bits.c.

References GetBit().

int CountBitsNot ( unsigned char *  BitField,
int  BitFieldLen 
)

Definition at line 183 of file bits.c.

int GetBit ( unsigned char *  BitField,
int  BitFieldLen,
int  BitNum 
) [inline]

Definition at line 7 of file bits.c.

References FALSE.

Referenced by BitFieldIsEmpty(), CountBits(), IPDstAddNode(), IPSrcAddNode(), IPTTLAddNode(), RuleIsActive(), TCPDstAddNode(), TCPFlagsAddNode(), and UDPSrcAddNode().

void NotAndBitFields ( unsigned char *  BitField1,
unsigned char *  BitField2,
unsigned char *  TargetBitField,
int  BitFieldLen 
) [inline]

Definition at line 121 of file bits.c.

Referenced by Decode(), TestIPDst(), TestIPSrc(), TestIPTTL(), TestTCPDst(), TestTCPFlags(), and TestUDPSrc().

void OrBitFields ( unsigned char *  BitField1,
unsigned char *  BitField2,
unsigned char *  TargetBitField,
int  BitFieldLen 
) [inline]

Definition at line 154 of file bits.c.

void SetBit ( unsigned char *  BitField,
int  BitFieldLen,
int  BitNum,
char  Value 
) [inline]

Definition at line 42 of file bits.c.

Referenced by AddToTree(), AddToTreeSorted(), DecoderSetDependency(), IPDstAddNode(), IPSrcAddNode(), IPTTLAddNode(), MatchStrings(), MatchStringTree(), SetRuleInactive(), TCPDstAddNode(), TCPFlagsAddNode(), TestSetDependency(), and UDPSrcAddNode().

void SetBits ( unsigned char *  BitField,
int  BitFieldLen,
int  StartBit,
int  EndBit,
char  Value 
) [inline]

Definition at line 111 of file bits.c.


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