The "ptr_u" unions no longer have a "next" pointer - they now just have

one member - or have one that's not used, so get rid of those unions.

svn path=/trunk/; revision=9151
This commit is contained in:
Guy Harris 2003-12-03 09:28:26 +00:00
parent ed2ae2d8d3
commit dcd98ae8d3
12 changed files with 101 additions and 111 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: ftypes.c,v 1.17 2003/12/03 08:53:37 guy Exp $
* $Id: ftypes.c,v 1.18 2003/12/03 09:28:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -196,7 +196,7 @@ fvalue_new(ftenum_t ftype)
SLAB_ALLOC(fv, fvalue_free_list);
FTYPE_LOOKUP(ftype, ft);
fv->ptr_u.ftype = ft;
fv->ftype = ft;
new_value = ft->new_value;
if (new_value) {
@ -213,7 +213,7 @@ fvalue_init(fvalue_t *fv, ftenum_t ftype)
FvalueNewFunc new_value;
FTYPE_LOOKUP(ftype, ft);
fv->ptr_u.ftype = ft;
fv->ftype = ft;
new_value = ft->new_value;
if (new_value) {
@ -227,8 +227,8 @@ fvalue_from_unparsed(ftenum_t ftype, char *s, gboolean allow_partial_value, LogF
fvalue_t *fv;
fv = fvalue_new(ftype);
if (fv->ptr_u.ftype->val_from_unparsed) {
if (fv->ptr_u.ftype->val_from_unparsed(fv, s, allow_partial_value, logfunc)) {
if (fv->ftype->val_from_unparsed) {
if (fv->ftype->val_from_unparsed(fv, s, allow_partial_value, logfunc)) {
return fv;
}
}
@ -246,8 +246,8 @@ fvalue_from_string(ftenum_t ftype, char *s, LogFunc logfunc)
fvalue_t *fv;
fv = fvalue_new(ftype);
if (fv->ptr_u.ftype->val_from_string) {
if (fv->ptr_u.ftype->val_from_string(fv, s, logfunc)) {
if (fv->ftype->val_from_string) {
if (fv->ftype->val_from_string(fv, s, logfunc)) {
return fv;
}
}
@ -262,34 +262,34 @@ fvalue_from_string(ftenum_t ftype, char *s, LogFunc logfunc)
const char*
fvalue_type_name(fvalue_t *fv)
{
return fv->ptr_u.ftype->name;
return fv->ftype->name;
}
guint
fvalue_length(fvalue_t *fv)
{
if (fv->ptr_u.ftype->len)
return fv->ptr_u.ftype->len(fv);
if (fv->ftype->len)
return fv->ftype->len(fv);
else
return fv->ptr_u.ftype->wire_size;
return fv->ftype->wire_size;
}
int
fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype)
{
g_assert(fv->ptr_u.ftype->len_string_repr);
return fv->ptr_u.ftype->len_string_repr(fv, rtype);
g_assert(fv->ftype->len_string_repr);
return fv->ftype->len_string_repr(fv, rtype);
}
char *
fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
{
g_assert(fv->ptr_u.ftype->val_to_string_repr);
g_assert(fv->ftype->val_to_string_repr);
if (!buf) {
buf = g_malloc0(fvalue_string_repr_len(fv, rtype) + 1);
}
fv->ptr_u.ftype->val_to_string_repr(fv, rtype, buf);
fv->ftype->val_to_string_repr(fv, rtype, buf);
return buf;
}
@ -375,7 +375,7 @@ slice_func(gpointer data, gpointer user_data)
return;
}
fv->ptr_u.ftype->slice(fv, slice_data->bytes, start_offset, length);
fv->ftype->slice(fv, slice_data->bytes, start_offset, length);
}
@ -406,98 +406,98 @@ fvalue_slice(fvalue_t *fv, drange *drange)
void
fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
{
g_assert(fv->ptr_u.ftype->set_value);
fv->ptr_u.ftype->set_value(fv, value, already_copied);
g_assert(fv->ftype->set_value);
fv->ftype->set_value(fv, value, already_copied);
}
void
fvalue_set_integer(fvalue_t *fv, guint32 value)
{
g_assert(fv->ptr_u.ftype->set_value_integer);
fv->ptr_u.ftype->set_value_integer(fv, value);
g_assert(fv->ftype->set_value_integer);
fv->ftype->set_value_integer(fv, value);
}
void
fvalue_set_floating(fvalue_t *fv, gdouble value)
{
g_assert(fv->ptr_u.ftype->set_value_floating);
fv->ptr_u.ftype->set_value_floating(fv, value);
g_assert(fv->ftype->set_value_floating);
fv->ftype->set_value_floating(fv, value);
}
gpointer
fvalue_get(fvalue_t *fv)
{
g_assert(fv->ptr_u.ftype->get_value);
return fv->ptr_u.ftype->get_value(fv);
g_assert(fv->ftype->get_value);
return fv->ftype->get_value(fv);
}
guint32
fvalue_get_integer(fvalue_t *fv)
{
g_assert(fv->ptr_u.ftype->get_value_integer);
return fv->ptr_u.ftype->get_value_integer(fv);
g_assert(fv->ftype->get_value_integer);
return fv->ftype->get_value_integer(fv);
}
double
fvalue_get_floating(fvalue_t *fv)
{
g_assert(fv->ptr_u.ftype->get_value_floating);
return fv->ptr_u.ftype->get_value_floating(fv);
g_assert(fv->ftype->get_value_floating);
return fv->ftype->get_value_floating(fv);
}
gboolean
fvalue_eq(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_eq);
return a->ptr_u.ftype->cmp_eq(a, b);
g_assert(a->ftype->cmp_eq);
return a->ftype->cmp_eq(a, b);
}
gboolean
fvalue_ne(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_ne);
return a->ptr_u.ftype->cmp_ne(a, b);
g_assert(a->ftype->cmp_ne);
return a->ftype->cmp_ne(a, b);
}
gboolean
fvalue_gt(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_gt);
return a->ptr_u.ftype->cmp_gt(a, b);
g_assert(a->ftype->cmp_gt);
return a->ftype->cmp_gt(a, b);
}
gboolean
fvalue_ge(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_ge);
return a->ptr_u.ftype->cmp_ge(a, b);
g_assert(a->ftype->cmp_ge);
return a->ftype->cmp_ge(a, b);
}
gboolean
fvalue_lt(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_lt);
return a->ptr_u.ftype->cmp_lt(a, b);
g_assert(a->ftype->cmp_lt);
return a->ftype->cmp_lt(a, b);
}
gboolean
fvalue_le(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_le);
return a->ptr_u.ftype->cmp_le(a, b);
g_assert(a->ftype->cmp_le);
return a->ftype->cmp_le(a, b);
}
gboolean
fvalue_contains(fvalue_t *a, fvalue_t *b)
{
/* XXX - check compatibility of a and b */
g_assert(a->ptr_u.ftype->cmp_contains);
return a->ptr_u.ftype->cmp_contains(a, b);
g_assert(a->ftype->cmp_contains);
return a->ftype->cmp_contains(a, b);
}

View File

@ -1,7 +1,7 @@
/* ftypes.h
* Definitions for field types
*
* $Id: ftypes.h,v 1.24 2003/12/03 08:53:37 guy Exp $
* $Id: ftypes.h,v 1.25 2003/12/03 09:28:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -127,9 +127,7 @@ ftype_can_contains(enum ftenum ftype);
#include <epan/dfilter/drange.h>
typedef struct _fvalue_t {
union {
ftype_t *ftype;
} ptr_u;
ftype_t *ftype;
union {
/* Put a few basic types in here */
gpointer pointer;
@ -216,7 +214,7 @@ extern fvalue_t *fvalue_free_list;
#define FVALUE_CLEANUP(fv) \
{ \
register FvalueFreeFunc free_value; \
free_value = (fv)->ptr_u.ftype->free_value; \
free_value = (fv)->ftype->free_value; \
if (free_value) { \
free_value((fv)); \
} \

View File

@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
* $Id: proto.c,v 1.121 2003/12/03 08:53:36 guy Exp $
* $Id: proto.c,v 1.122 2003/12/03 09:28:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -569,15 +569,14 @@ proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
* good thing we saved it, now we can reverse the
* memory leak and reclaim it.
*/
field_info_tmp->ptr_u.next=field_info_free_list;
field_info_free_list=field_info_tmp;
SLAB_FREE(field_info_tmp, field_info_free_list);
}
/* we might throw an exception, keep track of this one
* across the "dangerous" section below.
*/
field_info_tmp=new_fi;
switch(new_fi->ptr_u.hfinfo->type) {
switch(new_fi->hfinfo->type) {
case FT_NONE:
/* no value to set for FT_NONE */
break;
@ -738,9 +737,9 @@ proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
break;
default:
g_error("new_fi->ptr_u.hfinfo->type %d (%s) not handled\n",
new_fi->ptr_u.hfinfo->type,
ftype_name(new_fi->ptr_u.hfinfo->type));
g_error("new_fi->hfinfo->type %d (%s) not handled\n",
new_fi->hfinfo->type,
ftype_name(new_fi->hfinfo->type));
g_assert_not_reached();
break;
}
@ -1277,7 +1276,7 @@ proto_item_append_string(proto_item *pi, const char *str)
return;
fi = PITEM_FINFO(pi);
hfinfo = fi->ptr_u.hfinfo;
hfinfo = fi->hfinfo;
g_assert(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ);
old_str = fvalue_get(&fi->value);
new_str = g_malloc(strlen(old_str) + strlen(str) + 1);
@ -1638,7 +1637,7 @@ proto_tree_set_uint(field_info *fi, guint32 value)
header_field_info *hfinfo;
guint32 integer;
hfinfo = fi->ptr_u.hfinfo;
hfinfo = fi->hfinfo;
integer = value;
if (hfinfo->bitmask) {
@ -1725,7 +1724,7 @@ proto_tree_set_int(field_info *fi, gint32 value)
header_field_info *hfinfo;
guint32 integer;
hfinfo = fi->ptr_u.hfinfo;
hfinfo = fi->hfinfo;
integer = (guint32) value;
if (hfinfo->bitmask) {
@ -1883,7 +1882,7 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
FIELD_INFO_NEW(fi);
fi->ptr_u.hfinfo = hfinfo;
fi->hfinfo = hfinfo;
fi->start = start;
if (tvb) {
fi->start += tvb_raw_offset(tvb);
@ -1891,7 +1890,7 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
fi->length = *length;
fi->tree_type = -1;
fi->visible = PTREE_DATA(tree)->visible;
fvalue_init(&fi->value, fi->ptr_u.hfinfo->type);
fvalue_init(&fi->value, fi->hfinfo->type);
fi->rep = NULL;
/* add the data source tvbuff */
@ -2491,7 +2490,7 @@ proto_register_subtree_array(gint **indices, int num_indices)
void
proto_item_fill_label(field_info *fi, gchar *label_str)
{
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
guint8 *bytes;
guint32 integer;
@ -2676,7 +2675,7 @@ static void
fill_label_uint64(field_info *fi, gchar *label_str)
{
unsigned char *bytes;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
int ret; /*tmp return value */
bytes=fvalue_get(&fi->value);
@ -2705,7 +2704,7 @@ static void
fill_label_int64(field_info *fi, gchar *label_str)
{
unsigned char *bytes;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
int ret; /*tmp return value */
bytes=fvalue_get(&fi->value);
@ -2739,7 +2738,7 @@ fill_label_boolean(field_info *fi, gchar *label_str)
guint32 value;
int ret; /*tmp return value */
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
static const true_false_string default_tf = { "True", "False" };
const true_false_string *tfstring = &default_tf;
@ -2782,7 +2781,7 @@ fill_label_enumerated_bitfield(field_info *fi, gchar *label_str)
guint32 value;
int ret; /*tmp return value */
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
/* Figure out the bit width */
bitwidth = hfinfo_bitwidth(hfinfo);
@ -2818,7 +2817,7 @@ fill_label_numeric_bitfield(field_info *fi, gchar *label_str)
guint32 value;
int ret; /*tmp return value */
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
/* Figure out the bit width */
bitwidth = hfinfo_bitwidth(hfinfo);
@ -2849,7 +2848,7 @@ static void
fill_label_enumerated_uint(field_info *fi, gchar *label_str)
{
char *format = NULL;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
guint32 value;
int ret; /*tmp return value */
@ -2870,7 +2869,7 @@ static void
fill_label_uint(field_info *fi, gchar *label_str)
{
char *format = NULL;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
guint32 value;
int ret; /*tmp return value */
@ -2889,7 +2888,7 @@ static void
fill_label_enumerated_int(field_info *fi, gchar *label_str)
{
char *format = NULL;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
guint32 value;
int ret; /*tmp return value */
@ -2909,7 +2908,7 @@ static void
fill_label_int(field_info *fi, gchar *label_str)
{
char *format = NULL;
header_field_info *hfinfo = fi->ptr_u.hfinfo;
header_field_info *hfinfo = fi->hfinfo;
guint32 value;
int ret; /*tmp return value */
@ -3445,7 +3444,7 @@ proto_can_match_selected(field_info *finfo, epan_dissect_t *edt)
header_field_info *hfinfo;
gint length;
hfinfo = finfo->ptr_u.hfinfo;
hfinfo = finfo->hfinfo;
g_assert(hfinfo);
switch(hfinfo->type) {
@ -3537,7 +3536,7 @@ proto_construct_dfilter_string(field_info *finfo, epan_dissect_t *edt)
gint start, length;
guint8 c;
hfinfo = finfo->ptr_u.hfinfo;
hfinfo = finfo->hfinfo;
g_assert(hfinfo);
abbrev_len = strlen(hfinfo->abbrev);
@ -3678,7 +3677,7 @@ proto_construct_dfilter_string(field_info *finfo, epan_dissect_t *edt)
break;
case FT_PROTOCOL:
buf = g_strdup(finfo->ptr_u.hfinfo->abbrev);
buf = g_strdup(finfo->hfinfo->abbrev);
break;
default:

View File

@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
* $Id: proto.h,v 1.50 2003/12/03 08:53:36 guy Exp $
* $Id: proto.h,v 1.51 2003/12/03 09:28:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -109,14 +109,7 @@ typedef struct _item_label_t {
/* Contains the field information for the proto_item. */
typedef struct field_info {
union {
/* the next pointer is only used when keeping track of
* free (unallocated) field_infos. Such field_info's
* are never associated with a header_field_info.
*/
struct field_info *next;
header_field_info *hfinfo;
} ptr_u;
header_field_info *hfinfo;
gint start;
gint length;
gint tree_type; /* ETT_* */

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.335 2003/12/02 23:14:32 guy Exp $
* $Id: main.c,v 1.336 2003/12/03 09:28:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -272,7 +272,7 @@ goto_framenum_cb(GtkWidget *w _U_, gpointer data _U_)
header_field_info *hfinfo;
guint32 framenum;
hfinfo = cfile.finfo_selected->ptr_u.hfinfo;
hfinfo = cfile.finfo_selected->hfinfo;
g_assert(hfinfo);
if (hfinfo->type == FT_FRAMENUM) {
framenum = fvalue_get_integer(&cfile.finfo_selected->value);
@ -950,13 +950,13 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_)
cfile.finfo_selected = finfo;
set_menus_for_selected_tree_row(&cfile);
if (finfo->ptr_u.hfinfo) {
if (finfo->ptr_u.hfinfo->blurb != NULL &&
finfo->ptr_u.hfinfo->blurb[0] != '\0') {
if (finfo->hfinfo) {
if (finfo->hfinfo->blurb != NULL &&
finfo->hfinfo->blurb[0] != '\0') {
has_blurb = TRUE;
length = strlen(finfo->ptr_u.hfinfo->blurb);
length = strlen(finfo->hfinfo->blurb);
} else {
length = strlen(finfo->ptr_u.hfinfo->name);
length = strlen(finfo->hfinfo->name);
}
if (finfo->length == 0) {
len_str[0] = '\0';
@ -967,11 +967,11 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_)
}
statusbar_pop_field_msg(); /* get rid of current help msg */
if (length) {
length += strlen(finfo->ptr_u.hfinfo->abbrev) + strlen(len_str) + 10;
length += strlen(finfo->hfinfo->abbrev) + strlen(len_str) + 10;
help_str = g_malloc(sizeof(gchar) * length);
sprintf(help_str, "%s (%s)%s",
(has_blurb) ? finfo->ptr_u.hfinfo->blurb : finfo->ptr_u.hfinfo->name,
finfo->ptr_u.hfinfo->abbrev, len_str);
(has_blurb) ? finfo->hfinfo->blurb : finfo->hfinfo->name,
finfo->hfinfo->abbrev, len_str);
statusbar_push_field_msg(help_str);
g_free(help_str);
} else {

View File

@ -1,7 +1,7 @@
/* menu.c
* Menu routines
*
* $Id: menu.c,v 1.118 2003/12/01 01:57:14 sharpe Exp $
* $Id: menu.c,v 1.119 2003/12/03 09:28:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1037,7 +1037,7 @@ set_menus_for_selected_tree_row(capture_file *cf)
gboolean properties;
if (cf->finfo_selected != NULL) {
header_field_info *hfinfo = cf->finfo_selected->ptr_u.hfinfo;
header_field_info *hfinfo = cf->finfo_selected->hfinfo;
if (hfinfo->parent == -1) {
properties = prefs_is_registered_protocol(hfinfo->abbrev);
} else {

View File

@ -1,7 +1,7 @@
/* prefs_dlg.c
* Routines for handling preferences
*
* $Id: prefs_dlg.c,v 1.66 2003/11/24 22:11:55 guy Exp $
* $Id: prefs_dlg.c,v 1.67 2003/12/03 09:28:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1308,7 +1308,7 @@ properties_cb(GtkWidget *w, gpointer dummy)
}
/* Find the title for the protocol for the selected field. */
hfinfo = cfile.finfo_selected->ptr_u.hfinfo;
hfinfo = cfile.finfo_selected->hfinfo;
if (hfinfo->parent == -1)
title = prefs_get_title_by_name(hfinfo->abbrev);
else

View File

@ -1,7 +1,7 @@
/* rtp_analysis.c
* RTP analysis addition for ethereal
*
* $Id: rtp_analysis.c,v 1.11 2003/12/02 21:15:49 guy Exp $
* $Id: rtp_analysis.c,v 1.12 2003/12/03 09:28:26 guy Exp $
*
* Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net>
@ -1780,14 +1780,14 @@ static gboolean process_node(proto_item *ptree_node, header_field_info *hfinform
finfo = PITEM_FINFO(ptree_node);
if (hfinformation==(finfo->ptr_u.hfinfo)) {
if (hfinformation==(finfo->hfinfo)) {
hfssrc = proto_registrar_get_byname((gchar*) proto_field);
if (hfssrc == NULL)
return FALSE;
for(ptree_node=g_node_first_child(ptree_node); ptree_node!=NULL;
ptree_node=g_node_next_sibling(ptree_node)) {
finfo=PITEM_FINFO(ptree_node);
if (hfssrc==finfo->ptr_u.hfinfo) {
if (hfssrc==finfo->hfinfo) {
if (hfinformation->type==FT_IPv4) {
ipv4 = fvalue_get(&finfo->value);
*p_result = ipv4_get_net_order_addr(ipv4);

View File

@ -11,7 +11,7 @@
* Portions Copyright (c) Gilbert Ramirez 2000-2002
* Portions Copyright (c) Novell, Inc. 2000-2003
*
* $Id: packet-ncp2222.inc,v 1.67 2003/12/02 21:15:45 guy Exp $
* $Id: packet-ncp2222.inc,v 1.68 2003/12/03 09:28:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -928,7 +928,7 @@ get_item_string(proto_item *item)
char *
get_item_name(proto_item *item)
{
return PITEM_FINFO(item)->ptr_u.hfinfo->name;
return PITEM_FINFO(item)->hfinfo->name;
}

View File

@ -1,7 +1,7 @@
/* print.c
* Routines for printing packet analysis trees.
*
* $Id: print.c,v 1.61 2003/11/27 22:29:52 guy Exp $
* $Id: print.c,v 1.62 2003/12/03 09:28:19 guy Exp $
*
* Gilbert Ramirez <gram@alumni.rice.edu>
*
@ -155,7 +155,7 @@ void proto_tree_print_node(GNode *node, gpointer data)
/* If it's uninterpreted data, dump it (unless our caller will
be printing the entire packet in hex). */
if (fi->ptr_u.hfinfo->id == proto_data && pdata->print_hex_for_data) {
if (fi->hfinfo->id == proto_data && pdata->print_hex_for_data) {
/*
* Find the data for this field.
*/

View File

@ -1,7 +1,7 @@
/* proto_hier_stats.c
* Routines for calculating statistics based on protocol.
*
* $Id: proto_hier_stats.c,v 1.18 2003/11/24 22:11:53 guy Exp $
* $Id: proto_hier_stats.c,v 1.19 2003/12/03 09:28:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -86,10 +86,10 @@ process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
finfo = PITEM_FINFO(ptree_node);
g_assert(finfo);
stat_node = find_stat_node(parent_stat_node, finfo->ptr_u.hfinfo);
stat_node = find_stat_node(parent_stat_node, finfo->hfinfo);
/* Assert that the finfo is related to a protocol, not a field. */
g_assert(finfo->ptr_u.hfinfo->parent == -1);
g_assert(finfo->hfinfo->parent == -1);
stats = STAT_NODE_STATS(stat_node);
stats->num_pkts_total++;

View File

@ -1,7 +1,7 @@
/* tap-protohierstat.c
* protohierstat 2002 Ronnie Sahlberg
*
* $Id: tap-protohierstat.c,v 1.4 2003/11/24 22:11:53 guy Exp $
* $Id: tap-protohierstat.c,v 1.5 2003/12/03 09:28:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -93,8 +93,8 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, void *d
/* first time we saw a protocol at this leaf */
if(rs->protocol==-1){
rs->protocol=fi->ptr_u.hfinfo->id;
rs->proto_name=fi->ptr_u.hfinfo->abbrev;
rs->protocol=fi->hfinfo->id;
rs->proto_name=fi->hfinfo->abbrev;
rs->frames=1;
rs->bytes=pinfo->fd->pkt_len;
rs->child=new_phs_t(rs);
@ -104,7 +104,7 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, void *d
/* find this protocol in the list of siblings */
for(tmprs=rs;tmprs;tmprs=tmprs->sibling){
if(tmprs->protocol==fi->ptr_u.hfinfo->id){
if(tmprs->protocol==fi->hfinfo->id){
break;
}
}
@ -115,8 +115,8 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, void *d
;
tmprs->sibling=new_phs_t(rs->parent);
rs=tmprs->sibling;
rs->protocol=fi->ptr_u.hfinfo->id;
rs->proto_name=fi->ptr_u.hfinfo->abbrev;
rs->protocol=fi->hfinfo->id;
rs->proto_name=fi->hfinfo->abbrev;
} else {
rs=tmprs;
}