fqdncache.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 35 FQDN Cache */
10 
11 #include "squid.h"
12 #include "cbdata.h"
13 #include "dns/forward.h"
14 #include "dns/LookupDetails.h"
15 #include "dns/rfc1035.h"
16 #include "event.h"
17 #include "fqdncache.h"
18 #include "helper.h"
19 #include "mgr/Registration.h"
20 #include "snmp_agent.h"
21 #include "SquidConfig.h"
22 #include "SquidTime.h"
23 #include "StatCounters.h"
24 #include "Store.h"
25 #include "util.h"
26 
27 #if SQUID_SNMP
28 #include "snmp_core.h"
29 #endif
30 
66 #define FQDN_LOW_WATER 90
68 
70 #define FQDN_HIGH_WATER 95
71 
79 {
81 
82 public:
83  fqdncache_entry(const char *name);
85 
86  hash_link hash; /* must be first */
87  time_t lastref;
88  time_t expires;
89  unsigned char name_count;
90  char *names[FQDN_MAX_NAMES + 1];
92  void *handlerData;
94 
95  struct timeval request_time;
97  unsigned short locks;
98 
99  struct Flags {
101 
102  bool negcached;
103  bool fromhosts;
104  } flags;
105 
106  int age() const;
107 };
108 
110 static struct _fqdn_cache_stats {
111  int requests;
112  int replies;
113  int hits;
114  int misses;
117 
120 
122 static int fqdncacheParse(fqdncache_entry *, const rfc1035_rr *, int, const char *error_message);
123 static void fqdncacheRelease(fqdncache_entry *);
124 static void fqdncacheCallback(fqdncache_entry *, int wait);
125 static fqdncache_entry *fqdncache_get(const char *);
126 static int fqdncacheExpiredEntry(const fqdncache_entry *);
127 static void fqdncacheLockEntry(fqdncache_entry * f);
128 static void fqdncacheUnlockEntry(fqdncache_entry * f);
130 static void fqdncacheAddEntry(fqdncache_entry * f);
131 
134 
136 static long fqdncache_low = 180;
137 
139 static long fqdncache_high = 200;
140 
142 inline int fqdncacheCount() { return fqdn_table ? fqdn_table->count : 0; }
143 
144 int
146 {
147  return request_time.tv_sec ? tvSubMsec(request_time, current_time) : -1;
148 }
149 
154 static void
156 {
158  debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f->hash) << "'.");
159  dlinkDelete(&f->lru, &lru_list);
160  delete f;
161 }
162 
168 static fqdncache_entry *
169 fqdncache_get(const char *name)
170 {
171  hash_link *e;
172  static fqdncache_entry *f;
173  f = NULL;
174 
175  if (fqdn_table) {
176  if ((e = (hash_link *)hash_lookup(fqdn_table, name)) != NULL)
177  f = (fqdncache_entry *) e;
178  }
179 
180  return f;
181 }
182 
184 static int
186 {
187  /* all static entries are locked, so this takes care of them too */
188 
189  if (f->locks != 0)
190  return 0;
191 
192  if (f->expires > squid_curtime)
193  return 0;
194 
195  return 1;
196 }
197 
199 void
201 {
202  dlink_node *m;
203  dlink_node *prev = NULL;
204  fqdncache_entry *f;
205  int removed = 0;
206  eventAdd("fqdncache_purgelru", fqdncache_purgelru, NULL, 10.0, 1);
207 
208  for (m = lru_list.tail; m; m = prev) {
210  break;
211 
212  prev = m->prev;
213 
214  f = (fqdncache_entry *)m->data;
215 
216  if (f->locks != 0)
217  continue;
218 
219  fqdncacheRelease(f);
220 
221  ++removed;
222  }
223 
224  debugs(35, 9, "fqdncache_purgelru: removed " << removed << " entries");
225 }
226 
228 static void
230 {
231  dlink_node *m = lru_list.head;
232  fqdncache_entry *i = NULL;
233  fqdncache_entry *t;
234 
235  while (m) {
236  if (i != NULL) { /* need to delay deletion */
237  fqdncacheRelease(i); /* we just override locks */
238  i = NULL;
239  }
240 
241  t = (fqdncache_entry *)m->data;
242 
243  if (t->flags.fromhosts)
244  i = t;
245 
246  m = m->next;
247  }
248 
249  if (i != NULL)
250  fqdncacheRelease(i);
251 }
252 
254  lastref(0),
255  expires(squid_curtime + Config.negativeDnsTtl),
256  name_count(0),
257  handler(nullptr),
258  handlerData(nullptr),
259  error_message(nullptr),
260  locks(0) // XXX: use Lock
261 {
262  hash.key = xstrdup(name);
263 
264  memset(&request_time, 0, sizeof(request_time));
265  memset(&names, 0, sizeof(names));
266 }
267 
269 static void
271 {
273 
274  if (NULL != e) {
275  /* avoid collision */
276  fqdncache_entry *q = (fqdncache_entry *) e;
277  fqdncacheRelease(q);
278  }
279 
280  hash_join(fqdn_table, &f->hash);
281  dlinkAdd(f, &f->lru, &lru_list);
282  f->lastref = squid_curtime;
283 }
284 
290 static void
292 {
293  FQDNH *callback;
294  void *cbdata;
295  f->lastref = squid_curtime;
296 
297  if (!f->handler)
298  return;
299 
301 
302  callback = f->handler;
303 
304  f->handler = NULL;
305 
307  const Dns::LookupDetails details(f->error_message, wait);
308  callback(f->name_count ? f->names[0] : NULL, details, cbdata);
309  }
310 
312 }
313 
315 static int
316 fqdncacheParse(fqdncache_entry *f, const rfc1035_rr * answers, int nr, const char *error_message)
317 {
318  int k;
319  int ttl = 0;
320  const char *name = (const char *)f->hash.key;
322  f->flags.negcached = true;
323 
324  if (nr < 0) {
325  debugs(35, 3, "fqdncacheParse: Lookup of '" << name << "' failed (" << error_message << ")");
326  f->error_message = xstrdup(error_message);
327  return -1;
328  }
329 
330  if (nr == 0) {
331  debugs(35, 3, "fqdncacheParse: No DNS records for '" << name << "'");
332  f->error_message = xstrdup("No DNS records");
333  return 0;
334  }
335 
336  debugs(35, 3, "fqdncacheParse: " << nr << " answers for '" << name << "'");
337  assert(answers);
338 
339  for (k = 0; k < nr; ++k) {
340  if (answers[k]._class != RFC1035_CLASS_IN)
341  continue;
342 
343  if (answers[k].type == RFC1035_TYPE_PTR) {
344  if (!answers[k].rdata[0]) {
345  debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name << "'");
346  continue;
347  }
348 
349  if (strchr(answers[k].rdata, ' ')) {
350  debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers[k].rdata << "' for '" << name << "'");
351  continue;
352  }
353 
354  f->names[f->name_count] = xstrdup(answers[k].rdata);
355  ++ f->name_count;
356  } else if (answers[k].type != RFC1035_TYPE_CNAME)
357  continue;
358 
359  if (ttl == 0 || (int) answers[k].ttl < ttl)
360  ttl = answers[k].ttl;
361 
362  if (f->name_count >= FQDN_MAX_NAMES)
363  break;
364  }
365 
366  if (f->name_count == 0) {
367  debugs(35, DBG_IMPORTANT, "fqdncacheParse: No PTR record for '" << name << "'");
368  return 0;
369  }
370 
371  if (ttl > Config.positiveDnsTtl)
372  ttl = Config.positiveDnsTtl;
373 
374  if (ttl < Config.negativeDnsTtl)
375  ttl = Config.negativeDnsTtl;
376 
377  f->expires = squid_curtime + ttl;
378 
379  f->flags.negcached = false;
380 
381  return f->name_count;
382 }
383 
389 static void
390 fqdncacheHandleReply(void *data, const rfc1035_rr * answers, int na, const char *error_message, const bool lastAnswer)
391 {
392  assert(lastAnswer); // reverse DNS lookups do not generate multiple queries
393  fqdncache_entry *f;
394  static_cast<generic_cbdata *>(data)->unwrap(&f);
396  const int age = f->age();
398  fqdncacheParse(f, answers, na, error_message);
400  fqdncacheCallback(f, age);
401 }
402 
413 void
414 fqdncache_nbgethostbyaddr(const Ip::Address &addr, FQDNH * handler, void *handlerData)
415 {
416  fqdncache_entry *f = NULL;
417  char name[MAX_IPSTRLEN];
418  generic_cbdata *c;
419  addr.toStr(name,MAX_IPSTRLEN);
420  debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name << "'.");
422 
423  if (name[0] == '\0') {
424  debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
425  const Dns::LookupDetails details("Invalid hostname", -1); // error, no lookup
426  if (handler)
427  handler(NULL, details, handlerData);
428  return;
429  }
430 
431  f = fqdncache_get(name);
432 
433  if (NULL == f) {
434  /* miss */
435  (void) 0;
436  } else if (fqdncacheExpiredEntry(f)) {
437  /* hit, but expired -- bummer */
438  fqdncacheRelease(f);
439  f = NULL;
440  } else {
441  /* hit */
442  debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name << "'");
443 
444  if (f->flags.negcached)
446  else
447  ++ FqdncacheStats.hits;
448 
449  f->handler = handler;
450 
451  f->handlerData = cbdataReference(handlerData);
452 
453  fqdncacheCallback(f, -1); // no lookup
454 
455  return;
456  }
457 
458  debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name << "'");
460  f = new fqdncache_entry(name);
461  f->handler = handler;
462  f->handlerData = cbdataReference(handlerData);
464  c = new generic_cbdata(f);
466 }
467 
480 const char *
481 fqdncache_gethostbyaddr(const Ip::Address &addr, int flags)
482 {
483  char name[MAX_IPSTRLEN];
484  fqdncache_entry *f = NULL;
485 
486  if (addr.isAnyAddr() || addr.isNoAddr()) {
487  return NULL;
488  }
489 
490  addr.toStr(name,MAX_IPSTRLEN);
492  f = fqdncache_get(name);
493 
494  if (NULL == f) {
495  (void) 0;
496  } else if (fqdncacheExpiredEntry(f)) {
497  fqdncacheRelease(f);
498  f = NULL;
499  } else if (f->flags.negcached) {
501  // ignore f->error_message: the caller just checks FQDN cache presence
502  return NULL;
503  } else {
504  ++ FqdncacheStats.hits;
505  f->lastref = squid_curtime;
506  // ignore f->error_message: the caller just checks FQDN cache presence
507  return f->names[0];
508  }
509 
510  /* no entry [any more] */
511 
513 
514  if (flags & FQDN_LOOKUP_IF_MISS) {
516  }
517 
518  return NULL;
519 }
520 
526 void
528 {
529  fqdncache_entry *f = NULL;
530  int k;
531  int ttl;
532 
533  if (fqdn_table == NULL)
534  return;
535 
536  storeAppendPrintf(sentry, "FQDN Cache Statistics:\n");
537 
538  storeAppendPrintf(sentry, "FQDNcache Entries In Use: %d\n",
540 
541  storeAppendPrintf(sentry, "FQDNcache Entries Cached: %d\n",
542  fqdncacheCount());
543 
544  storeAppendPrintf(sentry, "FQDNcache Requests: %d\n",
546 
547  storeAppendPrintf(sentry, "FQDNcache Hits: %d\n",
549 
550  storeAppendPrintf(sentry, "FQDNcache Negative Hits: %d\n",
552 
553  storeAppendPrintf(sentry, "FQDNcache Misses: %d\n",
555 
556  storeAppendPrintf(sentry, "FQDN Cache Contents:\n\n");
557 
558  storeAppendPrintf(sentry, "%-45.45s %3s %3s %3s %s\n",
559  "Address", "Flg", "TTL", "Cnt", "Hostnames");
560 
562 
563  while ((f = (fqdncache_entry *) hash_next(fqdn_table))) {
564  ttl = (f->flags.fromhosts ? -1 : (f->expires - squid_curtime));
565  storeAppendPrintf(sentry, "%-45.45s %c%c %3.3d % 3d",
566  hashKeyStr(&f->hash),
567  f->flags.negcached ? 'N' : ' ',
568  f->flags.fromhosts ? 'H' : ' ',
569  ttl,
570  (int) f->name_count);
571 
572  for (k = 0; k < (int) f->name_count; ++k)
573  storeAppendPrintf(sentry, " %s", f->names[k]);
574 
575  storeAppendPrintf(sentry, "\n");
576  }
577 }
578 
580 static void
582 {
583  if (f->locks++ == 0) {
584  dlinkDelete(&f->lru, &lru_list);
585  dlinkAdd(f, &f->lru, &lru_list);
586  }
587 }
588 
590 static void
592 {
593  assert(f->locks > 0);
594  -- f->locks;
595 
596  if (fqdncacheExpiredEntry(f))
597  fqdncacheRelease(f);
598 }
599 
601 static void
603 {
604  fqdncache_entry *f = (fqdncache_entry *)data;
605  delete f;
606 }
607 
609 {
610  for (int k = 0; k < (int)name_count; ++k)
611  xfree(names[k]);
612 
613  xfree(hash.key);
615 }
616 
618 void
620 {
623  fqdn_table = NULL;
624 }
625 
633 void
635 {
636  fqdncache_high = (long) (((float) Config.fqdncache.size *
637  (float) FQDN_HIGH_WATER) / (float) 100);
638  fqdncache_low = (long) (((float) Config.fqdncache.size *
639  (float) FQDN_LOW_WATER) / (float) 100);
641 }
642 
649 void
650 fqdncacheAddEntryFromHosts(char *addr, SBufList &hostnames)
651 {
652  fqdncache_entry *fce= fqdncache_get(addr);
653  if (fce) {
654  if (1 == fce->flags.fromhosts) {
656  } else if (fce->locks > 0) {
657  debugs(35, DBG_IMPORTANT, "WARNING: can't add static entry for locked address '" << addr << "'");
658  return;
659  } else {
660  fqdncacheRelease(fce);
661  }
662  }
663 
664  fce = new fqdncache_entry(addr);
665 
666  int j = 0;
667  for (auto &h : hostnames) {
668  fce->names[j] = xstrdup(h.c_str());
669  Tolower(fce->names[j]);
670  ++j;
671 
672  if (j >= FQDN_MAX_NAMES)
673  break;
674  }
675 
676  fce->name_count = j;
677  fce->names[j] = NULL; /* it's safe */
678  fce->flags.fromhosts = true;
679  fqdncacheAddEntry(fce);
680  fqdncacheLockEntry(fce);
681 }
682 
684 static void
686 {
687  Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
688  fqdnStats, 0, 1);
689 
690 }
691 
698 void
700 {
701  int n;
702 
704 
705  if (fqdn_table)
706  return;
707 
708  debugs(35, 3, "Initializing FQDN Cache...");
709 
710  memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
711  lru_list = dlink_list();
712 
713  fqdncache_high = (long) (((float) Config.fqdncache.size *
714  (float) FQDN_HIGH_WATER) / (float) 100);
715 
716  fqdncache_low = (long) (((float) Config.fqdncache.size *
717  (float) FQDN_LOW_WATER) / (float) 100);
718 
719  n = hashPrime(fqdncache_high / 4);
720 
721  fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4);
722 }
723 
724 #if SQUID_SNMP
725 
731 {
732  variable_list *Answer = NULL;
733  MemBuf tmp;
734  debugs(49, 5, "snmp_netFqdnFn: Processing request:" << snmpDebugOid(Var->name, Var->name_length, tmp));
735  *ErrP = SNMP_ERR_NOERROR;
736 
737  switch (Var->name[LEN_SQ_NET + 1]) {
738 
739  case FQDN_ENT:
740  Answer = snmp_var_new_integer(Var->name, Var->name_length,
741  fqdncacheCount(),
742  SMI_GAUGE32);
743  break;
744 
745  case FQDN_REQ:
746  Answer = snmp_var_new_integer(Var->name, Var->name_length,
748  SMI_COUNTER32);
749  break;
750 
751  case FQDN_HITS:
752  Answer = snmp_var_new_integer(Var->name, Var->name_length,
754  SMI_COUNTER32);
755  break;
756 
757  case FQDN_PENDHIT:
758  /* this is now worthless */
759  Answer = snmp_var_new_integer(Var->name, Var->name_length,
760  0,
761  SMI_GAUGE32);
762  break;
763 
764  case FQDN_NEGHIT:
765  Answer = snmp_var_new_integer(Var->name, Var->name_length,
767  SMI_COUNTER32);
768  break;
769 
770  case FQDN_MISS:
771  Answer = snmp_var_new_integer(Var->name, Var->name_length,
773  SMI_COUNTER32);
774  break;
775 
776  case FQDN_GHBN:
777  Answer = snmp_var_new_integer(Var->name, Var->name_length,
778  0, /* deprecated */
779  SMI_COUNTER32);
780  break;
781 
782  default:
783  *ErrP = SNMP_ERR_NOSUCHNAME;
784  break;
785  }
786 
787  return Answer;
788 }
789 
790 #endif /*SQUID_SNMP */
791 
struct timeval request_time
Definition: fqdncache.cc:95
#define FQDN_LOOKUP_IF_MISS
Definition: defines.h:34
static long fqdncache_high
Definition: fqdncache.cc:139
SQUIDCEXTERN HASHHASH hash4
Definition: hash.h:46
#define RFC1035_TYPE_CNAME
Definition: rfc1035.h:94
void idnsPTRLookup(const Ip::Address &, IDNSCB *, void *)
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
Definition: snmp_core.cc:1052
time_t expires
Definition: fqdncache.cc:88
bool fromhosts
Definition: fqdncache.cc:103
#define cbdataReferenceValidDone(var, ptr)
Definition: cbdata.h:256
static int UseCount()
Definition: fqdncache.cc:80
void FREE(void *)
Definition: forward.h:36
void fqdnStats(StoreEntry *sentry)
Definition: fqdncache.cc:527
@ FQDN_HITS
Definition: cache_snmp.h:205
static void handler(int signo)
Definition: purge.cc:854
bool isAnyAddr() const
Definition: Address.cc:170
static IDNSCB fqdncacheHandleReply
Definition: fqdncache.cc:121
@ FQDN_MISS
Definition: cache_snmp.h:208
std::list< SBuf > SBufList
Definition: forward.h:22
struct SquidConfig::@108 fqdncache
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:869
SQUIDCEXTERN void hash_remove_link(hash_table *, hash_link *)
Definition: hash.cc:220
unsigned short locks
Definition: fqdncache.cc:97
static long fqdncache_low
Definition: fqdncache.cc:136
#define xstrdup
Definition: cbdata.cc:60
int type
Definition: errorpage.cc:153
SQUIDCEXTERN void hashFreeItems(hash_table *, HASHFREE *)
Definition: hash.cc:252
int HASHCMP(const void *, const void *)
Definition: hash.h:13
int count
Definition: hash.h:31
SQUIDCEXTERN void Tolower(char *)
Definition: util.c:28
#define cbdataReference(var)
Definition: cbdata.h:341
SQUIDCEXTERN void hash_join(hash_table *, hash_link *)
Definition: hash.cc:131
SQUIDCEXTERN void hashFreeMemory(hash_table *)
Definition: hash.cc:268
#define DBG_IMPORTANT
Definition: Debug.h:41
void fqdncache_init(void)
Definition: fqdncache.cc:699
char * toStr(char *buf, const unsigned int blen, int force=AF_UNSPEC) const
Definition: Address.cc:792
int name_length
Definition: snmp_vars.h:47
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
Definition: forward.h:25
oid * name
Definition: snmp_vars.h:46
#define FQDN_MAX_NAMES
Definition: defines.h:35
#define FQDN_HIGH_WATER
Definition: fqdncache.cc:70
void fqdncacheAddEntryFromHosts(char *addr, SBufList &hostnames)
Definition: fqdncache.cc:650
#define RFC1035_TYPE_PTR
Definition: rfc1035.h:95
int64_t snint
Definition: cache_snmp.h:14
StatHist svcTime
Definition: StatCounters.h:98
const char * fqdncache_gethostbyaddr(const Ip::Address &addr, int flags)
Definition: fqdncache.cc:481
#define NULL
Definition: types.h:166
hash_link hash
Definition: fqdncache.cc:86
static fqdncache_entry * fqdncache_get(const char *)
Definition: fqdncache.cc:169
static hash_table * fqdn_table
Definition: fqdncache.cc:133
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
@ FQDN_ENT
Definition: cache_snmp.h:203
@ FQDN_NEGHIT
Definition: cache_snmp.h:207
static void fqdncacheRelease(fqdncache_entry *)
Definition: fqdncache.cc:155
void fqdncache_purgelru(void *)
Definition: fqdncache.cc:200
struct fqdncache_entry::Flags flags
static int fqdncacheParse(fqdncache_entry *, const rfc1035_rr *, int, const char *error_message)
Definition: fqdncache.cc:316
Definition: MemBuf.h:24
@ FQDN_GHBN
Definition: cache_snmp.h:209
#define SMI_GAUGE32
Definition: snmp_vars.h:77
struct variable_list * snmp_var_new_integer(oid *, int, int, unsigned char)
Definition: snmp_vars.c:151
SQUIDCEXTERN void hash_first(hash_table *)
Definition: hash.cc:172
time_t positiveDnsTtl
Definition: SquidConfig.h:104
Flags()
Definition: fqdncache.cc:100
int tvSubMsec(struct timeval, struct timeval)
Definition: time.cc:37
void count(double val)
Definition: StatHist.cc:57
#define assert(EX)
Definition: assert.h:19
SQUIDCEXTERN const char * hashKeyStr(const hash_link *)
Definition: hash.cc:313
time_t negativeDnsTtl
Definition: SquidConfig.h:103
encapsulates DNS lookup results
Definition: LookupDetails.h:21
static void fqdncacheAddEntry(fqdncache_entry *f)
Definition: fqdncache.cc:270
dlink_node lru
Definition: fqdncache.cc:96
Definition: fqdncache.cc:79
variable_list * snmp_netFqdnFn(variable_list *Var, snint *ErrP)
Definition: fqdncache.cc:730
time_t squid_curtime
Definition: stub_time.cc:17
void fqdncache_nbgethostbyaddr(const Ip::Address &addr, FQDNH *handler, void *handlerData)
Definition: fqdncache.cc:414
static void purge_entries_fromhosts(void)
Definition: fqdncache.cc:229
@ FQDN_PENDHIT
Definition: cache_snmp.h:206
bool isNoAddr() const
Definition: Address.cc:284
#define xfree
unsigned int ttl
Definition: rfc1035.h:42
static void fqdncacheLockEntry(fqdncache_entry *f)
Definition: fqdncache.cc:581
@ FQDN_REQ
Definition: cache_snmp.h:204
int fqdncacheCount()
Definition: fqdncache.cc:142
static void fqdncacheRegisterWithCacheManager(void)
Definition: fqdncache.cc:685
Definition: fqdncache.cc:99
#define FQDN_LOW_WATER
Definition: fqdncache.cc:67
time_t lastref
Definition: fqdncache.cc:87
struct timeval current_time
Definition: stub_time.cc:15
char * error_message
Definition: fqdncache.cc:93
static int fqdncacheExpiredEntry(const fqdncache_entry *)
Definition: fqdncache.cc:185
void * handlerData
Definition: fqdncache.cc:92
#define LEN_SQ_NET
Definition: cache_snmp.h:49
#define MEMPROXY_CLASS(CLASS)
void fqdncacheFreeMemory(void)
Definition: fqdncache.cc:619
void IDNSCB(void *cbdata, const rfc1035_rr *answer, const int recordsInAnswer, const char *error, bool lastAnswer)
Definition: forward.h:16
unsigned char name_count
Definition: fqdncache.cc:89
static void fqdncacheUnlockEntry(fqdncache_entry *f)
Definition: fqdncache.cc:591
SQUIDCEXTERN hash_link * hash_next(hash_table *)
Definition: hash.cc:188
static struct _fqdn_cache_stats FqdncacheStats
SQUIDCEXTERN hash_table * hash_create(HASHCMP *, int, HASHHASH *)
Definition: hash.cc:108
struct StatCounters::@133 dns
char * names[FQDN_MAX_NAMES+1]
Definition: fqdncache.cc:90
void fqdncache_restart(void)
Definition: fqdncache.cc:634
#define SNMP_ERR_NOSUCHNAME
Definition: snmp_error.h:44
void FQDNH(const char *, const Dns::LookupDetails &details, void *)
Definition: fqdncache.h:23
#define RFC1035_CLASS_IN
Definition: rfc1035.h:96
void RegisterAction(char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
Definition: Registration.cc:16
int age() const
time passed since request_time or -1 if unknown
Definition: fqdncache.cc:145
fqdncache_entry(const char *name)
Definition: fqdncache.cc:253
static FREE fqdncacheFreeEntry
Definition: fqdncache.cc:129
SQUIDCEXTERN hash_link * hash_lookup(hash_table *, const void *)
Definition: hash.cc:146
bool negcached
Definition: fqdncache.cc:102
#define false
Definition: GnuRegex.c:233
SQUIDCEXTERN int hashPrime(int n)
Definition: hash.cc:293
~fqdncache_entry()
Definition: fqdncache.cc:608
FQDNH * handler
Definition: fqdncache.cc:91
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:108
static void fqdncacheCallback(fqdncache_entry *, int wait)
Definition: fqdncache.cc:291
#define SNMP_ERR_NOERROR
Definition: snmp_error.h:42
class SquidConfig Config
Definition: SquidConfig.cc:12
int unsigned int
Definition: stub_fd.cc:19
#define SMI_COUNTER32
Definition: snmp_vars.h:76
StatCounters statCounter
Definition: StatCounters.cc:12
static dlink_list lru_list
Definition: fqdncache.cc:119

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors