LibS1AP_Steps.ttcn 89.9 KB
Newer Older
garciay's avatar
garciay committed
         */
        function f_S1APPDU_Set(
                               inout template (value) S1AP_PDU p_PDU
        ) runs on S1APComponent {
            
            if (ischosen(p_PDU.initiatingMessage)) {
                vc_sendS1AP_PDU:=valueof(p_PDU);
            }
garciay's avatar
garciay committed
            if (ischosen(p_PDU.successfulOutcome)) {
                vc_sendS1AP_PDU:=valueof(p_PDU);
            }
garciay's avatar
garciay committed
            if (ischosen(p_PDU.unsuccessfulOutcome)) {
                 vc_sendS1AP_PDU:=valueof(p_PDU);
            }
garciay's avatar
garciay committed
            
        } // End of function f_S1APPDU_Set
garciay's avatar
garciay committed
        
garciay's avatar
garciay committed
         * @desc Send S1AP PDU to protocol port
         * @param p_PDU template value message to be send
         */
garciay's avatar
garciay committed
        function f_send_S1AP_PDU(
                                 in template (value) S1AP_PDU p_PDU
        ) runs on S1APComponent {
            f_S1APPDU_Set(p_PDU);
            S1_MMEeNB_P.send(p_PDU);
garciay's avatar
garciay committed
        } // End of function f_send_S1APPDU
        
        /**
garciay's avatar
garciay committed
         * @desc Send S1AP PDU with InitiatingMessage payload from protocol port
         * @param p_initiatingMessage Send value template for InitiatingMessage message
garciay's avatar
garciay committed
         */
        function f_send_S1AP_initiatingMessage(
garciay's avatar
garciay committed
                                               in template (value) InitiatingMessage p_initiatingMessage,
                                               in template (value) Criticality p_criticality := reject
garciay's avatar
garciay committed
        ) runs on S1APComponent {
            f_send_S1AP_PDU( {initiatingMessage := p_initiatingMessage})
garciay's avatar
garciay committed
        } // End of function f_send_S1AP_initiatingMessage
garciay's avatar
garciay committed
        /**
garciay's avatar
garciay committed
         * @desc Send S1AP PDU with SuccessfulOutcome payload from protocol port
         * @param p_successfulOutcome Send value template for SuccessfulOutcome message
garciay's avatar
garciay committed
         */
        function f_send_S1AP_successfulOutcome(
                                               in template (value) SuccessfulOutcome p_successfulOutcome
garciay's avatar
garciay committed
        ) runs on S1APComponent {
            f_send_S1AP_PDU( {successfulOutcome := p_successfulOutcome})
garciay's avatar
garciay committed
        } // End of function f_send_S1AP_successfulOutcome
garciay's avatar
garciay committed
        /**
garciay's avatar
garciay committed
         * @desc Send S1AP PDU with UnsuccessfulOutcome payload from protocol port
         * @param p_unsuccessfulOutcome Send value template for UnsuccessfulOutcome message
garciay's avatar
garciay committed
         */
        function f_send_S1AP_unsuccessfulOutcome(
garciay's avatar
garciay committed
                                                 in template (value) UnsuccessfulOutcome p_unsuccessfulOutcome
        ) runs on S1APComponent {
            f_send_S1AP_PDU( {unsuccessfulOutcome := p_unsuccessfulOutcome})
garciay's avatar
garciay committed
        } // End of function f_send_S1AP_unsuccessfulOutcome 
pintar's avatar
pintar committed
        /**
         * @desc Send S1AP Message E-RAB_SetupRequest
         * @param p_value Send template with IE for E-RAB_SetupRequest
         */
        function f_send_E_RABSetupRequest(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_E_RABSetupRequest(p_value))
        } // End of function f_send_E_RABSetupRequest

        /**
         * @desc Send S1AP Message E-RAB_SetupResponse
         * @param p_value Send template with IE for E-RAB_SetupResponse
         */
        function f_send_E_RABSetupResponse(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_E_RABSetupResponse(p_value))
        } // End of function f_send_E_RABSetupResponse
pintar's avatar
pintar committed
        
        /**
         * @desc Send S1AP Message E-RAB_ReleaseRequest
         * @param p_value Send template with IE for E-RAB_ReleaseRequest
         */
        function f_send_E_RABReleaseRequest(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_E_RABReleaseRequest(p_value))
        } // End of function f_send_E_RABReleaseRequest

        /**
         * @desc Send S1AP Message E-RAB_ModifiedRequest
         * @param p_value Send template with IE for E-RAB_ModifiedRequest
         */
        function f_send_E_RABModifiedRequest(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_E_RABModifiedRequest(p_value))
        } // End of function f_send_E_RABModifiedRequest
garciay's avatar
garciay committed
        /**
         * @desc Send S1AP Message E-RAB_ModifiedInd
         * @param p_value Send template with IE for E-RAB_ModifiedInd
         */
        function f_send_E_RABModifiedInd(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_E_RABModifiedInd(p_value))
        } // End of function f_send_E_RABModifiedInd
        
        /**
         * @desc Send S1AP Message InitialContext_SetupRequest
         * @param p_value Send template with IE for InitialContext_SetupRequest
         */
garciay's avatar
garciay committed
        function f_send_InitialContext_SetupRequest(
                                                    in template (value) RecordOf_ProtocolIE p_value,
                                                    in template (value) Criticality p_criticality := reject
        ) runs on S1APComponent {
garciay's avatar
garciay committed
            f_send_S1AP_initiatingMessage(
                m_InitialContextSetupRequest(
                     p_value,
                     p_criticality
            ))
        } // End of function f_send_InitialContext_SetupRequest
        /**
         * @desc Send S1AP Message f_send_HandoverRequired
         * @param p_value Send template with IE for HandoverRequest
         */
        function f_send_HandoverRequired(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_HandoverRequired(p_value))
        } // End of function f_send_HandoverRequest
          
        /**
         * @desc Send S1AP Message f_send_HandoverRequest
         * @param p_value Send template with IE for HandoverRequest
         */
        function f_send_HandoverRequest(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_HandoverRequest(p_value))
        } // End of function f_send_HandoverRequest

        /**
         * @desc Send S1AP Message f_send_HandoverRequestAcknowledge
         * @param p_value Send template with IE for HandoverRequestAcknowledge
         */
        function f_send_HandoverRequestAcknowledge(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_HandoverRequestAcknowledge(p_value))
        } // End of function f_send_HandoverRequestAcknowledge
        /**
         * @desc Send S1AP Message f_send_HandoverCancel
         * @param p_value Send template with IE for HandoverCancel
         */
        function f_send_HandoverCancel(in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_HandoverCancel(p_value))
        } // End of function f_send_HandoverCancel
        
        /**
         * @desc Send S1AP Message Handover Cancel Acknowledge
         * @param p_value Send template with IE for Handover Cancel Acknowledge
         */
        function f_send_HandoverCancelAcknowledge(
                                          in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_HandoverCancelAck(p_value))
        } // End of function f_send_HandoverCancelAcknowledge

        /**
         * @desc Send S1AP Message ENB STATUS TRANSFER
         * @param p_value Send template with IE for ENB STATUS TRANSFER 
         */
        function f_send_eNB_Status_Transfer(
                                                 in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_eNB_Status_Transfer(p_value))
        } // End of function f_send_eNB_Status_Transfer
        
        /**
         * @desc Send S1AP Message Handover Command
         * @param p_value Send template with IE for Handover Command
         */
        function f_send_HandoverCommand(
                                          in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_HandoverCommand(p_value))
        } // End of function f_send_HandoverCommand
        
        /**
         * @desc Send S1AP Message Path Switch Request
         * @param p_value Send template with IE for Path Switch Request
         */
        function f_send_PathSwitchRequest(
                                          in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_PathSwitchRequest(p_value))
        } // End of function f_send_PathSwitchRequestAcknowledge
        
        /**
         * @desc Send S1AP Message Path Switch Request Acknowledge
         * @param p_value Send template with IE for Path Switch Request Acknowledge
         */
        function f_send_PathSwitchRequestAcknowledge(
                                          in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_PathSwitchRequestAck(p_value))
        } // End of function f_send_PathSwitchRequestAcknowledge
        
garciay's avatar
garciay committed
         * @desc Send S1AP Message S1 SETUP RESPONSE
         * @param p_value Send template with IE for S1 SETUP RESPONSE
         */
        function f_send_S1_Setup_Response(
                                          in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_s1_Setup_Response(p_value))
        } // End of function f_send_S1_Setup_Response
        
        /**
         * @desc Send S1AP Message ENB CONFIGURATION UPDATE ACKNOWLEDGE
         * @param p_value Send template with IE for ENB CONFIGURATION UPDATE ACKNOWLEDGE
         */
        function f_send_eNB_Configuration_Update_Acknowledge(
                                                             in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_successfulOutcome(m_eNB_Configuration_Update_Acknowledge(p_value))
        } // End of function f_send_eNB_Configuration_Update_Acknowledge
        
garciay's avatar
garciay committed
        /**
         * @desc Send S1AP Message RESET
         * @param p_value Send template with IE for RESET
         */
        function f_send_Reset(
                              in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_reset(p_value))
        } // End of function f_send_Reset
        
garciay's avatar
garciay committed
        /**
         * @desc Send S1AP Message S1 SETUP REQUEST
         * @param p_value Send template with IE for S1 SETUP REQUEST
         */
        function f_send_S1_Setup_Request(
                                         in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_s1_Setup_Request(p_value))
        } // End of function f_send_S1_Setup_Request
        
        /**
         * @desc Send S1AP Message ENB CONFIGURATION UPDATE
         * @param p_value Send template with IE for ENB CONFIGURATION UPDATE 
         */
        function f_send_eNB_Configuration_Update(
                                                 in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_eNB_Configuration_Update(p_value))
        } // End of function f_send_eNB_Configuration_Update
        
        /**
         * @desc Send S1AP Message MME CONFIGURATION UPDATE 
         * @param p_value Send template with IE for MME CONFIGURATION UPDATE
         */
        function f_send_MME_Configuration_Update(
                                                 in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_mME_Configuration_Update(p_value))
        } // End of function f_send_MME_Configuration_Update
        
garciay's avatar
garciay committed
        /**
         * @desc Send S1AP Message TRACE START
         * @param p_value Send template with IE for TRACE START
         */
        function f_send_Trace_Start(
                                    in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_trace_Start(p_value))
        } // End of function f_send_Trace_Start
        
        /**
         * @desc Send S1AP Message DEACTIVATE TRACE 
         * @param p_value Send template with IE for DEACTIVATE TRACE
         */
        function f_send_deactivate_Trace(
                                         in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_deactivate_Trace(p_value))
        } // End of function f_send_deactivate_Trace
        
        /**
         * @desc Send S1AP Message LOCATION REPORTING CONTROL
         * @param p_value Send template with IE for LOCATION REPORTING CONTROL
         */
        function f_send_Location_Reporting_Control(
                                                   in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_location_Reporting_Control(p_value))
        } // End of function f_send_Location_Reporting_Control
        
        /**
         * @desc Send S1AP Message LOCATION REPORT FAILURE INDICATION
         * @param p_value Receive template for LOCATION REPORT FAILURE INDICATION IEs
         */
        function f_send_Location_Report_Failure_Indication(
                                                           template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_location_Report_Failure_Indication(p_value))
        } // End of f_send_Location_Report_Failure_Indication
        
        /**
         * @desc Send S1AP Message WRITE-REPLACE WARNING REQUEST
         * @param p_value Send template with IE for WRITE-REPLACE WARNING REQUEST
         */
        function f_send_Write_Replace_Warning_Request(
                                                      in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_write_Replace_Warning_Request(p_value))
        } // End of function f_send_Write_Replace_Warning_Request
        
        /**
         * @desc Send S1AP Message WRITE-REPLACE WARNING RESPONSE
         * @param p_value Send template with IE for WRITE-REPLACE WARNING RESPONSE
         */
        function f_send_Write_Replace_Warning_Response(
                                                      in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_write_Replace_Warning_Response(p_value))
        } // End of function f_send_Write_Replace_Warning_Response
        
        /**
         * @desc Send S1AP Message KILL REQUEST
         * @param p_value Send template with IE for KILL REQUEST
         */
        function f_send_Kill_Request(
                                     in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_kill_Request(p_value))
        } // End of function f_send_Kill_Request
        
        /**
         * @desc Send S1AP Message KILL REQUEST
         * @param p_value Send template with IE for KILL REQUEST
         */
        function f_send_Kill_Response(
                                     in template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_kill_Response(p_value))
        } // End of function f_send_Kill_Response
        /**
        * @desc Send S1AP Message UE Context Release Command
        * @param p_value Send template for UE CONTEXT RELEASE REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.6 UE CONTEXT RELEASE COMMAND
        */
        function f_send_UE_Context_Release_Command(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeContextReleaseCommand(p_value))
        } // End of f_send_UE_Context_Release_Command
        /**
        * @desc Send S1AP Message UE Context Release Complete
        * @param p_value Send template for UE CONTEXT RELEASE COMPLETE
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.7 UE CONTEXT RELEASE COMPLETE
        */
        function f_send_UE_Context_Release_Complete(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeContextReleaseComplete(p_value))
        } // End of f_send_UE_Context_Release_Command
        
        /**
        * @desc Send S1AP Message UE Context Release Request
        * @param p_value Receive template for UE CONTEXT RELEASE REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.5 UE CONTEXT RELEASE REQUEST
        */
        function f_send_UE_Context_Release_Request(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeContextReleaseRequest(p_value))
        } // End of f_send_UE_Context_Release_Request
rennoch's avatar
rennoch committed
        
        /**
        * @desc Send S1AP Message UE Context Suspend Request
        * @param p_value Receive template for UE CONTEXT SUSPEND REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.15 UE CONTEXT SUSPEND REQUEST
        */
        function f_send_UE_Context_Suspend_Request(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeContextSuspendRequest(p_value))
        } // End of f_send_UE_Context_Suspend_Request
        
        /**
        * @desc Send S1AP Message UE Context Modification Request
        * @param p_value Send template for UE CONTEXT MODIFICATION REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.8 UE CONTEXT MODIFICATION COMMAND
        */
        function f_send_UE_Context_Modification_Request(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeContextModificationRequest(p_value))
        } // End of f_send_UE_Context_Modification_Request
rennoch's avatar
rennoch committed

		/**
		* @desc Send S1AP Message UE Context Modification Indication
		* @param p_value Send template for UE CONTEXT MODIFICATION INDICATION
		* @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.13 UE CONTEXT MODIFICATION INDICATION
		*/
		function f_send_UE_Context_Modification_Indication(
										template (value) RecordOf_ProtocolIE p_value
		) runs on S1APComponent {
			f_send_S1AP_initiatingMessage(m_UeContextModificationIndication(p_value))
		} // End of f_send_UE_Context_Modification_Request

garciay's avatar
garciay committed
       /**
        * @desc Send S1AP Message UE Context Resume Request
        * @param p_value Send template for UE CONTEXT RESUME REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.17 UE CONTEXT RESUME REQUEST
        */
        function f_send_Ue_Context_Resume_Request(
                                                  in template (value) RecordOf_ProtocolIE p_value,
                                                  in template (value) Criticality p_criticality := reject
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(
                m_UeContextResumeRequest(
                    p_value, 
                    p_criticality
                )
            )
        } // End of f_send_UE_Context_Modification_Request
rennoch's avatar
rennoch committed

        /**
        * @desc Send S1AP Message UE Radio Capability Match Request
        * @param p_value Send template for UE_RADIO_CAPABILITY_MATCH_REQUEST
        * @see ETSI TS 136 413 V13.4.0 Clause 9.1.4.11 UE CONTEXT MODIFICATION COMMAND
        */
        function f_send_UE_Radio_Capability_Match_Request(
                                        template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_UeRadioCapabilityMatchRequest(p_value))
        } // End of f_send_UE_Radio_Capability_Match_Request
garciay's avatar
garciay committed
        
        /**
         * @desc Send S1AP Message UPLINK NAS TRANSPORT
         * @param p value Send template for UPLINK NAS TRANSPORT IEs
         */
        function f_send_Uplink_NAS_Transport(
                                             template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_uplink_nAS_Transport(p_value))
        } // End of f_send_Uplink_NAS_Transport
        
        /**
         * @desc Send S1AP Message INITIAL UE MESSAGE
         * @param p_value Receive template for INITIAL UE MESSAGE IEs
         */
        function f_send_Initial_UE_Message(
                                           template (value) RecordOf_ProtocolIE p_value
        ) runs on S1APComponent {
            f_send_S1AP_initiatingMessage(m_initial_uE_Message(p_value))
        } // End of f_send_Initial_UE_Message
        
garciay's avatar
garciay committed
    } // End of group sendPDU
    /**
     * @desc Setup full procedure functions
garciay's avatar
garciay committed
     * @see ETSI TS 136 413 V13.4.0 Clause 8.1 List of S1AP Elementary procedures
     */
    group fullProcedures {
        
        /**
         * @desc Setup a full E-RAB Setup procedure
         */
        function f_rABSetupRequest_recvResponse() runs on S1APComponent {
            f_send_E_RABSetupRequest(m_E_RABSetupReqIEs(
                vc_MME_UE_ID,
garciay's avatar
garciay committed
                vc_eNB_UE_ID,
                {
                     m_E_RABToBeSetupItemBearerSUReq(1),
                     m_E_RABToBeSetupItemBearerSUReq(
                        2,
                        m_e_RABlevelQoSParameters
                        (255)
                     )
                 }
            ));
garciay's avatar
garciay committed
            f_recv_E_RABSetupResponse(mw_E_RABSetupResIEs_FailedToSetupList_E_RABSetupItemBearerSURes(
garciay's avatar
garciay committed
                vc_eNB_UE_ID,
                {
                      mw_E_RABSetupItemBearerSURes(1)
                },
                {
                    mw_E_RABItem(
                        2,
                        {
                            radioNetwork :=not_supported_QCI_value
                        }
                    )
                }
            ));
        } // End of function f_rABSetupRequest_recvResponse
        
        /**
         * @desc Setup a full E-RAB Setup procedure
         */
        function f_rABSetupRequest_sendResponse() runs on S1APComponent {
            
            f_recv_E_RABSetupRequest(mw_E_RABSetupReqIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                { mw_E_RABToBeSetupItemBearerSUReq(?,?,?,?,?) }
            ));
                             
            f_send_E_RABSetupResponse(m_E_RABSetupResIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                {m_E_RABSetupItemBearerSURes}
            ));
        } // End of function f_rABSetupRequest_sendResponse

        /**
         * @desc Setup an initial Context E-RAB Setup procedure
         */
        function f_rABInitialContextSetup(
                     in template (value) RecordOf_E_RABToBeSetupItemCtxtSUReq p_RecordOf_E_RABToBeSetupItemCtxt_value
                ) runs on S1APComponent {
            f_send_InitialContext_SetupRequest(m_InitialContextSetupReqIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                m_UEAggregateMaximumBitrate(1,1),
                p_RecordOf_E_RABToBeSetupItemCtxt_value,
                m_UESecurityCapabilities(PX_ENCRYPTION_ALGORITHM,
                                         PX_INTEGRITY_PROTECTION_ALGORITHM),
                m_securityKey
            ));

            f_recv_InitialContext_SetupResponse(mw_InitialContextSetupResIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                {
                    mw_E_RABSetupItemBearerSURes
                }
            ));
        } // End of function f_rABInitialContextSetup

        
        /**
         * @desc Setup a full E-RAB Release procedure
         */
        function f_rABSetupRelease() runs on S1APComponent {
garciay's avatar
garciay committed
            // Local variables
            const E_RAB_ID c_E_RAB_ID_A := 0;
            
            f_send_E_RABReleaseRequest(m_E_RABReleaseReqIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                {
                    m_E_RABItem(
                        c_E_RAB_ID_A,
garciay's avatar
garciay committed
                        m_cause_ran(user_inactivity) 
garciay's avatar
garciay committed
                    )
                }
            ));
                
            f_recv_E_RABReleaseResponse(mw_E_RABReleaseResIEs(
                vc_MME_UE_ID,
                vc_eNB_UE_ID,
                {
                    mw_E_RABItem(
                        c_E_RAB_ID_A
                    )
                }
            ));
garciay's avatar
garciay committed
        /**
         * @desc Initiate an Handover procedure
         */
        function f_initiate_handover() runs on S1APComponent {
garciay's avatar
garciay committed
            // Local variables
            const Source_ToTarget_TransparentContainer c_source_ToTarget_TransparentContainer := '12121212'O;
            
            f_send_HandoverRequest(
                m_HandoverReqIEs(
                    vc_MME_UE_ID,
                    intralte,                               // Handover Type
                    m_cause_ran(
                        successful_handover
                    ),                                      // Cause
                    m_UEAggregateMaximumBitrate(1,1),       // UE Aggregate_Max_Bit_Rate
                    {
                        m_E_RABToBeSetupItemHOReq (
                            -,
                            -,
                            -,
                            m_e_RABlevelQoSParameters (5)
                        )
                    },                                      // E_RabsToBeSetupList
                    c_source_ToTarget_TransparentContainer, // SourceToTargetTransparentContainer
                    m_UESecurityCapabilities(
                        PX_ENCRYPTION_ALGORITHM,
                        PX_INTEGRITY_PROTECTION_ALGORITHM
garciay's avatar
garciay committed
                    ),                                      // UeSecurityCapabilities
                    m_securityContext                       // SecurityContext
            ));
garciay's avatar
garciay committed
        } // End of function f_initiate_handover
        
        /**
         * @desc Initiate a Trace Start procedure
         */
        function f_initiate_traceStart() runs on S1APComponent {
            f_send_Trace_Start(
                m_trace_StartIEs(
                    m_traceActivation(
                        PX_EUTRAN_TRACE_ID,
                        PX_INTERFACES_TO_TRACE,
                        PX_TRACE_DEPTH,
                        PX_TRANSPORT_LAYER_ADDRESS
            )));
garciay's avatar
garciay committed
        } // End of function f_initiate_traceStart
        
        /**
         * @desc Initiate a Deactivate Trace procedure
         */
        function f_initiate_deactivateTrace() runs on S1APComponent {
garciay's avatar
garciay committed
            f_send_deactivate_Trace(
                m_deactivate_TraceIEs(
                    vc_MME_UE_ID,
                    vc_eNB_UE_ID,
                    PX_EUTRAN_TRACE_ID
            ));
garciay's avatar
garciay committed
        } // End of function f_initiate_deactivateTrace
        
        /**
         * @desc Initiate a an Write-Replace Warning Request procedure
         */
        function f_writeReplaceWarningExchanges() runs on S1APComponent {
garciay's avatar
garciay committed
            if (fx_MME_Write_Replace_Warning_procedure() == true) {
                f_recv_Write_Replace_Warning_Request(
                    mw_write_Replace_Warning_RequestIEs(
                        PX_MESSAGE_IDENTIFIER,
                        PX_SERIAL_NUMBER,
                        PX_REPETITION_PERIOD, 
                        PX_NUMBER_OF_BROADCASTS_REQUESTED
                ));
                f_send_Write_Replace_Warning_Response(
                    m_write_Replace_Warning_ResponseIEs(
                        PX_MESSAGE_IDENTIFIER,
                        PX_SERIAL_NUMBER
                ));
                f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); 
            }
garciay's avatar
garciay committed
        } // End of function f_writeReplaceWarningExchanges
        
    } // End of group fullProcedures
    
    group externalFunctions {
        
            /**
             * @desc Trigger a Handover preparation procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Handover_preparation_procedure() return boolean;
            
            /**
             * @desc Trigger a Handover notification procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Handover_notification_procedure() return boolean;
            
            /**
             * @desc Trigger a Path switch request procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Path_switch_request_procedure() return boolean;
            
            /**
             * @desc Trigger an INITIAL UE MESSAGE procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Initiate_NAS_transport_procedure() return boolean;
            
            /**
             * @desc Trigger an INITIAL UE MESSAGE procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_NAS_transport_procedure() return boolean;
            
            /**
             * @desc Trigger an S1 SETUP procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_S1_Setup_Request_procedure() return boolean;
            
            /**
             * @desc Trigger an eNB Configuration Update procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Configuration_Update_procedure() return boolean;
            
            /**
             * @desc Trigger an an Overload Start procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Overload_Start_procedure() return boolean;
            
            /**
             * @desc Trigger an an Overload Stop procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Overload_Stop_procedure() return boolean;
            
            /**
             * @desc Trigger an Error Indication procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Error_Indication_procedure() return boolean;
            
            /**
             * @desc Trigger a RESET procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Reset_procedure() return boolean;
            
            /**
             * @desc Trigger a CDMA2000 to be forwarded procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Uplink_S1_CDMA2000_Tunnelling_procedure() return boolean;
            
            /**
             * @desc Trigger a UE CAPABILITY INFO INDICATION procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_UE_Capability_Info_Indication_procedure() return boolean;
            
            /**
             * @desc Force the UE to be registered to a new cell
             * @return true on success, false otherwise
             */
            external function fx_move_UE_to_new_cell() return boolean;
            
            /**
             * @desc Check htat UE stop reporting at change of serving cell
             * @return true on success, false otherwise
             */
            external function fx_check_UE_stops_reporting() return boolean;
            
            /**
             * @desc Trigger a PWS Restart Indication procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_PWS_Restart_Indication_procedure() return boolean;
            
            /**
             * @desc Trigger a PWS Failure Indication procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_PWS_Failure_Indication_procedure() return boolean;
            
            /**
             * @desc Trigger an ENB direct information Transfer procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Direct_Information_Transfer_procedure() return boolean;
            
            /**
             * @desc Trigger an ENB Configuration Transfer procedure
             * @return true on success, false otherwise
             */
            external function fx_eNB_Configuration_Transfer_procedure() return boolean;
            
            /**
             * @desc Trigger a LPPa Transport procedure using a UE associated signalling on eNodeB
             * @param p_associated_signalling_mode Set to true for an associated signalling mode, false otherwise
             * @return true on success, false otherwise
             */
            external function fx_eNB_LPPa_Transport_procedure_ind(
                                                                  in boolean p_associated_signalling_mode
            ) return boolean;
            
        } // End of group eNBRole
        
        group mmeRole {
            
            /**
             * @desc Trigger a Handover preparation procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Handover_preparation_procedure() return boolean;
            
            /**
             * @desc Trigger a Handover notification procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Handover_notification_procedure() return boolean;
                        
            /**
             * @desc Trigger a PAGING event
             * @return true on success, false otherwise
             */
            external function fx_MME_Paging_procedure() return boolean;
            
            /**
             * @desc Trigger a DOWNLINK NAS TRANSPORT event
             * @return true on success, false otherwise
             */
            external function fx_MME_Downlink_NAS_Transport_procedure() return boolean;
            
            /**
             * @desc Trigger a REROUTE NAS REQUEST event
             * @return true on success, false otherwise
             */
            external function fx_MME_Reroute_NAS_Request_procedure() return boolean;
            
            /**
             * @desc Trigger a RESET event
             * @return true on success, false otherwise
             */
            external function fx_MME_Reset_procedure() return boolean;
            
            /**
             * @desc Trigger an ERROR INDICATION event
             * @return true on success, false otherwise
             */
            external function fx_MME_Error_Indication_procedure() return boolean;
            
            /**
             * @desc Trigger a CDMA2000 signalling event
             * @return true on success, false otherwise
             */
            external function fx_MME_Downlink_S1_CDMA2000_Tunnelling_procedure() return boolean;
            
            /**
             * @desc Trigger a Trace Start procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Trace_Start_procedure() return boolean;
            
            /**
             * @desc Trigger a Deactivate Trace procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Deactivate_Trace_procedure() return boolean;
            
            /**
             * @desc Trigger a Location Reporting Control procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Location_Reporting_Control_procedure() return boolean;
            
            /**
             * @desc Trigger a Write-Replace Warning procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Write_Replace_Warning_procedure() return boolean;
            
            /**
             * @desc Trigger a Kill procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Kill_procedure() return boolean;
            
            /**
             * @desc Trigger an MME Direct Information Transfer procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Direct_Information_Transfer_procedure() return boolean;
            
            /**
             * @desc Trigger an MME Configuration Transfer procedure
             * @return true on success, false otherwise
             */
            external function fx_MME_Configuration_Transfer_procedure() return boolean;
            
            /**
             * @desc Trigger a LPPa Transport procedure using a UE associated signalling on MME
             * @param p_associated_signalling_mode Set to true for an associated signalling mode, false otherwise
             * @return true on success, false otherwise
             */
            external function fx_MME_LPPa_Transport_procedure_ind(
                                                                  in boolean p_associated_signalling_mode
            ) return boolean;
            /**
             * @desc Trigger a E-RAB Release procedure
             * @return true on success, false otherwise
             */
			external function fx_eNB_erab_Release_indication_procedure() return boolean;
ulrichst's avatar
ulrichst committed
            
            external function fx_eNB_erab_modification_indication_procedure () return boolean;
        } // End of group mmeRole
garciay's avatar
garciay committed
    group preambles {
        
        group preamble_S1AP{
garciay's avatar
garciay committed
            
            /**
             * @desc 
             * @verdict 
             */
            function f_preambleS1AP_MME()
            runs on S1APComponent {
garciay's avatar
garciay committed
                // Nothing to do
garciay's avatar
garciay committed
            } // End of function f_preambleS1AP_MME
garciay's avatar
garciay committed
            /**
             * @desc 
             * @verdict 
             */
            function f_preambleS1AP_eNB()
            runs on S1APComponent {
garciay's avatar
garciay committed
                // Nothing to do
garciay's avatar
garciay committed
            } // End of function f_preambleS1AP_eNB
            
        } // End of group preamble_S1AP
        
garciay's avatar
garciay committed
    } // End of group preambles
garciay's avatar
garciay committed
    group postambles {
garciay's avatar
garciay committed
        
        group postamble_S1AP{
garciay's avatar
garciay committed
            
            /**
             * @desc 
             * @verdict 
             */
            function f_postambleS1AP_eNB()
            runs on S1APComponent {
garciay's avatar
garciay committed
                // Nothing to do
garciay's avatar
garciay committed
            } // End of function f_postambleS1AP_eNB
            
            /**
             * @desc 
             * @verdict 
             */
            function f_postambleS1AP_MME()
            runs on S1APComponent {
                // Nothing to do
            } // End of function f_postambleS1AP_MME
            
garciay's avatar
garciay committed
        } // End of group postamble_S1AP
        
garciay's avatar
garciay committed
    } // End of group postambles
    
    /**
     * @desc Global 'altstep' statements description
     */
    group globalSteps {
        
        /**
         *  @desc    This is a test step that init S1AP component
         */
        function f_S1AP_Init_Component()
        runs on S1APComponent {
garciay's avatar
garciay committed
            // Nothing to do
garciay's avatar
garciay committed
        } // End of function  f_S1AP_Init_Component
        
        /**
         * @desc Component termination
         */
        function f_S1AP_terminate_component()
        runs on S1APComponent {
            
            log("component terminated - forced!");
            deactivate;
            stop;
        } // End of function f_S1AP_terminate_component
        
        /**
         * @desc Component termination
         */
        function f_componentStop()
        runs on S1APComponent {
            
            syncPort.send(m_syncClientStop);
            S1_MMEeNB_P.clear;
            stop;
        } // End of function f_componentStop
        
        /**
         * @desc Original copied from older LibCommon_VerdictControl
         */
        function f_getVerdict() // FIXME Are you sure we really need it???
        return FncRetCode {
            
            var FncRetCode v_ret := e_error;
            if (getverdict == pass or getverdict == none) {
                v_ret := e_success;
            }
            return v_ret;
        } // End of function 
        
    } // End of group globalSteps