engine/cache.h File Reference

#include "../config.h"
#include "hlbr.h"

Go to the source code of this file.

Data Structures

struct  cache_item
struct  cache_items
struct  cache

Defines

#define CACHE_MAX_KEYS   256
#define CACHE_MAX_ITEMS_PER_KEY   64
#define CACHE_NONE   -1

Typedefs

typedef cache_item CacheItem
typedef cache_items CacheItems
typedef cache Cache

Functions

CacheInitCache (int TimeoutLen)
int CacheAdd (Cache *c, unsigned char *Key, int KeyLen, unsigned char *Data, int DataLen, int Now)
int CacheDelKey (Cache *c, unsigned char *Key, int KeyLen, int Now)
CacheItemsCacheGet (Cache *c, unsigned char *Key, int KeyLen, int Now)
void DestroyCache (Cache *c)


Define Documentation

#define CACHE_MAX_ITEMS_PER_KEY   64

Definition at line 8 of file cache.h.

Referenced by CacheBinAdd().

#define CACHE_MAX_KEYS   256

Definition at line 7 of file cache.h.

Referenced by CacheCreateBin().

#define CACHE_NONE   -1

Definition at line 9 of file cache.h.

Referenced by CacheAdd(), CacheCreateBin(), CacheDelKey(), and CacheGet().


Typedef Documentation

typedef struct cache Cache

typedef struct cache_item CacheItem

typedef struct cache_items CacheItems


Function Documentation

int CacheAdd ( Cache c,
unsigned char *  Key,
int  KeyLen,
unsigned char *  Data,
int  DataLen,
int  Now 
)

Definition at line 118 of file cache.c.

References CACHE_NONE, CacheBinAdd(), CacheCreateBin(), CacheGetBin(), CacheTimeout(), FALSE, cache::Keys, cache_items::LastTime, and TRUE.

Referenced by DecodeIPDefrag().

int CacheDelKey ( Cache c,
unsigned char *  Key,
int  KeyLen,
int  Now 
)

Definition at line 157 of file cache.c.

References CACHE_NONE, CacheGetBin(), CacheTimeout(), cache_item::Data, cache_item::DataLen, FALSE, cache_items::Items, cache_items::Key, cache_items::KeyLen, cache::Keys, NULL, cache_items::NumItems, cache::NumKeys, and TRUE.

Referenced by CacheTimeout(), and DecodeIPDefrag().

CacheItems* CacheGet ( Cache c,
unsigned char *  Key,
int  KeyLen,
int  Now 
)

Definition at line 201 of file cache.c.

References CACHE_NONE, CacheGetBin(), CacheTimeout(), cache::Keys, and NULL.

Referenced by DecodeIPDefrag().

void DestroyCache ( Cache c  ) 

Definition at line 224 of file cache.c.

References cache_item::Data, cache_items::Items, cache_items::Key, cache::Keys, NULL, cache_items::NumItems, and cache::NumKeys.

Cache* InitCache ( int  TimeoutLen  ) 

Definition at line 11 of file cache.c.

References cache::TimeoutLen.


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