From f4b2c4ca42cc530c38c9ac6f275e4d7da9315fa2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 16 Sep 2018 07:53:41 +0200 Subject: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-sgsn and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 --- tests/sgsn/Makefile.am | 5 +++-- tests/sgsn/sgsn_test.c | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'tests/sgsn') diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 0eb210095..956ef8d8f 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -9,6 +9,7 @@ AM_CFLAGS = \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(LIBCARES_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,7 +38,7 @@ sgsn_test_LDFLAGS = \ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ - -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=osmo_gsup_client_send \ $(NULL) sgsn_test_LDADD = \ @@ -62,11 +63,11 @@ sgsn_test_LDADD = \ $(top_builddir)/src/gprs/gprs_sndcp_pcomp.o \ $(top_builddir)/src/gprs/v42bis.o \ $(top_builddir)/src/gprs/gprs_sndcp_dcomp.o \ - $(top_builddir)/src/gprs/gsup_client.o \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ $(LIBCARES_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 214d07b97..111515e03 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -148,13 +148,13 @@ int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_ }; /* override, requires '-Wl,--wrap=gsup_client_send' */ -int __real_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -int (*gsup_client_send_cb)(struct gsup_client *gsupc, struct msgb *msg) = - &__real_gsup_client_send; +int __real_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +int (*osmo_gsup_client_send_cb)(struct osmo_gsup_client *gsupc, struct msgb *msg) = + &__real_osmo_gsup_client_send; -int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int __wrap_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { - return (*gsup_client_send_cb)(gsupc, msg); + return (*osmo_gsup_client_send_cb)(gsupc, msg); }; static int count(struct llist_head *head) @@ -729,7 +729,7 @@ static void test_subscriber_gsup(void) cleanup_test(); } -int my_gsup_client_send_dummy(struct gsup_client *gsupc, struct msgb *msg) +int my_gsup_client_send_dummy(struct osmo_gsup_client *gsupc, struct msgb *msg) { msgb_free(msg); return 0; @@ -1032,7 +1032,7 @@ int my_subscr_request_update_gsup_auth(struct sgsn_mm_ctx *mmctx) { return rx_gsup_message(update_location_res, sizeof(update_location_res)); }; -int my_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int my_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { struct osmo_gsup_message to_peer = {0}; struct osmo_gsup_message from_peer = {0}; @@ -1074,7 +1074,7 @@ int my_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) return 0; } - reply_msg = gsup_client_msgb_alloc(); + reply_msg = osmo_gsup_client_msgb_alloc(); reply_msg->l2h = reply_msg->data; osmo_gsup_encode(reply_msg, &from_peer); gprs_subscr_rx_gsup_message(reply_msg); @@ -1451,7 +1451,7 @@ static void test_ggsn_selection(void) printf("Testing GGSN selection\n"); - gsup_client_send_cb = my_gsup_client_send_dummy; + osmo_gsup_client_send_cb = my_gsup_client_send_dummy; /* Check for emptiness */ OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL); @@ -1570,7 +1570,7 @@ static void test_ggsn_selection(void) sgsn_ggsn_ctx_free(ggcs[1]); sgsn_ggsn_ctx_free(ggcs[2]); - gsup_client_send_cb = __real_gsup_client_send; + osmo_gsup_client_send_cb = __real_osmo_gsup_client_send; cleanup_test(); } -- cgit v1.2.3