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"
42 #include "SquidTime.h"
43 #include "StatCounters.h"
48 \defgroup FQDNCacheAPI FQDN Cache API
50 \section Introduction Introduction
52 * The FQDN cache is a built-in component of squid providing
53 * Hostname to IP-Number translation functionality and managing
54 * the involved data-structures. Efficiency concerns require
55 * mechanisms that allow non-blocking access to these mappings.
56 * The FQDN cache usually doesn't block on a request except for
57 * special cases where this is desired (see below).
59 \todo FQDN Cache should have its own API *.h file.
63 \defgroup FQDNCacheInternal FQDN Cache Internals
66 * Internally, the execution flow is as follows:
67 * On a miss, fqdncache_nbgethostbyaddr() checks whether a request
68 * for this name is already pending, and if positive, it creates a
69 * new entry using fqdncacheAddEntry(). Then it calls
70 * fqdncacheAddPending() to add a request to the queue together
71 * with data and handler. Else, ifqdncache_dnsDispatch() is called
72 * to directly create a DNS query or to fqdncacheEnqueue() if all
73 * no DNS port is free.
76 * fqdncacheCallback() is called regularly to walk down the pending
77 * list and call handlers.
80 * LRU clean-up is performed through fqdncache_purgelru() according
81 * to the fqdncache_high threshold.
84 /// \ingroup FQDNCacheInternal
85 #define FQDN_LOW_WATER 90
87 /// \ingroup FQDNCacheInternal
88 #define FQDN_HIGH_WATER 95
92 * The data structure used for storing name-address mappings
93 * is a small hashtable (static hash_table *fqdn_table),
94 * where structures of type fqdncache_entry whose most
95 * interesting members are:
100 hash_link hash
; /* must be first */
103 unsigned char name_count
;
104 char *names
[FQDN_MAX_NAMES
+ 1];
109 struct timeval request_time
;
111 unsigned short locks
;
114 unsigned int negcached
:1;
115 unsigned int fromhosts
:1;
118 int age() const; ///< time passed since request_time or -1 if unknown
121 /// \ingroup FQDNCacheInternal
122 static struct _fqdn_cache_stats
{
130 /// \ingroup FQDNCacheInternal
131 static dlink_list lru_list
;
134 static HLPCB fqdncacheHandleReply
;
135 static int fqdncacheParse(fqdncache_entry
*, const char *buf
);
137 static IDNSCB fqdncacheHandleReply
;
138 static int fqdncacheParse(fqdncache_entry
*, const rfc1035_rr
*, int, const char *error_message
);
140 static void fqdncacheRelease(fqdncache_entry
*);
141 static fqdncache_entry
*fqdncacheCreateEntry(const char *name
);
142 static void fqdncacheCallback(fqdncache_entry
*, int wait
);
143 static fqdncache_entry
*fqdncache_get(const char *);
144 static int fqdncacheExpiredEntry(const fqdncache_entry
*);
145 static void fqdncacheLockEntry(fqdncache_entry
* f
);
146 static void fqdncacheUnlockEntry(fqdncache_entry
* f
);
147 static FREE fqdncacheFreeEntry
;
148 static void fqdncacheAddEntry(fqdncache_entry
* f
);
150 /// \ingroup FQDNCacheInternal
151 static hash_table
*fqdn_table
= NULL
;
153 /// \ingroup FQDNCacheInternal
154 static long fqdncache_low
= 180;
156 /// \ingroup FQDNCacheInternal
157 static long fqdncache_high
= 200;
159 /// \ingroup FQDNCacheInternal
160 inline int fqdncacheCount() { return fqdn_table
? fqdn_table
->count
: 0; }
163 fqdncache_entry::age() const
165 return request_time
.tv_sec
? tvSubMsec(request_time
, current_time
) : -1;
169 \ingroup FQDNCacheInternal
170 * Removes the given fqdncache entry
173 fqdncacheRelease(fqdncache_entry
* f
)
176 hash_remove_link(fqdn_table
, (hash_link
*) f
);
178 for (k
= 0; k
< (int) f
->name_count
; ++k
)
179 safe_free(f
->names
[k
]);
181 debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f
->hash
) << "'.");
183 dlinkDelete(&f
->lru
, &lru_list
);
185 safe_free(f
->hash
.key
);
187 safe_free(f
->error_message
);
189 memFree(f
, MEM_FQDNCACHE_ENTRY
);
193 \ingroup FQDNCacheInternal
194 \param name FQDN hash string.
195 \retval Match for given name
197 static fqdncache_entry
*
198 fqdncache_get(const char *name
)
201 static fqdncache_entry
*f
;
205 if ((e
= (hash_link
*)hash_lookup(fqdn_table
, name
)) != NULL
)
206 f
= (fqdncache_entry
*) e
;
212 /// \ingroup FQDNCacheInternal
214 fqdncacheExpiredEntry(const fqdncache_entry
* f
)
216 /* all static entries are locked, so this takes care of them too */
221 if (f
->expires
> squid_curtime
)
227 /// \ingroup FQDNCacheAPI
229 fqdncache_purgelru(void *notused
)
232 dlink_node
*prev
= NULL
;
235 eventAdd("fqdncache_purgelru", fqdncache_purgelru
, NULL
, 10.0, 1);
237 for (m
= lru_list
.tail
; m
; m
= prev
) {
238 if (fqdncacheCount() < fqdncache_low
)
243 f
= (fqdncache_entry
*)m
->data
;
253 debugs(35, 9, "fqdncache_purgelru: removed " << removed
<< " entries");
256 /// \ingroup FQDNCacheAPI
258 purge_entries_fromhosts(void)
260 dlink_node
*m
= lru_list
.head
;
261 fqdncache_entry
*i
= NULL
;
265 if (i
!= NULL
) { /* need to delay deletion */
266 fqdncacheRelease(i
); /* we just override locks */
270 t
= (fqdncache_entry
*)m
->data
;
272 if (t
->flags
.fromhosts
)
283 \ingroup FQDNCacheInternal
285 * Create blank fqdncache_entry
287 static fqdncache_entry
*
288 fqdncacheCreateEntry(const char *name
)
290 static fqdncache_entry
*f
;
291 f
= (fqdncache_entry
*)memAllocate(MEM_FQDNCACHE_ENTRY
);
292 f
->hash
.key
= xstrdup(name
);
293 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
297 /// \ingroup FQDNCacheInternal
299 fqdncacheAddEntry(fqdncache_entry
* f
)
301 hash_link
*e
= (hash_link
*)hash_lookup(fqdn_table
, f
->hash
.key
);
304 /* avoid colission */
305 fqdncache_entry
*q
= (fqdncache_entry
*) e
;
309 hash_join(fqdn_table
, &f
->hash
);
310 dlinkAdd(f
, &f
->lru
, &lru_list
);
311 f
->lastref
= squid_curtime
;
315 \ingroup FQDNCacheInternal
317 * Walks down the pending list, calling handlers
320 fqdncacheCallback(fqdncache_entry
* f
, int wait
)
324 f
->lastref
= squid_curtime
;
329 fqdncacheLockEntry(f
);
331 callback
= f
->handler
;
335 if (cbdataReferenceValidDone(f
->handlerData
, &cbdata
)) {
336 const DnsLookupDetails
details(f
->error_message
, wait
);
337 callback(f
->name_count
? f
->names
[0] : NULL
, details
, cbdata
);
340 fqdncacheUnlockEntry(f
);
343 /// \ingroup FQDNCacheInternal
346 fqdncacheParse(fqdncache_entry
*f
, const char *inbuf
)
348 LOCAL_ARRAY(char, buf
, DNS_INBUF_SZ
);
351 const char *name
= (const char *)f
->hash
.key
;
352 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
353 f
->flags
.negcached
= 1;
356 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL> reply in response to '" << name
<< "'");
357 f
->error_message
= xstrdup("Internal Error");
361 xstrncpy(buf
, inbuf
, DNS_INBUF_SZ
);
362 debugs(35, 5, "fqdncacheParse: parsing: {" << buf
<< "}");
363 token
= strtok(buf
, w_space
);
366 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL>, expecting '$name' in response to '" << name
<< "'");
367 f
->error_message
= xstrdup("Internal Error");
371 if (0 == strcmp(token
, "$fail")) {
372 token
= strtok(NULL
, "\n");
373 assert(NULL
!= token
);
374 f
->error_message
= xstrdup(token
);
378 if (0 != strcmp(token
, "$name")) {
379 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting '$name' in response to '" << name
<< "'");
380 f
->error_message
= xstrdup("Internal Error");
384 token
= strtok(NULL
, w_space
);
387 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting TTL in response to '" << name
<< "'");
388 f
->error_message
= xstrdup("Internal Error");
394 token
= strtok(NULL
, w_space
);
397 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting hostname in response to '" << name
<< "'");
398 f
->error_message
= xstrdup("Internal Error");
402 f
->names
[0] = xstrdup(token
);
405 if (ttl
== 0 || ttl
> Config
.positiveDnsTtl
)
406 ttl
= Config
.positiveDnsTtl
;
408 if (ttl
< Config
.negativeDnsTtl
)
409 ttl
= Config
.negativeDnsTtl
;
411 f
->expires
= squid_curtime
+ ttl
;
413 f
->flags
.negcached
= 0;
415 return f
->name_count
;
420 fqdncacheParse(fqdncache_entry
*f
, const rfc1035_rr
* answers
, int nr
, const char *error_message
)
424 const char *name
= (const char *)f
->hash
.key
;
425 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
426 f
->flags
.negcached
= 1;
429 debugs(35, 3, "fqdncacheParse: Lookup of '" << name
<< "' failed (" << error_message
<< ")");
430 f
->error_message
= xstrdup(error_message
);
435 debugs(35, 3, "fqdncacheParse: No DNS records for '" << name
<< "'");
436 f
->error_message
= xstrdup("No DNS records");
440 debugs(35, 3, "fqdncacheParse: " << nr
<< " answers for '" << name
<< "'");
443 for (k
= 0; k
< nr
; ++k
) {
444 if (answers
[k
]._class
!= RFC1035_CLASS_IN
)
447 if (answers
[k
].type
== RFC1035_TYPE_PTR
) {
448 if (!answers
[k
].rdata
[0]) {
449 debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name
<< "'");
453 if (strchr(answers
[k
].rdata
, ' ')) {
454 debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers
[k
].rdata
<< "' for '" << name
<< "'");
458 f
->names
[f
->name_count
] = xstrdup(answers
[k
].rdata
);
460 } else if (answers
[k
].type
!= RFC1035_TYPE_CNAME
)
463 if (ttl
== 0 || (int) answers
[k
].ttl
< ttl
)
464 ttl
= answers
[k
].ttl
;
466 if (f
->name_count
>= FQDN_MAX_NAMES
)
470 if (f
->name_count
== 0) {
471 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: No PTR record for '" << name
<< "'");
475 if (ttl
> Config
.positiveDnsTtl
)
476 ttl
= Config
.positiveDnsTtl
;
478 if (ttl
< Config
.negativeDnsTtl
)
479 ttl
= Config
.negativeDnsTtl
;
481 f
->expires
= squid_curtime
+ ttl
;
483 f
->flags
.negcached
= 0;
485 return f
->name_count
;
491 \ingroup FQDNCacheAPI
493 * Callback for handling DNS results.
497 fqdncacheHandleReply(void *data
, char *reply
)
499 fqdncacheHandleReply(void *data
, const rfc1035_rr
* answers
, int na
, const char *error_message
)
503 static_cast<generic_cbdata
*>(data
)->unwrap(&f
);
504 ++FqdncacheStats
.replies
;
505 const int age
= f
->age();
506 statCounter
.dns
.svcTime
.count(age
);
509 fqdncacheParse(f
, reply
);
512 fqdncacheParse(f
, answers
, na
, error_message
);
515 fqdncacheAddEntry(f
);
517 fqdncacheCallback(f
, age
);
521 \ingroup FQDNCacheAPI
523 \param addr IP address of domain to resolve.
524 \param handler A pointer to the function to be called when
525 * the reply from the FQDN cache
526 * (or the DNS if the FQDN cache misses)
527 \param handlerData Information that is passed to the handler
528 * and does not affect the FQDN cache.
531 fqdncache_nbgethostbyaddr(const Ip::Address
&addr
, FQDNH
* handler
, void *handlerData
)
533 fqdncache_entry
*f
= NULL
;
534 char name
[MAX_IPSTRLEN
];
536 addr
.NtoA(name
,MAX_IPSTRLEN
);
537 debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name
<< "'.");
538 ++FqdncacheStats
.requests
;
540 if (name
[0] == '\0') {
541 debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
542 const DnsLookupDetails
details("Invalid hostname", -1); // error, no lookup
544 handler(NULL
, details
, handlerData
);
548 f
= fqdncache_get(name
);
553 } else if (fqdncacheExpiredEntry(f
)) {
554 /* hit, but expired -- bummer */
559 debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name
<< "'");
561 if (f
->flags
.negcached
)
562 ++ FqdncacheStats
.negative_hits
;
564 ++ FqdncacheStats
.hits
;
566 f
->handler
= handler
;
568 f
->handlerData
= cbdataReference(handlerData
);
570 fqdncacheCallback(f
, -1); // no lookup
575 debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name
<< "'");
576 ++ FqdncacheStats
.misses
;
577 f
= fqdncacheCreateEntry(name
);
578 f
->handler
= handler
;
579 f
->handlerData
= cbdataReference(handlerData
);
580 f
->request_time
= current_time
;
581 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
);
688 \ingroup FQDNCacheInternal
690 * Process objects list
693 fqdnStats(StoreEntry
* sentry
)
695 fqdncache_entry
*f
= NULL
;
699 if (fqdn_table
== NULL
)
702 storeAppendPrintf(sentry
, "FQDN Cache Statistics:\n");
704 storeAppendPrintf(sentry
, "FQDNcache Entries In Use: %d\n",
705 memInUse(MEM_FQDNCACHE_ENTRY
));
707 storeAppendPrintf(sentry
, "FQDNcache Entries Cached: %d\n",
710 storeAppendPrintf(sentry
, "FQDNcache Requests: %d\n",
711 FqdncacheStats
.requests
);
713 storeAppendPrintf(sentry
, "FQDNcache Hits: %d\n",
714 FqdncacheStats
.hits
);
716 storeAppendPrintf(sentry
, "FQDNcache Negative Hits: %d\n",
717 FqdncacheStats
.negative_hits
);
719 storeAppendPrintf(sentry
, "FQDNcache Misses: %d\n",
720 FqdncacheStats
.misses
);
722 storeAppendPrintf(sentry
, "FQDN Cache Contents:\n\n");
724 storeAppendPrintf(sentry
, "%-45.45s %3s %3s %3s %s\n",
725 "Address", "Flg", "TTL", "Cnt", "Hostnames");
727 hash_first(fqdn_table
);
729 while ((f
= (fqdncache_entry
*) hash_next(fqdn_table
))) {
730 ttl
= (f
->flags
.fromhosts
? -1 : (f
->expires
- squid_curtime
));
731 storeAppendPrintf(sentry
, "%-45.45s %c%c %3.3d % 3d",
732 hashKeyStr(&f
->hash
),
733 f
->flags
.negcached
? 'N' : ' ',
734 f
->flags
.fromhosts
? 'H' : ' ',
736 (int) f
->name_count
);
738 for (k
= 0; k
< (int) f
->name_count
; ++k
)
739 storeAppendPrintf(sentry
, " %s", f
->names
[k
]);
741 storeAppendPrintf(sentry
, "\n");
745 /// \ingroup FQDNCacheAPI
747 fqdnFromAddr(const Ip::Address
&addr
)
750 static char buf
[MAX_IPSTRLEN
];
752 if (Config
.onoff
.log_fqdn
&& (n
= fqdncache_gethostbyaddr(addr
, 0)))
755 /// \todo Perhapse this should use toHostname() instead of straight NtoA.
756 /// that would wrap the IPv6 properly when raw.
757 addr
.NtoA(buf
, MAX_IPSTRLEN
);
762 /// \ingroup FQDNCacheInternal
764 fqdncacheLockEntry(fqdncache_entry
* f
)
766 if (f
->locks
++ == 0) {
767 dlinkDelete(&f
->lru
, &lru_list
);
768 dlinkAdd(f
, &f
->lru
, &lru_list
);
772 /// \ingroup FQDNCacheInternal
774 fqdncacheUnlockEntry(fqdncache_entry
* f
)
776 assert(f
->locks
> 0);
779 if (fqdncacheExpiredEntry(f
))
783 /// \ingroup FQDNCacheInternal
785 fqdncacheFreeEntry(void *data
)
787 fqdncache_entry
*f
= (fqdncache_entry
*)data
;
790 for (k
= 0; k
< (int) f
->name_count
; ++k
)
791 safe_free(f
->names
[k
]);
793 safe_free(f
->hash
.key
);
795 safe_free(f
->error_message
);
797 memFree(f
, MEM_FQDNCACHE_ENTRY
);
800 /// \ingroup FQDNCacheAPI
802 fqdncacheFreeMemory(void)
804 hashFreeItems(fqdn_table
, fqdncacheFreeEntry
);
805 hashFreeMemory(fqdn_table
);
810 \ingroup FQDNCacheAPI
812 * Recalculate FQDN cache size upon reconfigure.
813 * Is called to clear the FQDN cache's data structures,
814 * cancel all pending requests.
817 fqdncache_restart(void)
819 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
820 (float) FQDN_HIGH_WATER
) / (float) 100);
821 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
822 (float) FQDN_LOW_WATER
) / (float) 100);
823 purge_entries_fromhosts();
827 \ingroup FQDNCacheAPI
829 * Adds a "static" entry from /etc/hosts.
831 * The worldist is to be managed by the caller,
832 * including pointed-to strings
834 \param addr FQDN name to be added.
838 fqdncacheAddEntryFromHosts(char *addr
, wordlist
* hostnames
)
840 fqdncache_entry
*fce
;
843 if ((fce
= fqdncache_get(addr
))) {
844 if (1 == fce
->flags
.fromhosts
) {
845 fqdncacheUnlockEntry(fce
);
846 } else if (fce
->locks
> 0) {
847 debugs(35, DBG_IMPORTANT
, "fqdncacheAddEntryFromHosts: can't add static entry for locked address '" << addr
<< "'");
850 fqdncacheRelease(fce
);
854 fce
= fqdncacheCreateEntry(addr
);
857 fce
->names
[j
] = xstrdup(hostnames
->key
);
858 Tolower(fce
->names
[j
]);
860 hostnames
= hostnames
->next
;
862 if (j
>= FQDN_MAX_NAMES
)
867 fce
->names
[j
] = NULL
; /* it's safe */
868 fce
->flags
.fromhosts
= 1;
869 fqdncacheAddEntry(fce
);
870 fqdncacheLockEntry(fce
);
875 * \ingroup FQDNCacheAPI
876 * The function to return the FQDN statistics via SNMP
879 snmp_netFqdnFn(variable_list
* Var
, snint
* ErrP
)
881 variable_list
*Answer
= NULL
;
883 debugs(49, 5, "snmp_netFqdnFn: Processing request:" << snmpDebugOid(Var
->name
, Var
->name_length
, tmp
));
884 *ErrP
= SNMP_ERR_NOERROR
;
886 switch (Var
->name
[LEN_SQ_NET
+ 1]) {
889 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
895 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
896 FqdncacheStats
.requests
,
901 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
907 /* this is now worthless */
908 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
914 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
915 FqdncacheStats
.negative_hits
,
920 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
921 FqdncacheStats
.misses
,
926 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
932 *ErrP
= SNMP_ERR_NOSUCHNAME
;
939 #endif /*SQUID_SNMP */