ItsGeoNetworking_TpFunctions.ttcn 718 KB
Newer Older
                                    f_longPosVector2ShortPosVector(p_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    log("*** " & testcasename() & ": INFO: Message sent ***");
                    f_selfOrClientSyncAndVerdict(c_msgSent, e_success);
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                      
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_07_nodeC
                
            } // end GEONW_PON_GUC_BV_07
            
            group GEONW_PON_GUC_BV_08 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_08
                 */
                function f_GEONW_PON_GUC_BV_08() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var float v_distance := int2float(f_getCbfMaxCommunicationRange() - 10);
                    var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoUnicastForwardingAlgorithm() != e_cbf) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    // re-compute NodeA's position.
                    v_longPosVectorIut := f_getIutLongPosVector();
                    v_longPosVectorNodeA := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 0);
                    v_longPosVectorNodeA.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_08_nodeB(v_longPosVectorNodeA));
                    v_nodeC.start(f_GEONW_PON_GUC_BV_08_nodeC(v_longPosVectorNodeA));
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_08
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_08)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_08_nodeB(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sleepIgnoreDef(int2float(f_getGeoUnicastCbfMaxTime())/2000.0);
                    
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(p_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit - 1
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_08_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_08)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_08_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    //Note: Sending of the GUC packet move to test body in contrast to the test purpose due to time critical behaviour
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(p_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_08_nodeC
                
            } // end GEONW_PON_GUC_BV_08
            
            group GEONW_PON_GUC_BV_10 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_10
                 */
                function f_GEONW_PON_GUC_BV_10() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var float v_distance := int2float(f_getCbfMaxCommunicationRange() - 10);
                    var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoUnicastForwardingAlgorithm() != e_cbf) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    // re-compute NodeA's position.
                    v_longPosVectorIut := f_getIutLongPosVector();
                    v_longPosVectorNodeA := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 0);
                    v_longPosVectorNodeA.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_10_nodeB(v_longPosVectorNodeA));
                    v_nodeC.start(f_GEONW_PON_GUC_BV_10_nodeC(v_longPosVectorNodeA));
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_10
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_10)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_10_nodeB(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sleepIgnoreDef(int2float(f_getGeoUnicastCbfMaxTime())/2000.0);
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Re-broadcasted GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_10_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_10)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_10_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prDefault();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(p_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    f_sleepIgnoreDef(int2float(f_getGeoUnicastCbfMaxTime())/2000.0);
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Re-broadcasted GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_10_nodeC
                
            } // end GEONW_PON_GUC_BV_10

            group GEONW_PON_GUC_BV_11 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_11
                 */
                function f_GEONW_PON_GUC_BV_11() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    if (not PICS_GN_GUC_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoUnicastForwardingAlgorithm() != e_cbf) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_11_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BV_11_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_11
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_11)
                 */
                function f_GEONW_PON_GUC_BV_11_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    if(not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr))) {
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_11_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_11)
                 */
                function f_GEONW_PON_GUC_BV_11_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: broadcasted GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_11_nodeC
                                
            } // end GEONW_PON_GUC_BV_11

            group GEONW_PON_GUC_BO_12 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BO_12
                 */
                function f_GEONW_PON_GUC_BO_12() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if ((f_getGeoUnicastForwardingAlgorithm() != e_greedy) and (f_getGeoUnicastForwardingAlgorithm() != e_unspecified)) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == (e_greedy  or e_unspecified) required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BO_12_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BO_12_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BO_12
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BO_12)
                 */
                function f_GEONW_PON_GUC_BO_12_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": INFO: First GUC forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: First GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                        }
                    }
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(v_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit - 1
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Duplicate GUC was forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: Duplicate GUC not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);                            
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BO_12_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BO_12)
                 */
                function f_GEONW_PON_GUC_BO_12_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(v_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Duplicate GUC was forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: Duplicate GUC not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);                            
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BO_12_nodeC
                
            } // end GEONW_PON_GUC_BO_12

            group GEONW_PON_GUC_BO_13 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BO_13
                 */
                function f_GEONW_PON_GUC_BO_13() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    if (not PICS_GN_GUC_DST) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_DST required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if ((f_getGeoUnicastForwardingAlgorithm() != e_greedy) and (f_getGeoUnicastForwardingAlgorithm() != e_unspecified)) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == (e_greedy  or e_unspecified) required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up(c_compNodeB);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BO_13_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BO_13_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_13
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BO_13)
                 */
                function f_GEONW_PON_GUC_BO_13_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    var integer i;
                    var template (present) GeoNetworkingPdu v_gnPacket := m_geoNwPdu(
                        m_geoNwUnicastPacket(
                            f_getPosition(c_compNodeC),
                            f_longPosVector2ShortPosVector(v_longPosVectorIut),
                            vc_localSeqNumber
                        ),
                        -,
                        c_defaultHopLimit - 1
                    );
                    var GnRawPayload v_sentRawPayload;
                    
                    // Preamble
                    f_prNeighbour();
                    f_sleep(PX_TAC);
	                v_sentRawPayload := f_adaptPayloadForUtInd_m(valueof(v_gnPacket.gnPacket.packet.payload));
	                for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                        // empty on purpose 
                    }
                    if(i < lengthof(vc_utInds)) {
                        log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
                        //flush received upper indications 
                        vc_utInds := {};
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    }
                    else {
                        log("*** " & testcasename() & ": INCONC: GN was not transmitted to upper layer ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_error);
                    }
                    
                    // Test Body
                    f_sendGeoNetMessage(m_geoNwReq_withLinkLayerDestination(valueof(v_gnPacket), -, f_getIutMacAddress()));
                    
                    if(0 != lengthof(vc_utInds)) {
                        log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BO_13_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BO_13)
                 */
                function f_GEONW_PON_GUC_BO_13_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BO_13_nodeC
                
            } // end GEONW_PON_GUC_BO_13
                        
        } // end geoGeoUnicast
        
        // 6.2.2.9
        group geoGeoBroadcast {
            
            group GEONW_PON_GBC_BV_01 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GBC_BV_01
                 */
                function f_GEONW_PON_GBC_BV_01() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GBC_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_GBC_BV_01_nodeB());
                    v_nodeD.start(f_GEONW_PON_GBC_BV_01_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_GBC_BV_01
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                 */
                function f_GEONW_PON_GBC_BV_01_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
	                if ( not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) {
	                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
	                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
	                }
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveGeoBroadcastWithArea(
garciay's avatar
garciay committed
                                mw_longPosVectorPosition(v_longPosVectorIut),
                                ?,
                                f_getGeoBroadcastArea(c_area1)) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GBC message received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GBC_BV_01_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_GBC_BV_01)
                 */
                function f_GEONW_PON_GBC_BV_01_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] a_receiveGeoBroadcastWithArea(
garciay's avatar
garciay committed
                                mw_longPosVectorPosition(v_longPosVectorIut),
                                ?,
                                f_getGeoBroadcastArea(c_area1)) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GBC message received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GBC_BV_01_nodeD
                
            } // end GEONW_PON_GBC_BV_01
            
            group GEONW_PON_GBC_BV_02 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GBC_BV_02
                 */
                function f_GEONW_PON_GBC_BV_02() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GBC_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if ((f_getGeoBroadcastForwardingAlgorithm() != e_simple) and (f_getGeoBroadcastForwardingAlgorithm() != e_unspecified) and (f_getGeoBroadcastForwardingAlgorithm() != e_advanced)) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == ( e_simple or e_unspecified ) required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                                        
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_GBC_BV_02_nodeB());
                    v_nodeD.start(f_GEONW_PON_GBC_BV_02_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_GBC_BV_02
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_02)
                 */
                function f_GEONW_PON_GBC_BV_02_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    if ( not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area2))) ) {
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveGeoBroadcastWithArea(
garciay's avatar
garciay committed
                                mw_longPosVectorPosition(v_longPosVectorIut),
                                ?,
                                f_getGeoBroadcastArea(c_area2)) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GBC message received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GBC_BV_02_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_GBC_BV_02)
                 */
                function f_GEONW_PON_GBC_BV_02_nodeD() runs on ItsGeoNetworking {