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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors