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 = nullptr
 
static long ipcache_low = 180
 
static long ipcache_high = 200
 

Detailed Description

Note
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 
)
static

◆ ipcacheCount()

int ipcacheCount ( )
inline

Definition at line 293 of file ipcache.cc.

References hash_table::count, and ip_table.

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

◆ ipcacheExpiredEntry()

◆ ipcacheFreeEntry()

static void ipcacheFreeEntry ( void *  data)
static

Definition at line 1082 of file ipcache.cc.

◆ ipcacheHandleReply()

◆ ipcacheLockEntry()

static void ipcacheLockEntry ( ipcache_entry i)
static

◆ ipcacheRegisterWithCacheManager()

static void ipcacheRegisterWithCacheManager ( void  )
static

Definition at line 680 of file ipcache.cc.

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

Referenced by ipcache_init().

◆ ipcacheRelease()

◆ ipcacheStatPrint()

static void ipcacheStatPrint ( ipcache_entry i,
StoreEntry sentry 
)
static

◆ ipcacheUnlockEntry()

static void ipcacheUnlockEntry ( ipcache_entry i)
static

◆ purge_entries_fromhosts()

static void purge_entries_fromhosts ( void  )
static

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

Definition at line 385 of file ipcache.cc.

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

Referenced by ipcache_restart().

◆ stat_ipcache_get()

Variable Documentation

◆ ip_table

hash_table* ip_table = nullptr
static

◆ ipcache_high

long ipcache_high = 200
static

Definition at line 211 of file ipcache.cc.

Referenced by ipcache_init(), and ipcache_restart().

◆ ipcache_low

long ipcache_low = 180
static

Definition at line 209 of file ipcache.cc.

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

◆ IpcacheStats

◆ lru_list

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors