Skip to content
LibItsGeoNetworking_Templates.ttcn 74.4 KiB
Newer Older
berge's avatar
berge committed
/**
berge's avatar
berge committed
 *  @author     ETSI / STF405
 *  @version    $URL$
 *              $Id$
 *  @desc       GeoNetworking Templates
berge's avatar
berge committed
 *
 */
module LibItsGeoNetworking_Templates {
berge's avatar
berge committed
    
    // Libcommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
berge's avatar
berge committed
    
    // LibIts
    import from LibIts_Interface all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsIpv6OverGeoNetworking_TypesAndValues {type MacAddress}
    import from LibItsGeoNetworking_Pixits all;
    import from LibItsCommon_TypesAndValues all;
berge's avatar
berge committed
    
    group geoNwPrimitivesTemplates {
berge's avatar
berge committed

        /**
         * @desc    Send template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg GeoNetworking packet to be sent
         */    
        template (value) GeoNetworkingReq m_geoNwReq(
            template (value) GeoNetworkingPacket p_geoNwMsg
            macDestinationAddress := c_llBroadcast
        }

        /**
         * @desc    Send template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg              GeoNetworking packet to be sent
         * @param   p_llDestinationAdress   Link-layer destination address
         */    
        template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination(
            template (value) GeoNetworkingPacket p_geoNwMsg,
            template (value) MacAddress p_llDestinationAdress
        ) modifies m_geoNwReq := {
            macDestinationAddress := p_llDestinationAdress
berge's avatar
berge committed

        /**
         * @desc    Receive template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg GeoNetworking packet to be received
         */            
        template GeoNetworkingInd mw_geoNwInd(
            template (present) GeoNetworkingPacket p_geoNwMsg
            ) := {
            macDestinationAddress := ? 

        /**
         * @desc    Receive template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg              GeoNetworking packet to be received
         * @param   p_llDestinationAdress   Link-layer destination address
         */            
        template GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination(
            template (present) GeoNetworkingPacket p_geoNwMsg,
            template (present) MacAddress p_llDestinationAdress
        ) modifies mw_geoNwInd := {
            macDestinationAddress := p_llDestinationAdress 
        }
                
        group utPrimitives {
            
            /**
             * @desc Initializes the GN IUT. 
             */
            template (value) UtInitialize m_gnInitialize := {
                utGNInitialize := {
                }
            }
            
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination
             * @param   p_destinationGnAddr Destination of the GeoUnicast message  
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := {
                utGnEvent := {
                    geoUnicast := {
                        gnAddress := p_destinationGnAddr,
                        lifetime := omit,
                        payload := omit
                    }
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination with specific lifetime
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
berge's avatar
berge committed
             * @param   p_lifetime          Lifetime of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoUnicastMessageWithLifetime(
                GN_Address p_destinationGnAddr,
                integer p_lifetime
            ) modifies m_generateGeoUnicastMessage := {
                utGnEvent := {
                    geoUnicast := {
                        lifetime := p_lifetime
                    }
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination with a payload
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
berge's avatar
berge committed
             * @param   p_payload           Payload of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoUnicastMessageWithPayload(
                GN_Address p_destinationGnAddr,
                Payload p_payload
            ) modifies m_generateGeoUnicastMessage := {
                utGnEvent := {
                    geoUnicast := {
                        payload := p_payload
                    }
            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @param   p_area  Destination area of the message
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoBroadcastMessage(
berge's avatar
berge committed
                GeoArea p_area
                utGnEvent := {
                    geoBroadcast := {
                        area := p_area,
                        payload := omit
                    }
            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area with a payload
             * @param   p_area      Destination area of the message
berge's avatar
berge committed
             * @param   p_payload   Payload of the GeoBroadcast message
             * @see     m_generateGeoBroadcastMessage
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoBroadcastMessageWithPayload(
berge's avatar
berge committed
                GeoArea p_area,
                Payload p_payload
            ) modifies m_generateGeoBroadcastMessage := {
                utGnEvent := {
                    geoBroadcast := {
                        payload := p_payload
                    }
            /**
             * @desc    Request IUT to send a GeoAnycast message to a specific area
             * @param   p_area  Destination area of the message 
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoAnycastMessage(
berge's avatar
berge committed
                GeoArea p_area
                utGnEvent := {
                    geoAnycast := {
                        area := p_area,
                        payload := omit
                    }
            /**
             * @desc    Request IUT to send a GeoAnycast message to a specific area with a payload
             * @param   p_area      Destination area of the message
berge's avatar
berge committed
             * @param   p_payload   Payload of the GeoAnycast message
             * @see     m_generateGeoAnycastMessage
berge's avatar
berge committed
             */
            template UtEvent m_generateGeoAnycastMessageWithPayload(
berge's avatar
berge committed
                GeoArea p_area,
                Payload p_payload
            ) modifies m_generateGeoAnycastMessage := {
                utGnEvent := {
                    geoAnycast := {
                        payload := p_payload
                    }
            /**
             * @desc    Request IUT to send a SHB message
berge's avatar
berge committed
             */
            template UtEvent m_generateShbMessage := {
                utGnEvent := {
                    shb := {
                        payload := omit
                    }
Loading full blame...