From 23319ff023bcb144347a1307b958359b5226c699 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 10 Dec 2001 00:26:21 +0000 Subject: Move the pointer to the "column_info" structure in the "frame_data" structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370 --- packet-tns.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'packet-tns.c') diff --git a/packet-tns.c b/packet-tns.c index 6d5e669a2f..9d2e7baa1d 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,7 +1,7 @@ /* packet-tns.c * Routines for Oracle TNS packet dissection * - * $Id: packet-tns.c,v 1.23 2001/12/03 03:59:40 guy Exp $ + * $Id: packet-tns.c,v 1.24 2001/12/10 00:25:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -210,15 +210,15 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, } offset += 2; - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { if ( is_sns ) { - col_append_fstr(pinfo->fd, COL_INFO, ", SNS"); + col_append_fstr(pinfo->cinfo, COL_INFO, ", SNS"); } else { - col_append_fstr(pinfo->fd, COL_INFO, ", Data"); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Data"); } } @@ -248,9 +248,9 @@ static void dissect_tns_connect(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Connect"); + col_append_str(pinfo->cinfo, COL_INFO, ", Connect"); } if ( connect_tree ) @@ -396,9 +396,9 @@ static void dissect_tns_accept(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Accept"); + col_append_str(pinfo->cinfo, COL_INFO, ", Accept"); } if ( accept_tree ) @@ -492,9 +492,9 @@ static void dissect_tns_refuse(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Refuse"); + col_append_str(pinfo->cinfo, COL_INFO, ", Refuse"); } if ( refuse_tree ) @@ -543,9 +543,9 @@ static void dissect_tns_abort(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Abort"); + col_append_str(pinfo->cinfo, COL_INFO, ", Abort"); } if ( abort_tree ) @@ -595,15 +595,15 @@ static void dissect_tns_marker(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { if ( is_attention ) { - col_append_str(pinfo->fd, COL_INFO, ", Marker"); + col_append_str(pinfo->cinfo, COL_INFO, ", Marker"); } else { - col_append_str(pinfo->fd, COL_INFO, ", Attention"); + col_append_str(pinfo->cinfo, COL_INFO, ", Attention"); } } @@ -646,9 +646,9 @@ static void dissect_tns_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Redirect"); + col_append_str(pinfo->cinfo, COL_INFO, ", Redirect"); } if ( redirect_tree ) @@ -682,9 +682,9 @@ static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo, 0, 0, TRUE); } - if ( check_col(pinfo->fd, COL_INFO) ) + if ( check_col(pinfo->cinfo, COL_INFO) ) { - col_append_str(pinfo->fd, COL_INFO, ", Control"); + col_append_str(pinfo->cinfo, COL_INFO, ", Control"); } if ( control_tree ) @@ -713,12 +713,12 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 length; guint16 type; - if (check_col(pinfo->fd, COL_PROTOCOL)) - col_set_str(pinfo->fd, COL_PROTOCOL, "TNS"); + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "TNS"); - if (check_col(pinfo->fd, COL_INFO)) + if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_str(pinfo->fd, COL_INFO, + col_add_str(pinfo->cinfo, COL_INFO, (pinfo->match_port == pinfo->destport) ? "Request" : "Response"); } @@ -763,9 +763,9 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } offset += 1; - if ( check_col(pinfo->fd, COL_INFO)) + if ( check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->fd, COL_INFO, ", %s (%u)", + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s (%u)", val_to_str(type, tns_type_vals, "Unknown"), type); } -- cgit v1.2.3