summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-04-27 18:14:14 +0200
committerHarald Welte <laforge@gnumonks.org>2016-04-29 13:10:37 +0200
commit564c06525b9acb3f4b90d4c92970e7d9cc5b1d8e (patch)
tree415c88dfac2c692f548e50ab32830f2ba9b5ab68
parent31760a1f6089fb59475ba79faa3eb97e4cf00f68 (diff)
OAP: use osmo_oap_ prefix for OAP, rather than plain oap_
this is in preparation of moving related code to libosmocore.
-rw-r--r--openbsc/include/openbsc/oap.h4
-rw-r--r--openbsc/include/openbsc/oap_messages.h12
-rw-r--r--openbsc/src/gprs/oap.c14
-rw-r--r--openbsc/src/gprs/oap_messages.c6
-rw-r--r--openbsc/tests/oap/oap_test.c8
5 files changed, 22 insertions, 22 deletions
diff --git a/openbsc/include/openbsc/oap.h b/openbsc/include/openbsc/oap.h
index 2370cbe07..2206184d1 100644
--- a/openbsc/include/openbsc/oap.h
+++ b/openbsc/include/openbsc/oap.h
@@ -25,7 +25,7 @@
#include <stdint.h>
struct msgb;
-struct oap_message;
+struct osmo_oap_message;
/* This is the config part for vty. It is essentially copied in oap_state,
* where values are copied over once the config is considered valid. */
@@ -74,5 +74,5 @@ int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb *
/* Allocate a msgb and in it, return the encoded oap_msg. Return NULL on
* error. (Like oap_encode(), but also allocates a msgb.)
* About the name: the idea is do_something(oap_encoded(my_struct)) */
-struct msgb *oap_encoded(const struct oap_message *oap_msg);
+struct msgb *oap_encoded(const struct osmo_oap_message *oap_msg);
diff --git a/openbsc/include/openbsc/oap_messages.h b/openbsc/include/openbsc/oap_messages.h
index e76287bae..496a6de88 100644
--- a/openbsc/include/openbsc/oap_messages.h
+++ b/openbsc/include/openbsc/oap_messages.h
@@ -36,7 +36,7 @@ enum oap_iei {
OAP_CLIENT_ID_IE = 0x30,
};
-enum oap_message_type {
+enum osmo_oap_message_type {
OAP_MSGT_REGISTER_REQUEST = 0b00000100,
OAP_MSGT_REGISTER_ERROR = 0b00000101,
OAP_MSGT_REGISTER_RESULT = 0b00000110,
@@ -50,8 +50,8 @@ enum oap_message_type {
OAP_MSGT_SYNC_RESULT = 0b00001110,
};
-struct oap_message {
- enum oap_message_type message_type;
+struct osmo_oap_message {
+ enum osmo_oap_message_type message_type;
enum gsm48_gmm_cause cause;
uint16_t client_id;
int rand_present;
@@ -64,7 +64,7 @@ struct oap_message {
uint8_t auts[16];
};
-int oap_decode(const uint8_t *data, size_t data_len,
- struct oap_message *oap_msg);
-void oap_encode(struct msgb *msg, const struct oap_message *oap_msg);
+int osmo_oap_decode(const uint8_t *data, size_t data_len,
+ struct osmo_oap_message *oap_msg);
+void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg);
diff --git a/openbsc/src/gprs/oap.c b/openbsc/src/gprs/oap.c
index eb0dd19d1..0b8f48260 100644
--- a/openbsc/src/gprs/oap.c
+++ b/openbsc/src/gprs/oap.c
@@ -119,11 +119,11 @@ static int oap_evaluate_challenge(const struct oap_state *state,
return 0;
}
-struct msgb *oap_encoded(const struct oap_message *oap_msg)
+struct msgb *oap_encoded(const struct osmo_oap_message *oap_msg)
{
struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__);
OSMO_ASSERT(msg);
- oap_encode(msg, oap_msg);
+ osmo_oap_encode(msg, oap_msg);
return msg;
}
@@ -136,7 +136,7 @@ static struct msgb* oap_msg_register(uint16_t client_id)
return NULL;
}
- struct oap_message oap_msg = {0};
+ struct osmo_oap_message oap_msg = {0};
oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST;
oap_msg.client_id = client_id;
return oap_encoded(&oap_msg);
@@ -157,7 +157,7 @@ int oap_register(struct oap_state *state, struct msgb **msg_tx)
* On error, return NULL. */
static struct msgb* oap_msg_challenge_response(uint8_t *xres)
{
- struct oap_message oap_reply = {0};
+ struct osmo_oap_message oap_reply = {0};
oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT;
memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres));
@@ -166,7 +166,7 @@ static struct msgb* oap_msg_challenge_response(uint8_t *xres)
}
static int handle_challenge(struct oap_state *state,
- struct oap_message *oap_rx,
+ struct osmo_oap_message *oap_rx,
struct msgb **msg_tx)
{
int rc;
@@ -209,11 +209,11 @@ int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb *
size_t data_len = msgb_l2len(msg_rx);
int rc = 0;
- struct oap_message oap_msg = {0};
+ struct osmo_oap_message oap_msg = {0};
OSMO_ASSERT(data);
- rc = oap_decode(data, data_len, &oap_msg);
+ rc = osmo_oap_decode(data, data_len, &oap_msg);
if (rc < 0) {
LOGP(DGPRS, LOGL_ERROR,
"Decoding OAP message failed with error '%s' (%d)\n",
diff --git a/openbsc/src/gprs/oap_messages.c b/openbsc/src/gprs/oap_messages.c
index ccb3c81a2..53ea9ac84 100644
--- a/openbsc/src/gprs/oap_messages.c
+++ b/openbsc/src/gprs/oap_messages.c
@@ -31,8 +31,8 @@
#include <stdint.h>
-int oap_decode(const uint8_t *const_data, size_t data_len,
- struct oap_message *oap_msg)
+int osmo_oap_decode(const uint8_t *const_data, size_t data_len,
+ struct osmo_oap_message *oap_msg)
{
int rc;
uint8_t tag;
@@ -144,7 +144,7 @@ int oap_decode(const uint8_t *const_data, size_t data_len,
return 0;
}
-void oap_encode(struct msgb *msg, const struct oap_message *oap_msg)
+void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg)
{
uint8_t u8;
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);