IP Cache Internals
Collaboration diagram for IP Cache Internals:

Classes

struct  _ipcache_stats
 

Functions

int ipcacheCount ()
 
static void ipcacheRelease (ipcache_entry *, bool dofree=true)
 
static ipcache_entryipcache_get (const char *name)
 
static int ipcacheExpiredEntry (ipcache_entry *i)
 
static void purge_entries_fromhosts (void)
 
static void ipcacheAddEntry (ipcache_entry *i)
 
static void ipcacheCallback (ipcache_entry *i, const bool hit, const int wait)
 
static void ipcacheHandleReply (void *data, const rfc1035_rr *answers, int na, const char *error_message, const bool lastAnswer)
 
static void ipcacheRegisterWithCacheManager (void)
 
static void ipcacheStatPrint (ipcache_entry *i, StoreEntry *sentry)
 
static void stat_ipcache_get (StoreEntry *)
 
static void ipcacheLockEntry (ipcache_entry *i)
 
static void ipcacheUnlockEntry (ipcache_entry *i)
 
static void ipcacheFreeEntry (void *data)
 

Variables

static struct _ipcache_stats IpcacheStats
 
static dlink_list lru_list
 
static hash_tableip_table = NULL
 
static long ipcache_low = 180
 
static long ipcache_high = 200
 

Detailed Description

Todo:
when IP cache is provided as a class. These sub-groups will be obsolete for now they are used to separate the public and private functions. with the private ones all being in IPCachInternal and public in IPCacheAPI

Internal Operation

Internally, the execution flow is as follows: On a miss, ipcache_getnbhostbyname checks whether a request for this name is already pending, and if positive, it creates a new entry using ipcacheAddNew with the IP_PENDING flag set . Then it calls ipcacheAddPending to add a request to the queue together with data and handler. Else, ipcache_dnsDispatch() is called to directly create a DNS query or to ipcacheEnqueue() if all no DNS port is free. ipcache_call_pending() is called regularly to walk down the pending list and call handlers. LRU clean-up is performed through ipcache_purgelru() according to the ipcache_high threshold.

Function Documentation

static void ipcacheCallback ( ipcache_entry i,
const bool  hit,
const int  wait 
)
static
int ipcacheCount ( )
inline

Definition at line 292 of file ipcache.cc.

References hash_table::count.

Referenced by ipcache_purgelru(), snmp_netIpFn(), and stat_ipcache_get().

static void ipcacheFreeEntry ( void *  data)
static

Definition at line 1074 of file ipcache.cc.

References i.

static void ipcacheLockEntry ( ipcache_entry i)
static
static void ipcacheRegisterWithCacheManager ( void  )
static

Definition at line 672 of file ipcache.cc.

References Mgr::RegisterAction(), and stat_ipcache_get().

Referenced by ipcache_init().

static void ipcacheStatPrint ( ipcache_entry i,
StoreEntry sentry 
)
static
static void ipcacheUnlockEntry ( ipcache_entry i)
static
static void purge_entries_fromhosts ( void  )
static

purges entries added from /etc/hosts (or whatever).

Definition at line 384 of file ipcache.cc.

References dlink_node::data, dlink_list::head, i, ipcacheRelease(), dlink_node::next, and NULL.

Referenced by ipcache_restart().

Variable Documentation

hash_table* ip_table = NULL
static

Definition at line 207 of file ipcache.cc.

long ipcache_high = 200
static

Definition at line 212 of file ipcache.cc.

Referenced by ipcache_init(), and ipcache_restart().

long ipcache_low = 180
static

Definition at line 210 of file ipcache.cc.

Referenced by ipcache_init(), ipcache_purgelru(), and ipcache_restart().

dlink_list lru_list
static

Definition at line 190 of file ipcache.cc.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors