Skip to content
LibItsGeoNetworking_Templates.ttcn 104 KiB
Newer Older
             * @param   p_headerSubType Packet's subtype
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) HeaderTST m_geoAnycastHeaderType(
                in template (value) HeaderSubTypeGeoAnycast p_headerSubType
            ) := {
                geoAnycastHdr := {
                    headerType := e_geoAnycast,
                    headerSubType := p_headerSubType
                }
tepelmann's avatar
tepelmann committed
            }
             * @desc    Receive template for GeoAnycast header type with any sub-type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_geoAnycastHeaderType := {
                geoAnycastHdr := {
                    headerType := e_geoAnycast,
                    headerSubType := ?
                }
tepelmann's avatar
tepelmann committed
            }
             * @desc    Receive template for GeoAnycast header type with sub-type
berge's avatar
berge committed
             * @param   p_headerSubType Packet's subtype
tepelmann's avatar
tepelmann committed
             * @see     mw_geoAnycastHeaderType
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_geoAnycastHeaderTypeWithSubType(
                in template (present) HeaderSubTypeGeoAnycast p_headerSubType
            ) modifies mw_geoAnycastHeaderType := {
                geoAnycastHdr := {
                    headerSubType := p_headerSubType
                }
berge's avatar
berge committed
        } // end geoAnycastHeaderTemplates
berge's avatar
berge committed
        group lsRequestHeaderTemplates {
            
            /**
             * @desc    Send template for LS Request header
             * @param   p_sourceLongPosVec  Long position vector of source
             * @param   p_seqNumber         Sequence number of LS Request packet
             * @param   p_gnAddress         Searched GN_Address
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_lsRequestHeader(
berge's avatar
berge committed
                in template (value) LongPosVector p_sourceLongPosVec,
                in template (value) UInt16 p_seqNumber,
tepelmann's avatar
tepelmann committed
                in template (value) GN_Address p_gnAddress
berge's avatar
berge committed
            ) := {
                lsRequestHeader := {
tepelmann's avatar
tepelmann committed
                    seqNumber       := p_seqNumber,
                    reserved        := c_uInt8Zero,
                    srcPosVector    := p_sourceLongPosVec,
                    gnAddress       := p_gnAddress
            /**
             * @desc    Receive template for LS Request header
             * @param   p_seqNumber     Sequence number of LS Request packet
berge's avatar
berge committed
             * @param   p_mid           Searched GN_Address MID
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader mw_lsRequestHeader(
berge's avatar
berge committed
                in template (present) UInt16 p_seqNumber,
berge's avatar
berge committed
                in template (present) GN_Address.mid p_mid
berge's avatar
berge committed
            ) := {
                lsRequestHeader := {
                    seqNumber := p_seqNumber,
berge's avatar
berge committed
                    reserved := ?,
                    srcPosVector := ?,
            /**
             * @desc    Send template for LS Request header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) HeaderTST m_lsRequestHeaderType := {
                lsHdr := {
berge's avatar
berge committed
                    headerType := e_locationService,
                    headerSubType := e_lsRequest
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
            /**
             * @desc    Receive template for LS Request header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_lsRequestHeaderType := {
                lsHdr := {
berge's avatar
berge committed
                    headerType := e_locationService,
                    headerSubType := e_lsRequest
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end lsRequestHeaderTemplates
            /**
             * @desc    Send template for LS Reply header
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_destinationLongPosVec Long position vector of destination
             * @param   p_seqNumber             Sequence number of LS Reply packet
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_lsReplyHeader(
              in template (value) LongPosVector p_sourceLongPosVec,
              in template (value) ShortPosVector p_destinationLongPosVec,
              in template (value) UInt16 p_seqNumber
            ) := {
                lsReplyHeader := {
                  seqNumber := p_seqNumber,
                  reserved := c_uInt8Zero,
                  srcPosVector := p_sourceLongPosVec,
                  dstPosVector := p_destinationLongPosVec
                }
            }
            
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for any LS Reply header
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader mw_lsReplyHeaderAny := {
                reserved := ?,
                srcPosVector := ?,
                dstPosVector := ?
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for LS Reply header
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_destinationLongPosVec Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @see     mw_lsReplyHeaderAny
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader mw_lsReplyHeader(
tepelmann's avatar
tepelmann committed
                in template (present) LongPosVector p_sourceLongPosVec,
                in template (present) ShortPosVector p_destinationLongPosVec)
            modifies mw_lsReplyHeaderAny := {
                lsReplyHeader := {
                    srcPosVector := p_sourceLongPosVec,
                    dstPosVector := p_destinationLongPosVec
                }
berge's avatar
berge committed
            }
            /**
             * @desc    Send template for LS Reply header type
berge's avatar
berge committed
             */
            template (value) HeaderTST m_lsReplyHeaderType := {
                lsHdr := {
                  headerType := e_locationService,
                  headerSubType := e_lsReply
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end lsRequestHeaderTemplates
berge's avatar
berge committed
        group beaconHeaderTemplates {
            
            /**
             * @desc    Send template for Beacon header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_beaconHeader(
                in template (value) LongPosVector p_sourceLongPosVec
berge's avatar
berge committed
            ) := {
                beaconHeader := {
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec
            /**
             * @desc    Receive template for Beacon header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader mw_beaconHeader(
                in template (present) LongPosVector p_sourceLongPosVec
berge's avatar
berge committed
            ) := {
                beaconHeader := {
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec
            /**
             * @desc    Send template for Beacon header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) HeaderTST m_beaconHeaderType := {
                beaconHdr := {
berge's avatar
berge committed
                    headerType := e_beacon,
fischer's avatar
fischer committed
                    headerSubType := c_uInt4Zero
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
            /**
             * @desc    Receive template for Beacon header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_beaconHeaderType := {
                beaconHdr := {
berge's avatar
berge committed
                    headerType := e_beacon,
fischer's avatar
fischer committed
                    headerSubType := ?
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end beaconHeaderTemplates
        
berge's avatar
berge committed
             * @desc    Send template for SHB header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of sender
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_shbHeader(
                in template (value) LongPosVector p_sourceLongPosVec
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec,
                    reserved := 0
            /**
             * @desc    Receive template for SHB header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of sender
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) ExtendedHeader mw_shbHeader(
                in template (present) LongPosVector p_sourceLongPosVec
            ) := {
tepelmann's avatar
tepelmann committed
                    srcPosVector:= p_sourceLongPosVec,
                    reserved := ?
            /**
             * @desc    Send template for SHB header type
berge's avatar
berge committed
             */
            template (value) HeaderTST m_shbHeaderType := {
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_singleHop
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        group tsbHeaderTemplates {
            
            /**
             * @desc    Send template for TSB header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_srcPosVector      Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader m_tsbHeader(
tepelmann's avatar
tepelmann committed
                in template (value) UInt16 p_seqNumber,
                in template (value) LongPosVector p_srcPosVector
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := c_uInt8Zero,
                    srcPosVector := p_srcPosVector
                }
            }
            
            /**
             * @desc    Receive template for TSB header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) ExtendedHeader mw_tsbHeader(
tepelmann's avatar
tepelmann committed
                in template (present) UInt16 p_seqNumber,
fischer's avatar
fischer committed
                in template (present) LongPosVector p_sourceLongPosVec
tepelmann's avatar
tepelmann committed
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := ?,
fischer's avatar
fischer committed
                    srcPosVector := p_sourceLongPosVec
                }
            }
            
tepelmann's avatar
tepelmann committed
             * @desc    Send template for TSB header type
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) HeaderTST m_tsbHeaderType := {
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_multiHop
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for TSB header type
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) HeaderTST mw_tsbHeaderType := {
tepelmann's avatar
tepelmann committed
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_multiHop
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
            
        } // end tsbHeaderTemplates
        
        group saHeaderTemplates {
            
            /**
             * @desc    Send template for SA header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_srcPosVector      Long position vector of source
             */
            template ExtendedHeader m_saHeader(
                in template (value) UInt16 p_seqNumber,
                in template (value) LongPosVector p_srcPosVector
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := c_uInt8Zero,
                    srcPosVector := p_srcPosVector
                }
            }
            
            /**
             * @desc    Receive template for TSB header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_sourceLongPosVec  Long position vector of source
             */
            template (present) ExtendedHeader mw_saHeader(
                in template (present) UInt16 p_seqNumber,
                in template (present) LongPosVector p_sourceLongPosVec
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := ?,
                    srcPosVector := p_sourceLongPosVec
                }
            }
            
            /**
             * @desc    Send template for SA header type
             */
            template (value) HeaderTST m_saHeaderType_sa := {
                saHdr := {
                  headerType := e_serviceAnnouncement,
                  headerSubType := e_sa
                }
            }
            
            /**
             * @desc    Receive template for SA header type
             */
            template (present) HeaderTST mw_saHeaderType_sa := {
                saHdr := {
                  headerType := e_serviceAnnouncement,
                  headerSubType := e_sa
                }
            }
            
            /**
             * @desc    Send template for SA header type
             */
            template (value) HeaderTST m_saHeaderType_eos := {
                saHdr := {
                  headerType := e_serviceAnnouncement,
                  headerSubType := e_saEos
                }
            }
            
            /**
             * @desc    Receive template for SA header type
             */
            template (present) HeaderTST mw_saHeaderType_eos := {
                saHdr := {
                  headerType := e_serviceAnnouncement,
                  headerSubType := e_saEos
                }
            }
            
        } // end saHeaderTemplates
        
    } // end geoNwHeadersTemplates
berge's avatar
berge committed
    
berge's avatar
berge committed
    group geoMiscTemplates {
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for GN_Address. Only M_ID field is discriminent
         * @param   p_mid Expected GN Address MID
        template GN_Address mw_gnAddressMid(in template (present) GN_Address.mid p_mid) := {
            typeOfAddress := ?,
            stationType := ?,
            stationCountryCode := ?,
            mid := p_mid
        }
berge's avatar
berge committed
        group geoDummyTemplates {
            
tepelmann's avatar
tepelmann committed
             * @desc    Dummy template for GN_Address
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) GN_Address m_dummyGnAddr := {
                typeOfAddress := e_manual,
tepelmann's avatar
tepelmann committed
                stationType := e_passengerCar,
                stationCountryCode := c_uInt10Zero,
            /**
             * @desc    Dummy template for long position vector
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) LongPosVector m_dummyLongPosVector := {
berge's avatar
berge committed
                gnAddr := m_dummyGnAddr,
                latitude := c_uInt32Zero,
berge's avatar
berge committed
                longitude := c_uInt32Zero,
wattelet's avatar
wattelet committed
                pai := int2bit(1,1),
berge's avatar
berge committed
                speed := c_uInt16Zero,
tepelmann's avatar
tepelmann committed
                heading := c_uInt16Zero
            /**
             * @desc    Dummy template for Area
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) Area m_dummyArea := {
                geoAreaPosLatitude := c_uInt32Zero,
                geoAreaPosLongitude := c_uInt32Zero,
                distanceA := c_uInt16Zero,
                distanceB := c_uInt16Zero,
tepelmann's avatar
tepelmann committed
                angle := c_uInt16Zero
berge's avatar
berge committed
            }
            /**
             * @desc    Dummy template for GeoBroadcastArea
berge's avatar
berge committed
             */
            template (value) GeoBroadcastArea m_dummyGeoBroadcastArea := {
berge's avatar
berge committed
                geoBroadcastSubType := e_geoBroadcastRect,
                geoBroadcastArea := m_dummyArea
            }
            
berge's avatar
berge committed
        } // end geoDummyTemplates
        
    } // end geoMiscTemplates
    
garciay's avatar
garciay committed
} // end ItsGeoNetworking_Templates