engine/num_list.c File Reference

#include "num_list.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "hlbr.h"

Go to the source code of this file.

Functions

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

Variables

GlobalVars Globals


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 *  RawRanges,
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().

int ReplaceAliases ( char *  s1,
int  s1len,
char *  s2,
int  s2len,
NumAlias a,
int  NumAliases 
)

Definition at line 226 of file num_list.c.

References DEBUGPATH, FALSE, and TRUE.

Referenced by AddRangesString().


Variable Documentation

GlobalVars Globals

Definition at line 41 of file hlbr.c.


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