mscsplit: rewire MSC gsm0808_submit_dtap() to msc_tx_dtap()

This commit is contained in:
Neels Hofmeyr
2016-03-23 18:20:12 +01:00
parent b70dfa610d
commit c4b9b4edbb
5 changed files with 22 additions and 19 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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 */

View File

@@ -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);
}

View File

@@ -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;