Skip to content
LibItsGeoNetworking_Templates.ttcn 45.5 KiB
Newer Older
berge's avatar
berge committed
/**
 *	@author 	ETSI / STF405
 *  @version 	$URL$
 *				$Id$
 *	@desc		GeoNetworking Templates
 *
 */
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;
berge's avatar
berge committed
    
    group geoNwPrimitivesTemplates {
    
    	template (value) GeoNetworkingReq m_geoNwReq(
            template (value) GeoNetworkingPacket p_geoNwMsg
            ) := {
            msgOut := p_geoNwMsg
        }
        
        template GeoNetworkingInd mw_geoNwInd(
            template (present) GeoNetworkingPacket p_geoNwMsg
            ) := {
            msgIn := p_geoNwMsg
        }
    
        group taPrimitives {
            
            /**
             * @desc Testsystem will start beaconing for the given neighbor
             * @param p_beaconHeader The neighbor information
             */
            template (value) AcGNEvent m_startBeaconing(BeaconHeader p_beaconHeader) := {
                startBeaconing := {
                    beaconHeader := p_beaconHeader
                }
            }
            
            /**
             * @desc Testsystem will stop beaconing for the given neighbor
             * @param p_compName The neighbor
             */
            template AcGNEvent m_stopBeaconing := {
                stopBeaconing:= {
                }
            }
            
            /**
             * @desc Testsystem will pass received to the TTCN-3
             * @param p_beaconHeader The neighbor information
             */
            template AcGNEvent m_startPassBeaconing(BeaconHeader p_beaconHeader) := {
                startPassBeaconing := {
                    beaconHeader := p_beaconHeader
                }
            }
            
            /**
             * @desc Testsystem will stop passing beacon information to the TTCN-3
             */
                stopPassBeaconing := {
                }
            }
        
        } // end taPrimitives
            
    } // geoNwPrimitivesTemplates
    
    group geoNwPduTemplates {
        
        template (value) GeoNetworkingPacket m_geoNwPdu(in template (value) Header p_header) := {
        	header := p_header,
        	secHeader := omit,
        	payload := omit           
        }
        
        template (value) GeoNetworkingPacket m_geoNwPduWithPayload(in template (value) Header p_header, in template (value) Payload p_payload) := {
            header := p_header,
            secHeader := omit,
            payload := p_payload
        }
        
        template GeoNetworkingPacket mw_geoNwPdu(in template (present) Header p_header) := {
        	header := p_header,
        	secHeader := *,
            payload := *          
        template GeoNetworkingPacket mw_geoNwPduAnyPayload(in template (present) Header p_header) := {
fischer's avatar
fischer committed
        	header := p_header,
        	secHeader := *,
            payload := ?          
        }     
                
        template GeoNetworkingPacket mw_geoNwPduWithPayload(in template (present) Header p_header, in template (present) Payload p_payload) := {
            header := p_header,
            secHeader := *,
            payload := p_payload
        }     
                
    } // end geoNwPduTemplates
    
    group geoNwHeadersTemplates {
        
        group geoNwCommonHeaderTemplates {
        
            template (value) CommonHeader m_commonHeader (
            	in template (value) NextHeader p_nextHeader,
            	in template (value) HeaderTST p_headerTST,
            	in template (value) TrafficClass p_trafficClass,
            	in template (value) UInt8 p_hopLimit,
            	in template (value) LongPosVector p_longPosVec,
            	in template (value) StationTypeIdentifier p_stationType
            ) := {
            	version := c_geoNwProtocolVersion,
                nextHeader := p_nextHeader,
    			headerTST := p_headerTST,
                reserved := c_uInt8Zero,
                flags := m_flags(p_stationType),
                plLength := 0, // will be computed by Codec
                trafficClass := p_trafficClass,
                hopLimit := p_hopLimit,
                senderPosVector := p_longPosVec    
            }
            
            template CommonHeader mw_commonHeader (
                in template (present) LongPosVector p_senderLongPosVec,
                in template (present) NextHeader p_nextHeader,
                in template (present) HeaderTST p_headerTST,
                in template (present) StationTypeIdentifier p_stationType
                version := c_geoNwProtocolVersion,
                nextHeader := p_nextHeader,
                reserved := c_uInt8Zero,
                flags := mw_flags(p_stationType),
                plLength := ?, 
                trafficClass := ?,
                hopLimit := ?,
                senderPosVector := p_senderLongPosVec    
fischer's avatar
fischer committed
            template CommonHeader mw_commonHeaderBeacon (
            	in template (present) StationTypeIdentifier p_stationType,
            	in template (present) TrafficClass p_trafficClass,
            	in template (present) UInt8 p_hopLimit,
                in template (present) LongPosVector p_senderLongPosVec
berge's avatar
berge committed
            ) := {
fischer's avatar
fischer committed
				version := c_geoNwProtocolVersion,
				nextHeader := e_any, // 0
				headerTST := {
					beaconHdr := {	headerType := e_beacon, // 0
					    			headerSubType := 0}
				},
				reserved := c_uInt8Zero,
				flags := mw_flags(p_stationType),
				plLength := 0,
				trafficClass := p_trafficClass,
				hopLimit := p_hopLimit,
				senderPosVector := p_senderLongPosVec
fischer's avatar
fischer committed
			}
            template CommonHeader mw_commonHeaderWithHopLimit (
                in template (present) LongPosVector p_senderLongPosVec,
            	in template (present) NextHeader p_nextHeader,
            	in template (present) HeaderTST p_headerTST,
            	in template (present) StationTypeIdentifier p_stationType,
            	in template (present) UInt8 p_hopLimit
            ) modifies mw_commonHeader := {
                hopLimit := p_hopLimit   
            }
            
            template CommonHeader mw_commonHeaderWithTrafficClass (
                in template (present) LongPosVector p_senderLongPosVec,
                in template (present) NextHeader p_nextHeader,
                in template (present) HeaderTST p_headerTST,
                in template (present) StationTypeIdentifier p_stationType,
                in template (present) TrafficClass p_trafficClass
            ) modifies mw_commonHeader := {
                trafficClass := p_trafficClass
            }
            
            template (value) Flags m_flags(
            	in template (value) StationTypeIdentifier p_stationType
            ) := {
                reserved := c_uInt6Zero,
                stationType := p_stationType,
                reserved2 := c_uInt1Zero            
            }
            
            template Flags mw_flags(
            	in template (present) StationTypeIdentifier p_stationType
            ) := {
                reserved := c_uInt6Zero,
Loading full blame...