engine/cache.c File Reference

#include "cache.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Functions

CacheInitCache (int TimeoutLen)
int CacheGetBin (Cache *c, unsigned char *Key, int KeyLen)
int CacheCreateBin (Cache *c, unsigned char *Key, int KeyLen)
int CacheBinAdd (CacheItems *ci, unsigned char *Data, int DataLen)
void CacheTimeout (Cache *c, int Now)
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)


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 CacheBinAdd ( CacheItems ci,
unsigned char *  Data,
int  DataLen 
)

Definition at line 76 of file cache.c.

References CACHE_MAX_ITEMS_PER_KEY, cache_item::Data, cache_item::DataLen, FALSE, cache_items::Items, cache_items::NumItems, and TRUE.

Referenced by CacheAdd().

int CacheCreateBin ( Cache c,
unsigned char *  Key,
int  KeyLen 
)

Definition at line 48 of file cache.c.

References CACHE_MAX_KEYS, CACHE_NONE, cache_items::Key, cache_items::KeyLen, cache::Keys, cache_items::NumItems, and cache::NumKeys.

Referenced by CacheAdd().

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().

int CacheGetBin ( Cache c,
unsigned char *  Key,
int  KeyLen 
)

Definition at line 27 of file cache.c.

References cache_items::Key, cache_items::KeyLen, cache::Keys, and cache::NumKeys.

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

void CacheTimeout ( Cache c,
int  Now 
)

Definition at line 100 of file cache.c.

References CacheDelKey(), cache_items::Key, cache::Keys, cache_items::LastTime, cache::NumKeys, and cache::TimeoutLen.

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

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.

Referenced by InitDecoderIPDefrag().


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