|
Squid Web Cache master
|
Classes | |
| struct | _ipcache_stats |
Functions | |
| int | ipcacheCount () |
| static void | ipcacheRelease (ipcache_entry *, bool dofree=true) |
| static ipcache_entry * | ipcache_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_table * | ip_table = nullptr |
| static long | ipcache_low = 180 |
| static long | ipcache_high = 200 |
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.
|
static |
Definition at line 324 of file ipcache.cc.
References hash_lookup(), and ip_table.
Referenced by ipcache_gethostbyname(), ipcache_nbgethostbyname_(), ipcacheAddEntryFromHosts(), ipcacheInvalidate(), ipcacheInvalidateNegative(), ipcacheMarkBadAddr(), and ipcacheMarkGoodAddr().
|
static |
Definition at line 422 of file ipcache.cc.
References dlinkAdd(), ipcache_entry::hash, hash_join(), hash_lookup(), ip_table, ipcacheRelease(), hash_link::key, ipcache_entry::lastref, ipcache_entry::lru, lru_list, and squid_curtime.
Referenced by ipcacheAddEntryFromHosts(), and ipcacheHandleReply().
|
static |
walks down the pending list, calling handlers
Definition at line 443 of file ipcache.cc.
References ipcache_entry::addrs, ipcache_entry::error_message, IpCacheLookupForwarder::finalCallback(), IpCacheLookupForwarder::forwardHits(), ipcache_entry::handler, ipcacheLockEntry(), ipcacheUnlockEntry(), ipcache_entry::lastref, and squid_curtime.
Referenced by ipcache_nbgethostbyname_(), and ipcacheHandleReply().
|
inline |
Definition at line 294 of file ipcache.cc.
References hash_table::count, and ip_table.
Referenced by ipcache_purgelru(), snmp_netIpFn(), and stat_ipcache_get().
|
static |
Definition at line 334 of file ipcache.cc.
References ipcache_entry::addrs, Dns::CachedIps::empty(), ipcache_entry::expires, ipcache_entry::flags, ipcache_entry::locks, ipcache_entry::Flags::negcached, and squid_curtime.
Referenced by ipcache_gethostbyname(), ipcache_nbgethostbyname_(), and ipcacheUnlockEntry().
|
static |
Definition at line 1085 of file ipcache.cc.
|
static |
Definition at line 562 of file ipcache.cc.
References ipcache_entry::addrs, _ipcache_stats::cname_only, Config, StatHist::count(), debugs, StatCounters::dns, Dns::CachedIps::empty(), ipcache_entry::error_message, ipcache_entry::expires, ipcache_entry::flags, IpCacheLookupForwarder::forwardLookup(), ipcache_entry::handler, ipcacheAddEntry(), ipcacheCallback(), ipcacheParse(), IpcacheStats, ipcache_entry::latestError(), ipcache_entry::name(), SquidConfig::negativeDnsTtl, ipcache_entry::Flags::negcached, _ipcache_stats::replies, ipcache_entry::sawCname, squid_curtime, statCounter, StatCounters::svcTime, and IpCacheLookupForwarder::totalResponseTime().
|
static |
Definition at line 914 of file ipcache.cc.
References dlinkAdd(), dlinkDelete(), ipcache_entry::locks, ipcache_entry::lru, and lru_list.
Referenced by ipcacheAddEntryFromHosts(), and ipcacheCallback().
|
static |
Definition at line 681 of file ipcache.cc.
References Mgr::RegisterAction(), and stat_ipcache_get().
Referenced by ipcache_init().
|
static |
removes the given ipcache entry
Definition at line 302 of file ipcache.cc.
References DBG_CRITICAL, debugs, dlinkDelete(), ipcache_entry::hash, hash_remove_link(), ip_table, ipcacheFreeEntry, hash_link::key, ipcache_entry::lru, and lru_list.
Referenced by ipcache_gethostbyname(), ipcache_nbgethostbyname_(), ipcache_purgelru(), ipcacheAddEntry(), ipcacheAddEntryFromHosts(), ipcacheUnlockEntry(), and purge_entries_fromhosts().
|
static |
Definition at line 770 of file ipcache.cc.
References ipcache_entry::addrs, Dns::CachedIps::badCount(), DBG_CRITICAL, debugs, ipcache_entry::expires, ipcache_entry::flags, ipcache_entry::Flags::fromhosts, ipcache_entry::hash, hashKeyStr(), int, ipcache_entry::lastref, MAX_IPSTRLEN, ipcache_entry::Flags::negcached, Dns::CachedIps::raw(), Dns::CachedIps::size(), squid_curtime, and storeAppendPrintf().
Referenced by stat_ipcache_get().
|
static |
Definition at line 924 of file ipcache.cc.
References DBG_IMPORTANT, debugs, ipcacheExpiredEntry(), ipcacheRelease(), and ipcache_entry::locks.
Referenced by ipcacheAddEntryFromHosts(), and ipcacheCallback().
|
static |
purges entries added from /etc/hosts (or whatever).
Definition at line 386 of file ipcache.cc.
References dlink_node::data, dlink_list::head, ipcacheRelease(), lru_list, and dlink_node::next.
|
static |
process objects list
Definition at line 821 of file ipcache.cc.
References assert, _ipcache_stats::cname_only, dlink_node::data, dlink_list::head, _ipcache_stats::hits, _ipcache_stats::invalid, ip_table, ipcacheCount(), ipcacheStatPrint(), IpcacheStats, lru_list, _ipcache_stats::misses, _ipcache_stats::negative_hits, dlink_node::next, _ipcache_stats::numeric_hits, _ipcache_stats::requests, _ipcache_stats::rr_a, _ipcache_stats::rr_aaaa, _ipcache_stats::rr_cname, and storeAppendPrintf().
Referenced by ipcacheRegisterWithCacheManager().
|
static |
Definition at line 207 of file ipcache.cc.
Referenced by ipcache_get(), ipcache_init(), ipcacheAddEntry(), ipcacheCount(), ipcacheRelease(), and stat_ipcache_get().
|
static |
Definition at line 212 of file ipcache.cc.
Referenced by ipcache_init(), and ipcache_restart().
|
static |
Definition at line 210 of file ipcache.cc.
Referenced by ipcache_init(), ipcache_purgelru(), and ipcache_restart().
|
static |
|
static |
Definition at line 190 of file ipcache.cc.
Referenced by ipcache_init(), ipcache_purgelru(), ipcacheAddEntry(), ipcacheLockEntry(), ipcacheRelease(), purge_entries_fromhosts(), and stat_ipcache_get().