aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-logcat.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-02-09 18:35:08 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-02-18 11:14:01 +0000
commitff0468f6d3209b0a1bc271c99298b4a7d7d6e0cb (patch)
tree4268c7992c346c6b4b7b074e228197f5427eb910 /epan/dissectors/packet-logcat.c
parent4624d6d457b94ad7472df989fc172f7f4e3a360a (diff)
Add Logcat to Exported PDU
Logcat can be exported from ADB over USB or ADB over TCP where can occur multiple Logcat PDUs in one frame. Change-Id: I290fa131e5600c62357e5be4e76096ea5c35364b Reviewed-on: https://code.wireshark.org/review/234 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-logcat.c')
-rw-r--r--epan/dissectors/packet-logcat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/epan/dissectors/packet-logcat.c b/epan/dissectors/packet-logcat.c
index b7e79cd6fd..9e7660d778 100644
--- a/epan/dissectors/packet-logcat.c
+++ b/epan/dissectors/packet-logcat.c
@@ -26,6 +26,8 @@
#include <epan/packet.h>
#include <epan/expert.h>
+#include <epan/exported_pdu.h>
+#include <epan/tap.h>
static int proto_logcat = -1;
@@ -48,6 +50,8 @@ static gint ett_logcat_timestamp = -1;
static dissector_handle_t logcat_handle;
+static gint exported_pdu_tap = -1;
+
static expert_field ei_invalid_payload_length = EI_INIT;
static const value_string priority_vals[] = {
@@ -171,6 +175,15 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (length != check_length)
proto_tree_add_expert(maintree, pinfo, &ei_invalid_payload_length, tvb, offset, tvb_length_remaining(tvb, offset));
+ if (have_tap_listener(exported_pdu_tap)) {
+ exp_pdu_data_t *exp_pdu_data;
+
+ exp_pdu_data = load_export_pdu_tags(pinfo, "logcat", -1, EXP_PDU_TAG_END_OF_OPT);
+ exp_pdu_data->tvb_length = tvb_length(tvb);
+ exp_pdu_data->pdu_tvb = tvb;
+ tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data);
+ }
+
return offset;
}
@@ -269,6 +282,8 @@ void
proto_reg_handoff_logcat(void)
{
dissector_add_handle("tcp.port", logcat_handle);
+
+ exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LOGCAT);
}
/*