From 79c0daea91718f0d17d052d591183d5e3c63ca5b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 24 Oct 2017 18:08:23 +0100 Subject: [PATCH] Starting to handle Initial UE message --- srsepc/src/mme/mme.cc | 2 +- srsepc/src/mme/s1ap.cc | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/srsepc/src/mme/mme.cc b/srsepc/src/mme/mme.cc index ebab43e1e..0648c6d4e 100644 --- a/srsepc/src/mme/mme.cc +++ b/srsepc/src/mme/mme.cc @@ -142,7 +142,7 @@ mme::run_thread() m_s1ap_log.console("SCTP Notification %d\n", ((union sctp_notification*)pdu->msg)->sn_header.sn_type); if (((union sctp_notification*)pdu->msg)->sn_header.sn_type == SCTP_SHUTDOWN_EVENT) { - m_s1ap_log.console("SCTP Association Gracefully Shutdown\n"); + m_s1ap_log.console("SCTP Association Gracefully Shutdown\n");//TODO } } else diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 6fa3382b2..7b2074031 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -162,6 +162,9 @@ s1ap::handle_initiating_message(LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg, stru case LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_S1SETUPREQUEST: m_s1ap_log->info("Received S1 Setup Request.\n"); return handle_s1_setup_request(&msg->choice.S1SetupRequest, enb_sri); + case LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALUEMESSAGE: + m_s1ap_log->info("Received Initial UE Message.\n"); + return handle_initial_ue_message(&msg->choice.InitialUEMessage, enb_sri); default: m_s1ap_log->error("Unhandled intiating message: %s\n", liblte_s1ap_initiatingmessage_choice_text[msg->choice_type]); } @@ -225,6 +228,24 @@ s1ap::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, st } +bool +s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *msg, struct sctp_sndrcvinfo *enb_sri) +{ + + //Send Reply to eNB + //ssize_t n_sent = sctp_send(m_s1mme,reply_msg.msg, reply_msg.N_bytes, enb_sri, 0); + //if(n_sent == -1) + //{ + // m_s1ap_log->console("Failed to send S1 Setup Setup Reply"); + // return false; + //} + + return true; + +} + + + void s1ap::print_enb_ctx_info(const enb_ctx_t &enb_ctx) {