Skip to content
LibItsGeoNetworking_Templates.ttcn 104 KiB
Newer Older
berge's avatar
berge committed
/**
garciay's avatar
garciay committed
 *  @author     ETSI / STF405 / STF449 / STF484 / STF517
berge's avatar
berge committed
 *  @version    $URL$
 *              $Id$
 *  @desc       GeoNetworking Templates
garciay's avatar
garciay committed
 *  @copyright   ETSI Copyright Notification
 *               No part may be reproduced except as authorized by written permission.
 *               The copyright and the foregoing restriction extend to reproduction in all media.
 *               All rights reserved.
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
    
garciay's avatar
garciay committed
    // LibItsCommon
    import from LibItsCommon_TypesAndValues all;
garciay's avatar
garciay committed
    import from LibItsExternal_TypesAndValues all;
    
    // LibItsBtp
    //    import from LibItsBtp_Templates all;
filatov's avatar
filatov committed
//    import from LibItsBtp_EncdecDeclarations all;
garciay's avatar
garciay committed
    
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
filatov's avatar
filatov committed
//    import from LibItsSecurity_Pixits all;
garciay's avatar
garciay committed
    
    // LibItsIpv6OverGeoNetworking
    //import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
    //import from LibItsIpv6OverGeoNetworking_Templates all;
garciay's avatar
garciay committed
    
    // AtsGeoNetworking
reinaortega's avatar
reinaortega committed
    import from LibItsGeoNetworking_TestSystem all;
tepelmann's avatar
tepelmann committed
    import from LibItsGeoNetworking_TypesAndValues all;
reinaortega's avatar
reinaortega committed
    import from LibItsGeoNetworking_Pixits all;
filatov's avatar
filatov committed
//    import from LibItsGeoNetworking_EncdecDeclarations all;
berge's avatar
berge committed
    
    group geoNwPrimitivesTemplates {
tepelmann's avatar
tepelmann committed
        
berge's avatar
berge committed
        /**
         * @desc    Send template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg GeoNetworking packet to be sent
         * @param   p_its_aid  ITS-AID used in secured mode. Default: 0, means unused
tepelmann's avatar
tepelmann committed
         */
filatov's avatar
filatov committed
        template (omit) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast(
            in template (value) GeoNetworkingPdu p_geoNwMsg,
            in template (value) UInt32 p_its_aid := 0
            macDestinationAddress   := c_llBroadcast,
            its_aid                 := p_its_aid
tepelmann's avatar
tepelmann committed
        
        /**
         * @desc    Send template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg              GeoNetworking packet to be sent
         * @param   p_its_aid               ITS-AID used in secured mode. Default: 0, means unused
         * @param   p_llDestinationAdress   Link-layer destination address
tepelmann's avatar
tepelmann committed
         */
filatov's avatar
filatov committed
        template (omit) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination(
            in template (value) GeoNetworkingPdu p_geoNwMsg,
            in template (value) UInt32 p_its_aid := 0,
            in template (value) MacAddress p_llDestinationAdress
berge's avatar
berge committed
        ) modifies m_geoNwReq_linkLayerBroadcast := {
            macDestinationAddress := p_llDestinationAdress
tepelmann's avatar
tepelmann committed
        
berge's avatar
berge committed
        /**
         * @desc    Receive template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg GeoNetworking packet to be received
tepelmann's avatar
tepelmann committed
         */
        template GeoNetworkingInd mw_geoNwInd(
tepelmann's avatar
tepelmann committed
            template (present) GeoNetworkingPdu p_geoNwMsg
            msgIn                   := p_geoNwMsg,
            macDestinationAddress   := ?,
            ssp                     := *,
            its_aid                 := *
tepelmann's avatar
tepelmann committed
        
        /**
         * @desc    Receive template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg              GeoNetworking packet to be received
         * @param   p_llDestinationAdress   Link-layer destination address
tepelmann's avatar
tepelmann committed
         */
        template GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination(
tepelmann's avatar
tepelmann committed
            template (present) GeoNetworkingPdu p_geoNwMsg,
            template (present) MacAddress p_llDestinationAdress
        ) modifies mw_geoNwInd := {
tepelmann's avatar
tepelmann committed
            macDestinationAddress := p_llDestinationAdress
tepelmann's avatar
tepelmann committed
        
        group utPrimitives {
            
tepelmann's avatar
tepelmann committed
             * @desc Initializes the GN IUT.
garciay's avatar
garciay committed
            template (value) UtGnInitialize m_gnInitialize := {
garciay's avatar
garciay committed
                hashedId8 := '0000000000000000'O
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination
tepelmann's avatar
tepelmann committed
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := {
                geoUnicast := {
tepelmann's avatar
tepelmann committed
                    lifetime := c_lifetime,
                    trafficClass := valueof(m_trafficClass),
                    payload := ''O
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination with specific lifetime
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
             * @param   p_trafficClass      TrafficClass of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
             */
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithTrafficClass(
                GN_Address p_destinationGnAddr,
                TrafficClass p_trafficClass
            ) modifies m_generateGeoUnicastMessage := {
                geoUnicast := {
                    trafficClass := p_trafficClass
                }
            }
                        
            /**
             * @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
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetime(
                GN_Address p_destinationGnAddr,
tepelmann's avatar
tepelmann committed
                UInt16 p_lifetime
            ) modifies m_generateGeoUnicastMessage := {
            /**
             * @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
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithPayload(
                GN_Address p_destinationGnAddr,
berge's avatar
berge committed
                octetstring p_payload
            ) modifies m_generateGeoUnicastMessage := {
                geoUnicast := {
                    payload := p_payload
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Request IUT to send a GeoUnicast message to a specific destination with specific lifetime with specific payload
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
             * @param   p_lifetime          Lifetime of the GeoUnicast message
             * @param   p_payload           Payload of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload(
tepelmann's avatar
tepelmann committed
                GN_Address p_destinationGnAddr,
tepelmann's avatar
tepelmann committed
                UInt16 p_lifetime,
tepelmann's avatar
tepelmann committed
                octetstring p_payload
            ) modifies m_generateGeoUnicastMessageWithLifetime := {
                    payload := p_payload
tepelmann's avatar
tepelmann committed
            }
            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @param   p_geoArea  Destination area of the message
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoBroadcastMessage(
garciay's avatar
garciay committed
                    shape := p_geoArea.shape,
tepelmann's avatar
tepelmann committed
                    lifetime := c_lifetime,
                    trafficClass := valueof(m_trafficClass),
                    reserved := c_uInt24Zero,
                    payload := ''O

            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @param   p_geoArea           Destination area of the message
             * @param   p_trafficClass      TrafficClass of the GeoUnicast message
             */
            template (value) UtGnTrigger m_generateGeoBroadcastMessageWithTrafficClass(
                GeoArea p_geoArea,
                TrafficClass p_trafficClass
            ) modifies m_generateGeoBroadcastMessage := {
                geoBroadcast := {
                    trafficClass := p_trafficClass
                }
            }
                        
berge's avatar
berge committed
            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @param   p_geoArea   Destination area of the message
berge's avatar
berge committed
             * @param   p_lifetime  Packet's lifetime
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoBroadcastMessageWithLifetime(
tepelmann's avatar
tepelmann committed
                UInt16 p_lifetime
berge's avatar
berge committed
            ) modifies m_generateGeoBroadcastMessage := {
            /**
             * @desc    Request IUT to send a GeoBroadcast message to a specific area with a payload
             * @param   p_geoArea   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
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoBroadcastMessageWithPayload(
berge's avatar
berge committed
                octetstring p_payload
            ) modifies m_generateGeoBroadcastMessage := {
                    payload := p_payload
            /**
             * @desc    Request IUT to send a GeoAnycast message to a specific area
             * @param   p_geoArea  Destination area of the message
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoAnycastMessage(
garciay's avatar
garciay committed
                    shape := p_geoArea.shape,
tepelmann's avatar
tepelmann committed
                    lifetime := c_lifetime,
                    trafficClass := valueof(m_trafficClass),
                    reserved := c_uInt24Zero,
                    payload := ''O

            /**
             * @desc    Request IUT to send a GeoAnycast message to a specific area with a payload
             * @param   p_geoArea           Destination area of the message
             * @param   p_trafficClass      TrafficClass of the GeoUnicast message
             * @see     m_generateGeoAnycastMessage
             */
            template (value) UtGnTrigger m_generateGeoAnycastMessageWithTrafficClass(
                GeoArea p_geoArea,
                TrafficClass p_trafficClass
            ) modifies m_generateGeoAnycastMessage := {
                geoAnycast := {
                    trafficClass := p_trafficClass
                }
            }
                        
            /**
             * @desc    Request IUT to send a GeoAnycast message to a specific area with a payload
             * @param   p_geoArea   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
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateGeoAnycastMessageWithPayload(
berge's avatar
berge committed
                octetstring p_payload
            ) modifies m_generateGeoAnycastMessage := {
                    payload := p_payload
            /**
             * @desc    Request IUT to send a SHB message
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateShbMessage := {
                    trafficClass := valueof(m_trafficClass),
                    payload := ''O
 
            /**
             * @desc    Request IUT to send a SHB message with a payload
             * @param   p_trafficClass      TrafficClass of the GeoUnicast message
             * @see     m_generateShbMessage
             */
            template (value) UtGnTrigger m_generateShbMessageWithTrafficClass(
                TrafficClass p_trafficClass
            ) modifies m_generateShbMessage := {
                shb := {
                    trafficClass := p_trafficClass
                }
            }
                        
            /**
             * @desc    Request IUT to send a SHB message with a payload
berge's avatar
berge committed
             * @param   p_payload   Payload of the SHB message
             * @see     m_generateShbMessage
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateShbMessageWithPayload(
berge's avatar
berge committed
                octetstring p_payload
            ) modifies m_generateShbMessage := {
                    payload := p_payload
berge's avatar
berge committed
            
            /**
             * @desc    Request IUT to send a TSB message
tepelmann's avatar
tepelmann committed
            template (value) UtGnTrigger m_generateTsbMessage := {
garciay's avatar
garciay committed
                    nbHops := 10,
                    lifetime := c_lifetime,
                    trafficClass := valueof(m_trafficClass),
                    payload := ''O
            /**
             * @desc    Request IUT to send a TSB message
             * @param   p_lifetime  Packet's lifetime
             */
            template (value) UtGnTrigger m_generateTsbMessageWithLifetime(
                UInt16 p_lifetime
            ) modifies m_generateTsbMessage := {
                tsb := {
                    lifetime := p_lifetime
                }
            }
            
            /**
             * @desc    Request IUT to send a TSB message
             * @param   p_trafficClass      TrafficClass of the GeoUnicast message
             */
            template (value) UtGnTrigger m_generateTsbMessageWithTrafficClass(
                TrafficClass p_trafficClass
            ) modifies m_generateTsbMessage := {
                tsb := {
                    trafficClass := p_trafficClass
                }
            }
                        
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Request IUT to change its position
             */
garciay's avatar
garciay committed
            template (value) UtGnChangePosition m_changePosition := {
                latitude := 1000,
                longitude := 0,
                elevation := 0
tepelmann's avatar
tepelmann committed
            }
            
        } // end utPrimitives
        
        group taPrimitives {
            
berge's avatar
berge committed
            /**
             * @desc Testsystem will start beaconing for the given neighbor
             * @param p_beaconHeader The neighbor information
berge's avatar
berge committed
            template (value) AcGnPrimitive m_startBeaconing(
berge's avatar
berge committed
                template (value) BeaconHeader p_beaconHeader
            ) := {
                startBeaconing := {
                    beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1)
berge's avatar
berge committed
            /**
             * @desc Testsystem will stop beaconing for the given neighbor
             * @param p_compName The neighbor
berge's avatar
berge committed
            template AcGnPrimitive m_stopBeaconing := {
                stopBeaconing:= {
                }
            }
            
            /**
             * @desc Testsystem will pass received to the TTCN-3
             * @param p_beaconHeader The neighbor information
             */
berge's avatar
berge committed
            template AcGnPrimitive m_startPassBeaconing(
berge's avatar
berge committed
                template (value) BeaconHeader p_beaconHeader
            ) := {
                startPassBeaconing := {
                    beaconHeader := p_beaconHeader
                }
            }
            
            /**
             * @desc Testsystem will stop passing beacon information to the TTCN-3
             */
berge's avatar
berge committed
            template AcGnPrimitive m_stopPassBeaconing := {
                stopPassBeaconing := {
                }
            }
             * @desc Testsystem will start beaconing for multiple neighbors
             * @param p_beaconHeader The neighbor information
             * @param p_numberOfNeighbour The number of ITS stations for which TS will send beacons
berge's avatar
berge committed
            template (value) AcGnPrimitive m_startBeaconingMultipleNeighbour(
                template (value) BeaconHeader p_beaconHeader,
                integer p_numberOfNeighbour
            ) := {
                startBeaconingMultipleNeighbour := {
                    beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1),
                    numberOfNeighbour := p_numberOfNeighbour
                }
            }
            
            /**
             * @desc Testsystem will stop beaconing for multiple neighbors
             * @param p_compName The neighbor
             */
berge's avatar
berge committed
            template AcGnPrimitive m_stopBeaconingMultipleNeighbour := {
                stopBeaconingMultipleNeighbour:= {
                }
tepelmann's avatar
tepelmann committed
             * @desc Testsystem will reply the LongPosVector including the requested GN address
             *       found in received beacon information to the TTCN-3
             * @param p_gnAddress The GN address included in the LongPosVector
berge's avatar
berge committed
            template AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := {
                getLongPosVector := {
                    gnAddress := p_gnAddress
                }
            }
            
            /**
             * @desc    Receive template adapter control result for long position vector with specific GN_Address
             * @param   p_gnAddress GN_Address to be contained in the long position vector
             */
berge's avatar
berge committed
            template AcGnResponse mw_getLongPosVectorAny(template (present) GN_Address p_gnAddress) := {
                getLongPosVector := mw_longPosVectorAny(p_gnAddress)
            }
        } // end taPrimitives
    } // geoNwPrimitivesTemplates
    
    group geoNwPduTemplates {
        
tepelmann's avatar
tepelmann committed
         * @desc    Send template for GeoNetworking PDU
         * @param   p_packet    GnNonSecuredPacket of GeoNetworking message
         * @param   p_lifeTime  Lifetime of GeoNetworking message (Default: m_defaultLifetime)
         * @param   p_hopLimit  Router Hop limit of GeoNetworking message (Default: c_defaultHopLimit)
         */
        template (value) GeoNetworkingPdu m_geoNwPdu(
            in template (value) GnNonSecuredPacket p_packet,
            in template (value) Lifetime p_lifeTime := m_defaultLifetime,
            in template (value) UInt8 p_hopLimit := c_defaultHopLimit
        ) := {
            basicHeader := m_basicHeader(p_lifeTime, p_hopLimit),
            gnPacket := {
                packet := p_packet,
                securedMsg := omit
tepelmann's avatar
tepelmann committed
            }
        }
        
        /**
         * @desc    Receive template for GeoNetworking PDU
         * @param   p_packet    GnNonSecuredPacket of GeoNetworking message
         * @param   p_lifeTime  Lifetime of GeoNetworking message (Default: ?)
         * @param   p_hopLimit  Router Hop limit of GeoNetworking message (Default: ?)
         */
        template (present) GeoNetworkingPdu mw_geoNwPdu(
            in template (present) GnNonSecuredPacket p_packet,
            in template (present) Lifetime p_lifeTime := ?,
            in template (present) UInt8 p_hopLimit := ?
        ) := {
            basicHeader := mw_basicHeader(p_lifeTime, p_hopLimit),
            gnPacket := {

        /**
         * @desc    Receive template for secured GeoNetworking PDU
         * @param   p_secMsg    Secured message
         * @param   p_packet    Clear-text version of the packet
         */
        template (present) GeoNetworkingPdu mw_geoNwSecPdu(
            in template (present) SecuredMessage p_secMsg,
            in template (present) GnNonSecuredPacket p_packet := ?
        ) := {
            basicHeader := mw_securedBasicHeader(),
            gnPacket := {
                packet := p_packet,
                securedMsg := p_secMsg
            }
        }
        
        /**
         * @desc    Send template for secured GeoNetworking PDU
         * @param   p_packet    Clear-text version of the packet
         * @param   p_secMsg    Secured message
         */
        template (value) GeoNetworkingPdu m_geoNwSecPdu(
            in template (value) GnNonSecuredPacket p_packet,
            in template (value) SecuredMessage p_secMsg
            basicHeader := m_securedBasicHeader(),
            gnPacket := {
                packet := p_packet,
                securedMsg := p_secMsg
            }
        }
                
tepelmann's avatar
tepelmann committed
    } // end geoNwPduTemplates
    
    group geoNwPacketTemplates {
        
        /**
         * @desc    Send template for GeoNetworking Packet
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
berge's avatar
berge committed
         */
tepelmann's avatar
tepelmann committed
        template (value) GeoNetworkingPacket m_geoNwPacket(
            in template (value) CommonHeader p_commonHeader,
            in template (value) ExtendedHeader p_extHeader
berge's avatar
berge committed
        ) := {
            packet := {
                commonHeader := valueof(p_commonHeader),
                extendedHeader := valueof(p_extHeader),
                payload := char2oct("DEFAULT_PAYLOAD")
garciay's avatar
garciay committed
            securedMsg := omit
tepelmann's avatar
tepelmann committed
         * @desc    Send template for GeoNetworking Packet with no payload
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
tepelmann's avatar
tepelmann committed
         *
tepelmann's avatar
tepelmann committed
         * @see m_geoNwPacket
tepelmann's avatar
tepelmann committed
        template (value) GeoNetworkingPacket m_geoNwPacketNoPayload(
            in template (value) CommonHeader p_commonHeader,
            in template (value) ExtendedHeader p_extHeader
        ) modifies m_geoNwPacket := {
            packet := {
                payload := omit
            }
tepelmann's avatar
tepelmann committed
         * @desc    Send template for GeoNetworking Packet with payload
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
         * @param   p_payload       Payload
tepelmann's avatar
tepelmann committed
         *
tepelmann's avatar
tepelmann committed
         * @see m_geoNwPacket
berge's avatar
berge committed
         */
tepelmann's avatar
tepelmann committed
        template (value) GeoNetworkingPacket m_geoNwPacketWithPayload(
            in template (value) CommonHeader p_commonHeader,
            in template (value) ExtendedHeader p_extHeader,
            in template (value) GnRawPayload p_payload
tepelmann's avatar
tepelmann committed
        ) modifies m_geoNwPacket := {
            packet := {
                payload := p_payload
            }
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for GeoNetworking Packet
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
berge's avatar
berge committed
         */
tepelmann's avatar
tepelmann committed
        template (present) GeoNetworkingPacket mw_geoNwPacket(
            in template (present) CommonHeader p_commonHeader,
            in template (present) ExtendedHeader p_extHeader
berge's avatar
berge committed
        ) := {
tepelmann's avatar
tepelmann committed
            packet := {
                commonHeader := p_commonHeader,
                extendedHeader := p_extHeader,
                payload := *
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for GeoNetworking Packet with any payload
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
tepelmann's avatar
tepelmann committed
         *
tepelmann's avatar
tepelmann committed
         * @see     mw_geoNwPacket
berge's avatar
berge committed
         */
//FIXME RGY template restriction can be the same as its base template: template is not used currently
//        template GeoNetworkingPacket mw_geoNwPduAnyPayload(
        template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload(
tepelmann's avatar
tepelmann committed
            in template (present) CommonHeader p_commonHeader,
            in template (present) ExtendedHeader p_extHeader
tepelmann's avatar
tepelmann committed
        ) modifies mw_geoNwPacket := {
            packet := {
                payload := ?
            }
        }
        
         * @desc    Receive template for GeoNetworking PDU with octetstring payload
tepelmann's avatar
tepelmann committed
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
         * @param   p_payload       Octetstring payload
tepelmann's avatar
tepelmann committed
         *
tepelmann's avatar
tepelmann committed
         * @see     mw_geoNwPacket
berge's avatar
berge committed
         */
//FIXME RGY template restriction can be the same as its base template: template is not used currently
//        template GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload(
        template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload(
tepelmann's avatar
tepelmann committed
            in template (present) CommonHeader p_commonHeader,
            in template (present) ExtendedHeader p_extHeader,
berge's avatar
berge committed
            in template (present) octetstring p_payload
tepelmann's avatar
tepelmann committed
        ) modifies mw_geoNwPacket := {
            packet := {
                payload := p_payload
        
        /**
         * @desc    Receive template for GeoNetworking PDU with payload
tepelmann's avatar
tepelmann committed
         * @param   p_basicHeader   Common header of GeoNetworking packet
         * @param   p_extHeader     Extended header of GeoNetworking packet
         * @param   p_payload       Payload
tepelmann's avatar
tepelmann committed
         *
tepelmann's avatar
tepelmann committed
         * @see     mw_geoNwPacket
//FIXME RGY template restriction can be the same as its base template: used in TC_SEC_ITSS_SND_CAM_02_01_BV only, where is called with parameters
//        template GeoNetworkingPacket mw_geoNwPduWithPayload(
        template(present) GeoNetworkingPacket mw_geoNwPduWithPayload(
tepelmann's avatar
tepelmann committed
            in template (present) CommonHeader p_commonHeader,
            in template (present) ExtendedHeader p_extHeader,
            in template (present) GnRawPayload p_payload
tepelmann's avatar
tepelmann committed
        ) modifies mw_geoNwPacket := {
            packet := {
                payload := p_payload
            }
        }
        
        group geoNwPacketTemplates_ {
berge's avatar
berge committed
            
            /**
             * @desc    Receive template for any GeoNetworking Packet
             */
            template (present) GnNonSecuredPacket mw_geoNwAnyPacket := {
                commonHeader := mw_commonHeader(
                    ?,
                    ?
                ),
                extendedHeader := *,
                payload := *
            }
            
            /**
             * @desc    Receive template for any GeoNetworking Packet with Payload
             * @param   payload  Expected GN payload 
             */
            template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload(
                template (present) GnRawPayload p_payload
berge's avatar
berge committed
            ) := {
                commonHeader := mw_commonHeader(
                    ?,
                    ?
                ),
                extendedHeader := *,
                payload := p_payload
            }
                        
        } // end group geoNwPacketTemplates_
berge's avatar
berge committed
        
tepelmann's avatar
tepelmann committed
        group geoNwPacketUnicastTemplates {
            
            /**
             * @desc    Send template for GeoNetworking Unicast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec          Long position vector of source
             * @param   p_destinationShortPosVec    Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber                 Sequence number of GeoUnicast packet
             * @param   p_hopLimit                  Maximum number of hops (Default: c_defaultHopLimit)
             * @param   p_trafficClass              Traffic Class 
tepelmann's avatar
tepelmann committed
             */
            template (value) GnNonSecuredPacket m_geoNwUnicastPacket(
                in template (value) LongPosVector p_sourceLongPosVec,
                in template (value) ShortPosVector p_destinationShortPosVec,
                in template (value) UInt8 p_hopLimit := c_defaultHopLimit,
                in template (value) TrafficClass p_trafficClass := m_trafficClass
tepelmann's avatar
tepelmann committed
            ) := {
                commonHeader := valueof(m_commonHeader(
tepelmann's avatar
tepelmann committed
                    PX_GN_UPPER_LAYER,
                    m_geoUnicastHeaderType,
                    p_trafficClass,
                )),
                extendedHeader := valueof(m_geoUnicastHeader(
tepelmann's avatar
tepelmann committed
                    p_sourceLongPosVec,
                    p_destinationShortPosVec,
                    p_seqNumber
                payload := valueof(char2oct("DEFAULT_PAYLOAD"))
tepelmann's avatar
tepelmann committed
            }
            
            /**
             * @desc    Receive template for GeoNetworking Unicast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_destinationShortPosVec    Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber                 Sequence number of GeoUnicast packet
             */
            template (present) GnNonSecuredPacket mw_geoNwUnicastPacket(
                in template (present) ShortPosVector p_destinationShortPosVec,
                in template (present) UInt16 p_seqNumber
            ) := {
                commonHeader := mw_commonHeader(
                    PX_GN_UPPER_LAYER,
                    mw_geoUnicastHeaderType
                ),
                extendedHeader := mw_geoUnicastHeader(
                    p_destinationShortPosVec,
                    p_seqNumber
                ),
                payload := ?
            }
            
            /**
             * @desc    Receive template for GeoNetworking Unicast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_destinationShortPosVec    Short position vector of destination
             * @param   p_seqNumber                 Sequence number of GeoUnicast packet
             * @param   p_hopLimit                  Maximum number of hops (Default: ?)
             * @see mw_geoNwUnicastPacket
             */
            template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithHl(
                in template (present) ShortPosVector p_destinationShortPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) UInt8 p_hopLimit := ?
            ) modifies mw_geoNwUnicastPacket := {
                commonHeader := mw_commonHeaderWithHopLimit(
                    PX_GN_UPPER_LAYER,
                    mw_geoUnicastHeaderType,
                    p_hopLimit
                ),
                extendedHeader := mw_geoUnicastHeader(
                    p_destinationShortPosVec,
                    p_seqNumber
                ),
                payload := ?
            }
            
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Receive template for GeoNetworking Unicast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_destinationShortPosVec    Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber                 Sequence number of GeoUnicast packet
             * @param   p_srcLongPosVec             Long position vector of source
             */
            template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithSourcePv(
                in template (present) ShortPosVector p_destinationShortPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) LongPosVector p_srcLongPosVec
            ) modifies mw_geoNwUnicastPacket := {
                extendedHeader := mw_geoUnicastHeaderWithSourcePv(
                    p_destinationShortPosVec,
                    p_seqNumber,
                    p_srcLongPosVec
                )
            }
            
            /**
             * @desc    Receive template for GeoNetworking Unicast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_destinationShortPosVec    Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber                 Sequence number of GeoUnicast packet
             * @param   p_nextHeader                Id of next header
             */
            template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithNextHeader(
                in template (present) ShortPosVector p_destinationShortPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) NextHeader p_nextHeader
            ) modifies mw_geoNwUnicastPacket := {
                commonHeader := {
                    nextHeader := p_nextHeader
                }
            }
            
        } // end group geoNwPacketUnicastTemplates
        
        group geoNwPacketAnycastTemplates {
            
            /**
             * @desc    Send template for GeoNetworking Anycast Packet
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_seqNumber             Sequence number of GeoAnycast packet
             * @param   p_anycastArea           Destination GeoArea
             * @param   p_hopLimit              Maximum number of hops (Default: c_defaultHopLimit)
             * @param   p_trafficClass          Traffic Class 
tepelmann's avatar
tepelmann committed
             */
            template (value) GnNonSecuredPacket m_geoNwAnycastPacket(
                in template (value) LongPosVector p_sourceLongPosVec,
                in template (value) UInt16 p_seqNumber,
                in template (value) GeoAnycastArea p_anycastArea,
                in template (value) UInt8 p_hopLimit := c_defaultHopLimit,
                in template (value) TrafficClass p_trafficClass := m_trafficClass
tepelmann's avatar
tepelmann committed
            ) := {
                commonHeader := valueof(m_commonHeader(
tepelmann's avatar
tepelmann committed
                    PX_GN_UPPER_LAYER,
                    m_geoAnycastHeaderType(valueof(p_anycastArea.geoAnycastSubType)),
                    p_trafficClass,
                )),
                extendedHeader := valueof(m_geoAnycastHeader(
tepelmann's avatar
tepelmann committed
                    p_sourceLongPosVec,
                    p_seqNumber,
                    p_anycastArea
                payload := valueof(char2oct("DEFAULT_PAYLOAD"))
tepelmann's avatar
tepelmann committed
            }
            
            /**
             * @desc    Receive template for GeoNetworking Anycast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber             Sequence number of GeoAnycast packet
             */
            template (present) GnNonSecuredPacket mw_geoNwAnycastPacket(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber
            ) := {
                commonHeader := mw_commonHeader(
                    PX_GN_UPPER_LAYER,
                    mw_geoAnycastHeaderType
                ),
                extendedHeader := mw_geoAnycastHeader(
                    p_sourceLongPosVec,
                    p_seqNumber
                ),
                payload := ?
            }
            
            /**
             * @desc    Receive template for GeoNetworking Anycast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber             Sequence number of GeoAnycast packet
             * @param   p_anycastArea           Destination GeoArea
             */
            template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithArea(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) GeoAnycastArea p_anycastArea
            ) := {
                commonHeader := mw_commonHeader(
                    PX_GN_UPPER_LAYER,
                    mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType)
                ),
                extendedHeader := mw_geoAnycastHeaderWithArea(
                    p_sourceLongPosVec,
                    p_seqNumber,
                    p_anycastArea
                ),
                payload := ?
            }
            
            /**
             * @desc    Receive template for GeoNetworking Anycast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_seqNumber             Sequence number of GeoAnycast packet
             * @param   p_anycastArea           Destination GeoArea
             * @param   p_maxHopLimit           Maximum number of hops (Default := ?)
             */
            template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaAndHl(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) GeoAnycastArea p_anycastArea,
                in template (present) UInt8 p_maxHopLimit := ?
            ) modifies mw_geoNwAnycastPacketWithArea := {
                commonHeader := mw_commonHeaderWithHopLimit(
                    PX_GN_UPPER_LAYER,
                    mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType),
                    p_maxHopLimit
                )
            }
            
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Receive template for GeoNetworking Anycast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber             Sequence number of GeoAnycast packet
             * @param   p_anycastArea           Destination GeoArea
             * @param   p_nextHeader            Id of next header
             */
            template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaWithNextHeader(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) GeoAnycastArea p_anycastArea,
                in template (present) NextHeader p_nextHeader
            ) modifies mw_geoNwAnycastPacketWithArea := {
                commonHeader := {
                    nextHeader := p_nextHeader
                }
            }
            
        } // end group geoNwPacketAnycastTemplates
        
        group geoNwPacketBroadcastTemplates {
            
            /**
             * @desc    Send template for GeoNetworking Broadcast Packet
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_seqNumber             Sequence number of GeoBroadcast packet
             * @param   p_broadcastArea         Destination GeoArea
             * @param   p_hopLimit              Maximum number of hops (Default: c_defaultHopLimit)
             * @param   p_trafficClass          Traffic Class 
tepelmann's avatar
tepelmann committed
             */
            template (value) GnNonSecuredPacket m_geoNwBroadcastPacket(
                in template (value) LongPosVector p_sourceLongPosVec,
                in template (value) UInt16 p_seqNumber,
                in template (value) GeoBroadcastArea p_broadcastArea,
                in template (value) UInt8 p_hopLimit := c_defaultHopLimit,
                in template (value) TrafficClass p_trafficClass := m_trafficClass
tepelmann's avatar
tepelmann committed
            ) := {
                commonHeader := valueof(m_commonHeader(
tepelmann's avatar
tepelmann committed
                    PX_GN_UPPER_LAYER,
                    m_geoBroadcastHeaderType(valueof(p_broadcastArea.geoBroadcastSubType)),
                    p_trafficClass,
                )),
                extendedHeader := valueof(m_geoBroadcastHeader(
tepelmann's avatar
tepelmann committed
                    p_sourceLongPosVec,
                    p_seqNumber,
                    p_broadcastArea
                payload := valueof(char2oct("DEFAULT_PAYLOAD"))
tepelmann's avatar
tepelmann committed
            }
            
            /**
             * @desc    Receive template for GeoNetworking Broadcast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber             Sequence number of GeoBroadcast packet
             */
            template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber
            ) := {
                commonHeader := mw_commonHeader(
                    PX_GN_UPPER_LAYER,
                    mw_geoBroadcastHeaderType
                ),
                extendedHeader := mw_geoBroadcastHeader(
                    p_sourceLongPosVec,
                    p_seqNumber
                ),
                payload := ?
            }
            
            /**
             * @desc    Receive template for GeoNetworking Broadcast Packet
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec      Long position vector of source
tepelmann's avatar
tepelmann committed
             * @param   p_seqNumber             Sequence number of GeoBroadcast packet
             * @param   p_nextHeader            Id of next header
             */
            template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeader(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) NextHeader p_nextHeader
            ) modifies mw_geoNwBroadcastPacket := {
                commonHeader := mw_commonHeader(
                    p_nextHeader,
                    mw_geoBroadcastHeaderType
                )
            }
            
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Receive template for GeoNetworking Broadcast Packet
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_seqNumber             Sequence number of GeoBroadcast packet
             * @param   p_nextHeader            Id of next header
             * @param   p_payload               payload
             */
            template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) UInt16 p_seqNumber,
                in template (present) NextHeader p_nextHeader,
                in template (present) GnRawPayload p_payload
tepelmann's avatar
tepelmann committed
            ) modifies mw_geoNwBroadcastPacketWithNextHeader := {
                payload := p_payload
            }
            
tepelmann's avatar
tepelmann committed
            /**
             * @desc    Receive template for GeoNetworking Broadcast Packet