From 53373bca8f9fe79ca981f9fc1ef644586bd5c3b2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 20 Apr 2016 17:11:43 +0200 Subject: move gsm_04_08_gprs.h to libosmocore This requres the corresponding commit in libosmocore. --- openbsc/tests/oap/Makefile.am | 1 - 1 file changed, 1 deletion(-) (limited to 'openbsc/tests/oap') diff --git a/openbsc/tests/oap/Makefile.am b/openbsc/tests/oap/Makefile.am index 3a76b11ad..538e1787e 100644 --- a/openbsc/tests/oap/Makefile.am +++ b/openbsc/tests/oap/Makefile.am @@ -15,7 +15,6 @@ oap_test_LDADD = \ $(top_builddir)/src/gprs/oap.o \ $(top_builddir)/src/gprs/oap_messages.o \ $(top_builddir)/src/gprs/gprs_utils.o \ - $(top_builddir)/src/gprs/gsm_04_08_gprs.o \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- cgit v1.2.3 From 31760a1f6089fb59475ba79faa3eb97e4cf00f68 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 27 Apr 2016 15:17:14 +0200 Subject: oap_message.h: Remove dependency to openbsc include This is a first step to moving oap_messages.h to libosmocore --- openbsc/tests/oap/oap_test.c | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc/tests/oap') diff --git a/openbsc/tests/oap/oap_test.c b/openbsc/tests/oap/oap_test.c index 9a2063bdc..4ee5d4207 100644 --- a/openbsc/tests/oap/oap_test.c +++ b/openbsc/tests/oap/oap_test.c @@ -26,6 +26,7 @@ #include #include +#include static void test_oap_api(void) { -- cgit v1.2.3 From 564c06525b9acb3f4b90d4c92970e7d9cc5b1d8e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 27 Apr 2016 18:14:14 +0200 Subject: OAP: use osmo_oap_ prefix for OAP, rather than plain oap_ this is in preparation of moving related code to libosmocore. --- openbsc/tests/oap/oap_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openbsc/tests/oap') diff --git a/openbsc/tests/oap/oap_test.c b/openbsc/tests/oap/oap_test.c index 4ee5d4207..625d8d892 100644 --- a/openbsc/tests/oap/oap_test.c +++ b/openbsc/tests/oap/oap_test.c @@ -95,8 +95,8 @@ static void test_oap_api(void) printf(" - AUTN failures\n"); - struct oap_message oap_rx; - struct oap_message oap_tx; + struct osmo_oap_message oap_rx; + struct osmo_oap_message oap_tx; struct msgb *msg_rx; struct msgb *msg_tx; @@ -168,7 +168,7 @@ static void test_oap_api(void) /* Expect the challenge response in msg_tx */ OSMO_ASSERT(msg_tx); - OSMO_ASSERT(oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); OSMO_ASSERT(strcmp("e2d05b598c61d9ba", osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) @@ -191,7 +191,7 @@ static void test_oap_api(void) OSMO_ASSERT(oap_handle(state, msg_rx, &msg_tx) == 0); OSMO_ASSERT(state->registration_failures == 1); OSMO_ASSERT(msg_tx); - OSMO_ASSERT(oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); OSMO_ASSERT(state->state == OAP_REQUESTED_CHALLENGE); msgb_free(msg_tx); -- cgit v1.2.3 From 5d547a4358edbd18744d1996d6ecb40328f09061 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 27 Apr 2016 18:21:16 +0200 Subject: osmo_oap_decode(): Use common argument ordering In general, if a function generates output data like a msgb (or in this case filling an osmo_oap_message structure), the output argument precedes the source. This is what we use all over libosmo*, and it is modelled after memcpy(), where dst is the first argument, before src. Let's align osmo_oap_decode(). Intestingly, osmo_oap_encode was already correct, so the encode/decode functions used different conventions before. --- openbsc/tests/oap/oap_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsc/tests/oap') diff --git a/openbsc/tests/oap/oap_test.c b/openbsc/tests/oap/oap_test.c index 625d8d892..339d77430 100644 --- a/openbsc/tests/oap/oap_test.c +++ b/openbsc/tests/oap/oap_test.c @@ -168,7 +168,7 @@ static void test_oap_api(void) /* Expect the challenge response in msg_tx */ OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); OSMO_ASSERT(strcmp("e2d05b598c61d9ba", osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) @@ -191,7 +191,7 @@ static void test_oap_api(void) OSMO_ASSERT(oap_handle(state, msg_rx, &msg_tx) == 0); OSMO_ASSERT(state->registration_failures == 1); OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); OSMO_ASSERT(state->state == OAP_REQUESTED_CHALLENGE); msgb_free(msg_tx); -- cgit v1.2.3