diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-23 17:32:52 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-23 17:32:52 +0800 |
commit | acda6908adc2de44f34a266a694d50b59ad1f314 (patch) | |
tree | 6efa3865fd937595247af6dd90ba59cf0e2a12a4 | |
parent | 83f46278dd423d9efa04e33a525e5edd961c26b3 (diff) |
bssap: Move cipher mode complete to libosmocore
-rw-r--r-- | openbsc/src/bsc_msc_ip.c | 2 | ||||
-rw-r--r-- | openbsc/src/bssap.c | 31 |
2 files changed, 1 insertions, 32 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index 032d057ef..774b2afef 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -401,7 +401,7 @@ static int handle_cipher_m_complete(struct msgb *msg) } LOGP(DMSC, LOGL_DEBUG, "CIPHER MODE COMPLETE from MS, forwarding to MSC\n"); - resp = bssmap_create_cipher_complete(msg); + resp = gsm0808_create_cipher_complete(msg, msg->lchan->encr.alg_id); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Creating MSC response failed.\n"); return -1; diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c index f63c7c96c..dfd70a591 100644 --- a/openbsc/src/bssap.c +++ b/openbsc/src/bssap.c @@ -781,37 +781,6 @@ struct msgb *bssmap_create_layer3(struct msgb *msg_l3) return msg; } -struct msgb *bssmap_create_cipher_complete(struct msgb *layer3) -{ - struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, - "cipher-complete"); - if (!msg) - return NULL; - - /* send response with BSS override for A5/1... cheating */ - msg->l3h = msgb_put(msg, 3); - msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT; - msg->l3h[1] = 0xff; - msg->l3h[2] = BSS_MAP_MSG_CIPHER_MODE_COMPLETE; - - /* include layer3 in case we have at least two octets */ - if (layer3 && msgb_l3len(layer3) > 2) { - msg->l4h = msgb_put(msg, msgb_l3len(layer3) + 2); - msg->l4h[0] = GSM0808_IE_LAYER_3_MESSAGE_CONTENTS; - msg->l4h[1] = msgb_l3len(layer3); - memcpy(&msg->l4h[2], layer3->l3h, msgb_l3len(layer3)); - } - - /* and the optional BSS message */ - msg->l4h = msgb_put(msg, 2); - msg->l4h[0] = GSM0808_IE_CHOSEN_ENCR_ALG; - msg->l4h[1] = layer3->lchan->encr.alg_id; - - /* update the size */ - msg->l3h[1] = msgb_l3len(msg) - 2; - return msg; -} - static u_int8_t chan_mode_to_speech(struct gsm_lchan *lchan) { int mode = 0; |