summaryrefslogtreecommitdiffstats
path: root/openbsc/tests/libiudummy
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/tests/libiudummy
parent38fa951e523f3e36233224d84d35cbe151e7fbe1 (diff)
add libiudummy, to avoid linking Iu deps in tests
Diffstat (limited to 'openbsc/tests/libiudummy')
-rw-r--r--openbsc/tests/libiudummy/Makefile.am16
-rw-r--r--openbsc/tests/libiudummy/README2
-rw-r--r--openbsc/tests/libiudummy/iudummy.c35
3 files changed, 53 insertions, 0 deletions
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;
+}