summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_gsup_client.c8
-rw-r--r--openbsc/src/gprs/oap.c20
2 files changed, 15 insertions, 13 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index b991563..0360e0a 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -116,7 +116,7 @@ static void gsup_client_oap_register(struct gsup_client *gsupc)
{
struct msgb *msg_tx;
int rc;
- rc = oap_register(&gsupc->oap_state, &msg_tx);
+ rc = oap_client_register(&gsupc->oap_state, &msg_tx);
if ((rc < 0) || (!msg_tx)) {
LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n");
@@ -155,7 +155,7 @@ static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx
int rc;
struct msgb *msg_tx;
- rc = oap_handle(&gsupc->oap_state, msg_rx, &msg_tx);
+ rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx);
msgb_free(msg_rx);
if (rc < 0)
return rc;
@@ -265,7 +265,7 @@ static void start_test_procedure(struct gsup_client *gsupc)
struct gsup_client *gsup_client_create(const char *ip_addr,
unsigned int tcp_port,
gsup_client_read_cb_t read_cb,
- struct oap_config *oap_config)
+ struct oap_client_config *oap_config)
{
struct gsup_client *gsupc;
int rc;
@@ -273,7 +273,7 @@ struct gsup_client *gsup_client_create(const char *ip_addr,
gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client);
OSMO_ASSERT(gsupc);
- rc = oap_init(oap_config, &gsupc->oap_state);
+ rc = oap_client_init(oap_config, &gsupc->oap_state);
if (rc != 0)
goto failed;
diff --git a/openbsc/src/gprs/oap.c b/openbsc/src/gprs/oap.c
index 7efbe81..ac2b2a4 100644
--- a/openbsc/src/gprs/oap.c
+++ b/openbsc/src/gprs/oap.c
@@ -29,7 +29,8 @@
#include <openbsc/oap.h>
#include <openbsc/debug.h>
-int oap_init(struct oap_config *config, struct oap_state *state)
+int oap_client_init(struct oap_client_config *config,
+ struct oap_client_state *state)
{
OSMO_ASSERT(state->state == OAP_UNINITIALIZED);
@@ -66,7 +67,7 @@ disable:
* response message and update the state.
* Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail
* the authentication check; -3 for any other errors. */
-static int oap_evaluate_challenge(const struct oap_state *state,
+static int oap_evaluate_challenge(const struct oap_client_state *state,
const uint8_t *rx_random,
const uint8_t *rx_autn,
uint8_t *tx_xres)
@@ -119,7 +120,7 @@ static int oap_evaluate_challenge(const struct oap_state *state,
return 0;
}
-struct msgb *oap_encoded(const struct osmo_oap_message *oap_msg)
+struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg)
{
struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__);
OSMO_ASSERT(msg);
@@ -140,10 +141,10 @@ static struct msgb* oap_msg_register(uint16_t client_id)
oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST;
oap_msg.client_id = client_id;
- return oap_encoded(&oap_msg);
+ return oap_client_encoded(&oap_msg);
}
-int oap_register(struct oap_state *state, struct msgb **msg_tx)
+int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx)
{
*msg_tx = oap_msg_register(state->client_id);
if (!(*msg_tx))
@@ -163,10 +164,10 @@ static struct msgb* oap_msg_challenge_response(uint8_t *xres)
oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT;
memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres));
oap_reply.xres_present = 1;
- return oap_encoded(&oap_reply);
+ return oap_client_encoded(&oap_reply);
}
-static int handle_challenge(struct oap_state *state,
+static int handle_challenge(struct oap_client_state *state,
struct osmo_oap_message *oap_rx,
struct msgb **msg_tx)
{
@@ -203,7 +204,8 @@ failure:
return rc;
}
-int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb **msg_tx)
+int oap_client_handle(struct oap_client_state *state,
+ const struct msgb *msg_rx, struct msgb **msg_tx)
{
uint8_t *data = msgb_l2(msg_rx);
size_t data_len = msgb_l2len(msg_rx);
@@ -237,7 +239,7 @@ int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb *
state->state = OAP_INITIALIZED;
if (state->registration_failures < 3) {
state->registration_failures ++;
- return oap_register(state, msg_tx);
+ return oap_client_register(state, msg_tx);
}
return -11;