aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipmi.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-04-02 20:16:54 -0400
committerMartin Kaiser <wireshark@kaiser.cx>2015-04-04 09:07:51 +0000
commit37c41d7927d253882fdb97df4692d75306c70c2b (patch)
tree3b2232a3b1327b3df87bc54db366e31949f0da82 /epan/dissectors/packet-ipmi.c
parent7253ee7611fb2e62f2a9326689e48f8d2177aed9 (diff)
Add proper "Decode As" mechanism for I2C messages instead of preference.
Change-Id: Ifcf1193f97df6911ca9a0cf5613c9450b8fce1e4 Reviewed-on: https://code.wireshark.org/review/7897 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-ipmi.c')
-rw-r--r--epan/dissectors/packet-ipmi.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c
index 7587eb4d2b..256e6f6279 100644
--- a/epan/dissectors/packet-ipmi.c
+++ b/epan/dissectors/packet-ipmi.c
@@ -33,6 +33,7 @@
#include "packet-ipmi.h"
void proto_register_ipmi(void);
+void proto_reg_handoff_ipmi(void);
/*
* See the IPMI specifications at
@@ -1704,6 +1705,19 @@ dissect_ipmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
(ipmi_dissect_arg_t *) data);
}
+static int
+dissect_i2c_ipmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
+{
+ if (pinfo->pseudo_header->i2c.flags & 0x00000001) {
+ /* Master-receive transactions are not possible on IPMB */
+ return 0;
+ }
+
+ return do_dissect_ipmb(tvb, pinfo, tree, proto_ipmb, ett_ipmi,
+ (ipmi_dissect_arg_t *) data);
+}
+
+
/* Register IPMB protocol.
*/
void
@@ -1814,6 +1828,14 @@ proto_register_ipmi(void)
&selected_oem, oemsel_vals, FALSE);
}
+void proto_reg_handoff_ipmi(void)
+{
+ dissector_handle_t ipmi_handle;
+
+ ipmi_handle = new_create_dissector_handle( dissect_i2c_ipmi, proto_ipmi );
+ dissector_add_for_decode_as("i2c.message", ipmi_handle );
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*