diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-19 08:54:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-19 08:54:37 +0000 |
commit | 252d55d80f92fa8267758fbf4faab520d2f79273 (patch) | |
tree | b6449cf609799ebb75b91e1cd6b600b06ee3d11a /packet-clnp.c | |
parent | e88bd04f9aa217173cc86d785e9206e272a832ce (diff) | |
download | wireshark-252d55d80f92fa8267758fbf4faab520d2f79273.tar.gz wireshark-252d55d80f92fa8267758fbf4faab520d2f79273.tar.bz2 wireshark-252d55d80f92fa8267758fbf4faab520d2f79273.zip |
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-clnp.c')
-rw-r--r-- | packet-clnp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-clnp.c b/packet-clnp.c index 118271db3d..667afdde55 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.15 2000/11/19 04:14:26 guy Exp $ + * $Id: packet-clnp.c,v 1.16 2000/11/19 08:53:56 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -1516,7 +1516,7 @@ static gboolean dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo, /* Well, we found at least one valid COTP or CLTP PDU, so I guess this is either COTP or CLTP. */ if (!subdissector_found && check_col(pinfo->fd, COL_PROTOCOL)) - col_add_str(pinfo->fd, COL_PROTOCOL, is_cltp ? "CLTP" : "COTP"); + col_set_str(pinfo->fd, COL_PROTOCOL, is_cltp ? "CLTP" : "COTP"); found_ositp = TRUE; } @@ -1562,12 +1562,12 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->current_proto = "CLNP"; if (check_col(pinfo->fd, COL_PROTOCOL)) - col_add_str(pinfo->fd, COL_PROTOCOL, "CLNP"); + col_set_str(pinfo->fd, COL_PROTOCOL, "CLNP"); cnf_proto_id = tvb_get_guint8(tvb, P_CLNP_PROTO_ID); if (cnf_proto_id == NLPID_NULL) { if (check_col(pinfo->fd, COL_INFO)) - col_add_str(pinfo->fd, COL_INFO, "Inactive subset"); + col_set_str(pinfo->fd, COL_INFO, "Inactive subset"); if (tree) { ti = proto_tree_add_item(tree, proto_clnp, tvb, P_CLNP_PROTO_ID, 1, FALSE); clnp_tree = proto_item_add_subtree(ti, ett_clnp); |