diff --git a/src/helper/application-container.h b/src/helper/application-container.h index adf48d495..a07d0b21c 100644 --- a/src/helper/application-container.h +++ b/src/helper/application-container.h @@ -28,7 +28,15 @@ namespace ns3 { /** - * \brief holds a vector of ns3::Application pointers + * \brief holds a vector of ns3::Application pointers. + * + * Typically ns-3 Applications are installed on nodes using an Application + * helper. The helper Install method takes a NodeContainer which holds + * some number of Ptr. For each of the Nodes in the NodeContainer + * the helper will instantiate an application, install it in a node and + * add a Ptr to that application into a Container for use + * by the caller. This is that container used to hold the Ptr + * which are instantiated by the Application helper. * */ class ApplicationContainer @@ -40,60 +48,165 @@ public: ApplicationContainer (); /** - * Create an ApplicationContainer with exactly one application + * Create an ApplicationContainer with exactly one application which has + * been previously instantiated. The single application is specified + * by a smart pointer. * - * \param application The application to add to the container + * \param application The application to add to the container. */ ApplicationContainer (Ptr application); /** - * Create an ApplicationContainer with exactly one application + * Create an ApplicationContainer with exactly one application which has + * been previously instantiated and assigned a name using the Object name + * service. This Application is specified by its assigned name. * - * \param name The name of the application object to add to the container + * \param name The name of the application object to add to the container. */ ApplicationContainer (std::string name); typedef std::vector >::const_iterator Iterator; /** - * \returns an iterator which points to the start of the array of pointers. + * \brief Get an iterator which refers to the first Application in the + * container. + * + * Applications can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the iterator method and is typically used in a + * for-loop to run through the Applications + * + * \code + * ApplicationContainer::Iterator i; + * for (i = container.Begin (); i != container.End (); ++i) + * { + * (*i)->method (); // some Application method + * } + * \endcode + * + * \returns an iterator which refers to the first Application in the container. */ Iterator Begin (void) const; + /** - * \returns an iterator which points to the end of the array of pointers. + * \brief Get an iterator which indicates to the last Application in the + * container. + * + * Applications can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the iterator method and is typically used in a + * for-loop to run through the Applications + * + * \code + * ApplicationContainer::Iterator i; + * for (i = container.Begin (); i != container.End (); ++i) + * { + * (*i)->method (); // some Application method + * } + * \endcode + * + * \returns an iterator which indicates an ending condition for a loop. */ Iterator End (void) const; /** - * \returns the number of application pointers stored in this container. + * \brief Get the number of Ptr stored in this container. + * + * Applications can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the direct method and is typically used to + * define an ending condition in a for-loop that runs through the stored + * Applications + * + * \code + * uint32_t nApplications = continer.GetN (); + * for (uint32_t i = 0 i < nApplications; ++i) + * { + * Ptr p = continer.Get (i) + * i->method (); // some Application method + * } + * \endcode + * + * \returns the number of Ptr stored in this container. */ uint32_t GetN (void) const; + /** + * \brief Get the Ptr stored in this container at a given + * index. + * + * Applications can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the direct method and is used to retrieve the + * indexed Ptr. + * + * \code + * uint32_t nApplications = continer.GetN (); + * for (uint32_t i = 0 i < nApplications; ++i) + * { + * Ptr p = continer.Get (i) + * i->method (); // some Application method + * } + * \endcode + * * \param i the index of the requested application pointer. * \returns the requested application pointer. */ Ptr Get (uint32_t i) const; /** - * Append to the end of this container the other input container. + * \brief Append the contents of another ApplicationContainer to the end of + * this container. * - * \param other another application container + * \param The ApplicationContainer to append. */ void Add (ApplicationContainer other); + /** - * Append to the end of this container the input application pointer. + * \brief Append the single Ptr to this container. * - * \param application another netdevice pointer. + * \param application The Ptr to append. */ void Add (Ptr application); + /** - * Append to the end of this container the application specified by the name. + * \brief Append to this container the single Ptr referred to + * via its object name service registered name. * * \param name The name of the application object to add to the container. */ void Add (std::string name); + /** + * \brief Arrange for all of the Applications in this containter to Start() + * at the Time given as a parameter. + * + * All Applications need to be provided with a starting simulation time and + * a stopping simulation time. The ApplicationContainer is a convenient + * place for allowing all of the contained Applications to be told to wake + * up and start doing their thing (Start) at a common time. + * + * This method simply iterates through the contained Applications and calls + * their Start() methods with the provided Time. + * + * \param start The Time at which each of the applications should start. + */ void Start (Time start); + + /** + * \brief Arrange for all of the Applications in this containter to Stop() + * at the Time given as a parameter. + * + * All Applications need to be provided with a starting simulation time and + * a stopping simulation time. The ApplicationContainer is a convenient + * place for allowing all of the contained Applications to be told to shut + * down and stop doing their thing (Stop) at a common time. + * + * This method simply iterates through the contained Applications and calls + * their Start() methods with the provided Time. + * + * \param start The Time at which each of the applications should start. + */ void Stop (Time stop); private: diff --git a/src/helper/athstats-helper.h b/src/helper/athstats-helper.h index 3f64bcd84..f746fc42f 100644 --- a/src/helper/athstats-helper.h +++ b/src/helper/athstats-helper.h @@ -88,7 +88,7 @@ public: /** - * function to be called when the net device transmittes a packet + * function to be called when the net device transmits a packet * * @param context * @param p the packet being transmitted @@ -139,7 +139,6 @@ public: */ void TxFinalDataFailedTrace (std::string context, Mac48Address address); - /** * Function to be called when the PHY layer of the considered * device receives a frame @@ -195,9 +194,15 @@ public: private: + /** + * @internal + */ void WriteStats (); - void ResetCounters (); + /** + * @internal + */ + void ResetCounters (); uint32_t m_txCount; uint32_t m_rxCount; @@ -212,7 +217,6 @@ private: Time m_interval; - }; // class AthstatsWifiTraceSink diff --git a/src/helper/bridge-helper.h b/src/helper/bridge-helper.h index 8ebc8f65a..9f6039922 100644 --- a/src/helper/bridge-helper.h +++ b/src/helper/bridge-helper.h @@ -36,13 +36,16 @@ class AttributeValue; class BridgeHelper { public: + /* + * Construct a BridgeHelper + */ BridgeHelper (); /** - * \param n1 the name of the attribute to set - * \param v1 the value of the attribute to set - * * Set an attribute on each ns3::BridgeNetDevice created by * BridgeHelper::Install + * + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set */ void SetDeviceAttribute (std::string n1, const AttributeValue &v1); /** diff --git a/src/helper/csma-helper.h b/src/helper/csma-helper.h index 490fb2923..7f98d139b 100644 --- a/src/helper/csma-helper.h +++ b/src/helper/csma-helper.h @@ -40,6 +40,9 @@ class AsciiWriter; class CsmaHelper { public: + /** + * Construct a CsmaHelper. + */ CsmaHelper (); /** @@ -349,13 +352,30 @@ public: NetDeviceContainer& hubDevices, NetDeviceContainer& spokeDevices); private: + /* + * \internal + */ Ptr InstallPriv (Ptr node, Ptr channel) const; + /* + * \internal + */ static void SniffEvent (Ptr writer, Ptr packet); static void AsciiRxEvent (Ptr writer, std::string path, Ptr packet); + /* + * \internal + */ static void AsciiEnqueueEvent (Ptr writer, std::string path, Ptr packet); + + /* + * \internal + */ static void AsciiDequeueEvent (Ptr writer, std::string path, Ptr packet); + + /* + * \internal + */ static void AsciiDropEvent (Ptr writer, std::string path, Ptr packet); ObjectFactory m_queueFactory; diff --git a/src/helper/dot11s-installer.h b/src/helper/dot11s-installer.h index e2139e09b..a142591da 100644 --- a/src/helper/dot11s-installer.h +++ b/src/helper/dot11s-installer.h @@ -18,26 +18,61 @@ * Authors: Kirill Andreev */ - #ifndef DOT11S_STACK_INSTALLER_H #define DOT11S_STACK_INSTALLER_H + #include "ns3/mesh-stack-installer.h" + namespace ns3 { + +/** + * \brief Helper class to allow easy installation of 802.11s stack. + */ class Dot11sStack : public MeshStack { - public: - static TypeId GetTypeId (); - Dot11sStack (); - ~Dot11sStack (); - void DoDispose (); +public: + /** + * \internal + */ + static TypeId GetTypeId (); + + /** + * Create a Dot11sStack() installer helper. + */ + Dot11sStack (); - ///\brief Installs 802.11s stack. needed by helper only - bool InstallStack (Ptr mp); - void Report (const Ptr mp, std::ostream&); - void ResetStats (const Ptr mp); - private: - Mac48Address m_root; + /** + * Destroy a Dot11sStack() installer helper. + */ + ~Dot11sStack (); + + /** + * Break any reference cycles in the installer helper. Required for ns-3 + * Object support. + */ + void DoDispose (); + + /** + * \brief Install an 802.11s stack. + * \param The Ptr to use when setting up the PMP. + */ + bool InstallStack (Ptr mp); + + /** + * \brief Iterate through the referenced devices and protocols and print + * their statistics + */ + void Report (const Ptr mp, std::ostream&); + + /** + * \brief Reset the statistics on the referenced devices and protocols. + */ + void ResetStats (const Ptr mp); +private: + Mac48Address m_root; }; + } //namespace ns3 + #endif diff --git a/src/helper/emu-helper.h b/src/helper/emu-helper.h index 8ea9a018e..e63b472d0 100644 --- a/src/helper/emu-helper.h +++ b/src/helper/emu-helper.h @@ -39,6 +39,10 @@ class AsciiWriter; class EmuHelper { public: + /* + * Construct an EmuHelper() which is used to make installing and configuring + * Emulated Net Devices easier. + */ EmuHelper (); /** @@ -206,12 +210,34 @@ public: NetDeviceContainer Install (const NodeContainer &c) const; private: + /* + * \internal + */ Ptr InstallPriv (Ptr node) const; + + /* + * \internal + */ static void SniffEvent (Ptr writer, Ptr packet); + /* + * \internal + */ static void AsciiRxEvent (Ptr writer, std::string path, Ptr packet); + + /* + * \internal + */ static void AsciiEnqueueEvent (Ptr writer, std::string path, Ptr packet); + + /* + * \internal + */ static void AsciiDequeueEvent (Ptr writer, std::string path, Ptr packet); + + /* + * \internal + */ static void AsciiDropEvent (Ptr writer, std::string path, Ptr packet); ObjectFactory m_queueFactory; diff --git a/src/helper/flame-installer.h b/src/helper/flame-installer.h index 12b71e713..b7d93b0f2 100644 --- a/src/helper/flame-installer.h +++ b/src/helper/flame-installer.h @@ -20,26 +20,60 @@ #ifndef FLAME_STACK_INSTALLER_H #define FLAME_STACK_INSTALLER_H + #include "ns3/mesh-stack-installer.h" + namespace ns3 { + /** * \ingroup flame * - * \brief FLAME mesh stack (actually single protocol in this stack) + * \brief Helper class used to install FLAME mesh stack (actually single + * protocol in this stack) */ class FlameStack : public MeshStack { - public: - static TypeId GetTypeId (); - FlameStack (); - ~FlameStack (); - void DoDispose (); +public: + /* + * \internal + */ + static TypeId GetTypeId (); - /// Installs flame stack on given mesh point device. - bool InstallStack (Ptr mp); - void Report (const Ptr mp, std::ostream&); - void ResetStats (const Ptr mp); + /** + * Construct a FlameStack helper class. + */ + FlameStack (); + + /** + * Destroy a FlameStack helper class. + */ + ~FlameStack (); + + /** + * \internal + * Break any reference cycles in the installer helper. Required for ns-3 + * Object support. + */ + void DoDispose (); + + /** + * \brief Install a flame stack on the given MeshPointDevice + * \param The Ptr to use. + */ + bool InstallStack (Ptr mp); + + /** + * \brief Print flame protocol statistics. + */ + void Report (const Ptr mp, std::ostream&); + + /** + * \brief Reset the statistics. + */ + void ResetStats (const Ptr mp); }; -} //namespace ns3 -#endif + +} //namespace ns3 + +#endif // FLAME_STACK_INSTALLER_H diff --git a/src/helper/flow-monitor-helper.h b/src/helper/flow-monitor-helper.h index 1b5ed2d68..4786a195e 100644 --- a/src/helper/flow-monitor-helper.h +++ b/src/helper/flow-monitor-helper.h @@ -35,15 +35,18 @@ class Ipv4FlowClassifier; class FlowMonitorHelper { public: + /// \brief Construct a FlowMonitorHelper class which makes it easier to + /// configure and use the FlowMonitor FlowMonitorHelper (); - /// \brief Set an attribute for the to-be-created FlowMonitor object void SetMonitorAttribute (std::string n1, const AttributeValue &v1); /// \brief Enable flow monitoring on a set of nodes + /// \param nodes A NodeContainer holding the set of nodes to work with. Ptr Install (NodeContainer nodes); /// \brief Enable flow monitoring on a single node + /// \param nodes A Ptr to the node on which to enable flow monitoring. Ptr Install (Ptr node); /// \brief Enable flow monitoring on all nodes Ptr InstallAll (); diff --git a/src/helper/internet-stack-helper.h b/src/helper/internet-stack-helper.h index 7c8a6059c..5c9a0ee68 100644 --- a/src/helper/internet-stack-helper.h +++ b/src/helper/internet-stack-helper.h @@ -53,6 +53,10 @@ public: * such as ns3::OlsrHelper */ InternetStackHelper(void); + + /** + * Destroy the InternetStackHelper + */ virtual ~InternetStackHelper(void); InternetStackHelper (const InternetStackHelper &); InternetStackHelper &operator = (const InternetStackHelper &o); @@ -195,30 +199,67 @@ private: const Ipv4RoutingHelper *m_routing; /** + * \internal * \brief IPv6 routing helper. */ const Ipv6RoutingHelper *m_routingv6; + /** + * \internal + */ static void CreateAndAggregateObjectFromTypeId (Ptr node, const std::string typeId); + + /** + * \internal + */ static void Cleanup (void); + + /** + * \internal + */ static void LogRxIp (std::string context, Ptr packet, uint32_t deviceId); + + /** + * \internal + */ static void LogTxIp (std::string context, Ptr packet, uint32_t deviceId); + + /** + * \internal + */ static Ptr GetStream (uint32_t nodeId, uint32_t interfaceId); + struct Trace { uint32_t nodeId; uint32_t interfaceId; Ptr writer; }; + /** + * \internal + */ static void AsciiDropEventIpv4 (Ptr writer, std::string path, Ipv4Header const &header, Ptr packet, Ipv4L3Protocol::DropReason reason, uint32_t interface); + /** + * \internal + */ static void AsciiDropEventArp (Ptr writer, std::string path, Ptr packet); + + /** + * \internal + */ static void AsciiDropEventIpv6 (Ptr writer, std::string path, Ipv6Header const &header, Ptr packet, Ipv6L3Protocol::DropReason reason, uint32_t interface); + static std::string m_pcapBaseFilename; + + /** + * \internal + */ static uint32_t GetNodeIndex (std::string context); + static std::vector m_traces; /** diff --git a/src/helper/ipv4-address-helper.h b/src/helper/ipv4-address-helper.h index c1fd7ef70..93dbe4abe 100644 --- a/src/helper/ipv4-address-helper.h +++ b/src/helper/ipv4-address-helper.h @@ -176,6 +176,9 @@ public: Ipv4InterfaceContainer Assign (const NetDeviceContainer &c); private: + /** + * @internal + */ uint32_t NumAddressBits (uint32_t maskbits) const; uint32_t m_network; diff --git a/src/helper/ipv4-global-routing-helper.h b/src/helper/ipv4-global-routing-helper.h index 2e685af03..1ffb20ae3 100644 --- a/src/helper/ipv4-global-routing-helper.h +++ b/src/helper/ipv4-global-routing-helper.h @@ -31,9 +31,20 @@ namespace ns3 { class Ipv4GlobalRoutingHelper : public Ipv4RoutingHelper { public: - Ipv4GlobalRoutingHelper (); - Ipv4GlobalRoutingHelper (const Ipv4GlobalRoutingHelper &); /** + * \brief Construct a GlobalRoutingHelper to make life easier for managing + * global routing tasks. + */ + Ipv4GlobalRoutingHelper (); + + /** + * \brief Construct a GlobalRoutingHelper from another previously initialized + * instance (Copy Constructor). + */ + Ipv4GlobalRoutingHelper (const Ipv4GlobalRoutingHelper &); + + /** + * \internal * \returns pointer to clone of this Ipv4GlobalRoutingHelper * * This method is mainly for internal use by the other helpers; @@ -50,7 +61,7 @@ public: virtual Ptr Create (Ptr node) const; /** - * @brief Build a routing database and initialize the routing tables of + * \brief Build a routing database and initialize the routing tables of * the nodes in the simulation. Makes all nodes in the simulation into * routers. * @@ -60,7 +71,7 @@ public: */ static void PopulateRoutingTables (void); /** - *@brief Remove all routes that were previously installed in a prior call + * \brief Remove all routes that were previously installed in a prior call * to either PopulateRoutingTables() or RecomputeRoutingTables(), and * add a new set of routes. * @@ -73,6 +84,11 @@ public: */ static void RecomputeRoutingTables (void); private: + /** + * \internal + * \brief Assignment operator declared private and not implemented to disallow + * assignment and prevent the compiler from happily inserting its own. + */ Ipv4GlobalRoutingHelper &operator = (const Ipv4GlobalRoutingHelper &o); }; diff --git a/src/helper/ipv4-interface-container.h b/src/helper/ipv4-interface-container.h index c92dd33b4..1e4e74562 100644 --- a/src/helper/ipv4-interface-container.h +++ b/src/helper/ipv4-interface-container.h @@ -9,8 +9,25 @@ namespace ns3 { /** - * \brief keep track of a set of ipv4 interfaces. + * \brief holds a vector of std::pair of Ptr and interface index. * + * Typically ns-3 Ipv4Interfaces are installed on devices using an Ipv4 address + * helper. The helper's Assign() method takes a NetDeviceContainer which holds + * some number of Ptr. For each of the NetDevices in the + * NetDeviceContainer the helper will find the associated Ptr and + * Ptr. It makes sure that an interface exists on the node for the + * device and then adds an Ipv4Address according to the address helper settings + * (incrementing the Ipv4Address somehow as it goes). The helper then converts + * the Ptr and the interface index to a std::pair and adds them to a + * container -- a container of this type. + * + * The point is then to be able to implicitly associate an index into the + * original NetDeviceContainer (that identifies a particular net device) with + * an identical index into the Ipv4InterfaceContainer that has a std::pair with + * the Ptr and interface index you need to play with the interface. + * + * @see Ipv4AddressHelper + * @see Ipv4 */ class Ipv4InterfaceContainer { @@ -27,7 +44,8 @@ public: void Add (Ipv4InterfaceContainer other); /** - * \returns the number of interfaces stored in this Ipv4InterfaceContainer. + * \returns the number of Ptr and interface pairs stored in this + * Ipv4InterfaceContainer. */ uint32_t GetN (void) const; @@ -43,16 +61,52 @@ public: */ Ipv4Address GetAddress (uint32_t i, uint32_t j = 0) const; + void SetMetric (uint32_t i, uint16_t metric); + /** + * Manually add an entry to the container consisting of the individual parts + * of an entry std::pair. + * * \param ipv4 pointer to Ipv4 object * \param interface interface index of the Ipv4Interface to add to the container + * + * @see Ipv4InterfaceContainer */ void Add (Ptr ipv4, uint32_t interface); + + /** + * Manually add an entry to the container consisting of a previously composed + * entry std::pair. + * + * \param ipv4 pointer to Ipv4 object + * \param interface interface index of the Ipv4Interface to add to the container + * + * @see Ipv4InterfaceContainer + */ void Add (std::pair, uint32_t>); + + /** + * Manually add an entry to the container consisting of the individual parts + * of an entry std::pair. + * + * \param ipv4Name std:string referring to the saved name of an Ipv4 Object that + * has been previously named using the Object Name Service. + * \param interface interface index of the Ipv4Interface to add to the container + * + * @see Ipv4InterfaceContainer + */ void Add (std::string ipv4Name, uint32_t interface); - std::pair, uint32_t> Get (uint32_t) const; + /** + * Get the std::pair of an Ptr and interface stored at the location + * specified by the index. + * + * \param i the index of the entery to retrieve. + * + * @see Ipv4InterfaceContainer + */ + std::pair, uint32_t> Get (uint32_t i) const; private: diff --git a/src/helper/ipv4-list-routing-helper.h b/src/helper/ipv4-list-routing-helper.h index 5e6372936..f01f82edc 100644 --- a/src/helper/ipv4-list-routing-helper.h +++ b/src/helper/ipv4-list-routing-helper.h @@ -35,10 +35,26 @@ namespace ns3 { class Ipv4ListRoutingHelper : public Ipv4RoutingHelper { public: + /* + * Construct an Ipv4ListRoutingHelper used to make installing routing + * protocols easier. + */ Ipv4ListRoutingHelper (); + + /* + * Construct an Ipv4ListRoutingHelper used to make installing routing + * protocols easier. + */ virtual ~Ipv4ListRoutingHelper (); - Ipv4ListRoutingHelper (const Ipv4ListRoutingHelper &); + /** + * \brief Construct an Ipv4ListRoutingHelper from another previously + * initialized instance (Copy Constructor). + */ + Ipv4ListRoutingHelper (const Ipv4ListRoutingHelper &); + + /** + * \internal * \returns pointer to clone of this Ipv4ListRoutingHelper * * This method is mainly for internal use by the other helpers; @@ -65,6 +81,11 @@ public: */ virtual Ptr Create (Ptr node) const; private: + /** + * \internal + * \brief Assignment operator declared private and not implemented to disallow + * assignment and prevent the compiler from happily inserting its own. + */ Ipv4ListRoutingHelper &operator = (const Ipv4ListRoutingHelper &o); std::list > m_list; diff --git a/src/helper/ipv4-nix-vector-helper.h b/src/helper/ipv4-nix-vector-helper.h index 24f0ad8b9..efd928d27 100644 --- a/src/helper/ipv4-nix-vector-helper.h +++ b/src/helper/ipv4-nix-vector-helper.h @@ -33,13 +33,23 @@ namespace ns3 { * ns3::InternetStackHelper::SetRoutingHelper * */ - class Ipv4NixVectorHelper : public Ipv4RoutingHelper { public: + /* + * Construct an Ipv4NixVectorHelper to make life easier while adding Nix-vector + * routing to nodes. + */ Ipv4NixVectorHelper (); - Ipv4NixVectorHelper (const Ipv4NixVectorHelper &); + /** + * \brief Construct an Ipv4NixVectorHelper from another previously + * initialized instance (Copy Constructor). + */ + Ipv4NixVectorHelper (const Ipv4NixVectorHelper &); + + /** + * \internal * \returns pointer to clone of this Ipv4NixVectorHelper * * This method is mainly for internal use by the other helpers; @@ -56,6 +66,11 @@ public: virtual Ptr Create (Ptr node) const; private: + /** + * \internal + * \brief Assignment operator declared private and not implemented to disallow + * assignment and prevent the compiler from happily inserting its own. + */ Ipv4NixVectorHelper &operator = (const Ipv4NixVectorHelper &o); ObjectFactory m_agentFactory; diff --git a/src/helper/ipv4-routing-helper.h b/src/helper/ipv4-routing-helper.h index ed686f826..dbfa52e4d 100644 --- a/src/helper/ipv4-routing-helper.h +++ b/src/helper/ipv4-routing-helper.h @@ -39,6 +39,9 @@ class Node; class Ipv4RoutingHelper { public: + /* + * Destroy an instance of an Ipv4RoutingHelper + */ virtual ~Ipv4RoutingHelper (); /** diff --git a/src/helper/ipv4-static-routing-helper.h b/src/helper/ipv4-static-routing-helper.h index adc7952cb..1c00ccb47 100644 --- a/src/helper/ipv4-static-routing-helper.h +++ b/src/helper/ipv4-static-routing-helper.h @@ -40,9 +40,20 @@ namespace ns3 { class Ipv4StaticRoutingHelper : public Ipv4RoutingHelper { public: + /* + * Construct an Ipv4StaticRoutingHelper object, used to make configuration + * of static routing easier. + */ Ipv4StaticRoutingHelper (); - Ipv4StaticRoutingHelper (const Ipv4StaticRoutingHelper &); + /** + * \brief Construct an Ipv4StaticRoutingHelper from another previously + * initialized instance (Copy Constructor). + */ + Ipv4StaticRoutingHelper (const Ipv4StaticRoutingHelper &); + + /** + * \internal * \returns pointer to clone of this Ipv4StaticRoutingHelper * * This method is mainly for internal use by the other helpers; @@ -58,14 +69,42 @@ public: */ virtual Ptr Create (Ptr node) const; + /** + * Try and find the static routing protocol as either the main routing + * protocol or in the list of routing protocols associated with the + * Ipv4 provided. + * + * \param ipv4 the Ptr to search for the static routing protocol + */ Ptr GetStaticRouting (Ptr ipv4) const; + /** + * \brief Add a multicast route to a node and net device using explicit + * Ptr and Ptr + */ void AddMulticastRoute (Ptr n, Ipv4Address source, Ipv4Address group, Ptr input, NetDeviceContainer output); + + /** + * \brief Add a multicast route to a node and device using a name string + * previously associated to the node using the Object Name Service and a + * Ptr + */ void AddMulticastRoute (std::string n, Ipv4Address source, Ipv4Address group, Ptr input, NetDeviceContainer output); + + /** + * \brief Add a multicast route to a node and device using a Ptr and a + * name string previously associated to the device using the Object Name Service. + */ void AddMulticastRoute (Ptr n, Ipv4Address source, Ipv4Address group, std::string inputName, NetDeviceContainer output); + + /** + * \brief Add a multicast route to a node and device using name strings + * previously associated to both the node and device using the Object Name + * Service. + */ void AddMulticastRoute (std::string nName, Ipv4Address source, Ipv4Address group, std::string inputName, NetDeviceContainer output); @@ -79,10 +118,49 @@ public: * \param nd device of the node to add default route */ void SetDefaultMulticastRoute (Ptr n, Ptr nd); + + /** + * \brief Add a default route to the static routing protocol to forward + * packets out a particular interface + * + * Functionally equivalent to: + * route add 224.0.0.0 netmask 240.0.0.0 dev nd + * \param n node + * \param ndName string with name previously associated to device using the + * Object Name Service + */ void SetDefaultMulticastRoute (Ptr n, std::string ndName); + + /** + * \brief Add a default route to the static routing protocol to forward + * packets out a particular interface + * + * Functionally equivalent to: + * route add 224.0.0.0 netmask 240.0.0.0 dev nd + * \param nName string with name previously associated to node using the + * Object Name Service + * \param nd device of the node to add default route + */ void SetDefaultMulticastRoute (std::string nName, Ptr nd); + + /** + * \brief Add a default route to the static routing protocol to forward + * packets out a particular interface + * + * Functionally equivalent to: + * route add 224.0.0.0 netmask 240.0.0.0 dev nd + * \param nName string with name previously associated to node using the + * Object Name Service + * \param ndName string with name previously associated to device using the + * Object Name Service + */ void SetDefaultMulticastRoute (std::string nName, std::string ndName); private: + /** + * \internal + * \brief Assignment operator declared private and not implemented to disallow + * assignment and prevent the compiler from happily inserting its own. + */ Ipv4StaticRoutingHelper &operator = (const Ipv4StaticRoutingHelper &o); }; diff --git a/src/helper/ipv6-address-helper.h b/src/helper/ipv6-address-helper.h index f52788efa..e7fd2129a 100644 --- a/src/helper/ipv6-address-helper.h +++ b/src/helper/ipv6-address-helper.h @@ -81,11 +81,13 @@ class Ipv6AddressHelper private: /** + * \internal * \brief The IPv6 network. */ Ipv6Address m_network; /** + * \internal * \brief IPv6 The prefix (mask). */ Ipv6Prefix m_prefix; diff --git a/src/helper/ipv6-interface-container.h b/src/helper/ipv6-interface-container.h index 754051fa6..ac043e39b 100644 --- a/src/helper/ipv6-interface-container.h +++ b/src/helper/ipv6-interface-container.h @@ -102,6 +102,7 @@ class Ipv6InterfaceContainer typedef std::vector, uint32_t> > InterfaceVector; /** + * \internal * \brief List of IPv6 stack and interfaces index. */ InterfaceVector m_interfaces; diff --git a/src/wscript b/src/wscript index 5cd3fce8b..42f91d5cd 100644 --- a/src/wscript +++ b/src/wscript @@ -76,7 +76,7 @@ def configure(conf): if Options.options.enable_rpath: conf.env.append_value('RPATH', '-Wl,-rpath=%s' % (os.path.join(blddir),)) - ## Used to link the 'run-tests' program with all of ns-3 code + ## Used to link the 'test-runner' program with all of ns-3 code conf.env['NS3_MODULES'] = ['ns3-' + module.split('/')[-1] for module in all_modules] diff --git a/wscript b/wscript index 4c1756993..ede71ead1 100644 --- a/wscript +++ b/wscript @@ -177,6 +177,7 @@ def set_options(opt): help=("Enable regression testing; only used for the 'check' target"), default=False, dest='regression', action="store_true") opt.add_option('--check', + help=('DEPRECATED (run ./test.py)'), help=("Enable unit testing"), default=False, dest='check', action="store_true") opt.add_option('--regression-generate', @@ -566,11 +567,11 @@ def build(bld): " (--with-regression-traces configure option)") regression.run_regression(bld, regression_traces) - if Options.options.check: - Options.options.compile_targets += ',run-tests' - if env['ENABLE_PYTHON_BINDINGS']: - Options.options.compile_targets += ',ns3module,pybindgen-command' - _run_check(bld) +# if Options.options.check: +# Options.options.compile_targets += ',run-tests' +# if env['ENABLE_PYTHON_BINDINGS']: +# Options.options.compile_targets += ',ns3module,pybindgen-command' +# _run_check(bld) if Options.options.doxygen_no_build: doxygen() @@ -597,7 +598,10 @@ def shutdown(ctx): raise SystemExit(0) if Options.options.shell: - raise Utils.WafError("Run `./waf shell' now, instead of `./waf shell'") + raise Utils.WafError("Please run `./waf shell' now, instead of `./waf --shell'") + + if Options.options.check: + raise Utils.WafError("Please run `./test.py' now, instead of `./waf --check'") if Options.options.doxygen: doxygen() @@ -611,9 +615,10 @@ def shutdown(ctx): check_context = Build.BuildContext + def check(bld): - """run the NS-3 unit tests (deprecated in favour of --check option)""" - raise Utils.WafError("Please run `./waf --check' instead.") + """run the NS-3 unit tests (deprecated in favour of test.py)""" + raise Utils.WafError("Please run `./test.py' now, instead of './waf check'") class print_introspected_doxygen_task(Task.TaskBase): @@ -666,112 +671,110 @@ class run_python_unit_tests_task(Task.TaskBase): wutils.run_argv([self.bld.env['PYTHON'], os.path.join("..", "utils", "python-unit-tests.py")], self.bld.env, proc_env, force_no_valgrind=True) - -class run_a_unit_test_task(Task.TaskBase): - after = 'cc cxx cc_link cxx_link' - color = 'BLUE' - - def __init__(self, bld, name_of_test): - self.bld = bld - super(run_a_unit_test_task, self).__init__(generator=self) - self.name_of_test = name_of_test - try: - program_obj = wutils.find_program("run-tests", self.bld.env) - except ValueError, ex: - raise Utils.WafError(str(ex)) - program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)) - self.program_path = program_node.abspath(self.bld.env) - - def __str__(self): - return 'run-unit-test(%s)\n' % self.name_of_test - - def runnable_status(self): - return Task.RUN_ME - - def run(self): - #print repr([self.program_path, self.name_of_test]) - try: - self.retval = wutils.run_argv([self.program_path, self.name_of_test], self.bld.env) - except Utils.WafError: - self.retval = 1 - #print "running test %s: exit with %i" % (self.name_of_test, retval) - return 0 - -class get_list_of_unit_tests_task(Task.TaskBase): - after = 'cc cxx cc_link cxx_link' - color = 'BLUE' - - def __init__(self, bld): - self.bld = bld - super(get_list_of_unit_tests_task, self).__init__(generator=self) - self.tests = [] - - def __str__(self): - return 'get-unit-tests-list\n' - - def runnable_status(self): - return Task.RUN_ME - - def run(self): - try: - program_obj = wutils.find_program("run-tests", self.bld.env) - except ValueError, ex: - raise Utils.WafError(str(ex)) - program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)) - program_path = program_node.abspath(self.bld.env) - proc = subprocess.Popen([program_path, "--ListTests"], stdout=subprocess.PIPE, - env=wutils.get_proc_env()) - self.tests = [l.rstrip() for l in proc.stdout.readlines()] - retval = proc.wait() - if retval: - return retval - test_tasks = [] - for name_of_test in self.tests: - test_tasks.append(run_a_unit_test_task(self.bld, name_of_test)) - collector = collect_unit_test_results_task(self.bld, list(test_tasks)) - collector.run_after = list(test_tasks) - self.more_tasks = [collector] + test_tasks - - -class collect_unit_test_results_task(Task.TaskBase): - after = 'run_a_unit_test_task' - color = 'BLUE' - - def __init__(self, bld, test_tasks): - self.bld = bld - super(collect_unit_test_results_task, self).__init__(generator=self) - self.test_tasks = test_tasks - - def __str__(self): - return 'collect-unit-tests-results\n' - - def runnable_status(self): - for t in self.run_after: - if not t.hasrun: - return Task.ASK_LATER - return Task.RUN_ME - - def run(self): - failed_tasks = [] - for task in self.test_tasks: - if task.retval: - failed_tasks.append(task) - if failed_tasks: - print "C++ UNIT TESTS: %i tests passed, %i failed (%s)." % \ - (len(self.test_tasks) - len(failed_tasks), len(failed_tasks), - ', '.join(t.name_of_test for t in failed_tasks)) - return 1 - else: - print "C++ UNIT TESTS: all %i tests passed." % (len(self.test_tasks),) - return 0 - - -def _run_check(bld): - task = get_list_of_unit_tests_task(bld) - print_introspected_doxygen_task(bld) - if bld.env['ENABLE_PYTHON_BINDINGS']: - run_python_unit_tests_task(bld) - +#class run_a_unit_test_task(Task.TaskBase): +# after = 'cc cxx cc_link cxx_link' +# color = 'BLUE' +# +# def __init__(self, bld, name_of_test): +# self.bld = bld +# super(run_a_unit_test_task, self).__init__(generator=self) +# self.name_of_test = name_of_test +# try: +# program_obj = wutils.find_program("run-tests", self.bld.env) +# except ValueError, ex: +# raise Utils.WafError(str(ex)) +# program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)) +# self.program_path = program_node.abspath(self.bld.env) +# +# def __str__(self): +# return 'run-unit-test(%s)\n' % self.name_of_test +# +# def runnable_status(self): +# return Task.RUN_ME +# +# def run(self): +# #print repr([self.program_path, self.name_of_test]) +# try: +# self.retval = wutils.run_argv([self.program_path, self.name_of_test], self.bld.env) +# except Utils.WafError: +# self.retval = 1 +# #print "running test %s: exit with %i" % (self.name_of_test, retval) +# return 0 +# +#class get_list_of_unit_tests_task(Task.TaskBase): +# after = 'cc cxx cc_link cxx_link' +# color = 'BLUE' +# +# def __init__(self, bld): +# self.bld = bld +# super(get_list_of_unit_tests_task, self).__init__(generator=self) +# self.tests = [] +# +# def __str__(self): +# return 'get-unit-tests-list\n' +# +# def runnable_status(self): +# return Task.RUN_ME +# +# def run(self): +# try: +# program_obj = wutils.find_program("run-tests", self.bld.env) +# except ValueError, ex: +# raise Utils.WafError(str(ex)) +# program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)) +# program_path = program_node.abspath(self.bld.env) +# proc = subprocess.Popen([program_path, "--ListTests"], stdout=subprocess.PIPE, +# env=wutils.get_proc_env()) +# self.tests = [l.rstrip() for l in proc.stdout.readlines()] +# retval = proc.wait() +# if retval: +# return retval +# test_tasks = [] +# for name_of_test in self.tests: +# test_tasks.append(run_a_unit_test_task(self.bld, name_of_test)) +# collector = collect_unit_test_results_task(self.bld, list(test_tasks)) +# collector.run_after = list(test_tasks) +# self.more_tasks = [collector] + test_tasks +# +# +#class collect_unit_test_results_task(Task.TaskBase): +# after = 'run_a_unit_test_task' +# color = 'BLUE' +# +# def __init__(self, bld, test_tasks): +# self.bld = bld +# super(collect_unit_test_results_task, self).__init__(generator=self) +# self.test_tasks = test_tasks +# +# def __str__(self): +# return 'collect-unit-tests-results\n' +# +# def runnable_status(self): +# for t in self.run_after: +# if not t.hasrun: +# return Task.ASK_LATER +# return Task.RUN_ME +# +# def run(self): +# failed_tasks = [] +# for task in self.test_tasks: +# if task.retval: +# failed_tasks.append(task) +# if failed_tasks: +# print "C++ UNIT TESTS: %i tests passed, %i failed (%s)." % \ +# (len(self.test_tasks) - len(failed_tasks), len(failed_tasks), +# ', '.join(t.name_of_test for t in failed_tasks)) +# return 1 +# else: +# print "C++ UNIT TESTS: all %i tests passed." % (len(self.test_tasks),) +# return 0 +# +# +#def _run_check(bld): +# task = get_list_of_unit_tests_task(bld) +# print_introspected_doxygen_task(bld) +# if bld.env['ENABLE_PYTHON_BINDINGS']: +# run_python_unit_tests_task(bld) def check_shell(bld): if 'NS3_MODULE_PATH' not in os.environ: