aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-15 06:38:10 +0000
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-15 06:38:10 +0000
commita268b29164b24eaff97efc8fc57a8e7e71c1ce54 (patch)
treea46ff02b744f06032eaef2a29c3777ff4d894226 /print.c
parent1a3d31f474abacfda8358735a3e78bc516c9cdec (diff)
This patch introduces packet_add_new_data_source() which effectively deprecates add_new_data_source(). This is based on the following observation:
1) The tvb + name (aka. data_source) is only used when the protocol tree is visible The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify. A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29427 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'print.c')
-rw-r--r--print.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/print.c b/print.c
index f0e4564e44..921f41b10e 100644
--- a/print.c
+++ b/print.c
@@ -240,6 +240,10 @@ proto_tree_write_pdml(epan_dissect_t *edt, FILE *fh)
data.src_list = edt->pi.data_src;
data.edt = edt;
+ /* We shouldn't be called with a NULL pointer here because we've
+ * created a visible protocol tree */
+ g_assert(data.src_list);
+
fprintf(fh, "<packet>\n");
/* Print a "geninfo" protocol as required by PDML */
@@ -776,6 +780,10 @@ print_hex_data(print_stream_t *stream, epan_dissect_t *edt)
const guchar *cp;
guint length;
+ /* We shouldn't be called with a NULL pointer here because we've
+ * created a visible protocol tree */
+ g_assert(edt->pi.data_src);
+
/*
* Set "multiple_sources" iff this frame has more than one
* data source; if it does, we need to print the name of