Commit 07229f9d authored by rennoch's avatar rennoch
Browse files

sorting/renaming of templates

parent c0b4d7ec
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -489,8 +489,8 @@ module DiameterRx_Rx_TCFunctions {
												m_serviceURN, // Service_URN_AVP
                    							m_mediaComponentDescription_flowStatus(m_flowStatus(ENABLED_E)),
                    							m_mspIdentifier, // MPS_Identifier_AVP
                    							m_ServiceInfoStatus(FNAL_SERVICE_INFORMATION_E), // Service_Info_Status_AVP
                    							m_sponsoredConnectivityData_SI_ASPI_GSU(m_SponsorIdentity("1234"),m_ApplicationServiceProviderIdentity("1234"),m_GrantedServiceUnit), // Sponsored_Connectivity_Data_AVP
                    							m_serviceInfoStatus(FNAL_SERVICE_INFORMATION_E), // Service_Info_Status_AVP
                    							m_sponsoredConnectivityData_SI_ASPI_GSU(m_sponsorIdentity("1234"),m_applicationServiceProviderIdentity("1234"),m_grantedServiceUnit), // Sponsored_Connectivity_Data_AVP
                    							{m_specificAction(USAGE_REPORT_E)} // Setof_Specific_Action_AVP
                    							)                    							
                    			);
@@ -520,12 +520,12 @@ module DiameterRx_Rx_TCFunctions {
												vc_originRealm,
                    							vc_destinationRealm,
   												vc_destinationHost,
                    							m_sponsoredConnectivityData_SI_ASPI(m_SponsorIdentity("1234"),m_ApplicationServiceProviderIdentity("1234")) // Sponsored_Connectivity_Data_AVP
                    							m_sponsoredConnectivityData_SI_ASPI(m_sponsorIdentity("1234"),m_applicationServiceProviderIdentity("1234")) // Sponsored_Connectivity_Data_AVP
                    							)                    							
                    			);
                    
                    f_awaiting_AAA(mw_AAA_modified_Experimental_Result(?, ?, ?,
									mw_ExperimentalResult(mw_ExperimentalResultCode(REQUESTED_SERVICE_NOT_AUTHORIZED_E)))); // experimental result present
									mw_experimentalResult(mw_experimentalResultCode(REQUESTED_SERVICE_NOT_AUTHORIZED_E)))); // experimental result present
				
                    f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync

@@ -594,8 +594,8 @@ module DiameterRx_Rx_TCFunctions {
												omit, // Service_URN_AVP
                    							m_mediaComponentDescription_flowStatus(m_flowStatus(ENABLED_E)),
                    							m_mspIdentifier, // MPS_Identifier_AVP
                    							m_ServiceInfoStatus(FNAL_SERVICE_INFORMATION_E), // Service_Info_Status_AVP
                    							m_sponsoredConnectivityData_SI_ASPI_GSU(m_SponsorIdentity("1234"),m_ApplicationServiceProviderIdentity("1234"),m_GrantedServiceUnit), // Sponsored_Connectivity_Data_AVP
                    							m_serviceInfoStatus(FNAL_SERVICE_INFORMATION_E), // Service_Info_Status_AVP
                    							m_sponsoredConnectivityData_SI_ASPI_GSU(m_sponsorIdentity("1234"),m_applicationServiceProviderIdentity("1234"),m_grantedServiceUnit), // Sponsored_Connectivity_Data_AVP
                    							{m_specificAction(USAGE_REPORT_E)} // Setof_Specific_Action_AVP
                    							)                    							
                    			);
+141 −153
Original line number Diff line number Diff line
@@ -102,18 +102,127 @@ module DiameterRx_Templates {
            aVP_Data := p_avpData
        }		

        template Flow_Status_AVP m_flowStatus(Flow_Status_Type p_avpData) := 
        {
            aVP_Header := 
            {
                aVP_Code := c_vendIdFlow_Status_AVP,
                aVP_flags := m_avpFlags,
                aVP_len := 8+4,
                aVP_vid := omit
        	},
        template Flow_Status_AVP m_flowStatus (template Flow_Status_Type p_avpData) := {
            //Ref: ETSI TS 129 214 Flow_Status AVP
            aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Status_AVP, 4, omit),
            aVP_Data := p_avpData
            };

        template AF_Signalling_Protocol_AVP m_afSignallingProtocolSIP := {
          //Ref: ETSI TS 129 214 AF_Signalling_Protocol AVP
             aVP_Header := m_aVP_HeaderVid(c_vendIdAF_Signalling_Protocol_AVP, 4, omit),
             aVP_Data := SIP_E
          };

    
        template Media_Sub_Component_AVP m_mediaSubComponentUN (template UInt32 p_flowNumber, template Flow_Usage_Type p_flowUsageType ) := {
             aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
             								12 // flow_Number
             								+ 12, // flow_Usage
               								omit),
             flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
             flow_Description := omit,
             flow_Status := omit,
             flow_Usage := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Usage_AVP,4, omit), aVP_Data := p_flowUsageType},
             max_Requested_Bw_Ul := omit,
             max_Requested_Bw_Dl := omit,
             af_Signalling_Protocol := omit,
             aVP_Type := omit
        }
        
        template Media_Sub_Component_AVP m_mediaSubComponentUND2SP 
        		(template UInt32 p_flowNumber, 
        		 template Flow_Usage_Type p_flowUsageType,
        		 template Flow_Description_AVP p_flowDescription1,
        		 template Flow_Description_AVP p_flowDescription2,
           		 template Flow_Status_AVP p_FlowStatus,
        		 template AF_Signalling_Protocol_AVP p_afSignallingProtocol) := {
             aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
             					12 // flow_Number
             					+ lengthof(encvalue(p_flowDescription1))
             					+ lengthof(encvalue(p_flowDescription2))
               					+ 12 // flow_Usage
             					+ lengthof(encvalue(p_FlowStatus))
               					+ lengthof(encvalue(p_afSignallingProtocol)),
               					omit),
             flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
             flow_Description := {p_flowDescription1, p_flowDescription2},
             flow_Status := p_FlowStatus,
             flow_Usage := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Usage_AVP,4, omit), aVP_Data := p_flowUsageType},
             max_Requested_Bw_Ul := omit,
             max_Requested_Bw_Dl := omit,
             af_Signalling_Protocol := p_afSignallingProtocol,
             aVP_Type := omit
        }
			
        template Media_Sub_Component_AVP m_mediaSubComponentN (template UInt32 p_flowNumber) := {
             aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
             								8
             								+ 12, // flow_Number
               								omit),
             flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
             flow_Description := omit,
             flow_Status := omit,
             flow_Usage := omit,
             max_Requested_Bw_Ul := omit,
             max_Requested_Bw_Dl := omit,
             af_Signalling_Protocol := omit,
             aVP_Type := omit
        }
        
    	   
	   template Flow_Description_AVP m_flowDescription (UTF8String p_action, UTF8String p_direction, UTF8String p_proto,
	   			IP_AddressMask p_src, IP_AddressMask p_dst, UTF8String p_ports, UTF8String p_options) := {
           aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Description_AVP,
           						lengthof(p_action)
           						+ lengthof(p_direction)
           						+ lengthof(encvalue(p_src))
           						+ lengthof(encvalue(p_dst))
           						+ lengthof(p_ports)
           						+ lengthof(p_options),
           						omit),
		   aVP_Data := {
			   action_ := p_action,
			   direction := p_direction,
			   proto := p_proto,
			   src := p_src,
			   dst := p_dst,
			   ports := p_ports,
			   options := p_options
		   }
	   }


    	template Experimental_Result_AVP mw_experimentalResult(template Experimental_Result_Code_AVP p_ExperimentalResultCode) := {
    			aVP_Header := ?,
    			vendor_Id := ?,
    			experimental_Result_Code := p_ExperimentalResultCode		
    		}    			


    		                                
        template Sponsor_Identity_AVP m_sponsorIdentity(template UTF8String p_aVP_Data) := {
         //Ref: ETSI TS 129 214 Sponsor_Identity AVP
			 aVP_Header := m_aVP_HeaderVid(c_vendIdSponsor_Identity_AVP,8+lengthof(p_aVP_Data), omit),
             aVP_Data := p_aVP_Data
         };     
             

        template Granted_Service_Unit_AVP m_grantedServiceUnit := {
			//	Ref: RFC4006 8.17.  Granted-Service-Unit AVP
             	aVP_Header := m_aVP_HeaderVid(c_vendIdGranted_Service_Unit_AVP,0, omit),
            	tariff_Time_Change  := omit,
				cC_Time  := omit,
				cC_Money  := omit,
				cC_Total_Octets  := omit,
				cC_Input_Octets  := omit,
				cC_Output_Octets  := omit,
				cC_Service_Specific_Units := omit,
				aVP := omit				
			}


	    
	} //end group SubFields
    
    group HeaderFieldTemplates {
@@ -169,6 +278,20 @@ module DiameterRx_Templates {
    			codec_data := omit
    		}

				
           template Flow_Description_AVP m_flowDescription_dummy := {
               aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Description_AVP,8, omit),
    		   aVP_Data := {
    			   action_ := "permit",
    			   direction := "out",
    			   proto := "ip",
    			   src := {ipno := 4, addr := "1.2.3.4", mask := omit},
    			   dst := {ipno := 4, addr := "1.2.3.4", mask := omit},
    			   ports := "",
    			   options := omit
    		   }
    	   }
            
        } //end group DummyAVPHeaders
    
     	group SpecificAVPHeaders {
@@ -177,12 +300,7 @@ module DiameterRx_Templates {
    
            template (value) Access_Network_Charging_Address_AVP m_accessNetworkChargingAddress(template (value) Address p_avpData) := 
            {
                aVP_Header := {
                    aVP_Code := c_vendIdAccess_Network_Charging_Address_AVP,
                    aVP_flags := m_avpFlags,
                    aVP_len := 8 + f_IPAdressLength(),
                    aVP_vid := omit
            	},
                aVP_Header := m_aVP_HeaderVid(c_vendIdAccess_Network_Charging_Address_AVP, f_IPAdressLength(), omit),
                aVP_Data := p_avpData
            };
    
@@ -235,9 +353,9 @@ module DiameterRx_Templates {
                aVP_Data := ''O
                };
                
            template Service_Info_Status_AVP m_ServiceInfoStatus(Service_Info_Type p_avpData) := {
            template Service_Info_Status_AVP m_serviceInfoStatus(Service_Info_Type p_avpData) := {
             //Ref: ETSI TS 129 214 Service_Info AVP
                aVP_Header := m_aVP_HeaderVid(c_vendIdService_Info_Status_AVP, 4+4, omit),
                aVP_Header := m_aVP_HeaderVid(c_vendIdService_Info_Status_AVP, 4, omit),
                aVP_Data := p_avpData
             };    
    
@@ -283,18 +401,6 @@ module DiameterRx_Templates {
    			aVP_Data := p_terminationCauseData //DIAMETER_LOGOUT_E
    		}
    
            template AF_Signalling_Protocol_AVP m_afSignallingProtocolSIP := {
              //Ref: ETSI TS 129 214 AF_Signalling_Protocol AVP
                 aVP_Header := m_aVP_HeaderVid(c_vendIdAF_Signalling_Protocol_AVP, 4, omit),
                 aVP_Data := SIP_E
              };

            template Flow_Status_AVP m_FlowStatus (template Flow_Status_Type p_avpData) := {
                //Ref: ETSI TS 129 214 Flow_Status AVP
                aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Status_AVP, 4, omit),
                aVP_Data := p_avpData
                };
    
            template Specific_Action_AVP mw_specificAction(template Specific_Action_Type p_avpData) := 
            {
            	aVP_Header := ?, aVP_Data := p_avpData
@@ -398,70 +504,13 @@ module DiameterRx_Templates {
            {
                aVP_Header :=
                    m_aVP_HeaderVid(c_vendIdMedia_Component_Description_AVP,
                                    8 // header len
                                    + lengthof(encvalue(p_mediaSubComponent)) //     subComponent (32)
                                    lengthof(encvalue(p_mediaSubComponent)) //     subComponent (32)
                                    + lengthof(encvalue(p_mediaComponentNr)), //     media_Component_Nr (12)
                                    omit),
                    media_Sub_component := {p_mediaSubComponent},
                    media_Component_Nr := p_mediaComponentNr
            }  
    			
            template Media_Sub_Component_AVP m_mediaSubComponentUN (template UInt32 p_flowNumber, template Flow_Usage_Type p_flowUsageType ) := {
                 aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
                 								8
                 								+ 12 // flow_Number
                 								+ 12, // flow_Usage
                   								omit),
                 flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
                 flow_Description := omit,
                 flow_Status := omit,
                 flow_Usage := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Usage_AVP,4, omit), aVP_Data := p_flowUsageType},
                 max_Requested_Bw_Ul := omit,
                 max_Requested_Bw_Dl := omit,
                 af_Signalling_Protocol := omit,
                 aVP_Type := omit
            }
            
            template Media_Sub_Component_AVP m_mediaSubComponentUND2SP 
            		(template UInt32 p_flowNumber, 
            		 template Flow_Usage_Type p_flowUsageType,
            		 template Flow_Description_AVP p_flowDescription1,
            		 template Flow_Description_AVP p_flowDescription2,
               		 template Flow_Status_AVP p_FlowStatus,
            		 template AF_Signalling_Protocol_AVP p_afSignallingProtocol) := {
                 aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
                 					8
                 					+ 12 // flow_Number
                 					+ lengthof(encvalue(p_flowDescription1))
                 					+ lengthof(encvalue(p_flowDescription2))
                   					+ 12 // flow_Usage
                 					+ lengthof(encvalue(p_FlowStatus))
                   					+ lengthof(encvalue(p_afSignallingProtocol)),
                   					omit),
                 flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
                 flow_Description := {p_flowDescription1, p_flowDescription2},
                 flow_Status := p_FlowStatus,
                 flow_Usage := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Usage_AVP,4, omit), aVP_Data := p_flowUsageType},
                 max_Requested_Bw_Ul := omit,
                 max_Requested_Bw_Dl := omit,
                 af_Signalling_Protocol := p_afSignallingProtocol,
                 aVP_Type := omit
            }
    			
            template Media_Sub_Component_AVP m_mediaSubComponentN (template UInt32 p_flowNumber) := {
                 aVP_Header := m_aVP_HeaderVid(c_vendIdMedia_Sub_Component_AVP,
                 								8
                 								+ 12, // flow_Number
                   								omit),
                 flow_Number := {aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Number_AVP,4, omit), aVP_Data := p_flowNumber},
                 flow_Description := omit,
                 flow_Status := omit,
                 flow_Usage := omit,
                 max_Requested_Bw_Ul := omit,
                 max_Requested_Bw_Dl := omit,
                 af_Signalling_Protocol := omit,
                 aVP_Type := omit
            }    			
    
            template Sponsored_Connectivity_Data_AVP m_sponsoredConnectivityData_SI_ASPI_GSU
    		  (template Sponsor_Identity_AVP p_sponsorIdentity,
@@ -469,8 +518,7 @@ module DiameterRx_Templates {
    		   template Granted_Service_Unit_AVP p_grantedServiceUnit) := 
    		   {
    			  aVP_Header := m_aVP_HeaderVid(c_vendIdSponsored_Connectivity_Data_AVP,
    			  				12 // len of this template
    			  				+8+lengthof(p_sponsorIdentity.aVP_Data) // len of 1st subfield
    			  				8+lengthof(p_sponsorIdentity.aVP_Data) // len of 1st subfield
    			  				+8+lengthof(p_applicationServiceProviderId.aVP_Data) // len of 2nd subfield
    			  				+8, // len of 3rd subfield
    			  				omit),
@@ -486,8 +534,7 @@ module DiameterRx_Templates {
    		   template Application_Service_Provider_Identity_AVP p_applicationServiceProviderId) := 
    		   {
    			  aVP_Header := m_aVP_HeaderVid(c_vendIdSponsored_Connectivity_Data_AVP,
    			  				12 // len of this template
    			  				+8+lengthof(p_sponsorIdentity.aVP_Data) // len of 1st subfield
    			  				8+lengthof(p_sponsorIdentity.aVP_Data) // len of 1st subfield
    			  				+8+lengthof(p_applicationServiceProviderId.aVP_Data), // len of 2nd subfield
    			  				omit),
    			  sponsor_Identity := p_sponsorIdentity,
@@ -498,66 +545,12 @@ module DiameterRx_Templates {
    		}
    		
             
            template Sponsor_Identity_AVP m_SponsorIdentity(template UTF8String p_aVP_Data) := {
             //Ref: ETSI TS 129 214 Sponsor_Identity AVP
    			 aVP_Header := m_aVP_HeaderVid(c_vendIdSponsor_Identity_AVP,8+lengthof(p_aVP_Data), omit),
                 aVP_Data := p_aVP_Data
             };     
             
             
            template Application_Service_Provider_Identity_AVP m_ApplicationServiceProviderIdentity(template UTF8String p_aVP_Data) := {
            template Application_Service_Provider_Identity_AVP m_applicationServiceProviderIdentity(template UTF8String p_aVP_Data) := {
                //Ref: ETSI TS 129 214 Application_Service_Provider_Identity AVP
                 aVP_Header := m_aVP_HeaderVid(c_vendIdApplication_Service_Provider_Identity_AVP,8+lengthof(p_aVP_Data), omit),
                 aVP_Data := p_aVP_Data
            };   
            
            template Granted_Service_Unit_AVP m_GrantedServiceUnit := {
				//	Ref: RFC4006 8.17.  Granted-Service-Unit AVP
                 	aVP_Header := m_aVP_HeaderVid(c_vendIdGranted_Service_Unit_AVP,8, omit),
                	tariff_Time_Change  := omit,
					cC_Time  := omit,
					cC_Money  := omit,
					cC_Total_Octets  := omit,
					cC_Input_Octets  := omit,
					cC_Output_Octets  := omit,
					cC_Service_Specific_Units := omit,
					aVP := omit				
				}
				
           template Flow_Description_AVP m_flowDescription_dummy := {
               aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Description_AVP,8, omit),
    		   aVP_Data := {
    			   action_ := "permit",
    			   direction := "out",
    			   proto := "ip",
    			   src := {ipno := 4, addr := "1.2.3.4", mask := omit},
    			   dst := {ipno := 4, addr := "1.2.3.4", mask := omit},
    			   ports := "",
    			   options := omit
    		   }
    	   }
    	   
    	   template Flow_Description_AVP m_flowDescription (UTF8String p_action, UTF8String p_direction, UTF8String p_proto,
    	   			IP_AddressMask p_src, IP_AddressMask p_dst, UTF8String p_ports, UTF8String p_options) := {
               aVP_Header := m_aVP_HeaderVid(c_vendIdFlow_Description_AVP,
               						8
               						+ lengthof(p_action)
               						+ lengthof(p_direction)
               						+ lengthof(encvalue(p_src))
               						+ lengthof(encvalue(p_dst))
               						+ lengthof(p_ports)
               						+ lengthof(p_options),
               						omit),
    		   aVP_Data := {
    			   action_ := p_action,
    			   direction := p_direction,
    			   proto := p_proto,
    			   src := p_src,
    			   dst := p_dst,
    			   ports := p_ports,
    			   options := p_options
    		   }
    	   }


            template Sponsored_Connectivity_Data_AVP mw_sponsoredConnectivityData
@@ -581,17 +574,12 @@ module DiameterRx_Templates {
          	
          	
          	
          	template Experimental_Result_Code_AVP mw_ExperimentalResultCode(template Experimental_Result_Type p_aVP_Data) := {
          	template Experimental_Result_Code_AVP mw_experimentalResultCode(template Experimental_Result_Type p_aVP_Data) := {
				//	Ref: 3GPP TS 29.229	6.2 Result-Code AVP values
					aVP_Header := ?,
					aVP_Data := p_aVP_Data
				}

			template Experimental_Result_AVP mw_ExperimentalResult(template Experimental_Result_Code_AVP p_ExperimentalResultCode) := {
					aVP_Header := ?,
					vendor_Id := ?,
					experimental_Result_Code := p_ExperimentalResultCode		
				}