LibItsBtp_Templates.ttcn 3.75 KB
Newer Older
berge's avatar
berge committed
/**
 *  @author   ETSI / STF405
 *  @version  $URL$
 *            $Id$
 *  @desc     Basic Transport Protocol Templates
 *
 */
module LibItsBtp_Templates {
    
    // LibIts
    import from LibIts_Interface all;
    import from LibItsBtp_TypesAndValues all;
fischer's avatar
fischer committed
    import from LibItsBtp_Pixits all;
        
berge's avatar
berge committed
    group btpPrimitivesTemplates {
berge's avatar
berge committed

        template (value) BtpReq m_geoNwReq(
fischer's avatar
fischer committed
            template (value) BtpPacket p_btpPkt
berge's avatar
berge committed
            ) := {
fischer's avatar
fischer committed
            msgOut := p_btpPkt
berge's avatar
berge committed
        }
        
        template BtpInd mw_geoNwInd(
fischer's avatar
fischer committed
            template (present) BtpPacket p_btpPkt
berge's avatar
berge committed
            ) := {
fischer's avatar
fischer committed
            msgIn := p_btpPkt
berge's avatar
berge committed
        }
berge's avatar
berge committed
    
        group utPrimitives {
            
            /**
             * @desc Generate a BTP A packet
             * @param p_destPort  The destination port
             * @param p_srcPort   The source port
             */
            template (value) UtBtpEvent m_generateBtpAPacket(in BtpPortId p_destPort, in BtpPortId p_srcPort) := {
                btpA := {
                    destinationPort := p_destPort,
                    sourcePort := p_srcPort
                }
            }
            
            /**
             * @desc Generate a BTP B packet
             * @param p_destPort      The destination port
             * @param p_destPortInfo  The destination port information
             */
            template (value) UtBtpEvent m_generateBtpBPacket(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := {
                btpB := {
                    destinationPort := p_destPort,
                    destinationPortInfo := p_destPortInfo
                }
            }
            
            /**
             * @desc Generate a BTP B packet
             * @param p_destPort      The destination port
             * @param p_destPortInfo  The destination port information
             */
            template (value) UtBtpEvent m_checkPayload(in BtpPayload p_payload) := {
                payload := p_payload
            }
            
        } // end utPrimitives
        
berge's avatar
berge committed
    } // btpPrimitivesTemplates
    
    group btpPduTemplates {
fischer's avatar
fischer committed
        
        template(value) BtpPacket m_btpA (	template (value) BtpPortId 	p_DestPort,
        									template (value) BtpPortId 	p_SrcPort,
        									template (value) BtpPayload p_payload
        )
         := {
			header := { btpAHeader := {	destinationPort := p_DestPort, 
			    						sourcePort := p_SrcPort}}, 
            payload := p_payload
		}

        template(value) BtpPacket m_btpB (	template (value) BtpPortId 		p_DestPort,
        									template (value) BtpPortInfo 	p_DestPortInfo,
        									template (value) BtpPayload 	p_payload
        )
         := {
			header := { btpBHeader := {	destinationPort := 		p_DestPort, 
                						destinationPortInfo := 	p_DestPortInfo}}, 
            payload := p_payload
		}

        template(present) BtpPacket mw_btpA (	template (present) 	BtpPortId 	p_DestPort,
        										template (present) 	BtpPortId 	p_SrcPort,
        										template 			BtpPayload 	p_payload
        )
         := {
			header := { btpAHeader := {	destinationPort := p_DestPort, 
			    						sourcePort := p_SrcPort}}, 
            payload := p_payload
		}

        template(present) BtpPacket mw_btpB (	template (present) 	BtpPortId 	p_DestPort,
        										template (present) 	BtpPortInfo p_DestPortInfo,
        										template 			BtpPayload 	p_payload
        )
         := {
			header := { btpBHeader := {	destinationPort := 		p_DestPort, 
                						destinationPortInfo := 	p_DestPortInfo}}, 
            payload := p_payload
		}
berge's avatar
berge committed

    } // end btpPduTemplates
    
    
} // end LibItsBtp_Templates