Starting to add Init Context Setup Response Parsing.

master
Pedro Alvarez 7 years ago
parent c05c328194
commit 47576aced1

@ -82,7 +82,9 @@ public:
bool handle_nas_authentication_response(srslte::byte_buffer_t *nas_buffer, srslte::byte_buffer_t *reply_buffer, ue_ctx_t *ue_ctx); bool handle_nas_authentication_response(srslte::byte_buffer_t *nas_buffer, srslte::byte_buffer_t *reply_buffer, ue_ctx_t *ue_ctx);
bool handle_nas_security_mode_complete(srslte::byte_buffer_t *nas_msg, srslte::byte_buffer_t *reply_msg, ue_ctx_t *ue_ctx); bool handle_nas_security_mode_complete(srslte::byte_buffer_t *nas_msg, srslte::byte_buffer_t *reply_msg, ue_ctx_t *ue_ctx);
bool send_initial_context_setup_request(uint32_t mme_ue_s1ap_id, struct srslte::gtpc_create_session_response *cs_resp); bool send_initial_context_setup_request(uint32_t mme_ue_s1ap_id, struct srslte::gtpc_create_session_response *cs_resp);
bool handle_successful_outcome(LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg);
bool handle_initial_context_setup_response(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *in_ctxt_resp);
void print_enb_ctx_info(const enb_ctx_t &enb_ctx); void print_enb_ctx_info(const enb_ctx_t &enb_ctx);
private: private:

@ -224,7 +224,7 @@ s1ap::handle_s1ap_rx_pdu(srslte::byte_buffer_t *pdu, struct sctp_sndrcvinfo *enb
break; break;
case LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME: case LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME:
m_s1ap_log->info("Received Succeseful Outcome PDU\n"); m_s1ap_log->info("Received Succeseful Outcome PDU\n");
return true;//TODO handle_successfuloutcome(&rx_pdu.choice.successfulOutcome); return handle_successful_outcome(&rx_pdu.choice.successfulOutcome);
break; break;
case LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME: case LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME:
m_s1ap_log->info("Received Unsucceseful Outcome PDU\n"); m_s1ap_log->info("Received Unsucceseful Outcome PDU\n");
@ -261,6 +261,18 @@ s1ap::handle_initiating_message(LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg, stru
return true; return true;
} }
bool
s1ap::handle_successful_outcome(LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg)
{
switch(msg->choice_type) {
case LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPRESPONSE:
m_s1ap_log->info("Received Initial Context Setup Response.\n");
return handle_initial_context_setup_response(&msg->choice.InitialContextSetupResponse);
default:
m_s1ap_log->error("Unhandled successful outcome message: %s\n", liblte_s1ap_successfuloutcome_choice_text[msg->choice_type]);
}
return true;
}
bool bool
s1ap::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, struct sctp_sndrcvinfo *enb_sri) s1ap::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, struct sctp_sndrcvinfo *enb_sri)
{ {
@ -655,13 +667,13 @@ s1ap::send_initial_context_setup_request(uint32_t mme_ue_s1ap_id, struct srslte:
return true; return true;
} }
/*
bool bool
s1ap::handle_initial_context_setup_response(uint32_t mme_ue_s1ap_id, struct srslte::gtpc_create_session_response *cs_resp) s1ap::handle_initial_context_setup_response(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *in_ctxt_resp)
{ {
return true; return true;
} }
*/
bool bool
s1ap::handle_ue_context_release_request(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *ue_rel, struct sctp_sndrcvinfo *enb_sri) s1ap::handle_ue_context_release_request(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *ue_rel, struct sctp_sndrcvinfo *enb_sri)

@ -256,7 +256,7 @@ spgw::run_thread()
FD_SET(m_s1u, &set); FD_SET(m_s1u, &set);
FD_SET(sgi, &set); FD_SET(sgi, &set);
m_spgw_log->info("Waiting for S1-U or SGi packets.\n"); //m_spgw_log->info("Waiting for S1-U or SGi packets.\n");
int n = select(max_fd+1, &set, NULL, NULL, NULL); int n = select(max_fd+1, &set, NULL, NULL, NULL);
if (n == -1) if (n == -1)
{ {
@ -264,19 +264,19 @@ spgw::run_thread()
} }
else if (n) else if (n)
{ {
m_spgw_log->info("Data is available now.\n"); //m_spgw_log->info("Data is available now.\n");
if (FD_ISSET(m_s1u, &set)) if (FD_ISSET(m_s1u, &set))
{ {
msg->N_bytes = recvfrom(m_s1u, msg->msg, SRSLTE_MAX_BUFFER_SIZE_BYTES, 0, &src_addr, &addrlen ); msg->N_bytes = recvfrom(m_s1u, msg->msg, SRSLTE_MAX_BUFFER_SIZE_BYTES, 0, &src_addr, &addrlen );
m_spgw_log->console("Received PDU from S1-U. Bytes %d\n", msg->N_bytes); //m_spgw_log->console("Received PDU from S1-U. Bytes %d\n", msg->N_bytes);
m_spgw_log->debug("Received PDU from S1-U. Bytes %d\n", msg->N_bytes); //m_spgw_log->debug("Received PDU from S1-U. Bytes %d\n", msg->N_bytes);
} }
if (FD_ISSET(m_sgi_if, &set)) if (FD_ISSET(m_sgi_if, &set))
{ {
m_spgw_log->console("Received PDU from SGi\n"); //m_spgw_log->console("Received PDU from SGi\n");
msg->N_bytes = read(sgi, msg->msg, SRSLTE_MAX_BUFFER_SIZE_BYTES); msg->N_bytes = read(sgi, msg->msg, SRSLTE_MAX_BUFFER_SIZE_BYTES);
m_spgw_log->console("Received PDU from SGi. Bytes %d\n", msg->N_bytes); //m_spgw_log->console("Received PDU from SGi. Bytes %d\n", msg->N_bytes);
m_spgw_log->debug("Received PDU from SGi. Bytes %d\n", msg->N_bytes); //m_spgw_log->debug("Received PDU from SGi. Bytes %d\n", msg->N_bytes);
} }
} }
else else

Loading…
Cancel
Save