tcti: Use separate structures for the device and mssim TCTI contexts.

Using the same structure for both the device and mssim TCTI was lazy. We
were also using the same magic number for both modules which had the
potential to cause confusion if one library was passed a TCTI
initialized by the other. This patch resolves both of these issues by
breaking the old TSS2_TCTI_CONTEXT_INTEL structure up into the
TSS2_TCTI_COMMON_CONTEXT and a structure specific to the device and
mssim TCTIs.

To accomplish this we rename the old 'tcti' module to 'tcti-common'.
This module defines a context structure containing all of the data
common to both the device and mssim TCTIs. This includes the v2
structure as well as a header structure, the enumeration to track the
state machine as well as the locality. We also create new header files
for the device and mssim TCTI. In these headers we define structures
specific to each module that hold the file descriptor for the device
TCTI and the socket file descriptors for the mssim TCTI.

Another significant change in this commit is the way we're now casting
the TCTI context structures passed into the functions for each TCTI
module. Functions in the device and mssim modules that are passed the
opaque TSS2_TCTI_CONTEXT structure start by first checking the magic
number in the context to be sure it's the right one for the module.
If this succeeds they then "down-cast" the structure to the
TSS2_TCTI_COMMON_CONTEXT and then use this structure to perform all of
the state checks. This reduces the number of unsafe cast operations that
we have to perform.

Finally there are a number of changes in this commit that qualify as
cleanup. This includes some name changes for variable and macro names to
align with the name changes.

Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
diff --git a/Makefile-test.am b/Makefile-test.am
index 2bfca9e..18bb43d 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -159,13 +159,15 @@
 test_unit_tcti_device_LDADD   = $(CMOCKA_LIBS) $(libtss2_mu) $(libutil)
 test_unit_tcti_device_LDFLAGS = -Wl,--wrap=read -Wl,-wrap=write
 test_unit_tcti_device_SOURCES = test/unit/tcti-device.c \
-    src/tss2-tcti/tcti-device.c src/tss2-tcti/tcti.c src/tss2-tcti/tcti.h
+    src/tss2-tcti/tcti-common.c src/tss2-tcti/tcti-common.h \
+    src/tss2-tcti/tcti-device.c src/tss2-tcti/tcti-device.h
 
 test_unit_tcti_mssim_CFLAGS  = $(CMOCKA_CFLAGS) $(TESTS_CFLAGS) $(URIPARSER_CFLAGS)
 test_unit_tcti_mssim_LDADD   = $(CMOCKA_LIBS) $(libtss2_mu) $(URIPARSER_LIBS) $(libutil)
 test_unit_tcti_mssim_LDFLAGS = -Wl,--wrap=connect,--wrap=read,--wrap=select,--wrap=write
-test_unit_tcti_mssim_SOURCES = src/tss2-tcti/tcti-mssim.c \
-    test/unit/tcti-mssim.c src/tss2-tcti/tcti.c src/tss2-tcti/tcti.h
+test_unit_tcti_mssim_SOURCES = test/unit/tcti-mssim.c \
+    src/tss2-tcti/tcti-common.c src/tss2-tcti/tcti-common.h \
+    src/tss2-tcti/tcti-mssim.c src/tss2-tcti/tcti-mssim.h
 
 test_unit_io_CFLAGS  = $(CMOCKA_CFLAGS) $(TESTS_CFLAGS)
 test_unit_io_LDADD   = $(CMOCKA_LIBS) $(libutil) $(libtss2_mu)