diff options
author | Michael Mann <mmann78@netscape.net> | 2015-05-24 20:46:49 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-05-25 03:16:35 +0000 |
commit | 9d67d9fb9381f3b99a46a806247e3c251b287682 (patch) | |
tree | a728696c7df5c2703fd1c2f675959865e565fccf /epan/dissectors/file-file.c | |
parent | 0c8390b8e14af6658df13d974d1335903bfe6ac4 (diff) |
Make protocol name/key combo string filterable.
Change-Id: I1ff863d0a4e114223b8fe283b1dc894e39fcefd7
Reviewed-on: https://code.wireshark.org/review/8618
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/file-file.c')
-rw-r--r-- | epan/dissectors/file-file.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/file-file.c b/epan/dissectors/file-file.c index 3956bc4131..b1e1ff08d1 100644 --- a/epan/dissectors/file-file.c +++ b/epan/dissectors/file-file.c @@ -54,6 +54,7 @@ static int hf_file_marked = -1; static int hf_file_ignored = -1; static int hf_file_protocols = -1; static int hf_file_num_p_prot_data = -1; +static int hf_file_proto_name_and_key = -1; static int hf_file_color_filter_name = -1; static int hf_file_color_filter_text = -1; @@ -108,7 +109,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolean old_visible; /* Put in frame header information. */ - cap_len = tvb_length(tvb); + cap_len = tvb_captured_length(tvb); frame_len = tvb_reported_length(tvb); cap_plurality = plurality(cap_len, "", "s"); @@ -157,7 +158,8 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, ppd_item = proto_tree_add_uint(fh_tree, hf_file_num_p_prot_data, tvb, 0, 0, num_entries); PROTO_ITEM_SET_GENERATED(ppd_item); for(i=0; i<num_entries; i++){ - proto_tree_add_text (fh_tree, tvb, 0, 0, "%s",p_get_proto_name_and_key(wmem_file_scope(), pinfo, i)); + gchar* str = p_get_proto_name_and_key(wmem_file_scope(), pinfo, i); + proto_tree_add_string_format(fh_tree, hf_file_proto_name_and_key, tvb, 0, 0, str, "%s", str); } } @@ -365,6 +367,11 @@ proto_register_file(void) FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_file_proto_name_and_key, + { "Protocol Name and Key", "file.proto_name_and_key", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_file_ftap_encap, { "Encapsulation type", "file.encap_type", FT_INT16, BASE_DEC, NULL, 0x0, |