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;
170 \ingroup FQDNCacheInternal
171 * Removes the given fqdncache entry
174 fqdncacheRelease(fqdncache_entry
* f
)
177 hash_remove_link(fqdn_table
, (hash_link
*) f
);
179 for (k
= 0; k
< (int) f
->name_count
; ++k
)
180 safe_free(f
->names
[k
]);
182 debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f
->hash
) << "'.");
184 dlinkDelete(&f
->lru
, &lru_list
);
186 safe_free(f
->hash
.key
);
188 safe_free(f
->error_message
);
190 memFree(f
, MEM_FQDNCACHE_ENTRY
);
194 \ingroup FQDNCacheInternal
195 \param name FQDN hash string.
196 \retval Match for given name
198 static fqdncache_entry
*
199 fqdncache_get(const char *name
)
202 static fqdncache_entry
*f
;
206 if ((e
= (hash_link
*)hash_lookup(fqdn_table
, name
)) != NULL
)
207 f
= (fqdncache_entry
*) e
;
213 /// \ingroup FQDNCacheInternal
215 fqdncacheExpiredEntry(const fqdncache_entry
* f
)
217 /* all static entries are locked, so this takes care of them too */
222 if (f
->expires
> squid_curtime
)
228 /// \ingroup FQDNCacheAPI
230 fqdncache_purgelru(void *notused
)
233 dlink_node
*prev
= NULL
;
236 eventAdd("fqdncache_purgelru", fqdncache_purgelru
, NULL
, 10.0, 1);
238 for (m
= lru_list
.tail
; m
; m
= prev
) {
239 if (fqdncacheCount() < fqdncache_low
)
244 f
= (fqdncache_entry
*)m
->data
;
254 debugs(35, 9, "fqdncache_purgelru: removed " << removed
<< " entries");
257 /// \ingroup FQDNCacheAPI
259 purge_entries_fromhosts(void)
261 dlink_node
*m
= lru_list
.head
;
262 fqdncache_entry
*i
= NULL
;
266 if (i
!= NULL
) { /* need to delay deletion */
267 fqdncacheRelease(i
); /* we just override locks */
271 t
= (fqdncache_entry
*)m
->data
;
273 if (t
->flags
.fromhosts
)
284 \ingroup FQDNCacheInternal
286 * Create blank fqdncache_entry
288 static fqdncache_entry
*
289 fqdncacheCreateEntry(const char *name
)
291 static fqdncache_entry
*f
;
292 f
= (fqdncache_entry
*)memAllocate(MEM_FQDNCACHE_ENTRY
);
293 f
->hash
.key
= xstrdup(name
);
294 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
298 /// \ingroup FQDNCacheInternal
300 fqdncacheAddEntry(fqdncache_entry
* f
)
302 hash_link
*e
= (hash_link
*)hash_lookup(fqdn_table
, f
->hash
.key
);
305 /* avoid colission */
306 fqdncache_entry
*q
= (fqdncache_entry
*) e
;
310 hash_join(fqdn_table
, &f
->hash
);
311 dlinkAdd(f
, &f
->lru
, &lru_list
);
312 f
->lastref
= squid_curtime
;
316 \ingroup FQDNCacheInternal
318 * Walks down the pending list, calling handlers
321 fqdncacheCallback(fqdncache_entry
* f
, int wait
)
325 f
->lastref
= squid_curtime
;
330 fqdncacheLockEntry(f
);
332 callback
= f
->handler
;
336 if (cbdataReferenceValidDone(f
->handlerData
, &cbdata
)) {
337 const DnsLookupDetails
details(f
->error_message
, wait
);
338 callback(f
->name_count
? f
->names
[0] : NULL
, details
, cbdata
);
341 fqdncacheUnlockEntry(f
);
344 /// \ingroup FQDNCacheInternal
347 fqdncacheParse(fqdncache_entry
*f
, const char *inbuf
)
349 LOCAL_ARRAY(char, buf
, DNS_INBUF_SZ
);
352 const char *name
= (const char *)f
->hash
.key
;
353 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
354 f
->flags
.negcached
= 1;
357 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL> reply in response to '" << name
<< "'");
358 f
->error_message
= xstrdup("Internal Error");
362 xstrncpy(buf
, inbuf
, DNS_INBUF_SZ
);
363 debugs(35, 5, "fqdncacheParse: parsing: {" << buf
<< "}");
364 token
= strtok(buf
, w_space
);
367 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL>, expecting '$name' in response to '" << name
<< "'");
368 f
->error_message
= xstrdup("Internal Error");
372 if (0 == strcmp(token
, "$fail")) {
373 token
= strtok(NULL
, "\n");
374 assert(NULL
!= token
);
375 f
->error_message
= xstrdup(token
);
379 if (0 != strcmp(token
, "$name")) {
380 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting '$name' in response to '" << name
<< "'");
381 f
->error_message
= xstrdup("Internal Error");
385 token
= strtok(NULL
, w_space
);
388 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting TTL in response to '" << name
<< "'");
389 f
->error_message
= xstrdup("Internal Error");
395 token
= strtok(NULL
, w_space
);
398 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting hostname in response to '" << name
<< "'");
399 f
->error_message
= xstrdup("Internal Error");
403 f
->names
[0] = xstrdup(token
);
406 if (ttl
== 0 || ttl
> Config
.positiveDnsTtl
)
407 ttl
= Config
.positiveDnsTtl
;
409 if (ttl
< Config
.negativeDnsTtl
)
410 ttl
= Config
.negativeDnsTtl
;
412 f
->expires
= squid_curtime
+ ttl
;
414 f
->flags
.negcached
= 0;
416 return f
->name_count
;
421 fqdncacheParse(fqdncache_entry
*f
, const rfc1035_rr
* answers
, int nr
, const char *error_message
)
425 const char *name
= (const char *)f
->hash
.key
;
426 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
427 f
->flags
.negcached
= 1;
430 debugs(35, 3, "fqdncacheParse: Lookup of '" << name
<< "' failed (" << error_message
<< ")");
431 f
->error_message
= xstrdup(error_message
);
436 debugs(35, 3, "fqdncacheParse: No DNS records for '" << name
<< "'");
437 f
->error_message
= xstrdup("No DNS records");
441 debugs(35, 3, "fqdncacheParse: " << nr
<< " answers for '" << name
<< "'");
444 for (k
= 0; k
< nr
; ++k
) {
445 if (answers
[k
]._class
!= RFC1035_CLASS_IN
)
448 if (answers
[k
].type
== RFC1035_TYPE_PTR
) {
449 if (!answers
[k
].rdata
[0]) {
450 debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name
<< "'");
454 if (strchr(answers
[k
].rdata
, ' ')) {
455 debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers
[k
].rdata
<< "' for '" << name
<< "'");
459 f
->names
[f
->name_count
] = xstrdup(answers
[k
].rdata
);
461 } else if (answers
[k
].type
!= RFC1035_TYPE_CNAME
)
464 if (ttl
== 0 || (int) answers
[k
].ttl
< ttl
)
465 ttl
= answers
[k
].ttl
;
467 if (f
->name_count
>= FQDN_MAX_NAMES
)
471 if (f
->name_count
== 0) {
472 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: No PTR record for '" << name
<< "'");
476 if (ttl
> Config
.positiveDnsTtl
)
477 ttl
= Config
.positiveDnsTtl
;
479 if (ttl
< Config
.negativeDnsTtl
)
480 ttl
= Config
.negativeDnsTtl
;
482 f
->expires
= squid_curtime
+ ttl
;
484 f
->flags
.negcached
= 0;
486 return f
->name_count
;
493 \ingroup FQDNCacheAPI
495 * Callback for handling DNS results.
499 fqdncacheHandleReply(void *data
, char *reply
)
501 fqdncacheHandleReply(void *data
, const rfc1035_rr
* answers
, int na
, const char *error_message
)
505 static_cast<generic_cbdata
*>(data
)->unwrap(&f
);
506 ++FqdncacheStats
.replies
;
507 const int age
= f
->age();
508 statCounter
.dns
.svcTime
.count(age
);
511 fqdncacheParse(f
, reply
);
514 fqdncacheParse(f
, answers
, na
, error_message
);
517 fqdncacheAddEntry(f
);
519 fqdncacheCallback(f
, age
);
523 \ingroup FQDNCacheAPI
525 \param addr IP address of domain to resolve.
526 \param handler A pointer to the function to be called when
527 * the reply from the FQDN cache
528 * (or the DNS if the FQDN cache misses)
529 \param handlerData Information that is passed to the handler
530 * and does not affect the FQDN cache.
533 fqdncache_nbgethostbyaddr(const Ip::Address
&addr
, FQDNH
* handler
, void *handlerData
)
535 fqdncache_entry
*f
= NULL
;
536 char name
[MAX_IPSTRLEN
];
538 addr
.NtoA(name
,MAX_IPSTRLEN
);
539 debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name
<< "'.");
540 ++FqdncacheStats
.requests
;
542 if (name
[0] == '\0') {
543 debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
544 const DnsLookupDetails
details("Invalid hostname", -1); // error, no lookup
546 handler(NULL
, details
, handlerData
);
550 f
= fqdncache_get(name
);
555 } else if (fqdncacheExpiredEntry(f
)) {
556 /* hit, but expired -- bummer */
561 debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name
<< "'");
563 if (f
->flags
.negcached
)
564 ++ FqdncacheStats
.negative_hits
;
566 ++ FqdncacheStats
.hits
;
568 f
->handler
= handler
;
570 f
->handlerData
= cbdataReference(handlerData
);
572 fqdncacheCallback(f
, -1); // no lookup
577 debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name
<< "'");
578 ++ FqdncacheStats
.misses
;
579 f
= fqdncacheCreateEntry(name
);
580 f
->handler
= handler
;
581 f
->handlerData
= cbdataReference(handlerData
);
582 f
->request_time
= current_time
;
583 c
= new generic_cbdata(f
);
585 dnsSubmit(hashKeyStr(&f
->hash
), fqdncacheHandleReply
, c
);
587 idnsPTRLookup(addr
, fqdncacheHandleReply
, c
);
591 /// \ingroup FQDNCacheInternal
593 fqdncacheRegisterWithCacheManager(void)
595 Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
601 \ingroup FQDNCacheAPI
603 * Initialize the fqdncache.
604 * Called after IP cache initialization.
611 fqdncacheRegisterWithCacheManager();
616 debugs(35, 3, "Initializing FQDN Cache...");
618 memset(&FqdncacheStats
, '\0', sizeof(FqdncacheStats
));
620 memset(&lru_list
, '\0', sizeof(lru_list
));
622 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
623 (float) FQDN_HIGH_WATER
) / (float) 100);
625 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
626 (float) FQDN_LOW_WATER
) / (float) 100);
628 n
= hashPrime(fqdncache_high
/ 4);
630 fqdn_table
= hash_create((HASHCMP
*) strcmp
, n
, hash4
);
632 memDataInit(MEM_FQDNCACHE_ENTRY
, "fqdncache_entry",
633 sizeof(fqdncache_entry
), 0);
637 \ingroup FQDNCacheAPI
639 * Is different in that it only checks if an entry exists in
640 * it's data-structures and does not by default contact the
641 * DNS, unless this is requested, by setting the flags
642 * to FQDN_LOOKUP_IF_MISS.
644 \param addr address of the FQDN being resolved
645 \param flags values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
649 fqdncache_gethostbyaddr(const Ip::Address
&addr
, int flags
)
651 char name
[MAX_IPSTRLEN
];
652 fqdncache_entry
*f
= NULL
;
654 if (addr
.IsAnyAddr() || addr
.IsNoAddr()) {
658 addr
.NtoA(name
,MAX_IPSTRLEN
);
659 ++ FqdncacheStats
.requests
;
660 f
= fqdncache_get(name
);
664 } else if (fqdncacheExpiredEntry(f
)) {
667 } else if (f
->flags
.negcached
) {
668 ++ FqdncacheStats
.negative_hits
;
669 // ignore f->error_message: the caller just checks FQDN cache presence
672 ++ FqdncacheStats
.hits
;
673 f
->lastref
= squid_curtime
;
674 // ignore f->error_message: the caller just checks FQDN cache presence
678 /* no entry [any more] */
680 ++ FqdncacheStats
.misses
;
682 if (flags
& FQDN_LOOKUP_IF_MISS
) {
683 fqdncache_nbgethostbyaddr(addr
, NULL
, NULL
);
691 \ingroup FQDNCacheInternal
693 * Process objects list
696 fqdnStats(StoreEntry
* sentry
)
698 fqdncache_entry
*f
= NULL
;
702 if (fqdn_table
== NULL
)
705 storeAppendPrintf(sentry
, "FQDN Cache Statistics:\n");
707 storeAppendPrintf(sentry
, "FQDNcache Entries In Use: %d\n",
708 memInUse(MEM_FQDNCACHE_ENTRY
));
710 storeAppendPrintf(sentry
, "FQDNcache Entries Cached: %d\n",
713 storeAppendPrintf(sentry
, "FQDNcache Requests: %d\n",
714 FqdncacheStats
.requests
);
716 storeAppendPrintf(sentry
, "FQDNcache Hits: %d\n",
717 FqdncacheStats
.hits
);
719 storeAppendPrintf(sentry
, "FQDNcache Negative Hits: %d\n",
720 FqdncacheStats
.negative_hits
);
722 storeAppendPrintf(sentry
, "FQDNcache Misses: %d\n",
723 FqdncacheStats
.misses
);
725 storeAppendPrintf(sentry
, "FQDN Cache Contents:\n\n");
727 storeAppendPrintf(sentry
, "%-45.45s %3s %3s %3s %s\n",
728 "Address", "Flg", "TTL", "Cnt", "Hostnames");
730 hash_first(fqdn_table
);
732 while ((f
= (fqdncache_entry
*) hash_next(fqdn_table
))) {
733 ttl
= (f
->flags
.fromhosts
? -1 : (f
->expires
- squid_curtime
));
734 storeAppendPrintf(sentry
, "%-45.45s %c%c %3.3d % 3d",
735 hashKeyStr(&f
->hash
),
736 f
->flags
.negcached
? 'N' : ' ',
737 f
->flags
.fromhosts
? 'H' : ' ',
739 (int) f
->name_count
);
741 for (k
= 0; k
< (int) f
->name_count
; ++k
)
742 storeAppendPrintf(sentry
, " %s", f
->names
[k
]);
744 storeAppendPrintf(sentry
, "\n");
748 /// \ingroup FQDNCacheAPI
750 fqdnFromAddr(const Ip::Address
&addr
)
753 static char buf
[MAX_IPSTRLEN
];
755 if (Config
.onoff
.log_fqdn
&& (n
= fqdncache_gethostbyaddr(addr
, 0)))
758 /// \todo Perhapse this should use toHostname() instead of straight NtoA.
759 /// that would wrap the IPv6 properly when raw.
760 addr
.NtoA(buf
, MAX_IPSTRLEN
);
765 /// \ingroup FQDNCacheInternal
767 fqdncacheLockEntry(fqdncache_entry
* f
)
769 if (f
->locks
++ == 0) {
770 dlinkDelete(&f
->lru
, &lru_list
);
771 dlinkAdd(f
, &f
->lru
, &lru_list
);
775 /// \ingroup FQDNCacheInternal
777 fqdncacheUnlockEntry(fqdncache_entry
* f
)
779 assert(f
->locks
> 0);
782 if (fqdncacheExpiredEntry(f
))
786 /// \ingroup FQDNCacheInternal
788 fqdncacheFreeEntry(void *data
)
790 fqdncache_entry
*f
= (fqdncache_entry
*)data
;
793 for (k
= 0; k
< (int) f
->name_count
; ++k
)
794 safe_free(f
->names
[k
]);
796 safe_free(f
->hash
.key
);
798 safe_free(f
->error_message
);
800 memFree(f
, MEM_FQDNCACHE_ENTRY
);
803 /// \ingroup FQDNCacheAPI
805 fqdncacheFreeMemory(void)
807 hashFreeItems(fqdn_table
, fqdncacheFreeEntry
);
808 hashFreeMemory(fqdn_table
);
813 \ingroup FQDNCacheAPI
815 * Recalculate FQDN cache size upon reconfigure.
816 * Is called to clear the FQDN cache's data structures,
817 * cancel all pending requests.
820 fqdncache_restart(void)
822 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
823 (float) FQDN_HIGH_WATER
) / (float) 100);
824 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
825 (float) FQDN_LOW_WATER
) / (float) 100);
826 purge_entries_fromhosts();
830 \ingroup FQDNCacheAPI
832 * Adds a "static" entry from /etc/hosts.
834 * The worldist is to be managed by the caller,
835 * including pointed-to strings
837 \param addr FQDN name to be added.
841 fqdncacheAddEntryFromHosts(char *addr
, wordlist
* hostnames
)
843 fqdncache_entry
*fce
;
846 if ((fce
= fqdncache_get(addr
))) {
847 if (1 == fce
->flags
.fromhosts
) {
848 fqdncacheUnlockEntry(fce
);
849 } else if (fce
->locks
> 0) {
850 debugs(35, DBG_IMPORTANT
, "fqdncacheAddEntryFromHosts: can't add static entry for locked address '" << addr
<< "'");
853 fqdncacheRelease(fce
);
857 fce
= fqdncacheCreateEntry(addr
);
860 fce
->names
[j
] = xstrdup(hostnames
->key
);
861 Tolower(fce
->names
[j
]);
863 hostnames
= hostnames
->next
;
865 if (j
>= FQDN_MAX_NAMES
)
870 fce
->names
[j
] = NULL
; /* it's safe */
871 fce
->flags
.fromhosts
= 1;
872 fqdncacheAddEntry(fce
);
873 fqdncacheLockEntry(fce
);
879 * \ingroup FQDNCacheAPI
880 * The function to return the FQDN statistics via SNMP
883 snmp_netFqdnFn(variable_list
* Var
, snint
* ErrP
)
885 variable_list
*Answer
= NULL
;
887 debugs(49, 5, "snmp_netFqdnFn: Processing request:" << snmpDebugOid(Var
->name
, Var
->name_length
, tmp
));
888 *ErrP
= SNMP_ERR_NOERROR
;
890 switch (Var
->name
[LEN_SQ_NET
+ 1]) {
893 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
899 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
900 FqdncacheStats
.requests
,
905 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
911 /* this is now worthless */
912 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
918 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
919 FqdncacheStats
.negative_hits
,
924 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
925 FqdncacheStats
.misses
,
930 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
936 *ErrP
= SNMP_ERR_NOSUCHNAME
;
943 #endif /*SQUID_SNMP */