From 034ac6dad927b14b779e9709e880ac0569b53860 Mon Sep 17 00:00:00 2001 From: Simon Holesch Date: Fri, 10 Dec 2021 22:50:58 +0100 Subject: D-Bus: Add member to response frame in info column Add the method name to response frames, like Method Return and Error. The name is not included in the frame itself, but can be inferred with conversation tracking. --- epan/dissectors/packet-dbus.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-dbus.c b/epan/dissectors/packet-dbus.c index 1749ba44c1..da8d4ef6ad 100644 --- a/epan/dissectors/packet-dbus.c +++ b/epan/dissectors/packet-dbus.c @@ -1236,26 +1236,39 @@ dissect_dbus_header_fields(dbus_packet_t *packet) { return 1; } + add_conversation(packet, proto_item_get_subtree(header_field_array_pi)); + switch(packet->message_type) { case DBUS_MESSAGE_TYPE_METHOD_CALL: - col_add_fstr(packet->pinfo->cinfo, COL_INFO, "%s() @ %s", packet->member, packet->path); + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "%s(%s) @ %s", packet->member, packet->signature, packet->path); break; case DBUS_MESSAGE_TYPE_SIGNAL: - col_add_fstr(packet->pinfo->cinfo, COL_INFO, "* %s() @ %s", packet->member, packet->path); + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "* %s(%s) @ %s", packet->member, packet->signature, packet->path); break; case DBUS_MESSAGE_TYPE_ERROR: - col_add_fstr(packet->pinfo->cinfo, COL_INFO, "-> %s", packet->error_name); + if (packet->member) { + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "! %s: %s", packet->member, packet->error_name); + } else { + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "! %s", packet->error_name); + } break; case DBUS_MESSAGE_TYPE_METHOD_RETURN: - col_add_fstr(packet->pinfo->cinfo, COL_INFO, "-> '%s'", packet->signature); + if (packet->member) { + if (*packet->signature != '\0') { + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "-> %s: '%s'", packet->member, packet->signature); + } else { + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "-> %s: OK", packet->member); + + } + } else { + col_add_fstr(packet->pinfo->cinfo, COL_INFO, "-> '%s'", packet->signature); + } break; default: DISSECTOR_ASSERT_NOT_REACHED(); break; } - add_conversation(packet, proto_item_get_subtree(header_field_array_pi)); - // Header length must be a multiple of 8 bytes return add_padding(packet, SIG_CODE_STRUCT_OPEN); } -- cgit v1.2.3