aboutsummaryrefslogtreecommitdiffstats
path: root/packet-wsp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-19 08:54:37 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-19 08:54:37 +0000
commit252d55d80f92fa8267758fbf4faab520d2f79273 (patch)
treeb6449cf609799ebb75b91e1cd6b600b06ee3d11a /packet-wsp.c
parente88bd04f9aa217173cc86d785e9206e272a832ce (diff)
For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
Diffstat (limited to 'packet-wsp.c')
-rw-r--r--packet-wsp.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/packet-wsp.c b/packet-wsp.c
index cf3e66a159..e5721b1bb9 100644
--- a/packet-wsp.c
+++ b/packet-wsp.c
@@ -3,7 +3,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
- * $Id: packet-wsp.c,v 1.3 2000/11/05 09:30:11 guy Exp $
+ * $Id: packet-wsp.c,v 1.4 2000/11/19 08:54:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -402,9 +402,7 @@ dissect_wsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This field shows up as the "Info" column in the display; you should make
it, if possible, summarize what's in the packet, so that a user looking
- at the list of packets can tell what type of packet it is.
- "col_add_fstr()" can be used instead of "col_add_str()"; it takes
- "printf()"-like arguments. */
+ at the list of packets can tell what type of packet it is. */
/* Display protocol type depending on the port */
if (check_col(fdata, COL_PROTOCOL))
@@ -412,10 +410,10 @@ dissect_wsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch ( pinfo->match_port )
{
case UDP_PORT_WSP:
- col_add_fstr(fdata, COL_PROTOCOL, "WSP" );
+ col_set_str(fdata, COL_PROTOCOL, "WSP" );
break;
case UDP_PORT_WTLS_WSP:
- col_add_fstr(fdata, COL_PROTOCOL, "WTLS+WSP" );
+ col_set_str(fdata, COL_PROTOCOL, "WTLS+WSP" );
break;
}
}
@@ -439,20 +437,8 @@ dissect_wsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (tree) {
-/* NOTE: The offset and length values in the previous call to
- "proto_tree_add_item()" define what data bytes to highlight in the hex
- display window when the line in the protocol tree display
- corresponding to that item is selected.
-
- END_OF_FRAME is a handy way to highlight all data from the offset to
- the end of the packet. */
-/* ti = proto_tree_add_item(tree, proto_wsp, NullTVB, offset, END_OF_FRAME, NULL); */
-/*
- ti = proto_tree_add_item(tree, proto_wsp, tvb, offset, END_OF_FRAME, NULL);
- wsp_tree = proto_item_add_subtree(ti, ett_wsp);
-*/
-
- ti = proto_tree_add_item(tree, proto_wsp, tvb, 0, END_OF_FRAME, bo_little_endian);
+ ti = proto_tree_add_item(tree, proto_wsp, tvb, 0,
+ tvb_length(tvb), bo_little_endian);
wsp_tree = proto_item_add_subtree(ti, ett_wsp);
/* Code to process the packet goes here */