From b16efc8c0b574ef40605f8828474048002eda5e7 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Mon, 23 Jul 2007 20:06:00 -0700 Subject: [PATCH] a few edits on the doxygen --- README.routing | 9 ++++++++- src/routing/routing-environment.h | 11 ++++++++++- src/routing/static-route-manager-impl.cc | 11 +++++------ src/routing/static-route-manager-impl.h | 23 ++++++++++++----------- src/routing/static-route-manager.h | 8 +++----- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/README.routing b/README.routing index 2d8e0f88a..f787371be 100644 --- a/README.routing +++ b/README.routing @@ -72,7 +72,8 @@ Therefore, we think that enabling these other link types will be more straightforward now that the underlying OSPF SPF framework is in place. Presently, we can handle IPv4 point-to-point, numbered links, and we do -not do equal-cost multipath. +not do equal-cost multipath. We also do not allow for non-unit-cost +links, although it should be trivially extensible to do so. The support for this relies on the node object supporting a StaticRouter interface. This can be manually added to each node, or alternatively, @@ -124,3 +125,9 @@ router component into the node such as Gustavo's OLSR code does the StaticRouteManager. One possibility I would be fine with is to call it GlobalRouteManager (although I would still argue it adds static routes into the nodes in any case). + +- this method probably belongs in the Ipv4 (find InterfaceId corresponding +to the provided address) + uint32_t +StaticRouteManagerImpl::FindOutgoingInterfaceId (Ipv4Address a) + diff --git a/src/routing/routing-environment.h b/src/routing/routing-environment.h index 51ee61f2b..b233c821a 100644 --- a/src/routing/routing-environment.h +++ b/src/routing/routing-environment.h @@ -23,8 +23,17 @@ namespace ns3 { namespace RoutingEnvironment { - + +/** + * @brief This function tests the value of the global default value + * "DoStaticRouting". This approach puts everything in one compilation + * unit, as opposed to explicitly testing the value of the underlying + * static variable. + */ bool StaticRoutingEnabled(void); +/** + * @brief Allocate a 32-bit router ID from monotonically increasing counter. + */ uint32_t AllocateRouterId(void); } // namespace RoutingEnvironment diff --git a/src/routing/static-route-manager-impl.cc b/src/routing/static-route-manager-impl.cc index 52f8d4b32..0b2a61ddb 100644 --- a/src/routing/static-route-manager-impl.cc +++ b/src/routing/static-route-manager-impl.cc @@ -505,7 +505,7 @@ StaticRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate) StaticRouterLSA::LSA_SPF_NOT_EXPLORED) { // -// If we havent yet considered the link represented by we have to create +// If we haven't yet considered the link represented by we have to create // a new SPFVertex to represent it. // w = new SPFVertex (w_lsa); @@ -710,9 +710,6 @@ StaticRouteManagerImpl::SPFNexthopCalculation ( // Router Link Record we find that describes a point-to-point link from // to . If prev_link is not NULL, we return a Static Router Link Record // representing a possible *second* link from to . -// -// BUGBUG FIXME: This seems to be a bug. Shouldn't this function look for -// any link records after pre_link and not just after the first? // StaticRouterLinkRecord* StaticRouteManagerImpl::SPFGetNextLink ( @@ -928,7 +925,7 @@ StaticRouteManagerImpl::SPFCalculate (Ipv4Address root) } // -// BUGBUG FIXME: This should probably be a method on Ipv4 +// XXX This should probably be a method on Ipv4 // // Return the interface index corresponding to a given IP address // @@ -1360,12 +1357,14 @@ StaticRouteManagerImplTest::RunTests (void) srmlsdb->Insert (lsa3->GetLinkStateId (), lsa3); NS_ASSERT (lsa2 == srmlsdb->GetLSA (lsa2->GetLinkStateId ())); - // XXX next, calculate routes based on the manually created LSDB + // next, calculate routes based on the manually created LSDB StaticRouteManagerImpl* srm = new StaticRouteManagerImpl (); srm->DebugUseLsdb (srmlsdb); // manually add in an LSDB // Note-- this will succeed without any nodes in the topology // because the NodeList is empty srm->DebugSPFCalculate (lsa0->GetLinkStateId ()); // node n0 + + // XXX here we should do some verification of the routes built // This delete clears the srm, which deletes the LSDB, which clears // all of the LSAs, which each destroys the attached LinkRecords. diff --git a/src/routing/static-route-manager-impl.h b/src/routing/static-route-manager-impl.h index ec886fccb..776904818 100644 --- a/src/routing/static-route-manager-impl.h +++ b/src/routing/static-route-manager-impl.h @@ -136,7 +136,7 @@ public: * representing routers, and comes from the Link State Advertisement of a * router aggregated to a node in the simulation. These IDs are allocated * automatically by the routing environment and look like IP addresses - * beginning at 0.0.0.0 and monotonically increasing as new routers are + * beginning at 0.0.0.0 and monotonically increase as new routers are * instantiated. * * @returns The Ipv4Address Vertex ID of the current SPFVertex object. @@ -150,8 +150,9 @@ public: * representing routers, and comes from the Link State Advertisement of a * router aggregated to a node in the simulation. These IDs are allocated * automatically by the routing environment and look like IP addresses - * beginning at 0.0.0.0 and monotonically increasing as new routers are - * instantiated. + * beginning at 0.0.0.0 and monotonically increase as new routers are + * instantiated. This method is an explicit override of the automatically + * generated value. * * @param id The new Ipv4Address Vertex ID for the current SPFVertex object. */ @@ -520,7 +521,7 @@ private: }; /** - * @brief The Link State DataBase (LSDB) of the Static Route Manager. + * @brief The Link State DataBase (LSDB) of the StaticRouteManager. * * Each node in the simulation participating in static routing has a * StaticRouter interface. The primary job of this interface is to export @@ -536,14 +537,14 @@ class StaticRouteManagerLSDB { public: /** - * @brief Construct an empty Static Router Manager Link State Database. + * @brief Construct an empty StaticRoutingManager Link State Database. * * The database map composing the Link State Database is initialized in * this constructor. */ StaticRouteManagerLSDB (); /** - * @brief Destroy an empty Static Router Manager Link State Database. + * @brief Destroy an empty StaticRoutingManager Link State Database. * * The database map is walked and all of the Link State Advertisements stored * in the database are freed; then the database map itself is clear ()ed to @@ -599,7 +600,7 @@ private: LSDBMap_t m_database; /** * @brief StaticRouteManagerLSDB copy construction is disallowed. There's no - * need for it and a compiler provided shallow copy would be hopelessly wrong. + * need for it and a compiler provided shallow copy would be wrong. */ StaticRouteManagerLSDB (StaticRouteManagerLSDB& lsdb); /** @@ -646,15 +647,15 @@ public: void DebugSPFCalculate (Ipv4Address root); private: /** - * @brief Static Route Manager Implementation copy construction is disallowed. + * @brief StaticRouteManager Implementation copy construction is disallowed. * There's no need for it and a compiler provided shallow copy would be - * hopelessly wrong. + * wrong. */ StaticRouteManagerImpl (StaticRouteManagerImpl& srmi); /** - * @brief Static Route Manager Implementation assignment operator is + * @brief StaticRouteManager Implementation assignment operator is * disallowed. There's no need for it and a compiler provided shallow copy - * would be hopelessly wrong. + * would be wrong. */ StaticRouteManagerImpl& operator= (StaticRouteManagerImpl& srmi); diff --git a/src/routing/static-route-manager.h b/src/routing/static-route-manager.h index 4f1cdc8ae..11c6ec718 100644 --- a/src/routing/static-route-manager.h +++ b/src/routing/static-route-manager.h @@ -38,9 +38,7 @@ public: * the nodes in the simulation. * * All this function does is call BuildStaticRoutingDatabase () and - * InitializeRoutes (). There's no reason to export the two-step process - * since a high-level caller has no need to know how we're implementing the - * process. + * InitializeRoutes (). * * @see BuildStaticRoutingDatabase (); * @see InitializeRoutes (); @@ -60,13 +58,13 @@ private: static void InitializeRoutes (); /** * @brief Static Route Manager copy construction is disallowed. There's no - * need for it and a compiler provided shallow copy would be hopelessly wrong. + * need for it and a compiler provided shallow copy would be wrong. * */ StaticRouteManager (StaticRouteManager& srm); /** * @brief Static Router copy assignment operator is disallowed. There's no - * need for it and a compiler provided shallow copy would be hopelessly wrong. + * need for it and a compiler provided shallow copy would be wrong. */ StaticRouteManager& operator= (StaticRouteManager& srm); };