Commit d218ff0b authored by pintar's avatar pintar
Browse files

Templates for Lower Layer Primitives

parent bbcab845
Loading
Loading
Loading
Loading
+108 −5
Original line number Diff line number Diff line
@@ -20,12 +20,115 @@ module LibDiameter_Templates {
    //LibDiameter
    import from LibDiameter_TypesAndValues all;
    
    group Constants{//move constants into Type module
    	const UInt8 c_versionId := 1;
        const integer c_applidCommonMsg :=  0;			//For DWR, DWA
        const integer c_applidSip := 16777216;			//For other messages 16777216 (Vendor specific applications = 16777216 - 4294967294(0x01000000-0xfffffffe))
    group LowerLayerPrimitives {
        
        template Lower_Layer_Primitive m_llp_listen(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          ll_header := m_llh_listen(p_ETS_address, p_ETS_port, p_SUT_address, p_SUT_port, p_ETS_conn),
          pdu := omit
        }
        
        template Lower_Layer_Primitive m_llp_connect(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          ll_header := m_llh_connect(p_ETS_address, p_ETS_port, p_SUT_address, p_SUT_port, p_ETS_conn),
          pdu := omit
        }
        
        template Lower_Layer_Primitive mw_llp_connectIndication(template charstring p_ETS_address,  template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          ll_header := mw_llh_connectIndication(p_ETS_address, p_ETS_port, p_SUT_address, p_SUT_port, p_ETS_conn),
          pdu := *
        }
        
        template Lower_Layer_Primitive m_llp_disconnect(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          ll_header := m_llh_disconnect(p_ETS_address, p_ETS_port, p_SUT_address, p_SUT_port, p_ETS_conn),
          pdu := omit
        }
        
        template Lower_Layer_Primitive mw_llp_disconnectIndication(template charstring p_ETS_address,  template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          ll_header := mw_llh_disconnectIndication(p_ETS_address, p_ETS_port, p_SUT_address, p_SUT_port, p_ETS_conn),
          pdu := *
        }
                
        template Lower_Layer_Primitive m_llp_dataRequest( template integer p_ETS_conn, template DIAMETER_MSG p_pdu) := {
          ll_header := m_llh_dataRequest(p_ETS_conn),  //TODO: p_ETS_conn shall be declared as vc_ETS_conn with value 1
          pdu := p_pdu
        }
                
        template Lower_Layer_Primitive m_llp_dataIndication(template integer p_ETS_conn, template DIAMETER_MSG p_pdu) := {
          ll_header := mw_llh_dataIndication(p_ETS_conn),
          pdu := p_pdu
        }
        
        template Lower_Layer_Header m_llh_listen(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          primitive := LISTEN_REQUEST_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := p_ETS_address,
          ETS_port := p_ETS_port,
          SUT_address := p_SUT_address,
          SUT_port := p_SUT_port,
          ETS_conn := p_ETS_conn
        }
        
        template Lower_Layer_Header m_llh_connect(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          primitive := CONNECT_REQUEST_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := p_ETS_address,
          ETS_port := p_ETS_port,
          SUT_address := p_SUT_address,
          SUT_port := p_SUT_port,
          ETS_conn := p_ETS_conn
        }
        
        template Lower_Layer_Header mw_llh_connectIndication(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template  integer p_ETS_conn) := {
          primitive := CONNECT_INDICATION_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := p_ETS_address,
          ETS_port := p_ETS_port,
          SUT_address := p_SUT_address,
          SUT_port := p_SUT_port,
          ETS_conn := p_ETS_conn
        }
        
        template Lower_Layer_Header m_llh_disconnect(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template integer p_ETS_conn) := {
          primitive := DISCONNECT_REQUEST_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := p_ETS_address,
          ETS_port := p_ETS_port,
          SUT_address := p_SUT_address,
          SUT_port := p_SUT_port,
          ETS_conn := p_ETS_conn
        }
        
        template Lower_Layer_Header mw_llh_disconnectIndication(template charstring p_ETS_address, template integer p_ETS_port, template charstring p_SUT_address, template integer p_SUT_port, template  integer p_ETS_conn) := {
          primitive := DISCONNECT_INDICATION_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := p_ETS_address,
          ETS_port := p_ETS_port,
          SUT_address := p_SUT_address,
          SUT_port := p_SUT_port,
          ETS_conn := p_ETS_conn
        }
        
        template Lower_Layer_Header m_llh_dataRequest(template integer p_ETS_conn) := {
          primitive := DATA_REQUEST_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := omit,
          ETS_port := omit,
          SUT_address := omit,
          SUT_port := omit,
          ETS_conn := p_ETS_conn
        } 
        
        template Lower_Layer_Header mw_llh_dataIndication(template integer p_ETS_conn) := {
          primitive := DATA_INDICATION_E,
          transport_used := c_defaultTransportProtocol,
          ETS_address := *,
          ETS_port := *,
          SUT_address := *,
          SUT_port := *,
          ETS_conn := p_ETS_conn
        }         
        
    }//end group LowerLayerPrimitives
    
    //internal PIXITS if some
    group ModuleParameters {
	} //end group ModuleParameters
+22 −8
Original line number Diff line number Diff line
@@ -15,7 +15,21 @@ module LibDiameter_TypesAndValues {
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    
group BasicTypes{
group BasicTypesAndConstants{
   
    group GlobalConstants{

        // Default DIAMETER protocol : TCP
        const charstring c_defaultTransportProtocol := "TCP";
    
    }
    
    group DiameterConstants{//move constants into Type module
    
        const UInt8 c_versionId := 1;
        const integer c_applidCommonMsg :=  0;			//For DWR, DWA
        const integer c_applidSip := 16777216;			//For other messages 16777216 (Vendor specific applications = 16777216 - 4294967294(0x01000000-0xfffffffe))
    }
		
	group NumberTypes {
	    // below constants and types are not defined in library libCommon
@@ -2699,13 +2713,13 @@ group BasicTypes{
    		
            // ASP type definition.
            type enumerated ASP_type {
                Connect_Request(1),
                Connect_Indication(2),
                Disconnect_Request(3),
                Disconnect_Indication(4),
                Data_Request(5),
                Data_Indication(6),
                Listen_Request(7)
                CONNECT_REQUEST_E(1),
                CONNECT_INDICATION_E(2),
                DISCONNECT_REQUEST_E(3),
                DISCONNECT_INDICATION_E(4),
                DATA_REQUEST_E(5),
                DATA_INDICATION_E(6),
                LISTEN_REQUEST_E(7)
            }
			
		}//end group Other