|
|
@ -42,11 +42,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace srsue {
|
|
|
|
namespace srsue {
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
typedef enum { AUTH_OK, AUTH_FAILED, AUTH_SYNCH_FAILURE } auth_result_t;
|
|
|
|
AUTH_OK,
|
|
|
|
|
|
|
|
AUTH_FAILED,
|
|
|
|
|
|
|
|
AUTH_SYNCH_FAILURE
|
|
|
|
|
|
|
|
} auth_result_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// USIM interface for NAS
|
|
|
|
// USIM interface for NAS
|
|
|
|
class usim_interface_nas
|
|
|
|
class usim_interface_nas
|
|
|
@ -57,16 +53,16 @@ public:
|
|
|
|
virtual bool get_imsi_vec(uint8_t* imsi_, uint32_t n) = 0;
|
|
|
|
virtual bool get_imsi_vec(uint8_t* imsi_, uint32_t n) = 0;
|
|
|
|
virtual bool get_imei_vec(uint8_t* imei_, uint32_t n) = 0;
|
|
|
|
virtual bool get_imei_vec(uint8_t* imei_, uint32_t n) = 0;
|
|
|
|
virtual bool get_home_plmn_id(srslte::plmn_id_t* home_plmn_id) = 0;
|
|
|
|
virtual bool get_home_plmn_id(srslte::plmn_id_t* home_plmn_id) = 0;
|
|
|
|
virtual auth_result_t generate_authentication_response(uint8_t *rand,
|
|
|
|
virtual auth_result_t generate_authentication_response(uint8_t* rand,
|
|
|
|
uint8_t *autn_enb,
|
|
|
|
uint8_t* autn_enb,
|
|
|
|
uint16_t mcc,
|
|
|
|
uint16_t mcc,
|
|
|
|
uint16_t mnc,
|
|
|
|
uint16_t mnc,
|
|
|
|
uint8_t *res,
|
|
|
|
uint8_t* res,
|
|
|
|
int *res_len,
|
|
|
|
int* res_len,
|
|
|
|
uint8_t *k_asme) = 0;
|
|
|
|
uint8_t* k_asme) = 0;
|
|
|
|
virtual void generate_nas_keys(uint8_t *k_asme,
|
|
|
|
virtual void generate_nas_keys(uint8_t* k_asme,
|
|
|
|
uint8_t *k_nas_enc,
|
|
|
|
uint8_t* k_nas_enc,
|
|
|
|
uint8_t *k_nas_int,
|
|
|
|
uint8_t* k_nas_int,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -75,21 +71,21 @@ public:
|
|
|
|
class usim_interface_rrc
|
|
|
|
class usim_interface_rrc
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual void generate_as_keys(uint8_t *k_asme,
|
|
|
|
virtual void generate_as_keys(uint8_t* k_asme,
|
|
|
|
uint32_t count_ul,
|
|
|
|
uint32_t count_ul,
|
|
|
|
uint8_t *k_rrc_enc,
|
|
|
|
uint8_t* k_rrc_enc,
|
|
|
|
uint8_t *k_rrc_int,
|
|
|
|
uint8_t* k_rrc_int,
|
|
|
|
uint8_t *k_up_enc,
|
|
|
|
uint8_t* k_up_enc,
|
|
|
|
uint8_t *k_up_int,
|
|
|
|
uint8_t* k_up_int,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
virtual void generate_as_keys_ho(uint32_t pci,
|
|
|
|
virtual void generate_as_keys_ho(uint32_t pci,
|
|
|
|
uint32_t earfcn,
|
|
|
|
uint32_t earfcn,
|
|
|
|
int ncc,
|
|
|
|
int ncc,
|
|
|
|
uint8_t *k_rrc_enc,
|
|
|
|
uint8_t* k_rrc_enc,
|
|
|
|
uint8_t *k_rrc_int,
|
|
|
|
uint8_t* k_rrc_int,
|
|
|
|
uint8_t *k_up_enc,
|
|
|
|
uint8_t* k_up_enc,
|
|
|
|
uint8_t *k_up_int,
|
|
|
|
uint8_t* k_up_int,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -291,7 +287,7 @@ public:
|
|
|
|
virtual bool rb_is_um(uint32_t lcid) = 0;
|
|
|
|
virtual bool rb_is_um(uint32_t lcid) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//RLC interface for MAC
|
|
|
|
// RLC interface for MAC
|
|
|
|
class rlc_interface_mac : public srslte::read_pdu_interface
|
|
|
|
class rlc_interface_mac : public srslte::read_pdu_interface
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
@ -306,15 +302,15 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
/* MAC calls RLC to get RLC segment of nof_bytes length.
|
|
|
|
/* MAC calls RLC to get RLC segment of nof_bytes length.
|
|
|
|
* Segmentation happens in this function. RLC PDU is stored in payload. */
|
|
|
|
* Segmentation happens in this function. RLC PDU is stored in payload. */
|
|
|
|
virtual int read_pdu(uint32_t lcid, uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual int read_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/* MAC calls RLC to push an RLC PDU. This function is called from an independent MAC thread.
|
|
|
|
/* MAC calls RLC to push an RLC PDU. This function is called from an independent MAC thread.
|
|
|
|
* PDU gets placed into the buffer and higher layer thread gets notified. */
|
|
|
|
* PDU gets placed into the buffer and higher layer thread gets notified. */
|
|
|
|
virtual void write_pdu(uint32_t lcid, uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_bcch_bch(uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_bcch_bch(uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_bcch_dlsch(uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_bcch_dlsch(uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_pcch(uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_pcch(uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_mch(uint32_t lcid, uint8_t *payload, uint32_t nof_bytes) = 0;
|
|
|
|
virtual void write_pdu_mch(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** MAC interface
|
|
|
|
/** MAC interface
|
|
|
@ -418,7 +414,6 @@ public:
|
|
|
|
uint16_t sps_rnti;
|
|
|
|
uint16_t sps_rnti;
|
|
|
|
uint64_t contention_id;
|
|
|
|
uint64_t contention_id;
|
|
|
|
} ue_rnti_t;
|
|
|
|
} ue_rnti_t;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Interface RRC -> MAC */
|
|
|
|
/* Interface RRC -> MAC */
|
|
|
@ -444,7 +439,7 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
virtual void set_config(srslte::mac_cfg_t& mac_cfg) = 0;
|
|
|
|
virtual void set_config(srslte::mac_cfg_t& mac_cfg) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual void get_rntis(ue_rnti_t *rntis) = 0;
|
|
|
|
virtual void get_rntis(ue_rnti_t* rntis) = 0;
|
|
|
|
virtual void set_contention_id(uint64_t uecri) = 0;
|
|
|
|
virtual void set_contention_id(uint64_t uecri) = 0;
|
|
|
|
virtual void set_ho_rnti(uint16_t crnti, uint16_t target_pci) = 0;
|
|
|
|
virtual void set_ho_rnti(uint16_t crnti, uint16_t target_pci) = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -597,7 +592,7 @@ public:
|
|
|
|
virtual int meas_stop(uint32_t earfcn, int pci = -1) = 0;
|
|
|
|
virtual int meas_stop(uint32_t earfcn, int pci = -1) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
typedef struct {
|
|
|
|
enum {CELL_FOUND = 0, CELL_NOT_FOUND, ERROR} found;
|
|
|
|
enum { CELL_FOUND = 0, CELL_NOT_FOUND, ERROR } found;
|
|
|
|
enum { MORE_FREQS = 0, NO_MORE_FREQS } last_freq;
|
|
|
|
enum { MORE_FREQS = 0, NO_MORE_FREQS } last_freq;
|
|
|
|
} cell_search_ret_t;
|
|
|
|
} cell_search_ret_t;
|
|
|
|
|
|
|
|
|
|
|
@ -607,8 +602,8 @@ public:
|
|
|
|
} phy_cell_t;
|
|
|
|
} phy_cell_t;
|
|
|
|
|
|
|
|
|
|
|
|
/* Cell search and selection procedures */
|
|
|
|
/* Cell search and selection procedures */
|
|
|
|
virtual cell_search_ret_t cell_search(phy_cell_t *cell) = 0;
|
|
|
|
virtual cell_search_ret_t cell_search(phy_cell_t* cell) = 0;
|
|
|
|
virtual bool cell_select(phy_cell_t *cell = NULL) = 0;
|
|
|
|
virtual bool cell_select(phy_cell_t* cell = NULL) = 0;
|
|
|
|
virtual bool cell_is_camping() = 0;
|
|
|
|
virtual bool cell_is_camping() = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual void reset() = 0;
|
|
|
|
virtual void reset() = 0;
|
|
|
|