aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-20 21:41:08 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 15:32:30 +0100
commit6ebcbb3d5c3596dd519a28b54ee459162c8b7f04 (patch)
tree4ec1f3fd2998df5436ad718e366665975bcc15fc /openbsc
parent38fa951e523f3e36233224d84d35cbe151e7fbe1 (diff)
add libiudummy, to avoid linking Iu deps in tests
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/configure.ac1
-rw-r--r--openbsc/tests/Makefile.am1
-rw-r--r--openbsc/tests/db/Makefile.am1
-rw-r--r--openbsc/tests/libiudummy/Makefile.am16
-rw-r--r--openbsc/tests/libiudummy/README2
-rw-r--r--openbsc/tests/libiudummy/iudummy.c35
6 files changed, 56 insertions, 0 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 0ba73b911..190c04bd1 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -237,6 +237,7 @@ AC_OUTPUT(
src/gprs/Makefile
tests/Makefile
tests/atlocal
+ tests/libiudummy/Makefile
tests/gsm0408/Makefile
tests/channel/Makefile
tests/bsc/Makefile
diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am
index cde76d36f..7d43a7760 100644
--- a/openbsc/tests/Makefile.am
+++ b/openbsc/tests/Makefile.am
@@ -1,4 +1,5 @@
SUBDIRS = \
+ libiudummy \
gsm0408 \
channel \
mgcp \
diff --git a/openbsc/tests/db/Makefile.am b/openbsc/tests/db/Makefile.am
index 0eed5cd55..74a0aa00c 100644
--- a/openbsc/tests/db/Makefile.am
+++ b/openbsc/tests/db/Makefile.am
@@ -38,6 +38,7 @@ db_test_LDADD = \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a \
+ $(top_builddir)/tests/libiudummy/libiudummy.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOGSM_LIBS) \
diff --git a/openbsc/tests/libiudummy/Makefile.am b/openbsc/tests/libiudummy/Makefile.am
new file mode 100644
index 000000000..38664a2b6
--- /dev/null
+++ b/openbsc/tests/libiudummy/Makefile.am
@@ -0,0 +1,16 @@
+AM_CPPFLAGS = \
+ $(all_includes) \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir) \
+ $(NULL)
+
+AM_CFLAGS = \
+ -Wall \
+ $(LIBOSMOCORE_CFLAGS) \
+ $(NULL)
+
+noinst_LIBRARIES = libiudummy.a
+
+libiudummy_a_SOURCES = \
+ iudummy.c \
+ $(NULL)
diff --git a/openbsc/tests/libiudummy/README b/openbsc/tests/libiudummy/README
new file mode 100644
index 000000000..b90bf8c8b
--- /dev/null
+++ b/openbsc/tests/libiudummy/README
@@ -0,0 +1,2 @@
+libiudummy, for convenience, implements iu_tx() as a mere dummy data logger,
+for linking scopes that want to avoid linking against libasn1c, osmo-iuh etc.
diff --git a/openbsc/tests/libiudummy/iudummy.c b/openbsc/tests/libiudummy/iudummy.c
new file mode 100644
index 000000000..7052de82c
--- /dev/null
+++ b/openbsc/tests/libiudummy/iudummy.c
@@ -0,0 +1,35 @@
+#include <stdint.h>
+
+#include <osmocom/core/logging.h>
+#include <osmocom/vty/logging.h>
+#include <osmocom/core/msgb.h>
+
+struct msgb;
+struct ue_conn_ctx;
+struct gsm_auth_tuple;
+
+int iu_tx(struct msgb *msg, uint8_t sapi)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n",
+ msg->len, osmo_hexdump(msg->data, msg->len));
+ return 0;
+}
+
+int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp,
+ int send_ck)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n");
+ return 0;
+}
+
+int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n");
+ return 0;
+}
+
+int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n");
+ return 0;
+}