aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/Makefile.am2
-rw-r--r--openbsc/include/openbsc/msc_api.h (renamed from openbsc/src/libmsc/msc_api.h)9
-rw-r--r--openbsc/include/openbsc/msc_ifaces.h8
-rw-r--r--openbsc/src/libmsc/Makefile.am2
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c5
-rw-r--r--openbsc/src/libmsc/iu_cs.c7
-rw-r--r--openbsc/src/libmsc/msc_api.c5
-rw-r--r--openbsc/src/libmsc/msc_ifaces.c10
8 files changed, 28 insertions, 20 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 4869603f2..2a855d039 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -19,7 +19,7 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
gprs_gsup_client.h bsc_msg_filter.h \
oap.h oap_messages.h \
gtphub.h \
- msc_ifaces.h iu.h iu_cs.h \
+ msc_api.h msc_ifaces.h iu.h iu_cs.h \
common.h
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
diff --git a/openbsc/src/libmsc/msc_api.h b/openbsc/include/openbsc/msc_api.h
index e3459a6ae..b0197386c 100644
--- a/openbsc/src/libmsc/msc_api.h
+++ b/openbsc/include/openbsc/msc_api.h
@@ -4,7 +4,12 @@
* direction, while they are not concerned with which particular external
* interface is actually involved (A or IuCS).
*
- * For the interface specific decisions see msc_iface.[hc] */
+ * For the interface specific decisions see msc_iface.[hc]
+ */
+
+/* MSCSPLIT WIP: this will gradually replace the role that the bsc_api.h had in
+ * OsmoNITB. Actually, osmo_msc.[hc] has the same role as this file, but having
+ * separate files helps me to keep track of how far I've gotten yet. */
#include <stdint.h>
@@ -20,5 +25,5 @@ enum {
* MSC_CONN_REJECT */
int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
uint16_t chosen_channel);
-/* TODO: is chosen_channel NITB legacy? */
+/* TODO: is chosen_channel BSC land == NITB legacy? */
diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h
index 2dee3918a..90b635284 100644
--- a/openbsc/include/openbsc/msc_ifaces.h
+++ b/openbsc/include/openbsc/msc_ifaces.h
@@ -16,7 +16,7 @@
* scope to plug real world functions or to have mere dummy implementations.
*
* For example, for msc_tx_foo(ifaces, conn, msg), depending on
- * conn->via_iface, either ifaces->a.tx() or ifaces.iu_cs.tx() is called to
+ * conn->via_iface, either ifaces.a.tx() or ifaces.iu_cs.tx() is called to
* dispatch the msg.
*
* To replace the default dummy implementations, a user would do the likes of:
@@ -28,8 +28,8 @@
*
* int main(void)
* {
- * global_msc_ifaces->network = my_network;
- * global_msc_ifaces->iu_cs.tx = my_iu_cs_tx;
+ * global_msc_ifaces.network = my_network;
+ * global_msc_ifaces.iu_cs.tx = my_iu_cs_tx;
* ...
* }
*
@@ -55,7 +55,7 @@ struct msc_ifaces {
};
-extern struct msc_ifaces *global_msc_ifaces;
+extern struct msc_ifaces global_msc_ifaces;
int msc_tx_dtap(struct gsm_subscriber_connection *conn,
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am
index fbbcbdc77..7f9e8ebd0 100644
--- a/openbsc/src/libmsc/Makefile.am
+++ b/openbsc/src/libmsc/Makefile.am
@@ -3,7 +3,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) \
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) $(LIBSMPP34_CFLAGS)
-noinst_HEADERS = meas_feed.h msc_api.h
+noinst_HEADERS = meas_feed.h
noinst_LIBRARIES = libmsc.a
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 8c4ae063c..f2065836e 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -63,9 +63,10 @@
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/tlv.h>
+#include <openbsc/msc_ifaces.h>
+
#include <assert.h>
-#include "msc_api.h"
/* These debug statements were removed during the BSC/MSC split. It may make
* sense to replace them with debug statements that do not access BTS data. */
@@ -104,7 +105,7 @@ static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection
gh->proto_discr = trans->protocol | (trans->transaction_id << 4);
}
- return msc_submit_dtap(conn, msg);
+ return msc_tx_dtap(conn, msg);
}
int gsm48_cc_tx_notify_ss(struct gsm_trans *trans, const char *message)
diff --git a/openbsc/src/libmsc/iu_cs.c b/openbsc/src/libmsc/iu_cs.c
index b0426e82c..e66a3c1df 100644
--- a/openbsc/src/libmsc/iu_cs.c
+++ b/openbsc/src/libmsc/iu_cs.c
@@ -4,12 +4,9 @@
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
+#include <openbsc/msc_api.h>
#include <openbsc/iu.h>
-#include <openbsc/bsc_api.h> /* for BSC_API_CONN_POL_ACCEPT, TODO move that to libmsc */
-
-#include "../libmsc/msc_api.h"
-
/* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */
struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network,
struct ue_conn_ctx *ue)
@@ -97,7 +94,7 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg)
abort();
rc = msc_compl_l3(conn, msg, 0);
- if (rc != BSC_API_CONN_POL_ACCEPT) {
+ if (rc != MSC_CONN_ACCEPT) {
subscr_con_free(conn);
rc = -1;
}
diff --git a/openbsc/src/libmsc/msc_api.c b/openbsc/src/libmsc/msc_api.c
index e896b24c9..f02b4c669 100644
--- a/openbsc/src/libmsc/msc_api.c
+++ b/openbsc/src/libmsc/msc_api.c
@@ -24,8 +24,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <osmocom/core/logging.h>
+
+#include <openbsc/debug.h>
+
#include <openbsc/msc_api.h>
#include <openbsc/gsm_data.h>
+#include <openbsc/transaction.h>
int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
uint16_t chosen_channel)
diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c
index 88100926d..0b4a554c9 100644
--- a/openbsc/src/libmsc/msc_ifaces.c
+++ b/openbsc/src/libmsc/msc_ifaces.c
@@ -28,17 +28,17 @@ static int tx_dummy_a(struct msgb *msg, uint8_t sapi)
{
LOGP(DMSC, LOGL_ERROR,
"attempt to send message via uninitialized A-interface\n");
- return -1
+ return -1;
}
static int tx_dummy_iu_cs(struct msgb *msg, uint8_t sapi)
{
LOGP(DMSC, LOGL_ERROR,
"attempt to send message via uninitialized IuCS-interface\n");
- return -1
+ return -1;
}
-struct msc_ifaces *global_msc_ifaces = {
+struct msc_ifaces global_msc_ifaces = {
.a = {
.tx = tx_dummy_a,
},
@@ -57,7 +57,7 @@ static int msc_tx(struct msc_ifaces *ifaces,
/* TODO: msg->dst = <A-iface token> */
return ifaces->a.tx(msg, 0);
- case IFACE_IUCS:
+ case IFACE_IU:
msg->dst = conn->iu.ue_ctx;
return ifaces->iu_cs.tx(msg, 0);
@@ -73,6 +73,6 @@ static int msc_tx(struct msc_ifaces *ifaces,
int msc_tx_dtap(struct gsm_subscriber_connection *conn,
struct msgb *msg)
{
- msc_tx(global_msc_ifaces, conn, msg);
+ return msc_tx(&global_msc_ifaces, conn, msg);
}