diff options
author | Michael Mann <mmann78@netscape.net> | 2014-12-19 08:08:38 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-01-02 00:00:57 +0000 |
commit | 07c9492b8d40ed766074679f86c49780277af002 (patch) | |
tree | 5a0c6f5d078872b58a7eac1469ce6d2401bf2792 /epan/dissectors | |
parent | f384fa07f945fd73e3f0088c19d640a8c534a791 (diff) |
Remove pkt_comment member from packet_info structure.
Change-Id: Ifd3d201a09944e3fc36188f891ea8a584886101d
Reviewed-on: https://code.wireshark.org/review/5884
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/file-file.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-frame.c | 33 |
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; } |