Collaboration diagram for IP Cache Internals:


struct  _ipcache_stats


int ipcacheCount ()
static void ipcacheRelease (ipcache_entry *, bool dofree=true)
static ipcache_entryipcache_get (const char *)
static int ipcacheExpiredEntry (ipcache_entry *)
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 *, StoreEntry *)
static void stat_ipcache_get (StoreEntry *)
static void ipcacheLockEntry (ipcache_entry *)
static void ipcacheUnlockEntry (ipcache_entry *)
static void ipcacheFreeEntry (void *data)


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

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

◆ ipcache_get()

◆ ipcacheAddEntry()

◆ ipcacheCallback()

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

◆ ipcacheCount()

int ipcacheCount ( )

Definition at line 290 of file

References hash_table::count, and ip_table.

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

◆ ipcacheExpiredEntry()

◆ ipcacheFreeEntry()

static void ipcacheFreeEntry ( void *  data)

Definition at line 1072 of file

References data.

◆ ipcacheHandleReply()

◆ ipcacheLockEntry()

static void ipcacheLockEntry ( ipcache_entry i)

◆ ipcacheRegisterWithCacheManager()

static void ipcacheRegisterWithCacheManager ( void  )

Definition at line 670 of file

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

Referenced by ipcache_init().

◆ ipcacheRelease()

◆ ipcacheStatPrint()

static void ipcacheStatPrint ( ipcache_entry i,
StoreEntry sentry 
Negative-cached entries have no IPs listed.
Cached entries have IPs listed with a BNF of: ip-address '-' ('OK'|'BAD')

Definition at line 759 of file

References ipcache_entry::addrs, buf, DBG_CRITICAL, debugs, ipcache_entry::expires, ipcache_entry::flags, ipcache_entry::Flags::fromhosts, ipcache_entry::hash, hashKeyStr(), HERE(), ipcache_entry::lastref, MAX_IPSTRLEN, ipcache_entry::Flags::negcached, squid_curtime, and storeAppendPrintf().

Referenced by stat_ipcache_get().

◆ ipcacheUnlockEntry()

static void ipcacheUnlockEntry ( ipcache_entry i)

◆ purge_entries_fromhosts()

static void purge_entries_fromhosts ( void  )

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

Definition at line 382 of file

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

Referenced by ipcache_restart().

◆ stat_ipcache_get()

Variable Documentation

◆ ip_table

◆ ipcache_high

long ipcache_high = 200

Definition at line 210 of file

Referenced by ipcache_init(), and ipcache_restart().

◆ ipcache_low

long ipcache_low = 180

Definition at line 208 of file

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

◆ IpcacheStats

◆ lru_list






Web Site Translations