Introduce CRC and FSM for IuUP (user plane) as used in 3G RTP data

Only support for SMpSDU mode is introduced in this commit.

Not supported explicit list:
- Transparent mode
- ATM/AAL2 based Transport layer
- GTP-U based Transport Layer
- Iu Rate Control procedure
- Time Alignment procedure

APIs are provided to allocate the primitives properly inside the related
msgb. This way primitives can be placed in the headroom, leaving the
data part of the msgb for the IuUP payload, hence allowing re-use of the
msgb and 0 copy of IuUP payload when forwarding data over RNL<->TNL.
Since RNL and TNL primitives relu struct osmo_prim_header, which is not
packed, they cannot be set to packed, and hence proper memory alignment
in the msgb must be done to avoid misaligned accesses (Asan errors about
it otherwise).

Related: SYS#5516
Change-Id: Ibe356fa7b1abaca0091e368db8478e79c09c6cb0
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a6f6017..f54ce18 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,6 +45,7 @@
 		 time_cc/time_cc_test					\
 		 gsm48/rest_octets_test					\
 		 base64/base64_test					\
+		 iuup/iuup_test						\
 		 $(NULL)
 
 if ENABLE_MSGFILE
@@ -328,6 +329,9 @@
 time_cc_time_cc_test_SOURCES = time_cc/time_cc_test.c
 time_cc_time_cc_test_LDADD = $(LDADD)
 
+iuup_iuup_test_SOURCES = iuup/iuup_test.c
+iuup_iuup_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
+
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 	:;{ \
@@ -420,6 +424,7 @@
 	     time_cc/time_cc_test.ok \
 	     gsm48/rest_octets_test.ok \
 	     base64/base64_test.ok \
+	     iuup/iuup_test.ok \
 	     $(NULL)
 
 if ENABLE_LIBSCTP
@@ -616,6 +621,8 @@
 		>$(srcdir)/it_q/it_q_test.ok
 	time_cc/time_cc_test \
 		>$(srcdir)/time_cc/time_cc_test.ok
+	iuup/iuup_test \
+		>$(srcdir)/iuup/iuup_test.ok
 
 check-local: atconfig $(TESTSUITE)
 	[ -e /proc/cpuinfo ] && cat /proc/cpuinfo