#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.89.2.7 2007-01-15 11:15:54 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.89.2.8 2007-02-13 19:19:27 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
ns_qprint(register const u_char *cp, register const u_char *bp, int is_mdns)
{
register const u_char *np = cp;
- register u_int i, class, qu;
+ register u_int i, class;
cp = ns_nskip(cp);
/* print the qclass (if it's not IN) */
i = EXTRACT_16BITS(cp);
cp += 2;
- if (is_mdns) {
+ if (is_mdns)
class = (i & ~C_QU);
- qu = (i & C_QU);
- } else {
+ else
class = i;
- qu = 0;
- }
if (class != C_IN)
printf(" %s", tok2str(ns_class2str, "(Class %d)", class));
- if (qu)
- printf(" (QU)");
- else
- printf(" (QM)");
+ if (is_mdns) {
+ if (i & C_QU)
+ printf(" (QU)");
+ else
+ printf(" (QM)");
+ }
fputs("? ", stdout);
cp = ns_nprint(np, bp);
static const u_char *
ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns)
{
- register u_int i, class, cache_flush, opt_flags = 0;
+ register u_int i, class, opt_flags = 0;
register u_short typ, len;
register const u_char *rp;
/* print the class (if it's not IN and the type isn't OPT) */
i = EXTRACT_16BITS(cp);
cp += 2;
- if (is_mdns) {
+ if (is_mdns)
class = (i & ~C_CACHE_FLUSH);
- cache_flush = i & C_CACHE_FLUSH;
- } else {
+ else
class = i;
- cache_flush = 0;
- }
if (class != C_IN && typ != T_OPT)
printf(" %s", tok2str(ns_class2str, "(Class %d)", class));
- if (cache_flush)
- printf(" (Cache flush)");
+ if (is_mdns) {
+ if (i & C_CACHE_FLUSH)
+ printf(" (Cache flush)");
+ }
/* ignore ttl */
cp += 2;