aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-21 18:38:03 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-21 18:38:03 +0000
commit28e9dcc4a9261a61b16dfd9a2051205289beb926 (patch)
tree69465d340a5472a87467c43de32fd9f6a3035b1a /epan/epan.c
parent9e7b6f1a69c516579ffd4618f89e20559d738666 (diff)
Some work on multi file dissection
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/epan/epan.c b/epan/epan.c
index 023d580436..6382f79703 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -40,6 +40,7 @@
#include "epan_dissect.h"
#include "wsutil/report_err.h"
+#include "epan-int.h"
#include "conversation.h"
#include "circuit.h"
#include "except.h"
@@ -134,6 +135,26 @@ epan_cleanup(void)
wmem_cleanup();
}
+epan_t *
+epan_new(void)
+{
+ epan_t *session = g_slice_new(epan_t);
+
+ /* XXX, it should take session as param */
+ init_dissection();
+
+ return session;
+}
+
+void
+epan_free(epan_t *session)
+{
+ /* XXX, it should take session as param */
+ cleanup_dissection();
+
+ g_slice_free(epan_t, session);
+}
+
void
epan_conversation_init(void)
{
@@ -159,10 +180,11 @@ epan_circuit_cleanup(void)
}
epan_dissect_t*
-epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const gboolean proto_tree_visible)
+epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
{
g_assert(edt);
+ edt->session = session;
edt->pi.pool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
if (create_proto_tree) {
@@ -179,13 +201,13 @@ epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const g
}
epan_dissect_t*
-epan_dissect_new(const gboolean create_proto_tree, const gboolean proto_tree_visible)
+epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
{
epan_dissect_t *edt;
edt = g_new0(epan_dissect_t, 1);
- return epan_dissect_init(edt, create_proto_tree, proto_tree_visible);
+ return epan_dissect_init(edt, session, create_proto_tree, proto_tree_visible);
}
void