Show queries as a summary line (as was the case before my DNS checkins)
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 Oct 1998 06:40:51 +0000 (06:40 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 Oct 1998 06:40:51 +0000 (06:40 +0000)
which can be expanded into a detailed name/type/class description.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@58 f5534014-38df-0310-8fa8-9805f1628bb7

packet-dns.c
packet-nbns.c
packet.h

index 767b061648945143d2a9502da4b0d7af334a1170..770de7bc3933637338735133f2a8cc565aa1b39b 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-dns.c
  * Routines for DNS packet disassembly
  *
- * $Id: packet-dns.c,v 1.6 1998/10/14 22:37:01 guy Exp $
+ * $Id: packet-dns.c,v 1.7 1998/10/15 06:40:50 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -273,6 +273,7 @@ dissect_dns_query(const u_char *dns_data_ptr, const u_char *pd, int offset,
   char *type_name;
   const u_char *dptr;
   const u_char *data_start;
+  GtkWidget *q_tree, *tq;
 
   data_start = dptr = pd + offset;
 
@@ -280,15 +281,21 @@ dissect_dns_query(const u_char *dns_data_ptr, const u_char *pd, int offset,
     &type, &class);
   dptr += len;
 
-  add_item_to_tree(dns_tree, offset, name_len, "Name: %s", name);
+  type_name = dns_type_name(type);
+  class_name = dns_class_name(class);
+
+  tq = add_item_to_tree(dns_tree, offset, len, "%s: type %s, class %s", 
+                  name, type_name, class_name);
+  q_tree = gtk_tree_new();
+  add_subtree(tq, q_tree, ETT_DNS_QD);
+
+  add_item_to_tree(q_tree, offset, name_len, "Name: %s", name);
   offset += name_len;
 
-  type_name = dns_type_name(type);
-  add_item_to_tree(dns_tree, offset, 2, "Type: %s", type_name);
+  add_item_to_tree(q_tree, offset, 2, "Type: %s", type_name);
   offset += 2;
 
-  class_name = dns_class_name(class);
-  add_item_to_tree(dns_tree, offset, 2, "Class: %s", class_name);
+  add_item_to_tree(q_tree, offset, 2, "Class: %s", class_name);
   offset += 2;
   
   return dptr - data_start;
index 6492941ee307196e139aa87c13b5c92ad52b6c48..b2c0ae4d787d7858cabd44e5aa0421be99e8a1d0 100644 (file)
@@ -3,7 +3,7 @@
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  * Much stuff added by Guy Harris <guy@netapp.com>
  *
- * $Id: packet-nbns.c,v 1.3 1998/10/14 22:37:02 guy Exp $
+ * $Id: packet-nbns.c,v 1.4 1998/10/15 06:40:50 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -230,6 +230,7 @@ dissect_nbns_query(const u_char *nbns_data_ptr, const u_char *pd, int offset,
        char *type_name;
        const u_char *dptr;
        const u_char *data_start;
+       GtkWidget *q_tree, *tq;
 
        data_start = dptr = pd + offset;
 
@@ -237,15 +238,21 @@ dissect_nbns_query(const u_char *nbns_data_ptr, const u_char *pd, int offset,
            &name_len, &type, &class);
        dptr += len;
 
-       add_item_to_tree(nbns_tree, offset, name_len, "Name: %s", name);
+       type_name = nbns_type_name(type);
+       class_name = dns_class_name(class);
+
+       tq = add_item_to_tree(nbns_tree, offset, len, "%s: type %s, class %s", 
+           name, type_name, class_name);
+       q_tree = gtk_tree_new();
+       add_subtree(tq, q_tree, ETT_NBNS_QD);
+
+       add_item_to_tree(q_tree, offset, name_len, "Name: %s", name);
        offset += name_len;
 
-       type_name = nbns_type_name(type);
-       add_item_to_tree(nbns_tree, offset, 2, "Type: %s", type_name);
+       add_item_to_tree(q_tree, offset, 2, "Type: %s", type_name);
        offset += 2;
 
-       class_name = dns_class_name(class);
-       add_item_to_tree(nbns_tree, offset, 2, "Class: %s", class_name);
+       add_item_to_tree(q_tree, offset, 2, "Class: %s", class_name);
        offset += 2;
        
        return dptr - data_start;
index 2d02f374de6368fc4145d0c457a6e4f82adbc6ec..72b361ff0c0cef5c6378169492d695024bd1dc53 100644 (file)
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
 /* packet.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet.h,v 1.17 1998/10/14 19:35:00 guy Exp $
+ * $Id: packet.h,v 1.18 1998/10/15 06:40:51 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -403,8 +403,9 @@ enum {
        ETT_SPX,
        ETT_NCP,
        ETT_DNS,
-       ETT_DNS_ANS,
        ETT_DNS_QRY,
+       ETT_DNS_QD,
+       ETT_DNS_ANS,
        ETT_DNS_RR,
        ETT_RIP,
        ETT_RIP_VEC,
@@ -428,8 +429,9 @@ enum {
        ETT_IPXSAP,
        ETT_IPXSAP_SERVER,
        ETT_NBNS,
-       ETT_NBNS_ANS,
        ETT_NBNS_QRY,
+       ETT_NBNS_QD,
+       ETT_NBNS_ANS,
        ETT_NBNS_RR,
        ETT_NBIPX,
        NUM_TREE_TYPES  /* last item number plus one */