aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2001-12-06 04:25:09 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2001-12-06 04:25:09 +0000
commit8589e0e945100838da543a343cc6cfa4718dcd85 (patch)
tree184b82bfdeff9456df17b77f7ecf14b7c3aeec2e /epan/epan.c
parent485e716ecf5d0f3faed93e3d4526e3409632ae34 (diff)
Remove proto_tree from capture_file and PacketWinData, since they
already contain a pointer to an epan_dissect_t, which contains the proto_tree. Routines calling epan_dissect_new() do not create their own proto_tree via proto_tree_create_root(); instead, they pass a boolean to epan_dissect_new() telling it whether it should create the root proto_tree. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4343 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/epan.c b/epan/epan.c
index a60c67e92c..f9c7099066 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -1,6 +1,6 @@
/* epan.h
*
- * $Id: epan.c,v 1.11 2001/11/21 23:16:23 gram Exp $
+ * $Id: epan.c,v 1.12 2001/12/06 04:25:08 gram Exp $
*
* Ethereal Protocol Analyzer Library
*
@@ -74,7 +74,8 @@ epan_conversation_init(void)
epan_dissect_t*
-epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd, proto_tree *tree)
+epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd,
+ gboolean create_proto_tree)
{
epan_dissect_t *edt;
@@ -85,8 +86,12 @@ epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd, proto_
g_slist_free( fd->data_src);
fd->data_src = 0;
- /* XXX - init tree */
- edt->tree = tree;
+ if (create_proto_tree) {
+ edt->tree = proto_tree_create_root();
+ }
+ else {
+ edt->tree = NULL;
+ }
dissect_packet(edt, pseudo_header, data, fd);
@@ -102,5 +107,9 @@ epan_dissect_free(epan_dissect_t* edt)
* would have incremented the usage count on that tvbuff_t*) */
tvb_free_chain(edt->tvb);
+ if (edt->tree) {
+ proto_tree_free(edt->tree);
+ }
+
g_free(edt);
}