aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/epan.c13
-rw-r--r--epan/epan.h5
-rw-r--r--file.c30
-rw-r--r--gtk/packet_win.c6
-rw-r--r--proto_hier_stats.c4
-rw-r--r--tethereal.c17
6 files changed, 37 insertions, 38 deletions
diff --git a/epan/epan.c b/epan/epan.c
index 96e2b6bf8f..20edfb4b42 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -1,6 +1,6 @@
/* epan.h
*
- * $Id: epan.c,v 1.13 2001/12/10 00:26:16 guy Exp $
+ * $Id: epan.c,v 1.14 2001/12/16 22:16:13 guy Exp $
*
* Ethereal Protocol Analyzer Library
*
@@ -75,7 +75,8 @@ epan_conversation_init(void)
epan_dissect_t*
epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd,
- gboolean create_proto_tree, column_info *cinfo)
+ gboolean create_proto_tree, gboolean proto_tree_visible,
+ column_info *cinfo)
{
epan_dissect_t *edt;
@@ -86,6 +87,12 @@ epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd,
g_slist_free( fd->data_src);
fd->data_src = 0;
+ /*
+ * Set the global "proto_tree_is_visible" to control whether
+ * to fill in the text representation field in the protocol
+ * tree fields.
+ */
+ proto_tree_is_visible = proto_tree_visible;
if (create_proto_tree) {
edt->tree = proto_tree_create_root();
}
@@ -95,6 +102,8 @@ epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd,
dissect_packet(edt, pseudo_header, data, fd, cinfo);
+ proto_tree_is_visible = FALSE;
+
return edt;
}
diff --git a/epan/epan.h b/epan/epan.h
index d2e786cd85..f33cb1034e 100644
--- a/epan/epan.h
+++ b/epan/epan.h
@@ -1,6 +1,6 @@
/* epan.h
*
- * $Id: epan.h,v 1.10 2001/12/10 00:26:16 guy Exp $
+ * $Id: epan.h,v 1.11 2001/12/16 22:16:13 guy Exp $
*
* Ethereal Protocol Analyzer Library
*
@@ -56,7 +56,8 @@ typedef struct _epan_dissect_t {
epan_dissect_t*
epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd,
- gboolean create_proto_tree, column_info *cinfo);
+ gboolean create_proto_tree, gboolean proto_tree_visible,
+ column_info *cinfo);
void
epan_dissect_free(epan_dissect_t* edt);
diff --git a/file.c b/file.c
index 99180c8ddc..c74e8454d1 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.253 2001/12/10 03:25:58 guy Exp $
+ * $Id: file.c,v 1.254 2001/12/16 22:16:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -644,7 +644,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
/* Dissect the frame. */
edt = epan_dissect_new(pseudo_header, buf, fdata, create_proto_tree,
- &cf->cinfo);
+ FALSE, &cf->cinfo);
/* If we have a display filter, apply it if we're refiltering, otherwise
leave the "passed_dfilter" flag alone.
@@ -777,7 +777,7 @@ read_packet(capture_file *cf, long offset)
passed = TRUE;
if (cf->rfcode) {
- edt = epan_dissect_new(pseudo_header, buf, fdata, TRUE, NULL);
+ edt = epan_dissect_new(pseudo_header, buf, fdata, TRUE, FALSE, NULL);
passed = dfilter_apply_edt(cf->rfcode, edt);
epan_dissect_free(edt);
}
@@ -1122,10 +1122,6 @@ print_packets(capture_file *cf, print_args_t *print_args)
print_separator = FALSE;
- /* The protocol tree will be "visible", i.e., printed, only if we're
- not printing a summary. */
- proto_tree_is_visible = !print_args->print_summary;
-
/* Update the progress bar when it gets to this value. */
progbar_nextstep = 0;
/* When we reach the value that triggers a progress bar update,
@@ -1170,14 +1166,15 @@ print_packets(capture_file *cf, print_args_t *print_args)
/* Check to see if we are suppressing unmarked packets, if so,
* suppress them and then proceed to check for visibility.
*/
- if (((print_args->suppress_unmarked && fdata->flags.marked ) || !(print_args->suppress_unmarked)) && fdata->flags.passed_dfilter) {
+ if (((print_args->suppress_unmarked && fdata->flags.marked ) ||
+ !(print_args->suppress_unmarked)) && fdata->flags.passed_dfilter) {
wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header,
cf->pd, fdata->cap_len);
if (print_args->print_summary) {
/* Fill in the column information, but don't bother creating
the logical protocol tree. */
edt = epan_dissect_new(&cf->pseudo_header, cf->pd, fdata, FALSE,
- &cf->cinfo);
+ FALSE, &cf->cinfo);
fill_in_columns(&edt->pi);
cp = &line_buf[0];
line_len = 0;
@@ -1212,10 +1209,11 @@ print_packets(capture_file *cf, print_args_t *print_args)
if (print_separator)
print_line(cf->print_fh, print_args->format, "\n");
- /* Create the logical protocol tree; we don't need the columns
- here. */
+ /* Create the logical protocol tree, complete with the display
+ representation of the items; we don't need the columns here,
+ however. */
edt = epan_dissect_new(&cf->pseudo_header, cf->pd, fdata, TRUE,
- NULL);
+ TRUE, NULL);
/* Print the information in that tree. */
proto_tree_print(FALSE, print_args, (GNode *)edt->tree,
@@ -1247,8 +1245,6 @@ print_packets(capture_file *cf, print_args_t *print_args)
cf->print_fh = NULL;
- proto_tree_is_visible = FALSE;
-
return TRUE;
}
@@ -1437,7 +1433,7 @@ find_packet(capture_file *cf, dfilter_t *sfcode)
wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header,
cf->pd, fdata->cap_len);
edt = epan_dissect_new(&cf->pseudo_header, cf->pd, fdata, TRUE,
- NULL);
+ FALSE, NULL);
frame_matched = dfilter_apply_edt(sfcode, edt);
epan_dissect_free(edt);
if (frame_matched) {
@@ -1541,15 +1537,13 @@ select_packet(capture_file *cf, int row)
cf->pd, fdata->cap_len);
/* Create the logical protocol tree. */
- proto_tree_is_visible = TRUE;
if (cf->edt != NULL) {
epan_dissect_free(cf->edt);
cf->edt = NULL;
}
/* We don't need the columns here. */
cf->edt = epan_dissect_new(&cf->pseudo_header, cf->pd, cf->current_frame,
- TRUE, NULL);
- proto_tree_is_visible = FALSE;
+ TRUE, TRUE, NULL);
/* Display the GUI protocol tree and hex dump.
XXX - why does the protocol tree not show up if we call
diff --git a/gtk/packet_win.c b/gtk/packet_win.c
index bbbaf4a6de..e6a8433a33 100644
--- a/gtk/packet_win.c
+++ b/gtk/packet_win.c
@@ -3,7 +3,7 @@
*
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet_win.c,v 1.28 2001/12/10 00:26:17 guy Exp $
+ * $Id: packet_win.c,v 1.29 2001/12/16 22:16:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -166,10 +166,8 @@ create_new_window(char *Title, gint tv_size, gint bv_size)
memcpy(&DataPtr->pseudo_header, &cfile.pseudo_header, sizeof DataPtr->pseudo_header);
DataPtr->pd = g_malloc(DataPtr->frame->cap_len);
memcpy(DataPtr->pd, cfile.pd, DataPtr->frame->cap_len);
- proto_tree_is_visible = TRUE;
DataPtr->edt = epan_dissect_new(&DataPtr->pseudo_header, DataPtr->pd, DataPtr->frame,
- TRUE, &cfile.cinfo);
- proto_tree_is_visible = FALSE;
+ TRUE, TRUE, &cfile.cinfo);
DataPtr->main = main_w;
DataPtr->tv_scrollw = tv_scrollw;
DataPtr->tree_view = tree_view;
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index 3a6057ad7e..f242b5ed52 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -1,7 +1,7 @@
/* proto_hier_stats.c
* Routines for calculating statistics based on protocol.
*
- * $Id: proto_hier_stats.c,v 1.6 2001/12/10 00:25:41 guy Exp $
+ * $Id: proto_hier_stats.c,v 1.7 2001/12/16 22:16:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -129,7 +129,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
pd, frame->cap_len);
/* Dissect the frame */
- edt = epan_dissect_new(&phdr, pd, frame, TRUE, cinfo);
+ edt = epan_dissect_new(&phdr, pd, frame, TRUE, FALSE, cinfo);
/* Get stats from this protocol tree */
process_tree(edt->tree, ps, frame->pkt_len);
diff --git a/tethereal.c b/tethereal.c
index 46203484bc..613f86e47b 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -1,6 +1,6 @@
/* tethereal.c
*
- * $Id: tethereal.c,v 1.105 2001/12/10 02:12:53 guy Exp $
+ * $Id: tethereal.c,v 1.106 2001/12/16 22:16:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1239,7 +1239,7 @@ wtap_dispatch_cb_write(u_char *user, const struct wtap_pkthdr *phdr,
cf->count++;
if (cf->rfcode) {
fill_in_fdata(&fdata, cf, phdr, pseudo_header, offset);
- edt = epan_dissect_new(pseudo_header, buf, &fdata, TRUE, NULL);
+ edt = epan_dissect_new(pseudo_header, buf, &fdata, TRUE, FALSE, NULL);
passed = dfilter_apply_edt(cf->rfcode, edt);
} else {
passed = TRUE;
@@ -1331,10 +1331,6 @@ wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr,
cf->count++;
- /* The protocol tree will be "visible", i.e., printed, only if we're
- not printing a summary. */
- proto_tree_is_visible = verbose;
-
fill_in_fdata(&fdata, cf, phdr, pseudo_header, offset);
passed = TRUE;
@@ -1342,10 +1338,13 @@ wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr,
create_proto_tree = TRUE;
else
create_proto_tree = FALSE;
- /* We only need the columns if we're *not* verbose; in verbose mode,
+ /* The protocol tree will be "visible", i.e., printed, only if we're
+ not printing a summary.
+
+ We only need the columns if we're *not* verbose; in verbose mode,
we print the protocol tree, not the protocol summary. */
edt = epan_dissect_new(pseudo_header, buf, &fdata, create_proto_tree,
- verbose ? NULL : &cf->cinfo);
+ verbose, verbose ? NULL : &cf->cinfo);
if (cf->rfcode)
passed = dfilter_apply_edt(cf->rfcode, edt);
if (passed) {
@@ -1581,8 +1580,6 @@ wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr,
epan_dissect_free(edt);
clear_fdata(&fdata);
-
- proto_tree_is_visible = FALSE;
}
char *