mirror of
https://gerrit.osmocom.org/osmo-gbproxy
synced 2024-08-18 08:56:23 +00:00
Merge branch 'holger/merge-on-waves-msc'
This commit is contained in:
commit
43732d192d
3 changed files with 26 additions and 25 deletions
|
@ -724,7 +724,7 @@ int gsm48_generate_mid_from_imsi(u_int8_t *buf, const char* imsi);
|
|||
int gsm48_mi_to_string(char *string, const int str_len, const u_int8_t *mi, const int mi_len);
|
||||
|
||||
int gsm48_send_rr_release(struct gsm_lchan *lchan);
|
||||
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan);
|
||||
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
|
||||
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
|
||||
u_int8_t apdu_len, u_int8_t *apdu);
|
||||
|
||||
|
|
|
@ -1644,30 +1644,6 @@ static int gsm0408_rcv_rr(struct msgb *msg)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* Chapter 9.1.9: Ciphering Mode Command */
|
||||
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan)
|
||||
{
|
||||
struct msgb *msg = gsm48_msgb_alloc();
|
||||
struct gsm48_hdr *gh;
|
||||
u_int8_t ciph_mod_set;
|
||||
|
||||
msg->lchan = lchan;
|
||||
|
||||
DEBUGP(DRR, "TX CIPHERING MODE CMD\n");
|
||||
|
||||
if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0))
|
||||
ciph_mod_set = 0;
|
||||
else
|
||||
ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1;
|
||||
|
||||
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
|
||||
gh->proto_discr = GSM48_PDISC_RR;
|
||||
gh->msg_type = GSM48_MT_RR_CIPH_M_CMD;
|
||||
gh->data[0] = 0x10 | (ciph_mod_set & 0xf);
|
||||
|
||||
return rsl_encryption_cmd(msg);
|
||||
}
|
||||
|
||||
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
|
||||
u_int8_t apdu_len, u_int8_t *apdu)
|
||||
{
|
||||
|
|
|
@ -457,3 +457,28 @@ int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr)
|
|||
paging_request_stop(msg->trx->bts, subscr, msg->lchan);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Chapter 9.1.9: Ciphering Mode Command */
|
||||
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv)
|
||||
{
|
||||
struct msgb *msg = gsm48_msgb_alloc();
|
||||
struct gsm48_hdr *gh;
|
||||
u_int8_t ciph_mod_set;
|
||||
|
||||
msg->lchan = lchan;
|
||||
|
||||
DEBUGP(DRR, "TX CIPHERING MODE CMD\n");
|
||||
|
||||
if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0))
|
||||
ciph_mod_set = 0;
|
||||
else
|
||||
ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1;
|
||||
|
||||
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
|
||||
gh->proto_discr = GSM48_PDISC_RR;
|
||||
gh->msg_type = GSM48_MT_RR_CIPH_M_CMD;
|
||||
gh->data[0] = (want_imeisv & 0x1) << 4 | (ciph_mod_set & 0xf);
|
||||
|
||||
return rsl_encryption_cmd(msg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue