Commit f2c76a5d authored by Niuhaiwen's avatar Niuhaiwen

support de-register and Identity procedure

parent 82814a01
...@@ -197,7 +197,7 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind &nas_data_ind) ...@@ -197,7 +197,7 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind &nas_data_ind)
else else
{ {
Logger::amf_n1().error("No existing nas_context with GUTI %s", nas_data_ind.guti.c_str()); Logger::amf_n1().error("No existing nas_context with GUTI %s", nas_data_ind.guti.c_str());
return; //return;
} }
} }
else else
...@@ -342,10 +342,15 @@ void amf_n1::nas_signalling_establishment_request_handle(SecurityHeaderType type ...@@ -342,10 +342,15 @@ void amf_n1::nas_signalling_establishment_request_handle(SecurityHeaderType type
case SERVICE_REQUEST: case SERVICE_REQUEST:
{ {
Logger::amf_n1().debug("Received service request message, handling..."); Logger::amf_n1().debug("Received service request message, handling...");
nc.get()->security_ctx->ul_count.seq_num = ulCount; if(nc.get())
nc.get()->security_ctx->ul_count.seq_num = ulCount;
service_request_handle(true, nc, ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); service_request_handle(true, nc, ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
} }
break; break;
case UE_INIT_DEREGISTER:{
Logger::amf_n1().debug("received initialUeMessage de-registration request messgae , handle ...");
//ue_initiate_de_registration_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
}break;
default: default:
Logger::amf_n1().error("No handler for NAS message 0x%x", message_type); Logger::amf_n1().error("No handler for NAS message 0x%x", message_type);
} }
...@@ -356,6 +361,7 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, ...@@ -356,6 +361,7 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
{ {
uint8_t *buf = (uint8_t *)bdata(plain_msg); uint8_t *buf = (uint8_t *)bdata(plain_msg);
uint8_t message_type = *(buf + 2); uint8_t message_type = *(buf + 2);
Logger::amf_n1().debug("received message(0x%x)", message_type);
switch (message_type) switch (message_type)
{ {
case AUTHENTICATION_RESPONSE: case AUTHENTICATION_RESPONSE:
...@@ -394,6 +400,12 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, ...@@ -394,6 +400,12 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
ue_initiate_de_registration_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); ue_initiate_de_registration_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
} }
break; break;
case IDENTITY_RESPONSE:
{
Logger::amf_n1().debug("received identity response messgae , handle ...");
identity_response_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
}
break;
case REGISTRATION_COMPLETE: case REGISTRATION_COMPLETE:
{ {
Logger::amf_n1().debug("Received registration complete message, handling..."); Logger::amf_n1().debug("Received registration complete message, handling...");
...@@ -402,67 +414,63 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, ...@@ -402,67 +414,63 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
break; break;
default: default:
{ {
Logger::amf_n1().debug("No message available (0x%x)", message_type);
//TODO: //TODO:
} }
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring plain_msg, plmn_t plmn) void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring plain_msg, plmn_t plmn) {
{ uint8_t *buf = (uint8_t*) bdata(plain_msg);
uint8_t *buf = (uint8_t *)bdata(plain_msg);
uint8_t message_type = *(buf + 2); uint8_t message_type = *(buf + 2);
switch (message_type) switch (message_type) {
{ case AUTHENTICATION_RESPONSE: {
case AUTHENTICATION_RESPONSE: Logger::amf_n1().debug("Received authentication response message, handling...");
{ authentication_response_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
Logger::amf_n1().debug("Received authentication response message, handling..."); }
authentication_response_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); break;
} case AUTHENTICATION_FAILURE: {
break; Logger::amf_n1().debug("Received authentication failure message, handling...");
case AUTHENTICATION_FAILURE: authentication_failure_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
{ }
Logger::amf_n1().debug("Received authentication failure message, handling..."); break;
authentication_failure_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); case SECURITY_MODE_COMPLETE: {
} Logger::amf_n1().debug("Received security mode complete message, handling...");
break; security_mode_complete_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
case SECURITY_MODE_COMPLETE: }
{ break;
Logger::amf_n1().debug("Received security mode complete message, handling..."); case SECURITY_MODE_REJECT: {
security_mode_complete_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); Logger::amf_n1().debug("Received security mode reject message, handling...");
} security_mode_reject_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
break; }
case SECURITY_MODE_REJECT: break;
{ case UL_NAS_TRANSPORT: {
Logger::amf_n1().debug("Received security mode reject message, handling..."); Logger::amf_n1().debug("Received ul NAS transport message, handling...");
security_mode_reject_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); ul_nas_transport_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg, plmn);
} }
break; break;
case UL_NAS_TRANSPORT: case UE_INIT_DEREGISTER: {
{ Logger::amf_n1().debug("Received de-registration request message, handling...");
Logger::amf_n1().debug("Received ul NAS transport message, handling..."); ue_initiate_de_registration_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
ul_nas_transport_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg, plmn); }
} break;
break; case IDENTITY_RESPONSE:
case UE_INIT_DEREGISTER: {
{ Logger::amf_n1().debug("received identity response messgae , handle ...");
Logger::amf_n1().debug("Received de-registration request message, handling..."); identity_response_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
ue_initiate_de_registration_handle(ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); }
} break;
break; case REGISTRATION_COMPLETE: {
case REGISTRATION_COMPLETE: Logger::amf_n1().debug("Received registration complete message, handling...");
{ //TODO
Logger::amf_n1().debug("Received registration complete message, handling..."); }
//TODO break;
} default: {
break; //TODO:
default: }
{
//TODO:
}
} }
} }
// nas message decode // nas message decode
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_n1::check_security_header_type(SecurityHeaderType &type, uint8_t *buffer) bool amf_n1::check_security_header_type(SecurityHeaderType &type, uint8_t *buffer)
...@@ -1349,7 +1357,8 @@ void amf_n1::handle_auth_vector_successful_result(std::shared_ptr<nas_context> n ...@@ -1349,7 +1357,8 @@ void amf_n1::handle_auth_vector_successful_result(std::shared_ptr<nas_context> n
{ {
nc.get()->security_ctx = new nas_secu_ctx(); nc.get()->security_ctx = new nas_secu_ctx();
if (nc.get()->security_ctx && nc.get()->ngKsi != NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE) if (nc.get()->security_ctx && nc.get()->ngKsi != NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE)
ngksi = (nc.get()->security_ctx->ngksi + 1) % (NGKSI_MAX_VALUE + 1); //ngksi = (nc.get()->security_ctx->ngksi + 1) % (NGKSI_MAX_VALUE + 1);
ngksi = (nc.get()->amf_ue_ngap_id + 1) % (NGKSI_MAX_VALUE + 1);
// ensure which vector is available? // ensure which vector is available?
nc.get()->ngKsi = ngksi; nc.get()->ngKsi = ngksi;
} }
...@@ -1955,12 +1964,33 @@ void amf_n1::run_initial_registration_procedure() ...@@ -1955,12 +1964,33 @@ void amf_n1::run_initial_registration_procedure()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void amf_n1::ue_initiate_de_registration_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring nas) void amf_n1::ue_initiate_de_registration_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring nas)
{ {
string guti = "1234567890"; //need modify string guti = "1234567890";//need modify
_5G_GUTI_t Guti;
_5GSMobilityIdentity *ulNas = new _5GSMobilityIdentity();
ulNas->decodefrombuffer((uint8_t*)bdata(nas)+4, blength(nas),false);
ulNas->get5GGUTI(Guti);
delete ulNas;
string amf_region_id = std::to_string(Guti.amf_region_id);
guti = Guti.mcc + Guti.mnc + std::to_string(Guti.amf_region_id) + std::to_string(Guti.amf_set_id) + std::to_string(Guti.amf_pointer) + std::to_string(Guti._5g_tmsi);
std::shared_ptr<nas_context> nc; std::shared_ptr<nas_context> nc;
if(!is_guti_2_nas_context(guti))
return;
nc = guti_2_nas_context(guti); nc = guti_2_nas_context(guti);
nc.get()->is_auth_vectors_present = false; nc.get()-> is_auth_vectors_present = false;
nc.get()->is_current_security_available = false; nc.get()-> is_current_security_available = false;
nc.get()->security_ctx->sc_type = SECURITY_CTX_TYPE_NOT_AVAILABLE; nc.get()->security_ctx->sc_type = SECURITY_CTX_TYPE_NOT_AVAILABLE;
Logger::ngap().debug("sending itti ue context release command to TASK_AMF_N2");
itti_ue_context_release_command * itti_msg = new itti_ue_context_release_command(TASK_AMF_N1, TASK_AMF_N2);
itti_msg->amf_ue_ngap_id = amf_ue_ngap_id;
itti_msg->ran_ue_ngap_id = ran_ue_ngap_id;
itti_msg->cause.setChoiceOfCause(Ngap_Cause_PR_nas);
itti_msg->cause.setValue(2);//cause nas(2)--deregister
std::shared_ptr<itti_ue_context_release_command> i = std::shared_ptr<itti_ue_context_release_command>(itti_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret) {
Logger::ngap().error("Could not send ITTI message %s to task TASK_AMF_N2", i->get_msg_name());
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -270,7 +270,34 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer &smf) ...@@ -270,7 +270,34 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer &smf)
{ {
case PDU_SESSION_INITIAL_REQUEST: case PDU_SESSION_INITIAL_REQUEST:
{ {
handle_pdu_session_initial_request(supi, psc, smf_addr, smf.sm_msg, dnn); //get pti
uint8_t *sm_msg = (uint8_t*)bdata(smf.sm_msg);
uint8_t pti = sm_msg[2];
Logger::amf_n1().debug("decoded PTI for PDUSessionEstablishmentRequest(0x%x)", pti);
if(psc.get()->isn1sm_avaliable && psc.get()->isn2sm_avaliable){
itti_n1n2_message_transfer_request * itti_msg = new itti_n1n2_message_transfer_request(TASK_AMF_N11, TASK_AMF_APP);
itti_msg->supi = supi;
uint8_t accept_len = blength(psc.get()->n1sm);
uint8_t *accept = (uint8_t*)calloc(1, accept_len);
memcpy(accept, (uint8_t*)bdata(psc.get()->n1sm), accept_len);
accept[2] = pti;
itti_msg->n1sm = blk2bstr(accept, accept_len);
free(accept);
itti_msg->is_n1sm_set = true;
itti_msg->n2sm = psc.get()->n2sm;
itti_msg->is_n2sm_set = true;
itti_msg->pdu_session_id = psc.get()->pdu_session_id;
std::shared_ptr<itti_n1n2_message_transfer_request> i = std::shared_ptr<itti_n1n2_message_transfer_request>(itti_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret) {
Logger::amf_server().error( "Could not send ITTI message %s to task TASK_AMF_APP", i->get_msg_name());
}
}else{
psc.get()->isn2sm_avaliable = false;
handle_pdu_session_initial_request(supi, psc, smf_addr, smf.sm_msg, dnn);
}
//handle_pdu_session_initial_request(supi, psc, smf_addr, smf.sm_msg, dnn);
} }
break; break;
case EXISTING_PDU_SESSION: case EXISTING_PDU_SESSION:
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
pdu_session_context::pdu_session_context() { pdu_session_context::pdu_session_context() {
smf_available = false; smf_available = false;
isn2sm_avaliable = false;
isn1sm_avaliable = false;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -82,7 +82,10 @@ class itti_initial_context_setup_request : public itti_msg_n2 ...@@ -82,7 +82,10 @@ class itti_initial_context_setup_request : public itti_msg_n2
{ {
public: public:
itti_initial_context_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {} itti_initial_context_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {}
itti_initial_context_setup_request(const itti_initial_context_setup_request &i) : itti_msg_n2(i) {} itti_initial_context_setup_request(const itti_initial_context_setup_request &i) : itti_msg_n2(i) {
is_pdu_exist = false;
isn2sm_avaliable = false;
}
uint32_t ran_ue_ngap_id; uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id; long amf_ue_ngap_id;
bstring kgnb; bstring kgnb;
......
...@@ -59,24 +59,26 @@ int IdentityRequest::encode2buffer(uint8_t *buf, int len) { ...@@ -59,24 +59,26 @@ int IdentityRequest::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding IdentityRequest message"); Logger::nas_mm().debug("encoding IdentityRequest message");
int encoded_size = 0; int encoded_size = 0;
if (!plain_header) { if (!plain_header) {
Logger::nas_mm().error("Mandatory IE missing Header"); Logger::nas_mm().error("Mandontary IE missing Header");
return 0; return 0;
} }
if (!(plain_header->encode2buffer(buf, len))) if (!(plain_header->encode2buffer(buf, len))) return 0;
return 0; encoded_size += 3;
encoded_size += 3; if (!_5gs_identity_type) {
if (!_5gs_identity_type) { Logger::nas_mm().warn("IE _5gs_identity_type is not avaliable");
Logger::nas_mm().warn("IE _5gs_identity_type is not available");
} else {
if (int size = _5gs_identity_type->encode2buffer(buf + encoded_size, len - encoded_size)) {
encoded_size += size;
} else {
Logger::nas_mm().error("encoding _5gs_identity_type error");
return 0;
} }
else {
int size = _5gs_identity_type->encode2buffer(buf + encoded_size, len - encoded_size);
if (size) {
encoded_size += size;
}
else {
Logger::nas_mm().error("encoding _5gs_identity_type error");
return 0;
}
} }
Logger::nas_mm().debug("encoded IdentityRequest message len(%d)", encoded_size); Logger::nas_mm().debug("encoded IdentityRequest message len(%d)", encoded_size);
return 1; return encoded_size;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -109,6 +109,6 @@ int IdentityResponse::decodefrombuffer(NasMmPlainHeader *header, uint8_t *buf, i ...@@ -109,6 +109,6 @@ int IdentityResponse::decodefrombuffer(NasMmPlainHeader *header, uint8_t *buf, i
decoded_size += ie_mobility_id->decodefrombuffer(buf + decoded_size, len - decoded_size, false); decoded_size += ie_mobility_id->decodefrombuffer(buf + decoded_size, len - decoded_size, false);
Logger::nas_mm().debug("decoded_size(%d)", decoded_size); Logger::nas_mm().debug("decoded_size(%d)", decoded_size);
Logger::nas_mm().debug("decoded IdentityResponse message len(%d)", decoded_size); Logger::nas_mm().debug("decoded IdentityResponse message len(%d)", decoded_size);
return true;
} }
...@@ -199,31 +199,89 @@ int ngap_amf_handle_ue_context_release_complete(const sctp_assoc_id_t assoc_id, ...@@ -199,31 +199,89 @@ int ngap_amf_handle_ue_context_release_complete(const sctp_assoc_id_t assoc_id,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int ngap_amf_handle_pdu_session_resource_setup_response(const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream, struct Ngap_NGAP_PDU *message_p) { int ngap_amf_handle_pdu_session_resource_setup_response(const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream, struct Ngap_NGAP_PDU *message_p) {
Logger::ngap().debug("Handle PDU Session Resource Setup Response"); Logger::ngap().debug("sending itti pdu_session_resource_setup_response to TASK_AMF_N11");
PduSessionResourceSetupResponseMsg *pduresp = new PduSessionResourceSetupResponseMsg(); PduSessionResourceSetupResponseMsg *pduresp = new PduSessionResourceSetupResponseMsg();
if (!pduresp->decodefrompdu(message_p)) { if (!pduresp->decodefrompdu(message_p))
Logger::ngap().error("Decoding PduSessionResourceSetupResponseMsg message error"); {
Logger::ngap().error("decoding PduSessionResourceSetupResponseMsg message error");
return -1; return -1;
} }
std::vector<PDUSessionResourceSetupResponseItem_t> list; std::vector<PDUSessionResourceSetupResponseItem_t> list;
if (!pduresp->getPduSessionResourceSetupResponseList(list)) { if (!pduresp->getPduSessionResourceSetupResponseList(list))
Logger::ngap().error("Decoding PduSessionResourceSetupResponseMsg getPduSessionResourceSetupResponseList IE error"); {
return -1; Logger::ngap().error("decoding PduSessionResourceSetupResponseMsg getPduSessionResourceSetupResponseList IE error");
} }
uint8_t transferIe[500]; else
memcpy(transferIe, list[0].pduSessionResourceSetupResponseTransfer.buf, list[0].pduSessionResourceSetupResponseTransfer.size); {
bstring n2sm = blk2bstr(transferIe, list[0].pduSessionResourceSetupResponseTransfer.size); uint8_t transferIe[500];
memcpy(transferIe, list[0].pduSessionResourceSetupResponseTransfer.buf, list[0].pduSessionResourceSetupResponseTransfer.size);
Logger::ngap().debug("Sending itti pdu_session_resource_setup_response to TASK_AMF_N11"); bstring n2sm = blk2bstr(transferIe, list[0].pduSessionResourceSetupResponseTransfer.size);
itti_nsmf_pdusession_update_sm_context *itti_msg = new itti_nsmf_pdusession_update_sm_context(TASK_NGAP, TASK_AMF_N11); itti_nsmf_pdusession_update_sm_context *itti_msg = new itti_nsmf_pdusession_update_sm_context(TASK_NGAP, TASK_AMF_N11);
itti_msg->pdu_session_id = list[0].pduSessionId; long amf_ue_ngap_id = pduresp->getAmfUeNgapId();
itti_msg->n2sm = n2sm; std::shared_ptr<nas_context> nct = amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id);
std::shared_ptr < itti_nsmf_pdusession_update_sm_context > i = std::shared_ptr < itti_nsmf_pdusession_update_sm_context > (itti_msg); itti_msg->supi = "imsi-" + nct.get()->imsi;
int ret = itti_inst->send_msg(i); itti_msg->pdu_session_id = list[0].pduSessionId;
if (0 != ret) { itti_msg->n2sm = n2sm;
Logger::ngap().error("Could not send ITTI message %s to task TASK_AMF_N11", i->get_msg_name()); std::shared_ptr<itti_nsmf_pdusession_update_sm_context> i = std::shared_ptr<itti_nsmf_pdusession_update_sm_context>(itti_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret)
{
Logger::ngap().error("Could not send ITTI message %s to task TASK_AMF_N11", i->get_msg_name());
}
return 0;
}
std::vector<PDUSessionResourceFailedToSetupItem_t> list_fail;
if (!pduresp->getPduSessionResourceFailedToSetupList(list_fail))
{
Logger::ngap().error("decoding PduSessionResourceSetupResponseMsg getPduSessionResourceFailedToSetupList IE error");
}
else
{
PduSessionResourceSetupUnSuccessfulTransferIE *UnSuccessfultransfer = new PduSessionResourceSetupUnSuccessfulTransferIE();
uint8_t buffer[500];
memcpy(buffer, list_fail[0].pduSessionResourceSetupUnsuccessfulTransfer.buf, list_fail[0].pduSessionResourceSetupUnsuccessfulTransfer.size);
UnSuccessfultransfer->decodefromIE(buffer, list_fail[0].pduSessionResourceSetupUnsuccessfulTransfer.size);
Logger::ngap().debug("UnSuccessfultransfer->getChoiceOfCause%d UnSuccessfultransfer->getCause%d", UnSuccessfultransfer->getChoiceOfCause(), UnSuccessfultransfer->getCause());
if ((UnSuccessfultransfer->getChoiceOfCause() == Ngap_Cause_PR_radioNetwork) && (UnSuccessfultransfer->getCause() == Ngap_CauseRadioNetwork_multiple_PDU_session_ID_instances))
{
/*Logger::ngap().debug("sending itti pdu session resource release command to TASK_AMF_N2");
itti_pdu_session_resource_release_command * itti_msg = new itti_pdu_session_resource_release_command(TASK_NGAP, TASK_AMF_N2);
itti_msg->amf_ue_ngap_id = pduresp->getAmfUeNgapId();
itti_msg->ran_ue_ngap_id = pduresp->getRanUeNgapId();
std::shared_ptr<itti_pdu_session_resource_release_command> i = std::shared_ptr<itti_pdu_session_resource_release_command>(itti_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret) {
Logger::ngap().error("Could not send ITTI message %s to task TASK_AMF_N2", i->get_msg_name());
}*/
long amf_ue_ngap_id = pduresp->getAmfUeNgapId();
std::shared_ptr<nas_context> nct = amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id);
string supi = "imsi-" + nct.get()->imsi;
std::shared_ptr<pdu_session_context> psc;
if (amf_n11_inst->is_supi_to_pdu_ctx(supi))
{
psc = amf_n11_inst->supi_to_pdu_ctx(supi);
if (!psc)
{
Logger::amf_n1().error("connot get pdu_session_context");
return 0;
}
}
psc.get()->isn2sm_avaliable = false;
Logger::ngap().debug("receive pdu session resource setup response fail(multi pdu session id),set pdu session context isn2sm_avaliable = false");
/*Logger::ngap().debug("sending itti ue context release command to TASK_AMF_N2");
itti_ue_context_release_command * itti_msg = new itti_ue_context_release_command(TASK_AMF_N1, TASK_AMF_N2);
itti_msg->amf_ue_ngap_id = pduresp->getAmfUeNgapId();
itti_msg->ran_ue_ngap_id = pduresp->getRanUeNgapId();
itti_msg->cause.setChoiceOfCause(Ngap_Cause_PR_radioNetwork);
itti_msg->cause.setValue(28);
std::shared_ptr<itti_ue_context_release_command> i = std::shared_ptr<itti_ue_context_release_command>(itti_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret) {
Logger::ngap().error("Could not send ITTI message %s to task TASK_AMF_N2", i->get_msg_name());
}*/
return 0;
}
} }
return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -62,13 +62,16 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(const std::str ...@@ -62,13 +62,16 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(const std::str
} }
bstring n1sm; bstring n1sm;
msg_str_2_msg_hex(n1sm_str.substr(0, n1sm_str.length()), n1sm); msg_str_2_msg_hex(n1sm_str.substr(0, n1sm_str.length()-2), n1sm);
bstring n2sm; bstring n2sm;
msg_str_2_msg_hex(n2sm_str, n2sm); msg_str_2_msg_hex(n2sm_str, n2sm);
psc.get()->n1sm = n1sm;
psc.get()->isn1sm_avaliable = true;
psc.get()->n2sm = n2sm; psc.get()->n2sm = n2sm;
Logger::amf_server().debug("n2sm size in amf_server (%d)", blength(psc.get()->n2sm)); psc.get()->isn2sm_avaliable = true;
Logger::amf_server().debug("n2sm size in amf_server(%d)", blength(psc.get()->n2sm));
itti_n1n2_message_transfer_request * itti_msg = new itti_n1n2_message_transfer_request(AMF_SERVER, TASK_AMF_APP); itti_n1n2_message_transfer_request * itti_msg = new itti_n1n2_message_transfer_request(AMF_SERVER, TASK_AMF_APP);
itti_msg->supi = ueContextId; itti_msg->supi = ueContextId;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment