diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-10 13:30:17 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-02 12:09:15 +0000 |
commit | ac1f1436e9d380f632dd850fcd253d3480f0fc2d (patch) | |
tree | 555485b499cc7b4fcd8be9719bc60a15c23301d3 /openbsc/include | |
parent | 43273c63de6f457c47105e1432ea28ebf914d135 (diff) |
factor out & introduce struct gsm_encr, in common_cs.h
Factor out encryption info from struct gsm_lchan as struct gsm_encr, placed in
common_cs.h.
Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac
Future: this will be used by libmsc's subscriber connection, for osmo-cscn.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/common_cs.h | 8 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data_shared.h | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 8549a837b..172d6e621 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -7,6 +7,14 @@ struct gsm_network; typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); +#define MAX_A5_KEY_LEN (128/8) + +struct gsm_encr { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; +}; + struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 97fde835f..af7948554 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -24,6 +24,8 @@ #include <osmocom/gsm/lapdm.h> #endif +#include <openbsc/common_cs.h> + struct osmo_bsc_data; struct osmo_bsc_sccp_con; @@ -117,7 +119,6 @@ struct om2k_mo { struct osmo_fsm_inst *fsm; }; -#define MAX_A5_KEY_LEN (128/8) #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 @@ -219,11 +220,7 @@ struct gsm_lchan { uint8_t bs_power; uint8_t ms_power; /* Encryption information */ - struct { - uint8_t alg_id; - uint8_t key_len; - uint8_t key[MAX_A5_KEY_LEN]; - } encr; + struct gsm_encr encr; /* AMR bits */ uint8_t mr_ms_lv[7]; |