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"
40 #include "mgr/Registration.h"
43 #include "SquidTime.h"
44 #include "StatCounters.h"
49 \defgroup FQDNCacheAPI FQDN Cache API
51 \section Introduction Introduction
53 * The FQDN cache is a built-in component of squid providing
54 * Hostname to IP-Number translation functionality and managing
55 * the involved data-structures. Efficiency concerns require
56 * mechanisms that allow non-blocking access to these mappings.
57 * The FQDN cache usually doesn't block on a request except for
58 * special cases where this is desired (see below).
60 \todo FQDN Cache should have its own API *.h file.
64 \defgroup FQDNCacheInternal FQDN Cache Internals
67 * Internally, the execution flow is as follows:
68 * On a miss, fqdncache_nbgethostbyaddr() checks whether a request
69 * for this name is already pending, and if positive, it creates a
70 * new entry using fqdncacheAddEntry(). Then it calls
71 * fqdncacheAddPending() to add a request to the queue together
72 * with data and handler. Else, ifqdncache_dnsDispatch() is called
73 * to directly create a DNS query or to fqdncacheEnqueue() if all
74 * no DNS port is free.
77 * fqdncacheCallback() is called regularly to walk down the pending
78 * list and call handlers.
81 * LRU clean-up is performed through fqdncache_purgelru() according
82 * to the fqdncache_high threshold.
85 /// \ingroup FQDNCacheInternal
86 #define FQDN_LOW_WATER 90
88 /// \ingroup FQDNCacheInternal
89 #define FQDN_HIGH_WATER 95
93 * The data structure used for storing name-address mappings
94 * is a small hashtable (static hash_table *fqdn_table),
95 * where structures of type fqdncache_entry whose most
96 * interesting members are:
101 hash_link hash
; /* must be first */
104 unsigned char name_count
;
105 char *names
[FQDN_MAX_NAMES
+ 1];
110 struct timeval request_time
;
112 unsigned short locks
;
115 unsigned int negcached
:1;
116 unsigned int fromhosts
:1;
119 int age() const; ///< time passed since request_time or -1 if unknown
122 /// \ingroup FQDNCacheInternal
123 static struct _fqdn_cache_stats
{
131 /// \ingroup FQDNCacheInternal
132 static dlink_list lru_list
;
135 static HLPCB fqdncacheHandleReply
;
136 static int fqdncacheParse(fqdncache_entry
*, const char *buf
);
138 static IDNSCB fqdncacheHandleReply
;
139 static int fqdncacheParse(fqdncache_entry
*, const rfc1035_rr
*, int, const char *error_message
);
141 static void fqdncacheRelease(fqdncache_entry
*);
142 static fqdncache_entry
*fqdncacheCreateEntry(const char *name
);
143 static void fqdncacheCallback(fqdncache_entry
*, int wait
);
144 static fqdncache_entry
*fqdncache_get(const char *);
145 static int fqdncacheExpiredEntry(const fqdncache_entry
*);
146 static void fqdncacheLockEntry(fqdncache_entry
* f
);
147 static void fqdncacheUnlockEntry(fqdncache_entry
* f
);
148 static FREE fqdncacheFreeEntry
;
149 static void fqdncacheAddEntry(fqdncache_entry
* f
);
151 /// \ingroup FQDNCacheInternal
152 static hash_table
*fqdn_table
= NULL
;
154 /// \ingroup FQDNCacheInternal
155 static long fqdncache_low
= 180;
157 /// \ingroup FQDNCacheInternal
158 static long fqdncache_high
= 200;
160 /// \ingroup FQDNCacheInternal
161 inline int fqdncacheCount() { return fqdn_table
? fqdn_table
->count
: 0; }
164 fqdncache_entry::age() const
166 return request_time
.tv_sec
? tvSubMsec(request_time
, current_time
) : -1;
171 \ingroup FQDNCacheInternal
172 * Removes the given fqdncache entry
175 fqdncacheRelease(fqdncache_entry
* f
)
178 hash_remove_link(fqdn_table
, (hash_link
*) f
);
180 for (k
= 0; k
< (int) f
->name_count
; ++k
)
181 safe_free(f
->names
[k
]);
183 debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f
->hash
) << "'.");
185 dlinkDelete(&f
->lru
, &lru_list
);
187 safe_free(f
->hash
.key
);
189 safe_free(f
->error_message
);
191 memFree(f
, MEM_FQDNCACHE_ENTRY
);
195 \ingroup FQDNCacheInternal
196 \param name FQDN hash string.
197 \retval Match for given name
199 static fqdncache_entry
*
200 fqdncache_get(const char *name
)
203 static fqdncache_entry
*f
;
207 if ((e
= (hash_link
*)hash_lookup(fqdn_table
, name
)) != NULL
)
208 f
= (fqdncache_entry
*) e
;
214 /// \ingroup FQDNCacheInternal
216 fqdncacheExpiredEntry(const fqdncache_entry
* f
)
218 /* all static entries are locked, so this takes care of them too */
223 if (f
->expires
> squid_curtime
)
229 /// \ingroup FQDNCacheAPI
231 fqdncache_purgelru(void *notused
)
234 dlink_node
*prev
= NULL
;
237 eventAdd("fqdncache_purgelru", fqdncache_purgelru
, NULL
, 10.0, 1);
239 for (m
= lru_list
.tail
; m
; m
= prev
) {
240 if (fqdncacheCount() < fqdncache_low
)
245 f
= (fqdncache_entry
*)m
->data
;
255 debugs(35, 9, "fqdncache_purgelru: removed " << removed
<< " entries");
258 /// \ingroup FQDNCacheAPI
260 purge_entries_fromhosts(void)
262 dlink_node
*m
= lru_list
.head
;
263 fqdncache_entry
*i
= NULL
;
267 if (i
!= NULL
) { /* need to delay deletion */
268 fqdncacheRelease(i
); /* we just override locks */
272 t
= (fqdncache_entry
*)m
->data
;
274 if (t
->flags
.fromhosts
)
285 \ingroup FQDNCacheInternal
287 * Create blank fqdncache_entry
289 static fqdncache_entry
*
290 fqdncacheCreateEntry(const char *name
)
292 static fqdncache_entry
*f
;
293 f
= (fqdncache_entry
*)memAllocate(MEM_FQDNCACHE_ENTRY
);
294 f
->hash
.key
= xstrdup(name
);
295 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
299 /// \ingroup FQDNCacheInternal
301 fqdncacheAddEntry(fqdncache_entry
* f
)
303 hash_link
*e
= (hash_link
*)hash_lookup(fqdn_table
, f
->hash
.key
);
306 /* avoid colission */
307 fqdncache_entry
*q
= (fqdncache_entry
*) e
;
311 hash_join(fqdn_table
, &f
->hash
);
312 dlinkAdd(f
, &f
->lru
, &lru_list
);
313 f
->lastref
= squid_curtime
;
317 \ingroup FQDNCacheInternal
319 * Walks down the pending list, calling handlers
322 fqdncacheCallback(fqdncache_entry
* f
, int wait
)
326 f
->lastref
= squid_curtime
;
331 fqdncacheLockEntry(f
);
333 callback
= f
->handler
;
337 if (cbdataReferenceValidDone(f
->handlerData
, &cbdata
)) {
338 const DnsLookupDetails
details(f
->error_message
, wait
);
339 callback(f
->name_count
? f
->names
[0] : NULL
, details
, cbdata
);
342 fqdncacheUnlockEntry(f
);
345 /// \ingroup FQDNCacheInternal
348 fqdncacheParse(fqdncache_entry
*f
, const char *inbuf
)
350 LOCAL_ARRAY(char, buf
, DNS_INBUF_SZ
);
353 const char *name
= (const char *)f
->hash
.key
;
354 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
355 f
->flags
.negcached
= 1;
358 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL> reply in response to '" << name
<< "'");
359 f
->error_message
= xstrdup("Internal Error");
363 xstrncpy(buf
, inbuf
, DNS_INBUF_SZ
);
364 debugs(35, 5, "fqdncacheParse: parsing: {" << buf
<< "}");
365 token
= strtok(buf
, w_space
);
368 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL>, expecting '$name' in response to '" << name
<< "'");
369 f
->error_message
= xstrdup("Internal Error");
373 if (0 == strcmp(token
, "$fail")) {
374 token
= strtok(NULL
, "\n");
375 assert(NULL
!= token
);
376 f
->error_message
= xstrdup(token
);
380 if (0 != strcmp(token
, "$name")) {
381 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting '$name' in response to '" << name
<< "'");
382 f
->error_message
= xstrdup("Internal Error");
386 token
= strtok(NULL
, w_space
);
389 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting TTL in response to '" << name
<< "'");
390 f
->error_message
= xstrdup("Internal Error");
396 token
= strtok(NULL
, w_space
);
399 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting hostname in response to '" << name
<< "'");
400 f
->error_message
= xstrdup("Internal Error");
404 f
->names
[0] = xstrdup(token
);
407 if (ttl
== 0 || ttl
> Config
.positiveDnsTtl
)
408 ttl
= Config
.positiveDnsTtl
;
410 if (ttl
< Config
.negativeDnsTtl
)
411 ttl
= Config
.negativeDnsTtl
;
413 f
->expires
= squid_curtime
+ ttl
;
415 f
->flags
.negcached
= 0;
417 return f
->name_count
;
422 fqdncacheParse(fqdncache_entry
*f
, const rfc1035_rr
* answers
, int nr
, const char *error_message
)
426 const char *name
= (const char *)f
->hash
.key
;
427 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
428 f
->flags
.negcached
= 1;
431 debugs(35, 3, "fqdncacheParse: Lookup of '" << name
<< "' failed (" << error_message
<< ")");
432 f
->error_message
= xstrdup(error_message
);
437 debugs(35, 3, "fqdncacheParse: No DNS records for '" << name
<< "'");
438 f
->error_message
= xstrdup("No DNS records");
442 debugs(35, 3, "fqdncacheParse: " << nr
<< " answers for '" << name
<< "'");
445 for (k
= 0; k
< nr
; ++k
) {
446 if (answers
[k
]._class
!= RFC1035_CLASS_IN
)
449 if (answers
[k
].type
== RFC1035_TYPE_PTR
) {
450 if (!answers
[k
].rdata
[0]) {
451 debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name
<< "'");
455 if (strchr(answers
[k
].rdata
, ' ')) {
456 debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers
[k
].rdata
<< "' for '" << name
<< "'");
460 f
->names
[f
->name_count
] = xstrdup(answers
[k
].rdata
);
462 } else if (answers
[k
].type
!= RFC1035_TYPE_CNAME
)
465 if (ttl
== 0 || (int) answers
[k
].ttl
< ttl
)
466 ttl
= answers
[k
].ttl
;
468 if (f
->name_count
>= FQDN_MAX_NAMES
)
472 if (f
->name_count
== 0) {
473 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: No PTR record for '" << name
<< "'");
477 if (ttl
> Config
.positiveDnsTtl
)
478 ttl
= Config
.positiveDnsTtl
;
480 if (ttl
< Config
.negativeDnsTtl
)
481 ttl
= Config
.negativeDnsTtl
;
483 f
->expires
= squid_curtime
+ ttl
;
485 f
->flags
.negcached
= 0;
487 return f
->name_count
;
494 \ingroup FQDNCacheAPI
496 * Callback for handling DNS results.
500 fqdncacheHandleReply(void *data
, char *reply
)
502 fqdncacheHandleReply(void *data
, const rfc1035_rr
* answers
, int na
, const char *error_message
)
506 static_cast<generic_cbdata
*>(data
)->unwrap(&f
);
507 ++FqdncacheStats
.replies
;
508 const int age
= f
->age();
509 statCounter
.dns
.svcTime
.count(age
);
512 fqdncacheParse(f
, reply
);
515 fqdncacheParse(f
, answers
, na
, error_message
);
518 fqdncacheAddEntry(f
);
520 fqdncacheCallback(f
, age
);
524 \ingroup FQDNCacheAPI
526 \param addr IP address of domain to resolve.
527 \param handler A pointer to the function to be called when
528 * the reply from the FQDN cache
529 * (or the DNS if the FQDN cache misses)
530 \param handlerData Information that is passed to the handler
531 * and does not affect the FQDN cache.
534 fqdncache_nbgethostbyaddr(const Ip::Address
&addr
, FQDNH
* handler
, void *handlerData
)
536 fqdncache_entry
*f
= NULL
;
537 char name
[MAX_IPSTRLEN
];
539 addr
.NtoA(name
,MAX_IPSTRLEN
);
540 debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name
<< "'.");
541 ++FqdncacheStats
.requests
;
543 if (name
[0] == '\0') {
544 debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
545 const DnsLookupDetails
details("Invalid hostname", -1); // error, no lookup
547 handler(NULL
, details
, handlerData
);
551 f
= fqdncache_get(name
);
556 } else if (fqdncacheExpiredEntry(f
)) {
557 /* hit, but expired -- bummer */
562 debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name
<< "'");
564 if (f
->flags
.negcached
)
565 ++ FqdncacheStats
.negative_hits
;
567 ++ FqdncacheStats
.hits
;
569 f
->handler
= handler
;
571 f
->handlerData
= cbdataReference(handlerData
);
573 fqdncacheCallback(f
, -1); // no lookup
578 debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name
<< "'");
579 ++ FqdncacheStats
.misses
;
580 f
= fqdncacheCreateEntry(name
);
581 f
->handler
= handler
;
582 f
->handlerData
= cbdataReference(handlerData
);
583 f
->request_time
= current_time
;
584 c
= new generic_cbdata(f
);
586 dnsSubmit(hashKeyStr(&f
->hash
), fqdncacheHandleReply
, c
);
588 idnsPTRLookup(addr
, fqdncacheHandleReply
, c
);
594 \ingroup FQDNCacheAPI
596 * Is different in that it only checks if an entry exists in
597 * it's data-structures and does not by default contact the
598 * DNS, unless this is requested, by setting the flags
599 * to FQDN_LOOKUP_IF_MISS.
601 \param addr address of the FQDN being resolved
602 \param flags values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
606 fqdncache_gethostbyaddr(const Ip::Address
&addr
, int flags
)
608 char name
[MAX_IPSTRLEN
];
609 fqdncache_entry
*f
= NULL
;
611 if (addr
.IsAnyAddr() || addr
.IsNoAddr()) {
615 addr
.NtoA(name
,MAX_IPSTRLEN
);
616 ++ FqdncacheStats
.requests
;
617 f
= fqdncache_get(name
);
621 } else if (fqdncacheExpiredEntry(f
)) {
624 } else if (f
->flags
.negcached
) {
625 ++ FqdncacheStats
.negative_hits
;
626 // ignore f->error_message: the caller just checks FQDN cache presence
629 ++ FqdncacheStats
.hits
;
630 f
->lastref
= squid_curtime
;
631 // ignore f->error_message: the caller just checks FQDN cache presence
635 /* no entry [any more] */
637 ++ FqdncacheStats
.misses
;
639 if (flags
& FQDN_LOOKUP_IF_MISS
) {
640 fqdncache_nbgethostbyaddr(addr
, NULL
, NULL
);
648 \ingroup FQDNCacheInternal
650 * Process objects list
653 fqdnStats(StoreEntry
* sentry
)
655 fqdncache_entry
*f
= NULL
;
659 if (fqdn_table
== NULL
)
662 storeAppendPrintf(sentry
, "FQDN Cache Statistics:\n");
664 storeAppendPrintf(sentry
, "FQDNcache Entries In Use: %d\n",
665 memInUse(MEM_FQDNCACHE_ENTRY
));
667 storeAppendPrintf(sentry
, "FQDNcache Entries Cached: %d\n",
670 storeAppendPrintf(sentry
, "FQDNcache Requests: %d\n",
671 FqdncacheStats
.requests
);
673 storeAppendPrintf(sentry
, "FQDNcache Hits: %d\n",
674 FqdncacheStats
.hits
);
676 storeAppendPrintf(sentry
, "FQDNcache Negative Hits: %d\n",
677 FqdncacheStats
.negative_hits
);
679 storeAppendPrintf(sentry
, "FQDNcache Misses: %d\n",
680 FqdncacheStats
.misses
);
682 storeAppendPrintf(sentry
, "FQDN Cache Contents:\n\n");
684 storeAppendPrintf(sentry
, "%-45.45s %3s %3s %3s %s\n",
685 "Address", "Flg", "TTL", "Cnt", "Hostnames");
687 hash_first(fqdn_table
);
689 while ((f
= (fqdncache_entry
*) hash_next(fqdn_table
))) {
690 ttl
= (f
->flags
.fromhosts
? -1 : (f
->expires
- squid_curtime
));
691 storeAppendPrintf(sentry
, "%-45.45s %c%c %3.3d % 3d",
692 hashKeyStr(&f
->hash
),
693 f
->flags
.negcached
? 'N' : ' ',
694 f
->flags
.fromhosts
? 'H' : ' ',
696 (int) f
->name_count
);
698 for (k
= 0; k
< (int) f
->name_count
; ++k
)
699 storeAppendPrintf(sentry
, " %s", f
->names
[k
]);
701 storeAppendPrintf(sentry
, "\n");
705 /// \ingroup FQDNCacheAPI
708 fqdnFromAddr(const Ip::Address
&addr
)
711 static char buf
[MAX_IPSTRLEN
];
713 if (Config
.onoff
.log_fqdn
&& (n
= fqdncache_gethostbyaddr(addr
, 0)))
716 /// \todo Perhapse this should use toHostname() instead of straight NtoA.
717 /// that would wrap the IPv6 properly when raw.
718 addr
.NtoA(buf
, MAX_IPSTRLEN
);
724 /// \ingroup FQDNCacheInternal
726 fqdncacheLockEntry(fqdncache_entry
* f
)
728 if (f
->locks
++ == 0) {
729 dlinkDelete(&f
->lru
, &lru_list
);
730 dlinkAdd(f
, &f
->lru
, &lru_list
);
734 /// \ingroup FQDNCacheInternal
736 fqdncacheUnlockEntry(fqdncache_entry
* f
)
738 assert(f
->locks
> 0);
741 if (fqdncacheExpiredEntry(f
))
745 /// \ingroup FQDNCacheInternal
747 fqdncacheFreeEntry(void *data
)
749 fqdncache_entry
*f
= (fqdncache_entry
*)data
;
752 for (k
= 0; k
< (int) f
->name_count
; ++k
)
753 safe_free(f
->names
[k
]);
755 safe_free(f
->hash
.key
);
757 safe_free(f
->error_message
);
759 memFree(f
, MEM_FQDNCACHE_ENTRY
);
762 /// \ingroup FQDNCacheAPI
764 fqdncacheFreeMemory(void)
766 hashFreeItems(fqdn_table
, fqdncacheFreeEntry
);
767 hashFreeMemory(fqdn_table
);
772 \ingroup FQDNCacheAPI
774 * Recalculate FQDN cache size upon reconfigure.
775 * Is called to clear the FQDN cache's data structures,
776 * cancel all pending requests.
779 fqdncache_restart(void)
781 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
782 (float) FQDN_HIGH_WATER
) / (float) 100);
783 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
784 (float) FQDN_LOW_WATER
) / (float) 100);
785 purge_entries_fromhosts();
789 \ingroup FQDNCacheAPI
791 * Adds a "static" entry from /etc/hosts.
793 * The worldist is to be managed by the caller,
794 * including pointed-to strings
796 \param addr FQDN name to be added.
800 fqdncacheAddEntryFromHosts(char *addr
, wordlist
* hostnames
)
802 fqdncache_entry
*fce
;
805 if ((fce
= fqdncache_get(addr
))) {
806 if (1 == fce
->flags
.fromhosts
) {
807 fqdncacheUnlockEntry(fce
);
808 } else if (fce
->locks
> 0) {
809 debugs(35, DBG_IMPORTANT
, "fqdncacheAddEntryFromHosts: can't add static entry for locked address '" << addr
<< "'");
812 fqdncacheRelease(fce
);
816 fce
= fqdncacheCreateEntry(addr
);
819 fce
->names
[j
] = xstrdup(hostnames
->key
);
820 Tolower(fce
->names
[j
]);
822 hostnames
= hostnames
->next
;
824 if (j
>= FQDN_MAX_NAMES
)
829 fce
->names
[j
] = NULL
; /* it's safe */
830 fce
->flags
.fromhosts
= 1;
831 fqdncacheAddEntry(fce
);
832 fqdncacheLockEntry(fce
);
835 /// \ingroup FQDNCacheInternal
837 fqdncacheRegisterWithCacheManager(void)
839 Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
845 \ingroup FQDNCacheAPI
847 * Initialize the fqdncache.
848 * Called after IP cache initialization.
855 fqdncacheRegisterWithCacheManager();
860 debugs(35, 3, "Initializing FQDN Cache...");
862 memset(&FqdncacheStats
, '\0', sizeof(FqdncacheStats
));
864 memset(&lru_list
, '\0', sizeof(lru_list
));
866 fqdncache_high
= (long) (((float) Config
.fqdncache
.size
*
867 (float) FQDN_HIGH_WATER
) / (float) 100);
869 fqdncache_low
= (long) (((float) Config
.fqdncache
.size
*
870 (float) FQDN_LOW_WATER
) / (float) 100);
872 n
= hashPrime(fqdncache_high
/ 4);
874 fqdn_table
= hash_create((HASHCMP
*) strcmp
, n
, hash4
);
876 memDataInit(MEM_FQDNCACHE_ENTRY
, "fqdncache_entry",
877 sizeof(fqdncache_entry
), 0);
882 * \ingroup FQDNCacheAPI
883 * The function to return the FQDN statistics via SNMP
886 snmp_netFqdnFn(variable_list
* Var
, snint
* ErrP
)
888 variable_list
*Answer
= NULL
;
890 debugs(49, 5, "snmp_netFqdnFn: Processing request:" << snmpDebugOid(Var
->name
, Var
->name_length
, tmp
));
891 *ErrP
= SNMP_ERR_NOERROR
;
893 switch (Var
->name
[LEN_SQ_NET
+ 1]) {
896 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
902 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
903 FqdncacheStats
.requests
,
908 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
914 /* this is now worthless */
915 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
921 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
922 FqdncacheStats
.negative_hits
,
927 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
928 FqdncacheStats
.misses
,
933 Answer
= snmp_var_new_integer(Var
->name
, Var
->name_length
,
939 *ErrP
= SNMP_ERR_NOSUCHNAME
;
946 #endif /*SQUID_SNMP */