|
|
@ -46,11 +46,7 @@ struct rrc_cfg_sr_t {
|
|
|
|
uint32_t nof_subframes;
|
|
|
|
uint32_t nof_subframes;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
typedef enum { RRC_CFG_CQI_MODE_PERIODIC = 0, RRC_CFG_CQI_MODE_APERIODIC, RRC_CFG_CQI_MODE_N_ITEMS } rrc_cfg_cqi_mode_t;
|
|
|
|
RRC_CFG_CQI_MODE_PERIODIC = 0,
|
|
|
|
|
|
|
|
RRC_CFG_CQI_MODE_APERIODIC,
|
|
|
|
|
|
|
|
RRC_CFG_CQI_MODE_N_ITEMS
|
|
|
|
|
|
|
|
} rrc_cfg_cqi_mode_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char rrc_cfg_cqi_mode_text[RRC_CFG_CQI_MODE_N_ITEMS][20] = {"periodic", "aperiodic"};
|
|
|
|
static const char rrc_cfg_cqi_mode_text[RRC_CFG_CQI_MODE_N_ITEMS][20] = {"periodic", "aperiodic"};
|
|
|
|
|
|
|
|
|
|
|
@ -122,7 +118,7 @@ static const char rrc_state_text[RRC_STATE_N_ITEMS][100] = {"IDLE",
|
|
|
|
"RRC CONNECTED",
|
|
|
|
"RRC CONNECTED",
|
|
|
|
"RELEASE REQUEST"};
|
|
|
|
"RELEASE REQUEST"};
|
|
|
|
|
|
|
|
|
|
|
|
class rrc : public rrc_interface_pdcp,
|
|
|
|
class rrc final : public rrc_interface_pdcp,
|
|
|
|
public rrc_interface_mac,
|
|
|
|
public rrc_interface_mac,
|
|
|
|
public rrc_interface_rlc,
|
|
|
|
public rrc_interface_rlc,
|
|
|
|
public rrc_interface_s1ap,
|
|
|
|
public rrc_interface_s1ap,
|
|
|
@ -142,18 +138,18 @@ public:
|
|
|
|
srslte::log* log_rrc);
|
|
|
|
srslte::log* log_rrc);
|
|
|
|
|
|
|
|
|
|
|
|
void stop();
|
|
|
|
void stop();
|
|
|
|
void get_metrics(rrc_metrics_t &m);
|
|
|
|
void get_metrics(rrc_metrics_t& m);
|
|
|
|
|
|
|
|
|
|
|
|
// rrc_interface_mac
|
|
|
|
// rrc_interface_mac
|
|
|
|
void rl_failure(uint16_t rnti);
|
|
|
|
void rl_failure(uint16_t rnti);
|
|
|
|
void add_user(uint16_t rnti);
|
|
|
|
void add_user(uint16_t rnti);
|
|
|
|
void upd_user(uint16_t new_rnti, uint16_t old_rnti);
|
|
|
|
void upd_user(uint16_t new_rnti, uint16_t old_rnti);
|
|
|
|
void set_activity_user(uint16_t rnti);
|
|
|
|
void set_activity_user(uint16_t rnti);
|
|
|
|
bool is_paging_opportunity(uint32_t tti, uint32_t *payload_len);
|
|
|
|
bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len);
|
|
|
|
|
|
|
|
|
|
|
|
// rrc_interface_rlc
|
|
|
|
// rrc_interface_rlc
|
|
|
|
void read_pdu_bcch_dlsch(uint32_t sib_idx, uint8_t *payload);
|
|
|
|
void read_pdu_bcch_dlsch(uint32_t sib_idx, uint8_t* payload);
|
|
|
|
void read_pdu_pcch(uint8_t *payload, uint32_t buffer_size);
|
|
|
|
void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size);
|
|
|
|
void max_retx_attempted(uint16_t rnti);
|
|
|
|
void max_retx_attempted(uint16_t rnti);
|
|
|
|
|
|
|
|
|
|
|
|
// rrc_interface_s1ap
|
|
|
|
// rrc_interface_s1ap
|
|
|
@ -177,17 +173,19 @@ public:
|
|
|
|
void log_rrc_message(const std::string& source, direction_t dir, const srslte::byte_buffer_t* pdu, const T& msg);
|
|
|
|
void log_rrc_message(const std::string& source, direction_t dir, const srslte::byte_buffer_t* pdu, const T& msg);
|
|
|
|
|
|
|
|
|
|
|
|
// Notifier for user connect
|
|
|
|
// Notifier for user connect
|
|
|
|
class connect_notifier {
|
|
|
|
class connect_notifier
|
|
|
|
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual void user_connected(uint16_t rnti) = 0;
|
|
|
|
virtual void user_connected(uint16_t rnti) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
void set_connect_notifer(connect_notifier *cnotifier);
|
|
|
|
void set_connect_notifer(connect_notifier* cnotifier);
|
|
|
|
|
|
|
|
|
|
|
|
class activity_monitor : public thread
|
|
|
|
class activity_monitor : public thread
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
activity_monitor(rrc* parent_);
|
|
|
|
activity_monitor(rrc* parent_);
|
|
|
|
void stop();
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
rrc* parent;
|
|
|
|
rrc* parent;
|
|
|
|
bool running;
|
|
|
|
bool running;
|
|
|
@ -215,7 +213,7 @@ public:
|
|
|
|
void send_connection_release();
|
|
|
|
void send_connection_release();
|
|
|
|
void send_connection_reest_rej();
|
|
|
|
void send_connection_reest_rej();
|
|
|
|
void send_connection_reconf(srslte::unique_byte_buffer_t sdu);
|
|
|
|
void send_connection_reconf(srslte::unique_byte_buffer_t sdu);
|
|
|
|
void send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *e);
|
|
|
|
void send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT* e);
|
|
|
|
void send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu);
|
|
|
|
void send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu);
|
|
|
|
void send_security_mode_command();
|
|
|
|
void send_security_mode_command();
|
|
|
|
void send_ue_cap_enquiry();
|
|
|
|
void send_ue_cap_enquiry();
|
|
|
@ -229,8 +227,8 @@ public:
|
|
|
|
void handle_security_mode_failure(asn1::rrc::security_mode_fail_s* msg);
|
|
|
|
void handle_security_mode_failure(asn1::rrc::security_mode_fail_s* msg);
|
|
|
|
bool handle_ue_cap_info(asn1::rrc::ue_cap_info_s* msg);
|
|
|
|
bool handle_ue_cap_info(asn1::rrc::ue_cap_info_s* msg);
|
|
|
|
|
|
|
|
|
|
|
|
void set_bitrates(LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT *rates);
|
|
|
|
void set_bitrates(LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT* rates);
|
|
|
|
void set_security_capabilities(LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT *caps);
|
|
|
|
void set_security_capabilities(LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT* caps);
|
|
|
|
void set_security_key(uint8_t* key, uint32_t length);
|
|
|
|
void set_security_key(uint8_t* key, uint32_t length);
|
|
|
|
|
|
|
|
|
|
|
|
bool setup_erabs(LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* e);
|
|
|
|
bool setup_erabs(LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* e);
|
|
|
@ -306,7 +304,7 @@ public:
|
|
|
|
LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT address;
|
|
|
|
LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT address;
|
|
|
|
uint32_t teid_out;
|
|
|
|
uint32_t teid_out;
|
|
|
|
uint32_t teid_in;
|
|
|
|
uint32_t teid_in;
|
|
|
|
}erab_t;
|
|
|
|
} erab_t;
|
|
|
|
std::map<uint8_t, erab_t> erabs;
|
|
|
|
std::map<uint8_t, erab_t> erabs;
|
|
|
|
int sr_sched_sf_idx;
|
|
|
|
int sr_sched_sf_idx;
|
|
|
|
int sr_sched_prb_idx;
|
|
|
|
int sr_sched_prb_idx;
|
|
|
@ -324,16 +322,16 @@ public:
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
std::map<uint16_t,ue> users;
|
|
|
|
std::map<uint16_t, ue> users;
|
|
|
|
|
|
|
|
|
|
|
|
std::map<uint32_t, LIBLTE_S1AP_UEPAGINGID_STRUCT > pending_paging;
|
|
|
|
std::map<uint32_t, LIBLTE_S1AP_UEPAGINGID_STRUCT> pending_paging;
|
|
|
|
|
|
|
|
|
|
|
|
activity_monitor act_monitor;
|
|
|
|
activity_monitor act_monitor;
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<srslte::unique_byte_buffer_t> sib_buffer;
|
|
|
|
std::vector<srslte::unique_byte_buffer_t> sib_buffer;
|
|
|
|
|
|
|
|
|
|
|
|
// user connect notifier
|
|
|
|
// user connect notifier
|
|
|
|
connect_notifier *cnotifier;
|
|
|
|
connect_notifier* cnotifier;
|
|
|
|
|
|
|
|
|
|
|
|
void process_release_complete(uint16_t rnti);
|
|
|
|
void process_release_complete(uint16_t rnti);
|
|
|
|
void process_rl_failure(uint16_t rnti);
|
|
|
|
void process_rl_failure(uint16_t rnti);
|
|
|
@ -346,10 +344,10 @@ private:
|
|
|
|
void parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer_t pdu);
|
|
|
|
void parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer_t pdu);
|
|
|
|
void configure_security(uint16_t rnti,
|
|
|
|
void configure_security(uint16_t rnti,
|
|
|
|
uint32_t lcid,
|
|
|
|
uint32_t lcid,
|
|
|
|
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);
|
|
|
|
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo);
|
|
|
|
void enable_integrity(uint16_t rnti, uint32_t lcid);
|
|
|
|
void enable_integrity(uint16_t rnti, uint32_t lcid);
|
|
|
@ -365,11 +363,11 @@ private:
|
|
|
|
s1ap_interface_rrc* s1ap;
|
|
|
|
s1ap_interface_rrc* s1ap;
|
|
|
|
srslte::log* rrc_log;
|
|
|
|
srslte::log* rrc_log;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
typedef struct {
|
|
|
|
uint16_t rnti;
|
|
|
|
uint16_t rnti;
|
|
|
|
uint32_t lcid;
|
|
|
|
uint32_t lcid;
|
|
|
|
srslte::unique_byte_buffer_t pdu;
|
|
|
|
srslte::unique_byte_buffer_t pdu;
|
|
|
|
}rrc_pdu;
|
|
|
|
} rrc_pdu;
|
|
|
|
|
|
|
|
|
|
|
|
const static uint32_t LCID_EXIT = 0xffff0000;
|
|
|
|
const static uint32_t LCID_EXIT = 0xffff0000;
|
|
|
|
const static uint32_t LCID_REM_USER = 0xffff0001;
|
|
|
|
const static uint32_t LCID_REM_USER = 0xffff0001;
|
|
|
@ -397,7 +395,7 @@ private:
|
|
|
|
class mobility_cfg;
|
|
|
|
class mobility_cfg;
|
|
|
|
std::unique_ptr<mobility_cfg> enb_mobility_cfg;
|
|
|
|
std::unique_ptr<mobility_cfg> enb_mobility_cfg;
|
|
|
|
|
|
|
|
|
|
|
|
void run_thread();
|
|
|
|
void run_thread() override;
|
|
|
|
void rem_user_thread(uint16_t rnti);
|
|
|
|
void rem_user_thread(uint16_t rnti);
|
|
|
|
pthread_mutex_t user_mutex;
|
|
|
|
pthread_mutex_t user_mutex;
|
|
|
|
|
|
|
|
|
|
|
|