engine/num_list.h File Reference

#include "../config.h"

Go to the source code of this file.

Data Structures

struct  num_alias_item
struct  num_list_item
struct  num_list

Defines

#define LIST_TYPE_NORMAL   1
#define LIST_TYPE_TIME   2
#define LIST_TYPE_AGE   3
#define LIST_TYPE_PAIRED   4
#define LIST_INITIAL_SIZE   10
#define LIST_GROW_SIZE   50

Typedefs

typedef num_alias_item NumAlias
typedef num_list_item NumItem
typedef num_list NumList

Functions

NumListInitNumList (int ListType)
void DestroyNumList (NumList *n)
int ClearNumList (NumList *n)
int AddRange (NumList *n, unsigned int Lower, unsigned int Upper)
int AddRangeTime (NumList *n, unsigned int Lower, unsigned int Upper, int Time)
int AddSubList (NumList *n, NumList *SubList)
int IsInList (NumList *n, unsigned int Number)
int IsInListTime (NumList *n, unsigned int Number, int Now)
int AddRangesString (NumList *n, char *Ranges, NumAlias *Aliases, int NumAliases)
int AddIPRanges (NumList *n, char *Ranges)
int RemoveFromList (NumList *n, unsigned int Number)
int NumListCompare (NumList *n1, NumList *n2)


Define Documentation

#define LIST_GROW_SIZE   50

Definition at line 19 of file num_list.h.

Referenced by AddRangeTime(), and AddSubList().

#define LIST_INITIAL_SIZE   10

Definition at line 18 of file num_list.h.

Referenced by InitNumList().

#define LIST_TYPE_AGE   3

Definition at line 15 of file num_list.h.

Referenced by IsInListTime().

#define LIST_TYPE_NORMAL   1

Definition at line 13 of file num_list.h.

Referenced by BNSParseArgs(), EthernetTypeAddNode(), ICMPCodeAddNode(), ICMPTypeAddNode(), InitMacFilter(), IPCheckAddNode(), IPDstAddNode(), IPProtoAddNode(), IPSrcAddNode(), IPTTLAddNode(), ParseList(), RouteSIPAdd(), TCPDstAddNode(), TCPPortAddNode(), TCPSrcAddNode(), UDPDstAddNode(), and UDPSrcAddNode().

#define LIST_TYPE_PAIRED   4

Definition at line 16 of file num_list.h.

#define LIST_TYPE_TIME   2

Definition at line 14 of file num_list.h.

Referenced by InitRouteBNS(), and IsInListTime().


Typedef Documentation

typedef struct num_alias_item NumAlias

typedef struct num_list_item NumItem

typedef struct num_list NumList


Function Documentation

int AddIPRanges ( NumList n,
char *  Ranges 
)

Definition at line 360 of file num_list.c.

References AddRange(), AddSubList(), DEBUGPATH, FALSE, GetListByName(), Globals, global_list::List, LIST_NONE, global_vars::Lists, and TRUE.

Referenced by BNSParseArgs(), IPDstAddNode(), IPSrcAddNode(), IPTTLAddNode(), ParseList(), and RouteBNSAddNode().

int AddRange ( NumList n,
unsigned int  Lower,
unsigned int  Upper 
)

Definition at line 103 of file num_list.c.

References AddRangeTime(), and DEBUGPATH.

Referenced by AddIPRanges(), and AddRangesString().

int AddRangesString ( NumList n,
char *  Ranges,
NumAlias Aliases,
int  NumAliases 
)

Definition at line 259 of file num_list.c.

References AddRange(), DEBUGPATH, FALSE, NULL, ReplaceAliases(), and TRUE.

Referenced by EthernetTypeAddNode(), ICMPCodeAddNode(), ICMPTypeAddNode(), IPCheckAddNode(), IPProtoAddNode(), RouteMacFilterAddNode(), TCPDstAddNode(), TCPPortAddNode(), TCPSrcAddNode(), UDPDstAddNode(), and UDPSrcAddNode().

int AddRangeTime ( NumList n,
unsigned int  Lower,
unsigned int  Upper,
int  Time 
)

Definition at line 72 of file num_list.c.

References num_list::AllocCount, DEBUGPATH, num_list::Items, LIST_GROW_SIZE, num_list_item::Lower, num_list::NumEntries, num_list_item::Time, TRUE, and num_list_item::Upper.

Referenced by AddRange(), and BNSAction().

int AddSubList ( NumList n,
NumList SubList 
)

Definition at line 112 of file num_list.c.

References num_list::AllocCount, DEBUGPATH, num_list::Items, LIST_GROW_SIZE, num_list::NumEntries, num_list_item::SubList, num_list_item::Time, and TRUE.

Referenced by AddIPRanges().

int ClearNumList ( NumList n  ) 

Definition at line 33 of file num_list.c.

References DEBUGPATH, num_list::Items, NULL, and num_list::NumEntries.

Referenced by DestroyNumList().

void DestroyNumList ( NumList n  ) 

Definition at line 57 of file num_list.c.

References ClearNumList(), DEBUGPATH, num_list::Items, and NULL.

Referenced by IPDstAddNode(), IPSrcAddNode(), IPTTLAddNode(), TCPDstAddNode(), and UDPSrcAddNode().

NumList* InitNumList ( int  ListType  ) 

Definition at line 16 of file num_list.c.

References num_list::AllocCount, DEBUGPATH, num_list::Items, LIST_INITIAL_SIZE, and num_list::ListType.

Referenced by BNSParseArgs(), EthernetTypeAddNode(), ICMPCodeAddNode(), ICMPTypeAddNode(), InitMacFilter(), InitRouteBNS(), IPCheckAddNode(), IPDstAddNode(), IPProtoAddNode(), IPSrcAddNode(), IPTTLAddNode(), ParseList(), RouteSIPAdd(), TCPDstAddNode(), TCPPortAddNode(), TCPSrcAddNode(), UDPDstAddNode(), and UDPSrcAddNode().

int IsInList ( NumList n,
unsigned int  Number 
)

Definition at line 142 of file num_list.c.

References DEBUG, DEBUGPATH, IsInList(), num_list::Items, num_list_item::Lower, num_list::NumEntries, num_list_item::SubList, TRUE, and num_list_item::Upper.

Referenced by BNSAction(), IsInList(), RouteDIP(), RouteMacFilter(), RouteSIPAction(), RouteSIPAdd(), TestEthernetType(), TestICMPCode(), TestICMPType(), TestIPCheck(), TestIPDst(), TestIPProto(), TestIPSrc(), TestIPTTL(), TestTCPDst(), TestTCPDstOld(), TestTCPPort(), TestTCPSrc(), TestUDPDst(), and TestUDPSrc().

int IsInListTime ( NumList n,
unsigned int  Number,
int  Now 
)

Definition at line 167 of file num_list.c.

References DEBUG, DEBUGPATH, FALSE, num_list::Items, LIST_TYPE_AGE, LIST_TYPE_TIME, num_list::ListType, NULL, num_list::NumEntries, and num_list_item::Time.

Referenced by HandleIPPacket().

int NumListCompare ( NumList n1,
NumList n2 
)

Definition at line 675 of file num_list.c.

References DEBUG, DEBUGPATH, FALSE, num_list::Items, num_list_item::Lower, num_list::NumEntries, num_list_item::SubList, and num_list_item::Upper.

Referenced by IPDstAddNode(), IPSrcAddNode(), IPTTLAddNode(), TCPDstAddNode(), and UDPSrcAddNode().

int RemoveFromList ( NumList n,
unsigned int  Number 
)

Definition at line 643 of file num_list.c.

References DEBUG, DEBUGPATH, FALSE, num_list::Items, num_list_item::Lower, NULL, num_list::NumEntries, RemoveFromList(), num_list_item::SubList, TRUE, and num_list_item::Upper.

Referenced by RemoveFromList().


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