#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 | |
Cache * | InitCache (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) |
CacheItems * | CacheGet (Cache *c, unsigned char *Key, int KeyLen, int Now) |
void | DestroyCache (Cache *c) |
#define CACHE_MAX_ITEMS_PER_KEY 64 |
#define CACHE_MAX_KEYS 256 |
#define CACHE_NONE -1 |
Definition at line 9 of file cache.h.
Referenced by CacheAdd(), CacheCreateBin(), CacheDelKey(), and CacheGet().
typedef struct cache_item CacheItem |
typedef struct cache_items CacheItems |
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 | ) |