From a7a3947b9bd82e30124baab5c71925f20228ad9a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 5 Jul 2017 15:19:52 +0200 Subject: move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- tests/msc_vlr/Makefile.am | 15 ++++----------- tests/msc_vlr/msc_vlr_tests.c | 33 +++++++++++++++++++-------------- tests/sgsn/Makefile.am | 1 - tests/sms_queue/Makefile.am | 7 ------- 4 files changed, 23 insertions(+), 33 deletions(-) (limited to 'tests') diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6eba..3ae0c84fc 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ COMMON_LDADD = \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ COMMON_LDFLAGS = \ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10fbb..3966aacd4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -34,8 +34,13 @@ #include #include #include -#include + +#if BUILD_IU #include +#include +#else +#include +#endif #include "msc_vlr_tests.h" @@ -152,8 +157,8 @@ struct gsm_subscriber_connection *conn_new(void) conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +300,9 @@ int _paging_sent(enum ran_type via_ran, const char *imsi, uint32_t tmsi, uint32_ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +477,16 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +496,8 @@ int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *caus } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb96..ccb8f44f4 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ sgsn_test_LDADD = \ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996ef..62c479bab 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ sms_queue_test_LDADD = \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- cgit v1.2.3