tlv: Import osmo_shift_* and osmo_match_shift_* from openbsc

These routines have nothing to do with specifically the BSC, so import
them to the TLV parser we keep in libosmogsm.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3aaa99b..fa814c7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,7 +13,7 @@
 		 vty/vty_test comp128/comp128_test utils/utils_test	\
 		 smscb/gsm0341_test stats/stats_test			\
 		 bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test	\
-		 sim/sim_test
+		 sim/sim_test tlv/tlv_test
 
 if ENABLE_MSGFILE
 check_PROGRAMS += msgfile/msgfile_test
@@ -109,6 +109,9 @@
 sim_sim_test_SOURCES = sim/sim_test.c
 sim_sim_test_LDADD = $(top_builddir)/src/sim/libosmosim.la $(top_builddir)/src/libosmocore.la
 
+tlv_tlv_test_SOURCES = tlv/tlv_test.c
+tlv_tlv_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la
+
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 	:;{ \
@@ -143,7 +146,7 @@
 	     vty/vty_test.ok comp128/comp128_test.ok			\
 	     utils/utils_test.ok stats/stats_test.ok			\
 	     bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \
-	     sim/sim_test.ok
+	     sim/sim_test.ok tlv/tlv_test.ok
 
 DISTCLEANFILES = atconfig