diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2014-06-22 14:47:02 +0200 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2014-06-22 16:57:35 +0000 |
commit | 0a960872d7b3ed8b3ce69587f3e5694dedcd8ae5 (patch) | |
tree | 6f54f6ac48e6a6478e7b0c497218e701a0777f72 /epan/dissectors/packet-logcat.c | |
parent | 4a3d0b868473260c24aa66f5e3fa737b54a9fd02 (diff) |
Logcat: Set data-text-lines dissectors for log
Some binary logcat packets has more then one line, show them in
a convenient form.
Change-Id: I008aac6fe5589f2b10db51f7221853f9d79bbc7a
Reviewed-on: https://code.wireshark.org/review/2549
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-logcat.c')
-rw-r--r-- | epan/dissectors/packet-logcat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-logcat.c b/epan/dissectors/packet-logcat.c index 7633ba24f3..e72c48862e 100644 --- a/epan/dissectors/packet-logcat.c +++ b/epan/dissectors/packet-logcat.c @@ -48,8 +48,10 @@ static int hf_logcat_log = -1; static gint ett_logcat = -1; static gint ett_logcat_timestamp = -1; +static gint ett_logcat_log = -1; static dissector_handle_t logcat_handle; +static dissector_handle_t data_text_lines_handle; static gint exported_pdu_tap = -1; @@ -101,6 +103,7 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ gint logger_version; guint8 *log; gchar *c; + tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Logcat"); @@ -166,7 +169,11 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ while ((c = g_utf8_strchr(log, string_length, '\r'))) *c = ' '; - proto_tree_add_item(maintree, hf_logcat_log, tvb, offset, string_length, ENC_ASCII | ENC_NA); + subitem = proto_tree_add_item(maintree, hf_logcat_log, tvb, offset, string_length, ENC_ASCII | ENC_NA); + subtree = proto_item_add_subtree(subitem, ett_logcat_log); + + next_tvb = tvb_new_subset_length(tvb, offset, string_length - 1); + call_dissector(data_text_lines_handle, next_tvb, pinfo, subtree); col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO, log); @@ -263,7 +270,8 @@ proto_register_logcat(void) static gint *ett[] = { &ett_logcat, - &ett_logcat_timestamp + &ett_logcat_timestamp, + &ett_logcat_log }; static ei_register_info ei[] = { @@ -285,6 +293,8 @@ proto_register_logcat(void) void proto_reg_handoff_logcat(void) { + data_text_lines_handle = find_dissector("data-text-lines"); + dissector_add_uint("wtap_encap", WTAP_ENCAP_LOGCAT, logcat_handle); dissector_add_for_decode_as("tcp.port", logcat_handle); |