lte/gateway/c/core/oai/tasks/amf/amf_smf_send.cpp
/***************************************************************************
**                                                                        **
** Name:    amf_smf_validate_context()                                    **
**                                                                        **
** Description: function to check if max PDU sessions reached             **
**                                                                        **
**                                                                        **
***************************************************************************/


function to check if max PDU sessions reached
function to check if max PDU sessions reached
M5GMmCause amf_smf_validate_context(
    amf_ue_ngap_id_t ue_id, ULNASTransportMsg* msg) {
  M5GMmCause mm_cause = M5GMmCause::UNKNOWN_CAUSE;
  ue_m5gmm_context_s* ue_context = amf_ue_context_exists_amf_ue_ngap_id(ue_id);
  M5GRequestType requestType =
      static_cast<M5GRequestType>(msg->request_type.type_val);
  if ((N1_SM_INFO == msg->payload_container_type.type_val) &&
      ((M5GRequestType::INITIAL_REQUEST == requestType) ||
       (M5GRequestType::EXISTING_PDU_SESSION == requestType))) {
    if (ue_context->amf_context.smf_ctxt_map.size() >=
        MAX_UE_PDU_SESSION_LIMIT) {
      mm_cause = M5GMmCause::MAX_PDU_SESSIONS_REACHED;
    }
  }
  return mm_cause;
}
M5GMmCause amf_smf_validate_context ( amf_ue_ngap_id_t ue_id , ULNASTransportMsg * msg ) { M5GMmCause mm_cause = M5GMmCause :: UNKNOWN_CAUSE ; ue_m5gmm_context_s * ue_context = amf_ue_context_exists_amf_ue_ngap_id ( ue_id ) ; M5GRequestType requestType = static_cast < M5GRequestType > ( msg -> request_type . type_val ) ; if ( ( N1_SM_INFO == msg -> payload_container_type . type_val ) && ( ( M5GRequestType :: INITIAL_REQUEST == requestType ) || ( M5GRequestType :: EXISTING_PDU_SESSION == requestType ) ) ) { if ( ue_context -> amf_context . smf_ctxt_map . size ( ) >= MAX_UE_PDU_SESSION_LIMIT ) { mm_cause = M5GMmCause :: MAX_PDU_SESSIONS_REACHED ; } } return mm_cause ; }
Name:    amf_smf_validate_context()
Name : amf_smf_validate_context ()
/*
   * 1) the Payload container type IE is set to "N1 SM information" and
   * 2) the Request type IE is set to "initial request" or "existing PDU
   * session" the AMF determines that the PLMN's maximum number of PDU sessions
   * has already been reached for the UE, the AMF shall send back to the UE the
   * 5GSM message which was not forwarded and 5GMM cause #65
   */