Commit 8a505cb5 authored by garciay's avatar garciay
Browse files

Align ATS FNTP code

parent 59f78391
Loading
Loading
Loading
Loading
+137 −125
Original line number Diff line number Diff line
@@ -7,7 +7,12 @@
module LibItsFntp_Functions {
    
    // Libcommon
    import from LibCommon_Sync all;
    import from LibCommon_Sync {
        function 
            f_connect4SelfOrClientSync, f_disconnect4SelfOrClientSync, 
        f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictTestBody; 
        altstep a_shutdown 
    };
    import from LibCommon_VerdictControl {
      type FncRetCode
    };
@@ -39,7 +44,7 @@ module LibItsFntp_Functions {
    import from LibItsFntp_TypesAndValues {
        const c_portDyn, c_portNon;
        type 
            UtFntpEvent, 
            UtFntpEvent, UtFntpEventInd, 
            CfFntpEventInd, 
            AcFntpPrimitive
    };
@@ -52,10 +57,6 @@ module LibItsFntp_Functions {
        template 
            mdw_fwtSetNotRequestReq_port, mw_mnRequestRequest_setNotFNTP 
    };
//    import from LibItsMgt_Functions { FIXME To be removed 
//        function 
//            f_getNextCommandRef 
//    }; 
    import from LibItsCalm_Interface { 
        type 
            ItsCalm, 
@@ -186,9 +187,6 @@ module LibItsFntp_Functions {
            
            // Set defaults
            activate(a_fntpDefault()); // Default for Fntp module
            // FIXME To be removed?
            activate(a_mgtMnSapPortDefault()); // Default for MGT module / MF-SAP port
            
        } // End of f_initialiseComponent
        
    } // End of group fntpConfigurationFunctions
@@ -267,17 +265,50 @@ module LibItsFntp_Functions {
            ); 
        } // End of function f_fntpAwaitFwtUpdate()
        
        function f_fntpCommandRequestWithoutConfirm( 
            in template (value) UtFntpEvent p_generateNfFntpCommandRequest // TODO To be renamed
        /**
         * @desc Generate a NF-SAP request and wait for a confirm message 
         * @param p_generateNfSapRequest The NF-SAP request message to send 
         * @param p_nfSapRequestConfirm   The command confirm response
         * @param p_discard       Set to true if command confirm responses shall be discard, otherwise the function failed 
         * @param p_result        The command/request confirm response
         * @verdict Unchanged on success, fail otherwise
         */
        function f_fntpGenerateNfSApRequestWithConfirm( 
            in template (value) UtFntpEvent p_generateNfSapRequest, 
            in template (present) UtFntpEventInd p_nfSapRequestConfirm, 
            in boolean p_discard, 
            out UtEventInd p_result 
        ) runs on ItsCalm { 
            
            f_utEventResponse(
                UtEvent : { 
                    utFntpEvent := p_generateNfSapRequest 
                }, 
                UtEventInd : { 
                    utFntpEventInd := p_nfSapRequestConfirm 
                }, 
                p_discard,
                p_result
            );
            
        } // End of function f_fntpGenerateNfSApRequestWithConfirm 
        
        /**
         * @desc Generate a NF-SAP request without waiting for a confirm message 
         * @param p_generateNfSapRequest The NF-SAP request message to send 
         * @verdict 
         */
        function f_fntpGenerateNfSApRequestWithoutConfirm( 
            in template (value) UtFntpEvent p_generateNfSapRequest 
        ) runs on ItsCalm { 
            
            f_utEvent(
                UtEvent : { 
                    utFntpEvent := p_generateNfFntpCommandRequest 
                    utFntpEvent := p_generateNfSapRequest 
                } 
            );
            
        } // End of function f_fntpCommandRequestWithoutConfirm 
        } // End of function f_fntpGenerateNfSApRequestWithoutConfirm 
        
        /**
         * @desc Call this method to remove entry created by f_initializeFntpForwardingTable() in FNTP Forwarding Table
@@ -344,6 +375,29 @@ module LibItsFntp_Functions {
    
    group adapterControl {
        
        function f_acGenerateBasicFntpNpdu(
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress 
        ) runs on ItsCalm { 
            f_acTriggerEvent( 
                m_generateFntpNpdu( 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            m_fntpBasicNpdu( 
                                p_sourcePort, 
                                p_destinationPort
                            ) 
                        ) 
                    ) 
                ) 
            ); 
//FIXME                f_fntpAwaitFwtUpdate(?);
        } // End of function f_acGenerateBasicFntpNpdu
        
        /**
         * @desc    Triggers test adapter to send FNTP forwarding NDPU
         * @param   p_sourcePort        Source port (c_portRtr or c_portHst)
@@ -355,46 +409,36 @@ module LibItsFntp_Functions {
         * @param   p_counter           Expected value of FNTP packet counter counter field
         * @param   p_hops              N-hops value
         */
        function f_generateFntpForwardingNpdu(
        function f_acGenerateFntpForwardingBasicNpdu(
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) PortNumber p_fromPort, 
            in template (value) PortNumber p_toPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in template (value) FNTPpacketCounter p_counter, 
            in template (value) FNTPhopCount p_hops 
        ) runs on ItsCalm { 
//            var template (value) SimNLTcmd v_simNltCmd := { // INsapPrimitivesUp 
//                spRef := 0, 
//                servPrimitive := {
//                    IN_UNITDATA_indication := m_inUnitDataInd( 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        bit2oct( 
//                            encvalue( 
//                                md_fntpForwardingNpdu( 
//                                    p_sourcePort, 
//                                    p_destinationPort, 
//                                    p_hops,
//                                    p_fromPort,
//                                    p_toPort,
//                                    p_counter 
//                                ) 
//                            ) 
//                        )
//                    ) 
//                }
//            }; 
//            var template (value) UtCommandRequest v_commandReq := m_fntpNfSapRemoteCommandRequest_simNltCmd( 
//                f_getNextPduCounter(), 
//                f_getNextCommandRef(), 
//                v_simNltCmd
//            ); 
//            f_utEvent(v_commandReq);
//            // And wait for a MN-SAP.MN-COMMAND/FWTupdate message sent by ITS management entity to update the forwarding table
////FIXME                f_fntpAwaitFwtUpdate(?);
        } // End of function f_acGenerateFntpForwardingNpdu
            f_acTriggerEvent( 
                m_generateFntpNpdu( 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpForwardingNpdu( 
                                p_sourcePort, 
                                p_destinationPort, 
                                p_hops,
                                p_fromPort,
                                p_toPort,
                                p_counter 
                            ) 
                        ) 
                    ) 
                ) 
            ); 
//FIXME                f_fntpAwaitFwtUpdate(?);
        } // End of function f_acGenerateFntpForwardingBasicNpdu
        
        /**
         * @desc    Triggers test adapter to send FNTP NDPU
@@ -404,89 +448,58 @@ module LibItsFntp_Functions {
         * @param   p_destinationPort   IN-SAP destination port
         * @param   p_hops              N-hops value
         */
        function f_generateFntpNpdu(
        function f_acGenerateExtendedFntpNpdu(
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in FNTPhopCount p_hops 
        ) runs on ItsCalm { 
//            var template (value) SimNLTcmd v_simNltCmd := { // INsapPrimitivesUp 
//                spRef := 0, 
//                servPrimitive := {
//                    IN_UNITDATA_indication := m_inUnitDataInd( 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                    bit2oct( 
//                        encvalue( 
//                            m_fntpBasicNpdu( 
//                                p_sourcePort, 
//                                p_destinationPort 
//                            ) 
//                        ) 
//                    ) 
//                ) 
//                }
//            }; 
//            var template (value) UtCommandRequest v_commandReq := m_fntpNfSapRemoteCommandRequest_simNltCmd( 
//                f_getNextPduCounter(), 
//                f_getNextCommandRef(), 
//                v_simNltCmd
//            ); 
//            f_utEvent(v_commandReq);
            // And wait for a MN-SAP.MN-COMMAND/FWTupdate message sent by ITS management entity to update the forwarding table
//FIXME                f_fntpAwaitFwtUpdate(?);
        } // End of function f_acGenerateFntpNPDU
        
        /**
         * @desc    Triggers event in the test system adaptation via IN-SAP interface.
         * @param   p_event The event to trigger
         */
        function f_acTriggerEvent(template (value) AcFntpPrimitive p_event) runs on ItsCalm {
            acPort.send(p_event);
        }
        
        function f_acGenerateBasicFntpNpdu(
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress 
        ) runs on ItsCalm { 
            f_acTriggerEvent( 
                m_generateFntpNpdu( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            m_fntpBasicNpdu( 
                            m_fntpExtendedNpdu( 
                                p_sourcePort, 
                                p_destinationPort
                                p_destinationPort, 
                                p_hops
                            ) 
                        ) 
                    ) 
                ) 
            ); 
        } // End of function f_acGenerateFntpNpduCip
//FIXME                f_fntpAwaitFwtUpdate(?);
        } // End of function f_acGenerateExtendedFntpNpdu
        
        /**
         * @desc    Triggers event in the test system adaptation via IN-SAP interface.
         * @param   p_event The event to trigger
         */
        function f_acTriggerEvent(template (value) AcFntpPrimitive p_event) runs on ItsCalm {
            acPort.send(p_event);
        }
        
        /**
         * @desc    Triggers lower tester to send FNTP station-internal NDPU with several hops and an invalid control field
         * @param   p_sourcePort            Source port 
         * @param   p_destinationPort       Destination port 
         * @param   p_insapSourceAddress    IN-SAP source port 
         * @param   p_insapDestAddress      IN-SAP destination port 
         * @param   p_inSapSourceAddress    IN-SAP source port 
         * @param   p_inSapDestAddress      IN-SAP destination port 
         * @param   p_hops                  N-hops value 
         */
        function f_acGenerateFntpNpduInvalidCtrlField( 
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, // TODO Rename in p_insapSourceAddress
            in template (value) LLserviceAddr p_insapDestAddress,  // TODO Rename in p_insapDestAddress
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in template (value) FNTPhopCount p_hops 
        ) runs on ItsCalm { 
            f_acTriggerEvent(
                m_generateFntpNpdu( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpExtendedNpdu_invalidCtrlField( 
@@ -504,19 +517,19 @@ module LibItsFntp_Functions {
         * @desc    Triggers lower tester to send FNTP station-internal NDPU with bit5 set 
         * @param   p_sourcePort            Source port 
         * @param   p_destinationPort       Destination port 
         * @param   p_insapSourceAddress    IN-SAP source port 
         * @param   p_insapDestAddress      IN-SAP destination port 
         * @param   p_inSapSourceAddress    IN-SAP source port 
         * @param   p_inSapDestAddress      IN-SAP destination port 
         */
        function f_acGenerateFntpNpduInvalidBitSet( 
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress 
        ) runs on ItsCalm { 
            f_acTriggerEvent(
                m_generateFntpNpdu( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpExtendedNpdu_invalidBitSet( 
@@ -534,8 +547,8 @@ module LibItsFntp_Functions {
         * @desc    Triggers test adapter to send FNTP NDPU
         * @param   p_sourcePort        Source port 
         * @param   p_destinationPort   Destination port 
         * @param   p_insapSourceAddress     IN-SAP source port 
         * @param   p_insapDestAddress       IN-SAP destination port 
         * @param   p_inSapSourceAddress     IN-SAP source port 
         * @param   p_inSapDestAddress       IN-SAP destination port 
         * @param   p_hops              N-hops value 
         * @param   p_rxCIP             Receive (RX) parameter settings
         * @param   p_txCIP             Transmit (TX) parameters of a VCI
@@ -544,8 +557,8 @@ module LibItsFntp_Functions {
        function f_acGenerateFntpNpduCip(
            in template (value) PortNumber p_sourcePort, 
            in template (value) PortNumber p_destinationPort, 
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in template (value) FNTPhopCount p_hops, 
            in template (value) RXcip p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough
            in template (value) TXcip p_txCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough
@@ -553,8 +566,8 @@ module LibItsFntp_Functions {
        ) runs on ItsCalm { 
            f_acTriggerEvent( 
                md_generateFntpNpduCip( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpExtendedNpdu_cip( 
@@ -587,15 +600,15 @@ module LibItsFntp_Functions {
            in template (value) PortNumber p_destinationPort, 
            in template (value) PortNumber p_fromPort, 
            in template (value) PortNumber p_toPort,
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in template (value) FNTPpacketCounter p_counter, 
            in template (value) FNTPhopCount p_hops 
        ) runs on ItsCalm { 
            f_acTriggerEvent( 
                m_generateFntpNpdu( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpForwardingNpdu_unknownItsScuId( 
@@ -630,8 +643,8 @@ module LibItsFntp_Functions {
            in template (value) PortNumber p_destinationPort, 
            in template (value) PortNumber p_fromPort, 
            in template (value) PortNumber p_toPort,
            in template (value) LLserviceAddr p_insapSourceAddress, 
            in template (value) LLserviceAddr p_insapDestAddress, 
            in template (value) LLserviceAddr p_inSapSourceAddress, 
            in template (value) LLserviceAddr p_inSapDestAddress, 
            in template (value) FNTPpacketCounter p_counter, 
            in template (value) FNTPhopCount p_hops, 
            in template (value) RXcip p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough
@@ -640,8 +653,8 @@ module LibItsFntp_Functions {
        ) runs on ItsCalm { 
            f_acTriggerEvent( 
                md_generateFntpNpduCip( 
                    p_insapSourceAddress, 
                    p_insapDestAddress, 
                    p_inSapSourceAddress, 
                    p_inSapDestAddress, 
                    bit2oct( 
                        encvalue( 
                            md_fntpForwardingNpdu_cip( 
@@ -1026,7 +1039,6 @@ module LibItsFntp_Functions {
         * @desc The base default.
         */
        altstep a_fntpUnsollictedMessages() runs on ItsCalm {
// FIXME Add support of response to NF-FNTP-PORT.confirm & NF-FNTP-COMM.confirm
            [] fntpPort.receive(mw_fntpInd(mw_fntpInSapPrimitiveReq(mw_inUnitDataReq_any))) {
                log("*** a_fntpDefault: INFO: Unexpected FNTP NDPU received in default ***");
            }
+54 −54
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ module LibItsFntp_Templates {
    }; 
    import from CALMiitsscu language "ASN.1:1997" { 
        type 
            McmdRs, 
            McmdRs, TestConfigIICP, 
            PduCounter 
    }; 
    import from CITSapplReq language "ASN.1:1997" {