diff -r 73bc9e55f9bd -r 1e48ff9185f1 src/internet/model/ipv4-global-routing.h --- a/src/internet/model/ipv4-global-routing.h Sun Nov 24 23:48:49 2013 +0100 +++ b/src/internet/model/ipv4-global-routing.h Wed Nov 20 20:15:02 2013 +0100 @@ -69,15 +69,19 @@ class Ipv4GlobalRouting : public Ipv4RoutingProtocol { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); -/** - * \brief Construct an empty Ipv4GlobalRouting routing protocol, - * - * The Ipv4GlobalRouting class supports host and network unicast routes. - * This method initializes the lists containing these routes to empty. - * - * \see Ipv4GlobalRouting - */ + /** + * \brief Construct an empty Ipv4GlobalRouting routing protocol, + * + * The Ipv4GlobalRouting class supports host and network unicast routes. + * This method initializes the lists containing these routes to empty. + * + * \see Ipv4GlobalRouting + */ Ipv4GlobalRouting (); virtual ~Ipv4GlobalRouting (); @@ -94,131 +98,132 @@ virtual void SetIpv4 (Ptr ipv4); virtual void PrintRoutingTable (Ptr stream) const; -/** - * \brief Add a host route to the global routing table. - * - * \param dest The Ipv4Address destination for this route. - * \param nextHop The Ipv4Address of the next hop in the route. - * \param interface The network interface index used to send packets to the - * destination. - * - * \see Ipv4Address - */ + /** + * \brief Add a host route to the global routing table. + * + * \param dest The Ipv4Address destination for this route. + * \param nextHop The Ipv4Address of the next hop in the route. + * \param interface The network interface index used to send packets to the + * destination. + * + * \see Ipv4Address + */ void AddHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface); -/** - * \brief Add a host route to the global routing table. - * - * \param dest The Ipv4Address destination for this route. - * \param interface The network interface index used to send packets to the - * destination. - * - * \see Ipv4Address - */ + /** + * \brief Add a host route to the global routing table. + * + * \param dest The Ipv4Address destination for this route. + * \param interface The network interface index used to send packets to the + * destination. + * + * \see Ipv4Address + */ void AddHostRouteTo (Ipv4Address dest, uint32_t interface); -/** - * \brief Add a network route to the global routing table. - * - * \param network The Ipv4Address network for this route. - * \param networkMask The Ipv4Mask to extract the network. - * \param nextHop The next hop in the route to the destination network. - * \param interface The network interface index used to send packets to the - * destination. - * - * \see Ipv4Address - */ + /** + * \brief Add a network route to the global routing table. + * + * \param network The Ipv4Address network for this route. + * \param networkMask The Ipv4Mask to extract the network. + * \param nextHop The next hop in the route to the destination network. + * \param interface The network interface index used to send packets to the + * destination. + * + * \see Ipv4Address + */ void AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface); -/** - * \brief Add a network route to the global routing table. - * - * \param network The Ipv4Address network for this route. - * \param networkMask The Ipv4Mask to extract the network. - * \param interface The network interface index used to send packets to the - * destination. - * - * \see Ipv4Address - */ + /** + * \brief Add a network route to the global routing table. + * + * \param network The Ipv4Address network for this route. + * \param networkMask The Ipv4Mask to extract the network. + * \param interface The network interface index used to send packets to the + * destination. + * + * \see Ipv4Address + */ void AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface); -/** - * \brief Add an external route to the global routing table. - * - * \param network The Ipv4Address network for this route. - * \param networkMask The Ipv4Mask to extract the network. - * \param nextHop The next hop Ipv4Address - * \param interface The network interface index used to send packets to the - * destination. - */ + /** + * \brief Add an external route to the global routing table. + * + * \param network The Ipv4Address network for this route. + * \param networkMask The Ipv4Mask to extract the network. + * \param nextHop The next hop Ipv4Address + * \param interface The network interface index used to send packets to the + * destination. + */ void AddASExternalRouteTo (Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface); -/** - * \brief Get the number of individual unicast routes that have been added - * to the routing table. - * - * \warning The default route counts as one of the routes. - */ + /** + * \brief Get the number of individual unicast routes that have been added + * to the routing table. + * + * \warning The default route counts as one of the routes. + * \returns the number of routes + */ uint32_t GetNRoutes (void) const; -/** - * \brief Get a route from the global unicast routing table. - * - * Externally, the unicast global routing table appears simply as a table with - * n entries. The one subtlety of note is that if a default route has been set - * it will appear as the zeroth entry in the table. This means that if you - * add only a default route, the table will have one entry that can be accessed - * either by explicitly calling GetDefaultRoute () or by calling GetRoute (0). - * - * Similarly, if the default route has been set, calling RemoveRoute (0) will - * remove the default route. - * - * \param i The index (into the routing table) of the route to retrieve. If - * the default route has been set, it will occupy index zero. - * \return If route is set, a pointer to that Ipv4RoutingTableEntry is returned, otherwise - * a zero pointer is returned. - * - * \see Ipv4RoutingTableEntry - * \see Ipv4GlobalRouting::RemoveRoute - */ + /** + * \brief Get a route from the global unicast routing table. + * + * Externally, the unicast global routing table appears simply as a table with + * n entries. The one subtlety of note is that if a default route has been set + * it will appear as the zeroth entry in the table. This means that if you + * add only a default route, the table will have one entry that can be accessed + * either by explicitly calling GetDefaultRoute () or by calling GetRoute (0). + * + * Similarly, if the default route has been set, calling RemoveRoute (0) will + * remove the default route. + * + * \param i The index (into the routing table) of the route to retrieve. If + * the default route has been set, it will occupy index zero. + * \return If route is set, a pointer to that Ipv4RoutingTableEntry is returned, otherwise + * a zero pointer is returned. + * + * \see Ipv4RoutingTableEntry + * \see Ipv4GlobalRouting::RemoveRoute + */ Ipv4RoutingTableEntry *GetRoute (uint32_t i) const; -/** - * \brief Remove a route from the global unicast routing table. - * - * Externally, the unicast global routing table appears simply as a table with - * n entries. The one subtlety of note is that if a default route has been set - * it will appear as the zeroth entry in the table. This means that if the - * default route has been set, calling RemoveRoute (0) will remove the - * default route. - * - * \param i The index (into the routing table) of the route to remove. If - * the default route has been set, it will occupy index zero. - * - * \see Ipv4RoutingTableEntry - * \see Ipv4GlobalRouting::GetRoute - * \see Ipv4GlobalRouting::AddRoute - */ + /** + * \brief Remove a route from the global unicast routing table. + * + * Externally, the unicast global routing table appears simply as a table with + * n entries. The one subtlety of note is that if a default route has been set + * it will appear as the zeroth entry in the table. This means that if the + * default route has been set, calling RemoveRoute (0) will remove the + * default route. + * + * \param i The index (into the routing table) of the route to remove. If + * the default route has been set, it will occupy index zero. + * + * \see Ipv4RoutingTableEntry + * \see Ipv4GlobalRouting::GetRoute + * \see Ipv4GlobalRouting::AddRoute + */ void RemoveRoute (uint32_t i); - /** - * Assign a fixed random variable stream number to the random variables - * used by this model. Return the number of streams (possibly zero) that - * have been assigned. - * - * \param stream first stream index to use - * \return the number of stream indices assigned by this model - */ + /** + * Assign a fixed random variable stream number to the random variables + * used by this model. Return the number of streams (possibly zero) that + * have been assigned. + * + * \param stream first stream index to use + * \return the number of stream indices assigned by this model + */ int64_t AssignStreams (int64_t stream); protected: @@ -232,23 +237,34 @@ /// A uniform random number generator for randomly routing packets among ECMP Ptr m_rand; + /// container of Ipv4RoutingTableEntry (routes to hosts) typedef std::list HostRoutes; + /// const iterator of container of Ipv4RoutingTableEntry (routes to hosts) typedef std::list::const_iterator HostRoutesCI; + /// iterator of container of Ipv4RoutingTableEntry (routes to hosts) typedef std::list::iterator HostRoutesI; + + /// container of Ipv4RoutingTableEntry (routes to networks) typedef std::list NetworkRoutes; + /// const iterator of container of Ipv4RoutingTableEntry (routes to networks) typedef std::list::const_iterator NetworkRoutesCI; + /// iterator of container of Ipv4RoutingTableEntry (routes to networks) typedef std::list::iterator NetworkRoutesI; + + /// container of Ipv4RoutingTableEntry (routes to external AS) typedef std::list ASExternalRoutes; + /// const iterator of container of Ipv4RoutingTableEntry (routes to external AS) typedef std::list::const_iterator ASExternalRoutesCI; + /// iterator of container of Ipv4RoutingTableEntry (routes to external AS) typedef std::list::iterator ASExternalRoutesI; Ptr LookupGlobal (Ipv4Address dest, Ptr oif = 0); - HostRoutes m_hostRoutes; - NetworkRoutes m_networkRoutes; - ASExternalRoutes m_ASexternalRoutes; // External routes imported + HostRoutes m_hostRoutes; //!< Routes to hosts + NetworkRoutes m_networkRoutes; //!< Routes to networks + ASExternalRoutes m_ASexternalRoutes; //!< External routes imported - Ptr m_ipv4; + Ptr m_ipv4; //!< associated IPv4 instance }; } // Namespace ns3