aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipv6.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-ipv6.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-ipv6.c')
-rw-r--r--packet-ipv6.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c
index 51aa504988..c2ae63524f 100644
--- a/packet-ipv6.c
+++ b/packet-ipv6.c
@@ -1,7 +1,7 @@
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.45 2000/11/17 06:02:20 guy Exp $
+ * $Id: packet-ipv6.c,v 1.46 2000/11/19 08:53:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -417,7 +417,7 @@ again:
if (frag) {
/* fragmented */
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "IPv6");
+ col_set_str(fd, COL_PROTOCOL, "IPv6");
/* COL_INFO was filled in by "dissect_frag6()" */
old_dissect_data(pd, offset, fd, tree);
} else {
@@ -425,7 +425,7 @@ again:
if (!old_dissector_try_port(ip_dissector_table, nxt, pd, offset, fd, tree)) {
/* Unknown protocol */
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "IPv6");
+ col_set_str(fd, COL_PROTOCOL, "IPv6");
if (check_col(fd, COL_INFO))
col_add_fstr(fd, COL_INFO, "%s (0x%02x)", ipprotostr(nxt), nxt);
old_dissect_data(pd, offset, fd, tree);