--- a/doc/doxygen.conf Mon Oct 29 15:01:36 2007 +0100
+++ b/doc/doxygen.conf Mon Oct 29 15:04:23 2007 +0100
@@ -1081,7 +1081,8 @@
PREDEFINED = RUN_SELF_TESTS \
NS3_DEBUG_ENABLE \
- NS3_ASSERT_ENABLE
+ NS3_ASSERT_ENABLE \
+ NS3_LOG_ENABLE
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
--- a/src/core/log.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/core/log.h Mon Oct 29 15:04:23 2007 +0100
@@ -88,6 +88,19 @@
#ifdef NS3_LOG_ENABLE
+/**
+ * \param level the log level
+ * \param msg the message to log
+ *
+ * This macro allows you to log an arbitrary message at a specific
+ * log level. The log message is expected to be a C++ ostream
+ * message such as "my string" << aNumber << "my oth stream".
+ *
+ * Typical usage looks like:
+ * \code
+ * NS_LOG (LOG_DEBUG, "a number="<<aNumber<<", anotherNumber="<<anotherNumber);
+ * \endcode
+ */
#define NS_LOG(level, msg) \
do \
{ \
@@ -197,7 +210,6 @@
/**
* \param name a log component name
* \param level a logging level
- * \param decorate whether or not to add function names to all logs
* \ingroup logging
*
* Enable the logging output associated with that log component.
@@ -208,7 +220,6 @@
/**
* \param level a logging level
- * \param decorate whether or not to add function names to all logs
* \ingroup logging
*
* Enable the logging output for all registered log components.
@@ -232,13 +243,10 @@
void LogComponentDisable (char const *name, enum LogLevel level);
/**
- * \param name a log component name
* \param level a logging level
* \ingroup logging
*
- * Disable the logging output associated with that log component.
- * The logging output can be later re-enabled with a call
- * to ns3::LogComponentEnable.
+ * Disable all logging for all components.
*/
void LogComponentDisableAll (enum LogLevel level);
--- a/src/devices/csma/csma-channel.cc Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/csma/csma-channel.cc Mon Oct 29 15:04:23 2007 +0100
@@ -308,7 +308,7 @@
return (m_deviceList.size());
}
-Ptr<NetDevice>
+Ptr<CsmaNetDevice>
CsmaChannel::GetDevice (uint32_t i) const
{
Ptr< CsmaNetDevice > netDevice;
@@ -371,4 +371,10 @@
return m_state;
}
+Ptr<NetDevice>
+CsmaChannel::DoGetDevice (uint32_t i) const
+{
+ return GetDevice (i);
+}
+
} // namespace ns3
--- a/src/devices/csma/csma-channel.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/csma/csma-channel.h Mon Oct 29 15:04:23 2007 +0100
@@ -258,12 +258,14 @@
* \return Returns the pointer to the net device that is associated
* with deviceId i.
*/
- virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
+ Ptr<CsmaNetDevice> GetDevice (uint32_t i) const;
virtual DataRate GetDataRate (void);
virtual Time GetDelay (void);
private:
+ virtual Ptr<NetDevice> DoGetDevice (uint32_t i) const;
+
DataRate m_bps; /// Data rate of the channel
Time m_delay; /// Delay of the channel.
--- a/src/devices/csma/csma-ipv4-topology.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/csma/csma-ipv4-topology.h Mon Oct 29 15:04:23 2007 +0100
@@ -49,8 +49,8 @@
public:
/**
- * \param n1 Node to be attached to the Csma channel
- * \param ch CsmaChannel to which node n1 should be attached
+ * \param node Node to be attached to the Csma channel
+ * \param channel CsmaChannel to which node n1 should be attached
* \param addr Mac address of the node
*
* Add a Csma node to a Csma channel. This function adds
@@ -102,7 +102,7 @@
* \param netDeviceNumber The NetDevice index number with which to associate
* the address.
* \param address The Ipv4 Address for the interface.
- * \param network The network mask for the interface
+ * \param mask The network mask for the interface
* \param metric (optional) metric (cost) to assign for routing calculations
*
* Add an Ipv4Address to the Ipv4 interface associated with the
--- a/src/devices/point-to-point/point-to-point-channel.cc Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/point-to-point/point-to-point-channel.cc Mon Oct 29 15:04:23 2007 +0100
@@ -123,7 +123,7 @@
return m_nDevices;
}
-Ptr<NetDevice>
+Ptr<PointToPointNetDevice>
PointToPointChannel::GetDevice (uint32_t i) const
{
NS_LOG_FUNCTION;
@@ -145,5 +145,12 @@
return m_delay;
}
+Ptr<NetDevice>
+PointToPointChannel::DoGetDevice (uint32_t i) const
+{
+ NS_LOG_FUNCTION;
+ return GetDevice (i);
+}
+
} // namespace ns3
--- a/src/devices/point-to-point/point-to-point-channel.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/point-to-point/point-to-point-channel.h Mon Oct 29 15:04:23 2007 +0100
@@ -51,8 +51,6 @@
*/
class PointToPointChannel : public Channel {
public:
-// Each point to point link has exactly two net devices
- static const int N_DEVICES = 2;
/**
* \brief Create a PointToPointChannel
*
@@ -84,20 +82,44 @@
* \param device pointer to the netdevice to attach to the channel
*/
void Attach (Ptr<PointToPointNetDevice> device);
+
+ /**
+ * \brief Attach a given netdevice to this channel
+ * \param p Packet to transmit
+ * \param src Source PointToPointNetDevice
+ * \param txTime Transmit time to apply
+ */
bool TransmitStart (Packet& p, Ptr<PointToPointNetDevice> src,
const Time& txTime);
- // Below two not needed
- //bool TransmitEnd (Packet &p, Ptr<PointToPointNetDevice> src);
- //void PropagationCompleteEvent(Packet p, Ptr<PointToPointNetDevice> src);
-
-
+ /**
+ * \brief Get number of devices on this channel
+ * \returns number of devices on this channel
+ */
virtual uint32_t GetNDevices (void) const;
- virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
-
- virtual const DataRate& GetDataRate (void);
- virtual const Time& GetDelay (void);
+ /*
+ * \brief Get PointToPointNetDevice corresponding to index i on this channel
+ * \param i Index number of the device requested
+ * \returns Ptr to PointToPointNetDevice requested
+ */
+ Ptr<PointToPointNetDevice> GetDevice (uint32_t i) const;
+ /*
+ * \brief Get reference to DataRate for this channel
+ * \returns const reference to underlying DataRate object
+ */
+ const DataRate& GetDataRate (void);
+ /*
+ * \brief Get reference to Time object storing the delay on this channel
+ * \returns const reference to underlying Time object
+ */
+ const Time& GetDelay (void);
private:
+
+ // Each point to point link has exactly two net devices
+ static const int N_DEVICES = 2;
+
+ virtual Ptr<NetDevice> DoGetDevice (uint32_t i) const;
+
DataRate m_bps;
Time m_delay;
int32_t m_nDevices;
--- a/src/devices/point-to-point/point-to-point-net-device.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/devices/point-to-point/point-to-point-net-device.h Mon Oct 29 15:04:23 2007 +0100
@@ -54,24 +54,13 @@
* \class PointToPointNetDevice
* \brief A Device for a Point to Point Network Link.
*
- * Ns-3 takes a four-layer view of a protocol stack. This is the same model
- * that TCP uses. In this view, layers 5-7 of the OSI reference model are
- * grouped together into an application layer; layer four (transport / TCP) is
- * broken out; layer three (network / IP) is broken out; and layers 1-2 are
- * grouped together. We call this grouping of layers one and two a NetDevice
- * and represent it as a class in the system.
- *
- * The NetDevice class is specialized according to the needs of the specific
- * kind of network link. In this case, the link is a PointToPoint link. The
- * PointToPoint link is a family of classes that includes this class, the
- * PointToPointNetDevice, a PointToPointChannel class that represents the
- * actual medium across which bits are sent, a PointToPointIpv4Interface class
- * that provides the hook to tie a general purpose node to this specific
- * link, and finally, a PointToPointTopology object that is responsible for
- * putting all of the pieces together.
- *
- * This is the PointToPointNetDevice class that represents, essentially, the
- * PC card that is used to connect to the PointToPoint network.
+ * This PointToPointNetDevice class specializes the NetDevice abstract
+ * base class. Together with a PointToPointChannel (and a peer
+ * PointToPointNetDevice), the class models, with some level of
+ * abstraction, a generic point-to-point or serial link.
+ * Key parameters or objects that can be specified for this device
+ * include a queue, data rate, and interframe transmission gap (the
+ * propagation delay is set in the PointToPointChannel).
*/
class PointToPointNetDevice : public NetDevice {
public:
@@ -79,20 +68,21 @@
* Construct a PointToPointNetDevice
*
* This is the constructor for the PointToPointNetDevice. It takes as a
- * parameter the Node to which this device is connected. Ownership of the
- * Node pointer is not implied and the node must not be deleded.
+ * parameter a pointer to the Node to which this device is connected,
+ * as well as an optional DataRate object.
*
* @see PointToPointTopology::AddPointToPointLink ()
* @param node the Node to which this device is connected.
+ * @param rate (optional) DataRate object
*/
PointToPointNetDevice (Ptr<Node> node,
- const DataRate& = g_defaultRate.GetValue());
+ const DataRate& rate = g_defaultRate.GetValue());
/**
* Destroy a PointToPointNetDevice
*
* This is the destructor for the PointToPointNetDevice.
*/
- virtual ~PointToPointNetDevice();
+ virtual ~PointToPointNetDevice ();
/**
* Set the Data Rate used for transmission of packets. The data rate is
* set in the Attach () method from the corresponding field in the channel
@@ -101,7 +91,7 @@
* @see Attach ()
* @param bps the data rate at which this object operates
*/
- void SetDataRate(const DataRate& bps);
+ void SetDataRate (const DataRate& bps);
/**
* Set the inteframe gap used to separate packets. The interframe gap
* defines the minimum space required between packets sent by this device.
@@ -112,7 +102,7 @@
* @see Attach ()
* @param t the interframe gap time
*/
- void SetInterframeGap(const Time& t);
+ void SetInterframeGap (const Time& t);
/**
* Attach the device to a channel.
*
@@ -127,7 +117,7 @@
* @see SetInterframeGap ()
* @param ch a pointer to the channel to which this object is being attached.
*/
- bool Attach(Ptr<PointToPointChannel> ch);
+ bool Attach (Ptr<PointToPointChannel> ch);
/**
* Attach a queue to the PointToPointNetDevice.
*
@@ -142,7 +132,7 @@
* @param queue a pointer to the queue for which object is assuming
* ownership.
*/
- void AddQueue(Ptr<Queue> queue);
+ void AddQueue (Ptr<Queue> queue);
/**
* Receive a packet from a connected PointToPointChannel.
*
@@ -155,13 +145,15 @@
* @param p a reference to the received packet
*/
void Receive (Packet& p);
-protected:
+
+private:
/**
* Create a Trace Resolver for events in the net device.
*
* @see class TraceResolver
*/
virtual Ptr<TraceResolver> GetTraceResolver (void) const;
+
virtual void DoDispose (void);
/**
* Get a copy of the attached Queue.
@@ -173,6 +165,7 @@
* @returns a pointer to the queue.
*/
Ptr<Queue> GetQueue(void) const;
+
/**
* Get a copy of the attached Channel
*
@@ -183,6 +176,7 @@
* @returns a pointer to the channel
*/
virtual Ptr<Channel> DoGetChannel(void) const;
+
/**
* Set a new default data rate
*/
@@ -192,7 +186,6 @@
* Get the current default rate.
* @returns a const reference to current default
*/
-
static const DataRate& GetDefaultRate();
private:
--- a/src/internet-node/ipv4-interface.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/internet-node/ipv4-interface.h Mon Oct 29 15:04:23 2007 +0100
@@ -97,9 +97,9 @@
*/
Ipv4Mask GetNetworkMask (void) const;
/**
- * \param configured routing metric (cost) of this interface
+ * \param metric configured routing metric (cost) of this interface
*/
- void SetMetric (uint16_t);
+ void SetMetric (uint16_t metric);
/**
* \returns configured routing metric (cost) of this interface
*/
--- a/src/internet-node/ipv4-static-routing.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/internet-node/ipv4-static-routing.h Mon Oct 29 15:04:23 2007 +0100
@@ -209,7 +209,7 @@
* @brief Add a network route to the static routing table.
*
* @param network The Ipv4Address network for this route.
- * @param networkmask The Ipv4Mask to extract the network.
+ * @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.
@@ -225,7 +225,7 @@
* @brief Add a network route to the static routing table.
*
* @param network The Ipv4Address network for this route.
- * @param networkmask The Ipv4Mask to extract the network.
+ * @param networkMask The Ipv4Mask to extract the network.
* @param interface The network interface index used to send packets to the
* destination.
*
@@ -352,7 +352,7 @@
* @param inputInterface The input network interface index over which to
* expect packets destined for this route. May be
* Ipv4RoutingProtocol::IF_INDEX_ANY for packets of local origin.
- * @param outputInterface A vector of network interface indices used to specify
+ * @param outputInterfaces A vector of network interface indices used to specify
* how to send packets to the destination(s).
*
* @see Ipv4Address
@@ -411,7 +411,7 @@
*
* @param i The index (into the routing table) of the multicast route to
* retrieve. If the default route has been set, it will occupy index zero.
- * @return If route <i> is set, a pointer to that Ipv4MulticastRoute is
+ * @return If route \e i is set, a pointer to that Ipv4MulticastRoute is
* returned, otherwise a zero pointer is returned.
*
* @see Ipv4MulticastRoute
@@ -449,11 +449,11 @@
*
* @param origin The IP address specified as the origin of packets for the
* route.
- * @param origin The IP address specified as the multicast group addres of
+ * @param group The IP address specified as the multicast group addres of
* the route.
- * @param inputInterfade The network interface index specified as the expected
+ * @param inputInterface The network interface index specified as the expected
* input interface for the route.
- * @returns True if a route was found and removed, false otherwise.
+ * @returns true if a route was found and removed, false otherwise.
*
* @see Ipv4MulticastRoute
* @see Ipv4StaticRouting::AddMulticastRoute
--- a/src/internet-node/udp-l4-protocol.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/internet-node/udp-l4-protocol.h Mon Oct 29 15:04:23 2007 +0100
@@ -77,10 +77,11 @@
Ipv4Address saddr, Ipv4Address daddr,
uint16_t sport, uint16_t dport);
/**
- * \brief Recieve a packet up the protocol stack
+ * \brief Receive a packet up the protocol stack
* \param p The Packet to dump the contents into
* \param source The source's Ipv4Address
* \param destination The destinations Ipv4Address
+ * \param interface the interface from which the packet is coming.
*/
// inherited from Ipv4L4Protocol
virtual void Receive(Packet& p,
--- a/src/mobility/grid-topology.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/mobility/grid-topology.h Mon Oct 29 15:04:23 2007 +0100
@@ -97,8 +97,8 @@
uint32_t j = 0;
for (T i = begin; i != end; i++)
{
+ LayoutOneRowFirst (*i, j);
j++;
- LayoutOneRowFirst (*i, j);
}
}
@@ -109,8 +109,8 @@
uint32_t j = 0;
for (T i = begin; i != end; i++)
{
+ LayoutOneColumnFirst (*i, j);
j++;
- LayoutOneColumnFirst (*i, j);
}
}
--- a/src/node/channel.cc Mon Oct 29 15:01:36 2007 +0100
+++ b/src/node/channel.cc Mon Oct 29 15:04:23 2007 +0100
@@ -18,6 +18,7 @@
#include "ns3/log.h"
#include "channel.h"
+#include "net-device.h"
NS_LOG_COMPONENT_DEFINE ("Channel");
@@ -60,4 +61,10 @@
return m_name;
}
+ Ptr<NetDevice>
+Channel::GetDevice (uint32_t i) const
+{
+ return DoGetDevice (i);
+}
+
} // namespace ns3
--- a/src/node/channel.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/node/channel.h Mon Oct 29 15:04:23 2007 +0100
@@ -52,16 +52,18 @@
/**
* \param i index of NetDevice to retrieve
* \returns one of the NetDevices connected to this channel.
- *
- * This method must be implemented by subclasses.
*/
- virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0;
+ Ptr<NetDevice> GetDevice (uint32_t i) const;
protected:
virtual ~Channel ();
std::string m_name;
private:
+ /*
+ * This method must be implemented by subclasses.
+ */
+ virtual Ptr<NetDevice> DoGetDevice (uint32_t i) const = 0;
};
}; // namespace ns3
--- a/src/node/ipv4.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/node/ipv4.h Mon Oct 29 15:04:23 2007 +0100
@@ -411,13 +411,13 @@
virtual Ipv4Address GetSourceAddress (Ipv4Address destination) const = 0;
/**
- * \param destination The IP address of a hypothetical destination.
+ * \param dest The IP address of a hypothetical destination.
* \param ifIndex filled in with the interface index that will be used to
* send a packet to the hypothetical destination.
- * \returns True if a single interface can be identified, false otherwise.
+ * \returns true if a single interface can be identified, false otherwise.
*/
virtual bool GetIfIndexForDestination (Ipv4Address dest,
- uint32_t &ifIndex) const = 0;
+ uint32_t &ifIndex) const = 0;
/**
* \param i index of ipv4 interface
--- a/src/simulator/timer.h Mon Oct 29 15:01:36 2007 +0100
+++ b/src/simulator/timer.h Mon Oct 29 15:04:23 2007 +0100
@@ -43,6 +43,10 @@
class Timer
{
public:
+ /**
+ * The policy to use to manager the internal timer when and
+ * instance of the Timer class is destroyed.
+ */
enum DestroyPolicy {
/**
* This policy cancels the event from the destructor of the Timer
@@ -71,7 +75,7 @@
*/
Timer ();
/**
- * \param destroyFlags the event lifetime management policies to use for destroy events
+ * \param destroyPolicy the event lifetime management policies to use for destroy events
*/
Timer (enum DestroyPolicy destroyPolicy);
~Timer ();