aboutsummaryrefslogtreecommitdiffstats
path: root/packet-who.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
commit292e38e2c61edcd14bfa30ca3c72bacda1bcbe32 (patch)
treedb4edef02456a48d0f6d505166ac7d70f6c0f644 /packet-who.c
parent162800efb308901e0c302517be01226130e39b19 (diff)
Add tvbuff class.
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
Diffstat (limited to 'packet-who.c')
-rw-r--r--packet-who.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/packet-who.c b/packet-who.c
index c5f78046f1..9df4775559 100644
--- a/packet-who.c
+++ b/packet-who.c
@@ -2,7 +2,7 @@
* Routines for who protocol (see man rwhod)
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-who.c,v 1.5 2000/04/08 07:07:41 guy Exp $
+ * $Id: packet-who.c,v 1.6 2000/05/11 08:15:56 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -137,41 +137,41 @@ dissect_who(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
/* We already know that the packet has enough data to fill in
* the summary info. Retrieve that data */
- who_ti = proto_tree_add_item(tree, proto_who, offset, END_OF_FRAME, NULL);
+ who_ti = proto_tree_add_item(tree, proto_who, NullTVB, offset, END_OF_FRAME, NULL);
who_tree = proto_item_add_subtree(who_ti, ett_who);
- proto_tree_add_item(who_tree, hf_who_vers, offset, 1, pd[offset]);
+ proto_tree_add_item(who_tree, hf_who_vers, NullTVB, offset, 1, pd[offset]);
offset += 1;
- proto_tree_add_item(who_tree, hf_who_type, offset, 1, pd[offset]);
+ proto_tree_add_item(who_tree, hf_who_type, NullTVB, offset, 1, pd[offset]);
offset += 1;
/* 2 filler bytes */
offset += 2;
tv.tv_sec = pntohl(&pd[offset]);
- proto_tree_add_item(who_tree, hf_who_sendtime, offset, 4, &tv);
+ proto_tree_add_item(who_tree, hf_who_sendtime, NullTVB, offset, 4, &tv);
offset += 4;
tv.tv_sec = pntohl(&pd[offset]);
- proto_tree_add_item(who_tree, hf_who_recvtime, offset, 4, &tv);
+ proto_tree_add_item(who_tree, hf_who_recvtime, NullTVB, offset, 4, &tv);
offset += 4;
- proto_tree_add_item(who_tree, hf_who_hostname, offset, 32, server_name);
+ proto_tree_add_item(who_tree, hf_who_hostname, NullTVB, offset, 32, server_name);
offset += 32;
- proto_tree_add_item(who_tree, hf_who_loadav_5, offset, 4, loadav_5);
+ proto_tree_add_item(who_tree, hf_who_loadav_5, NullTVB, offset, 4, loadav_5);
offset += 4;
- proto_tree_add_item(who_tree, hf_who_loadav_10, offset, 4, loadav_10);
+ proto_tree_add_item(who_tree, hf_who_loadav_10, NullTVB, offset, 4, loadav_10);
offset += 4;
- proto_tree_add_item(who_tree, hf_who_loadav_15, offset, 4, loadav_15);
+ proto_tree_add_item(who_tree, hf_who_loadav_15, NullTVB, offset, 4, loadav_15);
offset += 4;
tv.tv_sec = pntohl(&pd[offset]);
- proto_tree_add_item(who_tree, hf_who_boottime, offset, 4, &tv);
+ proto_tree_add_item(who_tree, hf_who_boottime, NullTVB, offset, 4, &tv);
offset += 4;
dissect_whoent(pd, offset, fd, who_tree);
@@ -203,21 +203,21 @@ dissect_whoent(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
memcpy(out_line, &pd[line_offset], 8);
memcpy(out_name, &pd[line_offset+8], 8);
- whoent_ti = proto_tree_add_item(tree, hf_who_whoent, line_offset, SIZE_OF_WHOENT, NULL);
+ whoent_ti = proto_tree_add_item(tree, hf_who_whoent, NullTVB, line_offset, SIZE_OF_WHOENT, NULL);
whoent_tree = proto_item_add_subtree(whoent_ti, ett_whoent);
- proto_tree_add_item(whoent_tree, hf_who_tty, line_offset, 8, out_line);
+ proto_tree_add_item(whoent_tree, hf_who_tty, NullTVB, line_offset, 8, out_line);
line_offset += 8;
- proto_tree_add_item(whoent_tree, hf_who_uid, line_offset, 8, out_name);
+ proto_tree_add_item(whoent_tree, hf_who_uid, NullTVB, line_offset, 8, out_name);
line_offset += 8;
tv.tv_sec = pntohl(&pd[line_offset]);
- proto_tree_add_item(whoent_tree, hf_who_timeon, line_offset, 4, &tv);
+ proto_tree_add_item(whoent_tree, hf_who_timeon, NullTVB, line_offset, 4, &tv);
line_offset += 4;
idle_secs = pntohl(&pd[line_offset]);
- proto_tree_add_uint_format(whoent_tree, hf_who_idle, line_offset, 4, idle_secs,
+ proto_tree_add_uint_format(whoent_tree, hf_who_idle, NullTVB, line_offset, 4, idle_secs,
"Idle: %s", time_secs_to_str(idle_secs));
line_offset += 4;