From e72c658091fd1a3431834e9529dc9ec7d128067e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 20 May 2016 21:41:08 +0200 Subject: add libiudummy, to avoid linking Iu deps in tests Change-Id: I4a66c4122011dbc87c6fcb336ab0461b86522c98 --- openbsc/configure.ac | 1 + openbsc/tests/Makefile.am | 1 + openbsc/tests/db/Makefile.am | 1 + openbsc/tests/libiudummy/Makefile.am | 16 ++++++++++++++++ openbsc/tests/libiudummy/README | 2 ++ openbsc/tests/libiudummy/iudummy.c | 35 +++++++++++++++++++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 openbsc/tests/libiudummy/Makefile.am create mode 100644 openbsc/tests/libiudummy/README create mode 100644 openbsc/tests/libiudummy/iudummy.c 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 + +#include +#include +#include + +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; +} -- cgit v1.2.3