Commit f6c3dc08 authored by pintar's avatar pintar
Browse files

preparation of preamble and postable and related templates

parent a067487f
Loading
Loading
Loading
Loading
+29 −25
Original line number Original line Diff line number Diff line
@@ -9,12 +9,12 @@ module LibDiameter_Steps
	//LibCommon 
	//LibCommon 
	import from LibCommon_Sync all ;
	import from LibCommon_Sync all ;
	import from LibCommon_VerdictControl all ;
	import from LibCommon_VerdictControl all ;
	import from LibCommon_BasicTypesAndValues all;
	//LibDiameter
	//LibDiameter
	import from LibDiameter_TypesAndValues all;
	import from LibDiameter_TypesAndValues all;
	import from LibDiameter_Templates all;
	import from LibDiameter_Templates all;
	import from LibDiameter_Interface all;
	import from LibDiameter_Interface all;
	import from LibDiameter_PIXITS all;
	import from LibDiameter_PIXITS all;
    //import from AtsCommon_PIXITS all;


group CommonFunctions{
group CommonFunctions{


@@ -39,8 +39,8 @@ group CommonFunctions{
    * @desc  f_Inc, return incremented value of p_int 0
    * @desc  f_Inc, return incremented value of p_int 0
    * @param p_int - integer value
    * @param p_int - integer value
    */	
    */	
    function f_inc( inout integer p_int)
    function f_inc( inout UInt32 p_int)
    return integer
    return UInt32
    {
    {
        p_int:=p_int+1;
        p_int:=p_int+1;
        return p_int;
        return p_int;
@@ -130,8 +130,8 @@ group AwaitingMessage {
        //store specific parameter for AAR if needed
        //store specific parameter for AAR if needed
        
        
        vc_sessionId := vc_recvDiamMsg.aAR_MSG.session_Id;
        vc_sessionId := vc_recvDiamMsg.aAR_MSG.session_Id;
        vc_originHost := vc_recvDiamMsg.aAR_MSG.origin_Host;
//        vc_originHost := vc_recvDiamMsg.aAR_MSG.origin_Host;  //Origin host has to be Destination host and it is set at preamble of TC within init function 
        vc_originRealm := vc_recvDiamMsg.aAR_MSG.origin_Realm;
//        vc_originRealm := vc_recvDiamMsg.aAR_MSG.origin_Realm; //Origin realm has to be Destination realm and it is set at preamble of TC within init function
        
        
    }
    }
    
    
@@ -145,6 +145,8 @@ group AwaitingMessage {
    {
    {
        f_awaitingDiameterMsg({sTR_MSG:=p_STR});
        f_awaitingDiameterMsg({sTR_MSG:=p_STR});
        //store specific parameter for STR if needed
        //store specific parameter for STR if needed
        
        vc_sessionId := vc_recvDiamMsg.sTR_MSG.session_Id;
    }
    }
    
    
    function f_awaiting_STA(template (present)STA_MSG p_STA) runs on DiameterComponent
    function f_awaiting_STA(template (present)STA_MSG p_STA) runs on DiameterComponent
@@ -157,6 +159,7 @@ group AwaitingMessage {
    {
    {
        f_awaitingDiameterMsg({aSR_MSG:=p_ASR});
        f_awaitingDiameterMsg({aSR_MSG:=p_ASR});
        //store specific parameter for ASR if needed
        //store specific parameter for ASR if needed
        vc_sessionId := vc_recvDiamMsg.aSR_MSG.session_Id;
    }
    }
    
    
    function f_awaiting_ASA(template (present)ASA_MSG p_ASA) runs on DiameterComponent
    function f_awaiting_ASA(template (present)ASA_MSG p_ASA) runs on DiameterComponent
@@ -170,6 +173,7 @@ group AwaitingMessage {
    {
    {
        f_awaitingDiameterMsg({rAR_MSG:=p_RAR});
        f_awaitingDiameterMsg({rAR_MSG:=p_RAR});
        //store specific parameter for RAR if needed
        //store specific parameter for RAR if needed
        vc_sessionId := vc_recvDiamMsg.rAR_MSG.session_Id;
    }
    }
    
    
    
    
@@ -188,7 +192,7 @@ group SendMessage {
	* @desc  send DIAMETER message
	* @desc  send DIAMETER message
	* @param p_diameterMSG template of the message to be sent
	* @param p_diameterMSG template of the message to be sent
	*/	
	*/	
	function f_sendDiameterMsg(template DIAMETER_MSG p_diameterMSG) runs on DiameterComponent
	function f_sendDiameterMsg(template (value) DIAMETER_MSG p_diameterMSG) runs on DiameterComponent
	{
	{
        
        
        if (PX_DIAM_LLP_ENABLED)
        if (PX_DIAM_LLP_ENABLED)
@@ -211,7 +215,7 @@ group SendMessage {
        }	
        }	
    }//end f_sendDiameterMsg  
    }//end f_sendDiameterMsg  
        
        
    function f_send_CER(template CER_MSG p_CER) runs on DiameterComponent
    function f_send_CER(template (value) CER_MSG p_CER) runs on DiameterComponent
    {
    {
        //set specific parameter for CER if needed
        //set specific parameter for CER if needed
        
        
@@ -220,7 +224,7 @@ group SendMessage {
        f_sendDiameterMsg({cER_MSG:=p_CER});
        f_sendDiameterMsg({cER_MSG:=p_CER});
    }  
    }  
    
    
    function f_send_CEA(template CEA_MSG p_CEA) runs on DiameterComponent
    function f_send_CEA(template (value) CEA_MSG p_CEA) runs on DiameterComponent
    {
    {
        //set specific parameter for CEA if needed
        //set specific parameter for CEA if needed
        
        
@@ -229,7 +233,7 @@ group SendMessage {
        f_sendDiameterMsg({cEA_MSG:=p_CEA});
        f_sendDiameterMsg({cEA_MSG:=p_CEA});
    }
    }
    
    
    function f_send_DWR(template DWR_MSG p_DWR) runs on DiameterComponent
    function f_send_DWR(template (value) DWR_MSG p_DWR) runs on DiameterComponent
    {
    {
        //set specific parameter for DWR if needed
        //set specific parameter for DWR if needed
        
        
@@ -238,7 +242,7 @@ group SendMessage {
        f_sendDiameterMsg({dWR_MSG:=p_DWR});
        f_sendDiameterMsg({dWR_MSG:=p_DWR});
    }
    }
    
    
    function f_send_DWA(template DWA_MSG p_DWA) runs on DiameterComponent
    function f_send_DWA(template (value) DWA_MSG p_DWA) runs on DiameterComponent
    {
    {
        //set specific parameter for DWA if needed
        //set specific parameter for DWA if needed
        
        
@@ -247,7 +251,7 @@ group SendMessage {
        f_sendDiameterMsg({dWA_MSG:=p_DWA});
        f_sendDiameterMsg({dWA_MSG:=p_DWA});
    }
    }
    
    
    function f_send_DPR(template DPR_MSG p_DPR) runs on DiameterComponent
    function f_send_DPR(template (value) DPR_MSG p_DPR) runs on DiameterComponent
    {
    {
        //set specific parameter for DPR if needed
        //set specific parameter for DPR if needed
        
        
@@ -256,7 +260,7 @@ group SendMessage {
        f_sendDiameterMsg({dPR_MSG:=p_DPR});
        f_sendDiameterMsg({dPR_MSG:=p_DPR});
    }
    }
    
    
    function f_send_DPA(template DPA_MSG p_DPA) runs on DiameterComponent
    function f_send_DPA(template (value) DPA_MSG p_DPA) runs on DiameterComponent
    {
    {
        //set specific parameter for DPA if needed
        //set specific parameter for DPA if needed
        
        
@@ -265,7 +269,7 @@ group SendMessage {
        f_sendDiameterMsg({dPA_MSG:=p_DPA});
        f_sendDiameterMsg({dPA_MSG:=p_DPA});
    }
    }
    
    
    function f_send_AAR(template AAR_MSG p_AAR) runs on DiameterComponent
    function f_send_AAR(template (value) AAR_MSG p_AAR) runs on DiameterComponent
    {
    {
		//set specific parameter for AAR if needed
		//set specific parameter for AAR if needed


@@ -274,7 +278,7 @@ group SendMessage {
        f_sendDiameterMsg({aAR_MSG:=p_AAR});
        f_sendDiameterMsg({aAR_MSG:=p_AAR});
    }
    }


    function f_send_AAA(template AAA_MSG p_AAA) runs on DiameterComponent
    function f_send_AAA(template (value) AAA_MSG p_AAA) runs on DiameterComponent
    {
    {
        //set specific parameter for AAA if needed
        //set specific parameter for AAA if needed
                
                
@@ -283,7 +287,7 @@ group SendMessage {
        f_sendDiameterMsg({aAA_MSG:=p_AAA});
        f_sendDiameterMsg({aAA_MSG:=p_AAA});
    }
    }
    
    
    function f_send_STR(template STR_MSG p_STR) runs on DiameterComponent
    function f_send_STR(template (value) STR_MSG p_STR) runs on DiameterComponent
    {
    {
        //set specific parameter for STR if needed
        //set specific parameter for STR if needed
        
        
@@ -292,7 +296,7 @@ group SendMessage {
        f_sendDiameterMsg({sTR_MSG:=p_STR});
        f_sendDiameterMsg({sTR_MSG:=p_STR});
    }
    }
    
    
    function f_send_STA(template STA_MSG p_STA) runs on DiameterComponent
    function f_send_STA(template (value) STA_MSG p_STA) runs on DiameterComponent
    {
    {
        //set specific parameter for STA if needed
        //set specific parameter for STA if needed
        
        
@@ -301,7 +305,7 @@ group SendMessage {
        f_sendDiameterMsg({sTA_MSG:=p_STA});
        f_sendDiameterMsg({sTA_MSG:=p_STA});
    }
    }
    
    
    function f_send_ASR(template ASR_MSG p_ASR) runs on DiameterComponent
    function f_send_ASR(template (value) ASR_MSG p_ASR) runs on DiameterComponent
    {
    {
        //set specific parameter for ASR if needed
        //set specific parameter for ASR if needed
        
        
@@ -310,7 +314,7 @@ group SendMessage {
        f_sendDiameterMsg({aSR_MSG:=p_ASR});
        f_sendDiameterMsg({aSR_MSG:=p_ASR});
    }
    }
    
    
    function f_send_ASA(template ASA_MSG p_ASA) runs on DiameterComponent
    function f_send_ASA(template (value) ASA_MSG p_ASA) runs on DiameterComponent
    {
    {
        //set specific parameter for ASA if needed
        //set specific parameter for ASA if needed
        
        
@@ -318,7 +322,7 @@ group SendMessage {
        p_ASA.header.msglen := lengthof(encvalue(p_ASA));                
        p_ASA.header.msglen := lengthof(encvalue(p_ASA));                
        f_sendDiameterMsg({aSA_MSG:=p_ASA});
        f_sendDiameterMsg({aSA_MSG:=p_ASA});
    }
    }
    function f_send_RAR(template RAR_MSG p_RAR) runs on DiameterComponent
    function f_send_RAR(template (value) RAR_MSG p_RAR) runs on DiameterComponent
    {
    {
        //set specific parameter for RAR if needed
        //set specific parameter for RAR if needed
        
        
@@ -327,7 +331,7 @@ group SendMessage {
        f_sendDiameterMsg({rAR_MSG:=p_RAR});
        f_sendDiameterMsg({rAR_MSG:=p_RAR});
    }
    }
    
    
    function f_send_RAA(template RAA_MSG p_RAA) runs on DiameterComponent
    function f_send_RAA(template (value) RAA_MSG p_RAA) runs on DiameterComponent
    {
    {
        //set specific parameter for RAA if needed
        //set specific parameter for RAA if needed
        
        
@@ -352,7 +356,7 @@ group GlobalSteps {
    *  @desc	This is a test step that assign common Diameter headers
    *  @desc	This is a test step that assign common Diameter headers
    *  @param	
    *  @param	
    */
    */
            function f_Diameter_Set_Headers( inout template DIAMETER_MSG p_diameterMSG)
            function f_Diameter_Set_Headers( inout template (value) DIAMETER_MSG p_diameterMSG)
            runs on DiameterComponent {
            runs on DiameterComponent {
				
				
                //insert length of message  
                //insert length of message  
@@ -750,9 +754,9 @@ group Preambles {
        
        
        function f_preambleDiameterBase()runs on DiameterComponent
        function f_preambleDiameterBase()runs on DiameterComponent
        {
        {
            //TODO define templates
            
            f_send_CER(m_CER_basic(vc_originHost, vc_originRealm, vc_hostIPAddress));
            f_send_CER(m_CER_basic(vc_originHost, vc_originRealm, vc_hostIPAddress));
//            f_awaiting_CEA(mw_CEA);
            f_awaiting_CEA(mw_CEA_dummy);
            f_send_DWR(m_DWR_basic(vc_originHost, vc_originRealm));
            f_send_DWR(m_DWR_basic(vc_originHost, vc_originRealm));
            f_awaiting_DWA(mw_DWA_dummy);
            f_awaiting_DWA(mw_DWA_dummy);
        }
        }
@@ -809,8 +813,8 @@ group Postambles {
        function f_postambleDiameterBase()runs on DiameterComponent
        function f_postambleDiameterBase()runs on DiameterComponent
        {
        {
            //TODO define templates
            //TODO define templates
            /*f_send_DPR(m_DPR);
            f_send_DPR(m_DPR_basic(vc_originHost, vc_originRealm));
            f_awaiting_DPA(mw_DPA);*/
            f_awaiting_DPA(mw_DPA_dummy);
        }
        }
        
        
    }//end group postamble_Diameter
    }//end group postamble_Diameter
+28 −6
Original line number Original line Diff line number Diff line
@@ -229,7 +229,7 @@ module LibDiameter_Templates {
                    m_bit := '1'B,
                    m_bit := '1'B,
                    p_bit := '0'B,
                    p_bit := '0'B,
                    reserved_bits := '00000'B},
                    reserved_bits := '00000'B},
                aVP_len := 8 + p_avpDataLen + f_lengthVid(p_avpVid), // add length of avpData and optioal 4 (if Vid is present)
                aVP_len := 8 + p_avpDataLen + f_lengthVid(p_avpVid), // add length of avpData and optional 4 (if Vid is present)
                aVP_vid := p_avpVid
                aVP_vid := p_avpVid
            }
            }
            
            
@@ -295,7 +295,7 @@ module LibDiameter_Templates {
				aVP_Data := p_avpData
				aVP_Data := p_avpData
			}          
			}          
                    
                    
            template Result_Code_AVP mw_resultCode(template /*integer*/Result_Code_Type p_avpData) := {
            template Result_Code_AVP mw_resultCode(template (present)/*integer*/Result_Code_Type p_avpData) := {
            	aVP_Header := {
            	aVP_Header := {
            		aVP_Code := ?,
            		aVP_Code := ?,
            		aVP_flags := {v_bit := ?, m_bit := ?, p_bit := ?, reserved_bits := ?},
            		aVP_flags := {v_bit := ?, m_bit := ?, p_bit := ?, reserved_bits := ?},
@@ -305,7 +305,7 @@ module LibDiameter_Templates {
            	aVP_Data := p_avpData
            	aVP_Data := p_avpData
            }
            }
        
        
            template Result_Code_AVP m_resultCode(template /*integer*/Result_Code_Type p_avpData) := {
            template Result_Code_AVP m_resultCode(template (value) /*integer*/Result_Code_Type p_avpData) := {
    			aVP_Header := m_aVP_HeaderVid(c_vendIdResult_Code_AVP, 4, omit),
    			aVP_Header := m_aVP_HeaderVid(c_vendIdResult_Code_AVP, 4, omit),
    			aVP_Data := p_avpData
    			aVP_Data := p_avpData
    		}
    		}
@@ -316,6 +316,21 @@ module LibDiameter_Templates {
				aVP_Data := p_avpData
				aVP_Data := p_avpData
			}
			}
            
            
            template Product_Name_AVP m_productName(template(value) universal charstring p_avpData) := {
                aVP_Header := m_aVP_HeaderVid(c_vendIdProduct_Name_AVP, lengthof(p_avpData), omit),
                aVP_Data := p_avpData
            }
            
            template Vendor_Id_AVP m_vendorId(template(value) UInt32 p_avpData) := {
                aVP_Header := m_aVP_HeaderVid(c_vendIdVendor_Id_AVP, 4, omit),
                aVP_Data := p_avpData
            }
            
            template Disconnect_Cause_AVP m_disconnectCause(Disconnect_Cause_Type p_aVP_Data) := {
                aVP_Header := m_aVP_HeaderVid(c_vendIdDisconnect_Cause_AVP, 4, omit ),
                aVP_Data := p_aVP_Data
            }

        } //end group SpecificAVPHeaders
        } //end group SpecificAVPHeaders
    } //end group HeaderFieldTemplates
    } //end group HeaderFieldTemplates
	
	
@@ -486,9 +501,9 @@ module LibDiameter_Templates {
            							 Address p_address) modifies m_CER_dummy := {
            							 Address p_address) modifies m_CER_dummy := {
				origin_Host := p_originHost,
				origin_Host := p_originHost,
				origin_Realm := p_originRealm,
				origin_Realm := p_originRealm,
				host_IP_Address := {m_hostIPAddress(p_address)}
				host_IP_Address := {m_hostIPAddress(p_address)},
				//vendor_Id := m_vendorId_dummy,
				vendor_Id := m_vendorId(c_vendId3gpp),
				//product_Name := m_productName_dummy
				product_Name := m_productName("ETSI")
			}
			}


            template DWR_MSG m_DWR_basic(template Origin_Host_AVP p_originHost,
            template DWR_MSG m_DWR_basic(template Origin_Host_AVP p_originHost,
@@ -497,6 +512,13 @@ module LibDiameter_Templates {
            	origin_Realm := p_originRealm
            	origin_Realm := p_originRealm
            }
            }
              
              
            template DPR_MSG m_DPR_basic(template Origin_Host_AVP p_originHost,
    									 template Origin_Realm_AVP p_originRealm) modifies m_DPR_dummy := {
            	origin_Host := p_originHost,
            	origin_Realm := p_originRealm,
            	disconnect_Cause_AVP := m_disconnectCause(REBOOTING_E)
            }
                    
        } // end group basic_request_templates_send
        } // end group basic_request_templates_send


      	group basic_request_templates_receive {
      	group basic_request_templates_receive {
+3 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,9 @@ group BasicTypesAndConstants{
        const UInt32 c_applIdRx := 16777236;			//For Rx messages
        const UInt32 c_applIdRx := 16777236;			//For Rx messages
        const UInt32 c_applIdGx := 16777238;			//For Gx messages
        const UInt32 c_applIdGx := 16777238;			//For Gx messages
      } //end group ApplicationIdConstants
      } //end group ApplicationIdConstants
      group SMINetworkManagementPrivateEnterpriseCodes_VendorIDAVP {
        const UInt32 c_vendId3gpp := 10415;			//Vendor idFor 3GPP
      }//end group SMINetworkManagementPrivateEnterpriseCodes_VendorIDAVP
      group VendorIdConstants {
      group VendorIdConstants {
        group VendorIdConstantsRFC3855{				
        group VendorIdConstantsRFC3855{				
      	  const integer c_vendIdAccounting_Realtime_Required_AVP := 483; 			//Ref: RFC3588 9.8.7.  Accounting-Realtime-Required AVP
      	  const integer c_vendIdAccounting_Realtime_Required_AVP := 483; 			//Ref: RFC3588 9.8.7.  Accounting-Realtime-Required AVP