aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/file-file.c11
-rw-r--r--epan/dissectors/packet-frame.c33
2 files changed, 26 insertions, 18 deletions
diff --git a/epan/dissectors/file-file.c b/epan/dissectors/file-file.c
index 16e234654d..3956bc4131 100644
--- a/epan/dissectors/file-file.c
+++ b/epan/dissectors/file-file.c
@@ -85,8 +85,9 @@ call_file_record_end_routine(gpointer routine, gpointer dummy _U_)
(*func)();
}
-static void
-dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+/* XXX - "packet comment" is passed into dissector as data, but currently doesn't have a use */
+static int
+dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
proto_item *volatile ti = NULL;
guint cap_len = 0, frame_len = 0;
@@ -184,7 +185,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* Ignored package, stop handling here */
col_set_str(pinfo->cinfo, COL_INFO, "<Ignored>");
proto_tree_add_text (tree, tvb, 0, -1, "This record is marked as ignored");
- return;
+ return tvb_captured_length(tvb);
}
/* Portable Exception Handling to trap Wireshark specific exceptions like BoundsError exceptions */
@@ -311,6 +312,8 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
g_slist_free(pinfo->frame_end_routines);
pinfo->frame_end_routines = NULL;
}
+
+ return tvb_captured_length(tvb);
}
void
@@ -382,7 +385,7 @@ proto_register_file(void)
proto_file = proto_register_protocol("File", "File", "file");
proto_register_field_array(proto_file, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("file",dissect_file_record,proto_file);
+ new_register_dissector("file",dissect_file_record,proto_file);
/* You can't disable dissection of "Frame", as that would be
tantamount to not doing any dissection whatsoever. */
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index b8767108e1..0ac617a089 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -176,12 +176,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
proto_tree *comments_tree;
proto_item *item;
const gchar *cap_plurality, *frame_plurality;
- int file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_UNKNOWN;
+ frame_data_t *fr_data = (frame_data_t*)data;
tree=parent_tree;
- if (data != NULL) {
- file_type_subtype = GPOINTER_TO_INT(data);
- }
switch (pinfo->phdr->rec_type) {
@@ -251,14 +248,14 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
break;
}
- if (pinfo->pkt_comment) {
+ if (fr_data && fr_data->pkt_comment) {
item = proto_tree_add_item(tree, proto_pkt_comment, tvb, 0, 0, ENC_NA);
comments_tree = proto_item_add_subtree(item, ett_comments);
comment_item = proto_tree_add_string_format(comments_tree, hf_comments_text, tvb, 0, 0,
- pinfo->pkt_comment, "%s",
- pinfo->pkt_comment);
+ fr_data->pkt_comment, "%s",
+ fr_data->pkt_comment);
expert_add_info_format(pinfo, comment_item, &ei_comments_text,
- "%s", pinfo->pkt_comment);
+ "%s", fr_data->pkt_comment);
}
@@ -507,13 +504,21 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
case REC_TYPE_FT_SPECIFIC_EVENT:
case REC_TYPE_FT_SPECIFIC_REPORT:
- if (!dissector_try_uint(wtap_fts_rec_dissector_table, file_type_subtype,
- tvb, pinfo, parent_tree)) {
+ {
+ int file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_UNKNOWN;
+
+ if (fr_data) {
+ file_type_subtype = fr_data->file_type_subtype;
+ }
+
+ if (!dissector_try_uint(wtap_fts_rec_dissector_table, file_type_subtype,
+ tvb, pinfo, parent_tree)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
- col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
- file_type_subtype);
- call_dissector(data_handle,tvb, pinfo, parent_tree);
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
+ col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
+ file_type_subtype);
+ call_dissector(data_handle,tvb, pinfo, parent_tree);
+ }
}
break;
}