aboutsummaryrefslogtreecommitdiffstats
path: root/proto_hier_stats.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-04 10:59:34 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-04 10:59:34 +0000
commitf0b9d12b6a46e47bba5db8baeb24453396efac9d (patch)
treebf784482d59a9572d596b1c1177beb842447717d /proto_hier_stats.c
parente83aeb6431bc4f1577146e806c5c61a2e7c799a4 (diff)
Don't use GNodes for the protocol tree, put the sibling pointer, and
pointers to the first *and* last child, in the "proto_node" structure itself. That saves us one level of indirection and memory allocation, and lets us append to a tree by appending to the last child directly, rather than having to scan through the list of siblings of the first child to find the end of that list. svn path=/trunk/; revision=9171
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r--proto_hier_stats.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index 266c7dd070..641ee0d24c 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -1,7 +1,7 @@
/* proto_hier_stats.c
* Routines for calculating statistics based on protocol.
*
- * $Id: proto_hier_stats.c,v 1.19 2003/12/03 09:28:19 guy Exp $
+ * $Id: proto_hier_stats.c,v 1.20 2003/12/04 10:59:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -76,11 +76,11 @@ find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo)
static void
-process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, guint pkt_len)
+process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, guint pkt_len)
{
field_info *finfo;
- ph_stats_node_t *stats;
- proto_item *proto_sibling_node;
+ ph_stats_node_t *stats;
+ proto_node *proto_sibling_node;
GNode *stat_node;
finfo = PITEM_FINFO(ptree_node);
@@ -95,7 +95,7 @@ process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
stats->num_pkts_total++;
stats->num_bytes_total += pkt_len;
- proto_sibling_node = g_node_next_sibling(ptree_node);
+ proto_sibling_node = ptree_node->next;
if (proto_sibling_node) {
process_node(proto_sibling_node, stat_node, ps, pkt_len);
@@ -111,9 +111,9 @@ process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
static void
process_tree(proto_tree *protocol_tree, ph_stats_t* ps, guint pkt_len)
{
- proto_item *ptree_node;
+ proto_node *ptree_node;
- ptree_node = g_node_first_child(protocol_tree);
+ ptree_node = ((proto_node *)protocol_tree)->first_child;
if (!ptree_node) {
return;
}