diff options
author | Guy Harris <guy@alum.mit.edu> | 1998-12-04 05:59:14 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1998-12-04 05:59:14 +0000 |
commit | 7dd4f76f59579f4ac1ae8343d5e049ce3fe8191f (patch) | |
tree | 0a0c6d9499666e278cafdcbcf3098c8051059909 /packet-nbns.c | |
parent | 5274503f24eed25a020c3a004be4d7d9d61cd0e0 (diff) |
When dissecting DNS or NBNS queries or replies, add the item to the tree
for the queries or replies first, then create and add the subtree and
populate it, and, when that's done, set the length of the item
appropriately; if you add the subtree later, the subtree's top-level
node appears to have level 0, rather than 1 greater than the tree of
which it's a subtree, which causes those trees not to print correctly.
svn path=/trunk/; revision=122
Diffstat (limited to 'packet-nbns.c')
-rw-r--r-- | packet-nbns.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packet-nbns.c b/packet-nbns.c index c74c1c3eba..e14b637592 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -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.9 1998/11/21 04:00:31 guy Exp $ + * $Id: packet-nbns.c,v 1.10 1998/12/04 05:59:12 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -642,14 +642,14 @@ dissect_query_records(const u_char *nbns_data_ptr, int count, const u_char *pd, int start_off; GtkWidget *qatree, *ti; - qatree = gtk_tree_new(); start_off = cur_off; - - while (count-- > 0) - cur_off += dissect_nbns_query(nbns_data_ptr, pd, cur_off, qatree); ti = add_item_to_tree(GTK_WIDGET(nbns_tree), - start_off, cur_off - start_off, "Queries"); + start_off, 0, "Queries"); + qatree = gtk_tree_new(); add_subtree(ti, qatree, ETT_NBNS_QRY); + while (count-- > 0) + cur_off += dissect_nbns_query(nbns_data_ptr, pd, cur_off, qatree); + set_item_len(ti, cur_off - start_off); return cur_off - start_off; } @@ -663,15 +663,15 @@ dissect_answer_records(const u_char *nbns_data_ptr, int count, int start_off; GtkWidget *qatree, *ti; - qatree = gtk_tree_new(); start_off = cur_off; - + ti = add_item_to_tree(GTK_WIDGET(nbns_tree), + start_off, 0, name); + qatree = gtk_tree_new(); + add_subtree(ti, qatree, ETT_NBNS_ANS); while (count-- > 0) cur_off += dissect_nbns_answer(nbns_data_ptr, pd, cur_off, qatree, opcode); - ti = add_item_to_tree(GTK_WIDGET(nbns_tree), start_off, cur_off - start_off, name); - add_subtree(ti, qatree, ETT_NBNS_ANS); - + set_item_len(ti, cur_off - start_off); return cur_off - start_off; } |