From e95daf19258999a00b8bea5247ee21603941b639 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 25 Mar 2010 12:13:02 +0800 Subject: [PATCH] convert openbsc to use libosmocore-0.1.1 API the 0.1.1 API is cleaned up and removes all exported global static arrays (like rlm_cause_strs). There are now proper accessor functions. --- openbsc/configure.in | 2 +- openbsc/src/abis_rsl.c | 2 +- openbsc/src/gsm_04_08.c | 9 +++++---- openbsc/src/gsm_04_08_utils.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/openbsc/configure.in b/openbsc/configure.in index de0a9a958..27fb0ed36 100644 --- a/openbsc/configure.in +++ b/openbsc/configure.in @@ -18,7 +18,7 @@ dnl checks for libraries AC_SEARCH_LIBS(crypt, crypt, [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore = 0.1.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.1.1) dnl checks for header files AC_HEADER_STDC diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index 60e64cf8e..e7844afd2 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -1234,7 +1234,7 @@ static int rsl_rx_rll_err_ind(struct msgb *msg) LOGP(DRLL, LOGL_ERROR, "%s ERROR INDICATION cause=%s\n", gsm_lchan_name(msg->lchan), - get_value_string(rsl_rlm_cause_strs, rlm_cause[1])); + rsl_rlm_cause_name(rlm_cause[1])); rll_indication(msg->lchan, rllh->link_id, BSC_RLLR_IND_ERR_IND); diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index fb90ae3de..2eda0bd99 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -1008,7 +1008,8 @@ static void new_cc_state(struct gsm_trans *trans, int state) return; DEBUGP(DCC, "new state %s -> %s\n", - cc_state_names[trans->cc.state], cc_state_names[state]); + gsm48_cc_state_name(trans->cc.state), + gsm48_cc_state_name(state)); trans->cc.state = state; } @@ -2720,7 +2721,7 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg) trans->transaction_id, (lchan->subscr)?(lchan->subscr->extension):"-", get_mncc_name(msg_type), trans->cc.state, - cc_state_names[trans->cc.state]); + gsm48_cc_state_name(trans->cc.state)); /* Find function for current state and message */ for (i = 0; i < DOWNSLLEN; i++) @@ -2813,8 +2814,8 @@ static int gsm0408_rcv_cc(struct msgb *msg) "Received '%s' from MS in state %d (%s)\n", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, transaction_id, (lchan->subscr)?(lchan->subscr->extension):"-", - gsm48_cc_msg_names[msg_type], trans?(trans->cc.state):0, - cc_state_names[trans?(trans->cc.state):0]); + gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, + gsm48_cc_state_name(trans?(trans->cc.state):0)); /* Create transaction */ if (!trans) { diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c index 68f34f409..2472f12b0 100644 --- a/openbsc/src/gsm_04_08_utils.c +++ b/openbsc/src/gsm_04_08_utils.c @@ -68,7 +68,7 @@ int gsm48_sendmsg(struct msgb *msg, struct gsm_trans *trans) "Sending '%s' to MS.\n", msg->trx->bts->nr, msg->trx->nr, msg->lchan->ts->nr, gh->proto_discr & 0xf0, - gsm48_cc_msg_names[gh->msg_type & 0x3f]); + gsm48_cc_msg_name(gh->msg_type)); else DEBUGP(DCC, "(bts %d trx %d ts %d pd %02x) " "Sending 0x%02x to MS.\n", msg->trx->bts->nr,