core: Support transport control commands

This change introduces a control message request handler for MCTP
bindings. If a handler is provided, transport control messages will be
forwarded to the handler, otherwise they will be forwarded to the
default handler.

Change-Id: I62266d6bf2d512ec97759c0b8a3477c5e433d609
Signed-off-by: Wiktor Gołgowski <wiktor.golgowski@linux.intel.com>
[AJ: Split out general control message handler, formatting]
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0cace7..3b0097d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,10 @@
 target_link_libraries (test_serial mctp)
 add_test (NAME serial COMMAND test_serial)
 
+add_executable (test_cmds tests/test_cmds.c tests/test-utils.c)
+target_link_libraries (test_cmds mctp)
+add_test (NAME control_commands COMMAND test_cmds)
+
 install (TARGETS mctp DESTINATION lib)
 install (FILES libmctp.h DESTINATION include)