mirror of https://github.com/PentHertz/srsLTE.git
Continuing to clean S1AP
This commit is contained in:
parent
da7c105a29
commit
a5633bf143
|
@ -112,7 +112,7 @@ private:
|
|||
uint32_t m_next_mme_ue_s1ap_id;
|
||||
|
||||
s1ap_mngmt_proc* m_s1ap_mngmt_proc;
|
||||
s1ap_nas_transport m_s1ap_nas_transport;
|
||||
s1ap_nas_transport* m_s1ap_nas_transport;
|
||||
|
||||
//FIXME the GTP-C should be moved to the MME class, the the packaging of GTP-C messages is done.
|
||||
mme_gtpc *m_mme_gtpc;
|
||||
|
|
|
@ -36,8 +36,11 @@ namespace srsepc{
|
|||
class s1ap_nas_transport
|
||||
{
|
||||
public:
|
||||
s1ap_nas_transport();
|
||||
virtual ~s1ap_nas_transport();
|
||||
|
||||
static s1ap_nas_transport* m_instance;
|
||||
static s1ap_nas_transport* get_instance(void);
|
||||
static void cleanup(void);
|
||||
void init(void);
|
||||
|
||||
void set_log(srslte::log *s1ap_logger);
|
||||
bool unpack_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *init_ue, LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req, LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req);
|
||||
|
@ -54,8 +57,14 @@ public:
|
|||
|
||||
|
||||
private:
|
||||
s1ap_nas_transport();
|
||||
virtual ~s1ap_nas_transport();
|
||||
|
||||
srslte::log *m_s1ap_log;
|
||||
srslte::byte_buffer_pool *m_pool;
|
||||
|
||||
s1ap* m_parent;
|
||||
|
||||
};
|
||||
|
||||
} //namespace srsepc
|
||||
|
|
|
@ -366,10 +366,10 @@ s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ini
|
|||
m_s1ap_log->info("Received Initial UE Message. eNB-UE S1AP Id: %d\n", ue_ctx.enb_ue_s1ap_id);
|
||||
|
||||
/*Log unhandled Initial UE message IEs*/
|
||||
m_s1ap_nas_transport.log_unhandled_initial_ue_message_ies(init_ue);
|
||||
m_s1ap_nas_transport->log_unhandled_initial_ue_message_ies(init_ue);
|
||||
|
||||
/*Get NAS Attach Request and PDN connectivity request messages*/
|
||||
if(!m_s1ap_nas_transport.unpack_initial_ue_message(init_ue, &attach_req,&pdn_con_req))
|
||||
if(!m_s1ap_nas_transport->unpack_initial_ue_message(init_ue, &attach_req,&pdn_con_req))
|
||||
{
|
||||
//Could not decode the attach request and the PDN connectivity request.
|
||||
m_s1ap_log->error("Could not unpack NAS Attach Request and PDN connectivity request.\n");
|
||||
|
@ -435,7 +435,7 @@ s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ini
|
|||
|
||||
//Pack NAS Authentication Request in Downlink NAS Transport msg
|
||||
srslte::byte_buffer_t *reply_msg = m_pool->allocate();
|
||||
m_s1ap_nas_transport.pack_authentication_request(reply_msg, ue_ctx.enb_ue_s1ap_id, ue_ctx.mme_ue_s1ap_id, autn, rand);
|
||||
m_s1ap_nas_transport->pack_authentication_request(reply_msg, ue_ctx.enb_ue_s1ap_id, ue_ctx.mme_ue_s1ap_id, autn, rand);
|
||||
|
||||
//Send Reply to eNB
|
||||
ssize_t n_sent = sctp_send(m_s1mme,reply_msg->msg, reply_msg->N_bytes, enb_sri, 0);
|
||||
|
@ -561,7 +561,7 @@ s1ap::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, srslte:
|
|||
m_s1ap_log->console("UE Authentication Rejected. IMSI: %lu\n", ue_ctx->imsi);
|
||||
m_s1ap_log->warning("UE Authentication Rejected. IMSI: %lu\n", ue_ctx->imsi);
|
||||
//Send back Athentication Reject
|
||||
m_s1ap_nas_transport.pack_authentication_reject(reply_msg, ue_ctx->enb_ue_s1ap_id, ue_ctx->mme_ue_s1ap_id);
|
||||
m_s1ap_nas_transport->pack_authentication_reject(reply_msg, ue_ctx->enb_ue_s1ap_id, ue_ctx->mme_ue_s1ap_id);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -569,7 +569,7 @@ s1ap::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, srslte:
|
|||
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
|
||||
m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
|
||||
//Send Security Mode Command
|
||||
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx);
|
||||
m_s1ap_nas_transport->pack_security_mode_command(reply_msg, ue_ctx);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
@ -831,7 +831,7 @@ s1ap::send_initial_context_setup_request(uint32_t mme_ue_s1ap_id, struct srslte:
|
|||
return false;
|
||||
}
|
||||
srslte::byte_buffer_t *nas_buffer = m_pool->allocate();
|
||||
m_s1ap_nas_transport.pack_attach_accept(ue_ctx, erab_ctxt, &cs_resp->paa, nas_buffer);
|
||||
m_s1ap_nas_transport->pack_attach_accept(ue_ctx, erab_ctxt, &cs_resp->paa, nas_buffer);
|
||||
|
||||
|
||||
LIBLTE_ERROR_ENUM err = liblte_s1ap_pack_s1ap_pdu(&pdu, (LIBLTE_BYTE_MSG_STRUCT*)reply_buffer);
|
||||
|
|
|
@ -30,9 +30,11 @@
|
|||
|
||||
namespace srsepc{
|
||||
|
||||
s1ap_nas_transport* s1ap_nas_transport::m_instance = NULL;
|
||||
boost::mutex s1ap_nas_transport_instance_mutex;
|
||||
|
||||
s1ap_nas_transport::s1ap_nas_transport()
|
||||
{
|
||||
m_pool = srslte::byte_buffer_pool::get_instance();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -41,6 +43,35 @@ s1ap_nas_transport::~s1ap_nas_transport()
|
|||
return;
|
||||
}
|
||||
|
||||
s1ap_nas_transport*
|
||||
s1ap_nas_transport::get_instance(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(s1ap_nas_transport_instance_mutex);
|
||||
if(NULL == m_instance) {
|
||||
m_instance = new s1ap_nas_transport();
|
||||
}
|
||||
return(m_instance);
|
||||
}
|
||||
|
||||
void
|
||||
s1ap_nas_transport::cleanup(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(s1ap_nas_transport_instance_mutex);
|
||||
if(NULL != m_instance) {
|
||||
delete m_instance;
|
||||
m_instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
s1ap_nas_transport::init(void)
|
||||
{
|
||||
m_parent = s1ap::get_instance();
|
||||
m_s1ap_log = m_parent->m_s1ap_log;
|
||||
m_pool = srslte::byte_buffer_pool::get_instance();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
s1ap_nas_transport::set_log(srslte::log *s1ap_log)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue