Commit f75f9e49 authored by garciay's avatar garciay
Browse files

Setup initialize step

Continue FNTP tests
parent 8052e5a5
Loading
Loading
Loading
Loading
+76 −30
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ module LibItsFntp_Functions {
    };
    
    // LibIts 
    
    // LibItsCalm 
    import from CALMmanagement language "ASN.1:1997" { 
        type StationID, ITS_scuId; 
    }; 
@@ -40,7 +42,16 @@ module LibItsFntp_Functions {
    import from LibItsFntp_Pics {
        modulepar PICS_ITS_S_INW, PICS_ROLE_RH;
    };
    import from LibItsMgt_Templates { 
        template mw_mnRequestRequest 
    };
    import from LibItsMgt_Functions { 
        function 
            f_getNextCommandRef, 
            f_getNextPduCounter 
    }; 
    import from LibItsCalm_Interface all; 
    import from LibItsCalm_Pixits all;
    
    group fntpConfigurationFunctions {
        
@@ -173,7 +184,7 @@ module LibItsFntp_Functions {
         */
        function f_initialState() runs on ItsCalm {
            
            f_utInitializeIut(m_fntpInitialize);
            f_utInitializeIut(m_fntpInitialize(PX_LOC_ITS_ACCESS_LAYER));
            f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...)
        } // End of function f_initialState
        
@@ -190,10 +201,28 @@ module LibItsFntp_Functions {
        function f_initializeFntpForwardingTable(in PortNumber p_port) runs on ItsCalm {
            // Request allocation of a port number associated with the ITS-SP
            // TODO Consider case of c_portDyn, and use f_utCommandRequestConfirm
            f_utCommandRequestWithoutConfirm(
            var template (value) UtCommandRequest p_commandReq;
            
            if (PX_USE_IICP_REMOTE_COMMAND == true) { 
                p_commandReq := m_fntpNfSapRemoteCommandRequest( 
                    f_getNextPduCounter(), 
                    f_getNextCommandRef(), 
                    m_generateNfFntpPortCreationRequest(
                        f_getIutServiceRef(), 
                    p_port)
                        p_port 
                    ).utFntpCommandRequest.nfSapPrimitives 
                );
            } else {
                p_commandReq := m_generateNfFntpPortCreationRequest(
                    f_getIutServiceRef(), 
                    p_port 
                );
            }
            f_utCommandRequestConfirm( 
                p_commandReq,
                mdw_fntpCommConfirm_success_port(p_port),
                false,
                vc_utCommandConf 
            );
            // Store the allocated port number
            vc_portNumber := p_port;
@@ -202,11 +231,50 @@ module LibItsFntp_Functions {
            } else {
                log("*** f_initializeFntpForwardingTable: INFO: portNumber value is: " & int2str(vc_portNumber.portLong) & " ***");
            }
            // And wait for a MN-SAP.MN-COMMAND/FWTupdate message sent by IST management entity to update the forwarding table
			f_mnSapAwaitFwtUpdate();
            // And wait for a MN-SAP.MN-COMMAND/FWTupdate message sent by ITS management entity to update the forwarding table
            f_fntpAwaitFwtUpdate();
            
        } // End of function f_initializeFntpForwardingTable
        
        /**
         * @desc    Wait for MN-SAP.MN-REQUEST/FWTupdate message sent by IST management entity to update the forwarding table
         * @verdict Unchanged
         */
        function f_fntpAwaitFwtUpdate() runs on ItsCalm {
            var template (value) UtRequestRequest p_requestReq;
            
            if (PX_USE_IICP_REMOTE_COMMAND == true) { 
                p_requestReq := mw_fntpNnSapRemoteCommand( 
                    mw_awaitFwtUpdate(vc_portNumber).utFntpRequestRequest.mnRequestRequest 
                ); 
            } else { 
                p_requestReq := mw_awaitFwtUpdate(vc_portNumber) 
            } 
            f_utAwaitRequestRequest(p_requestReq); 
        } // End of function f_fntpAwaitFwtUpdate()
        
        function f_fntpCommandRequestConfirm( 
            in template (value) UtCommandRequest p_generateNfFntpCommandRequest
        ) runs on ItsCalm { 
            var template (value) UtCommandRequest p_commandReq;
            
            if (PX_USE_IICP_REMOTE_COMMAND == true) { 
                p_commandReq := m_fntpNfSapRemoteCommandRequest( 
                    f_getNextPduCounter(), 
                    f_getNextCommandRef(), 
                    p_generateNfFntpCommandRequest.utFntpCommandRequest.nfSapPrimitives 
                );
            } else {
                p_commandReq := p_generateNfFntpCommandRequest;
            }
            f_utCommandRequestConfirm(
                p_commandReq, //Content of the FNTP control field in the FNTP extended header
                mw_fntpCommConfirm_success,
                false,
                vc_utCommandConf);
            
        } // End of function f_fntpCommandRequestConfirm 
        
        /**
         * @desc Call this method to remove entry created by f_initializeFntpForwardingTable() in FNTP Forwarding Table
         * @verdict Unchanged
@@ -256,28 +324,6 @@ module LibItsFntp_Functions {
        
    } // End of group testerFunctions
    
    group mnSapFunctions {
        
        /**
         * @desc    Wait for MN-SAP.MN-COMMAND/FWTupdate message sent by IST management entity to update the forwarding table
         * @verdict Unchanged
         */
        function f_mnSapAwaitFwtUpdate() runs on ItsCalm {
            
            tc_ac.start;
            alt {
                [] a_mgtSapAwaitFwtUpdate() {
                    tc_ac.stop;
                    log("*** f_mnSapAwaitFwtUpdate: INFO: Expected message not received ***");
                }
                [] tc_ac.timeout {
                    log("*** f_mnSapAwaitFwtUpdate: ERROR: MN-SAP FWTupdate service primitive not received ***");
                }
            } // End of 'alt' statement
        } // End of function f_mnSapAwaitFwtUpdate()
        
    } // End of group testerFunctions
    
    group adapterControl {
        
        /**
+144 −9
Original line number Diff line number Diff line
@@ -11,8 +11,11 @@ module LibItsFntp_Templates {
        type 
            UInt8, UInt16;
    };
    import from LibCommon_DataStrings { 
        type Oct1 
    };
    
    // LibIts
    // LibItsCalm 
    import from CALMllsap language "ASN.1:1997" {
        type 
            IN_SAPaddress, EUI64, LLserviceAddr, Link_ID, INdata, AccessParameters, 
@@ -21,17 +24,38 @@ module LibItsFntp_Templates {
    };
    import from CALMmsap language "ASN.1:1997" {
        type 
            StationID, CommandRef
            StationID, CommandRef, 
            MN_Command, MN_Request, 
            MN_Request_request  
    };
    import from CALMmanagement language "ASN.1:1997" {
        type ITS_scuId
    };
    import from CALMiitsscu language "ASN.1:1997" {
        type PduCounter
    };
    import from CALMfntp language "ASN.1:1997" all;
    import from LibItsCalm_Interface all;
    import from LibItsFntp_TypesAndValues {
        const c_portRtr, c_portHst, c_portNon, c_portReservedLow, c_portReservedHigh;
        type AcFntpPrimitive
    };
    import from LibItsIicp_Templates { 
        template 
            m_iicRequestRx_mnCommandRequest, 
            mdw_iicRequestTx_mnRequestRequest 
    }; 
    import from LibItsMgt_Templates { 
        template 
            m_mnCommandRequest, 
            mdw_fwtSetNotRequestReq_port 
    }; 
    import from LibItsMgt_Functions { 
        function 
            f_getNextCommandRef, 
            f_getIutDestItsScuId, f_getIutOtherItsScuId, 
            f_getNextPduCounter 
    }; 
    import from LibItsFntp_Pixits all;
    
    group fntpPrimitives {
@@ -337,9 +361,9 @@ module LibItsFntp_Templates {
             * @param   p_rxCIP             Receive (RX) parameter settings
             * @param   p_txCIP             Transmit (TX) parameters of a VCI
             */
            template FNTPNPDU mw_fntpExtendedNpduCip( 
                in template RXcip p_rxCip, 
                in template TXcip p_txCip 
            template (present) FNTPNPDU mw_fntpExtendedNpduCip( 
                in template (present) RXcip p_rxCip, 
                in template (present) TXcip p_txCip 
            ) := {
                header := { 
                    sourcePort := { portLong := complement((c_portReservedLow .. c_portReservedHigh)) }, // See ISO/CD 29281-2 Table 1: FNTP endpoints identified by port numbers
@@ -558,6 +582,34 @@ module LibItsFntp_Templates {
            
        } // End of group fntpForwardingNpdu
        
        group fntpManagement { 
            
            template (present) UpdateNotFNTP mw_updateNotFNTP_any := { 
                reference := ?,
                remotePort := *,
                linkID := *,
                ciStatus := *,
                linkPort := *,
                serviceInfo := *,
                priority := *,
                timeout_ := *
            } // End of template mw_updateNotFNTP_any 
            
            template (present) UpdateNotFNTP mdw_updateNotFNTP_port( 
                in template (present) PortNumber p_remotePort 
            ) := {
                reference := ?,
                remotePort := p_remotePort,
                linkID := *,
                ciStatus := *,
                linkPort := *,
                serviceInfo := *,
                priority := *,
                timeout_ := *
            } // End of template mdw_updateNotFNTP_port 
            
        } // End of group fntpManagement 
        
        /**
         * @desc template used to trigger message on Lower Tester
         */
@@ -688,8 +740,11 @@ module LibItsFntp_Templates {
            /**
             * @desc Initializes the FNTP IUT
             */
            template (value) UtInitialize m_fntpInitialize := {
            template (value) UtInitialize m_fntpInitialize( 
                in Oct1 p_useIicpRemoteCommand 
            ) := {
                utFntpInitialize := { 
                    useIicpRemoteCommand := p_useIicpRemoteCommand 
                }
            } // End of template m_fntpInitialize
            
@@ -733,7 +788,6 @@ module LibItsFntp_Templates {
                    utFntpCommandRequest := {
                        nfSapPrimitives := {
                            fill := PX_NF_SAP_DOWN_FILL_FIELD_VALUE, 

                            primitivesDown := {
                                fntpPortRequest := {
                                    serviceRef := p_serviceRef,
@@ -746,6 +800,38 @@ module LibItsFntp_Templates {
                    } // End of field 'utFntpCommandRequest'
                } // End of template m_generateNfFntpPortDeletionRequest
                
                template (value) UtCommandRequest m_fntpNfSapRemoteCommandRequest( 
                    in PduCounter p_counter, 
                    in CommandRef p_nextCommandRef, 
                    in template (value) NFsapPrimitivesDown p_nfSapPrimitivesDown
                ) := { 
                    utFntpCommandRequest := { 
                        rcmdNfSapPrimitives := m_iicRequestRx_mnCommandRequest( 
                            f_getIutOtherItsScuId(), 
                            f_getIutDestItsScuId(), 
                            p_counter, 
                            m_mnCommandRequest( 
                                p_nextCommandRef, 
                                m_mnRemoteCommandRequest(p_nfSapPrimitivesDown) 
                            ) 
                        ) // End of field rcmdNfSapPrimitives  
                    } // End of field utFntpCommandRequest 
                } // End of template m_fntpNfSapRemoteCommandRequest 
                
                template (value) MN_Command m_mnRemoteCommandRequest( 
                    in template (value) NFsapPrimitivesDown p_nfSapPrimitivesDown
                ) := { 
                    fill := '00000'B, 
                    mnCmd := { 
                        simNFcmd := { 
                            fill := '0000000'B, 
                            simNFcmd := { 
                                fntp := p_nfSapPrimitivesDown 
                            } // End of field simNFcmd 
                        } // End of field simNFcmd 
                    } // End of field mnCmd 
                } // End of template m_mnRemoteCommandRequest 
                
                /**
                 * @desc  Receive template used by the FNTP to acknowledge a previous NF-FNTP-PORT.request
                 * @param p_serviceRef  Contains the same value provided in parameter "serviceRef" in the related NF-FNTP-SOCKET.request
@@ -807,7 +893,7 @@ module LibItsFntp_Templates {
            
            /**
             * @desc Receive a succesful COMMAND.confirm primitive
             * @see ISO/CD 29281-2 Clause 8.3.1
             * @see ISO/CD 29281-2 Clause 8.2.1    NF-FNTP-PORT.request
             */
            template (present) UtCommandConfirm mw_fntpCommConfirm_success := {
                utFntpCommandConfirm := {
@@ -824,6 +910,26 @@ module LibItsFntp_Templates {
                } // End of field 'utFntpCommandConfirm'
            } // End of template mw_fntpCommConfirm_success
            
            /**
             * @desc Receive a succesful COMMAND.confirm primitive for port creation/delation
             * @param p_servicePort Contain the Service port number assigned by the FNTP
             * @see ISO/CD 29281-2 Clause 8.2.2 NF-FNTP-PORT.confirm 
             */
            template (present) UtCommandConfirm mdw_fntpCommConfirm_success_port( 
                in template (present) PortNumber p_servicePort 
            ) modifies mw_fntpCommConfirm_success := {
                utFntpCommandConfirm := {
                    nfSapPrimitives := {
                        primitivesUp := {
                            fntpPortConfirm := {
								serviceRef := ?, 
                                servicePort := p_servicePort
                            } // End of field 'fntpCommConfirm'
                        } // End of field 'primitivesUp'
                    } // End of field 'nfSapPrimitives'
                } // End of field 'utFntpCommandConfirm'
            } // End of template mw_fntpCommConfirm_success
            
            /**
             * @desc    Receive an unsuccesful COMMAND.confirm primitive
             * @see     ISO/WD 29281-2 Clause 8.3.2
@@ -1024,6 +1130,35 @@ module LibItsFntp_Templates {
                
            } // End of group fntpControlFields
            
            /**
             * @desc Receive template for FNTP notification to Management ITS layer without IICP mechanism 
             * @param p_portNumber Contains either the value PORT_NON in order to indicate dynamic assignment of a port number by the port number manager, or a valid value of a well-known static port PORT_REG 
             */
            template (present) UtRequestRequest mw_awaitFwtUpdate( 
                in template (present) PortNumber p_portNumber 
            ) := { 
                utFntpRequestRequest := { 
                    mnRequestRequest := mdw_fwtSetNotRequestReq_port(p_portNumber) 
                } // End of field utFntpRequestRequest 
            } // End of template mw_awaitFwtUpdate
            
            /**
             * @desc Receive template for FNTP notification to Management ITS layer using IICP mechanism 
             * @param   p_mn_rreq The MN-Request.request message
             * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU 
             */
            template (present) UtRequestRequest mw_fntpNnSapRemoteCommand( 
                in template (present) MN_Request_request p_mnReqReq 
            ) := { 
                utFntpRequestRequest := { 
                    rcmdMnRequestRequest := mdw_iicRequestTx_mnRequestRequest( 
                        ?, 
                        ?, 
                        p_mnReqReq 
                    ) // End of field rcmdMnRequestRequest  
                } // End of field utFntpRequestRequest 
            } // End of template mw_fntpNnSapRemoteCommand 
            
        } // End of group utPrimitives
        
    } // End of group fntpPrimitives
+33 −4
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ module LibItsFntp_TypesAndValues {
    import from LibCommon_BasicTypesAndValues { 
        type UInt16 
    };
	import from LibCommon_DataStrings { 
		type Oct1 
	};
    
    // LibIts
    import from CALMllsap language "ASN.1:1997" {
@@ -22,6 +25,15 @@ module LibItsFntp_TypesAndValues {
            NFsapPrimitivesDown, NFsapPrimitivesUp, FNTPintForwarding, 
            PortNumber 
    };
    import from CALMiitsscu language "ASN.1:1997" {
        type 
            IICrequestTX, IICrequestRX, 
		    IICresponseRX 
    };
    import from CALMmsap language "ASN.1:1997" {
        type 
            MN_Request_request, MN_Request 
    };
    
    /**
     * @desc FNTP port values
@@ -73,8 +85,10 @@ module LibItsFntp_TypesAndValues {
        
        /**
         * @desc Trigger to initialize the IUT.
         * @member useIicpRemoteCommand 
         */
        type record UtFntpInitialize {
            Oct1 useIicpRemoteCommand 
        }
        
        /**
@@ -86,22 +100,28 @@ module LibItsFntp_TypesAndValues {
        
        /**
         * @desc Send a XXX.request primitive to the IUT through a SAP.
         * @member nfSapPrimitives 
         * @member rcmdNfSapPrimitives 
         */
        type union UtFntpCommandRequest { 
            NFsapPrimitivesDown nfSapPrimitives
            NFsapPrimitivesDown nfSapPrimitives, 
            IICrequestTX        rcmdNfSapPrimitives 
        }
        with {
            encode (nfSapPrimitives) "LibItsFntp_asn1"
            encode (nfSapPrimitives) "LibItsFntp_asn1"; 
            encode (rcmdNfSapPrimitives) "LibItsIicp_asn1"; 
        }
        
        /**
         * @desc Receive a XXX.confirm primitive from the IUT through a SAP.
         */
        type union UtFntpCommandConfirm { 
            NFsapPrimitivesUp nfSapPrimitives
            NFsapPrimitivesUp nfSapPrimitives, 
            IICresponseRX     rcmdNfSapPrimitives 
        }
        with {
            encode (nfSapPrimitives) "LibItsFntp_asn1"
            encode (nfSapPrimitives) "LibItsFntp_asn1";
            encode (rcmdNfSapPrimitives) "LibItsIicp_asn1"; 
        }
        
        /**
@@ -114,6 +134,15 @@ module LibItsFntp_TypesAndValues {
            encode (nfSapPrimitives) "LibItsFntp_asn1"
        }
        
        type union UtFntpRequestRequest { 
            MN_Request_request  mnRequestRequest, 
            IICrequestRX        rcmdMnRequestRequest 
        }
        with {
            encode (mnRequestRequest) "LibItsCalm_asn1"; 
            encode (rcmdMnRequestRequest) "LibItsIicp_asn1"; 
        }
        
    } // End of group utPrimitives

    group acPrimitives {
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ module LibItsIicp_Functions {
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:iicpPort, system:iicpPort);
            map(self:iicpPort, system:iicpPort);
            map(self:mgtMfSapPort, system:mgtMfSapPort);
            
            // Connect
+5 −5
Original line number Diff line number Diff line
@@ -1126,7 +1126,7 @@ module LibItsIicp_Templates {
                            in template (value) ITS_scuId p_sourceItsScuId, 
                            in template (value) ITS_scuId p_destinationItsScuId, 
                            in template (value) PduCounter p_pduCounter, 
                            in template (value) MN_Command_request p_mnReqCmd 
                            in template (value) MN_Command_request p_mnCommand_reques 
                        ) := {
                            sourceITS_scuId := p_sourceItsScuId, 
                            destinationITS_scuId := p_destinationItsScuId, 
@@ -1134,7 +1134,7 @@ module LibItsIicp_Templates {
                            pduRequest := { 
                                fill := PX_PDU_REQUEST_FILL_FIELD_VALUE,
                                requests := { 
                                    mn_rcmd := p_mnReqCmd 
                                    mn_rcmd := p_mnCommand_reques 
                                } // End of 'requests' field 
                            }, // End of 'pduRequest' field
                            seqRq := ''O // No security
Loading