From 5ae033890abb4cb1cd94badcd057072c3c704b9a Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 19 Nov 2000 08:54:37 +0000 Subject: 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2670 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-ascend.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packet-ascend.c') diff --git a/packet-ascend.c b/packet-ascend.c index 72acab9fcc..2efc22061c 100644 --- a/packet-ascend.c +++ b/packet-ascend.c @@ -1,7 +1,7 @@ /* packet-ascend.c * Routines for decoding Lucent/Ascend packet traces * - * $Id: packet-ascend.c,v 1.19 2000/11/19 02:00:02 guy Exp $ + * $Id: packet-ascend.c,v 1.20 2000/11/19 08:53:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -67,13 +67,13 @@ dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* load the top pane info. This should be overwritten by the next protocol in the stack */ if(check_col(pinfo->fd, COL_RES_DL_SRC)) - col_add_str(pinfo->fd, COL_RES_DL_SRC, "N/A" ); + col_set_str(pinfo->fd, COL_RES_DL_SRC, "N/A" ); if(check_col(pinfo->fd, COL_RES_DL_DST)) - col_add_str(pinfo->fd, COL_RES_DL_DST, "N/A" ); + col_set_str(pinfo->fd, COL_RES_DL_DST, "N/A" ); if(check_col(pinfo->fd, COL_PROTOCOL)) - col_add_str(pinfo->fd, COL_PROTOCOL, "N/A" ); + col_set_str(pinfo->fd, COL_PROTOCOL, "N/A" ); if(check_col(pinfo->fd, COL_INFO)) - col_add_str(pinfo->fd, COL_INFO, "Lucent/Ascend packet trace" ); + col_set_str(pinfo->fd, COL_INFO, "Lucent/Ascend packet trace" ); /* populate a tree in the second pane with the status of the link layer (ie none) */ -- cgit v1.2.3