summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-23 18:20:12 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-31 16:15:18 +0200
commitc4b9b4edbb63d0dd17e2587f1dd1e7e66041db00 (patch)
treec49b495f6366c77b5d008e8a4064fa399ff6c3bf /openbsc
parentb70dfa610d89786aa72a4adb4ffc1ba27a5f8af4 (diff)
mscsplit: rewire MSC gsm0808_submit_dtap() to msc_tx_dtap()
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/msc_ifaces.h7
-rw-r--r--openbsc/src/libmsc/a_iface.c14
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c4
-rw-r--r--openbsc/src/libmsc/gsm_04_80.c10
-rw-r--r--openbsc/src/libmsc/msc_ifaces.c6
5 files changed, 22 insertions, 19 deletions
diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h
index 9625c5843..57d16f4e4 100644
--- a/openbsc/include/openbsc/msc_ifaces.h
+++ b/openbsc/include/openbsc/msc_ifaces.h
@@ -28,6 +28,13 @@
/* Each main linkage must implement this function (see comment above). */
extern int iu_tx(struct msgb *msg, uint8_t sapi);
+/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface
+ * gets implemented, it should be in a separate lib (like libiu), this function
+ * should move there, and the following comment should remain here: "
+ * Each main linkage must implement this function (see comment above).
+ * " */
+extern int a_tx(struct msgb *msg);
+
int msc_tx_dtap(struct gsm_subscriber_connection *conn,
struct msgb *msg);
diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c
index faf2adada..ae9f5baa1 100644
--- a/openbsc/src/libmsc/a_iface.c
+++ b/openbsc/src/libmsc/a_iface.c
@@ -25,14 +25,12 @@
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
+#include <openbsc/msc_ifaces.h>
-int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
- struct msgb *msg, int link_id, int allow_sacch)
+int a_tx(struct msgb *msg)
{
- LOGP(DMSC, LOGL_ERROR, "gsm0808_submit_dtap(): message to be sent to"
- " BSC, but A interface not yet implemented.\n%s\n",
- osmo_hexdump(msg->data, msg->len)
- );
+ LOGP(DMSC, LOGL_ERROR, "message to be sent to BSC, but A-interface"
+ " not implemented.\n%s\n", osmo_hexdump(msg->data, msg->len));
return -1;
}
@@ -58,7 +56,7 @@ int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn)
DEBUGP(DMM, "-> CM SERVICE ACK\n");
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
/* 9.2.6 CM service reject */
@@ -75,5 +73,5 @@ int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value);
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 9b75fd105..796f1056e 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -53,7 +53,7 @@
#include <openbsc/paging.h>
#include <openbsc/bsc_rll.h>
#include <openbsc/chan_alloc.h>
-#include <openbsc/bsc_api.h>
+#include <openbsc/msc_ifaces.h>
#ifdef BUILD_SMPP
#include "smpp_smsc.h"
@@ -124,7 +124,7 @@ static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *m
{
DEBUGP(DLSMS, "GSM4.11 TX %s\n", osmo_hexdump(msg->data, msg->len));
msg->l3h = msg->data;
- return gsm0808_submit_dtap(conn, msg, UM_SAPI_SMS, 1);
+ return msc_tx_dtap(conn, msg);
}
/* Prefix msg with a 04.08/04.11 CP header */
diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c
index f1e1f273f..13961a656 100644
--- a/openbsc/src/libmsc/gsm_04_80.c
+++ b/openbsc/src/libmsc/gsm_04_80.c
@@ -32,7 +32,7 @@
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_04_08.h>
#include <openbsc/gsm_04_80.h>
-#include <openbsc/bsc_api.h>
+#include <openbsc/msc_ifaces.h>
#include <osmocom/gsm/gsm0480.h>
#include <osmocom/gsm/gsm_utils.h>
@@ -106,7 +106,7 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
| (1<<7); /* TI direction = 1 */
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
@@ -135,7 +135,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
gh->proto_discr |= req->transaction_id | (1<<7); /* TI direction = 1 */
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text)
@@ -143,7 +143,7 @@ int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, c
struct msgb *msg = gsm0480_gen_ussdNotify(level, text);
if (!msg)
return -1;
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
@@ -151,5 +151,5 @@ int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
struct msgb *msg = gsm0480_gen_releaseComplete();
if (!msg)
return -1;
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_tx_dtap(conn, msg);
}
diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c
index 453d92144..99f040e6a 100644
--- a/openbsc/src/libmsc/msc_ifaces.c
+++ b/openbsc/src/libmsc/msc_ifaces.c
@@ -28,10 +28,8 @@ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
switch (conn->via_iface) {
case IFACE_A:
- LOGP(DMSC, LOGL_ERROR,
- "attempt to send message via A-interface, which is not yet implemented.\n");
- /* TODO: msg->dst = <A-iface token>; a_tx(msg); */
- return -1;
+ msg->dst = conn;
+ return a_tx(msg);
case IFACE_IU:
msg->dst = conn->iu.ue_ctx;