LibItsBtp_Templates.ttcn 6.81 KB
Newer Older
berge's avatar
berge committed
/**
 *  @author   ETSI / STF405
 *  @version  $URL$
 *            $Id$
 *  @desc     Basic Transport Protocol Templates
 *
 */
module LibItsBtp_Templates {
    
    // LibIts
reinaortega's avatar
reinaortega committed
    import from LibItsBtp_TestSystem all;
berge's avatar
berge committed
    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
        /**
         * @desc    Send template for BTP packet (BtpPort Primitive)
         * @param   p_btpPkt BTP Packet to be sent
         */
        template (value) BtpReq m_btpReq(
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
        /**
         * @desc    Receive template for BTP packet (BtpPort Primitive)
         * @param   p_btpPkt BTP Packet to be received
         */
        template BtpInd mw_btpInd(
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 Initializes the BTP IUT. 
             */
            template (value) UtInitialize m_btpInitialize := {
                utBtpInitialize := {
                }
            }
            
            /**
             * @desc Generate a BTP A packet
             * @param p_destPort  The destination port
             * @param p_srcPort   The source port
             */
            template (value) UtEvent m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := {
                utBtpEvent := {
                    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) UtEvent m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := {
                utBtpEvent := {
                    btpB := {
                        destinationPort := p_destPort,
                        destinationPortInfo := p_destPortInfo
                    }
             * @desc Upper Tester template for checking that BTP payload has been transmitted to upper layer
             * @param p_payload Payload to be checked
            template (value) UtEvent m_checkPayload(in BtpPayload p_payload) := {
                utBtpEvent := {
                    payload := p_payload
                }
berge's avatar
berge committed
    } // btpPrimitivesTemplates
    
    group btpPduTemplates {
fischer's avatar
fischer committed
        
berge's avatar
berge committed
        /**
         * @desc    Send template for BTP-A packet
         * @param   p_destPort  Destination port
         * @param   p_srcPort   Source port
         * @param   p_payload   Payload
         */
        template (value) BtpPacket m_btpA (
            template (value) BtpPayload p_payload
        ):= {
            header := { 
                btpAHeader := {
                    destinationPort := PX_DESTINATION_PORT, 
                    sourcePort := PX_SOURCE_PORT
                }
            }, 
            payload := p_payload
        }

        /**
         * @desc    Send template for BTP-B packet
         * @param   p_destPort      Destination port
         * @param   p_destPortInfo  Destination port information
         * @param   p_payload       Payload
         */
        template( value) BtpPacket m_btpB (
            template (value) BtpPayload     p_payload
        ) := {
            header := { 
                btpBHeader := {
                    destinationPort := PX_DESTINATION_PORT, 
                    destinationPortInfo := 0
                }
            }, 
            payload := p_payload
        }
        
berge's avatar
berge committed
        /**
berge's avatar
berge committed
         * @desc    Send template for BTP-A packet with port parameters
berge's avatar
berge committed
         * @param   p_destPort  Destination port
         * @param   p_srcPort   Source port
         * @param   p_payload   Payload
         */
berge's avatar
berge committed
        template (value) BtpPacket m_btpAWithPorts (
berge's avatar
berge committed
            template (value) BtpPortId  p_destPort,
            template (value) BtpPortId  p_srcPort,
            template (value) BtpPayload p_payload
        ):= {
            header := { 
                btpAHeader := {
                    destinationPort := p_destPort, 
                    sourcePort := p_srcPort
                }
            }, 
fischer's avatar
fischer committed
            payload := p_payload
berge's avatar
berge committed
        }
fischer's avatar
fischer committed

berge's avatar
berge committed
        /**
berge's avatar
berge committed
         * @desc    Send template for BTP-B packet with port parameters
berge's avatar
berge committed
         * @param   p_destPort      Destination port
         * @param   p_destPortInfo  Destination port information
         * @param   p_payload       Payload
         */
berge's avatar
berge committed
        template( value) BtpPacket m_btpBWithPorts (
berge's avatar
berge committed
            template (value) BtpPortId      p_destPort,
            template (value) BtpPortInfo    p_destPortInfo,
            template (value) BtpPayload     p_payload
        ) := {
            header := { 
                btpBHeader := {
                    destinationPort := p_destPort, 
                    destinationPortInfo := p_destPortInfo
                }
            }, 
fischer's avatar
fischer committed
            payload := p_payload
		}

berge's avatar
berge committed
        /**
         * @desc    Receive template for BTP-A packet
         * @param   p_destPort  Destination port
         * @param   p_srcPort   Source port
         * @param   p_payload   Payload
         */
        template 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
                }
            }, 
fischer's avatar
fischer committed
            payload := p_payload
berge's avatar
berge committed
        }
fischer's avatar
fischer committed

berge's avatar
berge committed
        /**
         * @desc    Receive template for BTP-B packet
         * @param   p_destPort      Destination port 
         * @param   p_destPortInfo  Destination port information
         * @param   p_payload       Payload
         */
        template 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
                }
            }, 
fischer's avatar
fischer committed
            payload := p_payload
berge's avatar
berge committed
        }
berge's avatar
berge committed

    } // end btpPduTemplates
    
    
} // end LibItsBtp_Templates