/**
 *  @author     ETSI / STF422_EETS
 *  @version    $URL:$
 *              $Id:$
 *  @desc       FAST networking & transport layer protocol (ISO 29281-2) test cases
 */
module ItsFntp_TestCases {

    // Libcommon
    import from LibCommon_BasicTypesAndValues { 
        const c_uInt8Max 
    }; 
    import from LibCommon_Sync all; 
    
    // LibIts
    import from LibItsCommon_Functions  {
        function 
            f_checkTimeValidity, f_getCurrentTime 
    } 
    
    // LibItsCalm
    import from CALMfntp language "ASN.1:1997" {
        type 
            FNTPNPDU, 
            FNTPpacketCounter
    };
    import from CALMmsap language "ASN.1:1997" {
        type CommandRef
    };
    import from CALMllsap language "ASN.1:1997" {
        type IN_UNITDATA_request
    };
    import from LibItsFntp_TypesAndValues all;
    import from LibItsFntp_Templates all;
    import from LibItsFntp_Functions all;
    import from LibItsFntp_Pics all;
    import from LibItsMgt_TypesAndValues {
        const c_dniCiid 
    }; 
    import from LibItsMgt_Functions { 
        function 
            f_getNextCommandRef 
    };
    import from LibItsCalm_Interface {
        type 
            ItsCalm, FntpInd; 
    };
    import from LibItsCalm_TestSystem {
        type ItsCalmSystem 
    };
    
    // 6.1 Transmitting Packets
    group transmittingPackets {
        
        // 6.1.1 Basic procedure
        group basicProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    Single-hop broadcast transmission request with known VCI
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted single hop BC transmission request
                 *      }
                 *      then {
                 *          the IUT generates a basic FNTP NPDU, and forwards it to the BC-VCI(s) for transmission
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/BP/BV/01
                 */
                testcase TC_FNTP_TXP_BP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_basicNpdu;
                    
                    // Test control
                    if (not(PICS_ROLE_RH)) {
                        log("*** TC_FNTP_TXP_BP_BV_01: ERROR: 'PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_BP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdBc(),                       // Identifies the VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutShopValue())   // Content of the FNTP control field in the FNTP extended header
                        )
                    ); 
                    log("*** TC_FNTP_TXP_BP_BV_01: INFO: Formatted single hop BC transmission request done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_TXP_BP_BV_01: INFO: expected template: ", mw_fntpInd(
                        mw_fntpInSapPrimitiveReq(
                            mdw_inUnitDataReq( 
                                mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()), 
                                mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid()) 
                    ))));
                    tc_ac.start;
                    alt { 
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()),  // See ISO 21218 Table 6 - Address parameters in e.g. IN-UNITDATA.request for CIs using 48-bit MAC addresses
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid()) 
                         )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_basicNpdu);
                            log("*** TC_FNTP_TXP_BP_BV_01: INFO: FNTPPDU: ", v_basicNpdu, " ***");
                            if (match(v_basicNpdu, mdw_fntpBasicNpdu(vc_portNumber, f_getIutRemotePortNumberValue()))) { 
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_BP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_BP_BV_01: PASS: Received basic FNTP NPDU as expected ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_TXP_BP_BV_01: FAIL: Unexpected basic FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() { 
                            // Do not restart tc_ac
                            repeat; 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_BP_BV_01: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_BP_BV_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_FNTP_TXP_BP_BV_01: INFO: Postamble: done ***");
                    
                } // End of testcase TC_FNTP_TXP_BP_BV_01
                
                /**
                 * @desc    Single-hop unicast transmission request with known VCI
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the requested local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted single hop UC transmission request
                 *      }
                 *      then {
                 *          the IUT generates a basic FNTP NPDU, and forwards it to the UC-VCI for transmission
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/BP/BV/02
                 */
                testcase TC_FNTP_TXP_BP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_basicNpdu;
                    
                    // Test control
                    if (not(PICS_ROLE_RH)) {
                        log("*** TC_FNTP_TXP_BP_BV_02: ERROR: 'PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_setupKnownPeerStation();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_BP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm( 
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            mw_linkId(                                  // Identifies the VCI to be used to transmit the packet
                                f_getIutRemoteDestCiidUc(), 
                                f_getIutWlLocalCiid()),
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutShopValue())   // Content of the FNTP control field in the FNTP extended header
                        )
                    ); 
                    log("*** TC_FNTP_TXP_BP_BV_02: INFO: Formatted single hop UC transmission request done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_TXP_BP_BV_02: DEBUG: Expected template: ", 
                        mw_fntpInd( 
                            mw_fntpInSapPrimitiveReq( 
                                mdw_inUnitDataReq( 
                                    mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()), 
                                    mw_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()) 
                        ))), 
                        " ***");
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive( 
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq( 
                                    mdw_inUnitDataReq( 
                                        mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()), // See ISO 21218 Table 6 - Address parameters in e.g. IN-UNITDATA.request for CIs using 48-bit MAC addresses  
                                        mw_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()) 
                        )))) -> value v_fntpInd { 
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_basicNpdu);
                            log("*** TC_FNTP_TXP_BP_BV_02: INFO: FNTPPDU: ", v_basicNpdu, " ***");
                            if (match(v_basicNpdu, mdw_fntpBasicNpdu(vc_portNumber, ?))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_BP_BV_02: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_BP_BV_02: PASS: Received basic FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_TXP_BP_BV_02: FAIL: Unexpected basic FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() { 
                            // Do not restart tc_ac
                            repeat; 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_BP_BV_02: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_BP_BV_02: INFO: test body done ***");
                                        
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_TXP_BP_BV_02
                
            } // End of group validBehavior
            
            /**
             * Invalid test purposes will be defined in the next version of the present document once ISO has
             * implemented the concept of flows in the architecture standard ISO 21217 [i.7], and subsequently in
             * ISO 29281-1 [1]
             */
            group invalidBehavior {
                
            } // End of group invalidBehavior
            
        } // End of group basicProcedure
        
        // 6.1.2 Extended procedure
        group extendedProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    N-hop broadcast transmission request with known VCI
                 * <pre>
                 * Pics Selection: PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the requested local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted N-hop BC transmission request
                 *      }
                 *      then {
                 *          the IUT generates an extended FNTP NPDU, and forwards it to the BC-VCI(s) for transmission
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/EP/BV/01
                 */
                testcase TC_FNTP_TXP_EP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu;
                    
                    // Test control
                    if (not(PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_TXP_EP_BV_01: ERROR: 'PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_EP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdBc(),                       // Identifies the VCI to be used to broadcast the payload
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutNhopsValue())) // Content of the FNTP control field in the FNTP extended header
                    );
                    log("*** TC_FNTP_TXP_EP_BV_01: INFO: Formatted N-hop BC transmission request done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_TXP_EP_BV_01: DEBUG: Expected template: ", 
                        mw_fntpInd( 
                            mw_fntpInSapPrimitiveReq( 
                                mdw_inUnitDataReq( 
                                    mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()), 
                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid()) 
                        ))), 
                        " ***");
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId((c_dniCiid, f_getIutWlRemoteCiid()), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            log("*** TC_FNTP_TXP_EP_BV_01: INFO: Expected FNTPPDU: ", mdw_fntpExtendedNpdu(vc_portNumber, ?), " ***");
                            log("*** TC_FNTP_TXP_EP_BV_01: INFO: FNTPPDU: ", v_extendedNpdu, " ***");
                            if (match(v_extendedNpdu, mdw_fntpExtendedNpdu(vc_portNumber, ?))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_EP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_EP_BV_01: PASS: Received extended N-hops FNTP NPDU as expected ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_TXP_EP_BV_01: FAIL: Unexpected extended N-hops FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() { 
                            // Do not restart tc_ac
                            repeat; 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_EP_BV_01: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_EP_BV_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_TXP_EP_BV_01
                
            }// End of group validBehavior
            
            group invalidBehavior {
                
                // TODO BI shall be revised by ISO when concept of flows in architecture standard ISO 21217 will be done
                /**
                 * @desc    N-hop broadcast transmission request with unknown VCI
                 * <pre>
                 * Pics Selection: PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with no entry of the required BC-VCI, 
                 *      but with an entry for another BC-VCI properly serving the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted N-hop BC transmission request
                 *      }
                 *      then {
                 *          the IUT reports failure of delivery
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/EP/BI/01
                 */
                /* Removed from ETSI TS 102 985-2 V1.1.3 (2014-03)
                 * testcase TC_FNTP_TXP_EP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_TXP_EP_BI_01: ERROR: 'PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_EP_BI_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithConfirm( 
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                          // Unique cyclic reference number of command
                            vc_portNumber,                                  // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdUnknownBc(),                    // Identifies an unknown VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                              // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutNhopsValue())),    // Content of the FNTP control field in the FNTP extended header
                        mdw_fntpCommConfirm_unspecFailure(vc_portNumber),    // Failure expected
                        true,
                        vc_utEventInd.utFntpEventInd);
                    log("*** TC_FNTP_TXP_EP_BI_01: DEBUG: FNTP-COMMAND.request: vc_utEventInd=", vc_utEventInd, " ***");
                    log("*** TC_FNTP_TXP_EP_BI_01: INFO: FNTP-COMMAND.request done ***");
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_TXP_EP_BI_01: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_TXP_EP_BI_01: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_EP_BI_01: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                }*/ // End of testcase TC_FNTP_TXP_EP_BI_01
                
                /**
                 * @desc    N-hop broadcast transmission request with invalid FNTP control field, and with known VCI
                 * <pre>
                 * Pics Selection: PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support the local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received an N-hop BC transmission request with non-supported bits in "controlField" also set to 1
                 *      }
                 *      then {
                 *          the IUT reports failure of delivery
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/EP/BI/02
                 */
                testcase TC_FNTP_TXP_EP_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_TXP_EP_BI_02: ERROR: 'PICS_EXT and PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_EP_BI_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                           // Unique cyclic reference number of command
                            vc_portNumber,                                   // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdBc(),                            // Identifies the VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                               // Contains the ITS-SP payload EPDU
                            md_nonSupportedFntpControlField                  // NFfntpCommRequest message with unsupported control field
                        ),
                        mdw_fntpCommConfirm_unspecFailure(vc_portNumber),    // Failure expected 
                        true,
                        vc_utEventInd.utFntpEventInd);
                    log("*** TC_FNTP_TXP_EP_BI_02: DEBUG: FNTP-COMMAND.request: vc_utEventInd=", vc_utEventInd, " ***");
                    log("*** TC_FNTP_TXP_EP_BI_02: INFO: FNTP-COMMAND.request done ***");
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_TXP_EP_BI_02: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_TXP_EP_BI_02: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_EP_BI_02: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                   
                } // End of testcase TC_FNTP_TXP_EP_BI_02
                
            } // End of group invalidBehavior
            
        } // End of group extendedProcedure
        
        // 6.1.3 Forwarding procedure
        group forwardingProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    TX from ITS-S host
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the requested local port numbers of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted single hop BC transmission request for delivery via a VCI contained in a different ITS-SCU
                 *      }
                 *      then {
                 *          the IUT generates an FNTP forwarding NPDU, and forwards it to the BC-VCI for transmission to the selected ITS-S router
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/FP/BV/01
                 */
                testcase TC_FNTP_TXP_FP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_forwardingNpdu;
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_TXP_FP_BV_01: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up(); // Router only or Host only 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_FP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutLanLinkIdBc(),                      // Broadcast message with a different ITS-SCU
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutShopValue()))  // Content of the FNTP control field in the FNTP extended header
                    );
                    log("*** TC_FNTP_TXP_FP_BV_01: INFO: Formatted single hop BC transmission request for delivery via a VCI contained in a different ITS-SCU done ***");
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_forwardingNpdu);
                            log("*** TC_FNTP_TXP_FP_BV_01: INFO: FNTPPDU: ", v_forwardingNpdu, " ***");
                            if(match(v_forwardingNpdu, mdw_fntpForwardingNpdu(c_portRtr, c_portHst, f_getIutForwardingSrcPort(), f_getIutForwardingDestPort(), ?, f_getIutShopValue()))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_FP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_FP_BV_01: PASS: Received extended N-hops FNTP NPDU as expected ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_TXP_FP_BV_01: FAIL: Unexpected extended N-hops FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() {
                            // Do not restart tc_ac
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_FP_BV_01: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_FP_BV_01: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_TXP_FP_BV_01
               
                /**
                 * @desc    RX at ITS-S router
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of an ITS-S application in an ITS-S host
                *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received an FNTP station-internal forwarding NPDU containing a correctly formatted FNTP basic NPDU for single hop BC transmission
                 *      }
                 *      then {
                 *          the IUT extracts the FNTP basic NPDU, and forwards it to the BC-VCI for transmission via the IN-SAP
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/FP/BV/02
                 */
                testcase TC_FNTP_TXP_FP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_forwardingNpdu;
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_TXP_FP_BV_02: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_FP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendForwardingNpdu( 
                        { portLong := c_portHst },      // From host
                        { portLong := c_portRtr },      // To router
                        f_getIutForwardingSrcPort(),    // Forwarding source port
                        f_getIutForwardingDestPort(),   // Forwarding destination port
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())), 
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
                        0, 
                        f_getIutShopValue()             // S-Hop
                    );
                    log("*** TC_FNTP_TXP_FP_BV_02: INFO: FNTP station-internal forwarding NPDU containing a correctly formatted FNTP basic NPDU for single hop BC transmission done ***");
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq( 
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_forwardingNpdu);
                            log("*** TC_FNTP_TXP_FP_BV_02: INFO: FNTPPDU: ", v_forwardingNpdu, " ***");
                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpdu(c_portRtr, c_portHst, f_getIutForwardingSrcPort(), f_getIutForwardingDestPort(), ?, ?))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_FP_BV_02: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_FP_BV_02: PASS: Received forwarding S-Hop FNTP NPDU as expected ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_TXP_FP_BV_02: FAIL: Unexpected forwarding S-hops FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_FP_BV_02: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_FP_BV_02: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_TXP_FP_BV_02
                
                /**
                 * @desc    TX from ITS-S host - increment of Counter
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the requested local port numbers of the ITS-S application 
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a sequence of correctly formatted single hop BC transmission requests for delivery via a VCI contained in a different ITS-SCU, with the number of requests such that at least once the "Counter" value before increment is different to 255, 
                 *          and at least once it is equal to 255
                 *      }
                 *      then {
                 *          the IUT generates an FNTP forwarding NPDU for every request, with the "Counter" value in an FNTP forwarding NPDU equal to the "Counter" value from the previous FNTP forwarding NPDU incremented by one with a wrap around from the value 255 to 0
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/FP/BV/03
                 */
                testcase TC_FNTP_TXP_FP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_forwardingNpdu;
                    var integer v_counter; // Index used for loop
                    var template FNTPpacketCounter v_fntpPacketCounter; // Expected FNTPpacketCounter value
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_TXP_FP_BV_03: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_FP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    v_fntpPacketCounter := ?; // First loop, the fntpPacketCounter is unknown
                    v_counter := 0;
                    // Send first formatted single hop BC transmission request
                    f_fntpGenerateNfSApRequestWithoutConfirm( 
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutLanLinkIdBc(),                      // Broadcast message with a different ITS-SCU
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutShopValue()))  // Content of the FNTP control field in the FNTP extended header
                    );
                    log("*** TC_FNTP_TXP_FP_BV_03: INFO: First formatted single hop BC transmission request for delivery via a VCI contained in a different ITS-SCU done ***");
                    // Clause 'then'
                    // Process first expected FNTP forwarding NPDU
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            log("*** TC_FNTP_TXP_FP_BV_03: INFO: Received next FNTP forwarding NPDU ***");
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_forwardingNpdu);
                            log("*** TC_FNTP_TXP_FP_BV_03: INFO: FNTPPDU: ", v_forwardingNpdu, " ***");
                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpdu(c_portRtr, c_portHst, f_getIutForwardingSrcPort(), f_getIutForwardingDestPort(), v_fntpPacketCounter, f_getIutShopValue())) == false) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_FP_BV_03: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_TXP_FP_BV_03: ERROR: Received unexpected FNTP packet counter value ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            } else if (v_counter < 258) {
                                // Send next formatted single hop BC transmission request
                                v_counter := v_counter + 1;
                                v_fntpPacketCounter := (v_forwardingNpdu.header.options.intForw.counter + 1) mod (c_uInt8Max + 1); // Apply modulus 256 here
                                f_fntpGenerateNfSApRequestWithoutConfirm( 
                                    m_generateNfFntpCommRequest( 
                                        f_getNextCommandRef(),                      // Unique cyclic reference number of command
                                        vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                                        f_getIutLanLinkIdBc(),                      // Broadcast message with a different ITS-SCU
                                        f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                                        md_nHopNfFntpOptions(f_getIutShopValue()))  // Content of the FNTP control field in the FNTP extended header
                                );
                                log("*** TC_FNTP_TXP_FP_BV_03: INFO: Second formatted single hop BC transmission request done ***");
                                repeat; // Continue the processing
                            } else {
                                // Here, the counter has passed the wrap around fromt the value 255 to 0
                                log("*** TC_FNTP_TXP_FP_BV_03: PASS: The counter has passed the wrap around fromt the value 255 to 0 ***");
                            }
                        }
                        [] a_fntpUnsollictedMessages() {
                            // Do not restart tc_ac
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_TXP_FP_BV_03: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_FP_BV_03: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_TXP_FP_BV_03
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
                /**
                 * @desc    TX from ITS-S host - unknown access to ITS station-internal network
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with no entry related to an ITS station-internal network
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted single hop BC transmission request for delivery via a VCI contained in a different ITS-SCU
                 *      }
                 *      then {
                 *          the IUT reports failure of delivery
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/TXP/FP/BI/01
                 */
//              FIXME Implementation shall be reviewed during ATS validation 
                testcase TC_FNTP_TXP_FP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_TXP_FP_BI_01: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_TXP_FP_BI_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                          // Unique cyclic reference number of command
                            vc_portNumber,                                  // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutLanLinkIdBc(),                          // Broadcast message with a different ITS-SCU
                            f_getIutItsFpdu(),                              // Contains the ITS-SP payload EPDU
                            md_nHopNfFntpOptions(f_getIutShopValue())),     // Content of the FNTP control field in the FNTP extended header
                        mdw_fntpCommConfirm_unspecFailure(vc_portNumber),    // Failure expected 
                        true,
                        vc_utEventInd.utFntpEventInd
                    );
                    log("*** TC_FNTP_TXP_FP_BI_01: INFO: FNTP-COMMAND.request done ***");
                    // Clause 'then'
                    tc_noac.start; // No more message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            log("*** TC_FNTP_TXP_FP_BI_01: FAIL: No message was expected on FNTP port ***");
                        }
                        [] tc_noac.timeout {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            log("*** TC_FNTP_TXP_FP_BI_01: PASS: No message received as expected ***");
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_TXP_FP_BI_01: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_TXP_FP_BI_01
                
            } // End of group invalidBehavior
            
        } // End of group forwardingProcedure
        
    } // End of group transmittingPackets
    
    // 6.2 Transmitting Packets
    group receivingPackets {
        
        // 6.2.1 Basic delivery procedure
        group basicProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    Single hop unicast reception from peer station
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an entry in the FNTP forwarding table with Service Port such that no ITS station-internal forwarding is needed
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted unicast packet from the peer station via the IN-SAP
                 *      }
                 *      then {
                 *          the IUT forwards the message to the ITS-SP selected by the Service Port
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BV/01
                 */
                testcase TC_FNTP_RXP_BP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var UtFntpEventInd v_result; 
                    
                    // Test control
                    if (not(PICS_ROLE_RH)) {
                        log("*** TC_FNTP_RXP_BP_BV_01: ERROR: 'PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutLocalPortNumberValue()); 
                    f_setupKnownPeerStation();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendBasicFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        vc_portNumber,  
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid())), 
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid())) 
                    );
                    log("*** TC_FNTP_RXP_BP_BV_01: INFO: FNTP basic NPDU for single hop UC reception done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_RXP_BP_BV_01: DEBUG: Expected UT template: ", 
                        mw_utFntpEventInd( 
                            mdw_checkNfFntpCommIndication(
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                f_getIutLocalPortNumberValue(),                             // Source port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()) // Source address of DL-UNITDATA.request primitive
                    )));
                    tc_ac.start;
                    alt { 
                        [] utPort.receive( 
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                    f_getIutLocalPortNumberValue(),                             // Destination port of DL-UNITDATA.request primitive
                                    f_getIutRemotePortNumberValue(),                            // Source port of DL-UNITDATA.request primitive
                                    m_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()) // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_BP_BV_01: PASS: Received NF-COMM.indication primitive as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                        [] utPort.receive(UtFntpEventInd:?) -> value v_result {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_BP_BV_01: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_BP_BV_01: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BV_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BV_01
                
                /**
                 * @desc    Single hop unicast reception from unknown peer station
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an entry in the FNTP forwarding table for a Service Port, 
                 *      but no entry for the peer station
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted unicast packet from the peer station via the IN-SAP
                 *      }
                 *      then {
                 *          the IUT forwards the message to the ITS-SP selected by the Service Port,
                 *          the ITU informs the management about the new peer ITS-S

                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BV/02
                 */
                testcase TC_FNTP_RXP_BP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var UtFntpEventInd v_result; 
                    
                    // Test control
                    if (not(PICS_ROLE_RH)) {
                        log("*** TC_FNTP_RXP_BP_BV_02: ERROR: 'PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendBasicFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidUc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc()))         // Local station service address
                    );
                    log("*** TC_FNTP_RXP_BP_BV_02: INFO: FNTP basic NPDU for single hop UC reception done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_RXP_BP_BV_02: INFO: expected template: ", 
                        mw_utFntpEventInd( 
                            mdw_checkNfFntpCommIndication(
                                f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                    )));
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                    f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                    f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                    m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            // And check for a MN-SAP.MN-REQUEST/FWTupdate message sent to ITS management entity to update the forwarding table
                            if (PICS_ITS_MGT_NOT) {
                                f_fntpAwaitFwtUpdate( 
                                    vc_portNumber, 
                                    mw_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid()), 
                                    f_getIutRemotePortNumberValue(), 
                                    vc_portNumber 
                                );
                            }
                            log("*** TC_FNTP_RXP_BP_BV_02: PASS: Received NF-COMM.indication primitive as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                        [] utPort.receive(UtFntpEventInd:?) -> value v_result {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_BP_BV_02: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_BP_BV_02: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BV_02: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BV_02
                
                /**
                 * @desc    Single hop broadcast reception from peer station
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an entry in the FNTP forwarding table for a Service Port such that no ITS station-internal forwarding is needed
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast packet from the peer station via the IN-SAP
                 *      }
                 *      then {
                 *          the IUT forwards the message to the ITS-SP selected by the Service Port
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BV/03
                 */
                testcase TC_FNTP_RXP_BP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var UtFntpEventInd v_result; 
                    
                    // Test control
                    if (not(PICS_ROLE_RH)) {
                        log("*** TC_FNTP_RXP_BP_BV_03: ERROR: 'PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendBasicFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc()))         // Local station service address
                    );
                    log("*** TC_FNTP_RXP_BP_BV_03: INFO: FNTP basic NPDU for single hop BC reception done ***");
                    // Clause 'then'
                    log("*** TC_FNTP_RXP_BP_BV_03: INFO: expected template: ", 
                        mw_utFntpEventInd( 
                            mdw_checkNfFntpCommIndication(
                                f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                    )));
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            // And check for a MN-SAP.MN-REQUEST/FWTupdate message sent to ITS management entity to update the forwarding table
                            if (PICS_ITS_MGT_NOT) {
                                f_fntpAwaitFwtUpdate( 
                                    vc_portNumber, 
                                    mw_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid()), 
                                    f_getIutRemotePortNumberValue(), 
                                    vc_portNumber 
                                );
                            }
                            log("*** TC_FNTP_RXP_BP_BV_03: PASS: Received NF-COMM.indication primitive as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                        [] utPort.receive(UtFntpEventInd:?) -> value v_result {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_BP_BV_02: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_BP_BV_03: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BV_03: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BV_03
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
                /**
                 * @desc    Single hop broadcast reception to unknown Service Port
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an entry in the FNTP forwarding table for Service Port = port1, 
                 *      but not for Service Port = port2
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destination Port port2, 
                 *          with port2 different to port1
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/01
                 */
                testcase TC_FNTP_RXP_BP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_01: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutRemotePortNumberValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutLocalPortNumberValue(), 
                        f_getIutSecondRemotePortNumberValue(),
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_01: INFO: Broadcast message sent ***");
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive { 
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_01: FAIL: No message was expected on FNTP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { 
                            log("*** TC_FNTP_RXP_BP_BI_01: PASS: No FNTP NPDU received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_01
                
                /**
                 * @desc    Single hop broadcast reception to invalid Port PORT_NON
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destination Port PORT_NON
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/02
                 */
                testcase TC_FNTP_RXP_BP_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_02: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutLocalPortNumberValue(), 
                        { portLong := c_portNon }, 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_02: INFO: Broadcast message sent ***");
                    // Clause 'then'
                    tc_noac.start;
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_02: FAIL: No message was expected on FNTP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // the IUT discards the message, no messages expected
                            log("*** TC_FNTP_RXP_BP_BI_02: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_02: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_02
                
                /**
                 * @desc    Single hop broadcast reception from invalid Port PORT_NON
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *     the IUT having an entry in the FNTP forwarding table for Service Port = port1
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destinationPort port1 and a sourcePort PORT_NON
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/03
                 */
                testcase TC_FNTP_RXP_BP_BI_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_03: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutSecondRemotePortNumberValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        { portLong := c_portNon }, 
                        f_getIutRemotePortNumberValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_03: INFO: Broadcast message sent ***");
                    // Clause 'then'
                    tc_noac.start;
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_03: FAIL: No message was expected on FNTP port***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // the IUT discards the message, no messages expected
                            log("*** TC_FNTP_RXP_BP_BI_03: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_03: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_03
                
                /**
                 * @desc    Single hop broadcast reception from invalid port PORT_NON to invalid port PORT_NON
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destinationPort port1 and a sourcePort PORT_NON
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/04
                 */
                testcase TC_FNTP_RXP_BP_BI_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_04: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_04: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        { portLong := c_portNon }, 
                        { portLong := c_portNon }, 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_04: INFO: Broadcast message sent ***");
                    // Clause 'then'
                    tc_noac.start;
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_04: FAIL: No message was expected on FNTP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] cfPort.receive { 
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_04: FAIL: No message was expected on MN-SAP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // the IUT discards the message, no messages expected
                            log("*** TC_FNTP_RXP_BP_BI_04: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_04: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_04
                
                /**
                 * @desc    Single hop broadcast reception with invalid pair of ports, one of which is PORT_RTR and the other one is different to PORT_HST
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destinationPort PORT_RTR and a sourcePort different to PORT_HST
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/05
                 */
                testcase TC_FNTP_RXP_BP_BI_05() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_05: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_05: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        { portLong := c_portRtr }, 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_05: INFO: Broadcast message sent ***");
                    // Clause 'then'
                    tc_noac.start;
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_05: FAIL: No message was expected on FNTP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] cfPort.receive { 
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_05: FAIL: No message was expected on MN-SAP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // the IUT discards the message, no messages expected
                            log("*** TC_FNTP_RXP_BP_BI_05: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_05: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_05
                
                /**
                 * @desc    Single hop broadcast reception with invalid pair of ports, one of which is PORT_HST and the other one is different to PORT_RTR
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH OR PICS_ROLE_HONLY OR PICS_ROLE_RONLY
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast message with a destinationPort PORT_RTR and a sourcePort different to PORT_HST
                 *      }
                 *      then {
                 *          the IUT discards the message
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/BP/BI/06
                 */
                testcase TC_FNTP_RXP_BP_BI_06() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY)) {
                        log("*** TC_FNTP_RXP_BP_BI_06: ERROR: 'PICS_ROLE_RH or PICS_ROLE_HONLY or PICS_ROLE_RONLY' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_BP_BI_06: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        { portLong := c_portHst }, 
                        { portLong := c_portRtr }, 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),         // Local station service address
                        f_getIutShopValue() 
                    );
                    log("*** TC_FNTP_RXP_BP_BI_06: INFO: Broadcast message sent ***");
                    
                    // Clause 'then'
                    tc_noac.start;
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_06: FAIL: No message was expected on FNTP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] cfPort.receive { 
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_BP_BI_06: FAIL: No message was expected on MN-SAP port ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // the IUT discards the message, no messages expected
                            log("*** TC_FNTP_RXP_BP_BI_06: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_BP_BI_06: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_BP_BI_06
                
            } // End of group invalidBehavior
            
        } // End of group basicProcedure
        
        // 6.2.2 Extended delivery procedure
        group extendedProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    N-hop broadcast reception with forwarding
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of the local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast packet from the peer station via the IN-SAP with FNTP hop count set to 1
                 *      }
                 *      then {
                 *          the IUT forwards the message to the ITS-SP selected by the Service Port, 
                 *          and, the IUT transmits the received packet in broadcast mode with FNTP hop count set to zero
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BV/01
                 */
                testcase TC_FNTP_RXP_EP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu; // Expected forwarding NPDU
                    
                    // Test control
                    if (not(PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_RXP_EP_BV_01: ERROR: 'PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_setupKnownPeerStation();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_EP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),        // Local station service address
                        f_getIutNhopsValue() // N-hops count set to a value larger than 0
                    );
                    log("*** TC_FNTP_RXP_EP_BV_01: INFO: Broadcast message sent ***");
                    
                    // Clause 'then'
                    // 1) The IUT forwards the message to the ITS-SP selected by the Service Port, 
                    log("*** TC_FNTP_RXP_EP_BV_01: DEBUG: Expected UT template: ", 
                        mw_utFntpEventInd( 
                            mdw_checkNfFntpCommIndication(
                                f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                    )));
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                    f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                    f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                    m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_01: INFO: Received NF-COMM.indication primitive as expected ***");
                        }
                        [] utPort.receive {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_01: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_01: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    // 2) And, the IUT transmits the received packet in broadcast mode with FNTP hop count decremented by one
                    log("*** TC_FNTP_RXP_EP_BV_01: DEBUG: Expected LT template: ", 
                        mw_fntpInd( 
                            mw_fntpInSapPrimitiveReq(
                                mdw_inUnitDataReq( 
                                    mw_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid()), 
                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()) 
                    ))));
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()) 
                            )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            log("*** TC_FNTP_RXP_EP_BV_01: DEBUG: Expected FNTPPDU: ", m_fntpExtendedNpdu(f_getIutRemotePortNumberValue(), f_getIutAppPortValue(), f_getIutNhopsValue() - 1), " ***");
                            log("*** TC_FNTP_RXP_EP_BV_01: INFO: FNTPPDU: ", v_extendedNpdu, " ***");
                            if (match(v_extendedNpdu, m_fntpExtendedNpdu(f_getIutRemotePortNumberValue(), f_getIutAppPortValue(), f_getIutNhopsValue() - 1))) {
                                //TODO Enhance to check generation timestamp
/*                                if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_RXP_EP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_RXP_EP_BV_01: PASS: IUT transmits the received packet in BC mode ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_RXP_EP_BV_01: FAIL: Unexpected extended N-hops FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() { 
                            // Do not restart tc_ac
                            repeat; 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_01: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BV_01: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BV_01
                
                /**
                 * @desc    N-hop broadcast reception with no more forwarding (last hop test)
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an FNTP forwarding table with proper entry in support of  the local port number of the ITS-S application
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast packet from the peer station via the IN-SAP with FNTP hop count set to 0
                 *      }
                 *      then {
                 *          the IUT forwards the message to the ITS-SP selected by the Service Port, 
                 *          and, the IUT does not transmit the received packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BV/02
                 */
                testcase TC_FNTP_RXP_EP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_RXP_EP_BV_02: ERROR: 'PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_EP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),        // Local station service address
                        f_getIutShopValue() // S-hop count set to 0
                    );
                    log("*** TC_FNTP_RXP_EP_BV_02: INFO: Broadcast message sent ***");
                    
                    // Clause 'then'
                    // 1) The IUT forwards the message to the ITS-SP selected by the Service Port, 
                    log("*** TC_FNTP_RXP_EP_BV_02: DEBUG: Expected UT template: ", 
                        mw_utFntpEventInd( 
                            mdw_checkNfFntpCommIndication(
                                f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                    )));
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                    f_getIutAppPortValue(),                                     // Source port of DL-UNITDATA.request primitive
                                    f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                    m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_02: INFO: Received NF-COMM.indication primitive as expected ***");
                        }
                        [] utPort.receive {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_02: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_02: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    // 2) And, the IUT does not transmit the received packet
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_02: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout { // And, the IUT does not transmit the received packet
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_02: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BV_02: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BV_02
                
                /**
                 * @desc    N-hop broadcast reception to unknown Service Port with forwarding
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having no entry in the FNTP forwarding table for Service Port 
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast packet with unknown destination Port from a peer station via the IN-SAP with FNTP hop count set to a value larger than 0
                 *      }
                 *      then {
                 *          the IUT transmits the received packet in broadcast mode with FNTP hop count set to 0, 
                 *          and, the IUT discards the packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BV/03
                 */
                testcase TC_FNTP_RXP_EP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu; // Expected extended NPDU
                    var boolean v_inSapMessageReceived := false;
                    
                    // Test control
                    if (not(PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_RXP_EP_BV_03: ERROR: 'PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Nothing to do
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_EP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),        // Local station service address
                        f_getIutNhopsValue() //hop count set to a value larger than 0
                    );
                    log("*** TC_FNTP_RXP_EP_BV_03: INFO: Broadcast message sent ***");
                    
                    // Clause 'then'
                    log("*** TC_FNTP_RXP_EP_BV_03: DEBUG: Expected LT template: ", 
                        mw_fntpInd( 
                            mw_fntpInSapPrimitiveReq(
                                mdw_inUnitDataReq( 
                                    mw_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid()), 
                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()) 
                    ))));
                    tc_ac.start;
                    tc_noac.start;
                    alt {
                        [] utPort.receive { // No message is expected on NF-SAP
                            tc_noac.stop;
                            tc_ac.stop;
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            log("*** TC_FNTP_RXP_EP_BV_03: FAIL: No message was expected on NF-SAP ***");
                        }
                        [] fntpPort.receive( 
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            v_inSapMessageReceived := true;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            log("*** TC_FNTP_RXP_EP_BV_03: DEBUG: Expected FNTPPDU: ", mdw_fntpExtendedNpdu_portNumber(f_getIutRemotePortNumberValue(), f_getIutAppPortValue(), f_getIutNhopsValue() - 1), " ***");
                            log("*** TC_FNTP_RXP_EP_BV_03: INFO: FNTPPDU: ", v_extendedNpdu, " ***");
                            if (match(v_extendedNpdu, mdw_fntpExtendedNpdu_portNumber(f_getIutRemotePortNumberValue(), f_getIutAppPortValue(), f_getIutNhopsValue() - 1))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_FP_BV_03: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_RXP_EP_BV_03: PASS: IUT transmits the received packet in BC mode ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_RXP_EP_BV_03: FAIL: Unexpected extended N-hops FNTP NPDU ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] a_fntpUnsollictedMessages() { 
                            // Do not restart tc_ac
                            repeat; 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_03: INFO: No message received as expected ***");
                            if (v_inSapMessageReceived == false) {
                                repeat;
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_03: INCONC: the IUT discards the packet ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BV_03: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BV_03
                
                /**
                 * @desc    N-hop broadcast reception to unknown Service Port without forwarding
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having no entry in the FNTP forwarding table for Service Port 
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted broadcast packet with unknown destination Port from a peer station via the IN-SAP with FNTP hop count set to 0
                 *      }
                 *      then {
                 *          the IUT discards the packet, 
                 *          and, does not transmit the received packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BV/04
                 */
                testcase TC_FNTP_RXP_EP_BV_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_RXP_EP_BV_04: ERROR: 'PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Nothing to do
                    log("*** TC_FNTP_RXP_EP_BV_04: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    // Clause 'when'
                    f_sendExtendedFntpNpdu( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),        // Local station service address
                        0 
                    );
                    log("*** TC_FNTP_RXP_EP_BV_04: INFO: Broadcast message sent ***");
                    
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_EP_BV_04: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_EP_BV_04: PASS: No FNTP NPDUs received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BV_04: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BV_04
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
                /**
                 * @desc    N-hop broadcast reception with a furthur but unknown FNTP control field value
                 * <pre>
                 * Pics Selection: PICS_ROLE_RH and PICS_NHOPBC
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table 
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a broadcast packet with invalid value in the FNTP control field from a peer station via the IN-SAP with FNTP hop count set to a value larger than 0
                 *      }
                 *      then {
                 *          the IUT discards the packet, 
                 *          and, does not transmit the received packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BI/01
                 */
                testcase TC_FNTP_RXP_EP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_RH and PICS_NHOPBC)) {
                        log("*** TC_FNTP_RXP_EP_BI_01: ERROR: 'PICS_ROLE_RH and PICS_NHOPBC' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_EP_BI_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendFntpNpduInvalidCtrlField( 
                        f_getIutRemotePortNumberValue(), 
                        f_getIutAppPortValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlRemoteCiidBc())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlRemoteCiidUc())),        // Local station service address
                        10
                    );
                    log("*** TC_FNTP_RXP_EP_BI_01: INFO: Broadcast message with invalid control fields sent ***");
                    
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_EP_BI_01: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_EP_BI_01: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BI_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BI_01
                
                /**
                 * @desc    Reception of packet with not supported / invalid FNTP control field value
                 * <pre>
                 * Pics Selection: PICS_EXT and PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table, 
                 *      but without entry for the peer station
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a broadcast packet with not supported / illegal value (e.g. bit 5 set to 1) from a peer station via the IN-SAP
                 *      }
                 *      then {
                 *          the IUT discards the packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/EP/BI/02
                 */
                testcase TC_FNTP_RXP_EP_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_EXT and PICS_ROLE_RH)) {
                        log("*** TC_FNTP_RXP_EP_BI_02: ERROR: 'PICS_EXT and PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_EP_BI_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendFntpNpduInvalidBitSet( 
                        f_getIutLocalPortNumberValue(), 
                        f_getIutRemotePortNumberValue(), 
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())),     // Peer station service address
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()))         // Local station service address
                    );
                    
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_EP_BI_02: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_EP_BI_02: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_EP_BI_02: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_RXP_EP_BI_02
                
            } // End of group invalidBehavior
            
        } // End of group extendedProcedure
        
        // 7.7.6 Forwarded delivery procedure
        group forwardedProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    TX from ITS-S router to ITS-S host
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having set up properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a packet from a peer station requiring local forwarding via the ITS station-internal network
                 *      }
                 *      then {
                 *          the IUT constructs an FNTP forwarding NPDU and transmits it via the BC-VCI connected to the ITS station-internal network
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/FP/BV/01
                 */
                testcase TC_FNTP_RXP_FP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_forwardingNpdu; // Expected forwarding NPDU
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_RXP_FP_BV_01: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue()); 
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_FP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendForwardingNpdu( 
                        { portLong := c_portRtr },                                                      // From ITS-S router
                        { portLong := c_portHst },                                                      // To ITS-S host
                        f_getIutForwardingSrcPort(),                                                    // Forwarding source port
                        f_getIutForwardingDestPort(),                                                   // Forwarding destination port
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), // Peer station is the source
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())),   // Router is the destination
                        0, 
                        f_getIutShopValue()                                                             // S-Hop
                    ); 
                    log("*** TC_FNTP_RXP_FP_BV_01: INFO: Formatted UC transmission request done ***");
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_forwardingNpdu);
                            log("*** TC_FNTP_RXP_FP_BV_01: INFO: FNTPPDU: ", v_forwardingNpdu, " ***");
                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpdu(c_portRtr, c_portHst, f_getIutForwardingSrcPort(), f_getIutForwardingDestPort(), ?, ?))) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_BP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                log("*** TC_FNTP_RXP_FP_BV_01: PASS: Received FNTP forwarding NPDU as expected ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                            } else {
                                log("*** TC_FNTP_RXP_FP_BV_01: FAIL: Expected message not received ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_FP_BV_01: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_FP_BV_01: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_RXP_FP_BV_01
                
                /**
                 * @desc    TX from ITS-S router - Increment of Counter
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having set up ptoperly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having receivd a sequence of packets from a peer station requiring local forwarding via the ITS station-internal network, 
                 *          with the number of packets such that at least once the "Counter" value before increment is different to 255, 
                 *          and at least once it is equal to 255
                 *      }
                 *      then {
                 *          the IUT generates an FNTP forwarding NPDU for every request, 
                 *          with the Counter value in the second FNTP forwarding NPDU equal to the Counter value from the first FNTP forwarding NPDU incremented by onevalue and transmits it via the BC-VCI connected to the ITS station-internal network
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/FP/BV/02
                 */
                testcase TC_FNTP_RXP_FP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_forwardingNpdu;
                    var integer v_counter; // Index used for loop
                    var template (value) FNTPpacketCounter v_fntpPacketCounter; // Expected FNTPpacketCounter value
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_RXP_FP_BV_02: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue()); 
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_FP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    v_counter := 250; 
                    v_fntpPacketCounter := v_counter; 
                    f_sendForwardingNpdu( 
                        { portLong := c_portRtr },                                                      // From ITS-S router
                        { portLong := c_portHst },                                                      // To ITS-S host
                        f_getIutForwardingSrcPort(),                                                    // Forwarding source port
                        f_getIutForwardingDestPort(),                                                   // Forwarding destination port
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), // Peer station is the source
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())),   // Router is the destination
                        v_fntpPacketCounter, 
                        f_getIutNhopsValue()
                    ); 
                    // Prepare expected value
                    v_counter := v_counter + 1; 
                    v_fntpPacketCounter := v_counter; 
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReq( 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()) 
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_FP_BV_02: INFO: Received next FNTP forwarding NPDU ***");
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_forwardingNpdu);
                            log("*** TC_FNTP_RXP_FP_BV_02: INFO: FNTPPDU: ", v_forwardingNpdu, " ***");
                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpdu(c_portRtr, c_portHst, f_getIutForwardingSrcPort(), f_getIutForwardingDestPort(), v_fntpPacketCounter, ?)) == false) {
                                log("*** TC_FNTP_RXP_FP_BV_02: ERROR: Received unexpected FNTP packet counter value ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            } else if (v_counter < 258) {
                                //TODO Enhance to check generation timestamp
                                /*if (f_checkTimeValidity(int2float(v_fntpInd.receptionTime), int2float(f_getCurrentTime())) == false) { 
                                    log("*** TC_FNTP_TXP_BP_BV_01: WARN: Invalid timestamp ***");
                                }*/
                                // Prepare expected value
                                v_counter := v_counter + 1;
                                v_fntpPacketCounter := v_counter  mod (c_uInt8Max + 1); // Apply modulus 256 here
                                log("*** TC_FNTP_RXP_FP_BV_02: INFO: Second formatted single hop BC transmission request done ***");
                                // FIXME Do we need to call f_sendForwardingNpdu again?
                                repeat; // Continue the processing
                            } else {
                                // Here, the counter has passed the wrap around fromt the value 255 to 0
                                log("*** TC_FNTP_RXP_FP_BV_02: PASS: The counter has passed the wrap around fromt the value 255 to 0 ***");
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_FP_BV_02: INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_FP_BV_02: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_RXP_FP_BV_02
                
                /**
                 * @desc    RX at ITS-S host
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having set up properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received an FNTP station-internal forwarding NPDU containing a correctly fornmated FNTP basic NPDU
                 *      }
                 *      then {
                 *          the IUT extracts the FNTP basic NPDU, 
                 *          and notifies its reception to the required port
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/FP/BV/04
                 */
                testcase TC_FNTP_RXP_FP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_RXP_FP_BV_03: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue()); 
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_FP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendForwardingNpdu( 
                        { portLong := c_portRtr },                                                      // From ITS-S router
                        { portLong := c_portHst },                                                      // To ITS-S host
                        f_getIutForwardingSrcPort(),                                                    // Forwarding source port
                        vc_portNumber,     // Forwarding destination port is this ITS-S
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), // Peer station is the source
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())),   // Router is the destination
                        0, 
                        f_getIutShopValue()                                                             // S-Hop
                    ); 
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                        vc_portNumber,                                                  // Destination port of DL-UNITDATA.request primitive
                                        f_getIutForwardingSrcPort(),                                    // Source port of DL-UNITDATA.request primitive
                                        m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            log("*** TC_FNTP_RXP_FP_BV_03: PASS: Received NF-COMM.indication primitive as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                        [] utPort.receive {
                            log("*** TC_FNTP_RXP_FP_BV_03: FAIL: Unexpected NF-COMM.indication primitive ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_ac.timeout {
                            log("*** TC_FNTP_RXP_FP_BV_03: INCONC: Unexpected basic FNTP NPDU ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_FP_BV_03: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_RXP_FP_BV_03
                
                /**
                 * @desc    RX at ITS-S host - wrong ITS-SCU-ID
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having an ITS-SCU-ID different to the requested one
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received an FNTP station-internal forwarding NPDU containing a correctly formatted FNTP basic NPDU, 
                 *          but the ITS-SCU-ID indicates a different ITS-SCU
                 *      }
                 *      then {
                 *          the IUT discards the packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/FP/BV/04
                 */
                testcase TC_FNTP_RXP_FP_BV_04() runs on ItsCalm system ItsCalmSystem { 
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_RXP_FP_BV_04: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_FP_BV_04: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendFntpForwardingNpduWithUnknownItsSciId( 
                        { portLong := c_portRtr },                                                      // From ITS-S router
                        { portLong := c_portHst },                                                      // To ITS-S host
                        f_getIutForwardingSrcPort(),                                                    // Forwarding source port
                        f_getIutServicePortValue(),                                                     // Forwarding destination port is this ITS-S
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), // Peer station is the source
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())),   // Router is the destination
                        0, 
                        f_getIutShopValue()                                                             // S-Hop
                    ); 
                    
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            log("*** TC_FNTP_RXP_FP_BV_04: FAIL: No message was expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_FP_BV_04: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_FP_BV_04: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_RXP_FP_BV_04
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
                /**
                 * @desc    RX at ITS-S host - unknown Service Port
                 * <pre>
                 * Pics Selection: PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
                 * Config Id: CF02
                 * Initial conditions: 
                 *  with {
                 *      the IUT having no more entry for the required Service Port
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received an FNTP station-internal forwarding NPDU containing a correctly formatted FNTP basic NPDU, but the Service Port is no more known
                 *      }
                 *      then {
                 *          the IUT discards the packet
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/RXP/FP/BI/01
                 */
                testcase TC_FNTP_RXP_FP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH))) {
                        log("*** TC_FNTP_RXP_FP_BI_01: ERROR: 'PICS_ITS_S_INW and (PICS_ROLE_RONLY or PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions': nothing to do
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_RXP_FP_BI_01: INFO: Preamble done ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_sendForwardingNpdu( 
                        { portLong := c_portRtr },                                                      // From ITS-S router
                        { portLong := c_portHst },                                                      // To ITS-S host
                        f_getIutForwardingSrcPort(),                                                    // Forwarding source port
                        f_getIutServicePortValue(),                                                     // Forwarding destination port is this ITS-S
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), // Peer station is the source
                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())),   // Router is the destination
                        0, 
                        f_getIutShopValue()                                                             // S-Hop
                    ); 
                    
                    // Clause 'then'
                    tc_noac.start; // No message expected
                    alt {
                        [] fntpPort.receive {
                            tc_noac.stop;
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            log("*** TC_FNTP_RXP_FP_BI_01: FAIL: No message was expected ***");
                        }
                        [] tc_noac.timeout {
                            log("*** TC_FNTP_RXP_FP_BI_01: PASS: No message received as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_RXP_FP_BI_01: INFO: test body done ***");
                    
                    // Postamble
//                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf02Down();
                    
                } // End of testcase TC_FNTP_RXP_FP_BI_01
                
            } // End of group invalidBehavior
            
        } // End of group forwardedProcedure
        
    } // End of group receivingPackets
    
    // 6.3 CI parameter management
    group cipManagement {
        
        // 6.3.1 Basic procedure N/A
        group basicProcedure {
            
            group validBehavior {
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
            } // End of group invalidBehavior
            
        } // End of group basicProcedure
        
        // 6.3.2 Extended procedure
        group extendedProcedure {
            
            group validBehavior {
                
                /**
                 * @desc    CIP in NPDU for single-hop BC transmission
                 * <pre>
                 * Pics Selection: PICS_CIP and PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted single hop BC transmission request with CIPs indicated in the NF-FNTP-COMM.request service primitive
                 *      }
                 *      then {
                 *          the IUT generates an FNTP extended NPDU with CIPs included, and forwards it to the proper BC-VCI with access_parameters in the IN-SAP service primitive set equal to the CIPs
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/EP/BV/01
                 */
                testcase TC_FNTP_CIP_EP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu;
                    
                    // Test control
                    if (not((PICS_CIP and PICS_ROLE_RH))) {
                        log("*** TC_FNTP_CIP_EP_BV_01: ERROR: 'PICS_CIP and PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_CIP_EP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdBc(),                       // Identifies the VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_cipNfFntpOptions(                        // Contains CIP indication
                                f_getIutShopValue(), 
                                ''O, 
                                f_getIutTxCipValue()
                            )
                        )
                    );
                    log("*** TC_FNTP_CIP_EP_BV_01: INFO: Formatted BC transmission request done ***");
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReqCip( 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        f_getIutAccessParametersValue() // FIXME ASN.1 AccessParameters description shall be enhanced
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            if (match(
                                    v_extendedNpdu, 
                                    mw_fntpExtendedNpduCip(
                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
                                        f_getIutTxCipValue()))) {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                                log("*** TC_FNTP_CIP_EP_BV_01: PASS: Received extended FNTP NPDU with CIPs as expected ***");
                            } else {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                                log("*** TC_FNTP_CIP_EP_BV_01: FAIL: Expected message not received ***");
                            }
                        }
                        [] tc_ac.timeout {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                            log("*** TC_FNTP_CIP_EP_BV_01: INCONC: Expected message not received ***");
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_CIP_EP_BV_01: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_CIP_EP_BV_01
                
                /**
                 * @desc    CIP in NPDU for N-hop BC transmission
                 * <pre>
                 * Pics Selection: PICS_CIP and PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted N-hop BC transmission request with CIPs indicated in the NF-FNTP-COMM.request service primitive
                 *      }
                 *      then {
                 *          the IUT generates an FNTP extended NPDU with CIPs included, and forwards it to the proper UC-VCI with access_parameters in the IN-SAP service primitive set equal to the CIPs
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/EP/BV/02
                 */
                testcase TC_FNTP_CIP_EP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu;
                    
                    // Test control
                    if (not((PICS_CIP and PICS_ROLE_RH))) {
                        log("*** TC_FNTP_CIP_EP_BV_02: ERROR: 'PICS_CIP and PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_CIP_EP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdBc(),                       // Identifies the VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_cipNfFntpOptions(                        // Contains CIP indication
                                f_getIutNhopsValue(), 
                                ''O, 
                                f_getIutTxCipValue()
                            )
                        )
                    );
                    log("*** TC_FNTP_CIP_EP_BV_02: INFO: Formatted N-hops BC transmission request done ***");
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReqCip( 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        f_getIutAccessParametersValue() // FIXME ASN.1 AccessParameters description shall be enhanced
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            if (match(
                                    v_extendedNpdu, 
                                    mw_fntpExtendedNpduCip(
                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
                                        f_getIutTxCipValue()))) {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                                log("*** TC_FNTP_CIP_EP_BV_02: PASS: Received extended FNTP NPDU with CIPs as expected ***");
                            } else {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                                log("*** TC_FNTP_CIP_EP_BV_02: FAIL: Expected message not received ***");
                            }
                        }
                        [] tc_ac.timeout {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                            log("*** TC_FNTP_CIP_EP_BV_02: INCONC: Expected message not received ***");
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_CIP_EP_BV_02: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_CIP_EP_BV_02
                
                /**
                 * @desc    CIP in NPDU for UC transmission
                 * <pre>
                 * Pics Selection: PICS_CIP and PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted UC transmission request with CIPs indicated in the NF-FNTP-COMM.request service primitive
                 *      }
                 *      then {
                 *          the IUT generates an FNTP extended NPDU with CIPs included, and forwards it to the proper UC-VCI with access_parameters in the IN-SAP service primitive set equal to the CIPs
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/EP/BV/03
                 */
                testcase TC_FNTP_CIP_EP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu;
                    
                    // Test control
                    if (not((PICS_CIP and PICS_ROLE_RH))) {
                        log("*** TC_FNTP_CIP_EP_BV_03: ERROR: 'PICS_CIP and PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    log("*** TC_FNTP_CIP_EP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    
                    // Test Body
                    // Clause 'when'
                    f_fntpGenerateNfSApRequestWithoutConfirm(
                        m_generateNfFntpCommRequest( 
                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
                            f_getIutWlLinkIdUc(),                       // Identifies the VCI to be used to transmit the packet
                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
                            md_cipNfFntpOptions(                        // Contains CIP indication
                                f_getIutNhopsValue(), 
                                ''O, 
                                f_getIutTxCipValue()
                            )
                        )
                    );
                    log("*** TC_FNTP_CIP_EP_BV_03: INFO: Formatted UC transmission request done ***");
                    
                    // Clause 'then'
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReqCip( 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        f_getIutAccessParametersValue() // FIXME ASN.1 AccessParameters description shall be enhanced
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            if (match(
                                    v_extendedNpdu, 
                                    mw_fntpExtendedNpduCip(
                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
                                        f_getIutTxCipValue()))) {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                                log("*** TC_FNTP_CIP_EP_BV_03: PASS: Received extended FNTP NPDU with CIPs as expected ***");
                            } else {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                                log("*** TC_FNTP_CIP_EP_BV_03: FAIL: Expected message not received ***");
                            }
                        }
                        [] tc_ac.timeout {
                             f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                            log("*** TC_FNTP_CIP_EP_BV_03: INCONC: Expected message not received ***");
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_CIP_EP_BV_03: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_CIP_EP_BV_03
                
                /**
                 * @desc    Reception of CIP in NPDU for N-hop BC transmission
                 * <pre>
                 * Pics Selection: PICS_CIP and PICS_ROLE_RH
                 * Config Id: CF01
                 * Initial conditions: 
                 *  with {
                 *      the IUT having setup properly the FNTP forwarding table
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when { 
                 *          the IUT having received a correctly formatted FNTP extended NPDU with CIPs included and with the FNTP hop count set to 1
                 *      }
                 *      then {
                 *          the IUT extracts the FNTP basic NPDU and notifies reception to the required port,
                 *          the IUT removes CIPs from the received NPDU and forwards the remaining NPDU to the BC-VCI for next hop transmission
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 1.1.2
                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/EP/BV/04
                 */
                testcase TC_FNTP_CIP_EP_BV_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var FntpInd v_fntpInd; 
                    var FNTPNPDU v_extendedNpdu;
                    
                    // Test control
                    if (not((PICS_CIP and PICS_ROLE_RH))) {
                        log("*** TC_FNTP_CIP_EP_BV_04: ERROR: 'PICS_CIP and PICS_ROLE_RH' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up(); // Combined Host-Router 
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
                    log("*** TC_FNTP_CIP_EP_BV_04: INFO: Preamble: FNTP forwarding Table was setup properly ***");
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    // Clause 'when'
                    f_sendFntpNpduCip( 
                        f_getIutLocalPortNumberValue(), 
                        f_getIutRemotePortNumberValue(), 
                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())), 
                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
                        f_getIutNhopsValue(), 
                        f_getIutTxCipValue(),
                        f_getIutRxCipValue(),
                        f_getIutAccessParametersValue() // Access parameter - FIXME ASN.1 AccessParameters description shall be enhanced
                    ); 
                    log("*** TC_FNTP_CIP_EP_BV_04: INFO: Formatted single hop BC transmission request done ***");
                    
                    // Clause 'then'
                    // 1) Notifies reception to the required port
                    tc_ac.start;
                    alt {
                        [] utPort.receive(
                            mw_utFntpEventInd( 
                                mdw_checkNfFntpCommIndication(
                                    f_getIutRemotePortNumberValue(),                            // Destination port of DL-UNITDATA.request primitive
                                    f_getIutLocalPortNumberValue(),                             // Source port of DL-UNITDATA.request primitive
                                    m_linkId(f_getIutWlRemoteCiidUc(), f_getIutWlLocalCiid())   // Source address of DL-UNITDATA.request primitive
                        ))) {
                            tc_ac.stop;
                            log("*** TC_FNTP_CIP_EP_BV_04: INFO: Received NF-COMM.indication primitive as expected ***");
                        }
                        [] utPort.receive {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                            log("*** TC_FNTP_CIP_EP_BV_04: FAIL: Unexpected NF-COMM.indication primitive ***");
                        }
                        [] tc_ac.timeout {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
                            log("*** TC_FNTP_CIP_EP_BV_04: INCONC: Unexpected basic FNTP NPDU ***");
                        }
                    } // End of 'alt' statement
                    // 2) Forwards the remaining NPDU to the BC-VCI for next hop transmission
                    tc_ac.start;
                    alt {
                        [] fntpPort.receive(
                            mw_fntpInd( 
                                mw_fntpInSapPrimitiveReq(
                                    mdw_inUnitDataReqCip( 
                                        mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
                                        mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
                                        ? // FIXME ASN.1 AccessParameters description shall be enhanced
                        )))) -> value v_fntpInd {
                            tc_ac.stop;
                            f_oct2npdu(v_fntpInd.msgIn.servPrimitive.IN_UNITDATA_request.data, c_tbDone, v_extendedNpdu);
                            if (match(
                                    v_extendedNpdu, 
                                    mw_fntpExtendedNpduCip(
                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
                                        ?))) {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                                log("*** TC_FNTP_CIP_EP_BV_04: PASS: Received extended FNTP NPDU with CIPs as expected ***");
                            } else {
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                                log("*** TC_FNTP_CIP_EP_BV_04: FAIL: Expected message not received ***");
                            }
                        }
                        [] tc_ac.timeout {
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                            log("*** TC_FNTP_CIP_EP_BV_04: INCONC: Expected message not received ***");
                        }
                    } // End of 'alt' statement
                    log("*** TC_FNTP_CIP_EP_BV_04: INFO: test body done ***");
                    
                    // Postamble
                    f_unInitializeFntpForwardingTable();
                    f_poDefault();
                    f_cf01Down();
                    
                } // End of testcase TC_FNTP_CIP_EP_BV_04
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
            } // End of group invalidBehavior
            
        } // End of group extendedProcedure
        
        // 6.3.3 Forwarded procedure
        group forwardedProcedure {
            
            group validBehavior {
                
//                /**
//                 * @desc    TX from ITS-S host with CIPs
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having setup properly the FNTP forwarding table
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received a correctly formatted single hop BC transmission request with CIPs for delivery via a VCI contained in a different ITS-SCU
//                 *      }
//                 *      then {
//                 *          the IUT generates an FNTP forwarding NPDU containing an FNTP extended NPDU with CIPs, 
//                 *          and forwards it to the BC-VCI for transmission to the selected ITS-S router
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/01
//                 */
//                testcase TC_FNTP_CIP_FP_BV_01() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_extendedNpdu;
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_01: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_01: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendFntpNpduCip( 
//                        f_getIutLocalPortNumberValue(), 
//                        f_getIutRemotePortNumberValue(), 
//                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanDifferentLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutSecondRemoteDestCiidBc())), 
//                        f_getIutShopValue(), 
//                        f_getIutTxCipValue(),
//                        f_getIutRxCipValue(),
//                        f_getIutRxCipValue() // Access parameter
//                    ); 
//                    log("*** TC_FNTP_CIP_FP_BV_01: INFO: Formatted single hop BC transmission request done ***");
//                    
//                    // Clause 'then'
//                    tc_ac.start;
//                    alt {
//                        [] fntpPort.receive( 
//                            mw_fntpInSapPrimitiveReq( 
//                                mdw_inUnitDataReqCip( 
//                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
//                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutSecondRemoteDestCiidBc()), 
//                                    ? 
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_extendedNpdu);
//                            if (match(
//                                    v_extendedNpdu, 
//                                    mw_fntpExtendedNpduCip(
//                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
//                                        f_getIutTxCipValue()))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_01: PASS: Received extended FNTP NPDU with CIPs as expected ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_01: FAIL: Expected message not received ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_01: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_01: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_01
//                
//                /**
//                 * @desc    RX at ITS-S router from ITS-S host with CIPs
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received an FNTP station-internal forwarding NPDU containing a correctly formatted FNTP extended NPDU 
//                 *          with CIPs for single hop BC transmission
//                 *      }
//                 *      then {
//                 *          the IUT extracts the FNTP extended NPDU, 
//                 *          and forwards it to the BC-VCI for transmission via the IN-SAP with access_parameters set equal to the CIPs
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/02
//                 */
//                testcase TC_FNTP_CIP_FP_BV_02() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_extendedNpdu;
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_02: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_02: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendFntpForwardingNpduCip( 
//                        { portLong := c_portRtr },                                                          // From ITS-S router
//                        { portLong := c_portHst },                                                          // To ITS-S host
//                        f_getIutForwardingSrcPort(),                                                        // Forwarding source port
//                        f_getIutForwardingDestPort(),                                                       // Forwarding destination port
//                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidUc(), f_getIutRemoteDestCiidUc())), 
//                        0, // Packet counter
//                        f_getIutShopValue(),                                                                // S-Hop
//                        f_getIutRxCipValue(),                                                               // rx CIP parameter
//                        f_getIutTxCipValue(),                                                               // tx CIP parameter
//                        f_getIutRxCipValue()                                                                // Access parameter
//                    ); 
//                    log("*** TC_FNTP_CIP_FP_BV_02: INFO: Formatted single hop BC transmission request contained in a different ITS-SCU done ***");
//                    
//                    // Clause 'then'
//                    tc_ac.start;
//                    alt {
//                        [] fntpPort.receive( 
//                            mw_fntpInSapPrimitiveReq( 
//                                mdw_inUnitDataReqCip( 
//                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
//                                    mw_linkId(f_getIutRemoteDestCiidUc(), f_getIutRemoteDestCiidUc()), 
//                                    ? 
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_extendedNpdu);
//                            if (match(
//                                    v_extendedNpdu, 
//                                    mw_fntpExtendedNpduCip(
//                                        ''O, // For transmission, RX parameter shall be empty - See ISO/CD 21218 - Clause 8.5 
//                                        f_getIutTxCipValue()))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_02: PASS: Received extended FNTP NPDU with CIPs as expected ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_02: FAIL: Expected message not received ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_02: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_02: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_02
//                
//                /**
//                 * @desc    RX at ITS-S router from access layer with TX CIPs
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received a packet from the IN-SAP containing a properly formatted FNTP NPDU with TX CIPs, 
//                 *          and no RX CIPs are available
//                 *      }
//                 *      then {
//                 *          the IUT forwards the TX-CIP information to the implementation-specific destination in the ITS-S router, 
//                 *          and constructs an FNTP forwarding NPDU containing the received FNTP NPDU including the CIP header, 
//                 *          and transmits the FNTP forwarding NPDU via the BC-VCI connected to the ITS station-internal network
//
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/03
//                 */
//                testcase TC_FNTP_CIP_FP_BV_03() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_forwardingNpdu; // Expected forwarding NPDU
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_03: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_03: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendFntpNpduCip( 
//                        f_getIutLocalPortNumberValue(), 
//                        f_getIutRemotePortNumberValue(), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        f_getIutNhopsValue(), 
//                        f_getIutTxCipValue(),               // With TX CIPs
//                        ''O,                                // and no RX CIPs are available
//                        f_getIutRxCipValue()                // Access parameter
//                    ); 
//                    log("*** TC_FNTP_CIP_FP_BV_03: INFO: Formatted BC transmission request done ***");
//                    
//                    // Clause 'then'
//                    tc_ac.start;
//                    alt { 
//                        [] fntpPort.receive(
//                            mw_fntpInSapPrimitiveReq(
//                                mdw_inUnitDataReq( 
//                                    m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
//                                    m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()) 
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_forwardingNpdu);
//                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpduCip(
//                                    c_portRtr, 
//                                    c_portHst, 
//                                    f_getIutForwardingSrcPort(), 
//                                    f_getIutForwardingDestPort(), 
//                                    ?, 
//                                    ?, 
//                                    ''O, 
//                                    f_getIutTxCipValue()))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_03: PASS: Received FNTP forwarding NPDU as expected ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_03: FAIL: Expected message not received ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_03: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_03: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_03
//                
//                /**
//                 * @desc    RX at ITS-S router from access layer with TX CIPs and RX CIPs
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received a packet from the IN-SAP containing a properly formatted FNTP NPDU with TX CIPs, and RX CIPs are available
//                 *      }
//                 *      then {
//                 *          the IUT forwards the TX-CIP and RX-CIP information to the implementation-specific destination in the ITS-S router, 
//                 *          and constructs an FNTP forwarding NPDU containing the received FNTP NPDU including the CIP header extended by the RX CIPs, 
//                 *          and transmits the FNTP forwarding NPDU via the BC-VCI connected to the ITS station-internal network
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/04
//                 */
//                testcase TC_FNTP_CIP_FP_BV_04() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_forwardingNpdu; // Expected forwarding NPDU
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_04: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_04: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendFntpNpduCip( 
//                        f_getIutLocalPortNumberValue(), 
//                        f_getIutRemotePortNumberValue(), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        f_getIutShopValue(), 
//                        f_getIutTxCipValue(), 
//                        f_getIutRxCipValue(), 
//                        f_getIutRxCipValue() 
//                    ); 
//                    log("*** TC_FNTP_CIP_FP_BV_04: INFO: Formatted BC transmission request done ***");
//                    
//                    // Clause 'then'
//                    // TODO How to do this: Forwards the TX-CIP and RX-CIP information to the implementation-specific destination in the ITS-S host'
//                    // 1) Forwards NPDU containing the received FNTP NPDU including the CIP header extended by the RX CIPs 
//                    tc_ac.start;
//                    alt {
//                        [] utPort.receive(
//                            mdw_checkNfFntpCommIndicationCip(
//                                f_getIutRemotePortNumberValue(),                                        // Destination port of DL-UNITDATA.request primitive
//                                f_getIutLocalPortNumberValue(),                                         // Source port of DL-UNITDATA.request primitive
//                                m_linkId(f_getIutRemoteDestCiidBc(), f_getIutSecondRemoteDestCiidBc()), // Source address of DL-UNITDATA.request primitive
//                                mdw_nHopNfFntpOptions_cip( 
//                                    f_getIutNhopsValue(),
//                                    f_getIutTxCipValue(), 
//                                    f_getIutRxCipValue() 
//                                )
//                        )) {
//                            tc_ac.stop;
//                            log("*** TC_FNTP_CIP_FP_BV_04: INFO: Received NF-COMM.indication primitive as expected ***");
//                        }
//                        [] utPort.receive {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                            log("*** TC_FNTP_CIP_FP_BV_04: FAIL: Unexpected basic FNTP NPDU ***");
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
//                            log("*** TC_FNTP_CIP_FP_BV_04: INCONC: Unexpected basic FNTP NPDU ***");
//                        }
//                    } // End of 'alt' statement
//                    // 2) Transmits the FNTP forwarding NPDU via the BC-VCI connected to the ITS station-internal network
//                    tc_ac.start;
//                    alt { 
//                        [] fntpPort.receive(
//                            mw_fntpInSapPrimitiveReq(
//                                mdw_inUnitDataReq( 
//                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
//                                    mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()) 
//                        ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_forwardingNpdu);
//                            if (match(v_forwardingNpdu, mdw_fntpForwardingNpduCip(
//                                    c_portRtr, 
//                                    c_portHst, 
//                                    f_getIutForwardingSrcPort(), 
//                                    f_getIutForwardingDestPort(), 
//                                    ?, 
//                                    ?, 
//                                    f_getIutRxCipValue(), 
//                                    f_getIutTxCipValue()))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_04: PASS: Received FNTP forwarding NPDU as expected ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_04: FAIL: Expected message not received ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_04: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_04: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_04
//                
//                /**
//                 * @desc    RX at ITS-S host from ITS-S router with CIPs
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received an FNTP forwarding NPDU containing a correctly formatted FNTP extended NPDU and CIP
//                 *      }
//                 *      then {
//                 *          the IUT forwards the TX-CIP and RX-CIP information to the implementation-specific destination in the ITS-S host, 
//                 *          the IUT delivers the ITS-FPDU to the ITS-SP selected by the Service Port
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/05
//                 */
//                testcase TC_FNTP_CIP_FP_BV_05() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_05: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_05: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendFntpForwardingNpduCip( 
//                        { portLong := c_portRtr },      // From ITS-S router
//                        { portLong := c_portHst },      // To ITS-S host
//                        f_getIutForwardingSrcPort(),    // Forwarding source port
//                        f_getIutForwardingDestPort(),   // Forwarding destination port
//                        m_llServiceAddr(m_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        0,                              // Packet counter
//                        f_getIutShopValue(),            // S-Hop
//                        f_getIutRxCipValue(),           // rx CIP parameter
//                        f_getIutTxCipValue(),           // tx CIP parameter
//                        f_getIutRxCipValue()            // Access parameter
//                    ); 
//                    log("*** TC_FNTP_CIP_FP_BV_05: INFO: Request to send an FNTP extended NPDU containing CIP done ***");
//                    // Clause 'then'
//                    // TODO How to do this: Forwards the TX-CIP and RX-CIP information to the implementation-specific destination in the ITS-S host'
//                    tc_ac.start;
//                    alt {
//                        [] utPort.receive(
//                                mdw_checkNfFntpCommIndicationCip(
//                                    f_getIutRemotePortNumberValue(), // Destination port of DL-UNITDATA.request primitive
//                                    f_getIutLocalPortNumberValue(), // Source port of DL-UNITDATA.request primitive
//                                    m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), // Source address of DL-UNITDATA.request primitive
//                                    mdw_nHopNfFntpOptions_cip( 
//                                        f_getIutNhopsValue(),
//                                        f_getIutTxCipValue(), 
//                                        f_getIutRxCipValue() 
//                                    )
//                        )) {
//                            tc_ac.stop;
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                            log("*** TC_FNTP_CIP_FP_BV_05: INFO: Received NF-COMM.indication primitive as expected ***");
//                        }
//                        [] utPort.receive {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                            log("*** TC_FNTP_CIP_FP_BV_05: FAIL: Unexpected basic FNTP NPDU ***");
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
//                            log("*** TC_FNTP_CIP_FP_BV_05: INCONC: Unexpected basic FNTP NPDU ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_05: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_05
//                
//                /**
//                 * @desc    TX at ITS-S router to remote ITS-S with no transmission of CIP in the frame
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table, 
//                 *      and the IUT is set to not transmit CIPs in a frame to a remote ITS-S
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received the request to send an FNTP extended NPDU containing TX-CIPs
//                 *      }
//                 *      then {
//                 *          the IUT removes the TX-CIP information from the extended NPDU 
//                 *          and constructs the proper FNTP NPDU without TX-CIP, 
//                 *          and forwards it to the BC-VCI for transmission via the IN-SAP with access_parameters set equal to the TX-CIPs
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/06
//                 */
//                testcase TC_FNTP_CIP_FP_BV_06() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_extendedNpdu;
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH))) {
//                        log("*** TC_FNTP_CIP_FP_BV_06: ERROR: 'PICS_CIP and PICS_ITS_S_INW and (PICS_ROLE_HONLY or PICS_ROLE_RH)' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_06: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_utEventResponse(
//                        m_generateNfFntpCommRequest( 
//                            f_getNextCommandRef(),                      // Unique cyclic reference number of command
//                            vc_portNumber,                              // Port number allocated by FN-FNTP-PORT.create operation
//                            f_getIutWlLinkIdBc(),                       // Identifies the VCI to be used to transmit the packet
//                            f_getIutItsFpdu(),                          // Contains the ITS-SP payload EPDU
//                            md_cipNfFntpOptions(                        // Contains CIP indication
//                                f_getIutShopValue(), 
//                                ''O, 
//                                f_getIutTxCipValue())),
//                        mw_fntpCommConfirm_success,
//                        false,
//                        vc_utCommandConf);
//                    log("*** TC_FNTP_CIP_FP_BV_06: INFO: Request to send an FNTP extended NPDU containing CIP done ***");
//                    // Clause 'then'
//                    tc_ac.start;
//                    alt { 
//                        [] fntpPort.receive(
//                            mw_fntpInSapPrimitiveReq(
//                                mdw_inUnitDataReqCip( 
//                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
//                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
//                                    f_getIutTxCipValue()
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_extendedNpdu);
//                            if (match(v_extendedNpdu, mdw_fntpExtendedNpdu(?, ?))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_06: INFO: IUT transmits the received packet in BC mode ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_06: FAIL: Unexpected extended N-hops FNTP NPDU ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_06: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_06: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_06
//                
//                /**
//                 * @desc    RX of an FNTP extended NPDU with CIP at ITS-S router which is due to a retransmission (N-hop)
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table, 
//                 *      the IUT is enabled to transmit CIPs in a frame to remote ITS-S
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received a correctly formatted broadcast packet from the peer station via the IN-SAP with FNTP hop count set to a value larger than 0
//                 *      }
//                 *      then {
//                 *          the IUT forwards the CIP information to the implementation-specific destination in the ITS-S router, 
//                 *          the IUT retransmits the received packet in broadcast mode with FNTP hop count decremented by one, 
//                 *              and with no CIP contained in the NPDU, 
//                 *              and with access_parameters not set equal to the received CIP,
//                 *          the IUT processes the "FNTP extended NPDU" and notifies reception to the proper ITS-SP
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/07
//                 */
//                testcase TC_FNTP_CIP_FP_BV_07() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_extendedNpdu;
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH)) {
//                        log("*** TC_FNTP_CIP_FP_BV_07: ERROR: 'PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_07: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendExtendedFntpNpdu( 
//                        f_getIutLocalPortNumberValue(), 
//                        f_getIutRemotePortNumberValue(), 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        f_getIutNhopsValue() 
//                    );
//                    log("*** TC_FNTP_CIP_FP_BV_07: INFO: Request to send an FNTP extended NPDU containing CIP done ***");
//                    // Clause 'then'
//                    // TODO How to do this: Forwards the TX-CIP and RX-CIP information to the implementation-specific destination in the ITS-S host'
//                    // 1) The IUT processes the "FNTP extended NPDU" and notifies reception to the proper ITS-SP
//                    tc_ac.start;
//                    alt {
//                        [] utPort.receive(
//                                mdw_checkNfFntpCommIndicationCip(
//                                    f_getIutRemotePortNumberValue(),                                // Destination port of DL-UNITDATA.request primitive
//                                    f_getIutLocalPortNumberValue(),                                 // Source port of DL-UNITDATA.request primitive
//                                    m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()),  // Source address of DL-UNITDATA.request primitive
//                                    mdw_nHopNfFntpOptions_cip( 
//                                        f_getIutNhopsValue(),
//                                        f_getIutTxCipValue(), 
//                                        f_getIutRxCipValue() 
//                                    )
//                        )) {
//                            tc_ac.stop;
//                            log("*** TC_FNTP_CIP_FP_BV_07: INFO: Received NF-COMM.indication primitive as expected ***");
//                        }
//                        [] utPort.receive {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                            log("*** TC_FNTP_CIP_FP_BV_07: FAIL: Unexpected basic FNTP NPDU ***");
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
//                            log("*** TC_FNTP_CIP_FP_BV_07: INCONC: Unexpected basic FNTP NPDU ***");
//                        }
//                    } // End of 'alt' statement
//                    // 2) the IUT retransmits the received packet in broadcast mode with...
//                    tc_ac.start;
//                    alt { 
//                        [] fntpPort.receive(
//                            mw_fntpInSapPrimitiveReq(
//                                mdw_inUnitDataReqCip( 
//                                    mw_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid()), 
//                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
//                                    f_getIutRxCipValue() // And with access_parameters not set equal to the received CIP
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_extendedNpdu);
//                            if (match(
//                                    v_extendedNpdu, 
//                                    mdw_fntpExtendedNpdu(
//                                        ?, 
//                                        ?
//                                    ))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_07: INFO: IUT transmits the received packet in BC mode ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_07: FAIL: Unexpected extended N-hops FNTP NPDU ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_07: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_07: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_07
//                
//                /**
//                 * @desc    RX of an FNTP extended NPDU with CIP at ITS-S router which is due to a retransmission (N-hop)
//                 * <pre>
//                 * Pics Selection: PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH
//                 * Config Id: CF02
//                 * Initial conditions: 
//                 *  with {
//                 *      the IUT having set up properly the FNTP forwarding table, 
//                 *      the IUT is enabled to transmit CIPs in a frame to remote ITS-S
//                 *  }
//                 * Expected behaviour:
//                 *  ensure that {
//                 *      when { 
//                 *          the IUT having received a correctly formatted broadcast packet from the peer station via the IN-SAP with FNTP hop count set to a value larger than 0
//                 *      }
//                 *      then {
//                 *          the IUT forwards the CIP information to the implementation-specific destination in the ITS-S router, 
//                 *          the IUT retransmits the received packet in broadcast mode with FNTP hop count decremented by one, 
//                 *              and with no CIP contained in the NPDU, 
//                 *              and with access_parameters not set equal to the received CIP, 
//                 *          the IUT forwards the "FNTP extended NPDU" to the proper ITS host
//                 *      }
//                 *  }
//                 * </pre>
//                 * 
//                 * @version 1.1.2
//                 * @see     ETSI TS 102 985-2 v1.1.2 FNTP/CIP/FP/BV/08
//                 */
//                testcase TC_FNTP_CIP_FP_BV_08() runs on ItsCalm system ItsCalmSystem {
//                    // Local variables
//                    var INsapPrimitivesDown v_inSapPrimitivesDown; 
//                    var FNTPNPDU v_extendedNpdu;
//                    
//                    // Test control
//                    if (not(PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH)) {
//                        log("*** TC_FNTP_CIP_FP_BV_08: ERROR: 'PICS_CIP and PICS_ITS_S_INW and PICS_ROLE_RH' required for executing the TC ***");
//                        stop;
//                    }
//                    
//                    // Test component configuration
//                    f_cf02Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    // Clause 'Initial conditions'
//                    f_initializeFntpForwardingTable(f_getIutAppPortValue());
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    log("*** TC_FNTP_CIP_FP_BV_08: INFO: Preamble: FNTP forwarding Table was setup properly ***");
//                    
//                    // Test Body
//                    // Clause 'when'
//                    f_sendExtendedFntpNpdu( 
//                        f_getIutLocalPortNumberValue(), 
//                        f_getIutRemotePortNumberValue(), 
//                        m_llServiceAddr(m_linkId(f_getIutWlRemoteCiidBc(), f_getIutWlLocalCiid())), 
//                        m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid())), 
//                        f_getIutNhopsValue() 
//                    );
//                    log("*** TC_FNTP_CIP_FP_BV_08: INFO: Request to send an FNTP extended NPDU containing CIP done ***");
//                    // Clause 'then'
//                    // 1) The IUT forwards the "FNTP extended NPDU" to the proper ITS host
//                    tc_ac.start;
//                    alt {
//                        [] utPort.receive(
//                            mdw_checkNfFntpCommIndicationCip(
//                                f_getIutRemotePortNumberValue(),                                // Destination port of DL-UNITDATA.request primitive
//                                f_getIutLocalPortNumberValue(),                                 // Source port of DL-UNITDATA.request primitive
//                                m_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()),  // Source address of DL-UNITDATA.request primitive
//                                mdw_nHopNfFntpOptions_cip( 
//                                    f_getIutNhopsValue(),
//                                    f_getIutTxCipValue(), 
//                                    f_getIutRxCipValue() 
//                                )
//                        )) {
//                            tc_ac.stop;
//                            log("*** TC_FNTP_CIP_FP_BV_08: INFO: Received NF-COMM.indication primitive as expected ***");
//                        }
//                        [] utPort.receive {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                            log("*** TC_FNTP_CIP_FP_BV_08: FAIL: Unexpected basic FNTP NPDU ***");
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); 
//                            log("*** TC_FNTP_CIP_FP_BV_08: INCONC: Unexpected basic FNTP NPDU ***");
//                        }
//                    } // End of 'alt' statement
//                    // 2) the IUT retransmits the received packet in broadcast mode with...
//                    tc_ac.start;
//                    alt { 
//                        [] fntpPort.receive(
//                            mw_fntpInSapPrimitiveReq(
//                                mdw_inUnitDataReqCip( 
//                                    mw_linkId(f_getIutRemoteDestCiidBc(), f_getIutDestLocalCiid()), 
//                                    mw_linkId(f_getIutLanRemoteCiidBc(), f_getIutLanLocalCiid()), 
//                                    f_getIutRxCipValue() // and with access_parameters not set equal to the received CIP
//                            ))) -> value v_inSapPrimitivesDown {
//                            tc_ac.stop;
//                            f_oct2npdu(v_inSapPrimitivesDown.primitives.inUnitdataRq.data, c_tbDone, v_extendedNpdu);
//                            if (match(
//                                    v_extendedNpdu, 
//                                    mdw_fntpExtendedNpdu(
//                                        ?, 
//                                        ? 
//                                    ))) {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
//                                log("*** TC_FNTP_CIP_FP_BV_08: INFO: IUT transmits the received packet in BC mode ***");
//                            } else {
//                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
//                                log("*** TC_FNTP_CIP_FP_BV_08: FAIL: Unexpected extended N-hops FNTP NPDU ***");
//                            }
//                        }
//                        [] tc_ac.timeout {
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
//                            log("*** TC_FNTP_CIP_FP_BV_08: INCONC: Expected message not received ***");
//                        }
//                    } // End of 'alt' statement
//                    log("*** TC_FNTP_CIP_FP_BV_08: INFO: test body done ***");
//                    
//                    // Postamble
//                    f_poDefault();
//                    f_cf02Down();
//                    
//                } // End of testcase TC_FNTP_CIP_FP_BV_08
                
            } // End of group validBehavior
            
            group invalidBehavior {
                
            } // End of group invalidBehavior
            
        } // End of group forwardedProcedure
        
    } // End of group cipManagement
    
    // x.x.x Extended procedure
    group secureCommunications {
        
        group validBehavior {
            
        } // End of group validBehavior
        
        group invalidBehavior {
            
        } // End of group invalidBehavior
        
    } // End of group secureCommunications
    
} // End of module ItsFntp_TestCases