LibItsFsap_Templates.ttcn3 22.4 KB
Newer Older
garciay's avatar
garciay committed
/**
 *  @author     ETSI / STF422_EETS
 *  @version    $URL:$
 *              $Id:$
 *  @desc       Templates definitions for Fast service advertisement protocol (ISO 24102-5)
 */
module LibItsFsap_Templates {
    
    // LibIts
    import from CALMmanagement language "ASN.1:1997" {
        type 
            ITS_scuId, StationID
    };
    import from CITSapplMgmtApplReg language "ASN.1:1997" {
        type 
            ITSaid
    };
    import from CALMmsap language "ASN.1:1997" {
        type 
            MF_Command, MF_Command_confirm, 
            MF_Request_request, MF_Request 
    };
    import from CALMllsap language "ASN.1:1997" { 
garciay's avatar
garciay committed
    };
    import from CALMfntp language "ASN.1:1997" {
        type 
            PortNumber 
    };
garciay's avatar
garciay committed
    import from CALMfsap language "ASN.1:1997" {
        type 
            ApplicationID, 
            GCctxTxCmd,  GCregServer, GCregClient, GCderegClient, GCschedule, 
            ServiceDataReg, ServiceData, ContextData, ServiceList, ServiceInfo, 
            NonipContext, 
            SAMserviceData, CTXserviceData, 
            SAM, SAMrxNot, 
            CTX, CTXrxNot 
garciay's avatar
garciay committed
    };
    import from LibItsFntp_Templates {
        template m_fntpInSapAddress_src_command
    };
    import from LibItsFsap_Pixits {
            PX_FMTID_CTX, PX_VERSION_FSAP, PX_FMTID_SAM, 
reinaortega's avatar
reinaortega committed
    
    import from LibItsCalm_Interface all;
garciay's avatar
garciay committed
    
    group fsapPrimitives {
    
        group utPrimitives {
        
            /**
             * @desc    Initializes the FSAP IUT
garciay's avatar
garciay committed
             */
            template (value) UtInitialize m_fsapInitialize := {
                utFsapInitialize := {
                }
            } // End of template m_fsapInitialize
            
            /**
             * @desc    Send template to generate a REQUEST.request primitive
             * @param   p_mfRequestReq Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MF-SAP
             * @see ISO 24102-3 Clause 7.3.2
            template (value) UtCommandRequest m_generateMfRequestReq( 
                in template (value) MF_Request_request p_mfRequestReq 
            ) := { 
                utFsapCommandRequest := {
                    mfRequestReq := p_mfRequestReq
                } // End of field 'utFsapCommandRequest'
            } // End of template m_generateMfRequestReq
garciay's avatar
garciay committed
            
        } // End of group utPrimitives
        
        group taPrimitives {
            
        } // End of group taPrimitives
        
garciay's avatar
garciay committed
        group cregServerMessage {
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group cregServerMessageSend {
                 * @desc    Send a GCregServer registration request for an ITS-S application
                 * @param   p_applicationId   The Application ID
                 * @param   p_gCschedule      A set of scheduling information
                 * @param   p_serviceDataReg  Additional service data information
                 * @see ISO 24102-3 Table C.1 — MF-REQUESTs 
                 * @see ISO 24102-5 Clause 8.2.1 Groupcast registration 
                 */
                template (value) MF_Request m_mfRequestGcregServer(
garciay's avatar
garciay committed
                    in template (value) ApplicationID p_applicationId,
                    in template (value) GCschedule p_gCschedule,
                    in template (value) ServiceDataReg p_serviceDataReg
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        gCregServer := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId,
                            gCschedule := p_gCschedule,
                            priority := PX_USER_PRIORITY,
                            serviceDataReg := p_serviceDataReg
                        } // End of field 'gCregServer'
                    } // End of field 'mfReq'
                } // End of template m_mfRequestGcregServer
garciay's avatar
garciay committed
            } // End of group cregServerMessageSend
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group cregServerMessageRecv {
                /**
                 * @desc    Generic receive GCregServer template
garciay's avatar
garciay committed
                 * Used for:
                 * <li>modifying restrictif template</li>
                 * <li>default altstep</li>
                 * @see ISO 24102-3 Table C.1 — MF-REQUESTs 
                 * @see ISO 24102-5 Clause 8.2.1 Groupcast registration 
                 */
                template GCregServer mw_gCregServer_any := {
                    applicationID := {
                        hostITS_scuId := ?,
                        seqNumber := ?
                    }, // End of field applicationID''
                    gCschedule := ?,
                    priority := ?,
                    serviceDataReg := {
                        fill := ?,
                        datareg := {
                            nonipData := ?
                        } // End of field 'datareg'
                    } // End of field 'serviceDataReg'
                } // End of template mw_gCregServer
                
garciay's avatar
garciay committed
            } // End of group cregServerMessageRecv
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group cregServerMessage
garciay's avatar
garciay committed
        
garciay's avatar
garciay committed
        group cregClientMessage {
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group cregClientMessageSend {
                 * @desc    Send template for a  GCregClient without a session, CTX is not requested
garciay's avatar
garciay committed
                 * @param   p_applicationId   The Application ID
                 * @param   p_serviceId       The globally unique ITS-AID of the ITS-S application
                 * @see ISO 24102-5 Clause 8.5
garciay's avatar
garciay committed
                template (value) MF_Request m_mfRequest_gCregClientWithNoSessionAndNoCtx(
                    in template (value) ApplicationID p_applicationId,
                    in template (value) ITSaid p_serviceId
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        gCregClient := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId,
                            priority := PX_USER_PRIORITY,
garciay's avatar
garciay committed
                            serviceID := p_serviceId,
                            contextData := ''O
                        } // End of field 'gCregClient'
                    } // End of field 'mfReq'
garciay's avatar
garciay committed
                } // End of template m_mfRequest_gCregClientWithNoSessionAndNoCtx
                /**
                 * @desc    Send template for a  GCregClient without a session, CTX is requested
garciay's avatar
garciay committed
                 * @param   p_applicationId   The Application ID
                 * @param   p_serviceId       The globally unique ITS-AID of the ITS-S application
                 * @see ISO 24102-5 Clause 8.3.1 Groupcast registration
                 */
garciay's avatar
garciay committed
                template (value) MF_Request m_mfRequest_gCregClientWithSessionAndCtx(
                    in template (value) ApplicationID p_applicationId,
                    in template (value) ITSaid p_serviceId
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        gCregClient := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId,
                            priority := PX_USER_PRIORITY,
garciay's avatar
garciay committed
                            serviceID := p_serviceId,
                            contextData := ''O
                        } // End of field 'gCregClient'
                    } // End of field 'mfReq'
garciay's avatar
garciay committed
                } // End of template m_mfRequest_gCregClientWithSessionAndCtx
garciay's avatar
garciay committed
            } // End of group cregClientMessageSend
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group cregClientMessage
garciay's avatar
garciay committed
        
garciay's avatar
garciay committed
        group samMessage {
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group samMessageSend {
                 * @desc    Send template for a SAM from a service user ITS station, notified by the groupcast communication manager to the groupcast manager
                 * @param   p_link        Source_address
                 * @param   p_serverId    Server identifier
                 * @param   p_serviceList Service list descroption
                 * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX
                 */
garciay's avatar
garciay committed
                template (value) MF_Request m_mfRequest_samRxNot( 
                    in template (value) LLserviceAddr p_link, 
garciay's avatar
garciay committed
                    in template (value) StationID p_serverId, 
                    in template (value) ServiceList p_serviceList 
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        sAMrxNot := {
                            link := p_link,
                            sam := {
                                fmtID := PX_FMTID_SAM, 
                                version := PX_VERSION_FSAP, 
garciay's avatar
garciay committed
                                serverID := p_serverId,
                                serviceList := p_serviceList,
                                channelList := { },
                                ipServList := { }
                            } // End of field 'sam'
                        } // End of field 'sAMrxNot'
                    } // End of field 'mfReq'
garciay's avatar
garciay committed
                } // End of template m_mfRequest_samRxNot
garciay's avatar
garciay committed
            } // End of group samMessageSend
garciay's avatar
garciay committed
            group samMessageRecv {
                 * @desc    Generic receive MF-COMMAND template
garciay's avatar
garciay committed
                 * Used for:
                 * <li>modifying restrictif template</li>
                 * <li>default altstep</li>
                 * @see ISO 24102-3 Clause 8.2.1 
                template (present) MF_Command mw_mfCommand_any := {
                    fill := ?,
                    mfCmd := ?
                } // End of template mw_mfCommand_any
                
                 * @desc    Receive template for SAM
                 * @param   p_applicationId   The Application ID
                 * @param   p_serverId        Server identifier
                 * @param   p_serviceData     Additional SAM service data information
                 * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX
                template (present) MF_Command mdw_mfCommand_gcSam(
garciay's avatar
garciay committed
                    in template (present) ApplicationID p_applicationId,
                    in template (present) StationID p_serverId,
                    in template (present) SAMserviceData p_serviceData
                    mfCmd := {
                        gCsam := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId,
                            serverID := p_serverId,
                            serviceData := p_serviceData
                        } // End of header 'gCsam'
                    } // End of header 'mfCmd'
                 * @desc    Receive template for GCsamctx
garciay's avatar
garciay committed
                 * @param   p_applicationId   The Application ID
                 * @param   p_serverId        Server identifier
                 * @param   p_serviceInfo     Additional service data information
                 * @see     ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX
garciay's avatar
garciay committed
                template (present) MF_Command mdw_mfCommand_gcSamCtx(
                    in template (present) ApplicationID p_applicationId,
                    in template (present) StationID p_serverId,
                    in template (present) ServiceInfo p_serviceInfo
                ) modifies mw_mfCommand_any := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId,
                            serverID := p_serverId,
                            serviceInfo := p_serviceInfo
                        } // End of header 'gCsam'
garciay's avatar
garciay committed
                } // End of template mdw_mfCommand_gcSamCtx
                 * @desc    Receive template for SAMserviceData
                 * @param p_serviceId       Service identifier
                 * @param p_serviceData     Additional service data information
                 * @param p_providerPort    Service user port number
                template (present) SAMserviceData mw_samDataServerciceWithAccessTechAndNonIP( 
garciay's avatar
garciay committed
                    in template (present) ITSaid p_serviceId, 
                    in template (present) ServiceData p_serviceData, 
                    in template (present) PortNumber p_providerPort 
                ) := { 
                    fill := ?, 
garciay's avatar
garciay committed
                            serviceID := p_serviceId, 
                            serviceData := p_serviceData, 
                            providerPort := p_providerPort 
                        } // End of field 'nonipService'
                    } // End of field 'servData'
                } // End of template mw_samDataServerciceWithAccessTechAndNonIP
garciay's avatar
garciay committed
            } // End of group samMessageRecv
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group samMessage
garciay's avatar
garciay committed
        
garciay's avatar
garciay committed
        group ctxMessage {
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group ctxMessageSend {
                 * @desc    Send "CTX" in reply to SAM
                 * @param   p_linkID    Source address 
                 * @param   p_ctx       CTX information
                 * @see ISO 24102-5 Clause 8.2.6
                 * @see ISO 21218 Clause 5.4.2.1 & 5.4.2.2
                 */
                template (value) MF_Request m_mfRequest_ctx(
                    in template (value) LLserviceAddr p_linkID,
                    in template (value) CTX p_ctx
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        cTXrxNot := {
                            link := p_linkID,
                            ctx := p_ctx
                        } //  // End of field 'cTXrxNot'
                    } // End of field 'mfReq'
                } // End of template m_mfRequest_ctx
                
                 * @desc    Send template for CTX
                 * @param   p_clientID  Client identifier
                 * @see ISO 24102-5 Clause 8.2.6 Reception of CTX
                template (value) CTX m_ctx(
                    in template (value) StationID p_clientID
                ) := {
                    fmtID := PX_FMTID_CTX, 
                    version := PX_VERSION_FSAP, 
garciay's avatar
garciay committed
                    clientID := p_clientID,
                    servContextList := { },
                    ipContextList := { }
garciay's avatar
garciay committed
            } // End of group ctxMessageSend
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group ctxMessageRecv {
                 * @desc    Receive template for GCctx
garciay's avatar
garciay committed
                 * @param   p_applicationId     The application ID
                 * @param   p_clientID          Client identifier
                 * @param   p_serviceContext    Additional service context information
                 * @see ISO 24102-5 Clause 8.2.6 Reception of CTX
                 */
                template (present) MF_Command mdw_mfCommand_gCctx( 
garciay's avatar
garciay committed
                    in template (present) ApplicationID p_applicationId, 
                    in template (present) StationID p_clientID, 
                    in template (present) CTXserviceData p_serviceContext 
                ) modifies mw_mfCommand_any := { 
                    mfCmd := {
                        gCctx := {
garciay's avatar
garciay committed
                            applicationID := p_applicationId, 
                            clientID := p_clientID, 
                            serviceContext := p_serviceContext 
                        } // End of header 'gCctx'
                    } // End of header 'mfCmd'
                } // End of template mw_mfCommand_gCctx 
                
                /**
                 * @desc    Receive template for GCctxTxCmd
                 * @param   p_link  Source address
                 * @param   p_ctx   CTX information
                 * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX
                 */
                template (present) MF_Command mw_mfCommand_gCctxTxCmd( 
                    in template (present) CALMllsap.LLserviceAddr p_link,
                    in template (present) CTX p_ctx
                ) modifies mw_mfCommand_any := {
                    mfCmd := {
                        gCctxTxCmd := {
                            link := p_link,
                            ctx := p_ctx
                        } // End of header 'gCctxTxCmd'
                    } // End of header 'mfCmd'
                } // End of template mw_mfCommand_gCctxTxCmd
                
                /**
                 * @desc    Generic receive template for CTX.
garciay's avatar
garciay committed
                 * Used for:
                 * <li>modifying restrictif template</li>
                 * <li>default altstep</li>
                 * @see ISO 24102-5 Clause 8.2.6 Reception of CTX
                 */
                template (present) CTX mw_ctx_any := {
                    fmtID := PX_FMTID_CTX, 
                    version := PX_VERSION_FSAP, 
                    clientID := ?,
                    servContextList := ?,
                    ipContextList := ?
                } // End of template mw_ctx_any
                
                /**
                 * @desc    Receive template for CTX with non-ip service context
                 * @param   p_servContext   Additional service data information for non-IP based services (timeout information)
                 * @see ISO2410-5 Clause 8.2.1 Groupcast registration
                 * @see ISO2410-5 Figure 9 — serviceList
                 */
                template (present) CTX mw_ctx_NonipContext( 
                    in template (present) NonipContext p_servContext 
                ) modifies mw_ctx_any := { 
                    servContextList := superset(p_servContext) 
                } // End of template mw_ctx_NonipContext
                
                /**
                 * @desc    Receive template for CTX in non-ip context
garciay's avatar
garciay committed
                 * @param   p_serviceId     The globally unique ITS-AID of the ITS-S application
                 * @param   p_userPort      Service port number
                 * @see ISO2410-5 Clause 8.2.1 Groupcast registration
                 * @see ISO2410-5 Figure 9 — serviceList
                 */
                template (present) NonipContext mw_nonipContext( 
garciay's avatar
garciay committed
                    in template (present) ITSaid p_serviceId, 
                    in template (present) PortNumber p_userPort 
                ) := { 
garciay's avatar
garciay committed
                    serviceID := p_serviceId, 
                    contextData := ?, 
                    userPort := p_userPort 
                } // End of template mw_nonipContext 
                
                /**
                 * @desc    Generic receive template for CTXserviceData
garciay's avatar
garciay committed
                 * Used for:
                 * <li>modifying restrictif template</li>
                 * <li>default altstep</li>
                 */
                template (present) CTXserviceData mw_ctxDataServercice_any := {
                    fill := ?,
                    servData := ?
                } // End of template mw_ctxDataServercice_any
                
                /**
                 * @desc    Receive template for CTXserviceData
garciay's avatar
garciay committed
                 * @param   p_serviceId     The globally unique ITS-AID of the ITS-S application
                 * @param   p_contextData   Additional context data information for non-IP based services (timeout information)
                 * @param   p_userPort      Service port number
                 */
                template (present) CTXserviceData mdw_ctxServiceDataNonIP(
garciay's avatar
garciay committed
                    in template (present) ITSaid p_serviceId,
                    in template (present) ContextData p_contextData,
                    in template (present) PortNumber p_userPort
                ) modifies mw_ctxDataServercice_any := {
                    servData := {
                        nonipContext := {
garciay's avatar
garciay committed
                            serviceID := p_serviceId,
                            contextData := p_contextData,
                            userPort := p_userPort
                        } // End of field 'nonipService'
                    } // End of field 'servData'
                } // End of template mdw_ctxServiceDataNonIP
                
                // TODO To be removed
//                /**
//                 * @desc  Confirmation of Service context message transmission
//                 * @param p_csap      Source address - see ISO 21218 Clause 5.4.2.1 & 5.4.2.2
//                 * @param p_linkID    Destination link ID - see ISO 21218 Clause 5.4.2.2
//                 * @param p_clientID  Station ID of the client ITS station
//                 * 
//                 @see ISO 24102-5 Clause 7.2.3
//                 */
//                template GCctxTxCmd mw_gCctxTxCmd(
//                    in template (present) IN_SAPaddress p_csap,
//                    in template (present) Link_ID p_linkId,
//                    in template (present) StationID p_clientID
//                ) := {
//                    link := {
//                        csap := p_csap,
//                        linkID := p_linkID
//                    },
//                    ctx := {
//                        fmtID := 0, // FIXME Use PIXIT PX_FMTID_CTX
//                        version := 0, // FIXME Use PIXIT PX_VERSIONFSAP
//                        clientID := p_clientID,
//                        servContextList := ?,
//                        ipContextList := ?
//                    }
//                } // End of template mw_gCctxTxCmd
                
garciay's avatar
garciay committed
            } // End of group ctxMessageRecv
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group ctxMessage
garciay's avatar
garciay committed
        
    } // End of group fsapPrimitives
    
} // End of module LibItsFsap_Templates