Commit ff1aee0f authored by garciay's avatar garciay
Browse files

Editorial review:

1) Add ETSI copyright
2) Rename Types -> TypesAndValues, PIXITS -> Pixits
3) Replace TAB by SPACES
4) Formatting
parent ba072239
Loading
Loading
Loading
Loading
+68 −57
Original line number Diff line number Diff line
/**
 *	@author 	STF 519
 *  @version    $Id: $
 *    @author   ETSI / STF519
 *    @version  $URL:$
 *              $Id:$
 *    @desc     This module provides the types used by the test component for S1AP tests.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI TS 136 413 / 3GPP TS 36.413 version 13.4.0 Release 13
 */
module LibS1AP_Interface {
    
module LibS1AP_Interface
{
    // LibCommon
    import from LibCommon_Sync {type SelfSyncComp; 
                                modulepar PX_TSYNC_TIME_LIMIT;};
    import from LibCommon_BasicTypesAndValues {type UInt32;};
    import from LibCommon_Sync all;
    import from LibCommon_BasicTypesAndValues all;
    
    // LibS1AP
    import from S1AP_Constants language "ASN.1:1997" all;
@@ -18,19 +22,23 @@ module LibS1AP_Interface
    import from S1AP_IEs language "ASN.1:1997" all;
    import from S1AP_PDU_Contents language "ASN.1:1997" all;
    import from S1AP_PDU_Descriptions language "ASN.1:1997" all;
    import from LibS1AP_PIXITS all;
    
	//import from LibS1AP_TypesAndValues all;
    group portDefinitions {
        
	import from LibS1AP_PIXITS all;
        type port S1APPort message {
            inout S1AP_PDU
        } 
        
    } // End of group portDefinitions 
    
    type port S1APPort message {inout S1AP_PDU}; 
    group interfacePorts {
        
    type component S1APComponent extends SelfSyncComp
    {
      //port
        type component S1APComponent extends SelfSyncComp {
            // Port
            port S1APPort S1_MMEeNB_P;
            
	  //global variables
            // Global variables
            var charstring vc_ETS_address   := "";      //defined in init
            var charstring vc_ETS_address2  := "";      //defined in init
            var integer vc_ETS_port         := 3868;    //defined in init
@@ -42,19 +50,22 @@ module LibS1AP_Interface
            var S1AP_PDU vc_recvS1AP_PDU ;
            var S1AP_PDU vc_recvS1AP_PDUDefault ; //global variable defined to save Dimeter message received within default altstep
            
      //init of values at component started
            // Init of values at component started
            // TODO:
            
      //general timers
            // General timers
            timer tc_wait  := PX_S1AP_TWAIT;
            timer tc_delay := 0.3;  // delay next Request
            
      // variables for storing default references
            // Variables for storing default references
            var default     vc_default_s1ap;
            var default     vc_def_catchSyncStop_s1ap;
            
            //var boolean vc_isAF := false;
            var boolean vc_serverStop:=false;
  } // end S1APComponent
            
} // end module LibS1AP_Interface
 No newline at end of file
        } // End of type component S1APComponent
        
    } // End of group interfacePorts 
    
} // End of module LibS1AP_Interface

ttcn3/LibS1AP/LibS1AP_PIXITS.ttcn

deleted100644 → 0
+0 −35
Original line number Diff line number Diff line
/**
 *	@author 	STF 519
 *  @version    $Id: $
 *	@desc		This module provides PIXITS used by the test component for S1AP tests.
 */

module LibS1AP_PIXITS
{
	type enumerated TransportProtocol{
	    UDP_E,
	    TCP_E,
	    SCTP_E
	}
	
    group S1AP_PIXIT_Parameters{

      /** @desc	boolean (This is an operator option, not a protocol option),
                  True, if IPv6 addresses are used
      */
      modulepar boolean PX_IPv6 	:= true;
	  
	  /** @desc enumerated (This is an operator option, not a protocol option),
      */
      modulepar TransportProtocol PX_S1AP_TRANSPORT_PROTOCOL := SCTP_E;

	}//group S1AP_PIXIT_Parameters

    group S1AP_Timers{

        /** @desc	float for TWait default value for waiting an operator action
        */
        modulepar float    PX_S1AP_TWAIT:= 30.0;
    }//group S1AP_Timers

} // end module LibS1AP_PIXITS
 No newline at end of file
+43 −0
Original line number Diff line number Diff line
/**
 *    @author   ETSI / STF519
 *    @version  $URL:$
 *              $Id:$
 *    @desc     This module provides PixitS used by the test component for S1AP tests.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI TS 136 413 / 3GPP TS 36.413 version 13.4.0 Release 13
 */
module LibS1AP_Pixits {
    
    type enumerated TransportProtocol {
        UDP_E,
        TCP_E,
        SCTP_E
    }
    
    group S1AP_Pixit_Parameters {
        
        /** 
         * @desc    boolean (This is an operator option, not a protocol option), True, if IPv6 addresses are used
         */
        modulepar boolean PX_IPv6     := true;
        
        /** 
         * @desc enumerated (This is an operator option, not a protocol option)
         */
        modulepar TransportProtocol PX_S1AP_TRANSPORT_PROTOCOL := SCTP_E;
        
    } // End of group S1AP_Pixit_Parameters
    
    group S1AP_Timers {
        
        /** @desc float for TWait default value for waiting an operator action
         */
        modulepar float    PX_S1AP_TWAIT:= 30.0;
        
    }  // End of group S1AP_Timers
    
} // End of module LibS1AP_Pixits
+257 −228
Original line number Diff line number Diff line
/**
 *    @author     STF 519
 *  @version    $Id: $
 *    @desc        This module provides functions used in S1AP
 *    @author   ETSI / STF519
 *    @version  $URL:$
 *              $Id:$
 *    @desc     This module provides functions used in S1AP.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI TS 136 413 / 3GPP TS 36.413 version 13.4.0 Release 13
 */
module LibS1AP_Steps {
    
module LibS1AP_Steps
{
    //LibCommon
    import from LibCommon_Sync all;
    import from LibCommon_VerdictControl {type FncRetCode;
                                          function f_setVerdict;};
    import from LibCommon_BasicTypesAndValues {type UInt32;};
    import from LibCommon_VerdictControl all;
    import from LibCommon_BasicTypesAndValues all;
    
    // LibS1AP
    //import from LibS1AP_TypesAndValues all;
    import from S1AP_PDU_Descriptions language "ASN.1:1997" all;
    import from LibS1AP_Interface all;
    import from LibS1AP_PIXITS all;
    import from LibS1AP_Pixits all;
    import from LibS1AP_Templates all;
    
//    import from S1AP_Constants language "ASN.1:1997" all;
//    import from S1AP_CommonDataTypes language "ASN.1:1997" all;
//    import from S1AP_Containers language "ASN.1:1997" all;
//    import from S1AP_IEs language "ASN.1:1997" all;
//    import from S1AP_PDU_Contents language "ASN.1:1997" all;
    import from S1AP_PDU_Descriptions language "ASN.1:1997" all;

    group CommonFunctions{
    
        /**
@@ -32,30 +29,29 @@ module LibS1AP_Steps
        * @desc  f_gtZero, return true if value of p_int greater than 0
        * @param p_int - integer value
        */
        function f_gtZero(integer p_int)
        return boolean
        {
        function f_gtZero(
                          in integer p_int
        ) return boolean {
            if (p_int > 0){
                return true;
            }
            else{
                return false;
            }
        }
        } // End of function f_gtZero
        
        /**
        *
         * @desc  f_Inc, return incremented value of p_int 0
         * @param p_int - integer value
         */
        function f_inc( inout UInt32 p_int)
        return UInt32
        {
        function f_inc(
                       inout UInt32 p_int
        ) return UInt32 {
            p_int:=p_int + 1;
            return p_int;
        }
        } // End of function f_inc
        
    }//end group CommonFunctions
    } // End of group CommonFunctions
    
    group ReceivePDU {
        
@@ -63,8 +59,9 @@ module LibS1AP_Steps
         *  @desc    This is a test step that assign common S1AP
         *  @param
         */
		 function f_S1APPDU_Get( inout S1AP_PDU p_PDU)
		 runs on S1APComponent {
        function f_S1APPDU_Get(
                               inout S1AP_PDU p_PDU
        ) runs on S1APComponent {
            
            vc_recvS1AP_PDU := p_PDU;
            
@@ -77,23 +74,21 @@ module LibS1AP_Steps
            if (ischosen(p_PDU.unsuccessfulOutcome)) {
                 //TODO...
            }
		 } // end function f_S1APPDU_Get    	
    	
        } // End of function f_S1APPDU_Get
        
        /**
         *
         * @desc receive S1AP PDU
         * @param p_PDU template of the message to be received
         */
        function f_recv_S1AP_PDU(in template S1AP_PDU p_PDU) 
        runs on S1APComponent
        {
        function f_recv_S1AP_PDU(
                                 in template S1AP_PDU p_PDU
        ) runs on S1APComponent {
            var S1AP_PDU v_PDU;
            
            tc_wait.start;
            alt
            {
                []S1_MMEeNB_P.receive(p_PDU) -> value v_PDU
                  {
            alt {
                [] S1_MMEeNB_P.receive(p_PDU) -> value v_PDU {
                    tc_wait.stop;
                    f_S1APPDU_Get(v_PDU)
                }
@@ -104,27 +99,41 @@ module LibS1AP_Steps
                    f_componentStop();
                }
            }
        } // end f_recv_S1AP_PDU
            
        function f_recv_S1AP_initiatingMessage(template (present)InitiatingMessage p_initiatingMessage)
        runs on S1APComponent
        {
        } // End of function f_recv_S1AP_PDU
        
        /**
         * @desc 
         * @param p_initiatingMessage
         * @verdict 
         */
        function f_recv_S1AP_initiatingMessage(
                                               template (present)InitiatingMessage p_initiatingMessage
        ) runs on S1APComponent {
            f_recv_S1AP_PDU( {initiatingMessage := p_initiatingMessage})
        }//end f_recv_S1AP_initiatingMessage
        } // End of function f_recv_S1AP_initiatingMessage
        
        function f_recv_S1AP_successfulOutcome(template (present)SuccessfulOutcome p_successfulOutcome)
        runs on S1APComponent
        {
        /**
         * @desc 
         * @param p_successfulOutcome
         * @verdict 
         */
        function f_recv_S1AP_successfulOutcome(
                                               template (present)SuccessfulOutcome p_successfulOutcome
        ) runs on S1APComponent {
            f_recv_S1AP_PDU( {successfulOutcome := p_successfulOutcome})
        }//end f_recv_S1AP_successfulOutcome
        } // End of f_recv_S1AP_successfulOutcome
        
        function f_recv_S1AP_unsuccessfulOutcome(template (present)UnsuccessfulOutcome p_unsuccessfulOutcome)
        runs on S1APComponent
        {
        /**
         * @desc 
         */
        function f_recv_S1AP_unsuccessfulOutcome(
                                                 template (present) UnsuccessfulOutcome p_unsuccessfulOutcome
        ) runs on S1APComponent {
            f_recv_S1AP_PDU( {unsuccessfulOutcome := p_unsuccessfulOutcome})
        }//end f_recv_S1AP_unsuccessfulOutcome
        } // End of function f_recv_S1AP_unsuccessfulOutcome
        
    } // end ReceivePDU
    } // End of group ReceivePDU
    
    group SendPDU {
        
@@ -132,8 +141,9 @@ module LibS1AP_Steps
         *  @desc    This is a test step that assign common S1AP
         *  @param
         */
        function f_S1APPDU_Set( inout template (value) S1AP_PDU p_PDU)
        runs on S1APComponent {
        function f_S1APPDU_Set(
                               inout template (value) S1AP_PDU p_PDU
        ) runs on S1APComponent {
            
            if (ischosen(p_PDU.initiatingMessage)) {
                //TODO...
@@ -147,39 +157,49 @@ module LibS1AP_Steps
                 //TODO...
                 vc_sendS1AP_PDU:=valueof(p_PDU);
            }
        } // end function f_S1APPDU_Set
            
        } // End of function f_S1APPDU_Set
    
        /**
        *
        * @desc  send S1AP PDU
        * @param p_PDU template of the message to be sent
        */
        function f_send_S1AP_PDU(template (value) S1AP_PDU p_PDU)
        runs on S1APComponent
        {
        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);
        }//end f_send_S1APPDU
        } // End of function f_send_S1APPDU
        
        function f_send_S1AP_initiatingMessage(template (value)InitiatingMessage p_initiatingMessage)
        runs on S1APComponent
        {
        /**
         * @desc 
         */
        function f_send_S1AP_initiatingMessage(
                                               in template (value) InitiatingMessage p_initiatingMessage
        ) runs on S1APComponent {
            f_send_S1AP_PDU( {initiatingMessage := p_initiatingMessage})
        }//end f_send_S1AP_initiatingMessage
        } // End of function f_send_S1AP_initiatingMessage
        
        function f_send_S1AP_successfulOutcome(template (value)SuccessfulOutcome p_successfulOutcome)
        runs on S1APComponent
        {
        /**
         * @desc 
         */
        function f_send_S1AP_successfulOutcome(
                                               in template (value) SuccessfulOutcome p_successfulOutcome
		) runs on S1APComponent {
            f_send_S1AP_PDU( {successfulOutcome := p_successfulOutcome})
        }//end f_send_S1AP_successfulOutcome
        } // End of function f_send_S1AP_successfulOutcome
        
        function f_send_S1AP_unsuccessfulOutcome(template (value)UnsuccessfulOutcome p_unsuccessfulOutcome)
        runs on S1APComponent
        {
        /**
         * @desc 
         */
        function f_send_S1AP_unsuccessfulOutcome(
                                                 in template (value)UnsuccessfulOutcome p_unsuccessfulOutcome
		) runs on S1APComponent {
            f_send_S1AP_PDU( {unsuccessfulOutcome := p_unsuccessfulOutcome})
        }//end f_send_S1AP_unsuccessfulOutcome 
        } // End of function f_send_S1AP_unsuccessfulOutcome 
    
    } // end SendPDU
    } // End of group SendPDU

    group GlobalSteps{
        
@@ -190,7 +210,7 @@ module LibS1AP_Steps
        function f_S1AP_Init_Component()
        runs on S1APComponent {
            
        } // end function f_S1AP_Init_Component
        } // End of function  f_S1AP_Init_Component
        
        /**
        *
@@ -202,7 +222,7 @@ module LibS1AP_Steps
            log("component terminated - forced!");
            deactivate;
            stop;
        }
        } // End of function f_S1AP_terminate_component
    
        /**
        * @desc component termination
@@ -213,7 +233,7 @@ module LibS1AP_Steps
            syncPort.send(m_syncClientStop);
            S1_MMEeNB_P.clear;
            stop;
        }
        } // End of function f_componentStop
    
        /**
        *
@@ -227,67 +247,84 @@ module LibS1AP_Steps
                v_ret := e_success;
            }
            return v_ret;
            }    
        } // End of function 
    
        /**
        * 
        * @desc function waits for particular time before next expected message
        */    
        function f_wait(float p_time)
        function f_wait(float p_time) // TODO Replace by LibCommon.f_sleep
        runs on S1APComponent {
            
            tc_wait.start(p_time);
            alt {
                [] tc_wait.timeout{ }
            }
        }
    
    }// end group GlobalSteps
        } // End of function f_wait
    
    } // End of group GlobalSteps
    
    group Preambles {
    	
        group preamble_S1AP{
            
            /**
             * @desc 
             * @verdict 
             */
            function f_preambleS1AP_MME()
            runs on S1APComponent {
                //TODO:...        
            }
            } // End of function f_preambleS1AP_MME
            
            /**
             * @desc 
             * @verdict 
             */
            function f_preambleS1AP_eNB()
            runs on S1APComponent {
                //TODO:...        
            }
            } // End of function f_preambleS1AP_eNB
            
        }//end group preamble_S1AP
        } // End of group preamble_S1AP
        
    }// end group Preambles
    } // End of group Preambles
    
    group Postambles {
        
        group postamble_S1AP{
            
            /**
             * @desc 
             * @verdict 
             */
            function f_postambleS1AP_MME()
            runs on S1APComponent {
                // TODO:...
            }
            } // End of function f_postambleS1AP_MME
            
            /**
             * @desc 
             * @verdict 
             */
            function f_postambleS1AP_eNB()
            runs on S1APComponent {
                // TODO:...
            }
            } // End of function f_postambleS1AP_eNB
            
        }//end group postamble_S1AP
        } // End of group postamble_S1AP
        
    } //end group Postambles
    } // End of group Postambles
    
    group DefaultsTestStep
    {
    group DefaultsTestStep {
        
        /**
         * @desc 
         * @verdict 
         */
        altstep a_defaultS1AP()
        runs on S1APComponent
        {
            [] any timer.timeout
             {
        runs on S1APComponent {
            [] any timer.timeout {
                all timer.stop;
                if (vc_serverStop==false) {
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
@@ -296,20 +333,16 @@ module LibS1AP_Steps
                    stop;
                }
            }
            [] S1_MMEeNB_P.receive (S1AP_PDU:{initiatingMessage := ?}) -> value vc_recvS1AP_PDUDefault
             {
            [] S1_MMEeNB_P.receive (S1AP_PDU:{initiatingMessage := ?}) -> value vc_recvS1AP_PDUDefault {
                repeat;
            }
            [] S1_MMEeNB_P.receive (S1AP_PDU:{successfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault
             {
            [] S1_MMEeNB_P.receive (S1AP_PDU:{successfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault {
                repeat;
            }
            [] S1_MMEeNB_P.receive (S1AP_PDU:{unsuccessfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault
             {
            [] S1_MMEeNB_P.receive (S1AP_PDU:{unsuccessfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault {
                repeat;
            }
            [] S1_MMEeNB_P.receive (S1AP_PDU:?) -> value vc_recvS1AP_PDUDefault
             {
            [] S1_MMEeNB_P.receive (S1AP_PDU:?) -> value vc_recvS1AP_PDUDefault {
                if (vc_serverStop==false) {
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
@@ -317,8 +350,7 @@ module LibS1AP_Steps
                    stop;
                }
            }
            [] S1_MMEeNB_P.receive
             {
            [] S1_MMEeNB_P.receive {
                if (vc_serverStop==false) {
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
@@ -332,13 +364,11 @@ module LibS1AP_Steps
                // Terminate component execution
                stop;
            }
        }//end a_defaultS1AP
        } // End of altstep a_defaultS1AP
        
        altstep a_defaultS1AP_MME()
        runs on S1APComponent
        {
            [] any timer.timeout
             {
        runs on S1APComponent {
            [] any timer.timeout {
                all timer.stop;
                if (vc_serverStop==false) {
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
@@ -348,13 +378,11 @@ module LibS1AP_Steps
                }
            }
            //TODO:...
        }//end a_defaultS1AP_MME
        } // End of altstep a_defaultS1AP_MME
        
        altstep a_defaultS1AP_eNB()
        runs on S1APComponent
        {
            [] any timer.timeout
             {
        runs on S1APComponent {
            [] any timer.timeout {
                all timer.stop;
                if (vc_serverStop==false) {
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
@@ -364,7 +392,8 @@ module LibS1AP_Steps
                }
            }
             //TODO:...
        }//end a_defaultS1AP_eNB
        } // End of altstep a_defaultS1AP_eNB
        
    } // End of group DefaultsTestStep
    
    } // end of group DefaultsTestStep
} // end module LibS1AP_Steps
 No newline at end of file
} // End of module LibS1AP_Steps
+270 −202

File changed.

Preview size limit exceeded, changes collapsed.

Loading