4 * DEBUG: section 35 FQDN Cache
5 * AUTHOR: Harvest Derived
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
37 #include "DnsLookupDetails.h"
39 #include "mgr/Registration.h"
40 #include "SquidTime.h"
41 #include "StatCounters.h"
46 \defgroup FQDNCacheAPI FQDN Cache API
48 \section Introduction Introduction
50 * The FQDN cache is a built-in component of squid providing
51 * Hostname to IP-Number translation functionality and managing
52 * the involved data-structures. Efficiency concerns require
53 * mechanisms that allow non-blocking access to these mappings.
54 * The FQDN cache usually doesn't block on a request except for
55 * special cases where this is desired (see below).
57 \todo FQDN Cache should have its own API *.h file.
61 \defgroup FQDNCacheInternal FQDN Cache Internals
64 * Internally, the execution flow is as follows:
65 * On a miss, fqdncache_nbgethostbyaddr() checks whether a request
66 * for this name is already pending, and if positive, it creates a
67 * new entry using fqdncacheAddEntry(). Then it calls
68 * fqdncacheAddPending() to add a request to the queue together
69 * with data and handler. Else, ifqdncache_dnsDispatch() is called
70 * to directly create a DNS query or to fqdncacheEnqueue() if all
71 * no DNS port is free.
74 * fqdncacheCallback() is called regularly to walk down the pending
75 * list and call handlers.
78 * LRU clean-up is performed through fqdncache_purgelru() according
79 * to the fqdncache_high threshold.
82 /// \ingroup FQDNCacheInternal
83 #define FQDN_LOW_WATER 90
85 /// \ingroup FQDNCacheInternal
86 #define FQDN_HIGH_WATER 95
90 * The data structure used for storing name-address mappings
91 * is a small hashtable (static hash_table *fqdn_table),
92 * where structures of type fqdncache_entry whose most
93 * interesting members are:
98 hash_link hash
; /* must be first */
101 unsigned char name_count
;
102 char *names
[FQDN_MAX_NAMES
+ 1];
107 struct timeval request_time
;
109 unsigned short locks
;
112 unsigned int negcached
:1;
113 unsigned int fromhosts
:1;
116 int age() const; ///< time passed since request_time or -1 if unknown
119 /// \ingroup FQDNCacheInternal
120 static struct _fqdn_cache_stats
{
128 /// \ingroup FQDNCacheInternal
129 static dlink_list lru_list
;
132 static HLPCB fqdncacheHandleReply
;
133 static int fqdncacheParse(fqdncache_entry
*, const char *buf
);
135 static IDNSCB fqdncacheHandleReply
;
136 static int fqdncacheParse(fqdncache_entry
*, rfc1035_rr
*, int, const char *error_message
);
138 static void fqdncacheRelease(fqdncache_entry
*);
139 static fqdncache_entry
*fqdncacheCreateEntry(const char *name
);
140 static void fqdncacheCallback(fqdncache_entry
*, int wait
);
141 static fqdncache_entry
*fqdncache_get(const char *);
142 static int fqdncacheExpiredEntry(const fqdncache_entry
*);
143 static void fqdncacheLockEntry(fqdncache_entry
* f
);
144 static void fqdncacheUnlockEntry(fqdncache_entry
* f
);
145 static FREE fqdncacheFreeEntry
;
146 static void fqdncacheAddEntry(fqdncache_entry
* f
);
148 /// \ingroup FQDNCacheInternal
149 static hash_table
*fqdn_table
= NULL
;
151 /// \ingroup FQDNCacheInternal
152 static long fqdncache_low
= 180;
154 /// \ingroup FQDNCacheInternal
155 static long fqdncache_high
= 200;
157 /// \ingroup FQDNCacheInternal
158 inline int fqdncacheCount() { return fqdn_table
? fqdn_table
->count
: 0; }
161 fqdncache_entry::age() const
163 return request_time
.tv_sec
? tvSubMsec(request_time
, current_time
) : -1;
168 \ingroup FQDNCacheInternal
169 * Removes the given fqdncache entry
172 fqdncacheRelease(fqdncache_entry
* f
)
175 hash_remove_link(fqdn_table
, (hash_link
*) f
);
177 for (k
= 0; k
< (int) f
->name_count
; k
++)
178 safe_free(f
->names
[k
]);
180 debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f
->hash
) << "'.");
182 dlinkDelete(&f
->lru
, &lru_list
);
184 safe_free(f
->hash
.key
);
186 safe_free(f
->error_message
);
188 memFree(f
, MEM_FQDNCACHE_ENTRY
);
192 \ingroup FQDNCacheInternal
193 \param name FQDN hash string.
194 \retval Match for given name
196 static fqdncache_entry
*
197 fqdncache_get(const char *name
)
200 static fqdncache_entry
*f
;
204 if ((e
= (hash_link
*)hash_lookup(fqdn_table
, name
)) != NULL
)
205 f
= (fqdncache_entry
*) e
;
211 /// \ingroup FQDNCacheInternal
213 fqdncacheExpiredEntry(const fqdncache_entry
* f
)
215 /* all static entries are locked, so this takes care of them too */
220 if (f
->expires
> squid_curtime
)
226 /// \ingroup FQDNCacheAPI
228 fqdncache_purgelru(void *notused
)
231 dlink_node
*prev
= NULL
;
234 eventAdd("fqdncache_purgelru", fqdncache_purgelru
, NULL
, 10.0, 1);
236 for (m
= lru_list
.tail
; m
; m
= prev
) {
237 if (fqdncacheCount() < fqdncache_low
)
242 f
= (fqdncache_entry
*)m
->data
;
252 debugs(35, 9, "fqdncache_purgelru: removed " << removed
<< " entries");
255 /// \ingroup FQDNCacheAPI
257 purge_entries_fromhosts(void)
259 dlink_node
*m
= lru_list
.head
;
260 fqdncache_entry
*i
= NULL
;
264 if (i
!= NULL
) { /* need to delay deletion */
265 fqdncacheRelease(i
); /* we just override locks */
269 t
= (fqdncache_entry
*)m
->data
;
271 if (t
->flags
.fromhosts
)
282 \ingroup FQDNCacheInternal
284 * Create blank fqdncache_entry
286 static fqdncache_entry
*
287 fqdncacheCreateEntry(const char *name
)
289 static fqdncache_entry
*f
;
290 f
= (fqdncache_entry
*)memAllocate(MEM_FQDNCACHE_ENTRY
);
291 f
->hash
.key
= xstrdup(name
);
292 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
296 /// \ingroup FQDNCacheInternal
298 fqdncacheAddEntry(fqdncache_entry
* f
)
300 hash_link
*e
= (hash_link
*)hash_lookup(fqdn_table
, f
->hash
.key
);
303 /* avoid colission */
304 fqdncache_entry
*q
= (fqdncache_entry
*) e
;
308 hash_join(fqdn_table
, &f
->hash
);
309 dlinkAdd(f
, &f
->lru
, &lru_list
);
310 f
->lastref
= squid_curtime
;
314 \ingroup FQDNCacheInternal
316 * Walks down the pending list, calling handlers
319 fqdncacheCallback(fqdncache_entry
* f
, int wait
)
323 f
->lastref
= squid_curtime
;
328 fqdncacheLockEntry(f
);
330 callback
= f
->handler
;
334 if (cbdataReferenceValidDone(f
->handlerData
, &cbdata
)) {
335 const DnsLookupDetails
details(f
->error_message
, wait
);
336 callback(f
->name_count
? f
->names
[0] : NULL
, details
, cbdata
);
339 fqdncacheUnlockEntry(f
);
342 /// \ingroup FQDNCacheInternal
345 fqdncacheParse(fqdncache_entry
*f
, const char *inbuf
)
347 LOCAL_ARRAY(char, buf
, DNS_INBUF_SZ
);
350 const char *name
= (const char *)f
->hash
.key
;
351 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
352 f
->flags
.negcached
= 1;
355 debugs(35, 1, "fqdncacheParse: Got <NULL> reply in response to '" << name
<< "'");
356 f
->error_message
= xstrdup("Internal Error");
360 xstrncpy(buf
, inbuf
, DNS_INBUF_SZ
);
361 debugs(35, 5, "fqdncacheParse: parsing: {" << buf
<< "}");
362 token
= strtok(buf
, w_space
);
365 debugs(35, 1, "fqdncacheParse: Got <NULL>, expecting '$name' in response to '" << name
<< "'");
366 f
->error_message
= xstrdup("Internal Error");
370 if (0 == strcmp(token
, "$fail")) {
371 token
= strtok(NULL
, "\n");
372 assert(NULL
!= token
);
373 f
->error_message
= xstrdup(token
);
377 if (0 != strcmp(token
, "$name")) {
378 debugs(35, 1, "fqdncacheParse: Got '" << inbuf
<< "', expecting '$name' in response to '" << name
<< "'");
379 f
->error_message
= xstrdup("Internal Error");
383 token
= strtok(NULL
, w_space
);
386 debugs(35, 1, "fqdncacheParse: Got '" << inbuf
<< "', expecting TTL in response to '" << name
<< "'");
387 f
->error_message
= xstrdup("Internal Error");
393 token
= strtok(NULL
, w_space
);
396 debugs(35, 1, "fqdncacheParse: Got '" << inbuf
<< "', expecting hostname in response to '" << name
<< "'");
397 f
->error_message
= xstrdup("Internal Error");
401 f
->names
[0] = xstrdup(token
);
404 if (ttl
== 0 || ttl
> Config
.positiveDnsTtl
)
405 ttl
= Config
.positiveDnsTtl
;
407 if (ttl
< Config
.negativeDnsTtl
)
408 ttl
= Config
.negativeDnsTtl
;
410 f
->expires
= squid_curtime
+ ttl
;
412 f
->flags
.negcached
= 0;
414 return f
->name_count
;
419 fqdncacheParse(fqdncache_entry
*f
, rfc1035_rr
* answers
, int nr
, const char *error_message
)
423 const char *name
= (const char *)f
->hash
.key
;
424 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
425 f
->flags
.negcached
= 1;
428 debugs(35, 3, "fqdncacheParse: Lookup of '" << name
<< "' failed (" << error_message
<< ")");
429 f
->error_message
= xstrdup(error_message
);
434 debugs(35, 3, "fqdncacheParse: No DNS records for '" << name
<< "'");
435 f
->error_message
= xstrdup("No DNS records");
439 debugs(35, 3, "fqdncacheParse: " << nr
<< " answers for '" << name
<< "'");
442 for (k
= 0; k
< nr
; k
++) {
443 if (answers
[k
]._class
!= RFC1035_CLASS_IN
)
446 if (answers
[k
].type
== RFC1035_TYPE_PTR
) {
447 if (!answers
[k
].rdata
[0]) {
448 debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name
<< "'");
452 if (strchr(answers
[k
].rdata
, ' ')) {
453 debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers
[k
].rdata
<< "' for '" << name
<< "'");
457 f
->names
[f
->name_count
++] = xstrdup(answers
[k
].rdata
);
458 } else if (answers
[k
].type
!= RFC1035_TYPE_CNAME
)
461 if (ttl
== 0 || (int) answers
[k
].ttl
< ttl
)
462 ttl
= answers
[k
].ttl
;
464 if (f
->name_count
>= FQDN_MAX_NAMES
)
468 if (f
->name_count
== 0) {
469 debugs(35, 1, "fqdncacheParse: No PTR record for '" << name
<< "'");
473 if (ttl
> Config
.positiveDnsTtl
)
474 ttl
= Config
.positiveDnsTtl
;
476 if (ttl
< Config
.negativeDnsTtl
)
477 ttl
= Config
.negativeDnsTtl
;
479 f
->expires
= squid_curtime
+ ttl
;
481 f
->flags
.negcached
= 0;
483 return f
->name_count
;
490 \ingroup FQDNCacheAPI
492 * Callback for handling DNS results.
496 fqdncacheHandleReply(void *data
, char *reply
)
498 fqdncacheHandleReply(void *data
, rfc1035_rr
* answers
, int na
, const char *error_message
)
502 static_cast<generic_cbdata
*>(data
)->unwrap(&f
);
503 ++FqdncacheStats
.replies
;
504 const int age
= f
->age();
505 statCounter
.dns
.svc_time
.count(age
);
508 fqdncacheParse(f
, reply
);
511 fqdncacheParse(f
, answers
, na
, error_message
);
514 fqdncacheAddEntry(f
);
516 fqdncacheCallback(f
, age
);
520 \ingroup FQDNCacheAPI
522 \param addr IP address of domain to resolve.
523 \param handler A pointer to the function to be called when
524 * the reply from the FQDN cache
525 * (or the DNS if the FQDN cache misses)
526 \param handlerData Information that is passed to the handler
527 * and does not affect the FQDN cache.
530 fqdncache_nbgethostbyaddr(const Ip::Address
&addr
, FQDNH
* handler
, void *handlerData
)
532 fqdncache_entry
*f
= NULL
;
533 char name
[MAX_IPSTRLEN
];
535 addr
.NtoA(name
,MAX_IPSTRLEN
);
536 debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name
<< "'.");
537 FqdncacheStats
.requests
++;
539 if (name
[0] == '\0') {
540 debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
541 const DnsLookupDetails
details("Invalid hostname", -1); // error, no lookup
543 handler(NULL
, details
, handlerData
);
547 f
= fqdncache_get(name
);
552 } else if (fqdncacheExpiredEntry(f
)) {
553 /* hit, but expired -- bummer */
558 debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name
<< "'");
560 if (f
->flags
.negcached
)
561 FqdncacheStats
.negative_hits
++;
563 FqdncacheStats
.hits
++;
565 f
->handler
= handler
;
567 f
->handlerData
= cbdataReference(handlerData
);
569 fqdncacheCallback(f
, -1); // no lookup
574 debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name
<< "'");
575 FqdncacheStats
.misses
++;
576 f
= fqdncacheCreateEntry(name
);
577 f
->handler
= handler
;
578 f
->handlerData
= cbdataReference(handlerData
);
579 f
->request_time
= current_time
;
580 c
= new generic_cbdata(f
);
583 dnsSubmit(hashKeyStr(&f
->hash
), fqdncacheHandleReply
, c
);
585 idnsPTRLookup(addr
, fqdncacheHandleReply
, c
);
589 /// \ingroup FQDNCacheInternal
591 fqdncacheRegisterWithCacheManager(void)
593 Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
599 \ingroup FQDNCacheAPI
601 * Initialize the fqdncache.
602 * Called after IP cache initialization.
609 fqdncacheRegisterWithCacheManager();
614 debugs(35, 3, "Initializing FQDN Cache...");
616 memset(&FqdncacheStats
, '\0', sizeof(FqdncacheStats
));
618 memset(&lru_list
, '\0', sizeof(lru_list
));
620 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
621 (float) FQDN_HIGH_WATER
) / (float) 100);
623 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
624 (float) FQDN_LOW_WATER
) / (float) 100);
626 n
= hashPrime(fqdncache_high
/ 4);
628 fqdn_table
= hash_create((HASHCMP
*) strcmp
, n
, hash4
);
630 memDataInit(MEM_FQDNCACHE_ENTRY
, "fqdncache_entry",
631 sizeof(fqdncache_entry
), 0);
635 \ingroup FQDNCacheAPI
637 * Is different in that it only checks if an entry exists in
638 * it's data-structures and does not by default contact the
639 * DNS, unless this is requested, by setting the flags
640 * to FQDN_LOOKUP_IF_MISS.
642 \param addr address of the FQDN being resolved
643 \param flags values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
647 fqdncache_gethostbyaddr(const Ip::Address
&addr
, int flags
)
649 char name
[MAX_IPSTRLEN
];
650 fqdncache_entry
*f
= NULL
;
652 if (addr
.IsAnyAddr() || addr
.IsNoAddr()) {
656 addr
.NtoA(name
,MAX_IPSTRLEN
);
657 FqdncacheStats
.requests
++;
658 f
= fqdncache_get(name
);
662 } else if (fqdncacheExpiredEntry(f
)) {
665 } else if (f
->flags
.negcached
) {
666 FqdncacheStats
.negative_hits
++;
667 // ignore f->error_message: the caller just checks FQDN cache presence
670 FqdncacheStats
.hits
++;
671 f
->lastref
= squid_curtime
;
672 // ignore f->error_message: the caller just checks FQDN cache presence
676 /* no entry [any more] */
678 FqdncacheStats
.misses
++;
680 if (flags
& FQDN_LOOKUP_IF_MISS
) {
681 fqdncache_nbgethostbyaddr(addr
, NULL
, NULL
);
689 \ingroup FQDNCacheInternal
691 * Process objects list
694 fqdnStats(StoreEntry
* sentry
)
696 fqdncache_entry
*f
= NULL
;
700 if (fqdn_table
== NULL
)
703 storeAppendPrintf(sentry
, "FQDN Cache Statistics:\n");
705 storeAppendPrintf(sentry
, "FQDNcache Entries In Use: %d\n",
706 memInUse(MEM_FQDNCACHE_ENTRY
));
708 storeAppendPrintf(sentry
, "FQDNcache Entries Cached: %d\n",
711 storeAppendPrintf(sentry
, "FQDNcache Requests: %d\n",
712 FqdncacheStats
.requests
);
714 storeAppendPrintf(sentry
, "FQDNcache Hits: %d\n",
715 FqdncacheStats
.hits
);
717 storeAppendPrintf(sentry
, "FQDNcache Negative Hits: %d\n",
718 FqdncacheStats
.negative_hits
);
720 storeAppendPrintf(sentry
, "FQDNcache Misses: %d\n",
721 FqdncacheStats
.misses
);
723 storeAppendPrintf(sentry
, "FQDN Cache Contents:\n\n");
725 storeAppendPrintf(sentry
, "%-45.45s %3s %3s %3s %s\n",
726 "Address", "Flg", "TTL", "Cnt", "Hostnames");
728 hash_first(fqdn_table
);
730 while ((f
= (fqdncache_entry
*) hash_next(fqdn_table
))) {
731 ttl
= (f
->flags
.fromhosts
? -1 : (f
->expires
- squid_curtime
));
732 storeAppendPrintf(sentry
, "%-45.45s %c%c %3.3d % 3d",
733 hashKeyStr(&f
->hash
),
734 f
->flags
.negcached
? 'N' : ' ',
735 f
->flags
.fromhosts
? 'H' : ' ',
737 (int) f
->name_count
);
739 for (k
= 0; k
< (int) f
->name_count
; k
++)
740 storeAppendPrintf(sentry
, " %s", f
->names
[k
]);
742 storeAppendPrintf(sentry
, "\n");
746 /// \ingroup FQDNCacheAPI
748 fqdnFromAddr(const Ip::Address
&addr
)
751 static char buf
[MAX_IPSTRLEN
];
753 if (Config
.onoff
.log_fqdn
&& (n
= fqdncache_gethostbyaddr(addr
, 0)))
756 /// \todo Perhapse this should use toHostname() instead of straight NtoA.
757 /// that would wrap the IPv6 properly when raw.
758 addr
.NtoA(buf
, MAX_IPSTRLEN
);
763 /// \ingroup FQDNCacheInternal
765 fqdncacheLockEntry(fqdncache_entry
* f
)
767 if (f
->locks
++ == 0) {
768 dlinkDelete(&f
->lru
, &lru_list
);
769 dlinkAdd(f
, &f
->lru
, &lru_list
);
773 /// \ingroup FQDNCacheInternal
775 fqdncacheUnlockEntry(fqdncache_entry
* f
)
777 assert(f
->locks
> 0);
780 if (fqdncacheExpiredEntry(f
))
784 /// \ingroup FQDNCacheInternal
786 fqdncacheFreeEntry(void *data
)
788 fqdncache_entry
*f
= (fqdncache_entry
*)data
;
791 for (k
= 0; k
< (int) f
->name_count
; k
++)
792 safe_free(f
->names
[k
]);
794 safe_free(f
->hash
.key
);
796 safe_free(f
->error_message
);
798 memFree(f
, MEM_FQDNCACHE_ENTRY
);
801 /// \ingroup FQDNCacheAPI
803 fqdncacheFreeMemory(void)
805 hashFreeItems(fqdn_table
, fqdncacheFreeEntry
);
806 hashFreeMemory(fqdn_table
);
811 \ingroup FQDNCacheAPI
813 * Recalculate FQDN cache size upon reconfigure.
814 * Is called to clear the FQDN cache's data structures,
815 * cancel all pending requests.
818 fqdncache_restart(void)
820 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
821 (float) FQDN_HIGH_WATER
) / (float) 100);
822 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
823 (float) FQDN_LOW_WATER
) / (float) 100);
824 purge_entries_fromhosts();
828 \ingroup FQDNCacheAPI
830 * Adds a "static" entry from /etc/hosts.
832 * The worldist is to be managed by the caller,
833 * including pointed-to strings
835 \param addr FQDN name to be added.
839 fqdncacheAddEntryFromHosts(char *addr
, wordlist
* hostnames
)
841 fqdncache_entry
*fce
;
844 if ((fce
= fqdncache_get(addr
))) {
845 if (1 == fce
->flags
.fromhosts
) {
846 fqdncacheUnlockEntry(fce
);
847 } else if (fce
->locks
> 0) {
848 debugs(35, 1, "fqdncacheAddEntryFromHosts: can't add static entry for locked address '" << addr
<< "'");
851 fqdncacheRelease(fce
);
855 fce
= fqdncacheCreateEntry(addr
);
858 fce
->names
[j
] = xstrdup(hostnames
->key
);
859 Tolower(fce
->names
[j
]);
861 hostnames
= hostnames
->next
;
863 if (j
>= FQDN_MAX_NAMES
)
868 fce
->names
[j
] = NULL
; /* it's safe */
869 fce
->flags
.fromhosts
= 1;
870 fqdncacheAddEntry(fce
);
871 fqdncacheLockEntry(fce
);
877 * \ingroup FQDNCacheAPI
878 * The function to return the FQDN statistics via SNMP
881 snmp_netFqdnFn(variable_list
* Var
, snint
* ErrP
)
883 variable_list
*Answer
= NULL
;
885 debugs(49, 5, "snmp_netFqdnFn: Processing request:" << snmpDebugOid(Var
->name
, Var
->name_length
, tmp
));
886 *ErrP
= SNMP_ERR_NOERROR
;
888 switch (Var
->name
[LEN_SQ_NET
+ 1]) {
891 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
897 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
898 FqdncacheStats
.requests
,
903 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
909 /* this is now worthless */
910 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
916 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
917 FqdncacheStats
.negative_hits
,
922 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
923 FqdncacheStats
.misses
,
928 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
934 *ErrP
= SNMP_ERR_NOSUCHNAME
;
941 #endif /*SQUID_SNMP */