diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-30 13:09:14 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-23 22:27:37 +0100 |
commit | 331c78df5885ac7269682c23bd9b231f7a82a8c7 (patch) | |
tree | 083ba579301c9a56798b8038d7cf35e5c0ca0c9d /openbsc/src/libmsc/msc_ifaces.c | |
parent | 75f53b52794cb31e42f8974358a3ef5034cfc081 (diff) |
libmsc: duplicate gsm0808 / gsm48 functions (towards BSC)
In osmo-nitb, libmsc would directly call the functions on the BSC level, not
always via the bsc_api. When separating libmsc from libbsc, some functions are
missing from the linkage.
Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also
add a _tx to gsm0808_cipher_mode():
* add msc_gsm0808_tx_cipher_mode() (dummy/stub)
* add msc_gsm48_tx_mm_serv_ack()
* add msc_gsm48_tx_mm_serv_rej()
Call these from libmsc instead of
* gsm0808_cipher_mode()
* gsm48_tx_mm_serv_ack()
* gsm48_tx_mm_serv_rej()
Also add a comment relatd to msc_gsm0808_tx_cipher_mode() in two places.
Change-Id: I5b276853d3af71f5e3f0a031fd17b4fff0580020
Diffstat (limited to 'openbsc/src/libmsc/msc_ifaces.c')
-rw-r--r-- | openbsc/src/libmsc/msc_ifaces.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index 234ffd2ab..bc8533b5a 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -49,3 +49,35 @@ int msc_tx_dtap(struct gsm_subscriber_connection *conn, { return msc_tx(conn, msg); } + + +/* 9.2.5 CM service accept */ +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 SERV ACC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_ACC; + + DEBUGP(DMM, "-> CM SERVICE ACCEPT\n"); + + return msc_tx_dtap(conn, msg); +} + +/* 9.2.6 CM service reject */ +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value) +{ + struct msgb *msg; + + msg = gsm48_create_mm_serv_rej(value); + if (!msg) { + LOGP(DMM, LOGL_ERROR, "Failed to allocate CM Service Reject.\n"); + return -1; + } + + DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value); + + return msc_tx_dtap(conn, msg); +} |