2 * DEBUG: section 35 FQDN Cache
3 * AUTHOR: Harvest Derived
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
35 #include "DnsLookupDetails.h"
38 #include "HelperReply.h"
40 #include "mgr/Registration.h"
41 #include "SquidConfig.h"
43 #include "SquidTime.h"
44 #include "StatCounters.h"
49 #include "snmp_core.h"
53 \defgroup FQDNCacheAPI FQDN Cache API
55 \section Introduction Introduction
57 * The FQDN cache is a built-in component of squid providing
58 * Hostname to IP-Number translation functionality and managing
59 * the involved data-structures. Efficiency concerns require
60 * mechanisms that allow non-blocking access to these mappings.
61 * The FQDN cache usually doesn't block on a request except for
62 * special cases where this is desired (see below).
64 \todo FQDN Cache should have its own API *.h file.
68 \defgroup FQDNCacheInternal FQDN Cache Internals
71 * Internally, the execution flow is as follows:
72 * On a miss, fqdncache_nbgethostbyaddr() checks whether a request
73 * for this name is already pending, and if positive, it creates a
74 * new entry using fqdncacheAddEntry(). Then it calls
75 * fqdncacheAddPending() to add a request to the queue together
76 * with data and handler. Else, ifqdncache_dnsDispatch() is called
77 * to directly create a DNS query or to fqdncacheEnqueue() if all
78 * no DNS port is free.
81 * fqdncacheCallback() is called regularly to walk down the pending
82 * list and call handlers.
85 * LRU clean-up is performed through fqdncache_purgelru() according
86 * to the fqdncache_high threshold.
89 /// \ingroup FQDNCacheInternal
90 #define FQDN_LOW_WATER 90
92 /// \ingroup FQDNCacheInternal
93 #define FQDN_HIGH_WATER 95
97 * The data structure used for storing name-address mappings
98 * is a small hashtable (static hash_table *fqdn_table),
99 * where structures of type fqdncache_entry whose most
100 * interesting members are:
102 class fqdncache_entry
105 hash_link hash
; /* must be first */
108 unsigned char name_count
;
109 char *names
[FQDN_MAX_NAMES
+ 1];
114 struct timeval request_time
;
116 unsigned short locks
;
123 int age() const; ///< time passed since request_time or -1 if unknown
126 /// \ingroup FQDNCacheInternal
127 static struct _fqdn_cache_stats
{
135 /// \ingroup FQDNCacheInternal
136 static dlink_list lru_list
;
139 static HLPCB fqdncacheHandleReply
;
140 static int fqdncacheParse(fqdncache_entry
*, const char *buf
);
142 static IDNSCB fqdncacheHandleReply
;
143 static int fqdncacheParse(fqdncache_entry
*, const rfc1035_rr
*, int, const char *error_message
);
145 static void fqdncacheRelease(fqdncache_entry
*);
146 static fqdncache_entry
*fqdncacheCreateEntry(const char *name
);
147 static void fqdncacheCallback(fqdncache_entry
*, int wait
);
148 static fqdncache_entry
*fqdncache_get(const char *);
149 static int fqdncacheExpiredEntry(const fqdncache_entry
*);
150 static void fqdncacheLockEntry(fqdncache_entry
* f
);
151 static void fqdncacheUnlockEntry(fqdncache_entry
* f
);
152 static FREE fqdncacheFreeEntry
;
153 static void fqdncacheAddEntry(fqdncache_entry
* f
);
155 /// \ingroup FQDNCacheInternal
156 static hash_table
*fqdn_table
= NULL
;
158 /// \ingroup FQDNCacheInternal
159 static long fqdncache_low
= 180;
161 /// \ingroup FQDNCacheInternal
162 static long fqdncache_high
= 200;
164 /// \ingroup FQDNCacheInternal
165 inline int fqdncacheCount() { return fqdn_table
? fqdn_table
->count
: 0; }
168 fqdncache_entry::age() const
170 return request_time
.tv_sec
? tvSubMsec(request_time
, current_time
) : -1;
174 \ingroup FQDNCacheInternal
175 * Removes the given fqdncache entry
178 fqdncacheRelease(fqdncache_entry
* f
)
181 hash_remove_link(fqdn_table
, (hash_link
*) f
);
183 for (k
= 0; k
< (int) f
->name_count
; ++k
)
184 safe_free(f
->names
[k
]);
186 debugs(35, 5, "fqdncacheRelease: Released FQDN record for '" << hashKeyStr(&f
->hash
) << "'.");
188 dlinkDelete(&f
->lru
, &lru_list
);
190 safe_free(f
->hash
.key
);
192 safe_free(f
->error_message
);
194 memFree(f
, MEM_FQDNCACHE_ENTRY
);
198 \ingroup FQDNCacheInternal
199 \param name FQDN hash string.
200 \retval Match for given name
202 static fqdncache_entry
*
203 fqdncache_get(const char *name
)
206 static fqdncache_entry
*f
;
210 if ((e
= (hash_link
*)hash_lookup(fqdn_table
, name
)) != NULL
)
211 f
= (fqdncache_entry
*) e
;
217 /// \ingroup FQDNCacheInternal
219 fqdncacheExpiredEntry(const fqdncache_entry
* f
)
221 /* all static entries are locked, so this takes care of them too */
226 if (f
->expires
> squid_curtime
)
232 /// \ingroup FQDNCacheAPI
234 fqdncache_purgelru(void *notused
)
237 dlink_node
*prev
= NULL
;
240 eventAdd("fqdncache_purgelru", fqdncache_purgelru
, NULL
, 10.0, 1);
242 for (m
= lru_list
.tail
; m
; m
= prev
) {
243 if (fqdncacheCount() < fqdncache_low
)
248 f
= (fqdncache_entry
*)m
->data
;
258 debugs(35, 9, "fqdncache_purgelru: removed " << removed
<< " entries");
261 /// \ingroup FQDNCacheAPI
263 purge_entries_fromhosts(void)
265 dlink_node
*m
= lru_list
.head
;
266 fqdncache_entry
*i
= NULL
;
270 if (i
!= NULL
) { /* need to delay deletion */
271 fqdncacheRelease(i
); /* we just override locks */
275 t
= (fqdncache_entry
*)m
->data
;
277 if (t
->flags
.fromhosts
)
288 \ingroup FQDNCacheInternal
290 * Create blank fqdncache_entry
292 static fqdncache_entry
*
293 fqdncacheCreateEntry(const char *name
)
295 static fqdncache_entry
*f
;
296 f
= (fqdncache_entry
*)memAllocate(MEM_FQDNCACHE_ENTRY
);
297 f
->hash
.key
= xstrdup(name
);
298 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
302 /// \ingroup FQDNCacheInternal
304 fqdncacheAddEntry(fqdncache_entry
* f
)
306 hash_link
*e
= (hash_link
*)hash_lookup(fqdn_table
, f
->hash
.key
);
309 /* avoid colission */
310 fqdncache_entry
*q
= (fqdncache_entry
*) e
;
314 hash_join(fqdn_table
, &f
->hash
);
315 dlinkAdd(f
, &f
->lru
, &lru_list
);
316 f
->lastref
= squid_curtime
;
320 \ingroup FQDNCacheInternal
322 * Walks down the pending list, calling handlers
325 fqdncacheCallback(fqdncache_entry
* f
, int wait
)
329 f
->lastref
= squid_curtime
;
334 fqdncacheLockEntry(f
);
336 callback
= f
->handler
;
340 if (cbdataReferenceValidDone(f
->handlerData
, &cbdata
)) {
341 const DnsLookupDetails
details(f
->error_message
, wait
);
342 callback(f
->name_count
? f
->names
[0] : NULL
, details
, cbdata
);
345 fqdncacheUnlockEntry(f
);
348 /// \ingroup FQDNCacheInternal
351 fqdncacheParse(fqdncache_entry
*f
, const char *inbuf
)
353 LOCAL_ARRAY(char, buf
, DNS_INBUF_SZ
);
356 const char *name
= (const char *)f
->hash
.key
;
357 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
358 f
->flags
.negcached
= 1;
361 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL> reply in response to '" << name
<< "'");
362 f
->error_message
= xstrdup("Internal Error");
366 xstrncpy(buf
, inbuf
, DNS_INBUF_SZ
);
367 debugs(35, 5, "fqdncacheParse: parsing: {" << buf
<< "}");
368 token
= strtok(buf
, w_space
);
371 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got <NULL>, expecting '$name' in response to '" << name
<< "'");
372 f
->error_message
= xstrdup("Internal Error");
376 if (0 == strcmp(token
, "$fail")) {
377 token
= strtok(NULL
, "\n");
378 assert(NULL
!= token
);
379 f
->error_message
= xstrdup(token
);
383 if (0 != strcmp(token
, "$name")) {
384 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting '$name' in response to '" << name
<< "'");
385 f
->error_message
= xstrdup("Internal Error");
389 token
= strtok(NULL
, w_space
);
392 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting TTL in response to '" << name
<< "'");
393 f
->error_message
= xstrdup("Internal Error");
399 token
= strtok(NULL
, w_space
);
402 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: Got '" << inbuf
<< "', expecting hostname in response to '" << name
<< "'");
403 f
->error_message
= xstrdup("Internal Error");
407 f
->names
[0] = xstrdup(token
);
410 if (ttl
== 0 || ttl
> Config
.positiveDnsTtl
)
411 ttl
= Config
.positiveDnsTtl
;
413 if (ttl
< Config
.negativeDnsTtl
)
414 ttl
= Config
.negativeDnsTtl
;
416 f
->expires
= squid_curtime
+ ttl
;
418 f
->flags
.negcached
= 0;
420 return f
->name_count
;
425 fqdncacheParse(fqdncache_entry
*f
, const rfc1035_rr
* answers
, int nr
, const char *error_message
)
429 const char *name
= (const char *)f
->hash
.key
;
430 f
->expires
= squid_curtime
+ Config
.negativeDnsTtl
;
431 f
->flags
.negcached
= true;
434 debugs(35, 3, "fqdncacheParse: Lookup of '" << name
<< "' failed (" << error_message
<< ")");
435 f
->error_message
= xstrdup(error_message
);
440 debugs(35, 3, "fqdncacheParse: No DNS records for '" << name
<< "'");
441 f
->error_message
= xstrdup("No DNS records");
445 debugs(35, 3, "fqdncacheParse: " << nr
<< " answers for '" << name
<< "'");
448 for (k
= 0; k
< nr
; ++k
) {
449 if (answers
[k
]._class
!= RFC1035_CLASS_IN
)
452 if (answers
[k
].type
== RFC1035_TYPE_PTR
) {
453 if (!answers
[k
].rdata
[0]) {
454 debugs(35, 2, "fqdncacheParse: blank PTR record for '" << name
<< "'");
458 if (strchr(answers
[k
].rdata
, ' ')) {
459 debugs(35, 2, "fqdncacheParse: invalid PTR record '" << answers
[k
].rdata
<< "' for '" << name
<< "'");
463 f
->names
[f
->name_count
] = xstrdup(answers
[k
].rdata
);
465 } else if (answers
[k
].type
!= RFC1035_TYPE_CNAME
)
468 if (ttl
== 0 || (int) answers
[k
].ttl
< ttl
)
469 ttl
= answers
[k
].ttl
;
471 if (f
->name_count
>= FQDN_MAX_NAMES
)
475 if (f
->name_count
== 0) {
476 debugs(35, DBG_IMPORTANT
, "fqdncacheParse: No PTR record for '" << name
<< "'");
480 if (ttl
> Config
.positiveDnsTtl
)
481 ttl
= Config
.positiveDnsTtl
;
483 if (ttl
< Config
.negativeDnsTtl
)
484 ttl
= Config
.negativeDnsTtl
;
486 f
->expires
= squid_curtime
+ ttl
;
488 f
->flags
.negcached
= false;
490 return f
->name_count
;
496 \ingroup FQDNCacheAPI
498 * Callback for handling DNS results.
502 fqdncacheHandleReply(void *data
, const HelperReply
&reply
)
504 fqdncacheHandleReply(void *data
, const rfc1035_rr
* answers
, int na
, const char *error_message
)
508 static_cast<generic_cbdata
*>(data
)->unwrap(&f
);
509 ++FqdncacheStats
.replies
;
510 const int age
= f
->age();
511 statCounter
.dns
.svcTime
.count(age
);
514 fqdncacheParse(f
, reply
.other().content());
517 fqdncacheParse(f
, answers
, na
, error_message
);
520 fqdncacheAddEntry(f
);
522 fqdncacheCallback(f
, age
);
526 \ingroup FQDNCacheAPI
528 \param addr IP address of domain to resolve.
529 \param handler A pointer to the function to be called when
530 * the reply from the FQDN cache
531 * (or the DNS if the FQDN cache misses)
532 \param handlerData Information that is passed to the handler
533 * and does not affect the FQDN cache.
536 fqdncache_nbgethostbyaddr(const Ip::Address
&addr
, FQDNH
* handler
, void *handlerData
)
538 fqdncache_entry
*f
= NULL
;
539 char name
[MAX_IPSTRLEN
];
541 addr
.NtoA(name
,MAX_IPSTRLEN
);
542 debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name
<< "'.");
543 ++FqdncacheStats
.requests
;
545 if (name
[0] == '\0') {
546 debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!");
547 const DnsLookupDetails
details("Invalid hostname", -1); // error, no lookup
549 handler(NULL
, details
, handlerData
);
553 f
= fqdncache_get(name
);
558 } else if (fqdncacheExpiredEntry(f
)) {
559 /* hit, but expired -- bummer */
564 debugs(35, 4, "fqdncache_nbgethostbyaddr: HIT for '" << name
<< "'");
566 if (f
->flags
.negcached
)
567 ++ FqdncacheStats
.negative_hits
;
569 ++ FqdncacheStats
.hits
;
571 f
->handler
= handler
;
573 f
->handlerData
= cbdataReference(handlerData
);
575 fqdncacheCallback(f
, -1); // no lookup
580 debugs(35, 5, "fqdncache_nbgethostbyaddr: MISS for '" << name
<< "'");
581 ++ FqdncacheStats
.misses
;
582 f
= fqdncacheCreateEntry(name
);
583 f
->handler
= handler
;
584 f
->handlerData
= cbdataReference(handlerData
);
585 f
->request_time
= current_time
;
586 c
= new generic_cbdata(f
);
588 dnsSubmit(hashKeyStr(&f
->hash
), fqdncacheHandleReply
, c
);
590 idnsPTRLookup(addr
, fqdncacheHandleReply
, c
);
595 \ingroup FQDNCacheAPI
597 * Is different in that it only checks if an entry exists in
598 * it's data-structures and does not by default contact the
599 * DNS, unless this is requested, by setting the flags
600 * to FQDN_LOOKUP_IF_MISS.
602 \param addr address of the FQDN being resolved
603 \param flags values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
607 fqdncache_gethostbyaddr(const Ip::Address
&addr
, int flags
)
609 char name
[MAX_IPSTRLEN
];
610 fqdncache_entry
*f
= NULL
;
612 if (addr
.IsAnyAddr() || addr
.IsNoAddr()) {
616 addr
.NtoA(name
,MAX_IPSTRLEN
);
617 ++ FqdncacheStats
.requests
;
618 f
= fqdncache_get(name
);
622 } else if (fqdncacheExpiredEntry(f
)) {
625 } else if (f
->flags
.negcached
) {
626 ++ FqdncacheStats
.negative_hits
;
627 // ignore f->error_message: the caller just checks FQDN cache presence
630 ++ FqdncacheStats
.hits
;
631 f
->lastref
= squid_curtime
;
632 // ignore f->error_message: the caller just checks FQDN cache presence
636 /* no entry [any more] */
638 ++ FqdncacheStats
.misses
;
640 if (flags
& FQDN_LOOKUP_IF_MISS
) {
641 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
= true;
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 */