Diff between 07b028e5f210a857e43e7025bd60b79b1052d1ff and 31f06402630437312679131de83b219511d8469d

Changed Files

File Additions Deletions Status
monitor/control.c +40 -0 modified

Full Patch

diff --git a/monitor/control.c b/monitor/control.c
index 44cc1da..f2698fb 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -97,6 +97,40 @@ static void mgmt_unconf_index_removed(uint16_t len, const void *buf)
 	packet_hexdump(buf, len);
 }
 
+static void mgmt_ext_index_added(uint16_t len, const void *buf)
+{
+	const struct mgmt_ev_ext_index_added *ev = buf;
+
+	if (len < sizeof(*ev)) {
+		printf("* Malformed Extended Index Added control\n");
+		return;
+	}
+
+	printf("@ Extended Index Added: %u (%u)\n", ev->type, ev->bus);
+
+	buf += sizeof(*ev);
+	len -= sizeof(*ev);
+
+	packet_hexdump(buf, len);
+}
+
+static void mgmt_ext_index_removed(uint16_t len, const void *buf)
+{
+	const struct mgmt_ev_ext_index_removed *ev = buf;
+
+	if (len < sizeof(*ev)) {
+		printf("* Malformed Extended Index Removed control\n");
+		return;
+	}
+
+	printf("@ Extended Index Removed: %u (%u)\n", ev->type, ev->bus);
+
+	buf += sizeof(*ev);
+	len -= sizeof(*ev);
+
+	packet_hexdump(buf, len);
+}
+
 static void mgmt_controller_error(uint16_t len, const void *buf)
 {
 	const struct mgmt_ev_controller_error *ev = buf;
@@ -794,6 +828,12 @@ void control_message(uint16_t opcode, const void *data, uint16_t size)
 	case MGMT_EV_NEW_CONFIG_OPTIONS:
 		mgmt_new_config_options(size, data);
 		break;
+	case MGMT_EV_EXT_INDEX_ADDED:
+		mgmt_ext_index_added(size, data);
+		break;
+	case MGMT_EV_EXT_INDEX_REMOVED:
+		mgmt_ext_index_removed(size, data);
+		break;
 	default:
 		printf("* Unknown control (code %d len %d)\n", opcode, size);
 		packet_hexdump(data, size);