aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-31 17:10:10 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-31 17:10:10 +0000
commit5d76d969297cf8fa54364a768c3593a3fd276292 (patch)
treecbdcc9e293cbbfd29a05c2392c58dc5335eeec89
parentc9371c3cd203bdaf518b62203291d735f4f4cfb4 (diff)
downloadwireshark-5d76d969297cf8fa54364a768c3593a3fd276292.tar.gz
wireshark-5d76d969297cf8fa54364a768c3593a3fd276292.tar.bz2
wireshark-5d76d969297cf8fa54364a768c3593a3fd276292.zip
Get rid of the only uses of proto_tree_add_item_old() and
proto_tree_add_item_hidden_old(), and get rid of the functions as well. Also remove a static function in proto.c that is no longer used (it was used by proto_tree_add_item()). svn path=/trunk/; revision=2033
-rw-r--r--packet-rsvp.c6
-rw-r--r--proto.c129
-rw-r--r--proto.h11
3 files changed, 5 insertions, 141 deletions
diff --git a/packet-rsvp.c b/packet-rsvp.c
index 718974e4ae..dbeb91046e 100644
--- a/packet-rsvp.c
+++ b/packet-rsvp.c
@@ -3,7 +3,7 @@
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: packet-rsvp.c,v 1.22 2000/05/31 05:07:36 guy Exp $
+ * $Id: packet-rsvp.c,v 1.23 2000/05/31 17:10:08 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -875,7 +875,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
hdr->message_type);
return;
}
- proto_tree_add_item_hidden_old(rsvp_header_tree, rsvp_filter[RSVPF_MSG + hdr->message_type], NullTVB,
+ proto_tree_add_uint_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + hdr->message_type], NullTVB,
offset+1, 1, 1);
proto_tree_add_text(rsvp_header_tree, NullTVB, offset + 2 , 2, "Message Checksum");
proto_tree_add_text(rsvp_header_tree, NullTVB, offset + 4 , 1, "Sending TTL: %u",
@@ -898,7 +898,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (!object_type) object_type = "Unknown";
ti = proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], NullTVB,
offset, obj_length, obj->class);
- ti = proto_tree_add_item_old(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(obj->class)], NullTVB,
+ ti = proto_tree_add_uint(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(obj->class)], NullTVB,
offset, obj_length, obj->class);
offset2 = offset + sizeof(rsvp_object);
diff --git a/proto.c b/proto.c
index c4aa97ea00..ac11a8e3c9 100644
--- a/proto.c
+++ b/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.67 2000/05/31 05:07:59 guy Exp $
+ * $Id: proto.c,v 1.68 2000/05/31 17:10:09 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -99,8 +99,6 @@ static void
proto_tree_set_representation(proto_item *pi, const char *format, va_list ap);
static void
-proto_tree_set_value(field_info *fi, gint length, va_list ap);
-static void
proto_tree_set_bytes(field_info *fi, const guint8* start_ptr, gint length);
static void
proto_tree_set_bytes_tvb(field_info *fi, tvbuff_t *tvb, gint offset, gint length);
@@ -302,43 +300,6 @@ proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length,
return pi;
}
-/* Add an item to a proto_tree, using the text label registered to that item. */
-proto_item *
-proto_tree_add_item_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, ...)
-{
- proto_item *pi;
- va_list ap;
- field_info *new_fi;
-
- pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi);
- if (pi == NULL)
- return(NULL);
-
- va_start(ap, length);
- proto_tree_set_value(new_fi, length, ap);
- va_end(ap);
-
- return pi;
-}
-
-/* Add an item to a proto_tree, but make it invisible in GUI. The field is
- * still searchable, though. */
-proto_item *
-proto_tree_add_item_hidden_old(proto_tree *tree, int hfindex, tvbuff_t* tvb, gint start, gint length, ...)
-{
- proto_item *pi;
- field_info *fi;
-
- pi = proto_tree_add_item_old(tree, hfindex, tvb, start, length);
- if (pi == NULL)
- return(NULL);
-
- fi = (field_info*) (((GNode*)pi)->data);
- fi->visible = FALSE;
-
- return pi;
-}
-
static guint32
get_uint_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian)
{
@@ -510,94 +471,6 @@ proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb,
return pi;
}
-static void
-proto_tree_set_value(field_info *fi, gint length, va_list ap)
-{
- header_field_info *hfinfo;
-
- hfinfo = fi->hfinfo;
-
- /* from the stdarg man page on Solaris 2.6:
- NOTES
- It is up to the calling routine to specify in some manner
- how many arguments there are, since it is not always possi-
- ble to determine the number of arguments from the stack
- frame. For example, execl is passed a zero pointer to sig-
- nal the end of the list. printf can tell how many arguments
- there are by the format. It is non-portable to specify a
- second argument of char, short, or float to va_arg, because
- arguments seen by the called function are not char, short,
- or float. C converts char and short arguments to int and
- converts float arguments to double before passing them to a
- function.
- */
- switch(hfinfo->type) {
- case FT_NONE:
- break;
-
- case FT_BYTES:
- proto_tree_set_bytes(fi, va_arg(ap, guint8*), length);
- break;
-
- case FT_BOOLEAN:
- proto_tree_set_boolean(fi, va_arg(ap, unsigned int));
- break;
-
- case FT_UINT8:
- case FT_UINT16:
- case FT_UINT24:
- case FT_UINT32:
- proto_tree_set_uint(fi, va_arg(ap, unsigned int));
- break;
-
- case FT_INT8:
- case FT_INT16:
- case FT_INT24:
- case FT_INT32:
- proto_tree_set_int(fi, va_arg(ap, int));
- break;
-
- case FT_IPv4:
- proto_tree_set_ipv4(fi, va_arg(ap, unsigned int));
- break;
-
- case FT_IPXNET:
- proto_tree_set_ipxnet(fi, va_arg(ap, unsigned int));
- break;
-
- case FT_IPv6:
- proto_tree_set_ipv6(fi, va_arg(ap, guint8*));
- break;
-
- case FT_DOUBLE:
- proto_tree_set_double(fi, va_arg(ap, double));
- break;
-
- case FT_ETHER:
- proto_tree_set_ether(fi, va_arg(ap, guint8*));
- break;
-
- case FT_ABSOLUTE_TIME:
- case FT_RELATIVE_TIME:
- proto_tree_set_time(fi, va_arg(ap, struct timeval*));
- break;
-
- case FT_STRING:
- /* This g_strdup'ed memory is freed in proto_tree_free_node() */
- proto_tree_set_string(fi, va_arg(ap, char*));
- break;
-
- case FT_TEXT_ONLY:
- ; /* nothing */
- break;
-
- default:
- g_error("hfinfo->type %d not handled\n", hfinfo->type);
- g_assert_not_reached();
- break;
- }
-}
-
/* Add a FT_NONE to a proto_tree */
proto_item *
diff --git a/proto.h b/proto.h
index 234a7f24ba..6352536072 100644
--- a/proto.h
+++ b/proto.h
@@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
- * $Id: proto.h,v 1.32 2000/05/31 05:08:00 guy Exp $
+ * $Id: proto.h,v 1.33 2000/05/31 17:10:10 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -195,15 +195,6 @@ proto_register_field_array(int parent, hf_register_info *hf, int num_records);
void
proto_register_subtree_array(gint **indices, int num_indices);
-/* Add item's value to proto_tree, using label registered to that field */
-proto_item *
-proto_tree_add_item_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
- gint length, ...);
-
-proto_item *
-proto_tree_add_item_hidden_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
- gint length, ...);
-
/* Add an item to a proto_tree, using the text label registered to that item;
the item is extracted from the tvbuff handed to it. */
proto_item *