aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address_types.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2021-10-28 09:01:06 +0800
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-11-15 09:05:05 +0000
commite1cbe02ccea7322fb4020aaa193ac2d2a7282911 (patch)
tree4cf5279c4883b1f624031b8ad8a479684631fb5f /epan/address_types.c
parentb704562c0c78ab4ccef9b89e03a3c5c18e4c14b9 (diff)
Add Management Component Transport Protocol (MCTP) dissector
This change adds a protocol dissector for the Management Component Transport Protocol (MCTP). This is a failry simple datagram-based protocol for messaging between components within a single platform, typically over I2C, serial or PCIe. This dissector just implements the header fields, and sequence-number based message reassembly. Inner protocols will be added as follow-up changes. Linux has support for AF_MCTP data, so decode from the MCTP SLL ltype. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Diffstat (limited to 'epan/address_types.c')
-rw-r--r--epan/address_types.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/epan/address_types.c b/epan/address_types.c
index fd9439425c..2f4a6c1116 100644
--- a/epan/address_types.c
+++ b/epan/address_types.c
@@ -584,6 +584,28 @@ static int numeric_addr_to_str(const address* addr, gchar *buf, int buf_len)
}
/******************************************************************************
+ * AT_MCTP
+ ******************************************************************************/
+
+static int mctp_addr_to_str(const address* addr, gchar *buf, int buf_len _U_)
+{
+ const guint8 *addr_data = (const guint8 *)addr->data;
+ gchar *bufp = buf;
+
+ return g_snprintf(bufp, 3, "%d", addr_data[0]);
+}
+
+static int mctp_addr_str_len(const address* addr _U_)
+{
+ return 3;
+}
+
+static int mctp_len(void)
+{
+ return 1;
+}
+
+/******************************************************************************
* END OF PROVIDED ADDRESS TYPES
******************************************************************************/
@@ -759,6 +781,18 @@ void address_types_initialize(void)
NULL, /* addr_name_res_str */
NULL, /* addr_name_res_len */
};
+ static address_type_t mctp_address = {
+ AT_MCTP, /* addr_type */
+ "AT_MCTP" , /* name */
+ "MCTP Address", /* pretty_name */
+ mctp_addr_to_str, /* addr_to_str */
+ mctp_addr_str_len, /* addr_str_len */
+ NULL, /* addr_to_byte */
+ NULL, /* addr_col_filter */
+ mctp_len, /* addr_fixed_len */
+ NULL, /* addr_name_res_str */
+ NULL, /* addr_name_res_len */
+ };
num_dissector_addr_type = 0;
@@ -779,6 +813,7 @@ void address_types_initialize(void)
address_type_register(AT_AX25, &ax25_address );
address_type_register(AT_VINES, &vines_address );
address_type_register(AT_NUMERIC, &numeric_address );
+ address_type_register(AT_MCTP, &mctp_address );
}
/* Given an address type id, return an address_type_t* */