bsc: use select() statement in f_cipher_mode_bssmap_to_rsl()

Change-Id: I6e1c6762d2dd1efac2bd7ead3caf25e25dd3e7ad
Related: SYS#5838
This commit is contained in:
Vadim Yanitskiy 2022-03-14 22:07:43 +03:00 committed by laforge
parent d12db41526
commit 4483a22b1d
1 changed files with 11 additions and 32 deletions

View File

@ -780,41 +780,20 @@ function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig, RSL_DCHAN_PT r
/* Convert the cipher representation on BSSMAP to the representation used on RSL */ /* Convert the cipher representation on BSSMAP to the representation used on RSL */
function f_cipher_mode_bssmap_to_rsl(OCT1 alg_bssmap) return RSL_AlgId function f_cipher_mode_bssmap_to_rsl(OCT1 alg_bssmap) return RSL_AlgId
{ {
/* A5 0 */ select (alg_bssmap) {
if (alg_bssmap == '01'O) { case ('01'O) { return RSL_ALG_ID_A5_0; }
return RSL_ALG_ID_A5_0; case ('02'O) { return RSL_ALG_ID_A5_1; }
} case ('04'O) { return RSL_ALG_ID_A5_2; }
/* A5 1 */ case ('08'O) { return RSL_ALG_ID_A5_3; }
else if (alg_bssmap == '02'O) { case ('10'O) { return RSL_ALG_ID_A5_4; }
return RSL_ALG_ID_A5_1; case ('20'O) { return RSL_ALG_ID_A5_5; }
} case ('40'O) { return RSL_ALG_ID_A5_6; }
/* A5 2 */ case ('80'O) { return RSL_ALG_ID_A5_7; }
else if (alg_bssmap == '04'O) { case else {
return RSL_ALG_ID_A5_2;
}
/* A5 3 */
else if (alg_bssmap == '08'O) {
return RSL_ALG_ID_A5_3;
}
/* A5 4 */
else if (alg_bssmap == '10'O) {
return RSL_ALG_ID_A5_4;
}
/* A5 5 */
else if (alg_bssmap == '20'O) {
return RSL_ALG_ID_A5_5;
}
/* A5 6 */
else if (alg_bssmap == '40'O) {
return RSL_ALG_ID_A5_6;
}
/* A5 7 */
else if (alg_bssmap == '80'O) {
return RSL_ALG_ID_A5_7;
} else {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected Encryption Algorithm: " & Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected Encryption Algorithm: " &
oct2str(alg_bssmap)); oct2str(alg_bssmap));
return RSL_ALG_ID_A5_0; return RSL_ALG_ID_A5_0;
}
} }
} }