diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-12-10 00:26:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-12-10 00:26:21 +0000 |
commit | 23319ff023bcb144347a1307b958359b5226c699 (patch) | |
tree | b347f1669210e07039ec31051cbb2c5e82422e6b /packet-chdlc.c | |
parent | a81a607ed5e3d291940ab75dd82d28d72c222b48 (diff) | |
download | wireshark-23319ff023bcb144347a1307b958359b5226c699.tar.gz |
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
Diffstat (limited to 'packet-chdlc.c')
-rw-r--r-- | packet-chdlc.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/packet-chdlc.c b/packet-chdlc.c index 60919a49b6..90705e5acd 100644 --- a/packet-chdlc.c +++ b/packet-chdlc.c @@ -1,7 +1,7 @@ /* packet-chdlc.c * Routines for Cisco HDLC packet disassembly * - * $Id: packet-chdlc.c,v 1.8 2001/12/08 06:41:41 guy Exp $ + * $Id: packet-chdlc.c,v 1.9 2001/12/10 00:25:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -133,8 +133,8 @@ chdlctype(guint16 chdlctype, tvbuff_t *tvb, int offset_after_chdlctype, /* do lookup with the subdissector table */ if (!dissector_try_port(subdissector_table, chdlctype, next_tvb, pinfo, tree)) { - if (check_col(pinfo->fd, COL_PROTOCOL)) - col_add_fstr(pinfo->fd, COL_PROTOCOL, "0x%04x", chdlctype); + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "0x%04x", chdlctype); call_dissector(data_handle,next_tvb, pinfo, tree); } } @@ -147,14 +147,14 @@ dissect_chdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 addr; guint16 proto; - if (check_col(pinfo->fd, COL_RES_DL_SRC)) - col_set_str(pinfo->fd, COL_RES_DL_SRC, "N/A"); - if (check_col(pinfo->fd, COL_RES_DL_DST)) - col_set_str(pinfo->fd, COL_RES_DL_DST, "N/A"); - if (check_col(pinfo->fd, COL_PROTOCOL)) - col_set_str(pinfo->fd, COL_PROTOCOL, "CHDLC"); - if (check_col(pinfo->fd, COL_INFO)) - col_clear(pinfo->fd, COL_INFO); + if (check_col(pinfo->cinfo, COL_RES_DL_SRC)) + col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "N/A"); + if (check_col(pinfo->cinfo, COL_RES_DL_DST)) + col_set_str(pinfo->cinfo, COL_RES_DL_DST, "N/A"); + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "CHDLC"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_guint8(tvb, 0); proto = tvb_get_ntohs(tvb, 2); @@ -225,10 +225,10 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint32 mysequence; guint32 yoursequence; - if (check_col(pinfo->fd, COL_PROTOCOL)) - col_set_str(pinfo->fd, COL_PROTOCOL, "SLARP"); - if (check_col(pinfo->fd, COL_INFO)) - col_clear(pinfo->fd, COL_INFO); + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SLARP"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_clear(pinfo->cinfo, COL_INFO); code = tvb_get_ntohl(tvb, 0); @@ -241,8 +241,8 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case SLARP_REQUEST: case SLARP_REPLY: - if (check_col(pinfo->fd, COL_INFO)) { - col_add_fstr(pinfo->fd, COL_INFO, "%s, from %s, mask %s", + if (check_col(pinfo->cinfo, COL_INFO)) { + col_add_fstr(pinfo->cinfo, COL_INFO, "%s, from %s, mask %s", match_strval(code, slarp_ptype_vals), get_hostname(htonl(tvb_get_ntohl(tvb, 4))), ip_to_str(tvb_get_ptr(tvb, 8, 4))); @@ -258,8 +258,8 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case SLARP_LINECHECK: mysequence = tvb_get_ntohl(tvb, 4); yoursequence = tvb_get_ntohl(tvb, 8); - if (check_col(pinfo->fd, COL_INFO)) { - col_add_fstr(pinfo->fd, COL_INFO, + if (check_col(pinfo->cinfo, COL_INFO)) { + col_add_fstr(pinfo->cinfo, COL_INFO, "%s, outgoing sequence %u, returned sequence %u", match_strval(code, slarp_ptype_vals), mysequence, yoursequence); @@ -274,8 +274,8 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - if (check_col(pinfo->fd, COL_INFO)) - col_add_fstr(pinfo->fd, COL_INFO, "Unknown packet type 0x%08X", code); + if (check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown packet type 0x%08X", code); if (tree) { proto_tree_add_uint(slarp_tree, hf_slarp_ptype, tvb, 0, 4, code); call_dissector(data_handle,tvb_new_subset(tvb, 4,-1,tvb_reported_length_remaining(tvb,4)), pinfo, slarp_tree); |