aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
commit23319ff023bcb144347a1307b958359b5226c699 (patch)
treeb347f1669210e07039ec31051cbb2c5e82422e6b /epan/packet.c
parenta81a607ed5e3d291940ab75dd82d28d72c222b48 (diff)
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 'epan/packet.c')
-rw-r--r--epan/packet.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/packet.c b/epan/packet.c
index a4c70dbe47..b6f299a0a1 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.53 2001/12/08 21:00:42 guy Exp $
+ * $Id: packet.c,v 1.54 2001/12/10 00:26:16 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -152,8 +152,10 @@ init_all_protocols(void)
/* Creates the top-most tvbuff and calls dissect_frame() */
void
dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
- const u_char *pd, frame_data *fd)
+ const u_char *pd, frame_data *fd, column_info *cinfo)
{
+ int i;
+
edt->pi.dl_src.type = AT_NONE;
edt->pi.dl_dst.type = AT_NONE;
edt->pi.net_src.type = AT_NONE;
@@ -174,7 +176,15 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
edt->pi.fd = fd;
edt->pi.pseudo_header = pseudo_header;
- col_set_writable(fd, TRUE);
+ edt->pi.cinfo = cinfo;
+ if (cinfo != NULL) {
+ for (i = 0; i < cinfo->num_cols; i++) {
+ cinfo->col_buf[i][0] = '\0';
+ cinfo->col_data[i] = cinfo->col_buf[i];
+ }
+
+ col_set_writable(cinfo, TRUE);
+ }
TRY {
edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len, "Frame");