diff --git a/src/internet/model/global-route-manager.cc b/src/internet/model/global-route-manager.cc index 9b2cae9a5..b1026bf2c 100644 --- a/src/internet/model/global-route-manager.cc +++ b/src/internet/model/global-route-manager.cc @@ -55,4 +55,10 @@ GlobalRouteManager::AllocateRouterId() return routerId++; } +void +GlobalRouteManager::ResetRouterId() +{ + routerId = 0; +} + } // namespace ns3 diff --git a/src/internet/model/global-route-manager.h b/src/internet/model/global-route-manager.h index 1ce9edabc..b7ee6fa9c 100644 --- a/src/internet/model/global-route-manager.h +++ b/src/internet/model/global-route-manager.h @@ -60,6 +60,13 @@ class GlobalRouteManager */ static void InitializeRoutes(); + /** + * @brief Reset the router ID counter to zero. This should only be called by tests to reset the + * router ID counter between simulations within the same program. This function should not be + * called In typical simulations or when using the GlobalRouting helper. + */ + static void ResetRouterId(); + private: static uint32_t routerId; //!< Router ID counter };