aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 1375f4a5..8f6dc694 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -213,3 +213,18 @@ struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
return msgb_dequeue(&btsb->agch_queue);
}
+
+int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher)
+{
+ int sup;
+
+ if (rsl_cipher < 1 || rsl_cipher > 8)
+ return -ENOTSUP;
+
+ /* No encryption is always supported */
+ if (rsl_cipher == 1)
+ return 1;
+
+ sup = (1 << (rsl_cipher - 2)) & bts->support.ciphers;
+ return sup > 0;
+}