diff --git a/ItsGeoNetworking_TestCases.ttcn b/ItsGeoNetworking_TestCases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..af43f884a666f464d60292b0eee36a49c8e0606c --- /dev/null +++ b/ItsGeoNetworking_TestCases.ttcn @@ -0,0 +1,6267 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 + * @version $Url: https://oldforge.etsi.org/svn/ITS/tags/20170222_STF527_Final/ttcn/AtsGeoNetworking/ItsGeoNetworking_TestCases.ttcn $ + * $Id: ItsGeoNetworking_TestCases.ttcn 2700 2017-05-29 13:17:49Z berge $ + * @desc GeoNetworking Testcases + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module ItsGeoNetworking_TestCases { + + // LibIts + import from LibItsGeoNetworking_TestSystem all; + + // Its + import from ItsGeoNetworking_TpFunctions all; + + // 6.2.1 + group geoFormatingAndDataValidity { + + // 6.2.1.1 + group geoFdvBasicHeader { + + /** + * @desc Check defined values of default Gn parameters in the basic header + *
+             * Pics Selection: PICS_GN_BASIC_HEADER
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GBC packet
+             *      }
+             *      then {
+             *          the IUT sends a GBC packet
+             *              containing a correctly formatted Basic Header
+             *                  containing version field
+             *                      set to itsGnProtocolVersion MIB parameter
+             *                  containing RHL field
+             *                      set to itsGnDefaultHopLimit MIB parameter
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BAH/BV-01 + * @reference EN 302 636-4-1 [1], clauses 9.3.2 , 8.6.2 and Annex G + */ + testcase TC_GEONW_FDV_BAH_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BAH_BV_01(); + + } // End of testcase TC_GEONW_FDV_BAH_BV_01 + + /** + * @desc Check discard of packet having incorrect version + *
+             * Pics Selection: PICS_GN_BASIC_HEADER
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *      the IUT having received a SHB packet from ItsNodeB
+             *          containing a correctly formatted Basic Header
+             *              containing version field
+             *                  set to value equal to itsGnProtocolVersion MIB parameter
+             *        and the IUT having passed the received SHB packet to Upper Layer
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a SHB packet from ItsNodeB
+             *              containing a correctly formatted Basic Header
+             *                  containing version field
+             *                      set to value not equal to itsGnProtocolVersion MIB parameter
+             *      }
+             *      then {
+             *          the IUT discards the received SHB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BAH/BI-02 + * @reference EN 302 636-4-1 [1], clauses 9.3.3 + */ + testcase TC_GEONW_FDV_BAH_BI_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BAH_BI_02(); + + } // End of testcase TC_GEONW_FDV_BAH_BI_02 + + } // End of group geoFdvBasicHeader + + // 6.2.1.2 + group geoFdvCommonHeader { + + /** + * @desc Common GeoNetworking header validity test (PL field) + *
+             * Pics Selection: PICS_GN_COMMON_HEADER
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon message
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking message
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '1' (BEACON)
+             *                  containing HST field
+             *                      set to '0' (UNSPECIFIED)
+             *                  containing PL field
+             *                      set to '0'
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/COH/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.6 and 9.3.6 + */ + testcase TC_GEONW_FDV_COH_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_COH_BV_01(); + + } // End of testcase TC_GEONW_FDV_COH_BV_01 + + /** + * @desc Common GeoNetworking header validity test (PL field) + *
+             * Pics Selection: PICS_GN_COMMON_HEADER
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a SHB packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '5' (TSB)
+             *                  containing HST field
+             *                      set to '0' (SINGLE_HOP)
+             *                  containing MHL field
+             *                      set to '1'
+             *                  containing PL field
+             *                      set to the length of the included payload
+             *              containing a payload
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/COH/BV-02 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.4, 9.3.4 and 9.3.10 + */ + testcase TC_GEONW_FDV_COH_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_COH_BV_02(); + + } // End of testcase TC_GEONW_FDV_COH_BV_02 + + /** + * @desc Check defined values of default Gn parameters in the common header + *
+             * Pics Selection: PICS_GN_COMMON_HEADER
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *       the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GBC packet
+             *      }
+             *      then {
+             *          the IUT sends a GBC packet
+             *              containing a correctly formatted Common Header
+             *                  containing Flags field
+             *                      indicating value equalling the itsGnIsMobile MIB parameter
+             *                  containing MHL field
+             *                      set to itsGnDefaultHopLimit MIB parameter
+             *     }
+             *  }
+             * 
+ * + * @version 0.0.11 + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/COH/BV-03 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.8.2, 9.3.4 and Annex G + */ + testcase TC_GEONW_FDV_COH_BV_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_COH_BV_03(); + + } // End of testcase TC_GEONW_FDV_COH_BV_03 + + /** + * @desc Check that a received TSB packet is discarded if received with RHL > MHL + *
+             * Pics Selection: PICS_GN_COMMON_HEADER
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *       the IUT being in the "initial state" and
+             *       the IUT having received Beacon information from ItsNodeD and
+             *       the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a TSB packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating HL1 higher than MHL1
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating MHL1
+             *      }
+             *      then {
+             *          the IUT discards the TSB packet
+             *     }
+             *  }
+             * 
+ * + * @version 0.0.11 + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/COH/BO-04 + * @reference EN 302 636-4-1 [1], clauses 9.3.5 + */ + testcase TC_GEONW_FDV_COH_BO_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_FDV_COH_BO_04(); + + } // End of testcase TC_GEONW_FDV_COH_BV_04 + + } // End of group geoFdvCommonHeader + + // 6.2.1.3 + group geoFdvBeacon { + + /** + * @desc Beacon header validity test + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '1' (BEACON)
+             *                  containing HST field
+             *                      set to '0' (UNSPECIFIED)
+             *                  containing NH field
+             *                      set to '0' (UNSPECIFIED)
+             *              containing Extended Header
+             *                  containing SOPV
+             *                      indicating LPV of the IUT
+             *      }
+             *    }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BEA/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.8.6 and 9.3.6 + */ + testcase TC_GEONW_FDV_BEA_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BEA_BV_01(); + + } // End of testcase TC_GEONW_FDV_BEA_BV_01 + + /** + * @desc GeoNetworking address validity test + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *    the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing SOPV field
+             *                  containing GN_ADDR field
+             *                      containing ST field
+             *                          indicating the ITS Station type
+             *                      containing SCC field
+             *                          indicating the ITS Station country code
+             *      }
+             *  }
+             *  NOTE: Correct Source GeoNetworking address value: itsGnLocalGnAddr MIB parameter value.
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BEA/BV-02 + * @reference EN 302 636-4-1 [1], clauses 6.3 and 8.8.6.2 + */ + testcase TC_GEONW_FDV_BEA_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BEA_BV_02(); + + } // End of testcase TC_GEONW_FDV_BEA_BV_02 + + /** + * @desc Local Position Vector validity test, involving comparison against sensor input data + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correct SOPV field
+             *                  indicating the latest position of the IUT
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BEA/BV-03 + * @reference EN 302 636-4-1 [1], clauses 8.5.2.2 and 8.8.6.2 + */ + testcase TC_GEONW_FDV_BEA_BV_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BEA_BV_03(); + + } // End of testcase TC_GEONW_FDV_BEA_BV_03 + + /** + * @desc Local Position Vector validity test, involving timestamp comparison against sensor input data + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correct SOPV field
+             *                  indicating the timestamp value corresponding to the sensor acquisition time of position data
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/BEA/BV-04 + * @reference EN 302 636-4-1 [1], clauses 8.5.2.2 and 8.8.6.2 + */ + testcase TC_GEONW_FDV_BEA_BV_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_BEA_BV_04(); + + } // End of testcase TC_GEONW_FDV_BEA_BV_04 + + } // End of group geoFdvBeacon + + // 6.2.1.4 + group geoFdvGeoUnicast { + + /** + * @desc GUC header validity + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *                  containing HST field
+             *                      set to '0' (UNSPECIFIED)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating position of the ItsNodeB
+             *                  containing SOPV field
+             *                      indicating position of the IUT
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/GUC/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.8.2.2 and 9.3.8 + */ + testcase TC_GEONW_FDV_GUC_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_GUC_BV_01(); + + } // End of testcase TC_GEONW_FDV_GUC_BV_01 + + } // End of group geoFdvGeoUnicast + + // 6.2.1.5 + group geoFdvGeoBroadcast { + + /** + * @desc GBC header validity + *
+             * Pics Selection: PICS_GN_GBC_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from the ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GBC packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '4' (GEOBROADCAST)
+             *              containing GBC Extended Header
+             *                  containing SOPV field
+             *                      indicating position of the IUT
+             *       }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/GBC/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.5.2 and 9.3.11 + */ + testcase TC_GEONW_FDV_GBC_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_GBC_BV_01(); + + } // End of testcase TC_GEONW_FDV_GBC_BV_01 + + } // End of group geoFdvGeoBroadcast + + // 6.2.1.6 + group geoFdvGeoAnycast { + + /** + * @desc GAC header validity + *
+             * Pics Selection: PICS_GN_GAC_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from the ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GAC packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '3' (GEOANYCAST)
+             *              containing GAC Extended Header
+             *                  containing SOPV field
+             *                      indicating position of IUT
+             *       }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/GAC/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.5.2 and 9.3.12 + */ + testcase TC_GEONW_FDV_GAC_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_GAC_BV_01(); + + } // End of testcase TC_GEONW_FDV_GAC_BV_01 + + } // End of group geoFdvGeoAnycast + + // 6.2.1.7 + group geoFdvSingleHopBroadcast { + + /** + * @desc SHB header validity + *
+             * Pics Selection: PICS_GN_SHB_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from the ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a SHB packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '5' (TSB)
+             *                  containing HST field
+             *                      set to '0' (SINGLE_HOP)
+             *                  containing MHL field
+             *                      set to '1'
+             *              containing Extended Header
+             *                  containing SOPV
+             *                      indicating LPV of the IUT
+             *       }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/SHB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 9.3.4, 8.8.4.2 and 9.3.10 + */ + testcase TC_GEONW_FDV_SHB_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_SHB_BV_01(); + + } // End of testcase TC_GEONW_FDV_SHB_BV_01 + + } // End of group geoFdvSingleHopBroadcast + + // 6.2.1.8 + group geoFdvTopologicallyScopedBroadcast { + + /** + * @desc TSB header validity + *
+             * Pics Selection: PICS_GN_TSB_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from the ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a TSB packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '5' (TSB)
+             *                  containing HST field
+             *                      set to '1' (MULTI_HOP)
+             *              containing TSB Extended Header
+             *                  containing SOPV field
+             *                      indicating position of the IUT
+             *       }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/FDV/TSB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.3.2 and 9.3.9 + */ + testcase TC_GEONW_FDV_TSB_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_FDV_TSB_BV_01(); + + } // End of testcase TC_GEONW_FDV_TSB_BV_01 + + } // End of group geoFdvTopologicallyScopedBroadcast + + } // End of group geoFormatingAndDataValidity + + // 6.2.2 + group geoProtocolOperation { + + // 6.2.2.1 + group geoLocationTable { + + /** + * @desc Check insertion of new entries into location table from Beacon header + *
+             * Pics Selection: PICS_GN_GUC_SRC AND PICS_GN_BEACON_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from the ItsNodeB and
+             *      the lifetime of the ItsNodeB Location Table entry not being expired
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received from ItsNodeB
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-01 + * @reference EN 302 636-4-1 [1], clauses 9.3.10.3, 9.3.6.2 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_01(); + + } // End of testcase TC_GEONW_PON_LOT_BV_01 + + /** + * @desc Check insertion of new entries into location table from LS Reply data + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC AND PICS_GN_LS_REP_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having been requested to send a first GUC packet to ItsNodeA and
+             *      the IUT having sent a LS_REQUEST packet
+             *          containing Request field
+             *              containing GN_ADDR
+             *                  containing M_ID
+             *                      indicating ItsNodeA
+             *      the IUT having received a LS_REPLY packet from ItsNodeA
+             *          containing SOPV field and
+             *      the IUT having sent the GUC packet to ItsNodeA and
+             *      the lifetime of the ItsNodeA Location Table entry not being expired
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a second GUC packet to ItsNodeA
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating ItsNodeA
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the LS_REPLY packet received from ItsNodeA
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-02 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.1.4, 9.3.7.1.2 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_02(); + + } // End of testcase TC_GEONW_PON_LOT_BV_02 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_BEACON_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: Beacon packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_01(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_01 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_GUC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: GUC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_02(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_02 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_GAC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: GAC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_03(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_03 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_GBC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: GBC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_04(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_04 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_TSB_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: TSB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_05(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_05 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_SHB_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: SHB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_06(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_06 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_LS_REQ_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: LS Request packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_07() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_07(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_07 + + /** + * @desc Check insertion of new entries into location table from extended header processing (e.g. GUC header) + *
+             * Pics Selection: PICS_GN_LS_REP_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any beacon from NODE
+             *      the IUT having received a MESSAGE from originated by NODE
+             *  }
+             *  MESSAGE: LS Reply packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to NODE
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating NODE
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV of the MESSAGE received from NODE
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.9.3, 9.3.10.3, 9.3.7.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOT_BV_03_08() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_03_08(); + + } // End of testcase TC_GEONW_PON_LOT_BV_03_08 + + /** + * @desc Check location table entry expiration + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacons information from ItsNodeB and
+             *      the IUT not having received beacons from ItsNodeB for the duration of itsGnLifetimeLocTE parameter (20 sec)
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-04 + * @reference EN 302 636-4-1 [1], clauses 7.1.3, 9.3.8.2, 9.3.7.1.2 and Annex G + */ + testcase TC_GEONW_PON_LOT_BV_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_04(); + + } // End of testcase TC_GEONW_PON_LOT_BV_04 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_GUC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: GUC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_01(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_01 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_GAC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: GAC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_02(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_02 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_GBC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: GBC packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_03(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_03 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_TSB_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: TSB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_04(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_04 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_SHB_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: SHB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_05(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_05 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_LS_REQ_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: LS Request packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_06(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_06 + + /** + * @desc Check update of entries in location table with most up-to-date position data extracted + * from common header processing (including timestamp comparison before updating) + *
+             * Pics Selection: PICS_GN_LS_REP_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a MESSAGE from ItsNodeB,
+             *          containing Extended Header
+             *              containing SOPV field
+             *                  indicating an older timestamp than the last Beacon packet and
+             *                  indicating a different position than the position of the last Beacon packet
+             *  }
+             *  MESSAGE: LS Reply packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT does not send a GeoNetworking packet
+             *              containing a LS_REQUEST
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeB
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOT/BV-05 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2 + */ + testcase TC_GEONW_PON_LOT_BV_05_07() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOT_BV_05_07(); + + } // End of testcase TC_GEONW_PON_LOT_BV_05_07 + + } // End of group geoLocationTable + + // 6.2.2.2 + group geoLocalPositionVector { + + /** + * @desc Check update of the Local position vector + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having changed its position
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates eventually a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '1' (BEACON)
+             *                  containing HST field
+             *                      set to '0' (UNSPECIFIED)
+             *                  containing Extended Header
+             *                      containing SOPV field
+             *                          indicating the new position
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LPV/BV-01 + * @reference EN 302 636-4-1 [1], clauses 7.2.3, 9.2.2.2, 9.3.6.1 and Annex G + */ + testcase TC_GEONW_PON_LPV_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LPV_BV_01(); + + } // End of testcase TC_GEONW_PON_LPV_BV_01 + + } // End of group geoLocalPositionVector + + // 6.2.2.3 + group geoSequenceNumber { + + /** + * @desc Check initial sequence number assignment + *
+             * Pics Selection: PICS_GN_GBC_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having sent any GBC packet and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GBC packet to AREA1
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '4' (GEOBROADCAST)
+             *              containing GBC Extended Header
+             *                  containing SN field
+             *                      indicating value '0'
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/SQN/BV-01 + * @reference EN 302 636-4-1 [1], clauses 7.3.2, 9.3.8.2 + */ + testcase TC_GEONW_PON_SQN_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_SQN_BV_01(); + + } // End of testcase TC_GEONW_PON_SQN_BV_01 + + /** + * @desc Check the local sequence number incrementation + *
+             * Pics Selection: PICS_GN_GBC_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having sent a GBC packet to AREA1
+             *          containing the Sequence Number field
+             *              indicating value SN1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GBC packet to AREA1
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '4' (GEOBROADCAST)
+             *              containing GBC Extended Header
+             *                  containing SN field
+             *                      indicating value SN1 + 1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/SQN/BV-02 + * @reference EN 302 636-4-1 [1], clauses 7.2.3, 9.3.8.2 + */ + testcase TC_GEONW_PON_SQN_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_SQN_BV_02(); + + } // End of testcase TC_GEONW_PON_SQN_BV_02 + + } // End of group geoSequenceNumber + + // 6.2.2.4 + group geoLocationService { + + /** + * @desc Check first LS invocation for unknown Destination nodes + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeA
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '6' (LS)
+             *                  containing HST field
+             *                      set to '0' (LS_REQUEST)
+             *                  containing NH field
+             *                      set to '0' (UNSPECIFIED)
+             *              containing LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      indicating GN_ADDR of ItsNodeA
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-01 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.2, 9.2.4, 6.3 and 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_01(); + + } // End of testcase TC_GEONW_PON_LOS_BV_01 + + /** + * @desc Check absence of LS invocation for unknown Destination nodes when LS procedure is already active + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a first GUC packet to ItsNodeA and
+             *      the IUT having sent a GeoNetworking packet
+             *          containing a LS_REQUEST
+             *              containing Request field
+             *                  containing GN_ADDR
+             *                      containing M_ID
+             *                          indicating ItsNodeA
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *            the IUT is requested to send a new GUC packet to ItsNodeA
+             *      }
+             *      then {
+             *          IUT does not send a second LS_REQUEST packet (see note)
+             *      }
+             *  }
+             *  NOTE: at least not before the LS_REQUEST retransmission timer expires
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-02 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.2, 9.2.4 and 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_02(); + + } // End of testcase TC_GEONW_PON_LOS_BV_02 + + /** + * @desc Check packet buffering into LS buffer during Location service procedure, + * including handling of LT fields in the LT packet buffer + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC AND PICS_GN_LS_REP_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1 and
+             *      the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the LS_REPLY packet from ItsNodeA
+             *      }
+             *      then {
+             *          the IUT sends the GUC packet addressed to ItsNodeA
+             *              containing GUC Extended Header
+             *                  containing LT field
+             *                      indicating value (default LT value – WaitingTime (see note))
+             *      }
+             *  }
+             *  NOTE: Waiting Time == time difference between LS_REQUEST sending and LS_REPLY reception.
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-03 + * @reference EN 302 636-4-1 [1], clauses 7.4.3, 9.3.7.1.4, 9.3.8.2, 9.2.4 and 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_03(); + + } // End of testcase TC_GEONW_PON_LOS_BV_03 + + /** + * @desc Check LS buffer characteristics: FIFO type + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC AND PICS_GN_LS_REP_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating value LT1
+             *          containing payload field
+             *              indicating value PL1 and
+             *      the IUT having sent a LS_REQUEST packet and
+             *      the IUT having been requested to send a second GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating LT2
+             *          containing payload field
+             *              indicating value PL2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the LS_REPLY packet from ItsNodeA and
+             *          before expiry of LT1 and LT2
+             *      }
+             *      then {
+             *          the IUT sends GUC packet addressed to ItsNodeA
+             *              containing payload field
+             *                  indicating value PL1 and
+             *          the IUT sends GUC packet addressed to ItsNodeA
+             *              containing payload field
+             *                  indicating value PL2
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-04 + * @reference EN 302 636-4-1 [1], clauses 7.4.3, 9.3.8.2, 9.2.4 and 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_04(); + + } // End of testcase TC_GEONW_PON_LOS_BV_04 + + /** + * @desc Check LS buffer characteristics: discarding upon LT expiration + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send multiple GUC packets to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating values LTx and
+             *      the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the LS_REPLY packet from ItsNodeA after expiry of LTs
+             *      }
+             *      then {
+             *          the IUT does not send any packet to ItsNodeA
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-05 + * @reference EN 302 636-4-1 [1], clauses 7.4.3, 9.3.8.2, 9.2.4 and 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_05(); + + } // End of testcase TC_GEONW_PON_LOS_BV_05 + + /** + * @desc Check LS Request retransmission if no answer is received + *
+             * Pics Selection: PICS_GN_LS_REQ_RETRANSMISSION
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating value LT1 higher than itsGnLocationServiceTimer and
+             *      the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT does not receive LS_REPLY packet from ItsNodeA and
+             *          before expiration of LT1
+             *      }
+             *      then {
+             *          the IUT retransmits the LS_REQUEST packet
+             *              upon expiry of itsGnLocationServiceTimer
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-06 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.1.3, 9.3.7.1.2 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOS_TI_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_TI_06(); + + } // End of testcase TC_GEONW_PON_LOS_TI_06 + + /** + * @desc Check LS Request retransmission if no answer is received + *
+             * Pics Selection: PICS_GN_LS_REQ_RETRANSMISSION
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
+             *      the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT does not receive LS_REPLY packet from ItsNodeA and
+             *          before expiration of LT1
+             *      }
+             *      then {
+             *          the IUT retransmits the LS_REQUEST packet itsGnLocationServiceMaxRetrans times
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-07 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.1.2, 9.3.7.1.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOS_BV_07() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_07(); + + } // End of testcase TC_GEONW_PON_LOS_BV_07 + + /** + * @desc Check LS Reply generation by destination node + *
+             * Pics Selection: PICS_GN_LS_REQ_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a LS_REQUEST packet
+             *          containing Request field
+             *              indicating the IUT's GN_ADDR
+             *      }
+             *      then {
+             *          the IUT replies with a LS_REPLY packet
+             *              containing Common Header
+             *                  containing NH field
+             *                      set to '0' (UNSPECIFIED)
+             *                  containing LS_REPLY Extended Header
+             *                      containing DEPV field
+             *                          indicating same position as the SOPV value of the received LS_REQUEST
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-08 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.3 and 9.3.5 + */ + testcase TC_GEONW_PON_LOS_BV_08() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_08(); + + } // End of testcase TC_GEONW_PON_LOS_BV_08 + + /** + * @desc Check absence of LS Reply generation for already answered LS Request packets + *
+             * Pics Selection: PICS_GN_LS_REQ_DST
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received a LS_REQUEST packet generated by ItsNodeB from ItsNodeB
+             *      the IUT having sent a LS_REPLY packet to ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the same LS_REQUEST packet from ItsNodeD
+             *      }
+             *      then {
+             *          the IUT does not reply with a LS_REPLY packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BO-09 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.3 and 9.3.5 + */ + testcase TC_GEONW_PON_LOS_BO_09() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BO_09(); + + } // End of testcase TC_GEONW_PON_LOS_BO_09 + + + /** + * @desc Check LS Request forwarding + *
+             * Pics Selection: PICS_GN_LS_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a LS_REQUEST packet from ItsNodeC
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *              containing LS_REQUEST Extended Header
+             *                  containing Request field
+             *                      containing GN_ADDR
+             *                          containing M_ID
+             *                              indicating value differing from the M_ID part of the GN_ADDR of the IUT
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the received LS_REQUEST packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value decreased by 1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-10 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.2 + */ + testcase TC_GEONW_PON_LOS_BV_10() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_10(); + + } // End of testcase TC_GEONW_PON_LOS_BV_10 + + /** + * @desc Check LS Reply forwarding + *
+             * Pics Selection: PICS_GN_LS_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a LS_REPLY packet from ItsNodeC addressed to ItsNodeB
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT forwards the received LS_REPLY packet to ItsNodeB
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value decreased by 1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-11 + * @reference EN 302 636-4-1 [1], clauses 9.3.7.2 + */ + testcase TC_GEONW_PON_LOS_BV_11() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_11(); + + } // End of testcase TC_GEONW_PON_LOS_BV_11 + + /** + * @desc Check flushing of the LS buffer, initiated by the processing of a common header from the target destination + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet ItsNodeA
+             *          containing LT field
+             *              indicating LT1 and
+             *      the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to it from ItsNodeA before expiry of LT1
+             *      }
+             *      then {
+             *          the IUT sends the waiting GUC packet to ItsNodeA
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-12 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.7.1.2 and 7.4.2 + */ + testcase TC_GEONW_PON_LOS_BV_12() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_12(); + + } // End of testcase TC_GEONW_PON_LOS_BV_12 + + /** + * @desc Check LS buffer characteristics: FIFO type and Lifetime + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating value LT1
+             *          containing payload field
+             *              indicating value PL1 and
+             *      the IUT having sent a LS_REQUEST packet and
+             *      the IUT having been requested to send a second GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating LT2 lower than LT1
+             *          containing payload field
+             *              indicating value PL2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the LS_REPLY packet from ItsNodeA
+             *              after expiry of LT2
+             *              before expiry of LT1
+             *      }
+             *      then {
+             *          the IUT sends GUC packet addressed to ItsNodeA
+             *              containing payload field
+             *                  indicating value PL1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-13 + * @reference EN 302 636-4-1 [1], clauses 7.4.3, 9.3.7.1.2 + */ + testcase TC_GEONW_PON_LOS_BV_13() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_13(); + + } // End of testcase TC_GEONW_PON_LOS_BV_13 + + /** + * @desc Check that GeoNetworking packets in LS buffer are discarded when LS does not complete. + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *          containing LT field
+             *              indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
+             *      the IUT having sent a LS_REQUEST packet itsGnLocationServiceMaxRetrans times
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet from ItsNodeA
+             *              before expiration of LT1
+             *      }
+             *      then {
+             *          the IUT does not send any packet to ItsNodeA (see note)
+             *      }
+             *  }
+             *  NOTE: Stored GUC packets have been discarded upon LS failure
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-14 + * @reference EN 302 636-4-1 [1], clauses 7.4.3 + */ + testcase TC_GEONW_PON_LOS_BV_14() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_14(); + + } // End of testcase TC_GEONW_PON_LOS_BV_14 + + /** + * @desc Check flushing of the LS buffer, initiated by the processing of a common header from the target destination + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *  	the IUT having no Location Table Entry for ItsNodeA and
+             *  	the IUT having been requested to send a GUC packet ItsNodeA
+             *  		containing LT field
+             *  			indicating LT1 and
+             *  	the IUT having sent a LS_REQUEST packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives a GUC packet addressed to ItsNodeB from ItsNodeA before expiry of LT1
+             *  	}
+             *  	then {
+             *  		the IUT sends the waiting GUC packet to ItsNodeA
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-15 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.3, 9.3.7.1.2 and 7.4.2 + */ + testcase TC_GEONW_PON_LOS_BV_15() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_15(); + + } // End of testcase TC_GEONW_PON_LOS_BV_15 + + /** + * @desc Check LS Request retransmission termination when indirect response is received + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *  	the IUT having no Location Table Entry for ItsNodeA and
+             *  	the IUT having been requested to send a GUC packet to ItsNodeA
+             *  		containing TrafficClass.SCF set to 1
+             *  		containing LT field
+             *  			indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
+             *  	the IUT having sent a LS_REQUEST packet
+             *  	the IUT having retransmitted the LS_REQUEST packet less than itsGnLocationServiceMaxRetrans
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives a GUC packet addressed to it from ItsNodeA before expiry of LT1
+             *  	}
+             *  	then {
+             *  		the IUT does not retransmits the LS_REQUEST packet
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-16 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.7.1.2, 9.3.7.1.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOS_BV_16() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_16(); + + } // End of testcase TC_GEONW_PON_LOS_BV_16 + + /** + * @desc Check LS Request retransmission termination when indirect response is received + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *  	the IUT having no Location Table Entry for ItsNodeA and
+             *  	the IUT having been requested to send a GUC packet to ItsNodeA
+             *  		containing TrafficClass.SCF set to 1
+             *  		containing LT field
+             *  			indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
+             *  	the IUT having sent a LS_REQUEST packet
+             *  	the IUT having retransmitted the LS_REQUEST packet less than itsGnLocationServiceMaxRetrans
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives a GUC packet addressed to ItsNodeB from ItsNodeA before expiry of LT1
+             *  	}
+             *  	then {
+             *  		the IUT does not retransmits the LS_REQUEST packet
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/LOS/BV-17 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.3, 9.3.7.1.2, 9.3.7.1.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_LOS_BV_17() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_LOS_BV_17(); + + } // End of testcase TC_GEONW_PON_LOS_BV_17 + + } // End of group geoLocationService + + // 6.2.2.5 + group geoForwardingPacketBuffer { + + /** + * @desc Check Source packet buffering into UC forwarding buffer for unreachable Unicast destinations + * (absence of a suitable next hop candidate) + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note) and
+             *      the IUT having been requested to send a GUC packet addressed to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from ItsNodeB
+             *      }
+             *      then {
+             *          the IUT selects the ItsNodeB as the next hop and
+             *          the IUT sends the buffered GUC packet
+             *      }
+             *  }
+             *  NOTE: Location Table Entry is created by sending any GeoNetworking packet, originated by ItsNodeA, from ItsNodeC to IUT
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3, 9.3.4.2 and 9.3.8.3 + */ + testcase TC_GEONW_PON_FPB_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_01(); + + } // End of testcase TC_GEONW_PON_FPB_BV_01 + + /** + * @desc Check Forwarder packet buffering into UC forwarding buffer for unreachable Unicast destinations + * (absence of a suitable next hop candidate) + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having received GUC packets addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT1
+             *              containing RHL field
+             *                  indicating value greater than 1
+             *          containing GUC Extended Header
+             *              containing SN field
+             *                  indicating value SN1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from ItsNodeB
+             *      }
+             *      then {
+             *          the IUT selects the ItsNodeB as the next hop and
+             *          the IUT forwards the buffered GUC packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value decreased by 1
+             *              containing GUC Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-02 + * @reference EN 302 636-4-1 [1], clauses 9.3.8.3, 7.5.3, 9.3.6.3 + */ + testcase TC_GEONW_PON_FPB_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_02(); + + } // End of testcase TC_GEONW_PON_FPB_BV_02 + + /** + * @desc Check UC forwarding buffer characteristics: FIFO type + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having received a GUC (GEOUNI1) packet addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating value LT1 and
+             *              containing RHL field
+             *                  indicating value greater than 1
+             *          containing GUC Extended Header
+             *              containing SN field
+             *                  indicating value SN1
+             *      the IUT having received a second GUC (GEOUNI2) packet addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT2
+             *              containing RHL field
+             *                  indicating value greater than 1
+             *          containing GUC Extended Header
+             *              containing SN field
+             *                  indicating value SN2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from ItsNodeB
+             *          before expiry of LT1 and LT2
+             *      }
+             *      then {
+             *          the IUT selects ItsNodeB as the next hop and
+             *          the IUT forwards the GEOUNI1 buffered packet
+             *              containing GUC Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *          the IUT forwards the GEOUNI2 buffered packet
+             *              containing GUC Extended Header
+             *                  containing SN field
+             *                      indicating value SN2
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-03 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.8.3 + */ + testcase TC_GEONW_PON_FPB_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_03(); + + } // End of testcase TC_GEONW_PON_FPB_BV_03 + + /** + * @desc Check UC forwarding buffer characteristics: discarding upon LT expiration + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having received a GUC packet addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT1
+             *              containing RHL field
+             *                  indicating value greater than 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from ItsNodeB
+             *          after expiry of LT1
+             *      }
+             *      then {
+             *          the IUT does not forward the buffered GUC packet addressed to ItsNodeA
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-03 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.8.3 + */ + testcase TC_GEONW_PON_FPB_BV_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_04(); + + } // End of testcase TC_GEONW_PON_FPB_BV_04 + + /** + * @desc Check Source packet buffering into BC forwarding buffer for no GBC recipients + *
+             * Pics Selection: none
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received Beacon information from ItsNodeD and
+             *      the IUT not having received Beacon information from ItsNodeB and
+             *      the IUT having been requested to send a GBC packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from either ItsNodeB or ItsNodeD
+             *      }
+             *      then {
+             *          the IUT broadcasts the buffered GBC packet
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-06 + * @reference EN 302 636-4-1 [1], clauses 9.3.5, 7.5.3, 9.3.6.3 and 9.3.11.2 + */ + testcase TC_GEONW_PON_FPB_BV_06() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_06(); + + } // End of testcase TC_GEONW_PON_FPB_BV_06 + + /** + * @desc Check BC forwarding buffer characteristics: FIFO type + *
+             * Pics Selection: none
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received Beacon information from ItsNodeD and
+             *      the IUT not having received Beacon information from ItsNodeB and
+             *      the IUT having been requested to send a GBC (GEOBROAD1) packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT1
+             *          containing GBC Extended Header
+             *              containing SN field
+             *                  indicating value SN1
+             *      the IUT having been requested to send a GBC (GEOBROAD2) packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT2
+             *          containing GBC Extended Header
+             *              containing SN field
+             *                  indicating value SN2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from either ItsNodeD or ItsNodeB
+             *          before expiry of LT1 and LT2
+             *      }
+             *      then {
+             *          the IUT broadcasts GEOBROAD1 packet
+             *              containing GBC Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *          the IUT broadcasts GEOBROAD2 packet
+             *              containing GBC Extended Header
+             *                  containing SN field
+             *                      indicating value SN2
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-07 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.11.2 + */ + testcase TC_GEONW_PON_FPB_BV_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_07(); + + } // End of testcase TC_GEONW_PON_FPB_BV_07 + + /** + * @desc Check BC forwarding buffer characteristics: discarding upon LT expiration + *
+             * Pics Selection: none
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received Beacon information from ItsNodeD and
+             *      the IUT not having received Beacon information from ItsNodeB and
+             *      the IUT having been requested to send a GBC (GEOBROAD1) packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT1
+             *      the IUT having been requested to send a GBC (GEOBROAD2) packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing LT field
+             *                  indicating LT2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from either ItsNodeB or ItsNodeD
+             *          after expiry of LT1 and LT2
+             *      }
+             *      then {
+             *          the IUT does not broadcast any of the buffered GEOBROAD1 and GEOBROAD2
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-08 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.11.2 + */ + testcase TC_GEONW_PON_FPB_BV_08() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_08(); + + } // End of testcase TC_GEONW_PON_FPB_BV_08 + + /** + * @desc Check Source packet buffering into UC forwarding buffer for handling of LT fields in absence of a suitable next hop candidate + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA and
+             *      the IUT having been requested to send a GUC packet addressed to ItsNodeA
+             *          containing TrafficClass.SCF set to 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from ItsNodeB
+             *      }
+             *      then {
+             *          the IUT selects the ItsNodeB as the next hop and
+             *          the IUT sends the buffered GUC packet
+             *              containing GUC Extended Header
+             *                  containing LT field
+             *                      indicating (default LT value – WaitingTime(see note))
+             *      }
+             *  }
+             *  NOTE: WaitingTime == time difference between Upper layer packet generation and the neighbour Beacon reception
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-09 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.8.2 + */ + testcase TC_GEONW_PON_FPB_BV_09() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_09(); + + } // End of testcase TC_GEONW_PON_FPB_BV_09 + + /** + * @desc Check Source packet buffering into BC forwarding buffer for handling of LT fields for no GBC recipients + *
+             * Pics Selection: none
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received Beacon information from ItsNodeD and
+             *      the IUT not having received Beacon information from ItsNodeB and
+             *      the IUT having been requested to send a GBC packet to AREA1
+             *          containing TrafficClass.SCF set to 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a Beacon packet from either ItsNodeB or ItsNodeD
+             *      }
+             *      then {
+             *          the IUT broadcasts the buffered GBC packet
+             *              containing GBC Extended Header
+             *                  containing LT field
+             *                      indicating (default LT value - WaitingTime (see note))
+             *      }
+             *  }
+             *  NOTE: WaitingTime == time difference between Upper layer packet generation and the neighbour Beacon reception
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-10 + * @reference EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3 and 9.3.11.2 + */ + testcase TC_GEONW_PON_FPB_BV_10() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_10(); + + } // End of testcase TC_GEONW_PON_FPB_BV_10 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note)
+             *  }
+            *
+             *  MESSAGE : GUC packet addressed to ItsNodeA
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-11-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_11_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_11_01(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_01 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GAC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note)
+             *  }
+            *
+             *  MESSAGE : GAC packet
+             *                containing DestinationArea
+             *                    indicating AREA2
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-11-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_11_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_11_02(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_02 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GBC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note)
+             *  }
+            *
+             *  MESSAGE : GBC packet
+             *                containing DestinationArea
+             *                    indicating AREA2
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-11-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_11_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_11_03(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_03 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_TSB_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note)
+             *  }
+            *
+             *  MESSAGE : TSB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-11-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_11_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_11_04(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_04 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_SHB_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB and
+             *      the IUT having a Location Table Entry for ItsNodeA (see note)
+             *  }
+            *
+             *  MESSAGE : SHB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-11-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_11_05() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_11_05(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_05 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GUC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB
+             *  }
+            *
+             *  MESSAGE : GUC packet addressed to ItsNodeA
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-12-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_12_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_12_01(); + + } // End of testcase TC_GEONW_PON_FPB_BV_12_01 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GAC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB
+             *  }
+            *
+             *  MESSAGE : GAC packet
+             *                containing DestinationArea
+             *                    indicating AREA2
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-12-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_12_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_12_02(); + + } // End of testcase TC_GEONW_PON_FPB_BV_12_02 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_GBC_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB
+             *  }
+            *
+             *  MESSAGE : GBC packet
+             *                containing DestinationArea
+             *                    indicating AREA2
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-12-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_12_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_12_03(); + + } // End of testcase TC_GEONW_PON_FPB_BV_12_03 + + /** + * @desc Check immediate broadcasting in absence of a suitable next hop candidate when SCF is disabled + *
+             * Pics Selection: PICS_GN_TSB_SRC
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT not having received any Beacon information from ItsNodeB
+             *  }
+            *
+             *  MESSAGE : TSB packet
+            *
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a MESSAGE
+             *          containing TrafficClass.SCF set to 0
+             *      }
+             *      then {
+             *          the IUT broadcast the MESSAGE immediately
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/FPB/BV-12-X + * @reference EN 302 636-4-1 [1], Annex D2 + */ + testcase TC_GEONW_PON_FPB_BV_12_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_FPB_BV_12_04(); + + } // End of testcase TC_GEONW_PON_FPB_BV_11_04 + + } // End of group geoForwardingPacketBuffer + + // 6.2.2.6 + group geoGeoNetworkingAddress { + + /** + * @desc Check the initial GeoNetworking address assignment by IUT with auto-address configuration + *
+             * Pics Selection: PICS_GN_ADDR_AUTO
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT's itsGnLocalAddrConfMethod MIB parameter is set to AUTO (0)
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a Beacon packet
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking message
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '1' (BEACON)
+             *                  containing HST field
+             *                      set to '0' (UNSPECIFIED)
+             *              containing a Beacon Extender Header
+             *                  containing SOPV field
+             *                      containing GN_ADDR field
+             *                          indicating itsGnLocalGnAddr MIB parameter
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GNA/BV-01 + * @reference EN 302 636-4-1 [1], clauses 9.2.1.2 and 9.3.6.2 + */ + testcase TC_GEONW_PON_GNA_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GNA_BV_01(); + + } // End of testcase TC_GEONW_PON_GNA_BV_01 + + /** + * @desc Check the proper functioning of duplicate address detection mechanism + *
+             * Pics Selection: PICS_GN_DAD
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having sent an SHB packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a SHB packet
+             *              containing SHB Extended Header
+             *                  containing SOPV field
+             *                      containing GN_ADDR field
+             *                          indicating same GN_ADDR as the GN_ADDR field in the last SHB packet originated by the IUT
+             *      }
+             *      then {
+             *          the IUT sends subsequent SHB packet
+             *              containing SHB Extended Header
+             *                  containing SOPV field
+             *                      containing GN_ADDR field
+             *                          indicating different GN_ADDR as the previous used GN_ADDR
+             *      }
+             *   }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GNA/BV-02 + * @reference EN 302 636-4-1 [1], clauses 9.2.1.4 + */ + testcase TC_GEONW_PON_GNA_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GNA_BV_02(); + + } // End of testcase TC_GEONW_PON_GNA_BV_02 + + } // End of group geoGeoNetworkingAddress + + // 6.2.2.7 + group geoBeaconing { + + /** + * @desc Check that the IUT transmits Beacons at prescribed periodicity in the absence of other originated + * packets + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates Beacon packets
+             *      }
+             *      then {
+             *          the IUT sends each Beacon packet
+             *              after expiry of itsGnBeaconServiceRetransmitTimer
+             *              and before expiry of itsGnBeaconServiceRetransmitTimer + itsGnBeaconServiceMaxJitter
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/BEA/TI-01 + * @reference EN 302 636-4-1 [1], clauses 9.3.6.2 + */ + testcase TC_GEONW_PON_BEA_TI_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_BEA_TI_01(); + + } // End of testcase TC_GEONW_PON_BEA_TI_01 + + /** + * @desc Check that the IUT resets its timer for next Beacon transmission when originating other packets + *
+             * Pics Selection: PICS_GN_BEACON_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a SHB packet
+             *      }
+             *      then {
+             *          the IUT broadcasts a SHB packet and
+             *          the IUT sends the next Beacon packet
+             *              after expiry of itsGnBeaconServiceRetransmitTimer
+             *              and before expiry of itsGnBeaconServiceRetransmitTimer + itsGnBeaconServiceMaxJitter
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/BEA/TI-02 + * @reference EN 302 636-4-1 [1], clauses 9.2.3 and 9.3.10.2 + */ + testcase TC_GEONW_PON_BEA_TI_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_BEA_TI_02(); + + } // End of testcase TC_GEONW_PON_BEA_TI_02 + + } // End of group geoBeaconing + + // 6.2.2.8 + group geoGeoUnicast { + + group gucAllForwardingAlgorithms { + + /** + * @desc Check that the protocol header fields (RHL, PV) are correctly updated at each forwarding step + *
+             * Pics Selection: PICS_GN_GUC_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC and
+             *      the IUT having received a GUC packet (GEOUNI1) originated by ItsNodeA
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet (GEOUNI2) addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating position different from the SOPV value of GEOUNI1
+             *                  containing TST field
+             *                      indicating older value than the TimeStamp value of GEOUNI1
+             *      }
+             *      then {
+               *          the IUT retransmits GEOUNI2
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value decreased by 1 from the incoming value
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of GEOUNI1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/ALL/BV-03 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3 + */ + testcase TC_GEONW_PON_GUC_ALL_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_ALL_BV_03(); + + } // End of testcase TC_GEONW_PON_GUC_ALL_BV_03 + + /** + * @desc Check that the RHL restriction is correctly handled at the forwarding step + *
+             * Pics Selection: PICS_GN_GUC_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating 1
+             *      }
+             *      then {
+             *          the IUT does not retrnasmit the GUC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/ALL/BO-04 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3 + */ + testcase TC_GEONW_PON_GUC_ALL_BO_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_ALL_BO_04(); + + } // End of testcase TC_GEONW_PON_GUC_ALL_BO_04 + + /** + * @desc Check that a received GUC packet is passed over the Gn SAP to the correct upper + * protocol if the Destination address matches the IUT address + *
+             * Pics Selection: PICS_GN_GUC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *    the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to it
+             *      }
+             *      then {
+             *          the IUT passes the received GUC packet to the correct Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/ALL/BV-05 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.4 + */ + testcase TC_GEONW_PON_GUC_ALL_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_ALL_BV_05(); + + } // End of testcase TC_GEONW_PON_GUC_ALL_BV_06 + + /** + * @desc Check that a received GUC packet is not passed over the Gn SAP if the Destination + * address does not match the IUT address + *
+             * Pics Selection: PICS_GN_GUC_FWD
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *    the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeB from ItsNodeC
+             *      }
+             *      then {
+             *          the IUT does not pass the received GUC packet to any Upper Layer
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/ALL/BV-06 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.4 + */ + testcase TC_GEONW_PON_GUC_ALL_BV_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_ALL_BV_06(); + + } // End of testcase TC_GEONW_PON_GUC_ALL_BV_06 + + /** + * @desc Check that a received GUC packet is not passed over the Gn SAP to the correct upper protocol + * when the Destination address matches the IUT address if received twice or more + *
+             * Pics Selection: PICS_GN_GUC_DST
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeC and
+             *   the IUT having received Beacon information from ItsNodeB and
+             *   the IUT having received a GUC packet addressed to IUT from ItsNodeC
+             *       containing TrafficClass.SCF set to 1
+             *       containing Basic Header
+             *           containing RHL field
+             *               indicating value greater than 1 
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *       the IUT receives the same GUC packet from ItsNodeB
+             *              containing Basic Header
+             *                  containing RHL field
+             *                   indicating HL1 - 1
+             *      }
+             *      then {
+             *       the IUT does not pass the received GUC packet to any Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/ALL/BO-08 + * @reference EN 302 636-4-1 [1], clause 10.3.9.3 + */ + testcase TC_GEONW_PON_GUC_ALL_BO_08() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_ALL_BO_08(); + + } // End of testcase TC_GEONW_PON_GUC_ALL_BV_08 + + } // End of group gucAllForwardingAlgorithms + + group gucGreedyForwarding { + + /** + * @desc Check that a GUC request over upper Gn SAP triggers the origination of a + * GUC packet + *
+             * Pics Selection: PICS_GN_GUC_SRC AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *          the IUT sends a GeoNetworking packet
+             *              containing a correctly formatted Common Header
+             *                  containing HT field
+             *                      set to '2' (GEOUNICAST)
+             *              containing GUC Extended Header
+             *                  containing DEPV field
+             *                      indicating same position as the SOPV value of the Beacon information received
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/GRD/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.2, Annex E.2 + */ + testcase TC_GEONW_PON_GUC_GRD_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_GRD_BV_01(); + + } // End of testcase TC_GEONW_PON_GUC_GRD_BV_01 + + /** + * @desc Check that a received GUC packet is routed to the correct next hop neighbour according + * to the greedy forwarding rules + *
+             * Pics Selection:  PICS_GN_GUC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT selects ItsNodeB as the next hop and
+             *          the IUT forwards the GUC packet
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/GRD/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.2 + */ + testcase TC_GEONW_PON_GUC_GRD_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_GRD_BV_02(); + + } // End of testcase TC_GEONW_PON_GUC_GRD_BV_02 + + /** + * @desc Check that a received GUC packet is not triggering forwarding if received twice or more + *
+             * Pics Selection: PICS_GN_GUC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *  	the IUT having received Beacon information from ItsNodeC and
+             *  	the IUT having received Beacon information from ItsNodeB and
+             *  	the IUT having received a GUC packet addressed to ItsNodeA from ItsNodeC
+             *  		containing TrafficClass.SCF set to 1
+             *  		containing Basic Header
+             *  			containing RHL field
+             *  				indicating value greater than 1 and
+             *  	the IUT having forwarded the GUC packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives the same GUC packet from ItsNodeB
+             *  			containing Basic Header
+             *  				containing RHL field
+             *  					indicating HL1 - 1
+             *  	}
+             *  	then {
+             *  		the IUT does forward the packet
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/GRD/BO-07 + * @reference EN 302 636-4-1 [1], clause 10.3.9.3, Annex E.2 + */ + testcase TC_GEONW_PON_GUC_GRD_BO_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_GRD_BO_07(); + + } // End of testcase TC_GEONW_PON_GUC_GRD_BO_07 + + } // End of group gucGreedyForwarding + + group gucContentionBasedForwarding { + + /** + * @desc Check that a GUC request over upper Gn SAP triggers the origination of a GUC packet + *
+             * Pics Selection: PICS_GN_GUC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *       the IUT is requested to send a GUC packet to ItsNodeB
+             *      }
+             *      then {
+             *       the IUT broadcasts a GeoNetworking packet
+             *           containing a correctly formatted Common Header
+             *               containing HT field
+             *                   set to '2' (GEOUNICAST)
+             *           containing GUC Extended Header
+             *               containing DEPV field
+             *                   indicating same position as the SOPV value of the received Beacon information
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.2, 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_01(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_01 + + /** + * @desc Check that a received GUC packet is forwarded at the correct time according to the + * contention based forwarding rules + *
+             * Pics Selection: PICS_GN_GUC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC and
+             *      the distance between IUT and ItsNodeA being
+             *          less than itsGnDefaultMaxCommunicationRange MIB attribute
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the received GUC packet
+             *              upon expiry of calculated CBF delay (see note)
+             *      }
+             *  }
+             *  NOTE: The CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange,
+             *        itsGnCbfMinTime, and itsGnCbfMaxTime MIB attributes, and the distance value
+             *        between IUT and ItsNodeC
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_02(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_02 + + /** + * @desc Check that GUC packet forwarding correctly avoids packet duplication according to the + * contention based forwarding rules + *
+             * Pics Selection: PICS_GN_GUC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC and
+             *      the distance between IUT and ItsNodeA being
+             *          less than the itsGnDefaultMaxCommunicationRange MIB attribute and
+             *      the IUT having received a GUC packet addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing RHL field
+             *                  indicating value greater than 1 and
+             *      the IUT having started a CBF timer for this packet (see note)
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the same GUC packet from ItsNodeD
+             *              before expiration of the CBF timer
+             *      }
+             *      then {
+             *          the IUT does not re-broadcast the GUC packet
+             *      }
+             *  }
+             *  NOTE:    the CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange,
+             *           itsGnCbfMinTime, and itsGnCbfMaxTime MIB attributes, and the
+             *           distance value between IUT and ItsNodeC
+                *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_07(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_07 + + /** + * @desc Check that a received GUC packet forwarding is correctly handling the minimum delay + * value according to the contention based forwarding rules + *
+             * Pics Selection: PICS_GN_GUC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeC and
+             *      the distance between IUT and ItsNodeC being
+             *          larger than the itsGnDefaultMaxCommunicationRange MIB attribute
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the received GUC packet
+             *              upon expiry of itsGnCbfMinTime delay
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-20 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_20() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_20(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_20 + + /** + * @desc Check that a received GUC packet is forwarded at the correct time according to the + * contention based forwarding rules when the sender is unknown + *
+             * Pics Selection: PICS_GN_GUC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT not having received any message from ItsNodeC and
+             *      the distance between IUT and ItsNodeA being
+             *          less than the itsGnDefaultMaxCommunicationRange MIB attribute and
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the received GUC packet
+             *              upon expiry of CBF_MAX
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-21 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_21() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_21(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_21 + + /** + * @desc Check that a received GUC packet is forwarded at the correct time according to the contention + * based forwarding rules when the sender is known sender with an uncertain position (PAI = 0). + *
+             * Pics Selection: PICS_GN_GUC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD
+             *          containing Beacon ExtendedHeader
+             *              containing SOPV field
+             *                  containing PAI
+             *                      set to ‘0’
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA generated by ItsNodeC from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                          indicating value greater than 1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the GUC packet
+             *              upon expiry of CBF_MAX
+             *      }
+             *  }
+                *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GUC/CBF/BV-22 + * @reference EN 302 636-4-1 [1], clauses 10.3.8.3, Annex E.3 + */ + testcase TC_GEONW_PON_GUC_CBF_BV_22() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GUC_CBF_BV_22(); + + } // End of testcase TC_GEONW_PON_GUC_CBF_BV_22 + + } // End of group gucContentionBasedForwarding + + } // End of group geoGeoUnicast + + // 6.2.2.9 + group geoGeoBroadcast { + + group gbcNonAreaForwarding { + + group gbcNonAreaAllForwardingAlgorithm { + + /** + * @desc Check that the protocol header fields (RHL) are correctly updated during a GBC forwarding step + *
+             * Pics Selection:  PICS_GN_GBC_FWD
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+                *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value HL1 higher than 1
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT retransmits the GBC packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value (HL1 -1)
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+                *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/ALL/BV-03 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_ALL_BV_03(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_03 + + /** + * @desc Check that the RHL restriction is correctly handled at a GBC forwarding step + *
+             * Pics Selection: PICS_GN_GBC_FWD
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+                *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating 1
+             *              containing GBC Extended Header
+             *                  containing DestinationArea
+                *                      indicating AREA2
+             *      }
+             *      then {
+                *          the IUT does not retransmit the GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/ALL/BV-04 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_ALL_BV_04(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_04 + + /** + * @desc Check that a received GBC packet is not passed over the Gn SAP if it is received for the + * first time outside the GBC destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GBC packet
+             *              containing TrafficClass.SCF set to 1
+             *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+             *          the IUT does not pass the received GBC packet to any Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/ALL/BV-06 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_ALL_BV_06(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_ALL_BV_06 + + /** + * @desc Check that a received GBC packet is discarded when indicating a too big GeoArea + *
+             * Pics Selection: PICS_GN_GBC_FWD
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB
+                *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing DestinationArea
+                *                  indicating a geoArea bigger than itsGnMaxGeoAreaSize
+             *      }
+             *      then {
+                *          the IUT does not retransmit the received GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/ALL/BO-09 + * @reference EN 302 636-4-1 [1], Annex B.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_ALL_BO_09() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_ALL_BO_09(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_ALL_BO_09 + + /** + * @desc Check that a received GBC packet from inside of the destination area is discarded if + * received for the first time when IUT is outside of the destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeC and
+                *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the a GBC packet from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+                *                      indicating AREA2
+             *      }
+             *      then {
+                *          the IUT discards the received GBC packet
+             *      }
+             *  }
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/ALL/BO-10 + * @reference EN 302 636-4-1 [1], Annex D + */ + testcase TC_GEONW_PON_GBC_NONAREA_ALL_BO_10() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_ALL_BO_10(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_ALL_BO_10 + + } // End of group gbcNonAreaAllForwardingAlgorithm + + group gbcNonAreaGreedyForwarding { + + /** + * @desc Check that a GBC request over upper Gn SAP triggers line forwarding if the IUT is outside the Destination Area + *
+                * Pics Selection: PICS_GN_GBC_SRC AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY'
+                *                                       OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+                * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT is requested to send a GBC packet
+             *              containing TrafficClass.SCF set to 1
+             *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT selects ItsNodeB as the next hop and
+                *          the IUT sends the GBC packet (see note)
+             *      }
+             *  }
+                *  NOTE: Next hop ITS Station being identified by the MAC layer address of ItsNodeB
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/GRD/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.2, Annex E.2 + */ + testcase TC_GEONW_PON_GBC_NONAREA_GRD_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_GRD_BV_01(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_GRD_BV_01 + + /** + * @desc Check that a received GBC packet is triggering line forwarding if received out of its + * destination area for the first time from a known ITS-Station + *
+                * Pics Selection: PICS_GN_GBC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY'
+                *                                       OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet generated by ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing DestinationArea
+             *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT selects ItsNodeB as the next hop and
+                *          the IUT forwards the GBC packet (see note)
+             *      }
+             *  }
+                *  NOTE: Next hop ITS Station being identified by the MAC layer address of ItsNodeB
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/GRD/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex E.2 + */ + testcase TC_GEONW_PON_GBC_NONAREA_GRD_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_GRD_BV_02(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_GRD_BV_02 + + /** + * @desc Check that a received GBC packet is not triggering line forwarding if received out of its + * destination area twice or more + *
+                * Pics Selection: PICS_GN_GBC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY'
+                *                                       OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD
+                *      the IUT having received a GBC packet from ItsNodeC
+                *          containing TrafficClass.SCF set to 1
+                *          containing Basic Header
+                *              containing RHL field
+                *                  indicating value HL1 higher than 1
+                *          containing GBC Extended Header
+                *              containing SN field
+                *                  indicating value SN1
+                *              containing DestinationArea
+                *                  indicating AREA2
+                *      the IUT having forwarded the received GBC packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet from ItsNodeD
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating value lower than HL1
+                *              containing GBC Extended Header
+                *                  containing SN field
+                *                      indicating value SN1
+             *      }
+             *      then {
+                *          the IUT does not forward the received GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/GRD/BO-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_GRD_BO_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_GRD_BO_07(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_GRD_BO_07 + + } // End of group gbcNonAreaGreedyForwarding + + group gbcNonAreaContentionBasedForwarding { + + /** + * @desc Check that a GBC request over upper Gn SAP triggers the broadcasting of a GBC packet if the IUT is outside the Destination Area + *
+                * Pics Selection:  PICS_GN_GBC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT is requested to send a GBC packet
+                *              containing TrafficClass.SCF set to 1
+                *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT broadcasts immediately the GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.2, Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_01(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_01 + + /** + * @desc Check that a received GBC packet is forwarded at the correct time according to the contention + * based forwarding rules + *
+                * Pics Selection:  PICS_GN_GBC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeC and
+                *      the distance between IUT and ItsNodeA being
+                *          less than itsGnDefaultMaxCommunicationRange MIB attribute
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet addressed to ItsNodeA from ItsNodeC
+                *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+                *                      indicating value greater than 1
+             *      }
+             *      then {
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of calculated CBF delay (see note)
+             *      }
+             *  }
+                *  NOTE: The CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange, 
+                *        itsGnGeoCbfMinTime, and itsGnGeoCbfMaxTime MIB attributes, and the distance value between IUT and ItsNodeC.
+                *  
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_02(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_02 + + /** + * @desc Check that GBC packet forwarding correctly avoids packet duplication according to the + * contention based forwarding rules + *
+                * Pics Selection:  PICS_GN_GBC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeC and
+                *      the distance between IUT and ItsNodeA being 
+                *          less than the itsGnDefaultMaxCommunicationRange MIB attribute and
+                *      the IUT having received a GBC packet addressed to ItsNodeA from ItsNodeC
+                *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing RHL field
+                *                  indicating value greater than 1 and 
+                *      the IUT having started a CBF timer for this packet (see note)
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet from ItsNodeB
+                *              before expiration of the CBF timer
+                *      }
+                *      then {
+                *          the IUT does not re-broadcast the GBC packet
+                *      }
+                *  }
+                *  NOTE: The CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange, 
+                *        itsGnGeoCbfMinTime, and itsGnGeoCbfMaxTime MIB attributes, and the distance value between IUT and ItsNodeC.
+                *  
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_07(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_07 + + /** + * @desc Check that a received GBC packet forwarding is correctly handling the minimum delay value + * according to the contention based forwarding rules + *
+                * Pics Selection:  PICS_GN_GBC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeC and
+                *      the distance between IUT and ItsNodeC being
+                *          less than itsGnDefaultMaxCommunicationRange MIB attribute
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives a GBC packet addressed to ItsNodeA from ItsNodeC
+                *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+                *                      indicating value greater than 1
+             *      }
+             *      then {
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of itsGnGeoCbfMinTime delay
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-20 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_20() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_20(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_20 + + /** + * @desc Check that a received GBC packet is forwarded at the correct time according to the contention + * based forwarding rules if received for the first time when IUT is outside of the destination area + * from an unknown sender + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT not having received any message from ItsNodeD
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives the a GBC packet generated by ItsNodeC from ItsNodeD
+                *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+                *                  containing DestinationArea
+                *                      indicating AREA2
+                *      }
+                *      then {
+                *          the IUT re-broadcasts the GBC packet 
+                *              upon expiry of CBF_MAX
+                *      }
+                *  }
+                    *
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-21 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_21() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_21(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_21 + + /** + * @desc Check that a received GBC packet is forwarded at the correct time according to the contention + * based forwarding rules if received for the first time when IUT is outside of the destination area + * from a known sender having an uncertain position (PAI = 0) + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+                * Initial conditions:
+                * with {
+                *    the IUT being in the "initial state" and
+                *    the IUT having received Beacon information from ItsNodeB and
+                *    the IUT having received Beacon information from ItsNodeD
+                *        containing Beacon ExtendedHeader
+                *            containing SOPV field
+                *                containing PAI
+                *                    set to '0'
+                * }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives the a GBC packet generated by ItsNodeC from ItsNodeD
+                *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+                *                  containing DestinationArea
+                *                      indicating AREA2
+                *      }
+                *      then {
+                *          the IUT re-broadcasts the GBC packet
+                *              upon expiry of CBF_MAX
+                *      }
+                *  }
+                    *
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/NONAREA/CBF/BV-22 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_22() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_NONAREA_CBF_BV_22(); + + } // End of testcase TC_GEONW_PON_GBC_NONAREA_CBF_BV_22 + + } // End of group gbcNonAreaContentionBasedForwarding + + } // End of group gbcNonAreaForwarding + + group gbcAreaForwarding { + + group gbcAreaAllForwardingAlgorithm { + + /** + * @desc Check that a GBC request over upper Gn SAP triggers broadcasting of a GBC packet if the IUT is within the Destination Area + *
+                * Pics Selection: PICS_GN_GBC_SRC
+                * Config Id: CF02
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT is requested to send a GBC packet
+                *              containing TrafficClass.SCF set to 1
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      }
+                *      then {
+                *          the IUT broadcasts immediately the GBC packet
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      }
+                *  }
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ALL/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.2 + */ + testcase TC_GEONW_PON_GBC_AREA_ALL_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ALL_BV_01(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ALL_BV_01 + + /** + * @desc Check that the protocol header fields (RHL) are correctly updated during a GBC re- + * broadcasting step + *
+                * Pics Selection:  PICS_GN_GBC_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet
+                *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+                *                      indicating value HL1 higher than 1
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+                *              containing DestinationArea
+                *                      indicating AREA1
+             *      }
+             *      then {
+                *          the IUT retransmits the GBC packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value (HL1 -1)
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ALL/BV-03 + * @reference EN 302 636-4-1 [1], clauses 9.3.11.3 + */ + testcase TC_GEONW_PON_GBC_AREA_ALL_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ALL_BV_03(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ALL_BV_03 + + /** + * @desc Check that the RHL restriction is correctly handled at a GBC re-broadcasting step + *
+                * Pics Selection: PICS_GN_GBC_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet
+                *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating 1
+                *              containing GBC Extended Header
+                *                  containing DestinationArea
+                *                      indicating AREA1
+             *      }
+             *      then {
+                *          the IUT does not retransmit the GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ALL/BV-04 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_AREA_ALL_BV_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ALL_BV_04(); + + } // End of testcase TC_GEONW_PON_GB_AREA_ALLC_BV_04 + + /** + * @desc Check that a received GBC packet is passed over the Gn SAP to the correct upper + * protocol if it is received for the first time within the GBC destination area + *
+                * Pics Selection: PICS_GN_GBC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *    when {
+                *          the IUT receives a GBC packet
+                *              containing TrafficClass.SCF set to 1
+                *              containing DestinationArea
+                *                  indicating AREA1
+             *    }
+             *    then {
+                *          the IUT passes the received GBC packet to the correct Upper Layer protocol
+             *    }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ALL/BV-05 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_AREA_ALL_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ALL_BV_05(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ALL_BV_05 + + /** + * @desc Check that a received GBC packet is not passed over the Gn SAP if it is received for the + * second or more time + *
+                * Pics Selection: PICS_GN_GBC_DST
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received a GBC packet from ItsNodeB
+                *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing RHL field
+                *                  indicating HL1
+                *          containing GBC Extended Header
+             *              containing SN field
+                *                  indicating value SN1
+                *              containing DestinationArea
+                *                  indicating AREA1 and
+                *      the IUT having passed the received GBC packet to the correct Upper Layer protocol
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet from ItsNodeD
+             *              containing Basic Header
+             *                  containing RHL field
+                *                      indicating value lower than HL1
+             *                  containing SN field
+             *                      indicating value SN1
+             *      }
+             *      then {
+                *          the IUT does not pass the received GBC packet to any Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ALL/BO-08 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3 + */ + testcase TC_GEONW_PON_GBC_AREA_ALL_BO_08() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ALL_BO_08(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ALL_BO_08 + + } // End of group gbcAreaAllForwardingAlgorithm + + group gbcAreaSimpleForwarding { + + /** + * @desc Check that a received GBC packet is triggering re-broadcasting if received for the first + * time within its destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND (PICS_GN_AREA_FORWARDING_ALGORITHM == 'SIMPLE'
+                *                                       OR PICS_GN_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+                * Config Id: CF02
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives a GBC packet
+                *              containing TrafficClass.SCF set to 1
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      }
+                *      then {
+                *          the IUT re-broadcasts immediately the GBC packet
+                *      }
+                *  }
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/SMP/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex E.2 + */ + testcase TC_GEONW_PON_GBC_AREA_SMP_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_SMP_BV_02(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_SMP_BV_02 + + /** + * @desc Check that a received GBC packet is not triggering re-broadcasting if received for + * the second or more time (duplicate packet detection) + *
+                * Pics Selection:  PICS_GN_GBC_FWD  AND (PICS_GN_AREA_FORWARDING_ALGORITHM == 'SIMPLE' 
+                *                                        OR PICS_GN_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+                * Config Id: CF02
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received a GBC packet from ItsNodeB
+                *          containing TrafficClass.SCF set to 1
+                *          containing Basic Header
+                *              containing RHL field
+                *                  indicating value HL1 higher than 1
+                *          containing GBC Extended Header
+                *              containing SN field
+                *                  indicating value SN1
+                *              containing DestinationArea
+                *                  indicating AREA1 and
+                *      the IUT having re-broadcast the GBC packet
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives the same GBC packet from ItsNodeD
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating value lower than HL1
+                *              containing GBC Extended Header
+                *                  containing SN field
+                *                      indicating value SN1
+                *      }
+                *      then {
+                *          the IUT does not re-broadcast the GBC packet
+                *      }
+                *  }
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/SMP/BO-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.11.3, Annex A.2 + */ + testcase TC_GEONW_PON_GBC_AREA_SMP_BO_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_SMP_BO_07(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_SMP_BO_07 + + } // End of group gbcAreaSimpleForwarding + + group gbcAreaContentionBasedForwarding { + + /** + * @desc Check that a received GBC packet is triggering contention if received for the first time from a known sender + * when inside of the destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the a GBC packet from ItsNodeC
+                *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+                *                  containing DestinationArea
+                *                      indicating AREA1
+             *      }
+             *      then {
+                *          the IUT saves the GBC packet into the CBF buffer and
+                *          the IUT starts the contention timer and
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/CBF/BV-02 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_AREA_CBF_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_CBF_BV_02(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_CBF_BV_02 + + /** + * @desc Check that a received GBC packet is discarded if received twice or more + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeD
+                *      the IUT having received a GBC packet from ItsNodeC
+                *          containing TrafficClass.SCF set to 1
+                *          containing GBC Extended Header
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      the IUT having saved the packet into CBF buffer
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet from ItsNodeD
+             *      }
+             *      then {
+                *          the IUT removes the GBC packet from the CBF buffer
+                *          the IUT discards the new received GBC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/CBF/BV-07 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_AREA_CBF_BV_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_CBF_BV_07(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_CBF_BV_07 + + /** + * @desc Check that a received GBC packet is triggering contention if received for the first time + * when IUT is inside of the destination area from an unknown sender + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT not having received any message from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the a GBC packet generated by ItsNodeC from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *      then {
+                *          the IUT saves the GBC packet into the CBF buffer and
+                *          the IUT starts the contention timer set to CBF_MAX and
+                *          the IUT broadcasts the received GeoBroedcast packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/CBF/BV-21 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_AREA_CBF_BV_21() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_CBF_BV_21(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_CBF_BV_21 + + + /** + * @desc Check that a received GBC packet is triggering contention if received for the first time + * when IUT is inside of the destination area from an unknown sender + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeD
+                *        containing Beacon ExtendedHeader
+                *            containing SOPV field
+                *                containing PAI
+                *                    set to '0'
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the a GBC packet generated by ItsNodeC from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+                *                      indicating AREA1
+             *      }
+             *      then {
+                *          the IUT saves the GBC packet into the CBF buffer and
+                *          the IUT starts the contention timer set to CBF_MAX and
+                *          the IUT re-broadcasts the received GeoBroedcast packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/CBF/BV-22 + * @reference EN 302 636-4-1 [1], Annex E.3 + */ + testcase TC_GEONW_PON_GBC_AREA_CBF_BV_22() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_CBF_BV_22(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_CBF_BV_22 + + } // End of group gbcAreaContentionBasedForwarding + + group gbcAreaAdvancedForwarding { + + /** + * @desc Check that a received GBC packet with Broadcast MAC destination is triggering + * contention if received for the first time from an unknown sender when IUT is inside the + * destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF05
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT not having received any message from ItsNodeE
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeE
+                *              addressed to link-layer broadcast address
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *      then {
+                *          the IUT saves the GBC packet into the CBF buffer and
+                *          the IUT starts the contention timer set to CBF_MAX and
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-21 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_21() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_21(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_21 + + /** + * @desc Check that a received GBC packet is discarded if received more than MAX_COUNTER + * times when IUT is inside of the destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF06
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeF and
+                *      the IUT having received a GBC packet GBC1 from ItsNodeF
+                *          containing TrafficClass.SCF set to 1
+                *          containing GBC Extended Header
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      the IUT having saved the packet into CBF buffer
+                *      the IUT having received MAX_COUNTER - 1 times the GBC1 packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet GBC1
+                *      }
+                *      then {
+                *          the IUT removes GBC1 from the CBF buffer
+                *          the IUT discards the new received GBC packet
+                *      }
+                *  }
+                    *
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-23 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_23() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_23(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_23 + + /** + * @desc Check that a received GBC packet is discarded if received more than 1 times when IUT + * is inside of the destination area and inside the sectorial area of the GBC packet Sender + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF05
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeE and
+                *      the IUT having received a GBC packet GBC1 from ItsNodeB
+             *              containing TrafficClass.SCF set to 1
+                *          containing GBC Extended Header
+             *              containing DestinationArea
+                *                  indicating AREA1
+                *      the IUT having saved the packet into CBF buffer
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives the same GBC packet GBC1 from ItsNodeE
+                *          the IUT is inside the sectorial area of ItsNodeB
+             *      }
+             *      then {
+                *          the IUT removes GBC1 from the CBF buffer
+                *          the IUT discards the new received GBC packet
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-24 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_24() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_24(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_24 + + /** + * @desc Check that a received GBC packet is triggering contention if received more than 1 times when the IUT + * is inside of the destination area and outside the sectorial area of the GBC packet Sender (Angle_FSR > Angle_TH) + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF06
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeF and
+                *      the IUT having received a GBC packet GBC1 from ItsNodeB
+             *          containing TrafficClass.SCF set to 1
+                *          containing GBC Extended Header
+             *              containing DestinationArea
+                *                  indicating AREA1
+                *      the IUT having saved the packet into CBF buffer
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GBC packet GBC1 from ItsNodeF
+                *          the IUT is outside the sectorial area of ItsNodeB
+             *      }
+             *      then {
+                *          the IUT saves the GBC packet GBC1 from ItsNodeF and
+                *          the IUT starts the contention timer and
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+                    *
+                *  Note: In this configuration IUT is outside sectorial area of ItsNodeB to the angle FSR
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-25 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_25() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_25(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_25 + + /** + * @desc Check that a received GBC packet is triggering contention if received more than 1 times when IUT + * is inside the destination area and outside the sectorial area of the GBC packet Sender (Dist_R > Dist_F) + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF07
+                * Initial conditions:
+                *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received a GBC packet GBC1 from ItsNodeB
+                *          containing TrafficClass.SCF set to 1
+                *          containing GBC Extended Header
+                *              containing DestinationArea
+                *                  indicating AREA1
+                *      the IUT having saved packet into the CBF buffer
+                *  }
+                * Expected behaviour:
+                *  ensure that {
+                *      when {
+                *          the IUT receives the same GBC packet GBC1 from ItsNodeD
+                *          the IUT is outside the sectorial area of ItsNodeB
+                *      }
+                *      then {
+                *          the IUT saves the GBC packet into the CBF buffer and
+                *          the IUT starts the contention timer and
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of the contention timer
+                *      }
+                *  }
+                    *
+                * Note: In this configuration IUT is outside sectorial area of ItsNodeB because of dist_R > dist_F
+                * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-26 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_26() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_26(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_26 + + /** + * @desc Check that a received GBC packet with Unicast MAC destination is triggering line + * forwarding if received for the first time when IUT is inside the destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF05
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeE and
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeE
+                *              addressed to IUT's link-layer address
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+                *                      indicating AREA1
+             *      }
+             *      then {
+                *          the IUT selects ItsNodeB as the next hop ITS station and
+                *          the IUT forwards the GBC packet
+             *      }
+             *  }
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-27 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_27() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_27(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_27 + + /** + * @desc Check that a received GBC packet with Unicast MAC destination is triggering + * rebroadcast if received for the first time when IUT is inside the destination area. + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF05
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *   the IUT having received Beacon information from ItsNodeB and
+                *   the IUT having received Beacon information from ItsNodeE
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT receives a GBC packet from ItsNodeE addressed to IUT's link-layer address
+             *              containing TrafficClass.SCF set to 1
+                *           containing GBC Extended Header
+             *                  containing DestinationArea
+                *                   indicating AREA1
+             *      }
+             *      then {
+                *       the IUT saves the GBC packet into the CBF buffer and
+                *       the IUT starts the contention timer set to CBF_MAX and
+                *       the IUT re-broadcasts the received GBC packet
+                *           upon expiry of the contention timer
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-28 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_28() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_28(); + + } // End of testcase TC_GEONW_PON_BAA_BV_28 + + /** + * @desc Check that a received GBC packet with Broadcast destination is triggering contention if + * received for the first time from known sender when IUT is inside the destination area + *
+                * Pics Selection: PICS_GN_GBC_FWD AND PICS_GN_AREA_FORWARDING_ALGORITHM == 'ADVANCED'
+                * Config Id: CF05
+             * Initial conditions:
+             *  with {
+                *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeE
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GBC packet from ItsNodeE
+                *              addressed to broadcast link-layer address
+             *              containing TrafficClass.SCF set to 1
+                *              containing GBC Extended Header
+             *              containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *      then {
+                *          the IUT calculates and starts the contention timer and
+                *          the IUT re-broadcasts the received GBC packet
+                *              upon expiry of the contention timer
+             *      }
+             *  }
+                    *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GBC/AREA/ADV/BV-29 + * @reference EN 302 636-4-1 [1], Annex F.4 + */ + testcase TC_GEONW_PON_GBC_AREA_ADV_BV_29() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GBC_AREA_ADV_BV_29(); + + } // End of testcase TC_GEONW_PON_GBC_AREA_ADV_BV_29 + + } // End of group gbcAreaAdvancedForwarding + + } // End of group gbcAreaForwarding + + } // End of group geoGeoBroadcast + + // 6.2.2.10 + group geoTopologicallyScopedBroadcast { + + /** + * @desc Check that a TSB request over upper Gn SAP triggers the origination of a TSB + * packet + *
+             * Pics Selection: PICS_GN_TSB_SRC
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a TSB packet
+             *      }
+             *      then {
+             *          the IUT broadcasts a TSB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.2 + */ + testcase TC_GEONW_PON_TSB_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BV_01(); + + } // End of testcase TC_GEONW_PON_TSB_BV_01 + + /** + * @desc Check that a received TSB packet is triggering re-broadcasting if received for the first time + *
+             * Pics Selection: PICS_GN_TSB_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a TSB packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating HL1 higher than 1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the TSB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BV_02(); + + } // End of testcase TC_GEONW_PON_TSB_BV_02 + + /** + * @desc Check that the protocol header fields (RHL) are correctly updated during a TSB re- + * broadcasting step + *
+             * Pics Selection: PICS_GN_TSB_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a TSB packet
+             *          containing Basic Header
+             *              containing RHL field
+             *                  indicating HL1
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *      }
+             *      then {
+             *          the IUT re-broadcasts the TSB packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value (HL1 -1)
+             *              containing Common Header
+             *                  containing MHL field
+             *                      indicating value MHL1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BV-03 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BV_03(); + + } // End of testcase TC_GEONW_PON_TSB_BV_03 + + /** + * @desc Check that the RHL restriction is correctly handled at a TSB re-broadcasting step + *
+             * Pics Selection: PICS_GN_TSB_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a TSB packet
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating 1
+             *      }
+             *      then {
+             *          the IUT does not re-broadcast the TSB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BO-04 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BO_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BO_04(); + + } // End of testcase TC_GEONW_PON_TSB_BO_04 + + /** + * @desc Check that a received TSB packet is passed over the Gn SAP to the correct upper protocol if it is + * received for the first time + *
+             * Pics Selection: PICS_GN_TSB_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *      the IUT receives a TSB packet
+             *      }
+             *      then {
+             *      the IUT passes the received TSB packet to the correct Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BV-05 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BV_05(); + + } // End of testcase TC_GEONW_PON_TSB_BV_05 + + /** + * @desc Check that a received TSB packet is not triggering re-broadcasting if received for the second or + * more time + *
+             * Pics Selection: PICS_GN_TSB_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received a TSB packet from ItsNodeB
+             *          containing Basic Header
+             *              containing RHL field
+             *                  indicating HL1 higher than 1
+             *          containing TSB Extended Header
+             *              containing SN field
+             *                  indicating value SN1 and
+             *      the IUT having re-broadcast the TSB packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the same TSB packet from ItsNodeD
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating HL1 - 1
+             *              containing TSB Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *      }
+             *      then {
+             *          the IUT does not re-broadcast the TSB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BO-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BO_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BO_07(); + + } // End of testcase TC_GEONW_PON_TSB_BO_07 + + + /** + * @desc Check that a received TSB packet is not passed over the Gn SAP if it is received for the second + * or more time + *
+             * Pics Selection: PICS_GN_TSB_DST
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *      the IUT having received a TSB packet from ItsNodeB
+             *          containing Basic Header
+             *              containing RHL field
+             *                  indicating HL1 higher than 1
+             *          containing TSB Extended Header
+             *              containing SN field
+             *                  indicating value SN1 and
+             *      the IUT having passed the received TSB packet to the correct Upper Layer protocol
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *          the IUT receives the same TSB packet from ItsNodeD
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating HL1 - 1
+             *              containing TSB Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *  	}
+             *  	then {
+             *          the IUT does not pass the received TSB packet to any Upper Layer protocol
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/TSB/BO-08 + * @reference EN 302 636-4-1 [1], clauses 10.3.9.3 + */ + testcase TC_GEONW_PON_TSB_BO_08() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_TSB_BO_08(); + + } // End of testcase TC_GEONW_PON_TSB_BO_08 + + } // End of group geoTopologicallyScopedBroadcast + + // 6.2.2.11 + group geoSingleHopBroadcast { + + /** + * @desc Check that a SHB request over upper Gn SAP triggers the origination of a SHB + * packet + *
+             * Pics Selection: PICS_GN_SHB_SRC
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a SHB packet
+             *      }
+             *      then {
+             *          the IUT broadcasts the SHB packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/SHB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.10.2 + */ + testcase TC_GEONW_PON_SHB_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_SHB_BV_01(); + + } // End of testcase TC_GEONW_PON_SHB_BV_01 + + /** + * @desc Check that a received SHB packet is passed over the Gn SAP to the correct upper protocol if it is + * received for the first time + *
+             * Pics Selection: PICS_GN_SHB_DST
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *    the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a SHB packet
+             *      }
+             *      then {
+             *          the IUT passes the received SHB packet to the Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/SHB/BV-05 + * @reference EN 302 636-4-1 [1], clauses 10.3.10.3 + */ + testcase TC_GEONW_PON_SHB_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_SHB_BV_05(); + + } // End of testcase TC_GEONW_PON_SHB_BV_05 + + } // End of group geoSingleHopBroadcast + + // 6.2.2.12 + group geoGeoAnycast { + + group gacNonAreaForwarding { + + group gacNonAreaAllForwardingAlgorithm { + + /** + * @desc Check that the protocol header fields (RHL) are correctly updated during a GAC + * forwarding step + *
+                * Pics Selection: PICS_GN_GAC_FWD
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating value HL1 higher than 1
+                *              containing Common Header
+                *                  containing MHL field
+                *                      indicating value MHL1
+             *                  containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT retrnasmits the GAC packet
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating value (HL1 - 1)
+                *              containing Common Header
+                *                  containing MHL field
+                *                      indicating value MHL1
+                *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/ALL/BV-03 + * @reference EN 302 636-4-1 [1], clauses 10.3.6.3 and 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_03() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_ALL_BV_03(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_03 + + /** + * @desc Check that the RHL restriction is correctly handled at a GAC forwarding step + *
+                * Pics Selection: PICS_GN_GAC_FWD
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB
+             *      the IUT having received Beacon information from ItsNodeC
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating 1
+                *              containing GAC Extended Header
+             *                  containing DestinationArea
+             *                      indicating AREA2
+             *      }
+             *      then {
+                *         the IUT does not retransmit the GAC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/ALL/BO-04 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_ALL_BO_04() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_ALL_BO_04(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_ALL_BO_04 + + /** + * @desc Check that a received GAC packet is not passed over the Gn SAP if it is received for the + * first time outside the GAC destination area + *
+                * Pics Selection: PICS_GN_GAC_FWD
+                * Config Id: CF01
+             * Initial conditions:
+             *  with {
+                *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeB
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+             *                      indicating AREA2
+             *      }
+             *      then {
+                *          the IUT does not pass the received GAC packet to any Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/BV-06 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_ALL_BV_06(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_06 + + /** + * @desc Check that a received GAC packet is discarded when indicating a too big GeoArea + *
+                * Pics Selection: PICS_GN_GAC_FWD
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+                *                  indicating a geoArea bigger than itsGnMaxGeoAreaSize
+             *      }
+             *      then {
+                *          the IUT does not retransmit the received GAC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/ALL/BO-09 + * @reference EN 302 636-4-1 [1], Annex B.3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_ALL_BO_09() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_ALL_BO_09(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_ALL_BO_09 + + /** + * @desc Check that a received GAC packet from inside the destination area is discarded if received for + * the first time from a known sender when IUT is outside the destination area. + *
+                * Pics Selection: PICS_GN_GAC_FWD
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *      the IUT having received Beacon information from ItsNodeC and
+                *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *              containing GAC Extended Header
+             *                  containing DestinationArea
+             *                      indicating AREA2
+             *      }
+             *      then {
+                *          the IUT discards the received GAC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/ALL/BV-10 + * @reference EN 302 636-4-1 [1], Annex D + */ + testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_10() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_ALL_BV_10(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_ALL_BV_10 + + } // End of group gacNonAreaAllForwardingAlgorithm + + group gacNonAreaGreedyForwarding { + + /** + * @desc Check that a GAC request over upper Gn SAP triggers line forwarding if the IUT is outside the Destination Area + *
+                * Pics Selection: PICS_GN_GAC_SRC  AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+                * Config Id: CF02
+             * Initial conditions:
+             * with {
+             *    the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeD and
+                *      the IUT having received Beacon information from ItsNodeB
+             * }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT is requested to send a GAC packet
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+             *                      indicating AREA2
+             *      }
+             *      then {
+                *          the IUT selects ItsNodeB as the next hop and
+                *          the IUT sends the GAC packet (see note)
+                *              containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *  }
+                *  NOTE: Next hop ITS Station being identified by the MAC layer address of ItsNodeB
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/GRD/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.2, Annex E.2 + */ + testcase TC_GEONW_PON_GAC_NONAREA_GRD_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_GRD_BV_01(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_GRD_BV_01 + + /** + * @desc Check that a received GAC packet is triggering line forwarding if received out of its + * destination area for the first time + *
+                * Pics Selection: PICS_GN_GAC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB
+             *      the IUT having received Beacon information from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives a GAC packet from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+                *                  indicating AREA2
+             *      }
+             *      then {
+                *          the IUT selects ItsNodeB as the next hop and
+                *          the IUT forwards the GAC packet (see note)
+             *      }
+             *  }
+                *  NOTE: Next hop ITS Station being identified by the MAC layer address of ItsNodeB
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/GRD/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3, Annex E.2 + */ + testcase TC_GEONW_PON_GAC_NONAREA_GRD_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_GRD_BV_02(); + + } // End of testcase TC_GEONW_PON_GAC_BV_02 + + /** + * @desc Check that a received GAC packet is not triggering line forwarding if received out of its + * destination area for the second or more time + *
+                * Pics Selection: PICS_GN_GAC_FWD AND (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'GREEDY' OR PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'UNSPECIFIED')
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *      the IUT having received Beacon information from ItsNodeB
+                *      the IUT having received Beacon information from ItsNodeD
+                *      the IUT having received a GAC packet from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+                *          containing Basic Header
+                *              containing RHL field
+                *                  indicating value HL1 higher than 1
+                *          containing GAC Extended Header
+                *              containing SN field
+                *                  indicating value SN1 and
+             *              containing DestinationArea
+                *                  indicating AREA2
+                *      the IUT having forwarded the GAC packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *          the IUT receives the same GAC packet from other neighbour
+                *              containing Basic Header
+                *                  containing RHL field
+                *                      indicating value lower than HL1
+                *              containing GAC Extended Header
+                *                  containing SN field
+                *                      indicating value SN1
+             *      }
+             *      then {
+                *          the IUT does not forward the received GAC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/GRD/BO-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_GRD_BO_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_GRD_BO_07(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_GRD_BO_07 + + } // End of group gacNonAreaGreedyForwarding + + group gacNonAreaContentionBasedForwarding { + + /** + * @desc Check that a GAC request over upper Gn SAP triggers immediate broadcasting of a + * GAC packet if the IUT is outside the Destination Area + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+                *   the IUT having received Beacon information from ItsNodeD and
+                *   the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT is requested to send a GAC packet
+                *           containing TrafficClass.SCF set to 1
+                *           containing DestinationArea
+                *               indicating AREA2
+             *      }
+             *      then {
+                *       the IUT broadcasts immediately the GAC packet 
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.2 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_01(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_01 + + /** + * @desc Check that a received GAC packet is forwarded at the correct time according to the contention + * based forwarding rules + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *   the IUT having received Beacon information from ItsNodeC and
+                *   the distance between IUT and ItsNodeA being 
+                *       less than itsGnDefaultMaxCommunicationRange MIB attribute
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT receives a GAC packet addressed to ItsNodeA from ItsNodeC
+                *           containing TrafficClass.SCF set to 1
+                *           containing Basic Header
+                *               containing RHL field
+                *                   indicating value greater than 1
+             *      }
+             *      then {
+                *       the IUT re-broadcasts the received GAC packet
+                *           upon expiry of calculated CBF delay (see note)
+             *      }
+             *  }
+                * NOTE: The CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange, itsGnCbfMinTime, 
+                *       and itsGnCbfMaxTime MIB attributes, and the distance value between IUT and ItsNodeC.  
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.2, Annex E3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_02(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_02 + + /** + * @desc Check that GAC packet forwarding correctly avoids packet duplication according to the contention + * based forwarding rules + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *   the IUT having received Beacon information from ItsNodeC and
+                *   the distance between IUT and ItsNodeA being 
+                *       less than the itsGnDefaultMaxCommunicationRange MIB attribute and
+                *   the IUT having received a GAC packet addressed to ItsNodeA from ItsNodeC
+                *       containing TrafficClass.SCF set to 1
+                *       containing Basic Header
+                *           containing RHL field
+                *               indicating value greater than 1 and 
+                *   the IUT having started a CBF timer for this packet (see note)
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT receives the same GAC packet from ItsNodeB
+                *           before expiration of the CBF timer
+             *      }
+             *      then {
+                *       the IUT does not re-broadcast the GAC packet 
+             *      }
+             *  }
+                * NOTE: The CBF delay timer value is calculated from the itsGnDefaultMaxCommunicationRange, itsGnCbfMinTime, 
+                *       and itsGnCbfMaxTime MIB attributes, and the distance value between IUT and ItsNodeC.  
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-07 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3, Annex E3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_07() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_07(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_07 + + /** + * @desc Check that a received GAC packet forwarding is correctly handling the minimum delay value + * according to the contention based forwarding rules + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *  	the IUT being in the "initial state" and
+             *  	the IUT having received Beacon information from ItsNodeB and
+                *   the IUT having received Beacon information from ItsNodeC and
+                *   the distance between IUT and ItsNodeC being 
+                *       larger than the itsGnDefaultMaxCommunicationRange MIB attribute
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+                *       the IUT receives a GAC packet addressed to ItsNodeA from ItsNodeC
+             *  			containing TrafficClass.SCF set to 1
+                *           containing Basic Header
+                *               containing RHL field
+                *                   indicating value greater than 1
+             *  	}
+             *  	then {
+                *       the IUT re-broadcasts the received GAC packet
+                *           upon expiry of itsGnCbfMinTime delay
+             *  	}
+             *  }
+                *  
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-20 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3, Annex E3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_20() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_20(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_20 + + /** + * @desc Check that a received GAC packet is forwarded at the correct time according to the contention + * based forwarding rules if received for the first time when IUT is outside of the destination area + * from an unknown sender + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+                * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+                *   the IUT not having received any message from ItsNodeD
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT receives a GAC packet generated by ItsNodeC from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *           containing GAC Extended Header
+             *                  containing DestinationArea
+                *                   indicating AREA2
+             *      }
+             *      then {
+                *       the IUT re-broadcasts the GAC packet
+                *           upon expiry of CBF_MAX
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-21 + * @reference EN 302 636-4-1 [1], Annex E3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_21() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_21(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_21 + + /** + * @desc Check that a received GAC packet is forwarded at the correct time according to the contention + * based forwarding rules if received for the first time when IUT is outside of the destination area + * from a known sender having an uncertain position (PAI = 0) + *
+                * Pics Selection: PICS_GN_GAC_SRC AND PICS_GN_NON_AREA_FORWARDING_ALGORITHM == 'CBF'
+             * Config Id: CF04
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having received Beacon information from ItsNodeD
+                *       containing Beacon ExtendedHeader 
+                *           containing SOPV field
+                *               containing PAI
+                *                   set to ‘0’
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+                *       the IUT receives a GAC packet generated by ItsNodeC from ItsNodeD
+             *              containing TrafficClass.SCF set to 1
+                *           containing GAC Extended Header
+             *                  containing DestinationArea
+             *                      indicating AREA2
+             *      }
+             *      then {
+                *       the IUT re-broadcasts the GAC packet
+                *           upon expiry of CBF_MAX
+             *      }
+             *  }
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/NONAREA/CBF/BV-22 + * @reference EN 302 636-4-1 [1], Annex E3 + */ + testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_22() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_NONAREA_CBF_BV_22(); + + } // End of testcase TC_GEONW_PON_GAC_NONAREA_CBF_BV_22 + + } // End of group gacNonAreaContentionBasedForwarding + + } // End of group gacNonAreaForwarding + + group gacAreaForwarding { + + /** + * @desc Check that GAC request over upper Gn SAP triggers broadcasting of a GAC packet if the IUT is within the Destination Area + *
+             * Pics Selection: PICS_GN_GAC_SRC
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GAC packet
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *      then {
+             *          the IUT broadcasts immediately the GAC packet
+             *              containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/AREA/ALL/BV-01 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.2 + */ + testcase TC_GEONW_PON_GAC_AREA_ALL_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_AREA_ALL_BV_01(); + + } // End of testcase TC_GEONW_PON_GAC_AREA_ALL_BV_01 + + /** + * @desc Check that a received GAC packet is not triggering forwarding or re-broadcasting if the IUT + * is within the Destination Area + *
+             * Pics Selection: PICS_GN_GAC_FWD
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received Beacon information from ItsNodeD and
+             *      the IUT having received Beacon information from ItsNodeB
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GAC packet
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+             *                      indicating AREA1
+             *      }
+             *      then {
+             *          IUT does not retransmit the received GAC packet
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/AREA/ALL/BV-02 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_AREA_ALL_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_AREA_ALL_BV_02(); + + } // End of testcase TC_GEONW_PON_GAC_AREA_ALL_BV_02 + + /** + * @desc Check that a received GAC packet is passed over the Gn SAP to the correct upper + * protocol if it is received for the first time within the GAC destination area + *
+             * Pics Selection: PICS_GN_GAC_DST
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GAC packet from ItsNodeB
+             *              containing TrafficClass.SCF set to 1
+             *                  containing DestinationArea
+             *                  indicating AREA1
+             *      }
+             *      then {
+             *          the IUT passes the received GAC packet to the correct Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/AREA/ALL/BV-05 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_AREA_ALL_BV_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_AREA_ALL_BV_05(); + + } // End of testcase TC_GEONW_PON_GAC_AREA_ALL_BV_05 + + /** + * @desc Check that a received GAC packet is not passed over the Gn SAP if it is received for + * the second or more time + *
+             * Pics Selection: PICS_GN_GAC_DST
+             * Config Id: CF02
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having received a GAC packet from ItsNodeD
+             *          containing TrafficClass.SCF set to 1
+             *          containing Basic Header
+             *              containing RHL field
+             *                  indicating HL1
+             *          containing GAC Extended Header
+             *              containing SN field
+             *                  indicating value SN1 and
+             *              containing DestinationArea
+             *                  indicating AREA1 and
+             *      the IUT having passed the received GAC packet to the correct Upper Layer protocol
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives the same GAC packet from ItsNodeB
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating value lower than HL1
+             *              containing GAC Extended Header
+             *                  containing SN field
+             *                      indicating value SN1
+             *      }
+             *      then {
+             *          the IUT does not pass the received GAC packet to any Upper Layer protocol
+             *      }
+             *  }
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/PON/GAC/AREA/ALL/BO-08 + * @reference EN 302 636-4-1 [1], clauses 10.3.12.3 + */ + testcase TC_GEONW_PON_GAC_AREA_ALL_BO_08() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_PON_GAC_AREA_ALL_BO_08(); + + } // End of testcase TC_GEONW_PON_GAC_AREA_ALL_BO_08 + + } // End of group gacAreaForwarding + + } // End of group geoGeoAnycast + + } // End of group geoProtocolOperation + + // 6.2.3 Capacities + group geoCapacities { + + // 6.2.3.1 + group geoCapLocationService { + + /** + * @desc Test of LS buffer capacity according to its GnLocationServicePacketBufferSize parameter and + * the overflow handling procedure + *
+             * Pics Selection: PICS_GN_LS_REQ_SRC
+             * Config Id: CF01
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeA and
+             *      the IUT having received Beacon information from ItsNodeB and
+             *      the IUT having been requested to send multiple GUC packets to ItsNodeA
+             *          containing TrafficClass.SCF set to 1 and
+             *      the IUT having sent a LS_REQUEST packet and
+             *      the IUT not having received a LS_REPLY packet
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT is requested to send a GUC packet to ItsNodeA
+             *              containing TrafficClass.SCF set to 1 and
+             *          the location service buffer capacity exceeded (see note 1)
+             *      }
+             *      then {
+             *          the IUT removes the older packet(s) in the location service buffer and,
+             *          the IUT inserts the new received packet at the end of the location service buffer (see note 2)
+             *      }
+             *  }
+             *  NOTE 1: The amount of stored data exceeds Location Service buffer capacity defined by the
+             *          itsGnLocationServicePacketBufferSize MIB parameter
+             *  NOTE 2: Buffered packets will be delivered upon reception of LS_REPLY message
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/CAP/LOS/BV-01 + * @reference EN 302 636-4-1 [1], clauses 7.4.3 + */ + testcase TC_GEONW_CAP_LOS_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_GEONW_CAP_LOS_BV_01(); + + } // End of testcase TC_GEONW_CAP_LOS_BV_01 + + } // End of group geoCapLocationService + + // 6.2.3.2 + group geoCapForwardingPacketBuffer { + + /** + * @desc Test of UC forwarding buffer capacity according to itsGnUcForwardingPacketBufferSize + * parameter and the overflow handling procedure + *
+             * Pics Selection: PICS_GN_GUC_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeB and
+             *      the IUT having received multiple GUC packets addressed to ItsNodeA from ItsNodeC
+             *          containing TrafficClass.SCF set to 1
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GUC packet addressed to ItsNodeA from ItsNodeC
+             *              containing TrafficClass.SCF set to 1
+             *              containing Basic Header
+             *                  containing RHL field
+             *                      indicating HL1 higher than 1
+             *          the UC forwarding packet buffer capacity exceeded (see note 1)
+             *      }
+             *      then {
+             *          the IUT removes the older packet(s) in the UC forwarding packet buffer and,
+             *          the IUT inserts the new received GUC packet at the end of the UC forwarding packet buffer (see note 2)
+             *      }
+             *  }
+             *  NOTE 1: The amount of stored data exceeds UC forwarding packet capacity defined by the
+             *          itsGnUcForwardingPacketBufferSize MIB parameter
+             *  NOTE 2: Buffered packets will be delivered upon reception of Beacon message from ItsNodeB
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/CAP/FPB/BV-01 + * @reference EN 302 636-4-1 [1], clauses 7.5.3 + */ + testcase TC_GEONW_CAP_FPB_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_CAP_FPB_BV_01(); + + } // End of testcase TC_GEONW_CAP_FPB_BV_01 + + /** + * @desc Test of BC forwarding buffer capacity according to itsGnBcForwardingPacketBufferSize + * parameter and the overflow handling procedure + *
+             * Pics Selection: PICS_GN_GBC_FWD
+             * Config Id: CF03
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state" and
+             *      the IUT having no Location Table Entry for ItsNodeB
+             *      the IUT having received multiple GBC packets
+             *          containing TrafficClass.SCF set to 1
+             *          containing GBC Extended Header
+             *              containing GBC Destination Area
+             *                  indicating AREA2
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT receives a GBC packet
+             *              containing TrafficClass.SCF set to 1
+             *              containing GBC Extended Header
+             *                  containing GBC Destination Area
+             *                      indicating AREA2 and
+             *          the BC forwarding packet buffer capacity exceeded (see note 1)
+             *      }
+             *      then {
+             *          the IUT removes the older packet(s) in the BC forwarding packet buffer and,
+             *          the IUT inserts the new received GBC packet at the end of the BC forwarding packet buffer (see note 2)
+             *      }
+             *  }
+             *  NOTE 1: The amount of stored data exceeds BC forwarding buffer capacity defined by the
+             *          itsGnBcForwardingPacketBufferSize MIB parameter
+             *  NOTE 2: Buffered packets will be delivered upon reception of Beacon message from ItsNodeB
+            *
+             * 
+ * + * @see ETSI TS 102 871-2 v1.4.1 TP/GEONW/CAP/FPB/BV-02 + * @reference EN 302 636-4-1 [1], clauses 7.5.3 + */ + testcase TC_GEONW_CAP_FPB_BV_02() runs on ItsMtc system ItsGeoNetworkingSystem { + + f_GEONW_CAP_FPB_BV_02(); + + } // End of testcase TC_GEONW_CAP_FPB_BV_02 + + } // End of group geoCapForwardingPacketBuffer + + } // End of group geoCapacities + +} // End of module ItsGeoNetworking_TestCases + diff --git a/ItsGeoNetworking_TestControl.ttcn b/ItsGeoNetworking_TestControl.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cc3c88329c0a5c2d5b337f2063122e0bec23584 --- /dev/null +++ b/ItsGeoNetworking_TestControl.ttcn @@ -0,0 +1,494 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 + * @version $URL$ + * $Id$ + * @desc Test Control file for GeoNetworking + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module ItsGeoNetworking_TestControl { + + // ATS GeoNetworking + import from ItsGeoNetworking_TestCases all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_Pics all; + import from LibItsGeoNetworking_TypesAndValues all; + + // Test Execution + control { + + /* FDV */ + + if(PICS_GN_BASIC_HEADER) { + execute(TC_GEONW_FDV_BAH_BV_01()); + execute(TC_GEONW_FDV_BAH_BI_02()); + } + + if(PICS_GN_COMMON_HEADER) { + execute(TC_GEONW_FDV_COH_BV_01()); + execute(TC_GEONW_FDV_COH_BV_02()); + execute(TC_GEONW_FDV_COH_BV_03()); + execute(TC_GEONW_FDV_COH_BO_04()); + } + + if(PICS_GN_BEACON_SRC) { + execute(TC_GEONW_FDV_BEA_BV_01()); + execute(TC_GEONW_FDV_BEA_BV_02()); + execute(TC_GEONW_FDV_BEA_BV_03()); + execute(TC_GEONW_FDV_BEA_BV_04()); + } + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_FDV_GUC_BV_01()); + } + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_FDV_GBC_BV_01()); + } + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_FDV_GAC_BV_01()); + } + + if(PICS_GN_SHB_SRC) { + execute(TC_GEONW_FDV_SHB_BV_01()); + } + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_FDV_TSB_BV_01()); + } + + /* PON/LOT */ + + if(PICS_GN_GUC_SRC and PICS_GN_BEACON_DST) { + execute(TC_GEONW_PON_LOT_BV_01()); + } + + if(PICS_GN_LS_REQ_SRC and PICS_GN_LS_REP_DST) { + execute(TC_GEONW_PON_LOT_BV_02()); + } + + if(PICS_GN_BEACON_DST) { + execute(TC_GEONW_PON_LOT_BV_03_01()); + } + + if(PICS_GN_GUC_DST) { + execute(TC_GEONW_PON_LOT_BV_03_02()); + } + + if(PICS_GN_GAC_DST) { + execute(TC_GEONW_PON_LOT_BV_03_03()); + } + + if(PICS_GN_GBC_DST) { + execute(TC_GEONW_PON_LOT_BV_03_04()); + } + + if(PICS_GN_TSB_DST) { + execute(TC_GEONW_PON_LOT_BV_03_05()); + } + + if(PICS_GN_SHB_DST) { + execute(TC_GEONW_PON_LOT_BV_03_06()); + } + + if(PICS_GN_LS_REQ_DST) { + execute(TC_GEONW_PON_LOT_BV_03_07()); + } + + if(PICS_GN_LS_REP_DST) { + execute(TC_GEONW_PON_LOT_BV_03_08()); + } + + if(PICS_GN_LS_REQ_SRC) { + execute(TC_GEONW_PON_LOT_BV_04()); + } + + if(PICS_GN_GUC_DST) { + execute(TC_GEONW_PON_LOT_BV_05_01()); + } + + if(PICS_GN_GAC_DST) { + execute(TC_GEONW_PON_LOT_BV_05_02()); + } + + if(PICS_GN_GBC_DST) { + execute(TC_GEONW_PON_LOT_BV_05_03()); + } + + if(PICS_GN_TSB_DST) { + execute(TC_GEONW_PON_LOT_BV_05_04()); + } + + if(PICS_GN_SHB_DST) { + execute(TC_GEONW_PON_LOT_BV_05_05()); + } + + if(PICS_GN_LS_REQ_DST) { + execute(TC_GEONW_PON_LOT_BV_05_06()); + } + + if(PICS_GN_LS_REP_DST) { + execute(TC_GEONW_PON_LOT_BV_05_07()); + } + + /* PON/LPV */ + + if(PICS_GN_BEACON_SRC) { + execute(TC_GEONW_PON_LPV_BV_01()); + } + + /* PON/SQN */ + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_SQN_BV_01()); + execute(TC_GEONW_PON_SQN_BV_02()); + } + + /* PON/LOS */ + + if(PICS_GN_LS_REQ_SRC) { + execute(TC_GEONW_PON_LOS_BV_01()); + execute(TC_GEONW_PON_LOS_BV_02()); + if(PICS_GN_LS_REP_DST) { + execute(TC_GEONW_PON_LOS_BV_03()); + execute(TC_GEONW_PON_LOS_BV_04()); + } + execute(TC_GEONW_PON_LOS_BV_05()); + } + + if(PICS_GN_LS_REQ_RETRANSMISSION) { + execute(TC_GEONW_PON_LOS_TI_06()); + execute(TC_GEONW_PON_LOS_BV_07()); + } + + if(PICS_GN_LS_REQ_DST) { + execute(TC_GEONW_PON_LOS_BV_08()); + execute(TC_GEONW_PON_LOS_BO_09()); + } + + if(PICS_GN_LS_FWD) { + execute(TC_GEONW_PON_LOS_BV_10()); + execute(TC_GEONW_PON_LOS_BV_11()); + } + + if(PICS_GN_LS_REQ_SRC) { + execute(TC_GEONW_PON_LOS_BV_12()); + execute(TC_GEONW_PON_LOS_BV_13()); + execute(TC_GEONW_PON_LOS_BV_14()); + execute(TC_GEONW_PON_LOS_BV_15()); + execute(TC_GEONW_PON_LOS_BV_16()); + execute(TC_GEONW_PON_LOS_BV_17()); + } + + /* PON/FPB */ + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_FPB_BV_01()); + execute(TC_GEONW_PON_FPB_BV_02()); + execute(TC_GEONW_PON_FPB_BV_03()); + execute(TC_GEONW_PON_FPB_BV_04()); + } + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_PON_FPB_BV_06()); + execute(TC_GEONW_PON_FPB_BV_07()); + execute(TC_GEONW_PON_FPB_BV_08()); + } + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_FPB_BV_09()); + } + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_PON_FPB_BV_10()); + } + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_FPB_BV_11_01()); + } + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_PON_FPB_BV_11_02()); + } + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_FPB_BV_11_03()); + } + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_PON_FPB_BV_11_04()); + } + + if(PICS_GN_SHB_SRC) { + execute(TC_GEONW_PON_FPB_BV_11_05()); + } + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_FPB_BV_12_01()); + } + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_PON_FPB_BV_12_02()); + } + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_FPB_BV_12_03()); + } + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_PON_FPB_BV_12_04()); + } + + /* PON/GNA */ + + if(PICS_GN_ADDR_AUTO) { + if (PICS_GN_LOCAL_ADDR_CONF_METHOD == e_auto) { + execute(TC_GEONW_PON_GNA_BV_01()); + } + } + + if(PICS_GN_DAD) { + execute(TC_GEONW_PON_GNA_BV_02()); + } + + /* PON/BEA */ + + if(PICS_GN_BEACON_SRC) { + execute(TC_GEONW_PON_BEA_TI_01()); + execute(TC_GEONW_PON_BEA_TI_02()); + } + + /* PON/GUC */ + if(PICS_GN_GUC) { + + if(PICS_GN_GUC_FWD) { + execute(TC_GEONW_PON_GUC_ALL_BV_03()); + execute(TC_GEONW_PON_GUC_ALL_BO_04()); + execute(TC_GEONW_PON_GUC_ALL_BV_06()); + } + + if(PICS_GN_GUC_DST) { + execute(TC_GEONW_PON_GUC_ALL_BV_05()); + execute(TC_GEONW_PON_GUC_ALL_BO_08()); + } + + if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) { + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_GUC_GRD_BV_01()); + } + + if(PICS_GN_GUC_FWD) { + execute(TC_GEONW_PON_GUC_GRD_BV_02()); + execute(TC_GEONW_PON_GUC_GRD_BO_07()); + } + } + + if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) { + + if(PICS_GN_GUC_SRC) { + execute(TC_GEONW_PON_GUC_CBF_BV_01()); + } + + if(PICS_GN_GUC_FWD) { + execute(TC_GEONW_PON_GUC_CBF_BV_02()); + execute(TC_GEONW_PON_GUC_CBF_BV_07()); + execute(TC_GEONW_PON_GUC_CBF_BV_20()); + execute(TC_GEONW_PON_GUC_CBF_BV_21()); + execute(TC_GEONW_PON_GUC_CBF_BV_22()); + } + } + + } + + /* PON/GBC */ + if(PICS_GN_GBC) { + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_03()); + execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_04()); + execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_06()); + execute(TC_GEONW_PON_GBC_NONAREA_ALL_BO_09()); + execute(TC_GEONW_PON_GBC_NONAREA_ALL_BO_10()); + } + + if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) { + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_GBC_NONAREA_GRD_BV_01()); + } + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_NONAREA_GRD_BV_02()); + execute(TC_GEONW_PON_GBC_NONAREA_GRD_BO_07()); + } + } + + if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) { + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_01()); + } + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_02()); + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_07()); + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_20()); + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_21()); + execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_22()); + } + } + + if(PICS_GN_GBC_SRC) { + execute(TC_GEONW_PON_GBC_AREA_ALL_BV_01()); + } + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_AREA_ALL_BV_03()); + execute(TC_GEONW_PON_GBC_AREA_ALL_BV_04()); + } + + if(PICS_GN_GBC_DST) { + execute(TC_GEONW_PON_GBC_AREA_ALL_BV_05()); + execute(TC_GEONW_PON_GBC_AREA_ALL_BO_08()); + } + + if((PICS_GN_AREA_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_AREA_FORWARDING_ALGORITHM == e_unspecified)) { + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_AREA_SMP_BV_02()); + execute(TC_GEONW_PON_GBC_AREA_SMP_BO_07()); + } + } + + if(PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf) { + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_AREA_CBF_BV_02()); + execute(TC_GEONW_PON_GBC_AREA_CBF_BV_07()); + execute(TC_GEONW_PON_GBC_AREA_CBF_BV_21()); + execute(TC_GEONW_PON_GBC_AREA_CBF_BV_22()); + } + } + + if(PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced) { + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_21()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_23()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_24()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_25()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_26()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_27()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_28()); + execute(TC_GEONW_PON_GBC_AREA_ADV_BV_29()); + } + } + } + + /* PON/TSB */ + if(PICS_GN_TSB) { + + if(PICS_GN_TSB_SRC) { + execute(TC_GEONW_PON_TSB_BV_01()); + } + + if(PICS_GN_TSB_FWD) { + execute(TC_GEONW_PON_TSB_BV_02()); + execute(TC_GEONW_PON_TSB_BV_03()); + execute(TC_GEONW_PON_TSB_BO_04()); + execute(TC_GEONW_PON_TSB_BO_07()); + } + + if(PICS_GN_TSB_DST) { + execute(TC_GEONW_PON_TSB_BV_05()); + execute(TC_GEONW_PON_TSB_BO_08()); + } + } + + /* PON/SHB */ + if(PICS_GN_SHB) { + + if(PICS_GN_SHB_SRC) { + execute(TC_GEONW_PON_SHB_BV_01()); + } + + if(PICS_GN_SHB_DST) { + execute(TC_GEONW_PON_SHB_BV_05()); + } + } + + /* PON/GAC */ + if(PICS_GN_GAC) { + + if(PICS_GN_GAC_FWD) { + execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_03()); + execute(TC_GEONW_PON_GAC_NONAREA_ALL_BO_04()); + execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_06()); + execute(TC_GEONW_PON_GAC_NONAREA_ALL_BO_09()); + execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_10()); + } + + if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) { + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_PON_GAC_NONAREA_GRD_BV_01()); + } + + if(PICS_GN_GAC_FWD) { + execute(TC_GEONW_PON_GAC_NONAREA_GRD_BV_02()); + execute(TC_GEONW_PON_GAC_NONAREA_GRD_BO_07()); + } + } + + if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) { + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_01()); + } + + if(PICS_GN_GAC_FWD) { + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_02()); + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_07()); + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_20()); + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_21()); + execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_22()); + } + } + + if(PICS_GN_GAC_SRC) { + execute(TC_GEONW_PON_GAC_AREA_ALL_BV_01()); + } + + if(PICS_GN_GAC_FWD) { + execute(TC_GEONW_PON_GAC_AREA_ALL_BV_02()); + } + + if(PICS_GN_GAC_DST) { + execute(TC_GEONW_PON_GAC_AREA_ALL_BV_05()); + execute(TC_GEONW_PON_GAC_AREA_ALL_BO_08()); + } + } + + /* CAP */ + + if(PICS_GN_LS_REQ_SRC) { + execute(TC_GEONW_CAP_LOS_BV_01()); + } + + if(PICS_GN_GUC_FWD) { + execute(TC_GEONW_CAP_FPB_BV_01()); + } + + if(PICS_GN_GBC_FWD) { + execute(TC_GEONW_CAP_FPB_BV_02()); + } + + } + +} // End of module ItsGeoNetworking_TestControl diff --git a/ItsGeoNetworking_TpFunctions.ttcn b/ItsGeoNetworking_TpFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccb186c0a2bfb1aa5f189d82c17dcb80fc145f19 --- /dev/null +++ b/ItsGeoNetworking_TpFunctions.ttcn @@ -0,0 +1,17107 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF525 + * @version $Url: https://oldforge.etsi.org/svn/ITS/tags/20170222_STF527_Final/ttcn/AtsGeoNetworking/ItsGeoNetworking_TpFunctions.ttcn $ + * $Id: ItsGeoNetworking_TpFunctions.ttcn,v 1.5 2019/08/05 15:18:56 dte Exp $ + * @desc GeoNetworking TP Functions + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module ItsGeoNetworking_TpFunctions { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibItsCommon + import from LibItsCommon_Functions all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; + import from LibItsGeoNetworking_Functions all; + import from LibItsGeoNetworking_Templates all; + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_Pics all; + import from LibItsGeoNetworking_Pixits all; + + // 6.2.1 + group geoFormatingAndDataValidity { + + // 6.2.1.1 + group geoFdvBasicHeader { + + /** + * @desc TP Function for TC_GEONW_FDV_BAH_BV_01 + */ + function f_GEONW_FDV_BAH_BV_01() runs on ItsGeoNetworking { + + // Local variables + + // Test control + if (not PICS_GN_BASIC_HEADER) { + log("*** " & testcasename() & ": PICS_GN_BASIC_HEADER required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // 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 { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket(?, ?), -, f_getDefaultHopLimit()))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Basic Header correctly formatted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BAH_BV_01 + + /** + * @desc TP Function for TC_GEONW_FDV_BAH_BI_02 + */ + function f_GEONW_FDV_BAH_BI_02() runs on ItsGeoNetworking { + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + + // Test control + if (not PICS_GN_BASIC_HEADER) { + log("*** " & testcasename() & ": PICS_GN_BASIC_HEADER required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu(m_geoNwShbPacket(v_longPosVectorNodeB)); + + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_gnPacket))); + + f_sleep(PX_TAC); + + if(0 < 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 + v_gnPacket.basicHeader.version := valueof(v_gnPacket.basicHeader.version) + 1; + + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_gnPacket))); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was discarded and not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BAH_BI_02 + + } // end geoFdvBasicHeader + + // 6.2.1.2 + group geoFdvCommonHeader { + + /** + * @desc TP Function for TC_GEONW_FDV_COH_BV_01 + */ + function f_GEONW_FDV_COH_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_COMMON_HEADER) { + log("*** " & testcasename() & ": PICS_GN_COMMON_HEADER required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Common Header correclty formatted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + f_acTriggerEvent(m_stopPassBeaconing); + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_COH_BV_01 + + /** + * @desc TP Function for TC_GEONW_FDV_COH_BV_02 + */ + function f_GEONW_FDV_COH_BV_02() runs on ItsGeoNetworking { + + // Local variables + var GeoNetworkingInd v_geoNwInd; + var octetstring v_payload := char2oct("PAYLOAD"); + + // Test control + if (not PICS_GN_COMMON_HEADER) { + log("*** " & testcasename() & ": PICS_GN_COMMON_HEADER required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateShbMessageWithPayload(v_payload)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwShbPacket))) -> value v_geoNwInd { + tc_ac.stop; + if(ispresent(v_geoNwInd.msgIn.gnPacket.packet.payload)) { + if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload)) { + log("*** " & testcasename() & ": PASS: PL field correctly indicates payload size ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: PL does correctly not indicate payload size (" + & int2str(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength) + & " != " + & int2str(lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload)) + & ")***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + else { + if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == 0) { + log("*** " & testcasename() & ": PASS: PL field correctly indicates empty payload ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: PL does not indicate empty payload ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_COH_BV_02 + + /** + * @desc TP Function for TC_GEONW_FDV_COH_BV_03 + */ + function f_GEONW_FDV_COH_BV_03( + in template (present) UInt8 p_hopLimit := f_getDefaultHopLimit(), + in template (present) Bit8 p_flags := f_isMobile() + ) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_COMMON_HEADER) { + log("*** " & testcasename() & ": PICS_GN_COMMON_HEADER required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // 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 { + + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithHlAndFlags(mw_longPosVectorPosition(v_longPosVectorIut), ?, p_hopLimit, p_flags)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Correct GeoNetworking Common Header received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoBroadcast(mw_longPosVectorPosition(v_longPosVectorIut), ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Incorrect GeoNetworking Common Header received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_COH_BV_03 + + group GEONW_FDV_COH_BO_04 { + + /** + * @desc TP Function for TC_GEONW_FDV_COH_BO_04 + */ + function f_GEONW_FDV_COH_BO_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_COMMON_HEADER) { + log("*** " & testcasename() & ": PICS_GN_COMMON_HEADER 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_FDV_COH_BO_04_nodeB()); + v_nodeD.start(f_GEONW_FDV_COH_BO_04_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_FDV_COH_BV_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_FDV_COH_BV_04) + */ + function f_GEONW_FDV_COH_BO_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var UInt8 v_hopLimit := f_getDefaultHopLimit(); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB, + v_hopLimit-1 + ), + -, + v_hopLimit + ) + ) + )); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: TSB packet was not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: TSB was correctly discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_FDV_COH_BO_04_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_FDV_COH_BV_04) + */ + function f_GEONW_FDV_COH_BO_04_nodeD() 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_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: TSB packet was not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: TSB was correctly discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_FDV_COH_BO_04_nodeD + + } // end GEONW_FDV_COH_BO_04 + + } // end geoFdvCommonHeader + + // 6.2.1.3 + group geoFdvBeacon { + + /** + * @desc TP Function for TC_GEONW_FDV_BEA_BV_01 + */ + function f_GEONW_FDV_BEA_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition(v_longPosVectorIut), e_any)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Common Header correclty formatted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BEA_BV_01 + + /** + * @desc TP Function for TC_GEONW_FDV_BEA_BV_02 + */ + function f_GEONW_FDV_BEA_BV_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket( + mw_longPosVectorAny(f_getIutGnLocalAddress()))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GN address correctly received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BEA_BV_02 + + /** + * @desc TP Function for TC_GEONW_FDV_BEA_BV_03 + */ + function f_GEONW_FDV_BEA_BV_03() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition(v_longPosVectorIut))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Position equaling GN-MNGT primitive value received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BEA_BV_03 + + /** + * @desc TP Function for TC_GEONW_FDV_BEA_BV_04 + */ + function f_GEONW_FDV_BEA_BV_04() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition(v_longPosVectorIut))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Timestamp equaling GN-MNGT primitive value received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_BEA_BV_04 + + } // end geoFdvBeacon + + // 6.2.1.4 + group geoFdvGeoUnicast { + + /** + * @desc TP Function for TC_GEONW_FDV_GUC_BV_01 + */ + function f_GEONW_FDV_GUC_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_GUC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + v_longPosVectorIut := f_getPosition(c_compIut); + 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_geoNwUnicastPacketWithSourcePv( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), // DEPV + ?, // sequence number + mw_longPosVectorPosition(v_longPosVectorIut) //SOPV + ) + ) + ) + ) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: Fields of the received GUC message correctly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GUC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_GUC_BV_01 + + } // end geoFdvGeoUnicast + + // 6.2.1.5 + group geoFdvGeoBroadcast { + + /** + * @desc TP Function for TC_GEONW_FDV_GBC_BV_01 + */ + function f_GEONW_FDV_GBC_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + var octetstring v_payload := char2oct("PAYLOAD"); + + // 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_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorIut := f_getPosition(c_compIut); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoBroadcastMessageWithPayload(f_getArea(c_area1), v_payload)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + f_receiveGeoNetMessageWithPayload( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), // SOPV + ? // sequence number + ) + ) + ), + ? + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Fields of the received GBC message correctly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_GBC_BV_01 + + } // end geoFdvGeoBroadcast + + // 6.2.1.6 + group geoFdvGeoAnycast { + + /** + * @desc TP Function for TC_GEONW_FDV_GAC_BV_01 + */ + function f_GEONW_FDV_GAC_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var octetstring v_payload := char2oct("PAYLOAD"); + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorIut := f_getPosition(c_compIut); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoAnycastMessageWithPayload(f_getArea(c_area1), v_payload)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + f_receiveGeoNetMessageWithPayload( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), // SOPV + ? // sequence number + ) + ) + ), + ? + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Fields of the received GAC message correctly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_GAC_BV_01 + + } // end geoFdvGeoAnycast + + // 6.2.1.7 + group geoFdvSingleHopBroadcast { + + /** + * @desc TP Function for TC_GEONW_FDV_SHB_BV_01 + */ + function f_GEONW_FDV_SHB_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_SHB_SRC) { + log("*** " & testcasename() & ": PICS_GN_SHB_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorIut := f_getPosition(c_compIut); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateShbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwShbPacket( + mw_longPosVectorPosition(v_longPosVectorIut), // SOPV + 1 //MHL + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Fields of the received SHB message correctly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: SHB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_SHB_BV_01 + + } // end geoFdvSingleHopBroadcast + + // 6.2.1.8 + group geoFdvTopologicallyScopedBroadcast { + + /** + * @desc TP Function for TC_GEONW_FDV_TSB_BV_01 + */ + function f_GEONW_FDV_TSB_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_TSB_SRC) { + log("*** " & testcasename() & ": PICS_GN_TSB_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorIut := f_getPosition(c_compIut); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateTsbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, // sequence number + mw_longPosVectorPosition(v_longPosVectorIut) // SOPV + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: message received with correct common and extended headers ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_FDV_TSB_BV_01 + + } // end geoFdvTopologicallyScopedBroadcast + + } // end geoFormatingAndDataValidity + + // 6.2.2 + group geoProtocolOperation { + + // 6.2.2.1 + group geoLocationTable { + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_01 + */ + function f_GEONW_PON_LOT_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + + // Test control + if (not PICS_GN_GUC_SRC or not PICS_GN_BEACON_DST) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC and PICS_GN_BEACON_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // 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 { + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GUC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoUnicastWithDestination(?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GUC packet has some inconsistence ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveAnyLsRequest() { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Received Location Service Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": TIMEOUT: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOT_BV_01 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_02 + */ + function f_GEONW_PON_LOT_BV_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + var GN_Address v_gnAddressNodeA; + var boolean v_lsRequestReceived := false; + + // Test control + if (not PICS_GN_LS_REQ_SRC or not PICS_GN_LS_REP_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC AND PICS_GN_LS_REP_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_gnAddressNodeA := v_longPosVectorNodeA.gnAddr; + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequestAndReply( + ?, v_gnAddressNodeA.mid, + v_longPosVectorNodeA + ) { + v_lsRequestReceived := true; + log("*** " & testcasename() & ": Pre-conditions: Received and answered Location Service Request ***"); + repeat; + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + tc_ac.stop; + if(v_lsRequestReceived == true) { + log("*** " & testcasename() & ": Pre-conditions: First GUC message received correctly ***"); + } + else { + log("*** " & testcasename() & ": Pre-conditions: GUC packet received without LS Request ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Pre-conditions: Initial conditions not satisfied. ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_gnAddressNodeA.mid, v_longPosVectorIut) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Received Location Service Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Received second GUC packet without LS Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOT_BV_02 + + group GEONW_PON_LOT_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_01 + */ + function f_GEONW_PON_LOT_BV_03_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeB); + + // Test control + if (not PICS_GN_BEACON_DST) { + log("*** " & testcasename() & ": PICS_GN_BEACON_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwBeaconPacket( + v_longPosVectorNode + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_01 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_02 + */ + function f_GEONW_PON_LOT_BV_03_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_GUC_DST) { + log("*** " & testcasename() & ": PICS_GN_GUC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwUnicastPacket( + v_longPosVectorNode, + f_getIutShortPosVector(), + vc_localSeqNumber + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_02 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_03 + */ + function f_GEONW_PON_LOT_BV_03_03() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_GAC_DST) { + log("*** " & testcasename() & ": PICS_GN_GAC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwAnycastPacket( + v_longPosVectorNode, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_03 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_04 + */ + function f_GEONW_PON_LOT_BV_03_04() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_GBC_DST) { + log("*** " & testcasename() & ": PICS_GN_GBC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwBroadcastPacket( + v_longPosVectorNode, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_04 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_05 + */ + function f_GEONW_PON_LOT_BV_03_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_TSB_DST) { + log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNode + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_05 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_06 + */ + function f_GEONW_PON_LOT_BV_03_06() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeB); + + // Test control + if (not PICS_GN_SHB_DST) { + log("*** " & testcasename() & ": PICS_GN_SHB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwShbPacket( + v_longPosVectorNode + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_06 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_07 + */ + function f_GEONW_PON_LOT_BV_03_07() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_LS_REQ_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + activate(a_receiveAnyLsReply()); + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwLsRequestPacket( + v_longPosVectorNode, + vc_localSeqNumber, + f_getIutGnLocalAddress() + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_07 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_03_08 + */ + function f_GEONW_PON_LOT_BV_03_08() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNode := f_TP_GEONW_PON_LOT_BV_03_pre_1(c_compNodeA); + + // Test control + if (not PICS_GN_LS_REP_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REP_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_03_pre_2( + m_geoNwLsReplyPacket( + v_longPosVectorNode, + f_getIutShortPosVector(), + vc_localSeqNumber + ) + ); + + f_TP_GEONW_PON_LOT_BV_03_main(v_longPosVectorNode); + + } // End of function f_GEONW_PON_LOT_BV_03_08 + + /** + * @desc Function including first preamble part (TC_GEONW_PON_LOT_BV_03) + */ + function f_TP_GEONW_PON_LOT_BV_03_pre_1(in charstring p_nodeName) runs on ItsGeoNetworking return LongPosVector { + + // Local variables + var LongPosVector v_longPosVectorNode; + + // Test control + + // Test component configuration + f_cf01Up(); + v_longPosVectorNode := f_getPosition(p_nodeName); + + // Test adapter configuration + + // Preamble part I + if(p_nodeName == c_compNodeA) { + f_prNeighbour(); + } + else { + f_prNonNeighbour(); + } + + return v_longPosVectorNode; + } // End of function f_TP_GEONW_PON_LOT_BV_03_pre_1 + + /** + * @desc Function including second preamble part (TC_GEONW_PON_LOT_BV_03) + */ + function f_TP_GEONW_PON_LOT_BV_03_pre_2(in template (value) GnNonSecuredPacket p_packet) runs on ItsGeoNetworking { + + //preamble part II + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(p_packet, -, c_hopLimit1))) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } // End of function f_TP_GEONW_PON_LOT_BV_03_pre_2 + + /** + * @desc Function including test body and postamble part (TC_GEONW_PON_LOT_BV_03) + */ + function f_TP_GEONW_PON_LOT_BV_03_main(in template (value) LongPosVector p_longPosVectorNode) runs on ItsGeoNetworking { + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(valueof(p_longPosVectorNode.gnAddr))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveAnyLsRequest() { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Received Location Service Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_longPosVectorNode)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GUC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_TP_GEONW_PON_LOT_BV_03_main + + } //end GEONW_PON_LOT_BV_03 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_04 + */ + function f_GEONW_PON_LOT_BV_04() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prDefault(); // NodeB will send Beacon only once + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(m_geoNwBeaconPacket(v_longPosVectorNodeB), -, c_hopLimit1)))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(f_getLifetimeLocTableEntry() + PX_T_DELTA); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeB.gnAddr.mid, v_longPosVectorIut ) { + log("*** " & testcasename() & ": PASS: LS Request received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOT_BV_04 + + group GEONW_PON_LOT_BV_05 { + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_01 + */ + function f_GEONW_PON_LOT_BV_05_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_GUC_DST) { + log("*** " & testcasename() & ": PICS_GN_GUC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwUnicastPacket( + v_obsoleteLongPosVectorNodeB, + f_getIutShortPosVector(), + vc_localSeqNumber + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_01 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_02 + */ + function f_GEONW_PON_LOT_BV_05_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_GAC_DST) { + log("*** " & testcasename() & ": PICS_GN_GAC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwAnycastPacket( + v_obsoleteLongPosVectorNodeB, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_02 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_03 + */ + function f_GEONW_PON_LOT_BV_05_03() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_GBC_DST) { + log("*** " & testcasename() & ": PICS_GN_GBC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwBroadcastPacket( + v_obsoleteLongPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_03 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_04 + */ + function f_GEONW_PON_LOT_BV_05_04() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_TSB_DST) { + log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_obsoleteLongPosVectorNodeB + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_04 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_05 + */ + function f_GEONW_PON_LOT_BV_05_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_SHB_DST) { + log("*** " & testcasename() & ": PICS_GN_SHB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwShbPacket( + v_obsoleteLongPosVectorNodeB + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_05 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_06 + */ + function f_GEONW_PON_LOT_BV_05_06() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_LS_REQ_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + activate(a_receiveAnyLsReply()); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwLsRequestPacket( + v_obsoleteLongPosVectorNodeB, + vc_localSeqNumber, + f_getIutGnLocalAddress() + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_06 + + /** + * @desc TP Function for TC_GEONW_PON_LOT_BV_05_07 + */ + function f_GEONW_PON_LOT_BV_05_07() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_obsoleteLongPosVectorNodeB; + + // Test control + if (not PICS_GN_LS_REQ_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + f_TP_GEONW_PON_LOT_BV_05_pre_2( + m_geoNwLsReplyPacket( + v_obsoleteLongPosVectorNodeB, + f_getIutShortPosVector(), + vc_localSeqNumber + ) + ); + + f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB); + + } // End of function f_GEONW_PON_LOT_BV_05_07 + + /** + * @desc Function including first preamble part (TC_GEONW_PON_LOT_BV_05) + */ + function f_TP_GEONW_PON_LOT_BV_05_pre_1(out LongPosVector p_longPosVectorNodeB, out LongPosVector p_obsoleteLongPosVectorNodeB) runs on ItsGeoNetworking { + + // Local variables + + // Test control + + // Test component configuration + f_cf01Up(); + p_longPosVectorNodeB := f_getPosition(c_compNodeB); + p_obsoleteLongPosVectorNodeB := p_longPosVectorNodeB; + p_obsoleteLongPosVectorNodeB.timestamp_ := p_obsoleteLongPosVectorNodeB.timestamp_ - 1000; + p_obsoleteLongPosVectorNodeB.latitude := p_obsoleteLongPosVectorNodeB.latitude - (PX_POS_DELTA * 3); + + // Test adapter configuration + + // Preamble + f_prDefault(); + + // Act as a neighbor and send one beacon + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(m_geoNwBeaconPacket(p_longPosVectorNodeB), -, c_hopLimit1)))); + } // End of function f_TP_GEONW_PON_LOT_BV_05_pre_1 + + /** + * @desc Function including second preamble part (TC_GEONW_PON_LOT_BV_05) + */ + function f_TP_GEONW_PON_LOT_BV_05_pre_2(in template (value) GnNonSecuredPacket p_packet) runs on ItsGeoNetworking { + + //preamble part II + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(p_packet))) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } // End of function f_TP_GEONW_PON_LOT_BV_05_pre_2 + + /** + * @desc Function including test body and postamble part (TC_GEONW_PON_LOT_BV_05) + */ + function f_TP_GEONW_PON_LOT_BV_05_main(in template (value) LongPosVector p_longPosVectorNodeB, in template (value) LongPosVector p_obsoleteLongPosVectorNodeB) runs on ItsGeoNetworking { + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(valueof(p_longPosVectorNodeB.gnAddr)))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveAnyLsRequest() { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Received Location Service Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_obsoleteLongPosVectorNodeB)))) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GN packet received with obsolete Destination Position Vector ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_longPosVectorNodeB)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GN packet packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_TP_GEONW_PON_LOT_BV_05_main + + } // end group GEONW_PON_LOT_BV_05 + + } // end geoLocationTable + + // 6.2.2.2 + group geoLocalPositionVector { + + /** + * @desc TP Function for TC_GEONW_PON_LPV_BV_01 + */ + function f_GEONW_PON_LPV_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var template LongPosVector v_previouslongPosVectorIut; + var GeoNetworkingInd v_geoNwInd; + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up();//FIXME ac change position, not used by C2C + v_longPosVectorIut := f_getPosition(c_compIut); + v_previouslongPosVectorIut := v_longPosVectorIut; + v_previouslongPosVectorIut.timestamp_ := ?; + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwBeaconPacket( + mw_longPosVectorAny(v_longPosVectorIut.gnAddr) + ) + ))) -> value v_geoNwInd { + tc_ac.stop; + log("*** " & testcasename() & ": Pre-conditions: Beacon received ***"); + v_longPosVectorIut := v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.beaconHeader.srcPosVector; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + f_utChangePosition(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + geoNetworkingPort.clear; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwBeaconPacket( + mw_longPosVectorAny(v_longPosVectorIut.gnAddr) + ) + ))) -> value v_geoNwInd { + tc_ac.stop; + //check if the position vector has changed + if (match(v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.beaconHeader.srcPosVector, v_previouslongPosVectorIut)) { + log("*** " & testcasename() & ": FAIL: Sender Postion Vector not correctly updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Sender Postion Vector correctly updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + f_acTriggerEvent(m_stopPassBeaconing); + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LPV_BV_01 + + } // end geoLocalPositionVector + + // 6.2.2.3 + group geoSequenceNumber { + + /** + * @desc TP Function for TC_GEONW_PON_SQN_BV_01 + */ + function f_GEONW_PON_SQN_BV_01() runs on ItsGeoNetworking { + + // Local variables + var UInt16 v_expectedSequenceNumber := 0; + var LongPosVector v_longPosVectorIut; + + // 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_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // 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_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorIut), + v_expectedSequenceNumber) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorIut), + v_expectedSequenceNumber) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received with incorrect sequence number ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_SQN_BV_01 + + /** + * @desc TP Function for TC_GEONW_PON_SQN_BV_02 + */ + function f_GEONW_PON_SQN_BV_02() runs on ItsGeoNetworking { + + // Local variables + var UInt16 v_expectedSequenceNumber := 0; + var integer v_nbReceivedPackets := 0; + var GeoNetworkingInd v_geoNwInd; + var LongPosVector v_longPosVectorIut; + + // 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_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_sleep(10.0); + // receive first packet + if ( not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ? + )))) -> value v_geoNwInd { + tc_ac.stop; + log("*** " & testcasename() & ": Pre-conditions: First GUC packet received ***"); + v_expectedSequenceNumber := v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.geoBroadcastHeader.seqNumber + 1; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + 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_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorIut), + v_expectedSequenceNumber) { + tc_ac.stop; + v_nbReceivedPackets := v_nbReceivedPackets + 1; + if(v_nbReceivedPackets >= vc_multipleMessagesCount) { + log("*** " & testcasename() & ": PASS: GBC packets received with correct sequence numbers ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + v_expectedSequenceNumber := v_expectedSequenceNumber + 1; + if ( not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + repeat; + } + } + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorIut), + ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received with incorrect sequence number ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_SQN_BV_02 + + } // end geoSequenceNumber + + // 6.2.2.4 + group geoLocationService { + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_01 + */ + function f_GEONW_PON_LOS_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var GN_Address v_gnAddressNodeA; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_gnAddressNodeA := f_getPosition(c_compNodeA).gnAddr; + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_gnAddressNodeA)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveLsRequest( + ?, + v_gnAddressNodeA.mid, + v_longPosVectorIut + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: LS Request received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveAnyLsRequest() { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: LS Request does not contain GN Address of nodeA ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_01 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_02 + */ + function f_GEONW_PON_LOS_BV_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var GN_Address v_gnAddressNodeA; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_gnAddressNodeA := f_getPosition(c_compNodeA).gnAddr; + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_gnAddressNodeA)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_gnAddressNodeA.mid, v_longPosVectorIut) { + tc_ac.stop; + //start retransmission timer + tc_ac.start(f_getLsRetransmitTimer() - f_getDeltaTimer()); + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_gnAddressNodeA)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + alt { + [] a_receiveLsRequest(?, v_gnAddressNodeA.mid, v_longPosVectorIut) { + tc_ac.stop; + log("*** " & testcasename() & ": Second LS_REQUEST received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": No second LS_REQUEST received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_02 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_03 + */ + function f_GEONW_PON_LOS_BV_03() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorIut; + var GeoNetworkingInd v_geoNetInd; + + // Test control + if (not PICS_GN_LS_REQ_SRC or not PICS_GN_LS_REP_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC AND PICS_GN_LS_REP_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + + tc_ac.start; + alt { + + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ) + ) -> value v_geoNetInd { + tc_ac.stop; + //we only check that the lifetime is less than the default lifetime due to + //we do not know exactly the time passed at IUT + if (f_getLifetimeValue(v_geoNetInd.msgIn.basicHeader.lifeTime) v_maxNbrRetrans) { + //first LS request is not counted as a retransmission + log("*** " & testcasename() & ": LS_REQUEST retransmitted more than itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + tc_ac.start; + repeat; + } + } + [] tc_ac.timeout { + if(v_nbLsReceived == (v_maxNbrRetrans)) { + //first LS request is not counted as a retransmission + log("*** " & testcasename() & ": LS_REQUEST retransmitted itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": LS_REQUEST retransmitted less than itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_07 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_08 + */ + function f_GEONW_PON_LOS_BV_08() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorIut; + var GN_Address v_iutGnAddress; + var UInt16 v_seqNbr := vc_localSeqNumber; + var FncRetCode v_ret := e_error; + + // Test control + if (not PICS_GN_LS_REQ_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_iutGnAddress := f_getPosition(c_compIut).gnAddr; + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_ret := f_processLocationService(v_longPosVectorNodeA, v_seqNbr, v_iutGnAddress, v_longPosVectorIut); + if (v_ret == e_success) { + log("*** " & testcasename() & ": LS_REPLY packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": LS_REPLY packet not received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_08 + + group GEONW_PON_LOS_BO_09 { + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BO_09 + */ + function f_GEONW_PON_LOS_BO_09() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_LS_REQ_DST) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_DST 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_LOS_BO_09_nodeB()); + v_nodeD.start(f_GEONW_PON_LOS_BO_09_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_LOS_BO_09 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_LOS_BO_09) + */ + function f_GEONW_PON_LOS_BO_09_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var FncRetCode v_ret := e_error; + + // Preamble + f_prNeighbour(); + v_ret := f_processLocationService( + v_longPosVectorNodeB, + vc_localSeqNumber, + v_longPosVectorIut.gnAddr, + v_longPosVectorIut); + if (v_ret == e_error) { + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + else { + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: LS_REQUEST has not been discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: LS_REQUEST discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BO_09_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_LOS_BO_09) + */ + function f_GEONW_PON_LOS_BO_09_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GN_Address v_iutGnAddress := f_getPosition(c_compIut).gnAddr; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + v_iutGnAddress + ) + ) + ) + )); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: LS_REQUEST has not been discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: LS_REQUEST discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BO_09_nodeD + + } // end GEONW_PON_LOS_BO_09 + + group GEONW_PON_LOS_BV_10 { + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_10 + */ + function f_GEONW_PON_LOS_BV_10() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_LS_FWD) { + log("*** " & testcasename() & ": PICS_GN_LS_FWD 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_LOS_BV_10_nodeB()); + v_nodeC.start(f_GEONW_PON_LOS_BV_10_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_LOS_BV_10 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_LOS_BV_10) + */ + function f_GEONW_PON_LOS_BV_10_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 + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsRequestPacket( + ?, + v_longPosVectorNodeB.gnAddr.mid + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Re-broadcasted LS Request received with HL field decreased by 1 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: LS Request was not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BV_10_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_LOS_BV_10) + */ + function f_GEONW_PON_LOS_BV_10_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + f_getPosition(c_compNodeA), + vc_localSeqNumber, + f_getPosition(c_compNodeB).gnAddr + ), + -, + c_defaultHopLimit + ) + ) + )); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BV_10_nodeC + + } // end GEONW_PON_LOS_BV_10 + + group GEONW_PON_LOS_BV_11 { + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_11 + */ + function f_GEONW_PON_LOS_BV_11() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_LS_FWD) { + log("*** " & testcasename() & ": PICS_GN_LS_FWD 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_LOS_BV_11_nodeB()); + v_nodeC.start(f_GEONW_PON_LOS_BV_11_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_LOS_BV_11 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_LOS_BV_11) + */ + function f_GEONW_PON_LOS_BV_11_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + 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_geoNwLsReplyPacket( + mw_longPosVectorPosition(v_longPosVectorNodeA), + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)) + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + log("*** " & testcasename() & ": PASS: Forwarded LS Reply received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: LS Reply was not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BV_11_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_LOS_BV_11) + */ + function f_GEONW_PON_LOS_BV_11_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsReplyPacket( + f_getPosition(c_compNodeA), + f_longPosVector2ShortPosVector(f_getPosition(c_compNodeB)), + vc_localSeqNumber + ), + -, + c_defaultHopLimit + ) + ) + )); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_LOS_BV_11_nodeC + + } // end GEONW_PON_LOS_BV_11 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_12 + */ + function f_GEONW_PON_LOS_BV_12() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorIut; + var UInt16 v_seqNbr := vc_localSeqNumber; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + + tc_ac.start; + alt { + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GUC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_12 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_13 + */ + function f_GEONW_PON_LOS_BV_13() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorIut; + var integer v_lt1 := f_getLsMaxRetrans()*float2int(f_getLsRetransmitTimer()); + var integer v_lt2 := float2int(int2float(v_lt1)/2.0); + var octetstring v_payload1 := char2oct("PAYLOAD_1"); + var octetstring v_payload2 := char2oct("PAYLOAD_2"); + var boolean v_msg1Received := false; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + + if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetimeWithPayload(v_longPosVectorNodeA.gnAddr, v_lt2*1000, v_payload2)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetimeWithPayload(v_longPosVectorNodeA.gnAddr, v_lt1*1000, v_payload1)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + //Send LS-REPLY after LT2 expiry + f_sleepIgnoreDef(int2float(v_lt2)); + + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + log("*** " & testcasename() & ": INFO: LS Request retransmission ignored ***"); + repeat; + } + [] geoNetworkingPort.receive( + f_receiveGeoNetMessageWithPayload( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ), + v_payload1 + ) + ) { + v_msg1Received := true; + repeat; + } + [] geoNetworkingPort.receive( + f_receiveGeoNetMessageWithPayload( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ), + v_payload2 + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: message with elapsed lifetime received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + if(v_msg1Received == true) { + log("*** " & testcasename() & ": PASS: message with running lifetime received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: message with running lifetime not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_13 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_13 + */ + function f_GEONW_PON_LOS_BV_14() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorIut; + var integer v_maxNbrRetrans := f_getLsMaxRetrans(); + var integer v_nbLsReceived := 0; + var UInt16 v_LT1; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + v_LT1 := float2int(int2float(v_maxNbrRetrans + 2) * f_getLsRetransmitTimer() * 1000.0); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetime(v_longPosVectorNodeA.gnAddr,v_LT1)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + + tc_wait.start(int2float(v_LT1)); + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + v_nbLsReceived := v_nbLsReceived + 1; + if(v_nbLsReceived > v_maxNbrRetrans) { + //first LS request is not counted as a retransmission + log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted more than itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + else { + tc_ac.start; + repeat; + } + } + [] tc_ac.timeout { + if(v_nbLsReceived == (v_maxNbrRetrans)) { + //first LS request is not counted as a retransmission + log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + else { + log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted less than itsGnLocationServiceMaxRetrans times ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + } + } + + // Test Body + if (tc_wait.running) { + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + tc_wait.stop; + + tc_noac.start; + alt { + // no check for ItsNodeA address as no other trigger for messages exists + [] geoNetworkingPort.receive { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message was sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + } + else { + log("*** " & testcasename() & ": FAIL: LT1 expired ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_14 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_15 + */ + function f_GEONW_PON_LOS_BV_15() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorNodeB), + vc_localSeqNumber + ) + ) + ) + )); + + tc_ac.start; + alt { + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GUC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_15 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_16 + */ + function f_GEONW_PON_LOS_BV_16() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + + tc_noac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: LS Request retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + log("*** " & testcasename() & ": INFO: GUC packet received ***"); + repeat; + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: LS Request not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_16 + + /** + * @desc TP Function for TC_GEONW_PON_LOS_BV_17 + */ + function f_GEONW_PON_LOS_BV_17() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorNodeB), + vc_localSeqNumber + ) + ) + ) + )); + + tc_noac.start; + alt { + [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: LS Request retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) { + log("*** " & testcasename() & ": INFO: GUC packet received ***"); + repeat; + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: LS Request not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_LOS_BV_17 + + } // end geoLocationService + + // 6.2.2.5 + group geoForwardingPacketBuffer { + + group GEONW_PON_FPB_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_01 + */ + function f_GEONW_PON_FPB_BV_01() 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; + } + + // 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_FPB_BV_01_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_01_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_01) + */ + function f_GEONW_PON_FPB_BV_01_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleepIgnoreDef(1.0); + f_startBeingNeighbour(); + + tc_ac.start; + alt { + [] a_receiveAnyLsRequest() { + tc_ac.stop; + log("*** " & testcasename() & ": INCONC: Received Location Service Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: packet correctly forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_01_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_01) + */ + function f_GEONW_PON_FPB_BV_01_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNeighbour(); + + // Make sure IUT has LocE for NodeA by sending unsolicited LS_REPLY + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + )))); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + // /!\ This pre-condition has impact on test body + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GUC packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_01_nodeC + + } // end GEONW_PON_FPB_BV_01 + + group GEONW_PON_FPB_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_02 + */ + function f_GEONW_PON_FPB_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var UInt16 c_sequenceNumberC := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GUC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC 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_FPB_BV_02_nodeB(c_sequenceNumberC)); + v_nodeC.start(f_GEONW_PON_FPB_BV_02_nodeC(c_sequenceNumberC)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_02) + */ + function f_GEONW_PON_FPB_BV_02_nodeB(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + vc_localSeqNumber := p_sequenceNumberC; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(1.0); + f_startBeingNeighbour(); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + vc_localSeqNumber + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Packet correctly forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_02) + */ + function f_GEONW_PON_FPB_BV_02_nodeC(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + vc_localSeqNumber := p_sequenceNumberC; + + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeC, + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + vc_localSeqNumber + ), + -, + c_defaultHopLimit + ) + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_02_nodeC + + } // end GEONW_PON_FPB_BV_02 + + group GEONW_PON_FPB_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_03 + */ + function f_GEONW_PON_FPB_BV_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var UInt16 c_sequenceNumberC := f_getInitialSequenceNumber(); + const integer c_messageCount := 2; + + // Test control + if (not PICS_GN_GUC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC 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_FPB_BV_03_nodeB(c_sequenceNumberC, c_messageCount)); + v_nodeC.start(f_GEONW_PON_FPB_BV_03_nodeC(c_sequenceNumberC, c_messageCount)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_03) + */ + function f_GEONW_PON_FPB_BV_03_nodeB(in UInt16 p_sequenceNumberC, in integer p_messageCount) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var UInt16 v_expectedSequenceNumber := p_sequenceNumberC; + var integer v_nbReceivedPackets := 0; + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + vc_multipleMessagesCount := p_messageCount; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(1.0); + f_startBeingNeighbour(); + + tc_ac.start; + alt { + [] a_receiveGeoUnicast( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + v_expectedSequenceNumber) { + tc_ac.stop; + v_nbReceivedPackets := v_nbReceivedPackets + 1; + if(v_nbReceivedPackets >= vc_multipleMessagesCount) { + log("*** " & testcasename() & ": PASS: GUC packets received in correct order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + v_expectedSequenceNumber := v_expectedSequenceNumber + 1; + tc_ac.start; + repeat; + } + } + [] a_receiveGeoUnicast( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GUC packet received in incorrect order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_03) + */ + function f_GEONW_PON_FPB_BV_03_nodeC(in UInt16 p_sequenceNumberC, in integer p_messageCount) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var integer i := 0; + + // Preamble + f_prNeighbour(); + vc_localSeqNumber := p_sequenceNumberC; + vc_multipleMessagesCount := p_messageCount; + + for(i:=0; i < vc_multipleMessagesCount; i:=i+1) { + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeC, + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + vc_localSeqNumber + ) + ) + ) + )); + } + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_03_nodeC + + } // end GEONW_PON_FPB_BV_03 + + group GEONW_PON_FPB_BV_04 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_04 + */ + function f_GEONW_PON_FPB_BV_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + const UInt6 c_packetLifetime := 10; // 10s + + // Test control + if (not PICS_GN_GUC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC 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_FPB_BV_04_nodeB(c_packetLifetime)); + v_nodeC.start(f_GEONW_PON_FPB_BV_04_nodeC(c_packetLifetime)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_04) + */ + function f_GEONW_PON_FPB_BV_04_nodeB(in UInt6 p_packetLifetime) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(int2float(p_packetLifetime + 1)); + f_startBeingNeighbour(); + + tc_noac.start; + alt { + [] a_receiveGeoUnicast( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ?) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GUC packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_04) + */ + function f_GEONW_PON_FPB_BV_04_nodeC(in UInt6 p_packetLifetime) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwUnicastPacket( + v_longPosVectorNodeC, + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + vc_localSeqNumber + ), + m_lifetimeBase1s(p_packetLifetime), + c_defaultHopLimit + ) + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_04_nodeC + + } // end GEONW_PON_FPB_BV_04 + + group GEONW_PON_FPB_BV_06 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_06 + */ + function f_GEONW_PON_FPB_BV_06() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + + // 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_FPB_BV_06_nodeB()); + v_nodeD.start(f_GEONW_PON_FPB_BV_06_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_FPB_BV_06 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_06) + */ + function f_GEONW_PON_FPB_BV_06_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GeoNetworkingInd v_geoNetInd; + + // Preamble + f_prDefault(); + if (not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(1.0); + f_startBeingNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) -> value v_geoNetInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_06_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_FPB_BV_06) + */ + function f_GEONW_PON_FPB_BV_06_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GeoNetworkingInd v_geoNetInd; + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) -> value v_geoNetInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_06_nodeD + + } // end GEONW_PON_FPB_BV_06 + + group GEONW_PON_FPB_BV_07 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_07 + */ + function f_GEONW_PON_FPB_BV_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + const integer v_messageCount := 2; + + // Test control + + // 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_FPB_BV_07_nodeB(v_messageCount)); + v_nodeD.start(f_GEONW_PON_FPB_BV_07_nodeD(v_messageCount)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_FPB_BV_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_07) + */ + function f_GEONW_PON_FPB_BV_07_nodeB(in integer p_messageCount) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GeoNetworkingInd v_geoNetInd; + var template (present) UInt16 v_expectedSequenceNumber := ?; + var integer v_nbReceivedPackets := 0; + var integer i := 0; + + // Preamble + f_prDefault(); + vc_multipleMessagesCount := p_messageCount; + for(i:=0; i < vc_multipleMessagesCount; i:=i+1) { + if(not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + tc_ac.start(1.0); + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": INCONC: GBC packet not buffered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": PASS: GBC packet buffered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + } + + // Test Body + f_startBeingNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + v_expectedSequenceNumber)))) -> value v_geoNetInd { + tc_ac.stop; + v_nbReceivedPackets := v_nbReceivedPackets + 1; + if(v_nbReceivedPackets >= vc_multipleMessagesCount) { + log("*** " & testcasename() & ": PASS: GBC packets received in correct order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + v_expectedSequenceNumber := v_geoNetInd.msgIn.gnPacket.packet.extendedHeader.geoBroadcastHeader.seqNumber + 1; + tc_ac.start; + repeat; + } + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received in incorrect order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_07_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_FPB_BV_07) + */ + function f_GEONW_PON_FPB_BV_07_nodeD(in integer p_messageCount) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GeoNetworkingInd v_geoNetInd; + var template (present) UInt16 v_expectedSequenceNumber := ?; + var integer v_nbReceivedPackets := 0; + + // Preamble + f_prDefault(); + vc_multipleMessagesCount := p_messageCount; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + v_expectedSequenceNumber)))) -> value v_geoNetInd { + tc_ac.stop; + v_nbReceivedPackets := v_nbReceivedPackets + 1; + if(v_nbReceivedPackets >= vc_multipleMessagesCount) { + log("*** " & testcasename() & ": PASS: GBC packets received in correct order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + v_expectedSequenceNumber := v_geoNetInd.msgIn.gnPacket.packet.extendedHeader.geoBroadcastHeader.seqNumber + 1; + tc_ac.start; + repeat; + } + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received in incorrect order ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_07_nodeD + + } // end GEONW_PON_FPB_BV_07 + + group GEONW_PON_FPB_BV_08 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_08 + */ + function f_GEONW_PON_FPB_BV_08() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + + // 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_FPB_BV_08_nodeB()); + v_nodeD.start(f_GEONW_PON_FPB_BV_08_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_FPB_BV_08 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_08) + */ + function f_GEONW_PON_FPB_BV_08_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prDefault(); + if(not f_utTriggerEvent(m_generateGeoBroadcastMessageWithLifetime(f_getArea(c_area1), c_lifetime )) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + if(not f_utTriggerEvent(m_generateGeoBroadcastMessageWithLifetime(f_getArea(c_area1), c_lifetime)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(int2float(c_defaultLifetime + 1)); + f_startBeingNeighbour(); + + tc_noac.start; + alt { + + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_08_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_FPB_BV_08) + */ + function f_GEONW_PON_FPB_BV_08_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(int2float(c_defaultLifetime + 1)); + f_startBeingNeighbour(); + + tc_noac.start; + alt { + + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_08_nodeD + + } // end GEONW_PON_FPB_BV_08 + + group GEONW_PON_FPB_BV_09 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_09 + */ + function f_GEONW_PON_FPB_BV_09() 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; + } + + // 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_FPB_BV_09_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_09_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_09 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_09) + */ + function f_GEONW_PON_FPB_BV_09_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var GeoNetworkingInd v_geoNetInd; + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(1.0); + f_startBeingNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ?)))) -> value v_geoNetInd { + tc_ac.stop; + + //we only check that the lifetime is less than the default lifetime due to + //we do not know exactly the time passed at IUT + if (f_getLifetimeValue(v_geoNetInd.msgIn.basicHeader.lifeTime) < f_getMaxPacketLifeTime()) { + log("*** " & testcasename() & ": PASS: Lifetime was handled properly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: Lifetime was not handled properly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_09_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_09) + */ + function f_GEONW_PON_FPB_BV_09_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNeighbour(); + + // Make sure IUT has LocE for NodeA by sending unsolicited LS_REPLY + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + )))); + + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_09_nodeC + + } // end GEONW_PON_FPB_BV_09 + + group GEONW_PON_FPB_BV_10 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_10 + */ + function f_GEONW_PON_FPB_BV_10() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + + // 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_FPB_BV_10_nodeB()); + v_nodeD.start(f_GEONW_PON_FPB_BV_10_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_FPB_BV_10 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_10) + */ + function f_GEONW_PON_FPB_BV_10_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var GeoNetworkingInd v_geoNetInd; + + // Preamble + f_prDefault(); + if(not f_utTriggerEvent(m_generateGeoBroadcastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sleep(1.0); + f_startBeingNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) -> value v_geoNetInd { + tc_ac.stop; + + //we only check that the lifetime is less than the default lifetime due to + //we do not know exactly the time passed at IUT + if (f_getLifetimeValue(v_geoNetInd.msgIn.basicHeader.lifeTime) < f_getMaxPacketLifeTime()) { + log("*** " & testcasename() & ": PASS: Lifetime was handled properly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: Lifetime was not handled properly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_FPB_BV_10_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_FPB_BV_10) + */ + function f_GEONW_PON_FPB_BV_10_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ?)))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_10_nodeD + + } // end GEONW_PON_FPB_BV_10 + + group GEONW_PON_FPB_BV_11 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_11_01 + */ + function f_GEONW_PON_FPB_BV_11_01() 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; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_11_01_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_11_01_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_11_01) + */ + function f_GEONW_PON_FPB_BV_11_01_nodeB() runs on ItsGeoNetworking { + + // Local variablesa + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_01_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_11_01) + */ + function f_GEONW_PON_FPB_BV_11_01_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + // Make sure IUT has LocE for NodeA by sending unsolicited LS_REPLY + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + )))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if(not f_utTriggerEvent(m_generateGeoUnicastMessageWithTrafficClass( + v_longPosVectorNodeA.gnAddr, + valueof(m_trafficClass(e_scfDisabled))))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_01_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_11_02 + */ + function f_GEONW_PON_FPB_BV_11_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_11_02_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_11_02_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_11_02) + */ + function f_GEONW_PON_FPB_BV_11_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_11_02) + */ + function f_GEONW_PON_FPB_BV_11_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if(not f_utTriggerEvent(m_generateGeoAnycastMessageWithTrafficClass( + f_getArea(c_area2), + valueof(m_trafficClass(e_scfDisabled))))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_02_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_11_03 + */ + function f_GEONW_PON_FPB_BV_11_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // 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_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_11_03_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_11_03_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_11_03) + */ + function f_GEONW_PON_FPB_BV_11_03_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_11_03) + */ + function f_GEONW_PON_FPB_BV_11_03_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if(not f_utTriggerEvent(m_generateGeoBroadcastMessageWithTrafficClass( + f_getArea(c_area2), + valueof(m_trafficClass(e_scfDisabled))))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorIut), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_03_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_11_04 + */ + function f_GEONW_PON_FPB_BV_11_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_TSB_SRC) { + log("*** " & testcasename() & ": PICS_GN_TSB_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_11_04_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_11_04_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_11_04) + */ + function f_GEONW_PON_FPB_BV_11_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorIut) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_11_04) + */ + function f_GEONW_PON_FPB_BV_11_04_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if(not f_utTriggerEvent(valueof(m_generateTsbMessageWithTrafficClass(valueof(m_trafficClass(e_scfDisabled)))))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorIut) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_04_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_11_05 + */ + function f_GEONW_PON_FPB_BV_11_05() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_TSB_SRC) { + log("*** " & testcasename() & ": PICS_GN_TSB_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_11_05_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_11_05_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_05 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_11_05) + */ + function f_GEONW_PON_FPB_BV_11_05_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwShbPacket( + mw_longPosVectorPosition(v_longPosVectorIut) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_05_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_11_05) + */ + function f_GEONW_PON_FPB_BV_11_05_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if(not f_utTriggerEvent(valueof(m_generateShbMessageWithTrafficClass(valueof(m_trafficClass(e_scfDisabled)))))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwShbPacket( + mw_longPosVectorPosition(v_longPosVectorIut) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_05_nodeC + + } // end GEONW_PON_FPB_BV_11 + + group GEONW_PON_FPB_BV_12 { + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_12_01 + */ + function f_GEONW_PON_FPB_BV_12_01() 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; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_12_01_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_12_01_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_12_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_12_01) + */ + function f_GEONW_PON_FPB_BV_12_01_nodeB() runs on ItsGeoNetworking { + + // Local variablesa + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_01_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_12_01) + */ + function f_GEONW_PON_FPB_BV_12_01_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeC), + f_longPosVector2ShortPosVector(f_getPosition(c_compNodeA)), + vc_localSeqNumber, + -, + m_trafficClass(e_scfDisabled) + ), + -, + c_defaultHopLimit + ), + -, + f_getIutMacAddress() + ) + )); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_01_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_12_02 + */ + function f_GEONW_PON_FPB_BV_12_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_12_02_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_12_02_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_12_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_12_02) + */ + function f_GEONW_PON_FPB_BV_12_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacket( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_12_02) + */ + function f_GEONW_PON_FPB_BV_12_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2), + -, + m_trafficClass(e_scfDisabled) + ) + ) + ) + )); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacket( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_02_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_12_02 + */ + function f_GEONW_PON_FPB_BV_12_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // 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_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_12_03_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_12_03_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_12_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_12_03) + */ + function f_GEONW_PON_FPB_BV_12_03_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_12_03) + */ + function f_GEONW_PON_FPB_BV_12_03_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2), + -, + m_trafficClass(e_scfDisabled) + ) + ) + ) + )); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwBroadcastPacket( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_11_03_nodeC + + /** + * @desc TP Function for TC_GEONW_PON_FPB_BV_12_04 + */ + function f_GEONW_PON_FPB_BV_12_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_TSB_SRC) { + log("*** " & testcasename() & ": PICS_GN_TSB_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_FPB_BV_12_04_nodeB()); + v_nodeC.start(f_GEONW_PON_FPB_BV_12_04_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_FPB_BV_11_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_FPB_BV_12_04) + */ + function f_GEONW_PON_FPB_BV_12_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeC) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_FPB_BV_12_04) + */ + function f_GEONW_PON_FPB_BV_12_04_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeC, + c_defaultHopLimit, + m_trafficClass(e_scfDisabled) + ), + -, + c_defaultHopLimit + ) + ) + )); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeC) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: TSB not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_FPB_BV_12_04_nodeC + + } // end GEONW_PON_FPB_BV_12 + + } // end geoForwardingPacketBuffer + + // 6.2.2.6 + group geoGeoNetworkingAddress { + + /** + * @desc TP Function for TC_GEONW_PON_GNA_BV_01 + */ + function f_GEONW_PON_GNA_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + + // Test control + if (not PICS_GN_ADDR_AUTO) { + log("*** " & testcasename() & ": PICS_GN_ADDR_AUTO required for executing the TC ***"); + setverdict(inconc); + stop; + } + + if(f_getIutGnLocalAddressConfigurationMethod() != e_auto) { + log("*** " & testcasename() & ": PICS_GN_LOCAL_ADDR_CONF_METHOD == e_auto required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwBeaconPacket( + mw_longPosVectorAny(f_getIutGnLocalAddress()) // IUT's SOPV + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": GN address is correct ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwBeaconPacket( + ? // any SOPV + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": GN address is not correct ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GNA_BV_01 + + /** + * @desc TP Function for TC_GEONW_PON_GNA_BV_02 + */ + function f_GEONW_PON_GNA_BV_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var LongPosVector v_longPosVectorNodeB; + var GeoNetworkingInd v_geoNetInd; + var GN_Address v_iutGnAddress := valueof(m_dummyGnAddr); + + // Test control + if (not PICS_GN_DAD) { + log("*** " & testcasename() & ": PICS_GN_DAD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_prNeighbour(); + if ( not f_utTriggerEvent(m_generateShbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwShbPacket( + ? // SO PV + )))) -> value v_geoNetInd { + v_iutGnAddress := valueof(v_geoNetInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.gnAddr); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_longPosVectorNodeB.gnAddr := v_iutGnAddress; + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(m_geoNwShbPacket(v_longPosVectorNodeB), -, c_hopLimit1)))); + + f_sleep(0.5); + + if ( not f_utTriggerEvent(m_generateShbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwShbPacket( + mw_longPosVectorAny(v_iutGnAddress) // SO PV + )))) { + log("*** " & testcasename() & ": IUT is still using old GN address. Waiting... ***"); + repeat; + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( + mw_geoNwShbPacket( + ? // SO PV + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": IUT used new GN address ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GNA_BV_02 + + } // end geoGeoNetworkingAddress + + // 6.2.2.7 + group geoBeaconing { + + /** + * @desc TP Function for TC_GEONW_PON_BEA_TI_01 + */ + function f_GEONW_PON_BEA_TI_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorIut; + var boolean v_beaconReceived := false; + timer t_minRetransTimer := f_getBsRetransmitTimer(); + timer t_maxRetransTimer := f_getBsRetransmitTimer() + f_getBsMaxJitter(); + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + + t_maxRetransTimer.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(?)))) { + if (v_beaconReceived == false) { + v_beaconReceived := true; + t_minRetransTimer.start; + t_maxRetransTimer.start; + //after the first beacon received, check the retransmission + repeat; + } + if(t_minRetransTimer.running) { + log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too early) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": Beacon transmitted at prescribed periodicity ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minRetransTimer.timeout { + log("*** " & testcasename() & ": Ready for retransmission ***"); + repeat; + } + [] t_maxRetransTimer.timeout { + log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too late) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + f_acTriggerEvent(m_stopPassBeaconing); + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_BEA_TI_01 + + /** + * @desc TP Function for TC_GEONW_PON_BEA_TI_02 + */ + function f_GEONW_PON_BEA_TI_02() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + var boolean v_geoUnicastReceived := false; + var boolean v_readyForRetransmission := false; + timer t_minRetransTimer := f_getBsRetransmitTimer() - f_getDeltaTimer(); + timer t_maxRetransTimer := f_getBsRetransmitTimer() + f_getBsMaxJitter() + f_getDeltaTimer(); + + // Test control + if (not PICS_GN_BEACON_SRC) { + log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + v_longPosVectorIut := f_getPosition(c_compIut); + + // Test adapter configuration + f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + if ( not f_utTriggerEvent(m_generateShbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwShbPacket))) { + tc_ac.stop; + t_minRetransTimer.start; + t_maxRetransTimer.start; + v_geoUnicastReceived := true; + repeat; + } + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket))) { + if(not(v_geoUnicastReceived)) { + repeat; + } + if(not(v_readyForRetransmission)) { + log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too early) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": Beacon transmitted at prescribed periodicity ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minRetransTimer.timeout { + log("*** " & testcasename() & ": Ready for retransmission ***"); + v_readyForRetransmission := true; + repeat; + } + [] t_maxRetransTimer.timeout { + log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too late) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": GUC not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + f_acTriggerEvent(m_stopPassBeaconing); + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_BEA_TI_02 + + } // end geoBeaconing + + // 6.2.2.8 + group geoGeoUnicast { + + group gucAllForwardingAlgorithm { + + + group GEONW_PON_GUC_ALL_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_ALL_BV_03 + */ + function f_GEONW_PON_GUC_ALL_BV_03() 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; + } + + // 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_ALL_BV_03_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_ALL_BV_03_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_ALL_BV_03) + */ + function f_GEONW_PON_GUC_ALL_BV_03_nodeB() 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( + v_longPosVectorNodeA, + f_longPosVector2ShortPosVector(f_getPosition(c_compIut)), + vc_localSeqNumber + ) + ), + -, + f_getIutMacAddress() + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacketWithHl( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ?, + c_defaultHopLimit + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Forwarded GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + ?, + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Fields not correctly updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_ALL_BV_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_ALL_BV_03) + */ + function f_GEONW_PON_GUC_ALL_BV_03_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_obsoleteLongPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + v_obsoleteLongPosVectorNodeA.timestamp_ := v_obsoleteLongPosVectorNodeA.timestamp_ - 1000; + v_obsoleteLongPosVectorNodeA.latitude := v_obsoleteLongPosVectorNodeA.latitude - 1; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeC), + f_longPosVector2ShortPosVector(v_obsoleteLongPosVectorNodeA), + vc_localSeqNumber, + c_defaultHopLimit + ), + -, + c_defaultHopLimit + ), + -, + f_getIutMacAddress() + ) + ); + + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_ALL_BV_03_nodeC + + } // end GEONW_PON_GUC_ALL_BV_03 + + group GEONW_PON_GUC_ALL_BO_04 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_ALL_BO_04 + */ + function f_GEONW_PON_GUC_ALL_BO_04() 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; + } + + // 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_ALL_BO_04_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_ALL_BO_04_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_BO_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_ALL_BO_04) + */ + function f_GEONW_PON_GUC_ALL_BO_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + 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: Retransmitted GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GUC was not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_ALL_BO_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_ALL_BO_04) + */ + function f_GEONW_PON_GUC_ALL_BO_04_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeC), + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + vc_localSeqNumber + ), + -, + 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: Retransmitted GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GUC was not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_ALL_BO_04_nodeC + + } // end GEONW_PON_GUC_ALL_BO_04 + + /** + * @desc TP Function for TC_GEONW_PON_GUC_ALL_BV_05 + */ + function f_GEONW_PON_GUC_ALL_BV_05() runs on ItsGeoNetworking { + + // Local variables + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GUC_DST) { + log("*** " & testcasename() & ": PICS_GN_GUC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeB), + f_getIutShortPosVector(), + vc_localSeqNumber + ) + ); + f_sendGeoNetMessage(m_geoNwReq_withLinkLayerDestination(v_gnPacket, -, f_getIutMacAddress())); + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GUC_ALL_BV_05 + + /** + * @desc TP Function for TC_GEONW_PON_GUC_ALL_BV_06 + */ + function f_GEONW_PON_GUC_ALL_BV_06() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GUC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeB), + f_longPosVector2ShortPosVector(v_longPosVectorNodeA), + vc_localSeqNumber + ) + ); + f_sendGeoNetMessage(m_geoNwReq_withLinkLayerDestination(v_gnPacket, -, f_getIutMacAddress())); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GUC_ALL_BV_06 + + group GEONW_PON_GUC_ALL_BO_08 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_ALL_BO_08 + */ + function f_GEONW_PON_GUC_ALL_BO_08() 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; + } + + // 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_ALL_BO_08_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_ALL_BO_08_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_ALL_BO_08 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_ALL_BO_08) + */ + function f_GEONW_PON_GUC_ALL_BO_08_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 + ); + + // Preamble + f_prNeighbour(); + f_sleep(PX_TAC); + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); 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())); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_ALL_BO_08_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_ALL_BO_08) + */ + function f_GEONW_PON_GUC_ALL_BO_08_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 of function f_GEONW_PON_GUC_ALL_BO_08_nodeC + + } // end GEONW_PON_GUC_ALL_BO_08 + + } // end gucAllForwardingAlgorithm + + group gucGreedyForwarding { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_GRD_BV_01 + */ + function f_GEONW_PON_GUC_GRD_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + + // Test control + if (not PICS_GN_GUC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GUC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == (e_greedy or e_unspecified) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // 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() & ": DEPV of the received GUC message correctly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + ?, + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": DEPV of the received GUC message incorrectly set ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GUC_GRD_BV_01 + + group GEONW_PON_GUC_GRD_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_GRD_BV_02 + */ + function f_GEONW_PON_GUC_GRD_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GUC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == (e_greedy or e_unspecified) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GUC_GRD_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_GRD_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GUC_GRD_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GUC_GRD_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_GRD_BV_02) + */ + function f_GEONW_PON_GUC_GRD_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // 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_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 of function f_GEONW_PON_GUC_GRD_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_GRD_BV_02) + */ + function f_GEONW_PON_GUC_GRD_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu( + m_geoNwUnicastPacket( + f_getPosition(c_compNodeC), + f_longPosVector2ShortPosVector(f_getPosition(c_compNodeA)), + vc_localSeqNumber + ), + -, + c_defaultHopLimit + ), + -, + f_getIutMacAddress() + ) + ); + + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_GRD_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GUC_GRD_BV_02) + */ + function f_GEONW_PON_GUC_GRD_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_GRD_BV_02_nodeD + + } // end GEONW_PON_GUC_GRD_BV_02 + + group GEONW_PON_GUC_GRD_BO_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_GRD_BO_07 + */ + function f_GEONW_PON_GUC_GRD_BO_07() 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_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_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_GRD_BO_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_GRD_BO_07_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_GRD_BO_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_GRD_BO_07) + */ + function f_GEONW_PON_GUC_GRD_BO_07_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 of function f_GEONW_PON_GUC_GRD_BO_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_GRD_BO_07) + */ + function f_GEONW_PON_GUC_GRD_BO_07_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 of function f_GEONW_PON_GUC_GRD_BO_07_nodeC + + } // end GEONW_PON_GUC_GRD_BO_07 + + } // end gucGreedyForwarding + + group gucContentionBasedForwarding { + + group GEONW_PON_GUC_CBF_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_01 + */ + function f_GEONW_PON_GUC_CBF_BV_01() 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_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_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_CBF_BV_01_nodeB()); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_01_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_01) + */ + function f_GEONW_PON_GUC_CBF_BV_01_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 of function f_GEONW_PON_GUC_CBF_BV_01_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_01) + */ + function f_GEONW_PON_GUC_CBF_BV_01_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 of function f_GEONW_PON_GUC_CBF_BV_01_nodeC + + } // end GEONW_PON_GUC_CBF_BV_01 + + group GEONW_PON_GUC_CBF_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_02 + */ + function f_GEONW_PON_GUC_CBF_BV_02() 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_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_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_CBF_BV_02_nodeB(v_distance, v_longPosVectorNodeA)); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_02_nodeC(v_longPosVectorNodeA)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_02) + * @param p_distanceToNodeA Distance between IUT and NodeA + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_02_nodeB(in float p_distanceToNodeA, in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * p_distanceToNodeA) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + t_toCbf.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)), + ? + ) + ) + ) + ) { + tc_ac.stop; + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Forwarded GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_02) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_02_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + 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() + ) + ); + 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: Re-broadcasted GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_02_nodeC + + } // end GEONW_PON_GUC_CBF_BV_02 + + group GEONW_PON_GUC_CBF_BV_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_07 + */ + function f_GEONW_PON_GUC_CBF_BV_07() 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_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_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_CBF_BV_07_nodeB(v_longPosVectorNodeA)); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_07_nodeC(v_longPosVectorNodeA)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_07) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_07_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_getCbfMaxTime())/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 of function f_GEONW_PON_GUC_CBF_BV_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_07) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_07_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 of function f_GEONW_PON_GUC_CBF_BV_07_nodeC + + } // end GEONW_PON_GUC_CBF_BV_07 + + group GEONW_PON_GUC_CBF_BV_20 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_20 + */ + function f_GEONW_PON_GUC_CBF_BV_20() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var float v_distance := int2float(f_getCbfMaxCommunicationRange() * 2); + var LongPosVector v_longPosVectorIut, v_longPosVectorNodeC; + + // Test control + if (not PICS_GN_GUC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(); + // re-compute NodeC's position. + v_longPosVectorIut := f_getIutLongPosVector(); + v_longPosVectorNodeC := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 180); + v_longPosVectorNodeC.gnAddr := f_getTsGnLocalAddress(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_GUC_CBF_BV_20_nodeB(v_longPosVectorNodeC)); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_20_nodeC(v_longPosVectorNodeC)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_20 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GUC_CBF_BV_20_nodeB(in LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + timer t_toCbf := int2float(f_getCbfMinTime()) / 1000.0; + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + t_toCbf.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ) + ) { + tc_ac.stop; + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Forwarded GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***"); + repeat; + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_20_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GUC_CBF_BV_20_nodeC(LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu( + m_geoNwUnicastPacket( + p_longPosVectorNodeC, + f_longPosVector2ShortPosVector(v_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(v_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 of function f_GEONW_PON_GUC_CBF_BV_20_nodeC + + } // end GEONW_PON_GUC_CBF_BV_20 + + group GEONW_PON_GUC_CBF_BV_21 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_21 + */ + function f_GEONW_PON_GUC_CBF_BV_21() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + 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_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + // 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_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GUC_CBF_BV_21_nodeB(v_longPosVectorNodeA)); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_21_nodeC(v_longPosVectorNodeA)); + v_nodeD.start(f_GEONW_PON_GUC_CBF_BV_21_nodeD(v_longPosVectorNodeA)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_21 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_21) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_21_nodeB(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + + // 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(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 of function f_GEONW_PON_GUC_CBF_BV_21_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_21) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_21_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + + // 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(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 of function f_GEONW_PON_GUC_CBF_BV_21_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GUC_CBF_BV_21) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_21_nodeD(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNonNeighbour(); + 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() + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)), + ? + ) + ) + ) + ) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GUC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GUC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: GUC timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_21_nodeD + + } // end GEONW_PON_GUC_CBF_BV_21 + + group GEONW_PON_GUC_CBF_BV_22 { + + /** + * @desc TP Function for TC_GEONW_PON_GUC_CBF_BV_22 + */ + function f_GEONW_PON_GUC_CBF_BV_22() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + 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_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + // 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_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GUC_CBF_BV_22_nodeB(v_longPosVectorNodeA)); + v_nodeC.start(f_GEONW_PON_GUC_CBF_BV_22_nodeC(v_longPosVectorNodeA)); + v_nodeD.start(f_GEONW_PON_GUC_CBF_BV_22_nodeD(v_longPosVectorNodeA)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_22 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GUC_CBF_BV_22) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_22_nodeB(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + + // 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(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 of function f_GEONW_PON_GUC_CBF_BV_22_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GUC_CBF_BV_22) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_22_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + + // 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(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 of function f_GEONW_PON_GUC_CBF_BV_22_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GUC_CBF_BV_22) + * @param p_longPosVectorNodeA Position vector of NodeA + */ + function f_GEONW_PON_GUC_CBF_BV_22_nodeD(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + v_longPosVectorNodeD.pai := int2bit(0,1); + f_changePositon(c_compNodeD, v_longPosVectorNodeD); + f_prNeighbour(); + 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() + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)), + ? + ) + ) + ) + ) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GUC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GUC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: GUC timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GUC_CBF_BV_22_nodeD + + } // end GEONW_PON_GUC_CBF_BV_22 + + } // end gucContentionBasedForwarding + + } // end geoGeoUnicast + + // 6.2.2.9 + group geoGeoBroadcast { + + group gbcNonAreaForwarding { + + group gbcNonAreaAllForwardingAlgorithm { + + group GEONW_PON_GBC_NONAREA_ALL_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_ALL_BV_03 + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD 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_GBC_NONAREA_ALL_BV_03_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_ALL_BV_03_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_ALL_BV_03) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_03_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2), + c_defaultHopLimit - 1, + c_defaultHopLimit) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message correctly retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoBroadcastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2), + ?, + ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC message fields not updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_ALL_BV_03) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_03_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2), + c_defaultHopLimit + ), + -, + c_defaultHopLimit + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_03_nodeC + + } // end GEONW_PON_GBC_NONAREA_ALL_BV_03 + + group GEONW_PON_GBC_NONAREA_ALL_BV_04 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_ALL_BV_04 + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD 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_GBC_NONAREA_ALL_BV_04_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_ALL_BV_04_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_ALL_BV_04) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_ALL_BV_04) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_04_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ), + -, + c_hopLimit1 + ) + ) + ); + + tc_noac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_04_nodeC + + } // end GEONW_PON_GBC_NONAREA_ALL_BV_04 + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_ALL_BV_06 + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BV_06() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was NOT transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BV_06 + + group GEONW_PON_GBC_NONAREA_ALL_BO_09 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_ALL_BO_09 + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_09() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_distanceTooBig; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + v_distanceTooBig := float2int(1.1 * f_radiusFromCircularArea(f_getGnMaxAreaSize()*c_squareKm)); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeB(v_distanceTooBig)); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeC(v_distanceTooBig)); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeD(v_distanceTooBig)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_09 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_BO_19) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeB(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_getPosition(c_compNodeB), + p_distanceTooBig + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_geoArea2GeoBroadcastArea(v_areaTooBig) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_ALL_BO_09) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeC(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_getPosition(c_compNodeB), + p_distanceTooBig + ); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_geoArea2GeoBroadcastArea(v_areaTooBig) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_ALL_BO_09) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeD(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_getPosition(c_compNodeB), + p_distanceTooBig + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_geoArea2GeoBroadcastArea(v_areaTooBig) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_09_nodeD + + } // end GEONW_PON_GBC_NONAREA_ALL_BO_09 + + group GEONW_PON_GBC_NONAREA_ALL_BO_10 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_ALL_BO_10 + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_10() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_10 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_ALL_BO_10) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeB() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_ALL_BO_10) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_ALL_BO_10) + */ + function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeD, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_ALL_BO_10_nodeD + + } // end GEONW_PON_GBC_NONAREA_ALL_BO_10 + + } // end gbcNonAreaAllForwardingAlgorithm + + group gbcNonAreaGreedyForwarding { + + group GEONW_PON_GBC_NONAREA_GRD_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_GRD_BV_01 + */ + function f_GEONW_PON_GBC_NONAREA_GRD_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; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy 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_NONAREA_GRD_BV_02_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_GRD_BV_01) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_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_area2))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + 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 of function f_GEONW_PON_GBC_NONAREA_GRD_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_GRD_BV_01) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_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_noac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoBroadcastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: received GBC message ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BV_01_nodeD + + } // end GEONW_PON_GBC_NONAREA_GRD_BV_01 + + group GEONW_PON_GBC_NONAREA_GRD_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_GRD_BV_02 + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy or e_unspecified ) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message correctly forwarded to area center ***"); + 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 of function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message not forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BV_02_nodeD + + } // end GEONW_PON_GBC_NONAREA_GRD_BV_02 + + group GEONW_PON_GBC_NONAREA_GRD_BO_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_GRD_BO_07 + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BO_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_sequenceNumber := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy or e_unspecified ) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeC(v_sequenceNumber)); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeD(v_sequenceNumber)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BO_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoNetworkingInd v_msgInd; + var template GeoNetworkingInd v_msgInd_t; + + // Preamble + f_prNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: GBC message correctly forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + v_msgInd_t := v_msgInd; + v_msgInd_t.msgIn.basicHeader.routerHopLimit := ?; + tc_noac.start; + alt { + [] geoNetworkingPort.receive(v_msgInd_t) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeC(in UInt16 p_sequenceNumber) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumber, + f_getGeoBroadcastArea(c_area2) + ), + -, + c_defaultHopLimit + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeD(in UInt16 p_sequenceNumber) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": INCONC: Pre-conditions: GBC message not forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: Pre-conditions: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + } + + // Test Body + // send geoBroadcast for second time (same source + same seq Nr + lower RHL) + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumber, + f_getGeoBroadcastArea(c_area2) + ), + -, + c_defaultHopLimit - 1 + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC re-forwarded! (not to area center!) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_GRD_BO_07_nodeD + + } // end GEONW_PON_GBC_NONAREA_GRD_BO_07 + + } // end gbcNonAreaGreedyForwarding + + group gbcNonAreaContentionBasedForwarding { + + group GEONW_PON_GBC_NONAREA_CBF_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_01 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_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; + } + if ((f_getNonAreaForwardingAlgorithm() != e_cbf)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_cbf ) 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_NONAREA_CBF_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_01) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_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_area2))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + 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 of function f_GEONW_PON_GBC_NONAREA_CBF_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_CBF_BV_01) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_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( + 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 of function f_GEONW_PON_GBC_NONAREA_CBF_BV_01_nodeD + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_01 + + group GEONW_PON_GBC_NONAREA_CBF_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_02 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeC, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_02_nodeD + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_02 + + group GEONW_PON_GBC_NONAREA_CBF_BV_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_07 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_sequenceNumberC := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeC(v_sequenceNumberC)); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeD(v_sequenceNumberC)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeC(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_07_nodeD(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_071_nodeD + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_07 + + group GEONW_PON_GBC_NONAREA_CBF_BV_20 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_20 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_20() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var float v_distance := int2float(f_getCbfMaxCommunicationRange() * 2); + var LongPosVector v_longPosVectorIut, v_longPosVectorNodeC; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(); + // re-compute NodeC's position. + v_longPosVectorIut := f_getIutLongPosVector(); + v_longPosVectorNodeC := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 180); + v_longPosVectorNodeC.gnAddr := f_getTsGnLocalAddress(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeB(v_longPosVectorNodeC)); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeC(v_longPosVectorNodeC)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_20 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeB(in LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + timer t_toCbf := int2float(f_getCbfMinTime()) / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + t_toCbf.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(p_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Forwarded GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***"); + repeat; + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeC(LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + p_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(p_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + 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 of function f_GEONW_PON_GBC_NONAREA_CBF_BV_20_nodeC + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_20 + + group GEONW_PON_GBC_NONAREA_CBF_BV_21 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_21 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_21() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_21 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_21_nodeD + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_21 + + group GEONW_PON_GBC_NONAREA_CBF_BV_22 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_NONAREA_CBF_BV_22 + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_22() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_22 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + v_longPosVectorNodeC.pai := int2bit(0,1); + f_changePositon(c_compNodeC, v_longPosVectorNodeC); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeA, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_NONAREA_CBF_BV_22_nodeD + + } // end GEONW_PON_GBC_NONAREA_CBF_BV_22 + + } // end gbcNonAreaContentionBasedForwarding + + } // end gbcNonAreaForwarding + + group gbcAreaForwarding { + + group gbcAreaAllForwardingAlgorithm { + + group GEONW_PON_GBC_AREA_ALL_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ALL_BV_01 + */ + function f_GEONW_PON_GBC_AREA_ALL_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_AREA_ALL_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_ALL_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ALL_BV_01) + */ + function f_GEONW_PON_GBC_AREA_ALL_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( + 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 of function f_GEONW_PON_GBC_AREA_ALL_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_ALL_BV_01) + */ + function f_GEONW_PON_GBC_AREA_ALL_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( + 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 of function f_GEONW_PON_GBC_AREA_ALL_BV_01_nodeD + + } // end GEONW_PON_GBC_AREA_ALL_BV_01 + + group GEONW_PON_GBC_AREA_ALL_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ALL_BV_03 + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD 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_AREA_ALL_BV_03_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_ALL_BV_03_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ALL_BV_03) + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_03_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1), + c_defaultHopLimit + ), + -, + c_defaultHopLimit + ) + ) + ); + + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1), + c_defaultHopLimit - 1, + c_defaultHopLimit) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message correctly retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoBroadcastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1), + ?, + ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GBC message fields not updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_03_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_ALL_BV_03) + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_03_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1), + c_defaultHopLimit - 1, + c_defaultHopLimit) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message correctly retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_03_nodeD + + } // end GEONW_PON_GBC_AREA_ALL_BV_03 + + group GEONW_PON_GBC_AREA_ALL_BV_04 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ALL_BV_04 + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD 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_AREA_ALL_BV_04_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_ALL_BV_04_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ALL_BV_04) + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_04_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ), + -, + c_hopLimit1 + ) + ) + ); + + tc_noac.start; + alt { + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_04_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_ALL_BV_04) + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_04_nodeD() 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_noac.start; + alt { + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_04_nodeD + + } // end GEONW_PON_GBC_AREA_ALL_BV_04 + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ALL_BV_05 + */ + function f_GEONW_PON_GBC_AREA_ALL_BV_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GBC_DST) { + log("*** " & testcasename() & ": PICS_GN_GBC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BV_05 + + group GEONW_PON_GBC_AREA_ALL_BO_08 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ALL_BO_08 + */ + function f_GEONW_PON_GBC_AREA_ALL_BO_08() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_DST) { + log("*** " & testcasename() & ": PICS_GN_GBC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf02Up(c_compNodeB); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BO_08 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ALL_BO_08) + */ + function f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var template (present) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ), + -, + c_defaultHopLimit + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket))); + + // IUT should also rebroadcast the packet. Get ready + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: GBC message rebroadcasted ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INFO: GBC message not rebroadcasted ***"); + } + } + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); 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_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was NOT transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_ALL_BO_08) + */ + function f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var GeoNetworkingInd v_msgInd; + var integer i; + + // Preamble + f_prNeighbour(); + + // IUT should also rebroadcast the packet. Get ready + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: Pre-conditions: GBC message rebroadcasted ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INFO: Pre-conditions: GBC message not rebroadcasted ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) / 2; + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_msgInd.msgIn)); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ALL_BO_08_nodeD + + } // end GEONW_PON_GBC_AREA_ALL_BO_08 + + } // end gbcAreaAllForwardingAlgorithm + + group gbcAreaSimpleForwarding { + + group GEONW_PON_GBC_AREA_SMP_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_SMP_BV_02 + */ + function f_GEONW_PON_GBC_AREA_SMP_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_getAreaForwardingAlgorithm() != e_simple) and (f_getAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_AREA_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_AREA_SMP_BV_02_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_SMP_BV_02_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_AREA_SMP_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_SMP_BV_02) + */ + function f_GEONW_PON_GBC_AREA_SMP_BV_02_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + tc_ac.start; + alt { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + 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 of function f_GEONW_PON_GBC_AREA_SMP_BV_02_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_SMP_BV_02) + */ + function f_GEONW_PON_GBC_AREA_SMP_BV_02_nodeD() 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 { + [] a_receiveGeoBroadcastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + 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 of function f_GEONW_PON_GBC_AREA_SMP_BV_02_nodeD + + } // end GEONW_PON_GBC_AREA_SMP_BV_02 + + group GEONW_PON_GBC_AREA_SMP_BO_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_SMP_BO_07 + */ + function f_GEONW_PON_GBC_AREA_SMP_BO_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getAreaForwardingAlgorithm() != e_simple) and (f_getAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_AREA_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_AREA_SMP_BO_07_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_SMP_BO_07_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GBC_BO_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_SMP_BO_07) + */ + function f_GEONW_PON_GBC_AREA_SMP_BO_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var template (present) GeoNetworkingPdu v_gnPacket; + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ), + -, + c_defaultHopLimit + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket))); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: GBC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoBroadcast( + ?, + ?) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_SMP_BO_07_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_SMP_BO_07) + */ + function f_GEONW_PON_GBC_AREA_SMP_BO_07_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: GBC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Pre-conditions: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + } + + // Test Body + // send geoBroadcast for second time (same source + same seq Nr + lower RHL) + v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) - 1; + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_msgInd.msgIn))); + + tc_noac.start; + alt { + [] a_receiveGeoBroadcast( + ?, + ?) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_SMP_BO_07_nodeD + + } // end GEONW_PON_GBC_AREA_SMP_BO_07 + + } // end gbcAreaSimpleForwarding + + group gbcAreaContentionBasedForwarding { + + group GEONW_PON_GBC_AREA_CBF_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_CBF_BV_02 + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_AREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeC, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_CBF_BV_02) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_02_nodeD + + } // end GEONW_PON_GBC_AREA_CBF_BV_02 + + group GEONW_PON_GBC_AREA_CBF_BV_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_CBF_BV_07 + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_sequenceNumberC := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeC(v_sequenceNumberC)); + v_nodeD.start(f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeD(v_sequenceNumberC)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_BCA_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_AREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeC(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_CBF_BV_07) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_07_nodeD(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GBC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GBC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_071_nodeD + + } // end GEONW_PON_GBC_AREA_CBF_BV_07 + + group GEONW_PON_GBC_AREA_CBF_BV_21 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_CBF_BV_21 + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_21() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_21 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_AREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_CBF_BV_21) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_21_nodeD + + } // end GEONW_PON_GBC_AREA_CBF_BV_21 + + group GEONW_PON_GBC_AREA_CBF_BV_22 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_CBF_BV_22 + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_22() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeB()); + v_nodeC.start(f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeC()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_22 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GBC_AREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_CBF_BV_22) + */ + function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + v_longPosVectorNodeD.pai := int2bit(0,1); + f_changePositon(c_compNodeD, v_longPosVectorNodeD); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GBC_AREA_CBF_BV_22_nodeD + + } // end GEONW_PON_GBC_AREA_CBF_BV_22 + + } // end gbcAreaContentionBasedForwarding + + group gbcAreaAdvancedForwarding { + + group GEONW_PON_GBC_AREA_ADV_BV_21 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_21 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_21() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeE; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf05Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeE := f_getComponent(c_compNodeE); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeB()); + v_nodeE.start(f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeE()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf05Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_21 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_21) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeB + + /** + * @desc Behavior function for NodeE (TC_GEONW_PON_GBC_AREA_ADV_BV_21) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeE() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_21_nodeE + + } // end GEONW_PON_GBC_AREA_ADV_BV_21 + + group GEONW_PON_GBC_AREA_ADV_BV_23 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_23 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_23() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeF; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf06Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeF := f_getComponent(c_compNodeF); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeB()); + v_nodeF.start(f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeF()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf06Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_23 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_23) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeB() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: Message not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeB + + /** + * @desc Behavior function for NodeF (TC_GEONW_PON_GBC_AREA_ADV_BV_23) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeF() runs on ItsGeoNetworking { + + // Local variables + var integer i; + var template (value) GeoNetworkingPdu v_gnPacket; + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoBroadcastArea(c_area1) + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + for(i:=1; i < f_getAdvancedGbcForwardingMaxCounter(); i:=i+1) { + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + f_sleepIgnoreDef(0.5); + } + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: Message not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_23_nodeF + + } // end GEONW_PON_GBC_AREA_ADV_BV_23 + + group GEONW_PON_GBC_AREA_ADV_BV_24 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_24 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_24() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeE; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf05Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeE := f_getComponent(c_compNodeE); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeB()); + v_nodeE.start(f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeE()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf05Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_24 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_24) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: Message not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeB + + /** + * @desc Behavior function for NodeE (TC_GEONW_PON_GBC_AREA_ADV_BV_24) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeE() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + tc_noac.start; + alt { + [] geoNetworkingPort.receive (mw_geoNwInd(mw_geoNwPdu(?))){ + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: Message not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_24_nodeE + + } // end GEONW_PON_GBC_AREA_ADV_BV_24 + + group GEONW_PON_GBC_AREA_ADV_BV_25 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_25 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_25() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeF; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf06Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeF := f_getComponent(c_compNodeF); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeB()); + v_nodeF.start(f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeF()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf06Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_25 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_25) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message received ***"); + 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 of function f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeB + + /** + * @desc Behavior function for NodeF (TC_GEONW_PON_GBC_AREA_ADV_BV_25) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeF() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var LongPosVector v_longPosVectorNodeF := f_getPosition(c_compNodeF); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeF, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_25_nodeF + + } // end GEONW_PON_GBC_AREA_ADV_BV_25 + + group GEONW_PON_GBC_AREA_ADV_BV_26 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_26 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_26() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf07Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeB()); + v_nodeD.start(f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf06Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_26 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_26) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GBC message received ***"); + 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 of function f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GBC_AREA_ADV_BV_26) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeB, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeB, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + )); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GBC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_26_nodeD + + } // end GEONW_PON_GBC_AREA_ADV_BV_26 + + + group GEONW_PON_GBC_AREA_ADV_BV_27 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_27 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_27() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeE; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf05Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeE := f_getComponent(c_compNodeE); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeB()); + v_nodeE.start(f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeE()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf05Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_27 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_27) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: packet correctly forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeB + + /** + * @desc Behavior function for NodeE (TC_GEONW_PON_GBC_AREA_ADV_BV_27) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeE() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeA, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ), + -, + f_getIutMacAddress() + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_27_nodeE + + } // end GEONW_PON_GBC_AREA_ADV_BV_27 + + group GEONW_PON_GBC_AREA_ADV_BV_28 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_28 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_28() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeE; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf05Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeE := f_getComponent(c_compNodeE); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeB()); + v_nodeE.start(f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeE()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf05Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_28 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_28) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: packet correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeB + + /** + * @desc Behavior function for NodeE (TC_GEONW_PON_GBC_AREA_ADV_BV_28) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeE() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_withLinkLayerDestination( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeA, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ), + -, + f_getIutMacAddress() + ) + ); + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: packet correctly broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_28_nodeE + + } // end GEONW_PON_GBC_AREA_ADV_BV_28 + + group GEONW_PON_GBC_AREA_ADV_BV_29 { + + /** + * @desc TP Function for TC_GEONW_PON_GBC_AREA_ADV_BV_29 + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_29() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeE; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getAreaForwardingAlgorithm() != e_advanced) { + log("*** " & testcasename() & ": PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { + // log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); + // setverdict(inconc); + // stop; + // } + + // Test component configuration + f_cf05Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeE := f_getComponent(c_compNodeE); + v_nodeB.start(f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeB()); + v_nodeE.start(f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeE()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf05Down(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_29 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GBC_AREA_ADV_BV_29) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeE := f_getPosition(c_compNodeE); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeE, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeE), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeB + + /** + * @desc Behavior function for NodeE (TC_GEONW_PON_GBC_AREA_ADV_BV_29) + */ + function f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeE() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeE := f_getPosition(c_compNodeE); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeE, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu(m_geoNwBroadcastPacket( + v_longPosVectorNodeE, + 0, + f_getGeoBroadcastArea(c_area1) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeE), + ?, + f_getGeoBroadcastArea(c_area1) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GBC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GBC_AREA_ADV_BV_29_nodeE + + } // end GEONW_PON_GBC_AREA_ADV_BV_29 + + } // end gbcAreaAdvancedForwarding + + } // end gbcAreaForwarding + + } // end geoGeoBroadcast + + // 6.2.2.10 + group geoTopologicallyScopedBroadcast { + + group GEONW_PON_TSB_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BV_01 + */ + function f_GEONW_PON_TSB_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_SRC) { + log("*** " & testcasename() & ": PICS_GN_TSB_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_TSB_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BV_01) + */ + function f_GEONW_PON_TSB_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_generateTsbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket(?, mw_longPosVectorPosition(v_longPosVectorIut)) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BV_01) + */ + function f_GEONW_PON_TSB_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 { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket(?, mw_longPosVectorPosition(v_longPosVectorIut)) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_01_nodeD + + } // end GEONW_PON_TSB_BV_01 + + group GEONW_PON_TSB_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BV_02 + */ + function f_GEONW_PON_TSB_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_FWD) { + log("*** " & testcasename() & ": PICS_GN_TSB_FWD 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_TSB_BV_02_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BV_02_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BV_02) + */ + function f_GEONW_PON_TSB_BV_02_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB + ), + -, + c_defaultHopLimit + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_02_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BV_02) + */ + function f_GEONW_PON_TSB_BV_02_nodeD() 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_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_02_nodeD + + } // end GEONW_PON_TSB_BV_02 + + group GEONW_PON_TSB_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BV_03 + */ + function f_GEONW_PON_TSB_BV_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_FWD) { + log("*** " & testcasename() & ": PICS_GN_TSB_FWD 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_TSB_BV_03_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BV_03_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BV_03) + */ + function f_GEONW_PON_TSB_BV_03_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB, + c_defaultHopLimit + ), + -, + c_defaultHopLimit + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ), + -, + ? + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: TSB packet received with incorrect HopLimit ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_03_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BV_03) + */ + function f_GEONW_PON_TSB_BV_03_nodeD() 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_geoNwTsbPacketWithHl( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB), + c_defaultHopLimit + ), + -, + c_defaultHopLimit - 1 + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ), + -, + ? + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: TSB packet received with incorrect HopLimit ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BV_03_nodeD + + } // end GEONW_PON_TSB_BV_03 + + group GEONW_PON_TSB_BO_04 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BO_04 + */ + function f_GEONW_PON_TSB_BO_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_FWD) { + log("*** " & testcasename() & ": PICS_GN_TSB_FWD 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_TSB_BO_04_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BO_04_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BO_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BO_04) + */ + function f_GEONW_PON_TSB_BO_04_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB + ), + -, + 1 + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_04_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BO_04) + */ + function f_GEONW_PON_TSB_BO_04_nodeD() 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_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: TSB message was re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: TSB message was not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_04_nodeD + + } // end GEONW_PON_TSB_BO_04 + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BV_05 + */ + function f_GEONW_PON_TSB_BV_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_TSB_DST) { + log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prDefault(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + log("*** " & testcasename() & ": TSB packet passed to Upper Layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cf01Down(); + + } // End of function f_GEONW_PON_TSB_BV_05 + + group GEONW_PON_TSB_BO_07 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BO_07 + */ + function f_GEONW_PON_TSB_BO_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_FWD) { + log("*** " & testcasename() & ": PICS_GN_TSB_FWD 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_TSB_BO_07_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BO_07_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BO_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BO_07) + */ + function f_GEONW_PON_TSB_BO_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var template GeoNetworkingPdu v_gnPacket; + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu( + m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB + ), + -, + c_defaultHopLimit + ); + + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket))); + v_gnPacket.basicHeader.routerHopLimit := ?; + tc_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: The same TSB packet was re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: The same TSB packet was not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_07_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BO_07) + */ + function f_GEONW_PON_TSB_BO_07_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: Expected TSB message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) -1; + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_msgInd.msgIn)); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(v_msgInd) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: The same TSB packet was re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: The same TSB packet was not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_07_nodeD + + } // end GEONW_PON_TSB_BO_07 + + group GEONW_PON_TSB_BO_08 { + + /** + * @desc TP Function for TC_GEONW_PON_TSB_BV_08 + */ + function f_GEONW_PON_TSB_BO_08() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_TSB_DST) { + log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf02Up(c_compNodeB); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_TSB_BO_08_nodeB()); + v_nodeD.start(f_GEONW_PON_TSB_BO_08_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_TSB_BO_08 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_TSB_BO_08) + */ + function f_GEONW_PON_TSB_BO_08_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu(m_geoNwTsbPacket( + vc_localSeqNumber, + v_longPosVectorNodeB + ), + -, + c_defaultHopLimit + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket))); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) { + tc_ac.stop; + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly rebroadcasted and passed to Upper Layer ***"); + vc_utInds := {}; + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + else { + log("*** " & testcasename() & ": INCONC: TSB was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: TSB not rebroadcasted ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: Same TSB packet was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Same TSB packet was not passed to Upper Layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_08_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_TSB_BO_08) + */ + function f_GEONW_PON_TSB_BO_08_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); + var GeoNetworkingInd v_msgInd; + var integer i; + var template (value) GeoNetworkingPdu v_gnPacket; + + // Preamble + f_prNeighbour(); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwTsbPacket( + ?, + mw_longPosVectorPosition(v_longPosVectorNodeB) + ) + ) + ) + ) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly rebroadcasted ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: TSB not rebroadcasted ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) - 1; + v_gnPacket := v_msgInd.msgIn; + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_msgInd.msgIn)); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_TSB_BO_08_nodeD + + } // end GEONW_PON_TSB_BO_08 + + } // end geoTopologicallyScopedBroadcast + + // 6.2.2.11 + group geoSingleHopBroadcast { + + group GEONW_PON_SHB_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_SHB_BV_01 + */ + function f_GEONW_PON_SHB_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_SHB_SRC) { + log("*** " & testcasename() & ": PICS_GN_SHB_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_SHB_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_SHB_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_SHB_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_SHB_BV_01) + */ + function f_GEONW_PON_SHB_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_generateShbMessage) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwShbPacket(mw_longPosVectorPosition(v_longPosVectorIut)) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: SHB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected SHB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_SHB_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_SHB_BV_01) + */ + function f_GEONW_PON_SHB_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 { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwShbPacket(mw_longPosVectorPosition(v_longPosVectorIut)) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: SHB packet received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: Expected SHB message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_SHB_BV_01_nodeD + + } // end GEONW_PON_SHB_BV_01 + + /** + * @desc TP Function for TC_GEONW_PON_SHB_BV_05 + */ + function f_GEONW_PON_SHB_BV_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_SHB_DST) { + log("*** " & testcasename() & ": PICS_GN_SHB_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB:= f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwShbPacket(v_longPosVectorNodeB)); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_SHB_BV_05 + + } // end geoSingleHopBroadcast + + // 6.2.2.12 + group geoGeoAnycast { + + group gacNonAreaForwarding { + + group gacNonAreaAllForwardingAlgorithm { + + group GEONW_PON_GAC_NONAREA_ALL_BV_03 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_ALL_BV_03 + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_03() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD 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_GAC_NONAREA_ALL_BV_03_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_ALL_BV_03_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_03 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_ALL_BV_03) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_03_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] a_receiveGeoAnycastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2), + c_defaultHopLimit - 1, + c_defaultHopLimit) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message correctly retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] a_receiveGeoAnycastWithAreaWithHopLimit( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2), + ?, + ?) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: GAC message fields not updated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_03_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_ALL_BV_03) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_03_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoNetworkingInd v_msgInd; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2), + c_defaultHopLimit + ), + -, + c_defaultHopLimit + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_03_nodeC + + } // end GEONW_PON_GAC_NONAREA_ALL_BV_03 + + group GEONW_PON_GAC_NONAREA_ALL_BO_04 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_ALL_BO_04 + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_04() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD 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_GAC_NONAREA_ALL_BO_04_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_ALL_BO_04_nodeC()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_04 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_ALL_BO_04) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_04_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_04_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_ALL_BO_04) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_04_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ), + -, + c_hopLimit1 + ) + ) + ); + + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_04_nodeC + + } // end GEONW_PON_GAC_NONAREA_ALL_BO_04 + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_ALL_BV_06 + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_06() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwAnycastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was NOT transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_06 + + group GEONW_PON_GAC_NONAREA_ALL_BO_09 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_ALL_BO_09 + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_09() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_distanceTooBig; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + v_distanceTooBig := float2int(1.1 * f_radiusFromCircularArea(f_getGnMaxAreaSize()*c_squareKm)); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeB(v_distanceTooBig)); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeC(v_distanceTooBig)); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeD(v_distanceTooBig)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_09 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_ALL_BO_09) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeB(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_computePosition(f_getPosition(c_compNodeB), 1000, 0), + p_distanceTooBig + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_geoArea2GeoAnycastArea(v_areaTooBig) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_ALL_BO_09) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeC(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_computePosition(f_getPosition(c_compNodeB), 1000, 0), + p_distanceTooBig + ); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_geoArea2GeoAnycastArea(v_areaTooBig) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_geoArea2GeoAnycastArea(v_areaTooBig) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_ALL_BO_09) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeD(in UInt16 p_distanceTooBig) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoArea v_areaTooBig; + + // Preamble + f_prNeighbour(); + v_areaTooBig := f_computeCircularArea( + f_computePosition(f_getPosition(c_compNodeB), 1000, 0), + p_distanceTooBig + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_geoArea2GeoAnycastArea(v_areaTooBig) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BO_09_nodeD + + } // end GEONW_PON_GAC_NONAREA_ALL_BO_09 + + group GEONW_PON_GAC_NONAREA_ALL_BV_10 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_ALL_BV_10 + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_10() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { +// log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); +// setverdict(inconc); +// stop; +// } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeC()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_10 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_ALL_BV_10) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeB() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_ALL_BV_10) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_ALL_BV_10) + */ + function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeD, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC received and not discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message discarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_ALL_BV_10_nodeD + + } // end GEONW_PON_GAC_NONAREA_ALL_BV_10 + + } // end gacNonAreaAllForwardingAlgorithm + + group gacNonAreaGreedyForwarding { + + group GEONW_PON_GAC_NONAREA_GRD_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_GRD_BV_01 + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy 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_GAC_NONAREA_GRD_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_GRD_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_GRD_BV_01) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_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_generateGeoAnycastMessage(f_getArea(c_area2))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_GRD_BV_01) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_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_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: received GAC message ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_01_nodeD + + } // end GEONW_PON_GAC_NONAREA_GRD_BV_01 + + group GEONW_PON_GAC_NONAREA_GRD_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_GRD_BV_02 + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy or e_unspecified ) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message correctly forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_GRD_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message not forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BV_02_nodeD + + } // end GEONW_PON_GAC_NONAREA_GRD_BV_02 + + group GEONW_PON_GAC_NONAREA_GRD_BO_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_GRD_BO_07 + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BO_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_sequenceNumber := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if ((f_getNonAreaForwardingAlgorithm() != e_greedy) and (f_getNonAreaForwardingAlgorithm() != e_unspecified)) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_greedy or e_unspecified ) required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeC(v_sequenceNumber)); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeD(v_sequenceNumber)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BO_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var GeoNetworkingInd v_msgInd; + var template GeoNetworkingInd v_msgInd_t; + + // Preamble + f_prNeighbour(); + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ) -> value v_msgInd { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Pre-conditions: GAC message correctly forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Pre-conditions: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } + + // Test Body + v_msgInd_t := v_msgInd; + v_msgInd_t.msgIn.basicHeader.routerHopLimit := ?; + tc_noac.start; + alt { + [] geoNetworkingPort.receive(v_msgInd_t) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message re-forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not re-forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeC(in UInt16 p_sequenceNumber) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + p_sequenceNumber, + f_getGeoAnycastArea(c_area2) + ), + -, + c_defaultHopLimit + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC re-forwarded! (not to area center!) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_GRD_BO_07) + */ + function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeD(in UInt16 p_sequenceNumber) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": INCONC: Pre-conditions: GAC message not forwarded to area center ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: Pre-conditions: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + } + + // Test Body + // send geoAnycast for second time (same source + same seq Nr + lower RHL) + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + p_sequenceNumber, + f_getGeoAnycastArea(c_area2) + ), + -, + c_defaultHopLimit - 1 + ) + ) + ); + + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC re-forwarded! (not to area center!) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_GRD_BO_07_nodeD + + } // end GEONW_PON_GAC_NONAREA_GRD_BO_07 + + + } // end gacNonAreaGreedyForwarding + + group gacNonAreaContentionBasedForwarding { + + group GEONW_PON_GAC_NONAREA_CBF_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_01 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + if(f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == ( e_cbf ) 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_GAC_NONAREA_CBF_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_01) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_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_generateGeoAnycastMessage(f_getArea(c_area2)))) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_CBF_BV_01) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_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_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: received GAC message ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_01_nodeD + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_01 + + group GEONW_PON_GAC_NONAREA_CBF_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_02 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { +// log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); +// setverdict(inconc); +// stop; +// } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeC()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + timer t_toCbf := (int2float(f_getCbfMaxTime()) + + ( + int2float(f_getCbfMinTime() - f_getCbfMaxTime()) + / int2float(f_getCbfMaxCommunicationRange()) + ) * f_distance(v_longPosVectorNodeC, v_longPosVectorIut)) * 0.95 / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GAC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GAC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_CBF_BV_02) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_02_nodeD + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_02 + + group GEONW_PON_GAC_NONAREA_CBF_BV_07 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_07 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_07() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + var UInt16 v_sequenceNumberC := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { +// log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); +// setverdict(inconc); +// stop; +// } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeC(v_sequenceNumberC)); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeD(v_sequenceNumberC)); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_07 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeC(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_CBF_BV_07) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_07_nodeD(in UInt16 p_sequenceNumberC) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + p_sequenceNumberC, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_071_nodeD + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_07 + + group GEONW_PON_GAC_NONAREA_CBF_BV_20 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_20 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_20() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var float v_distance := int2float(f_getCbfMaxCommunicationRange() * 2); + var LongPosVector v_longPosVectorIut, v_longPosVectorNodeC; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(); + // re-compute NodeC's position. + v_longPosVectorIut := f_getIutLongPosVector(); + v_longPosVectorNodeC := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 180); + v_longPosVectorNodeC.gnAddr := f_getTsGnLocalAddress(c_compNodeC); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeB(v_longPosVectorNodeC)); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeC(v_longPosVectorNodeC)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_20 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeB(in LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + timer t_toCbf := int2float(f_getCbfMinTime()) / 1000.0; + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + t_toCbf.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(p_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: Forwarded GUC received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***"); + repeat; + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_CBF_BV_20) + * @param p_longPosVectorNodeC Position vector of NodeC + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeC(LongPosVector p_longPosVectorNodeC) runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + p_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + log("*** " & testcasename() & ": INFO: Message sent ***"); + f_selfOrClientSyncAndVerdict(c_msgSent, e_success); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(p_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + 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 of function f_GEONW_PON_GAC_NONAREA_CBF_BV_20_nodeC + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_20 + + group GEONW_PON_GAC_NONAREA_CBF_BV_21 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_21 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_21() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { +// log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); +// setverdict(inconc); +// stop; +// } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeC()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_21 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeC() runs on ItsGeoNetworking { + + // Local variables + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not re-broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_CBF_BV_21) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + f_prNonNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeC, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GAC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GAC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poDefault(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_21_nodeD + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_21 + + group GEONW_PON_GAC_NONAREA_CBF_BV_22 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_NONAREA_CBF_BV_22 + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_22() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (f_getNonAreaForwardingAlgorithm() != e_cbf) { + log("*** " & testcasename() & ": PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // if (f_getCbfMinTime() < 300) { +// log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***"); +// setverdict(inconc); +// stop; +// } + + // Test component configuration + f_cf04Up(); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeB()); + v_nodeC.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeC()); + v_nodeD.start(f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeD()); + + // Synchronization + f_serverSync3ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf04Down(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_22 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_PON_GAC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeC() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + timer t_toCbf := int2float(f_getCbfMaxTime()) * 0.95 / 1000.0; + + // Preamble + v_longPosVectorNodeC.pai := int2bit(0,1); + f_changePositon(c_compNodeC, v_longPosVectorNodeC); + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeA, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area2) + ) + ) + ) + ); + + t_toCbf.start; + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + + if(t_toCbf.running) { + t_toCbf.stop; + log("*** " & testcasename() & ": FAIL: GAC retransmitted before CBF timer expiration ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GAC message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_toCbf.timeout { + log("*** " & testcasename() & ": INFO: CBF timer elapsed ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeC + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_NONAREA_CBF_BV_22) + */ + function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeA), + ?, + f_getGeoAnycastArea(c_area2) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC not broadcasted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_NONAREA_CBF_BV_22_nodeD + + } // end GEONW_PON_GAC_NONAREA_CBF_BV_22 + + } // end gacNonAreaContentionBasedForwarding + + } // end gacNonAreaForwarding + + group gacAreaForwarding { + + group GEONW_PON_GAC_AREA_ALL_BV_01 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_AREA_ALL_BV_01 + */ + function f_GEONW_PON_GAC_AREA_ALL_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_SRC) { + log("*** " & testcasename() & ": PICS_GN_GAC_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_GAC_AREA_ALL_BV_01_nodeB()); + v_nodeD.start(f_GEONW_PON_GAC_AREA_ALL_BV_01_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_AREA_ALL_BV_01) + */ + function f_GEONW_PON_GAC_AREA_ALL_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_generateGeoAnycastMessage(f_getArea(c_area1))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + + tc_ac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area1)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_01_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_AREA_ALL_BV_01) + */ + function f_GEONW_PON_GAC_AREA_ALL_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_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorIut), + ?, + f_getGeoAnycastArea(c_area1)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: GAC message received correctly ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": FAIL: GAC message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_01_nodeD + + } // end GEONW_PON_GAC_AREA_ALL_BV_01 + + group GEONW_PON_GAC_AREA_ALL_BV_02 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_AREA_ALL_BV_02 + */ + function f_GEONW_PON_GAC_AREA_ALL_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + + // Test control + if (not PICS_GN_GAC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GAC_FWD 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_GAC_AREA_ALL_BV_02_nodeB()); + v_nodeD.start(f_GEONW_PON_GAC_AREA_ALL_BV_02_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_AREA_ALL_BV_02) + */ + function f_GEONW_PON_GAC_AREA_ALL_BV_02_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 + f_sendGeoNetMessage( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwAnycastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ) + ) + ) + ); + + tc_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoAnycastArea(c_area1)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_02_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_AREA_ALL_BV_02) + */ + function f_GEONW_PON_GAC_AREA_ALL_BV_02_nodeD() 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_noac.start; + alt { + [] a_receiveGeoAnycastWithArea( + mw_longPosVectorPosition(v_longPosVectorNodeB), + ?, + f_getGeoAnycastArea(c_area1)) { + tc_noac.stop; + log("*** " & testcasename() & ": FAIL: GAC message retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: GAC message not retransmitted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_02_nodeD + + } // end GEONW_PON_GAC_AREA_ALL_BV_02 + + /** + * @desc TP Function for TC_GEONW_PON_GAC_AREA_ALL_BV_05 + */ + function f_GEONW_PON_GAC_AREA_ALL_BV_05() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeB; + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Test control + if (not PICS_GN_GAC_DST) { + log("*** " & testcasename() & ": PICS_GN_GAC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + + // Test adapter configuration + + // Preamble + f_prNeighbour(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_gnPacket := m_geoNwPdu(m_geoNwAnycastPacket( + v_longPosVectorNodeB, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ) + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + log("*** " & testcasename() & ": GAC packet passed to Upper Layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BV_05 + + group GEONW_PON_GAC_AREA_ALL_BO_08 { + + /** + * @desc TP Function for TC_GEONW_PON_GAC_AREA_ALL_BO_08 + */ + function f_GEONW_PON_GAC_AREA_ALL_BO_08() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeD; + var template (value) GeoNetworkingPdu v_gnPacket; + + // Test control + if (not PICS_GN_GAC_DST) { + log("*** " & testcasename() & ": PICS_GN_GAC_DST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf02Up(c_compNodeB); + + // Preamble + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeD := f_getComponent(c_compNodeD); + v_nodeB.start(f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeB()); + v_nodeD.start(f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeD()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf02Down(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BO_08 + + /** + * @desc Behavior function for NodeB (TC_GEONW_PON_GAC_AREA_ALL_BO_08) + */ + function f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeB() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Preamble + f_prNeighbour(); + + f_sleep(PX_TAC); + + v_gnPacket := m_geoNwPdu(m_geoNwAnycastPacket( + v_longPosVectorNodeD, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ), + -, + c_defaultHopLimit + ); + for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, valueof(v_gnPacket.gnPacket.packet.payload)); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utInds)) { + log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***"); + 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 + v_gnPacket.basicHeader.routerHopLimit := valueof(v_gnPacket.basicHeader.routerHopLimit) / 2; + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_sleep(PX_TAC); + + if(0 != lengthof(vc_utInds)) { + log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: GN was NOT transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeB + + /** + * @desc Behavior function for NodeD (TC_GEONW_PON_GAC_AREA_ALL_BO_08) + */ + function f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeD() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD); + var template (value) GeoNetworkingPdu v_gnPacket; + var integer i; + + // Preamble + f_prNeighbour(); + v_gnPacket := m_geoNwPdu(m_geoNwAnycastPacket( + v_longPosVectorNodeD, + vc_localSeqNumber, + f_getGeoAnycastArea(c_area1) + ), + -, + c_defaultHopLimit + ); + f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket)); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_PON_GAC_AREA_ALL_BO_08_nodeD + + } // end GEONW_PON_GAC_AREA_ALL_BO_08 + + } // end gacAreaForwarding + + } // end geoGeoAnycast + + } // end geoProtocolOperation + + // 6.2.3 Capacities + group geoCapacities { + + // 6.2.3.1 + group geoCapLocationService { + + /** + * @desc TP Function for TC_GEONW_CAP_LOS_BV_01 + */ + function f_GEONW_CAP_LOS_BV_01() runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA; + var LongPosVector v_longPosVectorNodeB; + var LongPosVector v_longPosVectorIut; + var GeoNetworkingInd v_msg; + var integer v_packetSize := 0; + var integer v_index := 0; + var integer v_nbrOfPackets := 0; + + // Test control + if (not PICS_GN_LS_REQ_SRC) { + log("*** " & testcasename() & ": PICS_GN_LS_REQ_SRC required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_longPosVectorNodeA := f_getPosition(c_compNodeA); + v_longPosVectorNodeB := f_getPosition(c_compNodeB); + v_longPosVectorIut := f_getPosition(c_compIut); + f_prNeighbour(); + + // Trigger message to NodeB in order to get an estimation of packet size + if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithPayload(v_longPosVectorNodeB.gnAddr, char2oct("PAYLOAD_" & oct2str(int2oct(0, 2))))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), + ? + ) + ) + ) + ) -> value v_msg { + var GeoNetworkingReq v_req; + tc_ac.stop; + //if we use directly v_msg(GeoNetworkingInd) for encvalue the encoder must also be able to provide + //encoding of "incoming messages"... + v_req.msgOut := v_msg.msgIn; + v_packetSize := lengthof(bit2oct(encvalue(v_req.msgOut))); + } + } + + // implicitely trigger LS_REQUEST + if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + tc_ac.start; + alt { + [] a_receiveLsRequest( + ?, + v_longPosVectorNodeA.gnAddr.mid, + v_longPosVectorIut + ) { + } + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + // Fill the LS buffer + one more message to remove an older message + v_nbrOfPackets := f_getLsPacketBufferSize() / v_packetSize + 1; + log("*** " & testcasename() & ": " & int2str(v_nbrOfPackets) & " ***"); + for (v_index:=1; v_index <= v_nbrOfPackets; v_index:=v_index+1) { + if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithPayload(v_longPosVectorNodeA.gnAddr, char2oct("PAYLOAD_" & oct2str(int2oct(v_index, 2))))) ) { + log("*** " & testcasename() & ": INCONC: Trigger failed ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + f_sleepIgnoreDef(0.5); + f_sendGeoNetMessage( + valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsReplyPacket( + v_longPosVectorNodeB, + f_longPosVector2ShortPosVector(v_longPosVectorIut), + vc_localSeqNumber + ) + ) + ) + )); + + // packet 1 shall be dropped + v_index := 2; + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + f_receiveGeoNetMessageWithPayload( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ), + char2oct("PAYLOAD_" & oct2str(int2oct(v_index, 2))) + ) + ) { + if (v_index < v_nbrOfPackets) { + v_index := v_index + 1; + repeat; + } + tc_ac.stop; + log("*** " & testcasename() & ": Older message was removed, new message was inserted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": Expected amount of messages were not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + + // Postamble + f_poNeighbour(); + f_cf01Down(); + + } // End of function f_GEONW_CAP_LOS_BV_01 + + } // end geoCapLocationService + + // 6.2.3.2 + group geoCapForwardingPacketBuffer { + + group GEONW_CAP_FPB_BV_01 { + + /** + * @desc TP Function for TC_GEONW_CAP_LOS_BV_01 + */ + function f_GEONW_CAP_FPB_BV_01() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var template (value) GeoNetworkingPdu v_geoNetworkingMsg; + var integer v_packetSize := 0; + var integer v_nbrOfPackets := 0; + var integer v_payloadSize := f_min(1400, f_getUcForwardingPacketBufferSize() / 10 ); + var octetstring v_payload; + const integer c_nbrOfDiscardedMessages := 1; + var UInt16 v_sequenceNumberC := f_getInitialSequenceNumber(); + + // Test control + if (not PICS_GN_GUC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(); + + // Preamble + + // Prepare GUC message + v_payload := int2oct(0, v_payloadSize); + v_geoNetworkingMsg := m_geoNwPdu( + m_geoNwUnicastPacket( + m_dummyLongPosVector, + f_longPosVector2ShortPosVector(valueof(m_dummyLongPosVector)), + 0) + ); + v_geoNetworkingMsg.gnPacket.packet.payload := valueof(v_payload); + v_packetSize := lengthof(bit2oct(encvalue(v_geoNetworkingMsg))); + + // Fill the UC forwarding buffer + c_nbrOfDiscardedMessages more message to remove older messages + v_nbrOfPackets := f_getUcForwardingPacketBufferSize() / v_packetSize + c_nbrOfDiscardedMessages + 1; + log("*** " & testcasename() & ": " & int2str(v_nbrOfPackets) & " ***"); + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_CAP_FPB_BV_01_nodeB(v_sequenceNumberC, v_nbrOfPackets, c_nbrOfDiscardedMessages)); + v_nodeC.start(f_GEONW_CAP_FPB_BV_01_nodeC(v_sequenceNumberC, v_nbrOfPackets, v_geoNetworkingMsg)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_CAP_FPB_BV_01 + + /** + * @desc Behavior function for NodeB (TC_GEONW_CAP_FPB_BV_01) + * @param p_sequenceNumberC Initial sequence number of NodeC + * @param p_nbrOfPackets Number of packets sent by other component + * @param p_nbrOfDiscardedMessages Number of packets that should be discarded + */ + function f_GEONW_CAP_FPB_BV_01_nodeB( + in UInt16 p_sequenceNumberC, + in integer p_nbrOfPackets, + in integer p_nbrOfDiscardedMessages + ) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var UInt16 v_expectedSeqNumber := p_sequenceNumberC + p_nbrOfDiscardedMessages + 1; + var integer v_nbReceivedMessages := 0; + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_startBeingNeighbour(); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + v_expectedSeqNumber + ) + ) + ) + ) { + v_nbReceivedMessages := v_nbReceivedMessages + 1; + v_expectedSeqNumber := v_expectedSeqNumber + 1; + repeat; // repeat in any case => IUT may send more messages ! + } + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwUnicastPacket( + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), + ? + ) + ) + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Unexpected message received (Bad sequence number) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + if(v_nbReceivedMessages == (p_nbrOfPackets - p_nbrOfDiscardedMessages)) { + log("*** " & testcasename() & ": PASS: Older messages wer removed, new messages were inserted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: Expected amount of messages were not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_CAP_FPB_BV_01_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_CAP_FPB_BV_01) + * @param p_sequenceNumberC Initial sequence number of NodeC + * @param p_nbrOfPackets Number of packets to be send + * @param p_geoNetworkingMsg Pdu to be sent (template) + */ + function f_GEONW_CAP_FPB_BV_01_nodeC( + in UInt16 p_sequenceNumberC, + in integer p_nbrOfPackets, + in template (value) GeoNetworkingPdu p_geoNetworkingMsg + ) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA); + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var integer i := 0; + + // Preamble + f_prNeighbour(); + vc_localSeqNumber := p_sequenceNumberC; + + p_geoNetworkingMsg.gnPacket.packet.extendedHeader.geoUnicastHeader.srcPosVector := v_longPosVectorNodeC; + p_geoNetworkingMsg.gnPacket.packet.extendedHeader.geoUnicastHeader.dstPosVector := f_longPosVector2ShortPosVector(v_longPosVectorNodeA); + for (i:=0; i < p_nbrOfPackets; i:=i+1) { + p_geoNetworkingMsg.gnPacket.packet.extendedHeader.geoUnicastHeader.seqNumber := vc_localSeqNumber; + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(p_geoNetworkingMsg))); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_CAP_FPB_BV_01_nodeC + + } // end GEONW_CAP_FPB_BV_01 + + group GEONW_CAP_FPB_BV_02 { + + /** + * @desc TP Function for TC_GEONW_CAP_FPB_BV_02 + */ + function f_GEONW_CAP_FPB_BV_02() runs on ItsMtc { + + // Local variables + var ItsGeoNetworking v_nodeB; + var ItsGeoNetworking v_nodeC; + var template (value) GeoNetworkingPdu v_geoNetworkingMsg; + var integer v_packetSize := 0; + var integer v_nbrOfPackets := 0; + const integer c_nbrOfDiscardedMessages := 1; + var UInt16 v_sequenceNumberC := f_getInitialSequenceNumber(); + const octetstring c_defaultPayload := char2oct("DEFAULT_PAYLOAD"); + const integer c_itsGnMaxSduSize := 1398; + var octetstring v_payload := c_defaultPayload; + + // Test control + if (not PICS_GN_GBC_FWD) { + log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf03Up(); + + // Preamble + + // Prepare GBC message + v_geoNetworkingMsg := m_geoNwPdu(m_geoNwBroadcastPacket( + m_dummyLongPosVector, + 0, + m_dummyGeoBroadcastArea)); + + while (lengthof(v_payload) < (c_itsGnMaxSduSize- lengthof(c_defaultPayload))) { + v_payload := v_payload & c_defaultPayload; + } + + v_geoNetworkingMsg.gnPacket.packet.payload := valueof(v_payload); + + v_packetSize := lengthof(bit2oct(encvalue(v_geoNetworkingMsg))); + + // Fill the BC forwarding buffer + c_nbrOfDiscardedMessages more message to remove older messages + v_nbrOfPackets := f_getBcForwardingPacketBufferSize() / v_packetSize + c_nbrOfDiscardedMessages; + + // Start components + v_nodeB := f_getComponent(c_compNodeB); + v_nodeC := f_getComponent(c_compNodeC); + v_nodeB.start(f_GEONW_CAP_FPB_BV_02_nodeB(v_sequenceNumberC, v_nbrOfPackets, c_nbrOfDiscardedMessages)); + v_nodeC.start(f_GEONW_CAP_FPB_BV_02_nodeC(v_sequenceNumberC, v_nbrOfPackets, v_geoNetworkingMsg)); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cf03Down(); + + } // End of function f_GEONW_CAP_FPB_BV_02 + + /** + * @desc Behavior function for NodeB (TC_GEONW_CAP_FPB_BV_02) + * @param p_sequenceNumberC Initial sequence number of NodeC + * @param p_nbrOfPackets Number of packets sent by other component + * @param p_nbrOfDiscardedMessages Number of packets that should be discarded + */ + function f_GEONW_CAP_FPB_BV_02_nodeB( + in UInt16 p_sequenceNumberC, + in integer p_nbrOfPackets, + in integer p_nbrOfDiscardedMessages + ) runs on ItsGeoNetworking { + + // Local variables +// FIXME: remove var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var UInt16 v_expectedSeqNumber := p_sequenceNumberC + p_nbrOfDiscardedMessages; + var integer v_nbReceivedMessages := 0; + + // Preamble + f_prDefault(); // NodeB is not yet a neighbour + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_startBeingNeighbour(); + + tc_ac.start; + alt { + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorNodeC), + v_expectedSeqNumber + ) { + v_nbReceivedMessages := v_nbReceivedMessages + 1; + v_expectedSeqNumber := v_expectedSeqNumber + 1; + repeat; // repeat in any case => IUT may send more messages ! + } + [] a_receiveGeoBroadcast( + mw_longPosVectorPosition(v_longPosVectorNodeC), + ? + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Unexpected message received (Bad sequence number) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + if(v_nbReceivedMessages == (p_nbrOfPackets - p_nbrOfDiscardedMessages)) { + log("*** " & testcasename() & ": PASS: Older messages wer removed, new messages were inserted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: Expected amount of messages were not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + } + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_CAP_FPB_BV_02_nodeB + + /** + * @desc Behavior function for NodeC (TC_GEONW_CAP_FPB_BV_02) + * @param p_sequenceNumberC Initial sequence number of NodeC + * @param p_nbrOfPackets Number of packets to be send + * @param p_geoNetworkingMsg Pdu to be sent (template) + */ + function f_GEONW_CAP_FPB_BV_02_nodeC( + in UInt16 p_sequenceNumberC, + in integer p_nbrOfPackets, + in template (value) GeoNetworkingPdu p_geoNetworkingMsg + ) runs on ItsGeoNetworking { + + // Local variables + var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC); + var integer i := 0; + var GnRawPayload v_payload := valueof(p_geoNetworkingMsg.gnPacket.packet.payload); //save the given payload + + // Preamble + f_prNeighbour(); + vc_localSeqNumber := p_sequenceNumberC; + + p_geoNetworkingMsg.gnPacket.packet := m_geoNwBroadcastPacket( + v_longPosVectorNodeC, + 0, + f_getGeoBroadcastArea(c_area2) + ); + p_geoNetworkingMsg.gnPacket.packet.payload := v_payload; //set back the original given payload + + for (i:=0; i < p_nbrOfPackets; i:=i+1) { + p_geoNetworkingMsg.gnPacket.packet.extendedHeader.geoBroadcastHeader.seqNumber := vc_localSeqNumber; + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(p_geoNetworkingMsg))); + } + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poNeighbour(); + + } // End of function f_GEONW_CAP_FPB_BV_02_nodeC + + } // end GEONW_CAP_FPB_BV_02 + + } // end geoCapForwardingPacketBuffer + + } // end geoCapacities + +} // end ItsGeoNetworking_TpFunctions diff --git a/README.md b/README.md index 03aa5e859fcd30c091f839246308b2ca313b26b6..943c30f776754f328895baeee6091a1619b292cf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# GeoNetworking TS 102 871-3 +# GeoNetworking Abstract Test suite (TS 102 871-3) -GeoNetworking test suite as defined in ETSI TS 102 871-3 \ No newline at end of file +GeoNetworking (GN) abstract test suite (ATS) as defined in [ETSI TS 102 871-3 v1.5.1](https://www.etsi.org/deliver/etsi_ts/102800_102899/10287103/01.05.01_60/ts_10287103v010501p.pdf) + +This code is a part of the ETSI ITS test suite, available on https://forge.etsi.org/rep/ITS/TS.ITS + +This version of the test suite was developed by the _TTF-011_ and published as version **v1.5.1** diff --git a/lib/LibItsGeoNetworking_EncdecDeclarations.ttcn b/lib/LibItsGeoNetworking_EncdecDeclarations.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5d03f8f1b4702ecfc2b2f0f86170c16effbf13c --- /dev/null +++ b/lib/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -0,0 +1,46 @@ +module LibItsGeoNetworking_EncdecDeclarations { + + import from LibItsGeoNetworking_TypesAndValues all; + + external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + /* + external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + */ + + external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + +} // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/lib/LibItsGeoNetworking_Pics.ttcn b/lib/LibItsGeoNetworking_Pics.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16d13115e4b91d9a60b2421a81d900a8839214f4 --- /dev/null +++ b/lib/LibItsGeoNetworking_Pics.ttcn @@ -0,0 +1,389 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $URL$ + * $Id$ + * @desc GeoNetworking PICS + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Pics { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsExternal_TypesAndValues {type MacAddress}; + + group geoNwPics { + + /** + * @desc GeoNetworking address of the GeoAdhoc router + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar GN_Address PICS_GN_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := c_6ZeroBytes + }; + + /** + * @desc Is address manually configured + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar GnAddressConfigurationMethod PICS_GN_LOCAL_ADDR_CONF_METHOD := e_anonymous; + + /** + * @desc Is the IUT mobile? + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_IS_MOBILE := true; + + /** + * @desc Minimum update frequency of local position vector (LPV) in ms + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_MINIMUM_UPDATE_FREQUENCY_LPV := 1000; + + /** + * @desc Maximum size of GN-SDU [bytes] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_MAX_SDU_SIZE := 1398; + + /** + * @desc GN_MAX: Maximum size of GeoNetworking header [bytes] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_MAX_GN_HEADER_SIZE := 88; + + /** + * @desc Lifetime of location table entry [s] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_LIFETIME_LOC_TE := 20; + + /** + * @desc GN Security support enabled or disabled + * @see ETSI TS 102 871-1 Table 1 + * @remark This PIC is different than PICS_IS_IUT_SECURED. + * When set to true, this PIC indicates that the GeoNetworking is running with security ATS + * UtInitialse shall indicate which certificate the IUT shall use + */ + modulepar boolean PICS_GN_SECURITY := false; + + /** + * @desc Maximum number of retransmissions of LS_REQUEST packets + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_LOCATION_SERVICE_MAX_RETRANS := 10; + + /** + * @desc Duration of Location service retransmit timer [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER := 1000; + + /** + * @desc Size of Location service packet buffer [Byte] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE := 1024; + + /** + * @desc Duration of Beacon service retransmit timer [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER := 3000; + + /** + * @desc Maximum beacon jitter [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_BEACON_SERVICE_MAX_JITTER := 750; + + /** + * @desc Default hop limit indicating the maximum number of hops a packet travels + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar UInt8 PICS_GN_DEFAULT_HOP_LIMIT := 10; + + /** + * @desc Upper limit of the maximum lifetime [s] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_MAX_PACKET_LIFETIME := 600; + + /** + * @desc Lower limit of the packet repetition interval [km^2] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar float PICS_GN_MAX_GEO_AREA_SIZE:= 10.0; + + /** + * @desc Lower limit of the packet repetition interval [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_MIN_PACKET_REPETITION_INTERVAL := 100; + + /** + * @desc Default NON-AREA forwarding algorithm + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar NonAreaForwardingAlgorithm PICS_GN_NON_AREA_FORWARDING_ALGORITHM := e_greedy; + + /** + * @desc Default AREA forwarding algorithm + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar AreaForwardingAlgorithm PICS_GN_AREA_FORWARDING_ALGORITHM := e_cbf; + + /** + * @desc Minimum duration a packet shall be buffered in the CBF packet buffer [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_CBF_MIN_TIME := 1; + + /** + * @desc Maximum duration a packet shall be buffered in the CBF packet buffer [ms] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_CBF_MAX_TIME := 100; + + /** + * @desc Default theoretical maximum communication range [m] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE := 1000; + + /** + * @desc Size of UC forwarding packet buffer [Kbytes] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE := 256; + + /** + * @desc Size of BC forwarding packet buffer [Kbytes] + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar integer PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE := 1024; + + /** + * @desc Support for Basic header + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_BASIC_HEADER := true; + + /** + * @desc Support for Common header + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_COMMON_HEADER := true; + + /** + * @desc Support for Beacon source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_BEACON_SRC := true; + + /** + * @desc Support for Beacon destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_BEACON_DST := true; + + /** + * @desc Support for GUC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GUC := true; + + /** + * @desc Support for GUC source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GUC_SRC := true; + + /** + * @desc Support for GUC destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GUC_DST := true; + + /** + * @desc Support for GUC forwarding + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GUC_FWD := true; + + /** + * @desc Support for GBC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GBC := true; + + /** + * @desc Support for GBC source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GBC_SRC := true; + + /** + * @desc Support for GBC destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GBC_DST := true; + + /** + * @desc Support for GBC forwarding + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GBC_FWD := true; + + /** + * @desc Support for GAC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GAC := true; + + /** + * @desc Support for GAC source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GAC_SRC := true; + + /** + * @desc Support for GAC destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GAC_DST := true; + + /** + * @desc Support for GAC forwarding + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GAC_FWD := true; + + /** + * @desc Support for SHB operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_SHB := true; + + /** + * @desc Support for SHB source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_SHB_SRC := true; + + /** + * @desc Support for SHB destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_SHB_DST := true; + + /** + * @desc Support for TSB operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_TSB := true; + + /** + * @desc Support for TSB source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_TSB_SRC := true; + + /** + * @desc Support for TSB destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_TSB_DST := true; + + /** + * @desc Support for TSB forwarding + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_TSB_FWD := true; + + /** + * @desc Support for LS Request source operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_LS_REQ_SRC := true; + + /** + * @desc Support for LS Request retransmission + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_LS_REQ_RETRANSMISSION := true; + + /** + * @desc Support for LS Request destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_LS_REQ_DST := true; + + /** + * @desc Support for LS Reply destination operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_LS_REP_DST := true; + + /** + * @desc Support for LS forwarding + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_LS_FWD := true; + + /** + * @desc Support for automatic address + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_ADDR_AUTO := true; + + /** + * @desc Support for Managed address + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_ADDR_MANAGED := true; + + /** + * @desc Support for Anonymous address + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_ADDR_ANONYMOUS := true; + + /** + * @desc Support for DAD + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_DAD := true; + + /** + * @desc MAX_COUNTER used in Advanced GBC forwarding + * @see FIXME: not defined as protocol constant in base spec + */ + modulepar integer PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER := 3; + + /** + * @desc IUT's Mac address + */ + modulepar MacAddress PICS_IUT_MAC_ADDRESS := 'FFFFFFFFFFFF'O; + + } // end geoNwPics + + /** + * @desc Is the IUT running in secured mode? + * @remark This PIC is different than PICS_GN_SECURITY. + * When set to true, this PIC indicates that the GeoNetworking is running without security against a secured device + * UtInitialse does not indicate any certificate + */ + modulepar boolean PICS_IS_IUT_SECURED := false; + +} // End of module LibItsGeoNetworking_Pics diff --git a/lib/LibItsGeoNetworking_Pixits.ttcn b/lib/LibItsGeoNetworking_Pixits.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..768ee778560173fa7c787345ae7297609dc1b1b8 --- /dev/null +++ b/lib/LibItsGeoNetworking_Pixits.ttcn @@ -0,0 +1,207 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn $ + * $Id: LibItsGeoNetworking_Pixits.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ + * @desc GeoNetworking PICS + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Pixits { + + // LibCommon +// import from LibCommon_DataStrings all; + import from LibCommon_BasicTypesAndValues all; + + // LibIts + import from LibItsGeoNetworking_TypesAndValues all; + + group geoNetworkingPixits { + + group gnAddresses { + + /** + * @desc GeoNetworking address of the GeoAdhoc router node A + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_A_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(10,6) + }; + + /** + * @desc GeoNetworking address of the GeoAdhoc router node B + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_B_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(11,6) + }; + + /** + * @desc GeoNetworking address of the GeoAdhoc router node C + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_C_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(12,6) + }; + + /** + * @desc GeoNetworking address of the GeoAdhoc router node D + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_D_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(13,6) + }; + + /** + * @desc GeoNetworking address of the GeoAdhoc router node E + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_E_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(14,6) + }; + + /** + * @desc GeoNetworking address of the GeoAdhoc router node F + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar GN_Address PX_TS_NODE_F_LOCAL_GN_ADDR := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := int2oct(15,6) + }; + + } // end gnAddresses + + group congestionControl { + + /** + * @desc Nr of neighbour limit to enter the "medium" congestion status value + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_MIN_NR_NEIGHBOUR := 50; + + /** + * @desc Nr of neighbour limit to enter the "maximum" congestion status value + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_MAX_NR_NEIGHBOUR := 50; + + /** + * @desc Maximum number of application retransmissions + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_APPLICATION_MAX_RETRANS := 10; + + } // end congestionControl + + group timers { + + /** + * @desc Delta for timers to reflect processing time + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar float PX_T_DELTA := 0.1; + + /** + * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = medium (cong. ctrl) + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_BEACON_SERVICE_TIMER_MEDIUM := 5000; + + /** + * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = maximum (cong. ctrl) + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_BEACON_SERVICE_TIMER_MAXIMUM := 8000; + + /** + * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = medium (cong. ctrl) + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MEDIUM := 2000; + + /** + * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = maximum (cong. ctrl) + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM := 3000; + + /** + * @desc Duration of Application retransmit timer [ms] + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER := 1000; + + /** + * @desc Duration of Application retransmit timer [ms] - medium + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM := 2000; + + /** + * @desc Duration of Application retransmit timer [ms] - maximum + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM := 3000; + + /** + * @desc The allowed delta for position checking. + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_POS_DELTA := 1; + } + + group upperLayer { + + /** + * @desc The IUT's upper layer + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar NextHeader PX_GN_UPPER_LAYER := e_any; + + /** + * @desc Is BTP header present in IUT's UT indication. Only applicable if PX_GN_UPPER_LAYER == e_btpA or e_btpB. + * @remark It may happen that IUT do not report BTP header in UT indications (due to GN/BTP merge) + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar boolean PX_BTP_IN_UT_IND := true; + + } + + group parametrisation { + + /** + * @desc Number of messages to be sent + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar integer PX_MESSAGE_COUNT := 5; + + /** + * @desc Time necessary for IUT to detect neighbours + * @see ETSI TS 102 871-3 Table B.7 + */ + modulepar float PX_NEIGHBOUR_DISCOVERY_DELAY := 1.0 + + } + + } // end geoNetworkingPixits + +} // end LibItsGeoNetworking_Pixits diff --git a/lib/LibItsGeoNetworking_Templates.ttcn b/lib/LibItsGeoNetworking_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aaabcaa5472477c4a2db5b5a4b902bd12061dc62 --- /dev/null +++ b/lib/LibItsGeoNetworking_Templates.ttcn @@ -0,0 +1,2319 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn $ + * $Id: LibItsGeoNetworking_Templates.ttcn,v 1.5 2018/05/31 15:57:10 dte Exp $ + * @desc GeoNetworking Templates + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Templates { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + + // LibItsBtp + // import from LibItsBtp_Templates all; +// import from LibItsBtp_EncdecDeclarations all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; +// import from LibItsSecurity_Pixits all; + + // LibItsIpv6OverGeoNetworking + //import from LibItsIpv6OverGeoNetworking_TypesAndValues all; + //import from LibItsIpv6OverGeoNetworking_Templates all; + + // AtsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_Pixits all; +// import from LibItsGeoNetworking_EncdecDeclarations all; + + group geoNwPrimitivesTemplates { + + /** + * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) + * @param p_geoNwMsg GeoNetworking packet to be sent + * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused + */ + template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0 + ) := { + msgOut := p_geoNwMsg, + macDestinationAddress := c_llBroadcast, + its_aid := p_its_aid + } + + /** + * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) + * @param p_geoNwMsg GeoNetworking packet to be sent + * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused + * @param p_llDestinationAdress Link-layer destination address + */ + template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0, + in template (value) MacAddress p_llDestinationAdress + ) modifies m_geoNwReq_linkLayerBroadcast := { + macDestinationAddress := p_llDestinationAdress + } + + /** + * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) + * @param p_geoNwMsg GeoNetworking packet to be received + */ + template(present) GeoNetworkingInd mw_geoNwInd( + template (present) GeoNetworkingPdu p_geoNwMsg := ? + ) := { + msgIn := p_geoNwMsg, + macDestinationAddress := ?, + ssp := *, + its_aid := * + } + + /** + * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) + * @param p_geoNwMsg GeoNetworking packet to be received + * @param p_llDestinationAdress Link-layer destination address + */ + template (present) GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination( + template (present) GeoNetworkingPdu p_geoNwMsg := ?, + template (present) MacAddress p_llDestinationAdress := ? + ) modifies mw_geoNwInd := { + macDestinationAddress := p_llDestinationAdress + } + + group utPrimitives { + + /** + * @desc Initializes the GN IUT. + */ + template (value) UtGnInitialize m_gnInitialize := { + hashedId8 := '0000000000000000'O + } + + /** + * @desc Request IUT to send a GeoUnicast message to a specific destination + * @param p_destinationGnAddr Destination of the GeoUnicast message + */ + template (value) UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := { + geoUnicast := { + gnAddress := p_destinationGnAddr, + lifetime := c_lifetime, + trafficClass := valueof(m_trafficClass), + payload := ''O + } + } + + /** + * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime + * @param p_destinationGnAddr Destination of the GeoUnicast message + * @param p_trafficClass TrafficClass of the GeoUnicast message + * @see m_generateGeoUnicastMessage + */ + template (value) UtGnTrigger m_generateGeoUnicastMessageWithTrafficClass( + GN_Address p_destinationGnAddr, + TrafficClass p_trafficClass + ) modifies m_generateGeoUnicastMessage := { + geoUnicast := { + trafficClass := p_trafficClass + } + } + + /** + * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime + * @param p_destinationGnAddr Destination of the GeoUnicast message + * @param p_lifetime Lifetime of the GeoUnicast message + * @see m_generateGeoUnicastMessage + */ + template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetime( + GN_Address p_destinationGnAddr, + UInt16 p_lifetime + ) modifies m_generateGeoUnicastMessage := { + geoUnicast := { + lifetime := p_lifetime + } + } + + /** + * @desc Request IUT to send a GeoUnicast message to a specific destination with a payload + * @param p_destinationGnAddr Destination of the GeoUnicast message + * @param p_payload Payload of the GeoUnicast message + * @see m_generateGeoUnicastMessage + */ + template (value) UtGnTrigger m_generateGeoUnicastMessageWithPayload( + GN_Address p_destinationGnAddr, + octetstring p_payload + ) modifies m_generateGeoUnicastMessage := { + geoUnicast := { + payload := p_payload + } + } + + /** + * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime with specific payload + * @param p_destinationGnAddr Destination of the GeoUnicast message + * @param p_lifetime Lifetime of the GeoUnicast message + * @param p_payload Payload of the GeoUnicast message + * @see m_generateGeoUnicastMessage + */ + template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload( + GN_Address p_destinationGnAddr, + UInt16 p_lifetime, + octetstring p_payload + ) modifies m_generateGeoUnicastMessageWithLifetime := { + geoUnicast := { + payload := p_payload + } + } + + /** + * @desc Request IUT to send a GeoBroadcast message to a specific area + * @param p_geoArea Destination area of the message + */ + template (value) UtGnTrigger m_generateGeoBroadcastMessage( + GeoArea p_geoArea + ) := { + geoBroadcast := { + shape := p_geoArea.shape, + lifetime := c_lifetime, + trafficClass := valueof(m_trafficClass), + reserved := c_uInt24Zero, + area := p_geoArea.area, + payload := ''O + } + } + + /** + * @desc Request IUT to send a GeoBroadcast message to a specific area + * @param p_geoArea Destination area of the message + * @param p_trafficClass TrafficClass of the GeoUnicast message + */ + template (value) UtGnTrigger m_generateGeoBroadcastMessageWithTrafficClass( + GeoArea p_geoArea, + TrafficClass p_trafficClass + ) modifies m_generateGeoBroadcastMessage := { + geoBroadcast := { + trafficClass := p_trafficClass + } + } + + /** + * @desc Request IUT to send a GeoBroadcast message to a specific area + * @param p_geoArea Destination area of the message + * @param p_lifetime Packet's lifetime + */ + template (value) UtGnTrigger m_generateGeoBroadcastMessageWithLifetime( + GeoArea p_geoArea, + UInt16 p_lifetime + ) modifies m_generateGeoBroadcastMessage := { + geoBroadcast := { + lifetime := p_lifetime + } + } + + /** + * @desc Request IUT to send a GeoBroadcast message to a specific area with a payload + * @param p_geoArea Destination area of the message + * @param p_payload Payload of the GeoBroadcast message + * @see m_generateGeoBroadcastMessage + */ + template (value) UtGnTrigger m_generateGeoBroadcastMessageWithPayload( + GeoArea p_geoArea, + octetstring p_payload + ) modifies m_generateGeoBroadcastMessage := { + geoBroadcast := { + payload := p_payload + } + } + + /** + * @desc Request IUT to send a GeoAnycast message to a specific area + * @param p_geoArea Destination area of the message + */ + template (value) UtGnTrigger m_generateGeoAnycastMessage( + GeoArea p_geoArea + ) := { + geoAnycast := { + shape := p_geoArea.shape, + lifetime := c_lifetime, + trafficClass := valueof(m_trafficClass), + reserved := c_uInt24Zero, + area := p_geoArea.area, + payload := ''O + } + } + + /** + * @desc Request IUT to send a GeoAnycast message to a specific area with a payload + * @param p_geoArea Destination area of the message + * @param p_trafficClass TrafficClass of the GeoUnicast message + * @see m_generateGeoAnycastMessage + */ + template (value) UtGnTrigger m_generateGeoAnycastMessageWithTrafficClass( + GeoArea p_geoArea, + TrafficClass p_trafficClass + ) modifies m_generateGeoAnycastMessage := { + geoAnycast := { + trafficClass := p_trafficClass + } + } + + /** + * @desc Request IUT to send a GeoAnycast message to a specific area with a payload + * @param p_geoArea Destination area of the message + * @param p_payload Payload of the GeoAnycast message + * @see m_generateGeoAnycastMessage + */ + template (value) UtGnTrigger m_generateGeoAnycastMessageWithPayload( + GeoArea p_geoArea, + octetstring p_payload + ) modifies m_generateGeoAnycastMessage := { + geoAnycast := { + payload := p_payload + } + } + + /** + * @desc Request IUT to send a SHB message + */ + template (value) UtGnTrigger m_generateShbMessage := { + shb := { + trafficClass := valueof(m_trafficClass), + payload := ''O + } + } + + /** + * @desc Request IUT to send a SHB message with a payload + * @param p_trafficClass TrafficClass of the GeoUnicast message + * @see m_generateShbMessage + */ + template (value) UtGnTrigger m_generateShbMessageWithTrafficClass( + TrafficClass p_trafficClass + ) modifies m_generateShbMessage := { + shb := { + trafficClass := p_trafficClass + } + } + + /** + * @desc Request IUT to send a SHB message with a payload + * @param p_payload Payload of the SHB message + * @see m_generateShbMessage + */ + template (value) UtGnTrigger m_generateShbMessageWithPayload( + octetstring p_payload + ) modifies m_generateShbMessage := { + shb := { + payload := p_payload + } + } + + /** + * @desc Request IUT to send a TSB message + */ + template (value) UtGnTrigger m_generateTsbMessage := { + tsb := { + nbHops := 10, + lifetime := c_lifetime, + trafficClass := valueof(m_trafficClass), + payload := ''O + } + } + + /** + * @desc Request IUT to send a TSB message + * @param p_lifetime Packet's lifetime + */ + template (value) UtGnTrigger m_generateTsbMessageWithLifetime( + UInt16 p_lifetime + ) modifies m_generateTsbMessage := { + tsb := { + lifetime := p_lifetime + } + } + + /** + * @desc Request IUT to send a TSB message + * @param p_trafficClass TrafficClass of the GeoUnicast message + */ + template (value) UtGnTrigger m_generateTsbMessageWithTrafficClass( + TrafficClass p_trafficClass + ) modifies m_generateTsbMessage := { + tsb := { + trafficClass := p_trafficClass + } + } + + /** + * @desc Request IUT to change its position + */ + template (value) UtGnChangePosition m_changePosition := { + latitude := 1000, + longitude := 0, + elevation := 0 + } + + } // end utPrimitives + + group taPrimitives { + + /** + * @desc Testsystem will start beaconing for the given neighbor + * @param p_beaconHeader The neighbor information + */ + template (value) AcGnPrimitive m_startBeaconing( + template (value) BeaconHeader p_beaconHeader + ) := { + startBeaconing := { + beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1) + } + } + + /** + * @desc Testsystem will stop beaconing for the given neighbor + * @param p_compName The neighbor + */ + template AcGnPrimitive m_stopBeaconing := { + stopBeaconing:= { + } + } + + /** + * @desc Testsystem will pass received to the TTCN-3 + * @param p_beaconHeader The neighbor information + */ + template (value) AcGnPrimitive m_startPassBeaconing( + in template (value) BeaconHeader p_beaconHeader + ) := { + startPassBeaconing := { + beaconHeader := p_beaconHeader + } + } + + /** + * @desc Testsystem will stop passing beacon information to the TTCN-3 + */ + template (value) AcGnPrimitive m_stopPassBeaconing := { + stopPassBeaconing := { + } + } + + /** + * @desc Testsystem will start beaconing for multiple neighbors + * @param p_beaconHeader The neighbor information + * @param p_numberOfNeighbour The number of ITS stations for which TS will send beacons + */ + template (value) AcGnPrimitive m_startBeaconingMultipleNeighbour( + template (value) BeaconHeader p_beaconHeader, + integer p_numberOfNeighbour + ) := { + startBeaconingMultipleNeighbour := { + beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1), + numberOfNeighbour := p_numberOfNeighbour + } + } + + /** + * @desc Testsystem will stop beaconing for multiple neighbors + * @param p_compName The neighbor + */ + template (value) AcGnPrimitive m_stopBeaconingMultipleNeighbour := { + stopBeaconingMultipleNeighbour:= { + } + } + + /** + * @desc Testsystem will reply the LongPosVector including the requested GN address + * found in received beacon information to the TTCN-3 + * @param p_gnAddress The GN address included in the LongPosVector + */ + template (value) AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := { + getLongPosVector := { + gnAddress := p_gnAddress + } + } + + /** + * @desc Receive template adapter control result for long position vector with specific GN_Address + * @param p_gnAddress GN_Address to be contained in the long position vector + */ + template AcGnResponse mw_getLongPosVectorAny(template (present) GN_Address p_gnAddress) := { + getLongPosVector := mw_longPosVectorAny(p_gnAddress) + } + + } // end taPrimitives + + } // geoNwPrimitivesTemplates + + group geoNwPduTemplates { + + /** + * @desc Send template for GeoNetworking PDU + * @param p_packet GnNonSecuredPacket of GeoNetworking message + * @param p_lifeTime Lifetime of GeoNetworking message (Default: m_defaultLifetime) + * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: c_defaultHopLimit) + */ + template (value) GeoNetworkingPdu m_geoNwPdu( + in template (value) GnNonSecuredPacket p_packet, + in template (value) Lifetime p_lifeTime := m_defaultLifetime, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit + ) := { + basicHeader := m_basicHeader(p_lifeTime, p_hopLimit), + gnPacket := { + packet := p_packet, + securedMsg := omit + } + } + + /** + * @desc Receive template for GeoNetworking PDU + * @param p_packet GnNonSecuredPacket of GeoNetworking message + * @param p_lifeTime Lifetime of GeoNetworking message (Default: ?) + * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: ?) + */ + template (present) GeoNetworkingPdu mw_geoNwPdu( + template (present) GnNonSecuredPacket p_packet, + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? + ) := { + basicHeader := mw_basicHeader(p_lifeTime, p_hopLimit), + gnPacket := { + packet := p_packet, + securedMsg := * + } + } + + /** + * @desc Receive template for secured GeoNetworking PDU + * @param p_secMsg Secured message + * @param p_packet Clear-text version of the packet + */ + template (present) GeoNetworkingPdu mw_geoNwSecPdu( + template (present) EtsiTs103097Data p_secMsg, + template (present) GnNonSecuredPacket p_packet := ? + ) := { + basicHeader := mw_securedBasicHeader(), + gnPacket := { + packet := p_packet, + securedMsg := p_secMsg + } + } + + /** + * @desc Send template for secured GeoNetworking PDU + * @param p_packet Clear-text version of the packet + * @param p_secMsg Secured message + */ + template (value) GeoNetworkingPdu m_geoNwSecPdu( + in template (value) GnNonSecuredPacket p_packet, + in template (value) EtsiTs103097Data p_secMsg + ) := { + basicHeader := m_securedBasicHeader(), + gnPacket := { + packet := p_packet, + securedMsg := p_secMsg + } + } + + } // end geoNwPduTemplates + + group geoNwPacketTemplates { + + /** + * @desc Send template for GeoNetworking Packet + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + */ + template (value) GeoNetworkingPacket m_geoNwPacket( + in template (value) CommonHeader p_commonHeader, + in template (value) ExtendedHeader p_extHeader + ) := { + packet := { + commonHeader := valueof(p_commonHeader), + extendedHeader := valueof(p_extHeader), + payload := char2oct("DEFAULT_PAYLOAD") + }, + securedMsg := omit + } + + /** + * @desc Send template for GeoNetworking Packet with no payload + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + * + * @see m_geoNwPacket + */ + template (value) GeoNetworkingPacket m_geoNwPacketNoPayload( + in template (value) CommonHeader p_commonHeader, + in template (value) ExtendedHeader p_extHeader + ) modifies m_geoNwPacket := { + packet := { + payload := omit + } + } + + /** + * @desc Send template for GeoNetworking Packet with payload + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + * @param p_payload Payload + * + * @see m_geoNwPacket + */ + template (value) GeoNetworkingPacket m_geoNwPacketWithPayload( + in template (value) CommonHeader p_commonHeader, + in template (value) ExtendedHeader p_extHeader, + in template (value) GnRawPayload p_payload + ) modifies m_geoNwPacket := { + packet := { + payload := p_payload + } + } + + /** + * @desc Receive template for GeoNetworking Packet + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + */ + template (present) GeoNetworkingPacket mw_geoNwPacket( + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ? + ) := { + packet := { + commonHeader := p_commonHeader, + extendedHeader := p_extHeader, + payload := * + }, + securedMsg := * + } + + /** + * @desc Receive template for GeoNetworking Packet with any payload + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + * + * @see mw_geoNwPacket + */ + template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload( + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ? + ) modifies mw_geoNwPacket := { + packet := { + payload := ? + } + } + + /** + * @desc Receive template for GeoNetworking PDU with octetstring payload + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + * @param p_payload Octetstring payload + * + * @see mw_geoNwPacket + */ + template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ?, + template (present) octetstring p_payload := ? + ) modifies mw_geoNwPacket := { + packet := { + payload := p_payload + } + } + + /** + * @desc Receive template for GeoNetworking PDU with payload + * @param p_basicHeader Common header of GeoNetworking packet + * @param p_extHeader Extended header of GeoNetworking packet + * @param p_payload Payload + * + * @see mw_geoNwPacket + */ + template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ?, + template (present) GnRawPayload p_payload := ? + ) modifies mw_geoNwPacket := { + packet := { + payload := p_payload + } + } + + group geoNwPacketTemplates_ { + + /** + * @desc Receive template for any GeoNetworking Packet + */ + template (present) GnNonSecuredPacket mw_geoNwAnyPacket := { + commonHeader := mw_commonHeader( + ?, + ? + ), + extendedHeader := *, + payload := * + } + + /** + * @desc Receive template for any GeoNetworking Packet with Payload + * @param payload Expected GN payload + */ + template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload( + template (present) GnRawPayload p_payload := ? + ) := { + commonHeader := mw_commonHeader( + ?, + ? + ), + extendedHeader := *, + payload := p_payload + } + + } // end group geoNwPacketTemplates_ + + group geoNwPacketUnicastTemplates { + + /** + * @desc Send template for GeoNetworking Unicast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) + * @param p_trafficClass Traffic Class + */ + template (value) GnNonSecuredPacket m_geoNwUnicastPacket( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationShortPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_geoUnicastHeaderType, + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_geoUnicastHeader( + p_sourceLongPosVec, + p_destinationShortPosVec, + p_seqNumber + )), + payload := valueof(char2oct("DEFAULT_PAYLOAD")) + } + + /** + * @desc Send template for GeoNetworking Unicast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) + * @param p_trafficClass Traffic Class + */ + template (value) GnNonSecuredPacket m_geoNwUnicastPacket_with_payload( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationShortPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass, + in template (value) GnRawPayload p_payload + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_geoUnicastHeaderType, + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_geoUnicastHeader( + p_sourceLongPosVec, + p_destinationShortPosVec, + p_seqNumber + )), + payload := valueof(p_payload) + } + + /** + * @desc Receive template for GeoNetworking Unicast Packet + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + */ + template (present) GnNonSecuredPacket mw_geoNwUnicastPacket( + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + mw_geoUnicastHeaderType + ), + extendedHeader := mw_geoUnicastHeader( + p_destinationShortPosVec, + p_seqNumber + ), + payload := * + } + + /** + * @desc Receive template for GeoNetworking Unicast Packet + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_hopLimit Maximum number of hops (Default: ?) + * @see mw_geoNwUnicastPacket + */ + template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithHl( + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) UInt8 p_hopLimit := ? + ) modifies mw_geoNwUnicastPacket := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + mw_geoUnicastHeaderType, + p_hopLimit + ), + extendedHeader := mw_geoUnicastHeader( + p_destinationShortPosVec, + p_seqNumber + ), + payload := ? + } + + /** + * @desc Receive template for GeoNetworking Unicast Packet + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_srcLongPosVec Long position vector of source + */ + template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithSourcePv( + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) LongPosVector p_srcLongPosVec + ) modifies mw_geoNwUnicastPacket := { + extendedHeader := mw_geoUnicastHeaderWithSourcePv( + p_destinationShortPosVec, + p_seqNumber, + p_srcLongPosVec + ) + } + + /** + * @desc Receive template for GeoNetworking Unicast Packet + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_nextHeader Id of next header + */ + template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithNextHeader( + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader + ) modifies mw_geoNwUnicastPacket := { + commonHeader := { + nextHeader := p_nextHeader + } + } + + } // end group geoNwPacketUnicastTemplates + + group geoNwPacketAnycastTemplates { + + /** + * @desc Send template for GeoNetworking Anycast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) + * @param p_trafficClass Traffic Class + */ + template (value) GnNonSecuredPacket m_geoNwAnycastPacket( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GeoAnycastArea p_anycastArea, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_geoAnycastHeaderType(valueof(p_anycastArea.geoAnycastSubType)), + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_geoAnycastHeader( + p_sourceLongPosVec, + p_seqNumber, + p_anycastArea + )), + payload := valueof(char2oct("DEFAULT_PAYLOAD")) + } + + /** + * @desc Receive template for GeoNetworking Anycast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + */ + template (present) GnNonSecuredPacket mw_geoNwAnycastPacket( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + mw_geoAnycastHeaderType + ), + extendedHeader := mw_geoAnycastHeader( + p_sourceLongPosVec, + p_seqNumber + ), + payload := ? + } + + /** + * @desc Receive template for GeoNetworking Anycast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + */ + template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithArea( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoAnycastArea p_anycastArea := ? + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType) + ), + extendedHeader := mw_geoAnycastHeaderWithArea( + p_sourceLongPosVec, + p_seqNumber, + p_anycastArea + ), + payload := ? + } + + /** + * @desc Receive template for GeoNetworking Anycast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + * @param p_maxHopLimit Maximum number of hops (Default := ?) + */ + template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaAndHl( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoAnycastArea p_anycastArea, + template (present) UInt8 p_maxHopLimit := ? + ) modifies mw_geoNwAnycastPacketWithArea := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType), + p_maxHopLimit + ) + } + + /** + * @desc Receive template for GeoNetworking Anycast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + * @param p_nextHeader Id of next header + */ + template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaWithNextHeader( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoAnycastArea p_anycastArea, + template (present) NextHeader p_nextHeader + ) modifies mw_geoNwAnycastPacketWithArea := { + commonHeader := { + nextHeader := p_nextHeader + } + } + + } // end group geoNwPacketAnycastTemplates + + group geoNwPacketBroadcastTemplates { + + /** + * @desc Send template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) + * @param p_trafficClass Traffic Class + */ + template (value) GnNonSecuredPacket m_geoNwBroadcastPacket( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GeoBroadcastArea p_broadcastArea, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_geoBroadcastHeaderType(valueof(p_broadcastArea.geoBroadcastSubType)), + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_geoBroadcastHeader( + p_sourceLongPosVec, + p_seqNumber, + p_broadcastArea + )), + payload := valueof(char2oct("DEFAULT_PAYLOAD")) + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + mw_geoBroadcastHeaderType + ), + extendedHeader := mw_geoBroadcastHeader( + p_sourceLongPosVec, + p_seqNumber + ), + payload := * + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_nextHeader Id of next header + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeader( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader + ) modifies mw_geoNwBroadcastPacket := { + commonHeader := mw_commonHeader( + p_nextHeader, + mw_geoBroadcastHeaderType + ) + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_nextHeader Id of next header + * @param p_payload payload + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeaderAndPayload( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader, + template (present) GnRawPayload p_payload + ) modifies mw_geoNwBroadcastPacketWithNextHeader := { + payload := p_payload + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithArea( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea + ) modifies mw_geoNwBroadcastPacket := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType) + ), + extendedHeader := mw_geoBroadcastHeaderWithArea( + p_sourceLongPosVec, + p_seqNumber, + p_broadcastArea + ) + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + * @param p_maxHopLimit Maximum number of hops (Default := ?) + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaAndHl( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea, + template (present) UInt8 p_maxHopLimit := ? + ) modifies mw_geoNwBroadcastPacketWithArea := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType), + p_maxHopLimit + ) + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet (Default: ?) + * @param p_hopLimit Maximum number of hops (Default: ?) + * @param p_flags Flags in the common header (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithHlAndFlags( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber := ?, + template (present) UInt8 p_hopLimit := ?, + template (present) Bit8 p_flags := ? + ) modifies mw_geoNwBroadcastPacket := { + commonHeader := mw_commonHeaderWithHopLimitAndFlags( + PX_GN_UPPER_LAYER, + mw_geoBroadcastHeaderType, + p_hopLimit, + p_flags + ) + } + + /** + * @desc Receive template for GeoNetworking Broadcast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + */ + template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaWithNextHeader( + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea, + template (present) NextHeader p_nextHeader + ) modifies mw_geoNwBroadcastPacketWithArea := { + commonHeader := { + nextHeader := p_nextHeader + } + } + + } // end group geoNwPacketBroadcastTemplates + + group geoNwPacketLsTemplates { + + /** + * @desc Send template for GeoNetworking LS Request Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of LS Request packet + * @param p_gnAddress Searched GN_Address + */ + template (value) GnNonSecuredPacket m_geoNwLsRequestPacket( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GN_Address p_gnAddress + ) := { + commonHeader := m_commonHeader( + e_any, + m_lsRequestHeaderType, + m_trafficClass, + c_defaultHopLimit + ), + extendedHeader := m_lsRequestHeader( + p_sourceLongPosVec, p_seqNumber, p_gnAddress + ), + payload := omit + } + + /** + * @desc Receive template for GeoNetworking LS Request Packet + * @param p_seqNumber Sequence number of LS Request packet + * @param p_mid Searched GN_Address MID + */ + template (present) GnNonSecuredPacket mw_geoNwLsRequestPacket( + template (present) UInt16 p_seqNumber := ?, + template (present) GN_Address.mid p_mid := ? + ) := { + commonHeader := mw_commonHeader( + e_any, + m_lsRequestHeaderType + ), + extendedHeader := mw_lsRequestHeader( + p_seqNumber, + p_mid + ), + payload := omit + } + + /** + * @desc Send template for GeoNetworking LS Reply Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationLongPosVec Long position vector of destination + * @param p_seqNumber Sequence number of LS Reply packet + */ + template (value) GnNonSecuredPacket m_geoNwLsReplyPacket( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationLongPosVec, + in template (value) UInt16 p_seqNumber + ) := { + commonHeader := m_commonHeader( + e_any, + m_lsReplyHeaderType, + m_trafficClass, + c_defaultHopLimit + ), + extendedHeader := m_lsReplyHeader( + p_sourceLongPosVec, p_destinationLongPosVec, p_seqNumber + ), + payload := omit + } + + /** + * @desc Receive template for GeoNetworking LS Reply Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationLongPosVec Short position vector of destination + */ + template (present) GnNonSecuredPacket mw_geoNwLsReplyPacket( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) ShortPosVector p_destinationLongPosVec := ? + ) := { + commonHeader := mw_commonHeader( + e_any, + m_lsReplyHeaderType + ), + extendedHeader := mw_lsReplyHeader( + p_sourceLongPosVec, p_destinationLongPosVec + ), + payload := omit + } + + } // end group geoNwPacketLsTemplates + + group geoNwPacketBeaconTemplates { + + /** + * @desc Send template for GeoNetworking Beacon Packet + * @param p_sourceLongPosVec Long position vector of source + */ + template (value) GnNonSecuredPacket m_geoNwBeaconPacket( + in template (value) LongPosVector p_sourceLongPosVec + ) := { + commonHeader := m_commonHeader( + e_any, + m_beaconHeaderType, + m_trafficClass, + c_hopLimit1 + ), + extendedHeader := m_beaconHeader( + p_sourceLongPosVec + ), + payload := omit + } + + /** + * @desc Receive template for GeoNetworking Beacon Packet + * + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_nextHeader Next header (Default: e_any) + */ + template (present) GnNonSecuredPacket mw_geoNwBeaconPacket( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) NextHeader p_nextHeader := e_any + ) := { + commonHeader := mw_commonHeader_noPayload( + p_nextHeader, + m_beaconHeaderType + ), + extendedHeader := mw_beaconHeader(p_sourceLongPosVec), + payload := '00000000000000000000'O ifpresent //(*, '00000000000000000000'O) + } + + } // end group geoNwPacketBeaconTemplates + + group geoNwPacketShbTemplates { + + /** + * @desc Send template for GeoNetworking SHB Packet + * @param p_sourceLongPosVec Long position vector of source + */ + template (value) GnNonSecuredPacket m_geoNwShbPacket( + in template (value) LongPosVector p_sourceLongPosVec + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_shbHeaderType, + m_trafficClass, + c_defaultHopLimit + )), + extendedHeader := valueof(m_shbHeader( + p_sourceLongPosVec + )), + payload := valueof(char2oct("DEFAULT_PAYLOAD")) + } + + /** + * @desc Receive template for GeoNetworking SHB Packet + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_hopLimit Maximum number of hops (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwShbPacket( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt8 p_hopLimit := ? + ) := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + m_shbHeaderType, + p_hopLimit + ), + extendedHeader := mw_shbHeader(p_sourceLongPosVec), + payload := * + } + + } // end group geoNwPacketShbTemplates + + group geoNwPacketTsbTemplates { + + /** + * @desc Send template for GeoNetworking TSB Packet + * @param p_seqNumber Sequence number of TSB packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit) + */ + template (value) GnNonSecuredPacket m_geoNwTsbPacket( + in template (value) UInt16 p_seqNumber, + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_tsbHeaderType, + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_tsbHeader( + p_seqNumber, + p_sourceLongPosVec + )), + payload := valueof(char2oct("DEFAULT_PAYLOAD")) + } + + /** + * @desc Receive template for GeoNetworking TSB Packet + * @param p_seqNumber Sequence number of TSB packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwTsbPacket( + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ? + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + m_tsbHeaderType + ), + extendedHeader := mw_tsbHeader(p_seqNumber, p_sourceLongPosVec), + payload := * + } + + /** + * @desc Receive template for GeoNetworking TSB Packet + * @param p_seqNumber Sequence number of TSB packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_hopLimit The maximum number of hops (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithHl( + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt8 p_hopLimit := ? + ) modifies mw_geoNwTsbPacket := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + m_tsbHeaderType, + p_hopLimit + ) + } + + /** + * @desc Receive template for GeoNetworking TSB Packet + * @param p_seqNumber Sequence number of TSB packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_nextHeader Id of next header + */ + template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithNextHeader( + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ?, + in template (value) NextHeader p_nextHeader + ) modifies mw_geoNwTsbPacket := { + commonHeader := { + nextHeader := p_nextHeader + } + } + + } // end group geoNwPacketTsbTemplates + + } // end group geoNwPacketTemplates + + group geoNwHeadersTemplates { + + group geoNwBasicHeaderTemplates { + + /** + * @desc Send template for Basic header + * + * @param p_lifeTime Lifetime of GeoNetworking message + * @param p_hopLimit Router Hop limit of GeoNetworking message + */ + template (value) BasicHeader m_basicHeader( + in template (value) Lifetime p_lifeTime := m_defaultLifetime, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit + ) := { + version := c_geoNwProtocolVersion, + nextHeader := e_commonHeader, + reserved := 0, + lifeTime := p_lifeTime, + routerHopLimit := p_hopLimit + } + + /** + * @desc Receive template for Basic header + * + * @param p_lifeTime Lifetime of GeoNetworking message + * @param p_hopLimit Router Hop limit of GeoNetworking message + */ + template (present) BasicHeader mw_basicHeader( + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? + ) := { + version := c_geoNwProtocolVersion, + nextHeader := ?, + reserved := ?, + lifeTime := p_lifeTime, + routerHopLimit := p_hopLimit + } + + /** + * @desc Send template for Secured Basic header + * + * @param p_lifeTime Lifetime of GeoNetworking message + * @param p_hopLimit Router Hop limit of GeoNetworking message + */ + template (value) BasicHeader m_securedBasicHeader( + in template (value) Lifetime p_lifeTime := { + multiplier := c_defaultLifetime, + ltBase := e_100s + }/*FIXME Bug TITAN ? m_defaultLifetime*/, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit + ) := { + version := c_geoNwProtocolVersion, + nextHeader := e_securedPacket, + reserved := 0, + lifeTime := p_lifeTime, + routerHopLimit := p_hopLimit + } // End of template m_securedBasicHeader + + /** + * @desc Receive template for Secured Basic header + * + * @param p_lifeTime Lifetime of GeoNetworking message + * @param p_hopLimit Router Hop limit of GeoNetworking message + */ + template (present) BasicHeader mw_securedBasicHeader( + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? + ) := { + version := c_geoNwProtocolVersion, + nextHeader := e_securedPacket, + reserved := ?, + lifeTime := p_lifeTime, + routerHopLimit := p_hopLimit + } // End of template mw_securedBasicHeader + + /** + * @desc Default send template for Lifetime field + */ + template (value) Lifetime m_defaultLifetime := { + multiplier := c_defaultLifetime, + ltBase := e_100s + } + + /** + * @desc Send template for Lifetime field (Base = 1s) + */ + template (value) Lifetime m_lifetimeBase1s( + in template (value) UInt6 p_multiplier + ) := { + multiplier := p_multiplier, + ltBase := e_1s + } + + /** + * @desc Receive template for lifetime 0 + */ + template (present) Lifetime mw_lifetime0 := { + multiplier := 0, + ltBase := ? + } + + } //end group geoNwBasicHeaderTemplates + + group geoNwCommonHeaderTemplates { + + /** + * @desc Send template for Common header + * @param p_nextHeader Id of next header + * @param p_trafficClass Packet's traffic class + * @param p_headerTypeSubType Header's type and sub-type + * @param p_hopLimit Maximum number of hops + * @remark plLength field is set to 0 and has to be computed by codec + */ + template (value) CommonHeader m_commonHeader ( + in template (value) NextHeader p_nextHeader, + in template (value) HeaderTST p_headerTypeSubType, + in template (value) TrafficClass p_trafficClass, + in template (value) UInt8 p_hopLimit + ) := { + nextHeader := p_nextHeader, + reserved := c_uInt8Zero, + headerTST := p_headerTypeSubType, + trafficClass := p_trafficClass, + flags := c_8ZeroBits, + plLength := 0, // will be computed by Codec + maxHopLimit := p_hopLimit, + reserved2 := 0 + } + + /** + * @desc Receive template for Common header + * @param p_nextHeader Id of next header + * @param p_headerTypeSubType Header's type and sub-type + */ + template (present) CommonHeader mw_commonHeader ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ? + ) := { + nextHeader := p_nextHeader, + reserved := ?, + headerTST := p_headerTypeSubType, + trafficClass := ?, + flags := ?, + plLength := ?, + maxHopLimit := ?, + reserved2 := ? + } + + /** + * @desc Receive template for Common header with no payload + * @param p_nextHeader Id of next header + * @param p_headerTypeSubType Header's type and sub-type + */ + template (present) CommonHeader mw_commonHeader_noPayload ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ? + ) modifies mw_commonHeader := { + plLength := 0 + } + + /** + * @desc Receive template for Common header with specific Hop limit + * @param p_nextHeader Id of next header + * @param p_headerTypeSubType Header's type and sub-type + * @param p_hopLimit Maximum number of hops + * @see mw_commonHeader + */ + template (present) CommonHeader mw_commonHeaderWithHopLimit ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) UInt8 p_hopLimit := ? + ) modifies mw_commonHeader := { + maxHopLimit := p_hopLimit + } + + /** + * @desc Receive template for Common header with specific Hop limit + * @param p_senderLongPosVec Long position vector of sender + * @param p_nextHeader Id of next header + * @param p_headerTypeSubType Header's type and sub-type + * @param p_hopLimit Maximum number of hops + * @param p_flags Flags in the common header + * @see mw_commonHeaderWithHopLimit + */ + template (present) CommonHeader mw_commonHeaderWithHopLimitAndFlags ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) UInt8 p_hopLimit := ?, + template (present) Bit8 p_flags := ? + ) modifies mw_commonHeaderWithHopLimit := { + flags := p_flags + } + + /** + * @desc Receive template for Common header with specific Traffic Class + * @param p_senderLongPosVec Long position vector of sender + * @param p_nextHeader Id of next header + * @param p_headerTypeSubType Header's type and sub-type + * @param p_trafficClass Packet's traffic class + */ + template (present) CommonHeader mw_commonHeaderWithTrafficClass ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) TrafficClass p_trafficClass := ? + ) modifies mw_commonHeader := { + trafficClass := p_trafficClass + } + + /** + * @desc Default send template for traffic class + */ + template (value) TrafficClass m_trafficClass ( in SCF p_scf := e_scfEnabled, in ChannelOffload p_ChOff := e_choffDisabled ) := { + scf := p_scf, + channelOffload := p_ChOff, + tcId := 0 + } + + /** + * @desc Receive template for traffic class + */ + template TrafficClass mw_trafficClass ( in template(present) SCF p_scf := ?, in template(present) ChannelOffload p_ChOff := ? ) := { + scf := p_scf, + channelOffload := p_ChOff, + tcId := ? + } + + /** + * @desc Receive template for any GN_Address + */ + template GN_Address mw_gnAddressAny := { + typeOfAddress := ?, + stationType := ?, + reserved := ?, + mid := ? + } + + /** + * @desc Receive template for GN_Address + * @param p_stationType Station's type + * @param p_reserved Station's country code + */ + template GN_Address mw_gnAddress( + template (present) StationType p_stationType, + template (present) UInt10 p_reserved + ) := { + typeOfAddress := ?, + stationType := p_stationType, + reserved := p_reserved, + mid := ? + } + + /** + * @desc Receive template for long position vector with specific GN_Address + * @param p_gnAddress GN_Address to be contained in the long position vector + */ + template (present) LongPosVector mw_longPosVectorAny( + template (present) GN_Address p_gnAddress := ? + ) := { + gnAddr := p_gnAddress, + timestamp_ := ?, + latitude := ?, + longitude := ?, + pai := ?, + speed := ?, + heading := ? + } + + /** + * @desc Receive template for long position vector with strict position check + * @param p_longPosVector The base long position vector + */ + template (present) LongPosVector mw_longPosVectorPosition( + template (present) LongPosVector p_longPosVector := ? + ) := { + gnAddr := p_longPosVector.gnAddr, + timestamp_ := ?, + latitude := f_getDelta32(valueof(p_longPosVector.latitude), PX_POS_DELTA), + longitude := f_getDelta32(valueof(p_longPosVector.longitude), PX_POS_DELTA), + pai := ?, + //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta + speed := f_getDelta15(valueof(p_longPosVector.speed), float2int(int2float(valueof(p_longPosVector.speed)) * 0.03)), + heading := p_longPosVector.heading + } + + /** + * @desc Receive template for short position vector with strict position check + * @param p_shortPosVector The base short position vector + */ + template (present) ShortPosVector mw_shortPosVectorPosition( + template (present) ShortPosVector p_shortPosVector := ? + ) := { + gnAddr := p_shortPosVector.gnAddr, + timestamp_ := ?, + latitude := f_getDelta32(valueof(p_shortPosVector.latitude), PX_POS_DELTA), + longitude := f_getDelta32(valueof(p_shortPosVector.longitude), PX_POS_DELTA) + } + + /** + * @desc Receive template for short position vector without position check + * @param p_shortPosVector The base short position vector + */ + template (present) ShortPosVector mw_shortPosVectorPosition_anyPos( + template (present) ShortPosVector p_shortPosVector := ? + ) modifies mw_shortPosVectorPosition := { + latitude := ?, + longitude := ? + } + + function f_getDelta32(Int32 p_value, integer p_delta) return template (present) Int32 { + if (p_value == c_int32Min) { + return (p_value .. p_value+p_delta); + } + if (p_value == c_int32Max) { + return (p_value-p_delta .. p_value); + } + return (p_value-p_delta .. p_value+p_delta); + } + + function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 { + log(">>> f_getDelta15: ", p_value, ", ", p_delta); + + if (p_value == c_int15Min) { + return (p_value .. p_value+p_delta); + } + if (p_value == c_int15Max) { + return (p_value-p_delta .. p_value); + } + return (p_value-p_delta .. p_value+p_delta); + } + + } // end geoNwCommonHeaderTemplates + + group geoUnicastHeaderTemplates { + + /** + * @desc Send template for GeoUnicast header + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationLongPosVec Long position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + */ + template (value) ExtendedHeader m_geoUnicastHeader( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationLongPosVec, + in template (value) UInt16 p_seqNumber + ) := { + geoUnicastHeader := { + seqNumber := p_seqNumber, + reserved := c_uInt8Zero, + srcPosVector := p_sourceLongPosVec, + dstPosVector := p_destinationLongPosVec + } + } + + /** + * @desc Receive template for GeoUnicast header + * @param p_senderLongPosVec Long position vector of sender + * @param p_destinationShortPosVec Long position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + */ + template (present) ExtendedHeader mw_geoUnicastHeader( + template (present) ShortPosVector p_destinationShortPosVec := ?, + template (present) UInt16 p_seqNumber := ? + ) := { + geoUnicastHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := ?, + dstPosVector := p_destinationShortPosVec + } + } + + /** + * @desc Receive template for GeoUnicast header with source long position vector + * @param p_destinationShortPosVec Long position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_srcLongPosVec Long position vector of source + * @see mw_geoUnicastHeader + */ + template (present) ExtendedHeader mw_geoUnicastHeaderWithSourcePv( + template (present) ShortPosVector p_destinationShortPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_srcLongPosVec := ? + ) modifies mw_geoUnicastHeader := { + geoUnicastHeader := { + srcPosVector := p_srcLongPosVec + } + } + + /** + * @desc Send template for GeoUnicast header type + */ + template (value) HeaderTST m_geoUnicastHeaderType := { + geoUnicastHdr := { + headerType := e_geoUnicast, + headerSubType := c_uInt4Zero + } + } + + /** + * @desc Receive template for GeoUnicast header type + */ + template HeaderTST mw_geoUnicastHeaderType := { + geoUnicastHdr := { + headerType := e_geoUnicast, + headerSubType := c_uInt4Zero + } + } + + } // end geoUnicastHeaderTemplates + + group geoBroadcastHeaderTemplates { + + /** + * @desc Send template for GeoBroadcast header + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + */ + template (value) ExtendedHeader m_geoBroadcastHeader( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GeoBroadcastArea p_broadcastArea + ) := { + geoBroadcastHeader := { + seqNumber := valueof(p_seqNumber), + reserved := c_uInt8Zero, + srcPosVector := valueof(p_sourceLongPosVec), + geoAreaPosLatitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude), + geoAreaPosLongitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude), + distanceA := valueof(p_broadcastArea.geoBroadcastArea.distanceA), + distanceB := valueof(p_broadcastArea.geoBroadcastArea.distanceB), + angle := valueof(p_broadcastArea.geoBroadcastArea.angle), + reserved2 := c_uInt24Zero + } + } + + /** + * @desc Receive template for GeoBroadcast header for any GeoArea + * @param p_sourceLongPosVec Long position vector of source + * @param p_senderLongPosVec Long position vector of sender + * @param p_seqNumber Sequence number of GeoBroadcast packet + */ + template (present) ExtendedHeader mw_geoBroadcastHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? + ) := { + geoBroadcastHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := p_sourceLongPosVec, + geoAreaPosLatitude := ?, + geoAreaPosLongitude := ?, + distanceA := ?, + distanceB := ?, + angle := ?, + reserved2 := ? + } + } + + /** + * @desc Receive template for GeoBroadcast header + * @param p_sourceLongPosVec Long position vector of source + * @param p_senderLongPosVec Long position vector of sender + * @param p_seqNumber Sequence number of GeoBroadcast packet + * @param p_broadcastArea Destination GeoArea + * @see mw_geoBroadcastHeader + */ + template (present) ExtendedHeader mw_geoBroadcastHeaderWithArea ( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoBroadcastArea p_broadcastArea := ? + ) modifies mw_geoBroadcastHeader := { + geoBroadcastHeader := { + geoAreaPosLatitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude, + geoAreaPosLongitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude, + distanceA := p_broadcastArea.geoBroadcastArea.distanceA, + distanceB := p_broadcastArea.geoBroadcastArea.distanceB, + angle := p_broadcastArea.geoBroadcastArea.angle + } + } + + /** + * @desc Send template for GeoBroadcast header type + * @param p_headerSubType Packet's subtype + */ + template (value) HeaderTST m_geoBroadcastHeaderType( + in template (value) HeaderSubTypeGeoBroadcast p_headerSubType + ) := { + geoBroadcastHdr := { + headerType := e_geoBroadcast, + headerSubType := p_headerSubType + } + } + + /** + * @desc Receive template for GeoBroadcast header type + */ + template (present) HeaderTST mw_geoBroadcastHeaderType := { + geoBroadcastHdr := { + headerType := e_geoBroadcast, + headerSubType := ? + } + } + + /** + * @desc Receive template for GeoBroadcast header type with sub-type + * @param p_headerSubType Packet's subtype + * @see mw_geoBroadcastHeaderType + */ + template (present) HeaderTST mw_geoBroadcastHeaderTypeWithSubType( + template (present) HeaderSubTypeGeoBroadcast p_headerSubType := ? + ) modifies mw_geoBroadcastHeaderType := { + geoBroadcastHdr := { + headerSubType := p_headerSubType + } + } + + } // end geoBroadcastHeaderTemplates + + group geoAnycastHeaderTemplates { + + /** + * @desc Send template for GeoAnycast header + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + */ + template (value) ExtendedHeader m_geoAnycastHeader( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GeoAnycastArea p_anycastArea + ) := { + geoAnycastHeader := { + seqNumber := valueof(p_seqNumber), + reserved := c_uInt8Zero, + srcPosVector := valueof(p_sourceLongPosVec), + geoAreaPosLatitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLatitude), + geoAreaPosLongitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLongitude), + distanceA := valueof(p_anycastArea.geoAnycastArea.distanceA), + distanceB := valueof(p_anycastArea.geoAnycastArea.distanceB), + angle := valueof(p_anycastArea.geoAnycastArea.angle), + reserved2 := c_uInt24Zero + } + } + + /** + * @desc Receive template for GeoAnycast header for any GeoArea + * @param p_sourceLongPosVec Long position vector of source + * @param p_senderLongPosVec Long position vector of sender + * @param p_seqNumber Sequence number of GeoAnycast packet + */ + template (present) ExtendedHeader mw_geoAnycastHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? + ) := { + geoAnycastHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := p_sourceLongPosVec, + geoAreaPosLatitude := ?, + geoAreaPosLongitude := ?, + distanceA := ?, + distanceB := ?, + angle := ?, + reserved2 := ? + } + } + + /** + * @desc Receive template for GeoAnycast header + * @param p_sourceLongPosVec Long position vector of source + * @param p_senderLongPosVec Long position vector of sender + * @param p_seqNumber Sequence number of GeoAnycast packet + * @param p_anycastArea Destination GeoArea + * @see mw_geoAnycastHeader + */ + template (present) ExtendedHeader mw_geoAnycastHeaderWithArea ( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoAnycastArea p_anycastArea := ? + ) modifies mw_geoAnycastHeader := { + geoAnycastHeader := { + geoAreaPosLatitude := p_anycastArea.geoAnycastArea.geoAreaPosLatitude, + geoAreaPosLongitude := p_anycastArea.geoAnycastArea.geoAreaPosLongitude, + distanceA := p_anycastArea.geoAnycastArea.distanceA, + distanceB := p_anycastArea.geoAnycastArea.distanceB, + angle := p_anycastArea.geoAnycastArea.angle + } + } + + /** + * @desc Send template for GeoBroadcast header type with sub-type + * @param p_headerSubType Packet's subtype + */ + template (value) HeaderTST m_geoAnycastHeaderType( + in template (value) HeaderSubTypeGeoAnycast p_headerSubType + ) := { + geoAnycastHdr := { + headerType := e_geoAnycast, + headerSubType := p_headerSubType + } + } + + /** + * @desc Receive template for GeoAnycast header type with any sub-type + */ + template (present)HeaderTST mw_geoAnycastHeaderType := { + geoAnycastHdr := { + headerType := e_geoAnycast, + headerSubType := ? + } + } + + /** + * @desc Receive template for GeoAnycast header type with sub-type + * @param p_headerSubType Packet's subtype + * @see mw_geoAnycastHeaderType + */ + template (present) HeaderTST mw_geoAnycastHeaderTypeWithSubType( + template (present) HeaderSubTypeGeoAnycast p_headerSubType := ? + ) modifies mw_geoAnycastHeaderType := { + geoAnycastHdr := { + headerSubType := p_headerSubType + } + } + + } // end geoAnycastHeaderTemplates + + group lsRequestHeaderTemplates { + + /** + * @desc Send template for LS Request header + * @param p_sourceLongPosVec Long position vector of source + * @param p_seqNumber Sequence number of LS Request packet + * @param p_gnAddress Searched GN_Address + */ + template (value) ExtendedHeader m_lsRequestHeader( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) GN_Address p_gnAddress + ) := { + lsRequestHeader := { + seqNumber := p_seqNumber, + reserved := c_uInt8Zero, + srcPosVector := p_sourceLongPosVec, + gnAddress := p_gnAddress + } + } + + /** + * @desc Receive template for LS Request header + * @param p_seqNumber Sequence number of LS Request packet + * @param p_mid Searched GN_Address MID + */ + template (present) ExtendedHeader mw_lsRequestHeader( + template (present) UInt16 p_seqNumber := ?, + template (present) GN_Address.mid p_mid := ? + ) := { + lsRequestHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := ?, + gnAddress := mw_gnAddressMid(p_mid) + } + } + + /** + * @desc Send template for LS Request header type + */ + template (value) HeaderTST m_lsRequestHeaderType := { + lsHdr := { + headerType := e_locationService, + headerSubType := e_lsRequest + } + } + + /** + * @desc Receive template for LS Request header type + */ + template HeaderTST mw_lsRequestHeaderType := { + lsHdr := { + headerType := e_locationService, + headerSubType := e_lsRequest + } + } + + } // end lsRequestHeaderTemplates + + group lsReplyHeaderTemplates { + + /** + * @desc Send template for LS Reply header + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationLongPosVec Long position vector of destination + * @param p_seqNumber Sequence number of LS Reply packet + */ + template (value) ExtendedHeader m_lsReplyHeader( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationLongPosVec, + in template (value) UInt16 p_seqNumber + ) := { + lsReplyHeader := { + seqNumber := p_seqNumber, + reserved := c_uInt8Zero, + srcPosVector := p_sourceLongPosVec, + dstPosVector := p_destinationLongPosVec + } + } + + /** + * @desc Receive template for any LS Reply header + */ + template (present) ExtendedHeader mw_lsReplyHeaderAny := { + lsReplyHeader := { + seqNumber := ?, + reserved := ?, + srcPosVector := ?, + dstPosVector := ? + } + } + + /** + * @desc Receive template for LS Reply header + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationLongPosVec Short position vector of destination + * @see mw_lsReplyHeaderAny + */ + template (present) ExtendedHeader mw_lsReplyHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) ShortPosVector p_destinationLongPosVec := ? + ) modifies mw_lsReplyHeaderAny := { + lsReplyHeader := { + srcPosVector := p_sourceLongPosVec, + dstPosVector := p_destinationLongPosVec + } + } + + + /** + * @desc Send template for LS Reply header type + */ + template (value) HeaderTST m_lsReplyHeaderType := { + lsHdr := { + headerType := e_locationService, + headerSubType := e_lsReply + } + } + + } // end lsRequestHeaderTemplates + + group beaconHeaderTemplates { + + /** + * @desc Send template for Beacon header + * @param p_sourceLongPosVec Long position vector of source + */ + template (value) ExtendedHeader m_beaconHeader( + in template (value) LongPosVector p_sourceLongPosVec + ) := { + beaconHeader := { + srcPosVector := p_sourceLongPosVec + } + } + + /** + * @desc Receive template for Beacon header + * @param p_sourceLongPosVec Long position vector of source + */ + template (present) ExtendedHeader mw_beaconHeader( + template (present) LongPosVector p_sourceLongPosVec := ? + ) := { + beaconHeader := { + srcPosVector := p_sourceLongPosVec + } + } + + /** + * @desc Send template for Beacon header type + */ + template (value) HeaderTST m_beaconHeaderType := { + beaconHdr := { + headerType := e_beacon, + headerSubType := c_uInt4Zero + } + } + + /** + * @desc Receive template for Beacon header type + */ + template HeaderTST mw_beaconHeaderType := { + beaconHdr := { + headerType := e_beacon, + headerSubType := ? + } + } + + } // end beaconHeaderTemplates + + group shbHeaderTemplates { + + /** + * @desc Send template for SHB header + * @param p_sourceLongPosVec Long position vector of sender + */ + template (value) ExtendedHeader m_shbHeader( + in template (value) LongPosVector p_sourceLongPosVec + ) := { + shbHeader := { + srcPosVector := p_sourceLongPosVec, + reserved := 0 + } + } + + /** + * @desc Receive template for SHB header + * @param p_sourceLongPosVec Long position vector of sender + */ + template (present) ExtendedHeader mw_shbHeader( + template (present) LongPosVector p_sourceLongPosVec + ) := { + shbHeader := { + srcPosVector:= p_sourceLongPosVec, + reserved := ? + } + } + + /** + * @desc Send template for SHB header type + */ + template (value) HeaderTST m_shbHeaderType := { + tsbHdr := { + headerType := e_topologicallyScopedBroadcast, + headerSubType := e_singleHop + } + } + + } // end shbHeaderTemplates + + group tsbHeaderTemplates { + + /** + * @desc Send template for TSB header + * @param p_seqNumber Sequence number of TSB packet + * @param p_srcPosVector Long position vector of source + */ + template ExtendedHeader m_tsbHeader( + in template (value) UInt16 p_seqNumber, + in template (value) LongPosVector p_srcPosVector + ) := { + tsbHeader := { + seqNumber := p_seqNumber, + reserved := c_uInt8Zero, + srcPosVector := p_srcPosVector + } + } + + /** + * @desc Receive template for TSB header + * @param p_seqNumber Sequence number of TSB packet + * @param p_sourceLongPosVec Long position vector of source + */ + template (present) ExtendedHeader mw_tsbHeader( + template (present) UInt16 p_seqNumber, + template (present) LongPosVector p_sourceLongPosVec + ) := { + tsbHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := p_sourceLongPosVec + } + } + + /** + * @desc Send template for TSB header type + */ + template (value) HeaderTST m_tsbHeaderType := { + tsbHdr := { + headerType := e_topologicallyScopedBroadcast, + headerSubType := e_multiHop + } + } + + /** + * @desc Receive template for TSB header type + */ + template (present) HeaderTST mw_tsbHeaderType := { + tsbHdr := { + headerType := e_topologicallyScopedBroadcast, + headerSubType := e_multiHop + } + } + + } // end tsbHeaderTemplates + + } // end geoNwHeadersTemplates + + group geoMiscTemplates { + + /** + * @desc Receive template for GN_Address. Only M_ID field is discriminent + * @param p_mid Expected GN Address MID + */ + template (present) GN_Address mw_gnAddressMid( + template (present) GN_Address.mid p_mid := ? + ) := { + typeOfAddress := ?, + stationType := ?, + reserved := ?, + mid := p_mid + } + + group geoDummyTemplates { + + /** + * @desc Dummy template for GN_Address + */ + template (value) GN_Address m_dummyGnAddr := { + typeOfAddress := e_manual, + stationType := e_passengerCar, + reserved := c_uInt10Zero, + mid := c_6ZeroBytes + } + + /** + * @desc Dummy template for long position vector + */ + template (value) LongPosVector m_dummyLongPosVector := { + gnAddr := m_dummyGnAddr, + timestamp_ := c_uInt32Zero, + latitude := c_uInt32Zero, + longitude := c_uInt32Zero, + pai := int2bit(1,1), + speed := c_uInt16Zero, + heading := c_uInt16Zero + } + + /** + * @desc Dummy template for Area + */ + template (value) Area m_dummyArea := { + geoAreaPosLatitude := c_uInt32Zero, + geoAreaPosLongitude := c_uInt32Zero, + distanceA := c_uInt16Zero, + distanceB := c_uInt16Zero, + angle := c_uInt16Zero + } + + /** + * @desc Dummy template for GeoBroadcastArea + */ + template (value) GeoBroadcastArea m_dummyGeoBroadcastArea := { + geoBroadcastSubType := e_geoBroadcastRect, + geoBroadcastArea := m_dummyArea + } + + } // end geoDummyTemplates + + } // end geoMiscTemplates + +} // end ItsGeoNetworking_Templates diff --git a/lib/LibItsGeoNetworking_TypesAndValues.ttcn b/lib/LibItsGeoNetworking_TypesAndValues.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..191e717de7f255e476bc54fd6076f0435a581b03 --- /dev/null +++ b/lib/LibItsGeoNetworking_TypesAndValues.ttcn @@ -0,0 +1,1224 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn $ + * $Id: LibItsGeoNetworking_TypesAndValues.ttcn,v 1.5 2018/06/26 13:54:21 dte Exp $ + * @desc Module containing types and values for GeoNetworking Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + + // LibIts + import from EtsiTs103097Module language "ASN.1:1997" all; + + group geoConfigurationValues { + + const charstring c_compIut := "IUT"; + const charstring c_compMTC := "MTC"; + const charstring c_compNodeA := "NodeA"; + const charstring c_compNodeB := "NodeB"; + const charstring c_compNodeC := "NodeC"; + const charstring c_compNodeD := "NodeD"; + const charstring c_compNodeE := "NodeE"; + const charstring c_compNodeF := "NodeF"; + + const charstring c_area1 := "AREA1"; + const charstring c_area2 := "AREA2"; + + const integer c_latitudeFactorNodeA := 10; + const integer c_latitudeFactorNodeB := 2; + const integer c_latitudeFactorNodeC := -6; + const integer c_latitudeFactorNodeD := 1; + const integer c_latitudeFactorNodeE := -1; + const integer c_latitudeFactorNodeF := 2; + const integer c_longitudeFactorNodeA := 0; + const integer c_longitudeFactorNodeB := 0; + const integer c_longitudeFactorNodeC := 0; + const integer c_longitudeFactorNodeD := 0; + const integer c_longitudeFactorNodeE := 0; + const integer c_longitudeFactorNodeF := -3; + } // end geoConfigurationValues + + group geoSyncMessages { + + const charstring c_msgSent := "Message sent"; + + } // end geoSyncMessages + + group geoTestingConstants { + + const UInt6 c_defaultLifetime := 10; // in seconds + const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds + + } // end geoTestingConstants + + group units { + + const float c_squareKm := 1000000.0; + + } // end units + + group geoConfigurationTypes { + + /** + * @desc Entry of position table + * @member key Reference key of the entry + * @member position Position vector stored in the entry + */ + type record PositionEntry { + charstring key, + LongPosVector position + } + + /** + * @desc Table containing node positions + */ + type record of PositionEntry PositionTable; + + /** + * @desc Parameters of a geometric area + * @member geoAreaPosLatitude Latitude of area's center + * @member geoAreaPosLongitude Longitude of area's center + * @member distanceA Distance A + * @member distanceB Distance B + * @member angle Angle + */ + type record Area { + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle + } + + /** + * @desc Compact definition of GeoBroadcastArea + * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) + * @member geoBroadcastArea Parameters of the geometric area + */ + type record GeoBroadcastArea { + HeaderSubTypeGeoBroadcast geoBroadcastSubType, + Area geoBroadcastArea + } + + /** + * @desc Compact definition of GeoAnycastArea + * @member geoAnycastSubType Type of GeoAnycastArea (=shape) + * @member geoAnycastArea Parameters of the geometric area + */ + type record GeoAnycastArea { + HeaderSubTypeGeoAnycast geoAnycastSubType, + Area geoAnycastArea + } + + /** + * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) + * @member shape Shape of the GeoArea + * @member area Parameters of the geometric area + */ + type record GeoArea { + GeoShape shape, + Area area + } + + /** + * @desc Geometric shapes used to define GeoAreas + */ + type enumerated GeoShape { + e_geoCircle(0), + e_geoRect(1), + e_geoElip(2), + e_reserved + } + + /** + * @desc Entry of GeoArea table + * @member key Reference key of the entry + * @member geoArea GeoArea stored in the entry + */ + type record GeoAreaEntry { + charstring key, + GeoArea geoArea + } + + /** + * @desc Table containing geoArea definitions + */ + type record of GeoAreaEntry GeoAreaTable; + + } // end geoConfigurationTypes + + group geoNwValues { + + group geoNwHeaderConstants { + + const UInt4 c_geoNwProtocolVersion := 1; + + const UInt8 c_hopLimit1 := 1; + const UInt8 c_defaultHopLimit := 10; + + } // end geoNwHeaderConstants + + } // end geoNwValues + + group geoNetworkingPdus { + + /** + * @desc GeoNetworking Packet + * + * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 + * + * @member basicHeader + * @member gnPacket + */ + type record GeoNetworkingPdu { + BasicHeader basicHeader, + GeoNetworkingPacket gnPacket + } + + type record GeoNetworkingPacket { + GnNonSecuredPacket packet, + EtsiTs103097Data securedMsg optional + } with { + encode (securedMsg) "LibItsSecurity" + } + + type octetstring GnRawPayload; + + type record GnNonSecuredPacket { + CommonHeader commonHeader, + ExtendedHeader extendedHeader optional, + GnRawPayload payload optional + } + } // end group geoNetworkingPdus + + group geoNetworkingHeader { + + group geoNetworkingBasicHeader { + + /** + * @desc Basic Header + * + *
+       *  0               1               2               3
+       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.6.1 + * + * @member version + * @member nextHeader + * @member reserved + * @member lifeTime + * @member routerHopLimit + */ + type record BasicHeader { + UInt4 version, + BasicNextHeader nextHeader, + UInt8 reserved, + Lifetime lifeTime, + UInt8 routerHopLimit + } with { + variant "FIELDORDER(msb)" + } + + type enumerated BasicNextHeader { + e_any(0), + e_commonHeader(1), + e_securedPacket(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" + } + + /** + * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. + * @member multiplier + * @member ltBase + */ + type record Lifetime { + UInt6 multiplier, + LtBase ltBase + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The base for the calculation of the lifetime. + */ + type enumerated LtBase { + e_50ms(0), + e_1s(1), + e_10s(2), + e_100s(3) + } with { + variant "FIELDLENGTH(2)" + } + + } // end group geoNetworkingBasicHeader + + group geoNetworkingCommonHeader { + + /** + * @desc Common header for GeoNetworking + * + *
+       *  0               1               2               3
+       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |              PL               |     MHL       |    Reserved   |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.7.2 + * + * @member nextHeader + * @member reserved + * @member headerTST Header type + Header Sub Type + * @member trafficClass + * @member flags + * @member plLength + * @member maxHopLimit + * @member reserved2 + */ + type record CommonHeader { + NextHeader nextHeader, + UInt4 reserved, + HeaderTST headerTST, + TrafficClass trafficClass, + Bit8 flags, + UInt16 plLength, // The Codec shall set the length of the paylaod if present + UInt8 maxHopLimit, + UInt8 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of header immediately following the Common Header (4Bits). + */ + type enumerated NextHeader { + e_any(0), + e_btpA(1), + e_btpB(2), + e_ipv6(3), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc TrafficClass + * + *
+       *  0   1   2   3   4   5   6   7
+       * +---+---+---+---+---+---+---+---+
+       * |SCF|Ch.|         TC ID         |
+       * |   |Off|                       |
+       * +---+---+---+---+---+---+---+---+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.7.5 + * + * @member scf + * @member channelOffload + * @member tcId + */ + type record TrafficClass { + SCF scf, + ChannelOffload channelOffload, + TcId tcId + } with { + variant "FIELDORDER(msb)" + } + + type enumerated SCF { + e_scfDisabled(0), + e_scfEnabled (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type enumerated ChannelOffload { + e_choffDisabled(0), + e_choffEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type UInt6 TcId; + + } // end group geoNetworkingCommonHeader + + group geoNetworkingExtendedHeaders { + + /** + * @desc GeoNetworking ExtendedHeader + * + * @see ETSI EN 302 636-4-1 chapter 8.3 + * + * @member commonHeader + * @member gnExtHeader + */ + type union ExtendedHeader { + GeoUnicastHeader geoUnicastHeader, + TSBHeader tsbHeader, + SHBHeader shbHeader, + GeoBroadcastHeader geoBroadcastHeader, + GeoAnycastHeader geoAnycastHeader, + BeaconHeader beaconHeader, + LSRequestHeader lsRequestHeader, + LSReplyHeader lsReplyHeader, + AnyHeader anyHeader + } with { + variant "" + } + + /** + * @desc The unspecified ANY header. + * + * @member seqNumber + * @member reserved + */ + type record AnyHeader { + UInt16 seqNumber, + UInt16 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The BEACON packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.6 + * + * @member commonHeader + */ + type record BeaconHeader { + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOANYCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type record GeoAnycastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle, + UInt16 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOBROADCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type GeoAnycastHeader GeoBroadcastHeader; + + /** + * @desc The GEOUNICAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.2 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record GeoUnicastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Reply packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.8 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record LSReplyHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Request packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.7 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member gnAddress + */ + type record LSRequestHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + GN_Address gnAddress + } with { + variant "FIELDORDER(msb)" + } + + /** + * The Single Hop Broadcast (SHB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.4 + * + * @member srcPosVector + * @member reserved + */ + type record SHBHeader { + LongPosVector srcPosVector, + UInt32 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Topologically-Scoped Broadcast (TSB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.3 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + */ + type record TSBHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingHeadersSubtypes { + + /** + * @desc Identifies the header type and the header subtype for ANY. + * @member headerType + * @member reserved + */ + type record AnyHeaderType { + HeaderType headerType(e_any), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for BEACON. + * @member headerType + * @member reserved + */ + type record BeaconHeaderType { + HeaderType headerType(e_beacon), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOANYCAST. + * @member headerType + * @member reserved + */ + type record GeoAnycastHeaderType { + HeaderType headerType(e_geoAnycast), + HeaderSubTypeGeoAnycast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOBROADCAST. + * @member headerType + * @member reserved + */ + type record GeoBroadcastHeaderType { + HeaderType headerType(e_geoBroadcast), + HeaderSubTypeGeoBroadcast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOUNICAST. + * @member headerType + * @member reserved + */ + type record GeoUnicastHeaderType { + HeaderType headerType(e_geoUnicast), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Location Service LS. + * @member headerType + * @member reserved + */ + type record LsHeaderType { + HeaderType headerType(e_locationService), + HeaderSubTypeLs headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. + * @member headerType + * @member headerSubType + */ + type record TsbHeaderType { + HeaderType headerType(e_topologicallyScopedBroadcast), + HeaderSubTypeTSB headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header subtype for GEOANYCAST. + */ + type enumerated HeaderSubTypeGeoAnycast { + e_geoAnycastCircle(0), + e_geoAnycastRect(1), + e_geoAnycastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for GEOBROADCAST. + */ + type enumerated HeaderSubTypeGeoBroadcast { + e_geoBroadcastCircle(0), + e_geoBroadcastRect(1), + e_geoBroadcastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. + */ + type enumerated HeaderSubTypeTSB { + e_singleHop(0), + e_multiHop(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Location Service LS. + */ + type enumerated HeaderSubTypeLs { + e_lsRequest(0), + e_lsReply(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Service Announcement SA. + */ + type enumerated HeaderSubTypeSa { + e_sa(0), + e_saEos(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header type and the header subtype. + * @member anyHdr + * @member beaconHdr + * @member geoUnicastHdr + * @member geoAnycastHdr + * @member geoBroadcastHdr + * @member tsbHdr + * @member lsHdr + * @member saHdr + * @member reserved + */ + type union HeaderTST { + AnyHeaderType anyHdr, + BeaconHeaderType beaconHdr, + GeoUnicastHeaderType geoUnicastHdr, + GeoAnycastHeaderType geoAnycastHdr, + GeoBroadcastHeaderType geoBroadcastHdr, + TsbHeaderType tsbHdr, + LsHeaderType lsHdr, + UInt8 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of the GeoAdhoc header type (4Bits). + */ + type enumerated HeaderType { + e_any(0), + e_beacon(1), + e_geoUnicast(2), + e_geoAnycast(3), + e_geoBroadcast(4), + e_topologicallyScopedBroadcast(5), + e_locationService(6), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Long Position Vector + * + *
+         *  0               1               2               3
+         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                           GN_ADDR                             |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             TST                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Lat                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Long                              |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |P|              S              |               H               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.5.2 + * + * @member gnAddr + * @member timestamp_ + * @member latitude + * @member longitude + * @member pai Position Accuracy Indicator + * @member speed + * @member heading + */ + type record LongPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude, + Bit1 pai, + Int15 speed, + UInt16 heading + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Short Position Vector + * + *
+         *  0               1               2               3
+         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                           GN_ADDR                             |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             TST                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Lat                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Long                              |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.5.3 + * + * @member gnAddr + * @member timestamp + * @member latitude + * @member longitude + */ + type record ShortPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddress { + /** + * @desc GeoNetworking address + * + *
+           *  0               1               2               3
+           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * |M|  S_T    |       S_CC        |             M_ID              |
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * |                              M_ID                             |
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * 
+ * + * @see ETSI EN 302 636-4-1 chapter 6.2 + * + * @member typeOfAddress + * @member stationType + * @member mid + */ + type record GN_Address { + TypeOfAddress typeOfAddress, + StationType stationType, + UInt10 reserved, + Oct6 mid + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddressSubtypes { + + /** + * @desc Identifies the ITS station (5Bits). + */ + type enumerated StationType { + e_unknown(0), + e_pedestrian(1), + e_cyclist(2), + e_moped(3), + e_motorcycle(4), + e_passengerCar(5), + e_bus(6), + e_lightTruck(7), + e_heavyTruck(8), + e_trailer(9), + e_specialVehicle(10), + e_tram(11), + e_roadSideUnit(15) + } with { + variant "FIELDLENGTH(5)" //variant "5 bit" + } + + /** + * @desc Distinguish between manually configured + * network address and the initial GeoNetwork address (1Bit). + */ + type enumerated TypeOfAddress { + e_manual(1), + e_initial(0) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + + } // end group geoNetworkingAddressSubtypes + + } // end group geoNetworkingAddress + + } // end group geoNetworkingHeadersSubtypes + + } // end group geoNetworkingExtendedHeaders + + } // end group geoNetworkingHeader + + group geoNwPicsTypes { + + /** + * @desc The GeoUnicast forwarding algorithm. + */ + type enumerated NonAreaForwardingAlgorithm { + e_unspecified(0), + e_greedy(1), + e_cbf(2) + } + + /** + * @desc The GeoBroadcast forwarding algorithm. + */ + type enumerated AreaForwardingAlgorithm { + e_unspecified(0), + e_simple(1), + e_cbf(2), + e_advanced(3) + } + + /** + * @desc GN address configuration method. + */ + type enumerated GnAddressConfigurationMethod { + e_auto(0), + e_managed(1), + e_anonymous(2) + } + + } // end geoNwPicsTypes + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtGnInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the GeoNetworking IUT + * @member utGnInitialize - + * @member utGnTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utGnChangePositionResult - + */ + type union UtGnResults { + boolean utGnInitializeResult, + boolean utGnTriggerResult, + boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component + boolean utGnChangePositionResult + } with { + variant "" + } // End of type UtGnResults + + /** + * @desc AutoInterop UpperTester trigger + * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). + */ + type union UtAutoInteropTrigger { + boolean utRadioOnOff + } with { + variant "" + } // End of type UtAutoInteropTrigger + + /** + * @desc Upper Tester message to change the position of IUT. Values a relatives + */ + type record UtGnChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitives for GeoNetworking + * @member geoUnicast - + * @member geoBroadcast - + * @member geoAnycast - + * @member shb - + * @member tsb - + * @member changePosition - + * @member checkPacket - + */ + type union UtGnTrigger { + GenerateGeoUnicastMessage geoUnicast, + GenerateGeoBroadcastMessage geoBroadcast, + GenerateGeoAnycastMessage geoAnycast, + GenerateSHBMessage shb, + GenerateTSBMessage tsb + } with { + variant "" + } + + /** + * @desc UT primitive for IUT to send a GeoUnicast packet + * @member gnAddress Destination of the packet + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoUnicastMessage { + GN_Address gnAddress, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a GeoBroadcast packet + * @member shape Shape of the area + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member area Destination GeoArea + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoBroadcastMessage { + GeoShape shape, + UInt16 lifetime, + TrafficClass trafficClass, + UInt24 reserved, + Area area, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a Geoanycast packet + */ + type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateSHBMessage { + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member nbHops Number of Hops + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateTSBMessage { + UInt8 nbHops, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check Upper Layer message transmission on GN IUT + */ + type record UtGnEventInd { + GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT + */ + type record of UtGnEventInd UtGnEventIndList; + + } // end utPrimitives + with { + encode "UpperTester"; + variant "" + } + + group acPrimitives { + + /** + * @desc TA primitives for GeoNetworking + * @member startBeaconing - + * @member stopBeaconing - + * @member startPassBeaconing - + * @member stopPassBeaconing - + * @member startBeaconingMultipleNeighbour - + * @member stopBeaconingMultipleNeighbour - + * @member getLongPosVector - + */ + type union AcGnPrimitive { + AcStartBeaconing startBeaconing, + AcStopBeaconing stopBeaconing, + AcStartPassBeaconing startPassBeaconing, + AcStopPassBeaconing stopPassBeaconing, + AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, + AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, + AcGetLongPosVector getLongPosVector + } with { + variant "" + } + + /** + * @desc Primitive for receiveing response from TA + * @member getLongPosVector + */ + type union AcGnResponse { + LongPosVector getLongPosVector, + AcGnResponseFailure failure + } + with { + variant "" + encode(getLongPosVector) "LibItsGeoNetworking" + } + + type record AcGnResponseFailure { + boolean failure + } + + /** + * @desc Primitive for TA to start sending beacons for the test component + * @member beaconHeader Beacon template + */ + type record AcStartBeaconing { + GeoNetworkingPdu beaconPacket + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + } + + /** + * @desc Primitive for TA to stop sending beacons for the test component + */ + type record AcStopBeaconing { + } + + /** + * @desc Primitive for TA to start enqueueing received beacons + * @member beaconHeader Filter + */ + type record AcStartPassBeaconing { + BeaconHeader beaconHeader + } + with { + encode(beaconHeader) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop enqueueing received beacons + */ + type record AcStopPassBeaconing { + } + + /** + * @desc Primitive for TA to start sending beacons for multiple neighbours + * @member beaconHeader Beacon template + * @member numberOfNeighbour Number of neighbours to simulate + */ + type record AcStartBeaconingMultipleNeighbour { + GeoNetworkingPdu beaconPacket, + integer numberOfNeighbour + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop sending beacons for multiple neighbours + */ + type record AcStopBeaconingMultipleNeighbour { + } + + /** + * @desc Primitive for retrieving the position vector corresponding to a specific GN address + * @member gnAddress GN address to be searched + */ + type record AcGetLongPosVector { + GN_Address gnAddress + } + with { + encode(gnAddress) "LibItsGeoNetworking" + }; + + } // end acPrimitives + with { + variant "" + encode "AdapterControl" + } + + group networkAndTransportPrimitives { + + group nt2Primitives { + + /** + * @desc NT2 GeoNetworking Indication Primitive + */ + type record GeoNetworkingInd { + GeoNetworkingPdu msgIn, + MacAddress macDestinationAddress, + Bit256 ssp optional, + UInt32 its_aid optional + } with { + //encode "RAW"; + variant "FIELDORDER(msb)" + } + + /** + * @desc NT2 GeoNetworking Request Primitive + */ + type record GeoNetworkingReq { + GeoNetworkingPdu msgOut, + MacAddress macDestinationAddress, + UInt32 its_aid + } with { + //encode "RAW"; + variant "FIELDORDER(msb)" + } + + } // end nt2Primitives + + } // End of group networkAndTransportPrimitives + with { + variant "" + encode "LibIts_Interface" + } // end interfacePrimitives + +} +with { + variant "" + encode "LibItsGeoNetworking" + } diff --git a/lib/module.mk b/lib/module.mk new file mode 100644 index 0000000000000000000000000000000000000000..abd644c771297c348d1a725b41fe6f275ce43a6b --- /dev/null +++ b/lib/module.mk @@ -0,0 +1,6 @@ +sources := \ + LibItsGeoNetworking_EncdecDeclarations.ttcn \ + LibItsGeoNetworking_Pics.ttcn \ + LibItsGeoNetworking_Pixits.ttcn \ + LibItsGeoNetworking_Templates.ttcn \ + LibItsGeoNetworking_TypesAndValues.ttcn \ diff --git a/lib_system/LibItsGeoNetworking_Functions.ttcn b/lib_system/LibItsGeoNetworking_Functions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bbd413457f0d1b388d02299c70b8f8e1096c0916 --- /dev/null +++ b/lib_system/LibItsGeoNetworking_Functions.ttcn @@ -0,0 +1,2836 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF 538 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn $ + * $Id: LibItsGeoNetworking_Functions.ttcn 1329 2017-02-21 14:48:18Z berge $ + * @desc Module containing functions for GeoNetworking + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Functions { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibIts + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + // import from LibItsCommon_TestSystem all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_Templates all; + import from LibItsSecurity_Functions all; + import from LibItsSecurity_Pixits all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_Templates all; + import from LibItsGeoNetworking_Pixits all; + import from LibItsGeoNetworking_Pics all; + + group utFuntions { + + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Requests to change the position of the IUT + */ + function f_utChangePosition() runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(m_changePosition); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position changed ***"); + } + [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Triggers event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { + + // Variables + var boolean v_return := true; + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { + tc_wait.stop; + log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + v_return := false; + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + return v_return; + } + + } // End of group utFunctions + + group geoConfigurationFunctions { + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - two ITS nodes (nodeA, nodeB) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + */ + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + + // Map + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + map(self:geoNetworkingPort, system:geoNetworkingPort); + + // Connect + f_connect4SelfOrClientSync(); + activate(a_cf01Down()); + + // Initialise secured mode + f_initialiseSecuredMode(); + + //Initialze the IUT + f_initialState(p_scenario); + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); + + } // End of function f_cf01Up + + function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_uninitialiseSecuredMode(); + + // Unmap + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + unmap(self:geoNetworkingPort, system:geoNetworkingPort); + + // Disconnect + f_disconnect4SelfOrClientSync(); + + } // End of function f_cf01Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeB and NodeD + * NodeB being close to the area center + * + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf02Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // End of function f_cf02Up + + /** + * @desc Deletes configuration cf02 + */ + function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf02Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA (NodeB) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf03Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // End of function f_cf03Up + + /** + * @desc Deletes configuration cf03 + */ + function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf03Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA and having + * shortest distance to NodeA (NodeB) + * - one ITS node in direction of NodeA (NodeD) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeA, NodeB and NodeD + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf04Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // End of function f_cf04Up + + /** + * @desc Deletes configuration cf04 + */ + function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf04Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * longest distance to NodeB (NodeE) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf05Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf05 + */ + function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf05Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * shortest distance to NodeB (NodeF) + * - Area1 which only includes NodeB, NodeD and IUT + * - IUT not in sectorial area of NodeB-NodeF + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf06Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf06Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node in direction of NodeB and having + * shortest distance to NodeB (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf07Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // End of function f_cf07Down + + /** + * @desc Behavior function for initializing component's variables and tables + * @param p_positionTable Table containing position vectors of all nodes + * @param p_areaTable Table containing all defined geoAreas + * @param p_componentName Name of the component + */ + function f_initialiseComponent( + in PositionTable p_positionTable, + in GeoAreaTable p_areaTable, + in charstring p_componentName) + runs on ItsGeoNetworking { + + vc_positionTable := p_positionTable; + vc_areaTable := p_areaTable; + vc_componentName := p_componentName; + + vc_localSeqNumber := f_getInitialSequenceNumber(); + vc_multipleMessagesCount := f_getMessageCount(); + + } // End of function f_initialiseComponent + + /** + * @desc Makes the simulated ITS node behave as a neighbour of IUT + */ + function f_startBeingNeighbour() runs on ItsGeoNetworking { + + vc_neighbourDefault := activate(a_neighbourDefault()); + f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); + f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); + } // End of function f_startBeingNeighbour + + /** + * @desc Makes the simulated ITS node behave as not being a neighbour of IUT + */ + function f_stopBeingNeighbour() runs on ItsGeoNetworking { + + f_acTriggerEvent(m_stopBeaconing); + if (PICS_GN_SECURITY == true) { + deactivate(vc_neighbourDefault); + } + } // End of function f_stopBeingNeighbour + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY == true) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + } else if (PICS_IS_IUT_SECURED == true) { + if(e_success != f_acEnableSecurity()){ + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { + if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + f_acDisableSecurity(); + } + } // End of function f_uninitialiseSecuredMode() + + } // End of group geoConfigurationFunctions + + group componentFunctions { + /** + * @desc Get the component corresponding to a key + * @param p_componentName Name searched component + * @return ItsGeoNetworking - The searched position vector + */ + function f_getComponent( + in charstring p_componentName + ) runs on ItsMtc + return ItsGeoNetworking { + + var ItsGeoNetworking v_return := null; + var integer i := 0; + + for (i:=0; i value v_ind { + //store every upper tester indication received + //log("################# v_ind: ", v_ind); + vc_utInds[lengthof(vc_utInds)] := v_ind; + //log("################# vc_utInds: ", vc_utInds); + //log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); + repeat; + } + [vc_utDefaultActive] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); + repeat; + } + } + + /** + * @desc Default handling cf01 de-initialisation. + */ + altstep a_cf01Down() runs on ItsGeoNetworking { + [] a_shutdown() { + f_poDefault(); + f_cf01Down(); + log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf02 de-initialisation. + */ + altstep a_cf02Down() runs on ItsMtc { + [] a_shutdown() { + f_cf02Down(); + log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf03 de-initialisation. + */ + altstep a_cf03Down() runs on ItsMtc { + [] a_shutdown() { + f_cf03Down(); + log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf04 de-initialisation. + */ + altstep a_cf04Down() runs on ItsMtc { + [] a_shutdown() { + f_cf04Down(); + log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf05 de-initialisation. + */ + altstep a_cf05Down() runs on ItsMtc { + [] a_shutdown() { + f_cf05Down(); + log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf06 de-initialisation. + */ + altstep a_cf06Down() runs on ItsMtc { + [] a_shutdown() { + f_cf06Down(); + log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf07 de-initialisation. + */ + altstep a_cf07Down() runs on ItsMtc { + [] a_shutdown() { + f_cf07Down(); + log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + group geoGeoUnicastAltsteps { + + /** + * @desc Receive GeoUnicast packet + * @param p_sourceLongPosVec Expected source position vector + * @param p_destinationShortPosVec Expected destination position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoUnicast( + in template (present) ShortPosVector p_destinationShortPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + p_destinationShortPosVec, + p_seqNumber)))) { + } + } + + /** + * @desc Receive GeoUnicast packet for specific destination + * @param p_destinationShortPosVec Expected destination position vector + */ + altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} + } + + /** + * @desc Receive any GeoUnicast packet + */ + altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} + } + + } // End of group geoGeoUnicastAltsteps + + group geoGeoBroadcastAltsteps { + + /** + * @desc Receive GeoBroadcast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoBroadcast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoBroadcast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + * @param p_routerHopLimit Expected router hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoBroadcastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea, + in template (present) UInt8 p_routerHopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea, + p_maxHopLimit + ), + -, + p_routerHopLimit + ))) { + } + } + + /** + * @desc Receive GeoBroadcast packet for specific Geobroadcast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + */ + altstep a_receiveGeoBroadcastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea + )))) { + } + } + + } // End of group geoGeoBroadcastAltsteps + + group geoGeoAnycastAltsteps { + + /** + * @desc Receive GeoAnycast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoAnycast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) LongPosVector p_senderLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoAnycast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + * @param p_hopLimit Expected hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoAnycastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea, + in template (present) UInt8 p_hopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + ), + -, + p_hopLimit + ))) { + } + } + + /** + * @desc Receive GeoAnycast packet for specific GeoAnycast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + */ + altstep a_receiveGeoAnycastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + )))) { + } + } + + } // End of group geoGeoAnycastAltsteps + + group geoLocationServiceAltsteps { + + /** + * @desc Receive Location Service Request + * @param p_seqNumber Expected sequence number of the received LS Request + * @param p_mid GN address expected in received LS Request + * @param p_reqSrcPosVector Expected source position vector of the received LS Request + */ + altstep a_receiveLsRequest( + in template (present) UInt16 p_seqNumber, + in template (present) GN_Address.mid p_mid, + out LongPosVector p_reqSrcPosVector + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_msg; + + [vc_gnDefaultActive] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsRequestPacket( + p_seqNumber, + p_mid + ) + ) + ) + ) -> value v_msg { + p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); + } + } + + /** + * @desc Receive any Location Service Request + */ + altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { + var LongPosVector v_reqSrcPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} + } + + /** + * @desc Receive any Location Service Reply + */ + altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { + //ignore and repeat + repeat; + } + } + + /** + * @desc Receive Location Service Request and send Location Service Reply + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + */ + altstep a_receiveLsRequestAndReply( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking { + var LongPosVector v_repDstPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + p_repSrcPosVector, + f_longPosVector2ShortPosVector(v_repDstPosVector), + vc_localSeqNumber + ))))); + } + } + + } // End of group geoLocationServiceAltsteps + + + } // End of group geoAltsteps + + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsGeoNetworking { + activate(a_default()); + activate(a_utDefault()); + } + + /** + * @desc Preamble for non-neighbour nodes + */ + function f_prNonNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + } + + /** + * @desc Preamble for neighbour nodes + */ + function f_prNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + f_startBeingNeighbour(); + f_sleep(0.5); + } + + /** + * @desc Brings the IUT into an initial state. + * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used + */ + function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { + + if (PICS_GN_SECURITY) { + var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + if (oct2int(v_hashedId8ToBeUsed) == 0) { + v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates + } + f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); + } // else, default behavior + else { + f_utInitializeIut(m_gnInitialize); + } + f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); + + f_acLoadScenario(p_scenario); + f_acStartScenario(); + f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); + } + + /** + * @desc Receive and reply to LS Requests + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + function f_handleLocationService( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + + tc_ac.start; + alt { + [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector) {//Spirent removed, p_repSenderPosVector) { + tc_ac.stop; + } + } + + } + + /** + * @desc Send LS request and receive LS Reply + * @param p_reqSrcPosVector Source position vector of the sent LS Request + * @param p_reqSeqNumber Sequence number of the sent LS Request + * @param p_gnAddress GN address for which the LS Request is sent + * @param p_repSrcPosVector Expected source position vector in received LS Response + * @return FncRetCode + */ + function f_processLocationService( + in template (value) LongPosVector p_reqSrcPosVector, + in template (value) UInt16 p_reqSeqNumber, + in template (value) GN_Address p_gnAddress, + out LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_error; + var GeoNetworkingInd v_msg; + + f_sendGeoNetMessage( + valueof( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + p_reqSrcPosVector, + p_reqSeqNumber, + p_gnAddress + ) + ) + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + ?, + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) + ) + ) + ) + ) -> value v_msg { + tc_ac.stop; + p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); + v_ret := e_success; + } + } + + return v_ret; + } + + } // End of group preambles + + group postambles { + + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsGeoNetworking { + f_acStopScenario(); + } + + /** + * @desc Postamble for neighbour nodes + */ + function f_poNeighbour() runs on ItsGeoNetworking { + f_stopBeingNeighbour(); + f_poDefault(); + } + + } // End of group postambles + + group adapterControl { + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + + return v_ret; + } + + /** + * @desc Get the position vector corresponding to a specific GN address + * @param p_gnAddress GN address for which the search is performed + * @return LongPosVector - IUT's position + */ + function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { + var AcGnResponse v_result; + + f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); + tc_ac.start; + alt { + [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_result.getLongPosVector; + } + + /** + * @desc Triggers test adapter to send beacons for multiple neighbours + * @param p_numberOfNeighbour Number of neighbours to simulate + * @return FncRetCode + */ + function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { + + return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); + + } + + /** + * @desc Triggers test adapter to enable security support + * @return FncRetCode + */ + function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + return e_error; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); + } + return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); + } + + /** + * @desc Triggers test adapter to disable security support + * @return FncRetCode + */ + function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + + f_unloadCertificates(); + + return f_acTriggerSecEvent(m_acDisableSecurity); + + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent( + in template (value) AcSecPrimitive p_event + ) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acGnssResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Loads the given scenario + * + * @param p_scenario The scenario to load. + */ + function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_loadScenario(p_scenario)); + } + } // End of function f_acLoadScenario + + /** + * @desc Starts a loaded scenario + */ + function f_acStartScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_startScenario); + vc_scenarioStarted := true; + } + } // End of function f_acStartScenario + + /** + * @desc Stops a loaded scenario + */ + function f_acStopScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_stopScenario); + vc_scenarioStarted := false; + } + } // End of function f_acStopScenario + + function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); + + tc_ac.start(int2float(p_time)*1.1); + alt { + [] acPort.receive(m_acGnssTimeReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // End of function f_acAwaitTimeInRunningScenario + + } // End of group adapterControl + + group commonFunctions { + + /** + * @desc Gets the value of the lifetime in seconds. + * @param p_lifetime Lifetime to be converted + * @return Lifetime in seconds + */ + function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { + var float v_lifetime := 0.0; + + select (p_lifetime.ltBase) { + case (e_50ms) { + v_lifetime := int2float(p_lifetime.multiplier) * 0.5; + } + case (e_1s) { + v_lifetime := int2float(p_lifetime.multiplier) * 1.0; + } + case (e_10s) { + v_lifetime := int2float(p_lifetime.multiplier) * 10.0; + } + case (e_100s) { + v_lifetime := int2float(p_lifetime.multiplier) * 100.0; + } + } + + return v_lifetime; + } + + /** + * @desc Computes GN timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + function f_computeGnTimestamp() return UInt32 { + + // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) + var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; + return v_timestamp; + } + + } // End of group commonFunctions + + group testerFunctions { + + /** + * @desc Gets the tester GN local address for a specific node + * @param p_node Simulated node + * @return GN address of simulated node + */ + function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { + var GN_Address v_gnAddr := valueof(m_dummyGnAddr); + + select (p_node) { + case (c_compNodeA) { + v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; + } + case (c_compNodeB) { + v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; + } + case (c_compNodeC) { + v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; + } + case (c_compNodeD) { + v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; + } + case (c_compNodeE) { + v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; + } + case (c_compNodeF) { + v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; + } + case else { + log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); + } + } + + return v_gnAddr; + } + + /** + * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + */ + function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + * @param p_payload The payload to include. + */ + function f_sendGeoNetMessageWithPayload( + in template (value) GeoNetworkingReq p_geoNetReq, + in template (value) GnRawPayload p_payload + ) runs on ItsGeoNetworking { + p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetInd The message to receive. + * @param p_payload The payload to include. + */ + function f_receiveGeoNetMessageWithPayload( + in template (present) GeoNetworkingInd p_geoNetInd, + in template (present) GnRawPayload p_payload + ) return template (present) GeoNetworkingInd { + var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; + + v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; + + return v_geoNetInd; + } + + /** + * @desc Sets the value of the sequence number for the next event. + */ + function f_setLocalSequenceNumber() runs on ItsGeoNetworking { + vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; + } + + /** + * @desc Creates an initial seqence number + * @return Time based initial sequence number (increasing with time) + */ + function f_getInitialSequenceNumber() return UInt16 { + + return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; + } + + /** + * @desc Number of messages to be sent + * @return Number of messages to be sent + */ + function f_getMessageCount() return integer { + return PX_MESSAGE_COUNT; + } + + } // End of group testerFunctions + + group iutFunctions { + + /** + * @desc Gets the IUT GN local address + * @return IUT's GN_Address + * @see PICS_GN_LOCAL_GN_ADDR + */ + function f_getIutGnLocalAddress() return GN_Address { + + return PICS_GN_LOCAL_GN_ADDR; + } + + /** + * @desc Gets the IUT GN local address configuration method + * @return GnAddressConfigurationMethod - IUT's GN local address configuration method + * @see PICS_GN_LOCAL_ADDR_CONF_METHOD + */ + function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { + return PICS_GN_LOCAL_ADDR_CONF_METHOD; + } + + /** + * @desc Gets the IUT MAc address + * @return MacAddress - IUT's MAc Address + * @see PICS_IUT_MAC_ADDRESS + */ + function f_getIutMacAddress() return MacAddress { + return PICS_IUT_MAC_ADDRESS; + } + + /** + * @desc Gets the GeoUnicast forwarding algorithm + * @return IUT's GeoUnicast forwarding algorithm + * @see PICS_GN_NON_AREA_FORWARDING_ALGORITHM + */ + function f_getNonAreaForwardingAlgorithm() return NonAreaForwardingAlgorithm { + return PICS_GN_NON_AREA_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the GeoBroadcast forwarding algorithm + * @return IUT's GeoBroadcast forwarding algorithm + * @see PICS_GN_AREA_FORWARDING_ALGORITHM + */ + function f_getAreaForwardingAlgorithm() return AreaForwardingAlgorithm { + return PICS_GN_AREA_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the IUT default hop limit + * @return IUT's default hop limit + * @see PICS_GN_DEFAULT_HOP_LIMIT + */ + function f_getDefaultHopLimit() return UInt8 { + return PICS_GN_DEFAULT_HOP_LIMIT; + } + + /** + * @desc Is the ITS-S mobile or stationary? + * @return Flags indicating whether the ITS-S is mobile or stationary. + * @see PICS_GN_IS_MOBILE + */ + function f_isMobile() return Bit8 { + if (PICS_GN_IS_MOBILE) { + return '10000000'B; + } + return '00000000'B; + } + + /** + * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). + * @return LS retransmission timer in seconds + * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER + */ + function f_getLsRetransmitTimer() return float { + var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationServiceRetransmitTimer; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). + * @return LS retransmission timer (medium) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM + */ + function f_getLsRetransmitTimerMedium() return float { + var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). + * @return LS retransmission timer (maximum) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM + */ + function f_getLsRetransmitTimerMaximum() return float { + var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). + * @return App retransmission timer in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER + */ + function f_getAppRetransmitTimer() return float { + var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationApplicationRetransmitTimer; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). + * @return App retransmission timer (medium) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM + */ + function f_getAppRetransmitTimerMedium() return float { + var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMedium; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). + * @return App retransmission timer (maximum) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM + */ + function f_getAppRetransmitTimerMaximum() return float { + var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMaximum; + } + + /** + * @desc Gets the LS maximum retransmission number. + * @return LS maximum retransmission number + * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS + */ + function f_getLsMaxRetrans() return integer { + var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; + + return v_itsGnLocationServiceMaxRetrans; + } + + /** + * @desc Gets the Application maximum retransmission number. + * @return Application maximum retransmission number + * @see PX_GN_APPLICATION_MAX_RETRANS + */ + function f_getAppMaxRetrans() return integer { + var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; + + return v_itsGnApplicationMaxRetrans; + } + + /** + * @desc Gets the Location Service packet buffer size. + * @return Location Service packet buffer size in Kbytes + * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE + */ + function f_getLsPacketBufferSize() return integer { + var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; + + return v_itsGnLocationServicePacketBufferSize; + } // End of function f_getLsPacketBufferSize + + /** + * @desc Gets the UC forwarding packet buffer size. + * @return UC forwarding packet buffer size in bytes + * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getUcForwardingPacketBufferSize() return integer { + var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnUcForwardingPacketBufferSize * 1024; + } // End of function f_getUcForwardingPacketBufferSize + + /** + * @desc Gets the BC forwarding packet buffer size. + * @return BC forwarding packet buffer size in bytes + * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getBcForwardingPacketBufferSize() return integer { + var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnBcForwardingPacketBufferSize * 1024; + } // End of function f_getBcForwardingPacketBufferSize + + /** + * @desc Gets the maximum lifetime of a packet. + * @return Maximum lifetime of a packet in seconds + * @see PICS_GN_MAX_PACKET_LIFETIME + */ + function f_getMaxPacketLifeTime() return float { + var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); + + return v_itsGnMaxPacketLifetime; + } + + /** + * @desc Gets delta for timers. + * @return Delta for timers in seconds + * @see PX_T_DELTA + */ + function f_getDeltaTimer() return float { + var float v_deltaTimer := PX_T_DELTA; + + return v_deltaTimer; + } + + /** + * @desc Gets the beacon service retransmit timer. + * @return Beacon service retransmit timer + */ + function f_getBsRetransmitTimer() return float { + var float v_itsGnBeaconServiceRetransmitTimer; + + v_itsGnBeaconServiceRetransmitTimer := int2float( + (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); + + return v_itsGnBeaconServiceRetransmitTimer; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). + * @return Beacon service retransmit timer (medium) + */ + function f_getBsRetransmitTimerMedium() return float { + var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) + + v_itsGnBeaconServiceRetransmitTimerMedium := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). + * @return Beacon service retransmit timer (maximum) + */ + function f_getBsRetransmitTimerMaximum() return float { + var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) + + v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the maximum beacon service jitter. + * @return Maximum beacon service jitter + */ + function f_getBsMaxJitter() return float { + var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; + + return v_itsGnBeaconServiceMaxJitter; + } + + /** + * @desc Gets the Lifetime of a Location Table Entry. + * @return Lifetime of a Location Table Entry in seconds + * @see PICS_GN_LIFETIME_LOC_TE + */ + function f_getLifetimeLocTableEntry() return float { + var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); + + return v_itsGnLifetimeLocTableEntry; + } // End of function f_getLifetimeLocTableEntry + + /** + * @desc Gets the maximum communication range for CBF algorithm + * @return Maximum communication range for CBF algorithm in meters + * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE + */ + function f_getCbfMaxCommunicationRange() return integer { + var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; + + return v_maxCommunicationRange; + } // End of function f_getCbfMaxCommunicationRange + + function f_getCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_CBF_MAX_TIME; + + return v_cbfMaxTime; + } // End of function f_getCbfMaxTime + + function f_getCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_CBF_MIN_TIME; + + return v_cbfMinTime; + } // End of function f_getCbfMinTime + + function f_getGnMaxAreaSize() return float { + var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; + + return v_maxAreaSize; + } // End of function f_getGnMaxAreaSize + + function f_getAdvancedGbcForwardingMaxCounter() return integer { + var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; + + return v_maxCounter; + } + + /** + * @desc Set the number of neighbour in the Location Table. + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // End of function f_setNrNeighbourLocTableDefault + + /** + * @desc Set the number of neighbour in the Location Table (medium). + * @see PX_MIN_NR_NEIGHBOUR + * @see PX_MAX_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // End of function f_setNrNeighbourLocTableMedium + + /** + * @desc Set the number of neighbour in the Location Table (maximum). + * @see PX_MAX_NR_NEIGHBOUR + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // End of function f_setNrNeighbourLocTableMaximum + + } // End of group iutFunctions + + group posVectorFunctions { + + /** + * @desc Convert long position vector to short position vector + * @param p_longPosVector Long position vector to be converted + * @return Short position vector + */ + function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { + var ShortPosVector v_shortPosVector; + + v_shortPosVector := { + gnAddr := p_longPosVector.gnAddr, + timestamp_ := p_longPosVector.timestamp_, + latitude := p_longPosVector.latitude, + longitude := p_longPosVector.longitude + }; + + return v_shortPosVector; + } + + /** + * @desc Get IUT's long position vector + * @return IUT's long position vector + */ + function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { + return f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { + p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + + /** + * @desc Get IUT's short position vector + * @return IUT's short position vector + */ + function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + if (not isbound(v_longPosVectorIut)) { + v_longPosVectorIut := f_getIutLongPosVector(); + } + return f_longPosVector2ShortPosVector(v_longPosVectorIut); + } + + /** + * @desc Compute a position using a reference position, a distance and an orientation + * @param p_iutLongPosVector Reference position + * @param p_distance Distance to the reference position (in meter) + * @param p_orientation direction of the computed position (0 to 359; 0 means North) + * @return LongPosVector + */ + function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) + return LongPosVector { + var LongPosVector v_result := p_iutLongPosVector; + + log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); + fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); + + return v_result; + } + + } // End of group posVectorFunctions + + group externalFunctions { + + /** + * @desc External function to compute timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + external function fx_computeGnTimestamp() return UInt32; + + } // End of group externalFunctions + + group security { + + /** + * @desc Waiting for the GN message with Security + * @param p_InSecMsg SecurityMessage template + * @param p_received returns received SecurityMessage + */ + altstep a_securedMessage ( + in template (present) EtsiTs103097Data p_InSecMsg, + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_geoNw; + [] geoNetworkingPort.receive(mw_geoNwInd( + mw_geoNwSecPdu( + p_InSecMsg, + mw_geoNwAnyPacket_withPayload(?) + ))) -> value v_geoNw { + p_received := f_getSecuredMessage(v_geoNw.msgIn); + } + } // End of 'altstep' statement + + /** + * @desc Receive GN message with security containing certificate as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithCertificate( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_certificate // containing certificate + ) + ), + p_received + ) { + // Nothing to do + } + } // End of 'altstep' a_securedMessageWithCertificate + + /** + * @desc Receive GN message with security containing digest as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithDigest( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_digest // containing digest + ) + ), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithDigest + + } // End of group altSteps + + group waitingHelpers { + + /** + * @desc Wait for GN message with security containing certificate as a signer info + * @return the certificate used for sign received message + */ + function f_waitForCertificate( + out EtsiTs103097Certificate p_cert + ) runs on ItsGeoNetworking return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if (ischosen(v_signerIdentifier.certificate)) { + p_cert := v_signerIdentifier.certificate[0]; + v_ret := true; + } + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_waitForCertificate + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askForCertificateChain( + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate + if(ischosen(v_signerIdentifier.digest)) { + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer + if(tc_ac.running) { + tc_ac.stop; + tc_ac.start; + } + v_ret := true; + } + } + } + } + return v_ret; + } // End of function f_askForCertificateChain + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askAndWaitForCertificateChain( + out SequenceOfCertificate p_chain, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + var SignerIdentifier v_signerIdentifier; + var boolean v_ret := false; + + f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer + alt { + [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate + tc_ac.stop; + + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + p_chain := v_signerIdentifier.certificate; + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_askAndWaitForCertificateChain + + /** + * @desc Send a CAM message with a certificate and wait the certificate chain request message + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + */ + function f_sendCertificateAndWaitForCertificateChainRequest( + in charstring p_certificate, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + + f_sendCertificate(p_certificate, p_CamPayload); + /* FIXME To be reviewed alt { + [] a_securedMessage ( + mw_securedMessage( + superset( + mw_header_field_unrecognised_certificate + )), + v_recv + ) { + // Nothing to do + log("*** " & testcasename() & ": DEBUG: Receive certificate ***") + } + }*/ // End of 'alt' statement + + return true; + } // End of function f_sendCertificateAndWaitForCertificateChainRequest + + } // End of group waitingHelpers + + group CertRequests{ + + function f_sendCertificateRequest( + in template (value) HashedId8 p_digest, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + /* FIXME To be reviewed f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + { + m_header_field_unrecognised_certificate( + f_HashedId3FromHashedId8( + valueof(p_digest) + )) + }, + "" + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificateRequest + + /** + * @desc Send a CAM message with a certificate + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + * @see f_sendCertificateAndWaitForCertificateChainRequest + */ + function f_sendCertificate( + in charstring p_certificate, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + -, + p_certificate + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificate + + } // End of group CertRequests + + group messageGetters { + + /** + * @desc return EtsiTs103097Data field of GeoNetworking packet + * @param p_msg GeoNetworking packet + * @return the EtsiTs103097Data if any + */ + function f_getSecuredMessage( + in GeoNetworkingPdu p_msg + ) return EtsiTs103097Data { + return p_msg.gnPacket.securedMsg; + } + + } + +} // End of module LibItsGeoNetworking_Functions diff --git a/lib_system/LibItsGeoNetworking_TestSystem.ttcn b/lib_system/LibItsGeoNetworking_TestSystem.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0698fe0159f6f7ba89608531fa123be01fb4e3f7 --- /dev/null +++ b/lib_system/LibItsGeoNetworking_TestSystem.ttcn @@ -0,0 +1,143 @@ +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn $ + * $Id: LibItsGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ + * @desc Test System module for ITS GeoNetworking + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_TestSystem { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_Sync all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; + + // LibItsSecurity + import from LibItsSecurity_TestSystem all; + + import from LibItsIpv6OverGeoNetworking_TypesAndValues all; + + group portDefinitions { + + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out + AcGnPrimitive, AcGn6Primitive, AcGnssPrimitive, AcSecPrimitive; + in + AcGnResponse, AcGn6Response, AdapterControlResults; + } // end AdapterControlPort + + /** + * @desc Upper Tester port + */ + type port UpperTesterPort message { + out + UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component + in + UtGnResults, UtGnEventInd; + } // end UpperTesterPort + + } // end portDefinitions + + group interfacePorts { + + group networkAndTransportPorts { + + group nt2Ports { + + /** + * @desc NT2 GeoNetworking Port (GeoNetworking/RadioNetwork) + */ + type port GeoNetworkingPort message { + in GeoNetworkingInd; + out GeoNetworkingReq; + } // end GeoNetworkingPort + + } // End of group nt2Ports + + } // End of group networkAndTransportPorts + + } // End of group interfacePorts + + group componentDefinitions { + + /** + * @desc ITS Main Test Component + */ + type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking { + var ComponentTable vc_componentTable := {}; + } // end ItsMtc + + /** + * @desc ITS System Adapter + */ + type component ItsGeoNetworkingSystem { + + port UpperTesterPort utPort; + port AdapterControlPort acPort; + + // NT2 ports + port GeoNetworkingPort geoNetworkingPort; + + } // end ItsGeoNetworkingSystem + + } // End of group componentDefinitions + + type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { + + port UpperTesterPort utPort; + port AdapterControlPort acPort; + + // UT indications + var UtGnEventIndList vc_utInds := {}; + + var boolean vc_utDefaultActive := true; + var boolean vc_acDefaultActive := true; + var boolean vc_gnDefaultActive := true; + + } + + /** + * @desc Test component for ITS Network and Transport layer + */ + type component ItsGeoNetworking extends ItsBaseGeoNetworking { + + // NT2 ports + port GeoNetworkingPort geoNetworkingPort; + + //variables for Gn + var UInt16 vc_localSeqNumber := 0; + var PositionTable vc_positionTable := {}; + var GeoAreaTable vc_areaTable := {}; + var charstring vc_componentName := ""; + var default vc_neighbourDefault; + var integer vc_multipleMessagesCount := 0; + + } // End of component ItsGeoNetworking + + group misc { + + type record ComponentEntry { + charstring componentName, + ItsGeoNetworking gnComponent optional + } + + type record of ComponentEntry ComponentTable; + + } // end misc + +} // End of module LibItsGeoNetworking_TestSystem diff --git a/lib_system/module.mk b/lib_system/module.mk new file mode 100644 index 0000000000000000000000000000000000000000..1c96ef7d351403073e4131472811be26ac7d7e6c --- /dev/null +++ b/lib_system/module.mk @@ -0,0 +1,4 @@ +sources := \ + LibItsGeoNetworking_Functions.ttcn \ + LibItsGeoNetworking_TestSystem.ttcn \ + diff --git a/module.mk b/module.mk new file mode 100644 index 0000000000000000000000000000000000000000..a48b3c18da129c0033d413a4ea443d59296b2f94 --- /dev/null +++ b/module.mk @@ -0,0 +1,26 @@ +sources := \ + ItsGeoNetworking_TestCases.ttcn \ + ItsGeoNetworking_TestControl.ttcn \ + ItsGeoNetworking_TpFunctions.ttcn \ + +modules := lib \ + lib_system \ + ../LibCommon \ + ../LibIts \ + ../AtsIPv6OverGeoNetworking/lib \ + ../AtsIPv6OverGeoNetworking/lib_system \ + ../AtsSecurity/lib \ + ../AtsSecurity/lib_system \ + /ccsrc/Ports/LibIts_ports \ + /ccsrc/Ports/LibIts_ports/GN_ports \ + /ccsrc/Ports/LibIts_ports/IPv6oGN_ports \ + /ccsrc/EncDec \ + /ccsrc/Framework \ + /ccsrc/Externals \ + /ccsrc/loggers \ + /ccsrc/geospacial \ + /ccsrc/Asn1c \ + /ccsrc/Protocols/GeoNetworking \ + /ccsrc/Protocols/UpperTester \ + /ccsrc/Protocols/Security \ + /ccsrc/Protocols/Pcap \