path: root/include
diff options
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-12-26 18:55:54 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-26 18:55:54 +0100
commit19cf0e81b336ead3c0a55d1c9d6722f986510bc0 (patch)
treef78ac1ca37b836aa3b7ff1dbfc6b861ac44ab5b4 /include
parent5f408f934ca868ff209049bd92f3b0896a0eccac (diff)
ciphering: Handle ciphering support for A5/3 correctly
This was found and debugged by Sylvain. The BTS will always support A5/0 so we do not keep track of that, the first bit of the flags is used for A5/1, second for A5/2... but for RSL there is an offset to go from RSL to A5(x). Add a testcase and change the code.
Diffstat (limited to 'include')
1 files changed, 7 insertions, 1 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 33f074a8..55eec964 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -56,7 +56,7 @@ struct gsm_bts_role_bts {
char *rtp_bind_host;
unsigned int rtp_jitter_buf_ms;
struct {
- uint8_t ciphers;
+ uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
} support;
struct {
uint8_t tc4_ctr;
@@ -85,4 +85,10 @@ static inline struct femtol1_hdl *trx_femtol1_hdl(struct gsm_bts_trx *trx)
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
+/* cipher code */
+#define CIPHER_A5(x) (1 << (x-1))
+int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher);
#endif /* _GSM_DATA_H */