send connection reject if MME isn't connected

This commit is contained in:
Andre Puschmann 2018-11-15 15:50:17 +01:00
parent 56c01ba3ee
commit 8a1368c8d6
5 changed files with 25 additions and 1 deletions

View File

@ -280,6 +280,7 @@ public:
virtual bool user_release(uint16_t rnti, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM cause_radio) = 0;
virtual void ue_ctxt_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *res) = 0;
virtual void ue_erab_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *res) = 0;
virtual bool is_mme_connected() = 0;
// virtual void ue_capabilities(uint16_t rnti, LIBLTE_RRC_UE_EUTRA_CAPABILITY_STRUCT *caps) = 0;
};

View File

@ -198,6 +198,7 @@ public:
void send_connection_setup(bool is_setup = true);
void send_connection_reest();
void send_connection_reject();
void send_connection_release();
void send_connection_reest_rej();
void send_connection_reconf(srslte::byte_buffer_t *sdu);

View File

@ -80,6 +80,7 @@ public:
bool user_release(uint16_t rnti, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM cause_radio);
void ue_ctxt_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *res);
void ue_erab_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *res);
bool is_mme_connected();
//void ue_capabilities(uint16_t rnti, LIBLTE_RRC_UE_EUTRA_CAPABILITY_STRUCT *caps);
private:

View File

@ -1044,6 +1044,12 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, byte_buffer_t *pdu)
void rrc::ue::handle_rrc_con_req(LIBLTE_RRC_CONNECTION_REQUEST_STRUCT *msg)
{
if (not parent->s1ap->is_mme_connected()) {
printf("send reject\n");
parent->rrc_log->error("MME isn't connected. Sending Connection Reject\n");
send_connection_reject();
}
set_activity();
if(msg->ue_id_type == LIBLTE_RRC_CON_REQ_UE_ID_TYPE_S_TMSI) {
@ -1303,7 +1309,17 @@ void rrc::ue::send_connection_reest_rej()
dl_ccch_msg.msg_type = LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_REEST_REJ;
send_dl_ccch(&dl_ccch_msg);
}
void rrc::ue::send_connection_reject()
{
LIBLTE_RRC_DL_CCCH_MSG_STRUCT dl_ccch_msg;
bzero(&dl_ccch_msg, sizeof(LIBLTE_RRC_DL_CCCH_MSG_STRUCT));
dl_ccch_msg.msg_type = LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_REJ;
dl_ccch_msg.msg.rrc_con_rej.wait_time = 10;
send_dl_ccch(&dl_ccch_msg);
}
void rrc::ue::send_connection_setup(bool is_setup)

View File

@ -259,6 +259,11 @@ void s1ap::ue_erab_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETUPR
//}
bool s1ap::is_mme_connected()
{
return mme_connected;
}
/*******************************************************************************
/* S1AP connection helpers
********************************************************************************/