aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-04 11:59:41 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-15 20:06:47 +0100
commit2d2c910f2c5af98f9f4a2352dca85c66feb80f71 (patch)
treeb9e6b65b7ed60d8c1a6d48bce5b9b561be5525e5 /openbsc/src/bsc
parent4582586e248c35324c6c6fa0f3546be1dd70a599 (diff)
bsc: Implement sending a Cipher Mode Complete message
Diffstat (limited to 'openbsc/src/bsc')
-rw-r--r--openbsc/src/bsc/osmo_bsc_api.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/openbsc/src/bsc/osmo_bsc_api.c b/openbsc/src/bsc/osmo_bsc_api.c
index 82074e7e1..1e66a0ddd 100644
--- a/openbsc/src/bsc/osmo_bsc_api.c
+++ b/openbsc/src/bsc/osmo_bsc_api.c
@@ -21,6 +21,8 @@
#include <openbsc/osmo_bsc.h>
#include <openbsc/debug.h>
+#include <osmocore/gsm0808.h>
+
#define return_when_not_connected(conn) \
if (!conn->sccp_con) {\
LOGP(DMSC, LOGL_ERROR, "MSC Connection not present.\n"); \
@@ -41,7 +43,17 @@ static void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci)
static void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn,
struct msgb *msg, uint8_t chosen_encr)
{
+ struct msgb *resp;
return_when_not_connected(conn);
+
+ LOGP(DMSC, LOGL_DEBUG, "CIPHER MODE COMPLETE from MS, forwarding to MSC\n");
+ resp = gsm0808_create_cipher_complete(msg, chosen_encr);
+ if (!resp) {
+ LOGP(DMSC, LOGL_ERROR, "Creating the response failed.\n");
+ return;
+ }
+
+ bsc_queue_for_msc(conn, resp);
}
static int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,