aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipsec.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-11-19 08:54:37 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-11-19 08:54:37 +0000
commit5ae033890abb4cb1cd94badcd057072c3c704b9a (patch)
treeb6449cf609799ebb75b91e1cd6b600b06ee3d11a /packet-ipsec.c
parent2db57876028764ad3a8ec803db9f3fa12a733777 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2670 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ipsec.c')
-rw-r--r--packet-ipsec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-ipsec.c b/packet-ipsec.c
index 4c6e8ff315..21406b019c 100644
--- a/packet-ipsec.c
+++ b/packet-ipsec.c
@@ -1,7 +1,7 @@
/* packet-ipsec.c
* Routines for IPsec/IPComp packet disassembly
*
- * $Id: packet-ipsec.c,v 1.21 2000/11/17 21:00:35 gram Exp $
+ * $Id: packet-ipsec.c,v 1.22 2000/11/19 08:53:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -117,7 +117,7 @@ dissect_ah_old(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
advance = sizeof(ah) + ((ah.ah_len - 1) << 2);
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "AH");
+ col_set_str(fd, COL_PROTOCOL, "AH");
if (check_col(fd, COL_INFO)) {
col_add_fstr(fd, COL_INFO, "AH (SPI=0x%08x)",
(guint32)ntohl(ah.ah_spi));
@@ -160,7 +160,7 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
advance = sizeof(ah) + ((ah.ah_len - 1) << 2);
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "AH");
+ col_set_str(fd, COL_PROTOCOL, "AH");
if (check_col(fd, COL_INFO)) {
col_add_fstr(fd, COL_INFO, "AH (SPI=0x%08x)",
(guint32)ntohl(ah.ah_spi));
@@ -222,7 +222,7 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
* the next protocol in the stack
*/
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "ESP");
+ col_set_str(fd, COL_PROTOCOL, "ESP");
if (check_col(fd, COL_INFO)) {
col_add_fstr(fd, COL_INFO, "ESP (SPI=0x%08x)",
(guint32)ntohl(esp.esp_spi));
@@ -262,7 +262,7 @@ dissect_ipcomp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
* the next protocol in the stack
*/
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "IPComp");
+ col_set_str(fd, COL_PROTOCOL, "IPComp");
if (check_col(fd, COL_INFO)) {
p = val_to_str(ntohs(ipcomp.comp_cpi), cpi2val, "");
if (p[0] == '\0') {