Commit 188f5e21 authored by juvancic's avatar juvancic
Browse files

updated REG_REJ_msg

parent 28c6d748
Loading
Loading
Loading
Loading
+122 −151
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ module NG_NAS_TCFunctions {
    // LibNGAP
    import from NGAP_IEs language "ASN.1:2002" all;
    import from NGAP_Constants language "ASN.1:2002" all;
    import from NGAP_PDU_Descriptions language "ASN.1:2002" all;

    import from LibNGAP_Pixits all;
    import from LibNGAP_Templates all;
@@ -40,6 +41,56 @@ module NG_NAS_TCFunctions {
    import from NGAP_Steps all;
    //import from NGAP_Pixits all;

    function f_NASPDU_Get(inout NGAP_PDU p_PDU) runs on NGNASComponent {

            vc_recvNGAP_PDU := p_PDU;

            if (ischosen(p_PDU.initiatingMessage)) {
                // Nothing to do
                if (match(vc_recvNGAP_PDU.initiatingMessage,mw_n2_NGSetupRequest_base)){
                    var integer numOfIEs := lengthof(vc_recvNGAP_PDU.initiatingMessage.value_.NGSetupRequest.protocolIEs)
                    //log("Number of IEs:",numOfIEs);
                    for (var integer i:=0;i<numOfIEs;i:=i+1){
                        //log(vc_recvNGAP_PDUDefault.initiatingMessage.value_.NGSetupRequest.protocolIEs[i]);
                    }
                }else if (match(vc_recvNGAP_PDU.initiatingMessage,mw_n2_initialUeMessage_base_nas)){
                    var integer numOfIEs := lengthof(vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs)
                   
                    for (var integer i:=0;i<numOfIEs;i:=i+1){
                   
                        if ( (vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[i].id) == 38 /*id_NAS_PDU*/){
                            vc_recvNAS_PDU := vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[i].value_.nAS_PDU;
                            log("****************************************");
                            log("InitialUEMessage - NAS-PDU! ");
                            log( vc_recvNAS_PDU );
                            log("****************************************");

                        }
                    }
                }else if (match(vc_recvNGAP_PDU.initiatingMessage,mw_n2_DownlinkNASTransport_base_nas)){
                    var integer numOfIEs := lengthof(vc_recvNGAP_PDU.initiatingMessage.value_.DownlinkNASTransport.protocolIEs)
                   
                    for (var integer i:=0;i<numOfIEs;i:=i+1){
                   
                        if ( (vc_recvNGAP_PDU.initiatingMessage.value_.DownlinkNASTransport.protocolIEs[i].id) == 38 /*id_NAS_PDU*/){
                            vc_recvNAS_PDU := vc_recvNGAP_PDU.initiatingMessage.value_.DownlinkNASTransport.protocolIEs[i].value_.nAS_PDU;
                            log("****************************************");
                            log("DownlinkNASTransport - NAS-PDU! ");
                            log( vc_recvNAS_PDU );
                            log("****************************************");

                        }
                    }
                }
            }
            if (ischosen(p_PDU.successfulOutcome)) {
                // Nothing to do
            }
            if (ischosen(p_PDU.unsuccessfulOutcome)) {
                 // Nothing to do
            }
        } // End of function f_NASPDU_Get


    // interface at AMF
    group TP_AMF_NGAP {
@@ -277,106 +328,12 @@ module NG_NAS_TCFunctions {
                log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                // Body
                f_send_NGAP_PDU(
                    m_ngap_initMsg(
                        m_n2_NGSetupRequest(
                                m_globalRANNodeID_globalGNB_ID(
                                    m_ie_globalGnbId(
                                    PX_PLMN_IDENTITY,
                                    PX_GNB_ID,//'0000000000000000000000'B,//in template (value) bitstring p_gnbId,
                                    -//in template (omit) GlobalGNB_ID.iE_Extensions p_iE_Extensions := omit
                            )),
                            {
                                m_supportedTAItem(
                                    PX_TACode,
                                    {
                                        m_ie_broadcastPLMNItem(
                                            PX_PLMN_IDENTITY,//m_ie_pLMNIdentity('00f110'O),
                                            {
                                                m_sliceSupportItem(
                                                        m_s_NSSAI(
                                                            PX_SST,
                                                            PX_SD,//      in template (omit) SD p_sD := omit,
                                                            -//      in template (omit) S_NSSAI.iE_Extensions p_iE_Extensions := omit
                                                        ),
                                                        -//in template (omit) SliceSupportItem.iE_Extensions p_iE_Extensions := omit
                                                    )
                                            }
                                        )
                                    },//in template (value) BroadcastPLMNList p_broadcastPLMNList,
                                    -//in template (omit) SupportedTAItem.iE_Extensions p_iE_Extensions := omit
                                )
                            },
                            PX_PAGING_DRX
                        )
                    )
                );
                
                //f_recv_NGAP_PDU(
                //    mw_ngap_unsuccMsg(
                //        mw_n2_NGSetupFailure(
                //            mw_cause_radioNetwork(
                //                mww_causeRadioNetwork(?)
                //            )
                //        )
                //    )

                //);

                 f_recv_NGAP_PDU(
                     mw_ngap_succMsg(
                         mw_n2_NGSetupResponse(
                         ?,
                         {
                             mw_servedGUAMIItem(
                             mw_gUAMI(
                                 ?,//template (present) PLMNIdentity p_pLMNIdentity := ?,
                                 ?,//template (present) AMFRegionID p_aMFRegionID := ?,
                                 ?,//template (present) AMFSetID p_aMFSetID := ?,
                                 ?,//template (present) AMFPointer p_aMFPointer := ?,
                                 *//template GUAMI.iE_Extensions p_iE_Extensions := *
                             ),//template (present) GUAMI p_gUAMI := ?,
                             *,//template AMFName p_backupAMFName := *,
                             *//template ServedGUAMIItem.iE_Extensions p_iE_Extensions := *
                             )
                         },//template (present) ServedGUAMIList p_servedGUAMIList := ?,
                         ?,//template (present) RelativeAMFCapacity p_relativeAmfCap:= ?,
                         {
                             mw_pLMNSupportItem(
                             ?,//template (present) PLMNIdentity p_pLMNIdentity := ?,
                             {
                                 mw_sliceSupportItem(
                                 mw_s_NSSAI(
                                     ?,//template (present) SST p_sST := ?,
                                     *,//template SD p_sD := *,
                                     *//template S_NSSAI.iE_Extensions p_iE_Extensions := *
                                 ),//template (present) S_NSSAI p_s_NSSAI := ?,
                                 ?//template SliceSupportItem.iE_Extensions p_iE_Extensions := *
                                 )
                             },//template (present) SliceSupportList p_sliceSupportList := ?,
                             *//template PLMNSupportItem.iE_Extensions p_iE_Extensions := *
                             )
                         }//template (present) PLMNSupportList p_plmnSuppList := ?
                         )
                     )
                 );

                //f_recv_NGAP_PDU(?);

                vt_NgNasUl_Msg := m_NG_REGISTRATION_REQUEST(
                vt_NgNasUl_Msg := 
                    m_NG_REGISTRATION_REQUEST(
                        {'0'B,'001'B},//in template (value) RegistrationType p_RegistrationType,
                        '111'B,//in template (value) NAS_KsiValue p_KeySetId,
                        '0'B,//in template (value) B1_Type p_Tsc,
                                    /*{                              // 24.501 cl. 9.11.3.4
                                        iei:=omit,
                                        iel:='0002'O,
                                        idDigit1:='0000'B,                // 1st identitity digit
                                        oddEvenInd:='0'B,              // Odd/even indicator or Spare
                                        typeOfId:='000'B,                // Type of identity
                                        //otherDigits:='00'O// length (1..infinity) optional  // Other identity digits, could be any length @sic R5-192389, @sic R5w190307 sic@ sic@
                                        otherDigits:='00f110214300014444333020'O
                                    }*/
                                    m_NG_MobileIdentitySUCI('0000'B,'00f110214300014444330302'O)//in template (value) NG_MobileIdentity p_MobileId,
                        m_NG_MobileIdentitySUCI('0000'B,'00f110214300014444330302'O)//in template (value) NG_MobileIdentity p_MobileId,  // 24.501 cl. 9.11.3.4
                        
                        /* in template (omit) NAS_KeySetIdentifier p_NonCurrentKSI := omit,
                        in template (omit) NG_GMM_Cap p_GMM_Cap := omit,
@@ -418,6 +375,7 @@ module NG_NAS_TCFunctions {
                        in template (omit) PEIPS_AssistInfo p_RequestedPEIPS_AssistInfo := omit,
                        in template (omit) GPRS_Timer3 p_T3512 := omit */
                    )

                vc_sendNAS_PDU := bit2oct(encvalue( vt_NgNasUl_Msg ));
                var bitstring s := encvalue( vt_NgNasUl_Msg );
                //int i := decvalue(encvalue( vt_NgNasUl_Msg),vt_NgNasUl_Msg);
@@ -442,12 +400,25 @@ module NG_NAS_TCFunctions {
                    ))
                );

                f_recv_NGAP_PDU(?);

                f_recv_NGAP_PDU(
                    mw_ngap_initMsg(
                        mw_n2_DownlinkNASTransport(
                            ?,//template (present) AMF_UE_NGAP_ID p_amfUeNgapID := ?,
                            ?,//template (present) RAN_UE_NGAP_ID p_ranUeNgapID := ?,
                            ?//template (present) NAS_PDU p_nasPdu := ?
                    ))
                );

                log(vc_recvNGAP_PDU);
                f_NASPDU_Get(vc_recvNGAP_PDU);
                s := oct2bit(vc_recvNAS_PDU);
                log(s);
                var NG_NAS_DL_Message_Type recdl;
                var integer ir;
                ir := decvalue(s,recdl);
                log(ir);
                log(recdl);
               
                //f_send_NGAP_PDU(m_ngap_initMsg(/*initiating msgtemplate*/));
                //f_recv_NGAP_PDU(?);

                f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");