From 65f1fd24035d55cc96f45a7c4a7346be71ab1297 Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Thu, 29 May 2008 19:09:56 -0700 Subject: [PATCH 1/3] point-to-point cleanup --- examples/mixed-global-routing.cc | 4 +- examples/simple-alternate-routing.cc | 4 +- examples/simple-error-model.cc | 4 +- examples/simple-global-routing.cc | 4 +- examples/simple-point-to-point-olsr.cc | 4 +- examples/tcp-large-transfer.cc | 2 +- .../point-to-point/point-to-point-channel.cc | 37 +-- .../point-to-point/point-to-point-channel.h | 35 +-- .../point-to-point-net-device.cc | 221 +++++++++++------- .../point-to-point-net-device.h | 84 ++++--- src/devices/point-to-point/point-to-point.h | 4 +- 11 files changed, 225 insertions(+), 178 deletions(-) diff --git a/examples/mixed-global-routing.cc b/examples/mixed-global-routing.cc index f9f79e8dc..361b0ef34 100644 --- a/examples/mixed-global-routing.cc +++ b/examples/mixed-global-routing.cc @@ -71,13 +71,13 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", StringValue ("5Mbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps")); p2p.SetChannelParameter ("Delay", StringValue ("2ms")); NetDeviceContainer d0d2 = p2p.Install (n0n2); NetDeviceContainer d1d2 = p2p.Install (n1n2); - p2p.SetChannelParameter ("BitRate", StringValue ("1500kbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps")); p2p.SetChannelParameter ("Delay", StringValue ("10ms")); NetDeviceContainer d5d6 = p2p.Install (n5n6); diff --git a/examples/simple-alternate-routing.cc b/examples/simple-alternate-routing.cc index 0cdc687b0..2d130e7f0 100644 --- a/examples/simple-alternate-routing.cc +++ b/examples/simple-alternate-routing.cc @@ -97,13 +97,13 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", StringValue ("5Mbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps")); p2p.SetChannelParameter ("Delay", StringValue ("2ms")); NetDeviceContainer d0d2 = p2p.Install (n0n2); NetDeviceContainer d1d2 = p2p.Install (n1n2); - p2p.SetChannelParameter ("BitRate", StringValue ("1500kbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps")); p2p.SetChannelParameter ("Delay", StringValue ("10ms")); NetDeviceContainer d3d2 = p2p.Install (n3n2); diff --git a/examples/simple-error-model.cc b/examples/simple-error-model.cc index 1c08f3f04..71d022200 100644 --- a/examples/simple-error-model.cc +++ b/examples/simple-error-model.cc @@ -92,13 +92,13 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", DataRateValue (DataRate (5000000))); + p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate (5000000))); p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2))); NetDeviceContainer d0d2 = p2p.Install (n0n2); NetDeviceContainer d1d2 = p2p.Install (n1n2); - p2p.SetChannelParameter ("BitRate", DataRateValue (DataRate (1500000))); + p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate (1500000))); p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds (10))); NetDeviceContainer d3d2 = p2p.Install (n3n2); diff --git a/examples/simple-global-routing.cc b/examples/simple-global-routing.cc index e6a7b4eef..35fb96d94 100644 --- a/examples/simple-global-routing.cc +++ b/examples/simple-global-routing.cc @@ -92,13 +92,13 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", StringValue ("5Mbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps")); p2p.SetChannelParameter ("Delay", StringValue ("2ms")); NetDeviceContainer d0d2 = p2p.Install (n0n2); NetDeviceContainer d1d2 = p2p.Install (n1n2); - p2p.SetChannelParameter ("BitRate", StringValue ("1500kbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps")); p2p.SetChannelParameter ("Delay", StringValue ("10ms")); NetDeviceContainer d3d2 = p2p.Install (n3n2); diff --git a/examples/simple-point-to-point-olsr.cc b/examples/simple-point-to-point-olsr.cc index 0f271daf1..e11816bff 100644 --- a/examples/simple-point-to-point-olsr.cc +++ b/examples/simple-point-to-point-olsr.cc @@ -93,11 +93,11 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", StringValue ("5Mbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps")); p2p.SetChannelParameter ("Delay", StringValue ("2ms")); NetDeviceContainer nd02 = p2p.Install (n02); NetDeviceContainer nd12 = p2p.Install (n12); - p2p.SetChannelParameter ("BitRate", StringValue ("1500kbps")); + p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps")); p2p.SetChannelParameter ("Delay", StringValue ("10ms")); NetDeviceContainer nd32 = p2p.Install (n32); NetDeviceContainer nd34 = p2p.Install (n34); diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index 50ea99763..16110a7e0 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -137,7 +137,7 @@ int main (int argc, char *argv[]) // We create the channels first without any IP addressing information PointToPointHelper p2p; - p2p.SetChannelParameter ("BitRate", DataRateValue (DataRate(10000000))); + p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate(10000000))); p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds(10))); NetDeviceContainer dev0 = p2p.Install (c0); NetDeviceContainer dev1 = p2p.Install (c1); diff --git a/src/devices/point-to-point/point-to-point-channel.cc b/src/devices/point-to-point/point-to-point-channel.cc index 94d3c6e40..b8697a208 100644 --- a/src/devices/point-to-point/point-to-point-channel.cc +++ b/src/devices/point-to-point/point-to-point-channel.cc @@ -34,10 +34,6 @@ PointToPointChannel::GetTypeId (void) static TypeId tid = TypeId ("ns3::PointToPointChannel") .SetParent () .AddConstructor () - .AddAttribute ("BitRate", "The maximum bitrate of the channel", - DataRateValue (DataRate (0xffffffff)), - MakeDataRateAccessor (&PointToPointChannel::m_bps), - MakeDataRateChecker ()) .AddAttribute ("Delay", "Transmission delay through the channel", TimeValue (Seconds (0)), MakeTimeAccessor (&PointToPointChannel::m_delay), @@ -52,7 +48,8 @@ PointToPointChannel::GetTypeId (void) PointToPointChannel::PointToPointChannel() : Channel ("PointToPoint Channel"), - m_nDevices(0) + m_delay (Seconds (0.)), + m_nDevices (0) { NS_LOG_FUNCTION_NOARGS (); } @@ -79,9 +76,10 @@ PointToPointChannel::Attach(Ptr device) } bool -PointToPointChannel::TransmitStart(Ptr p, - Ptr src, - const Time& txTime) +PointToPointChannel::TransmitStart( + Ptr p, + Ptr src, + Time txTime) { NS_LOG_FUNCTION (this << p << src); NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); @@ -91,12 +89,8 @@ PointToPointChannel::TransmitStart(Ptr p, uint32_t wire = src == m_link[0].m_src ? 0 : 1; - // Here we schedule the packet receive event at the receiver, - // which simplifies this model quite a bit. The channel just - // adds the propagation delay time - Simulator::Schedule (txTime + m_delay, - &PointToPointNetDevice::Receive, - m_link[wire].m_dst, p); + Simulator::Schedule (txTime + m_delay, &PointToPointNetDevice::Receive, + m_link[wire].m_dst, p); return true; } @@ -115,20 +109,6 @@ PointToPointChannel::GetPointToPointDevice (uint32_t i) const return m_link[i].m_src; } -const DataRate& -PointToPointChannel::GetDataRate (void) -{ - NS_LOG_FUNCTION_NOARGS (); - return m_bps; -} - -const Time& -PointToPointChannel::GetDelay (void) -{ - NS_LOG_FUNCTION_NOARGS (); - return m_delay; -} - Ptr PointToPointChannel::GetDevice (uint32_t i) const { @@ -136,5 +116,4 @@ PointToPointChannel::GetDevice (uint32_t i) const return GetPointToPointDevice (i); } - } // namespace ns3 diff --git a/src/devices/point-to-point/point-to-point-channel.h b/src/devices/point-to-point/point-to-point-channel.h index 3df19f4a1..2e538c761 100644 --- a/src/devices/point-to-point/point-to-point-channel.h +++ b/src/devices/point-to-point/point-to-point-channel.h @@ -36,14 +36,7 @@ class Packet; * This class represents a very simple point to point channel. Think full * duplex RS-232 or RS-422 with null modem and no handshaking. There is no * multi-drop capability on this channel -- there can be a maximum of two - * point-to-point net devices connected. Once we start talking about multi- - * drop, or CSMA, or some other sharing mechanism, things begin getting - * complicated quickly. Rather than invent some ad-hoc mechanism, we just - * Keep It Simple everywhere. - * - * When the channel is instaniated, the constructor takes parameters for - * a single speed, in bits per second, and a speed-of-light delay time as a - * Time object. Both directions use the same speed and delay time. + * point-to-point net devices connected. * * There are two "wires" in the channel. The first device connected gets the * [0] wire to transmit on. The second device gets the [1] wire. There is a @@ -58,7 +51,7 @@ public: * \brief Create a PointToPointChannel * * By default, you get a channel with the name "PointToPoint Channel" that - * has an "infitely" fast transmission speed and zero delay. + * has zero transmission delay. */ PointToPointChannel (); @@ -75,38 +68,32 @@ public: * \param txTime Transmit time to apply */ bool TransmitStart (Ptr p, Ptr src, - const Time& txTime); + Time txTime); /** * \brief Get number of devices on this channel * \returns number of devices on this channel */ virtual uint32_t GetNDevices (void) const; + /* * \brief Get PointToPointNetDevice corresponding to index i on this channel * \param i Index number of the device requested * \returns Ptr to PointToPointNetDevice requested */ Ptr GetPointToPointDevice (uint32_t i) const; + + /* + * \brief Get NetDevice corresponding to index i on this channel + * \param i Index number of the device requested + * \returns Ptr to NetDevice requested + */ virtual Ptr 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; - - DataRate m_bps; Time m_delay; int32_t m_nDevices; @@ -122,7 +109,7 @@ private: { public: Link() : m_state (INITIALIZING), m_src (0), m_dst (0) {} - WireState m_state; + WireState m_state; Ptr m_src; Ptr m_dst; }; diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index c752e9023..25abe19af 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -45,7 +45,7 @@ PointToPointNetDevice::GetTypeId (void) MakeMac48AddressAccessor (&PointToPointNetDevice::m_address), MakeMac48AddressChecker ()) .AddAttribute ("DataRate", "The default data rate for point to point links", - DataRateValue (DataRate ("10Mb/s")), + DataRateValue (DataRate ("32768b/s")), MakeDataRateAccessor (&PointToPointNetDevice::m_bps), MakeDataRateChecker ()) .AddAttribute ("ReceiveErrorModel", "XXX", @@ -82,15 +82,10 @@ PointToPointNetDevice::PointToPointNetDevice () } PointToPointNetDevice::~PointToPointNetDevice () -{} - -void -PointToPointNetDevice::SetAddress (Mac48Address self) { - m_address = self; } -void + void PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) { NS_LOG_FUNCTION_NOARGS (); @@ -100,7 +95,7 @@ PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) p->AddHeader (ppp); } -bool + bool PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) { NS_LOG_FUNCTION_NOARGS (); @@ -110,7 +105,8 @@ PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) return true; } -void PointToPointNetDevice::DoDispose() + void +PointToPointNetDevice::DoDispose() { NS_LOG_FUNCTION_NOARGS (); m_node = 0; @@ -119,22 +115,21 @@ void PointToPointNetDevice::DoDispose() NetDevice::DoDispose (); } -void PointToPointNetDevice::SetDataRate(const DataRate& bps) + void +PointToPointNetDevice::SetDataRate(DataRate bps) { NS_LOG_FUNCTION_NOARGS (); - if (!m_channel || bps <= m_channel->GetDataRate ()) - { - m_bps = bps; - } + m_bps = bps; } -void PointToPointNetDevice::SetInterframeGap(const Time& t) + void +PointToPointNetDevice::SetInterframeGap(Time t) { NS_LOG_FUNCTION_NOARGS (); m_tInterframeGap = t; } -bool + bool PointToPointNetDevice::TransmitStart (Ptr p) { NS_LOG_FUNCTION (this << p); @@ -151,33 +146,40 @@ PointToPointNetDevice::TransmitStart (Ptr p) NS_LOG_LOGIC ("Schedule TransmitCompleteEvent in " << txCompleteTime.GetSeconds () << "sec"); - // Schedule the tx complete event + Simulator::Schedule (txCompleteTime, - &PointToPointNetDevice::TransmitComplete, - this); + &PointToPointNetDevice::TransmitComplete, this); + return m_channel->TransmitStart(p, this, txTime); } -void PointToPointNetDevice::TransmitComplete (void) + void +PointToPointNetDevice::TransmitComplete (void) { NS_LOG_FUNCTION_NOARGS (); // -// This function is called to finish the process of transmitting a packet. -// We need to tell the channel that we've stopped wiggling the wire and -// get the next packet from the queue. If the queue is empty, we are -// done, otherwise transmit the next packet. +// This function is called to when we're all done transmitting a packet. +// We try and pull another packet off of the transmit queue. If the queue +// is empty, we are done, otherwise we need to start transmitting the +// next packet. // NS_ASSERT_MSG(m_txMachineState == BUSY, "Must be BUSY if transmitting"); m_txMachineState = READY; Ptr p = m_queue->Dequeue (); if (p == 0) { - return; // Nothing to do at this point +// +// No packet was on the queue, so we just exit. +// + return; } +// +// Got another packet off of the queue, so start the transmit process agin. +// TransmitStart(p); } -bool + bool PointToPointNetDevice::Attach (Ptr ch) { NS_LOG_FUNCTION (this << &ch); @@ -185,64 +187,64 @@ PointToPointNetDevice::Attach (Ptr ch) m_channel = ch; m_channel->Attach(this); - m_bps = m_channel->GetDataRate (); - // GFR Comment. Below is definitely wrong. Interframe gap - // is unrelated to channel delay. - // -- unlesss you want to introduce a default gap which is there to avoid - // parts of multiple packets flowing on the "wire" at the same time. - //m_tInterframeGap = m_channel->GetDelay (); - /* - * For now, this device is up whenever a channel is attached to it. - * In fact, it should become up only when the second device - * is attached to the channel. So, there should be a way for - * a PointToPointChannel to notify both of its attached devices - * that the channel is 'complete', hence that the devices are - * up, hence that they can call NotifyLinkUp. - */ +// +// This device is up whenever it is attached to a channel. A better plan +// would be to have the link come up when both devices are attached, but this +// is not done for now. +// NotifyLinkUp (); return true; } -void PointToPointNetDevice::SetQueue (Ptr q) + void +PointToPointNetDevice::SetQueue (Ptr q) { NS_LOG_FUNCTION (this << q); - m_queue = q; } -void PointToPointNetDevice::SetReceiveErrorModel (Ptr em) + void +PointToPointNetDevice::SetReceiveErrorModel (Ptr em) { NS_LOG_FUNCTION ("(" << em << ")"); - m_receiveErrorModel = em; } -void PointToPointNetDevice::Receive (Ptr packet) + void +PointToPointNetDevice::Receive (Ptr packet) { NS_LOG_FUNCTION (this << packet); uint16_t protocol = 0; if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) ) { +// +// If we have an error model and it indicates that it is time to lose a +// corrupted packet, don't forward this packet up, let it go. +// m_dropTrace (packet); - // Do not forward up; let this packet go } else { +// +// Hit the receive trace hook, strip off the point-to-point protocol header +// and forward this packet up the protocol stack. +// m_rxTrace (packet); ProcessHeader(packet, protocol); m_rxCallback (this, packet, protocol, GetBroadcast ()); } } -Ptr PointToPointNetDevice::GetQueue(void) const + Ptr +PointToPointNetDevice::GetQueue(void) const { NS_LOG_FUNCTION_NOARGS (); return m_queue; } -void + void PointToPointNetDevice::NotifyLinkUp (void) { m_linkUp = true; @@ -252,110 +254,167 @@ PointToPointNetDevice::NotifyLinkUp (void) } } -void + void PointToPointNetDevice::SetName(const std::string name) { m_name = name; } -std::string + + std::string PointToPointNetDevice::GetName(void) const { return m_name; } -void + + void PointToPointNetDevice::SetIfIndex(const uint32_t index) { m_ifIndex = index; } -uint32_t + + uint32_t PointToPointNetDevice::GetIfIndex(void) const { return m_ifIndex; } -Ptr + + Ptr PointToPointNetDevice::GetChannel (void) const { return m_channel; } -Address + +// +// This is a point-to-point device, so we really don't need any kind of address +// information. However, the base class NetDevice wants us to define the +// methods to get and set the address. Rather than be rude and assert, we let +// clients get and set the address, but simply ignore them. + void +PointToPointNetDevice::SetAddress (Mac48Address addr) +{ + m_address = addr; +} + + Address PointToPointNetDevice::GetAddress (void) const { return m_address; } -bool + + bool PointToPointNetDevice::SetMtu (const uint16_t mtu) { m_mtu = mtu; return true; } -uint16_t + + uint16_t PointToPointNetDevice::GetMtu (void) const { return m_mtu; } -bool + + bool PointToPointNetDevice::IsLinkUp (void) const { return m_linkUp; } -void + + void PointToPointNetDevice::SetLinkChangeCallback (Callback callback) { m_linkChangeCallback = callback; } -bool + +// +// This is a point-to-point device, so every transmission is a broadcast to +// all of the devices on the network. +// + bool PointToPointNetDevice::IsBroadcast (void) const { return true; } -Address + +// +// We don't really need any addressing information since this is a +// point-to-point device. The base class NetDevice wants us to return a +// broadcast address, so we make up something reasonable. +// + Address PointToPointNetDevice::GetBroadcast (void) const { return Mac48Address ("ff:ff:ff:ff:ff:ff"); } -bool + +// +// We don't deal with multicast here. It doesn't make sense to include some +// of the one destinations on the network but exclude some of the others. + bool PointToPointNetDevice::IsMulticast (void) const { return false; } -Address + +// +// Since we return false in the IsMulticast call, calls to other multicast +// related methods returns are undefined according to the base class. So we +// can freely make something up, which is the base of the MAC multicast +// address space. +// + Address PointToPointNetDevice::GetMulticast (void) const { return Mac48Address ("01:00:5e:00:00:00"); } -Address + + Address PointToPointNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const { return Mac48Address ("01:00:5e:00:00:00"); } -bool + + bool PointToPointNetDevice::IsPointToPoint (void) const { return true; } -bool -PointToPointNetDevice::Send(Ptr packet, const Address& dest, uint16_t protocolNumber) + + bool +PointToPointNetDevice::Send( + Ptr packet, + const Address &dest, + uint16_t protocolNumber) { NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest); NS_LOG_LOGIC ("UID is " << packet->GetUid ()); - // GFR Comment. Why is this an assertion? Can't a link legitimately - // "go down" during the simulation? Shouldn't we just wait for it - // to come back up? - NS_ASSERT (IsLinkUp ()); +// +// If IsLinkUp() is false it means there is no channel to send any packet +// over so we just return an error. +// + if (IsLinkUp () == false) + { + return false; + } + +// +// Stick a point to point protocol header on the packet in preparation for +// shoving it out the door. +// AddHeader(packet, protocolNumber); -// -// This class simulates a point to point device. In the case of a serial -// link, this means that we're simulating something like a UART. -// // // If there's a transmission in progress, we enque the packet for later // transmission; otherwise we send it now. +// if (m_txMachineState == READY) { -// We still enqueue and dequeue it to hit the tracing hooks +// +// Even if the transmitter is immediately available, we still enqueue and +// dequeue the packet to hit the tracing hooks. +// m_queue->Enqueue (packet); packet = m_queue->Dequeue (); return TransmitStart (packet); @@ -365,22 +424,26 @@ PointToPointNetDevice::Send(Ptr packet, const Address& dest, uint16_t pr return m_queue->Enqueue(packet); } } -Ptr + + Ptr PointToPointNetDevice::GetNode (void) const { return m_node; } -void + + void PointToPointNetDevice::SetNode (Ptr node) { m_node = node; } -bool + + bool PointToPointNetDevice::NeedsArp (void) const { return false; } -void + + void PointToPointNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb) { m_rxCallback = cb; diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h index b42ed4fe2..6b63ecb37 100644 --- a/src/devices/point-to-point/point-to-point-net-device.h +++ b/src/devices/point-to-point/point-to-point-net-device.h @@ -60,16 +60,16 @@ public: * This is the constructor for the PointToPointNetDevice. It takes as a * parameter a pointer to the Node to which this device is connected, * as well as an optional DataRate object. - * - * @see PointToPointTopology::AddPointToPointLink () */ PointToPointNetDevice (); + /** * Destroy a PointToPointNetDevice * * This is the destructor for the 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 @@ -78,48 +78,35 @@ public: * @see Attach () * @param bps the data rate at which this object operates */ - void SetDataRate (const DataRate& bps); + void SetDataRate (DataRate bps); + /** * Set the inteframe gap used to separate packets. The interframe gap * defines the minimum space required between packets sent by this device. - * It is usually set in the Attach () method based on the speed of light - * delay of the channel to which the device is attached. It can be - * overridden using this method if desired. * - * @see Attach () * @param t the interframe gap time */ - void SetInterframeGap (const Time& t); + void SetInterframeGap (Time t); + /** * Attach the device to a channel. * - * The PointToPointTopology object creates a PointToPointChannel and two - * PointtoPointNetDevices. In order to introduce these components to each - * other, the topology object calls Attach () on each PointToPointNetDevice. - * Inside this method, the Net Device calls out to the PointToPointChannel - * to introduce itself. - * - * @see PointToPointTopology::AddPointToPointLink () - * @see SetDataRate () - * @see SetInterframeGap () - * @param ch a pointer to the channel to which this object is being attached. + * @param ch Ptr to the channel to which this object is being attached. */ bool Attach (Ptr ch); + /** * Attach a queue to the PointToPointNetDevice. * - * The PointToPointNetDevice "owns" a queue. This queue is created by the - * PointToPointTopology object and implements a queueing method such as - * DropTail or RED. The PointToPointNetDevice assumes ownership of this - * queue and must delete it when the device is destroyed. + * The PointToPointNetDevice "owns" a queue that implements a queueing + * method such as DropTail or RED. * - * @see PointToPointTopology::AddPointToPointLink () * @see Queue * @see DropTailQueue - * @param queue a pointer to the queue for which object is assuming - * ownership. + * @param queue Ptr to the new queue. */ void SetQueue (Ptr queue); + /** * Attach a receive ErrorModel to the PointToPointNetDevice. * @@ -127,9 +114,10 @@ public: * the packet receive chain. * * @see ErrorModel - * @param em a pointer to the ErrorModel + * @param em Ptr to the ErrorModel. */ void SetReceiveErrorModel(Ptr em); + /** * Receive a packet from a connected PointToPointChannel. * @@ -139,46 +127,67 @@ public: * arrived at the device. * * @see PointToPointChannel - * @param p a reference to the received packet + * @param p Ptr to the received packet. */ void Receive (Ptr p); - void SetAddress (Mac48Address self); + /** + * Assign a MAC address to this device. + * + * @see Mac48Address + * @param addr The new address. + */ + void SetAddress (Mac48Address addr); - // inherited from NetDevice base class. +// +// Pure virtual methods inherited from NetDevice we must implement. +// virtual void SetName(const std::string name); virtual std::string GetName(void) const; + virtual void SetIfIndex(const uint32_t index); virtual uint32_t GetIfIndex(void) const; + virtual Ptr GetChannel (void) const; virtual Address GetAddress (void) const; + virtual bool SetMtu (const uint16_t mtu); virtual uint16_t GetMtu (void) const; + virtual bool IsLinkUp (void) const; + virtual void SetLinkChangeCallback (Callback callback); + virtual bool IsBroadcast (void) const; virtual Address GetBroadcast (void) const; + virtual bool IsMulticast (void) const; virtual Address GetMulticast (void) const; virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const; + virtual bool IsPointToPoint (void) const; - virtual bool Send(Ptr packet, const Address& dest, uint16_t protocolNumber); + + virtual bool Send(Ptr packet, const Address &dest, + uint16_t protocolNumber); + virtual Ptr GetNode (void) const; virtual void SetNode (Ptr node); + virtual bool NeedsArp (void) const; + virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); private: virtual void DoDispose (void); + /** * Get a copy of the attached Queue. * * This method is provided for any derived class that may need to get * direct access to the underlying queue. * - * @see PointToPointTopology - * @returns a pointer to the queue. + * @returns Ptr to the queue. */ Ptr GetQueue(void) const; @@ -188,6 +197,7 @@ private: * respect the protocol implemented by the agent. */ void AddHeader(Ptr p, uint16_t protocolNumber); + /** * Removes, from a packet of data, all headers and trailers that * relate to the protocol implemented by the agent @@ -195,6 +205,7 @@ private: * protocol stack. */ bool ProcessHeader(Ptr p, uint16_t& param); + /** * Start Sending a Packet Down the Wire. * @@ -211,14 +222,15 @@ private: * @returns true if success, false on failure */ bool TransmitStart (Ptr p); + /** * Stop Sending a Packet Down the Wire and Begin the Interframe Gap. * * The TransmitComplete method is used internally to finish the process * of sending a packet out on the channel. - * */ void TransmitComplete(void); + void NotifyLinkUp (void); /** @@ -234,24 +246,28 @@ private: * @see TxMachineState */ TxMachineState m_txMachineState; + /** * The data rate that the Net Device uses to simulate packet transmission * timing. * @see class DataRate */ DataRate m_bps; + /** * The interframe gap that the Net Device uses to throttle packet * transmission * @see class Time */ Time m_tInterframeGap; + /** * The PointToPointChannel to which this PointToPointNetDevice has been * attached. * @see class PointToPointChannel */ Ptr m_channel; + /** * The Queue which this PointToPointNetDevice uses as a packet source. * Management of this Queue has been delegated to the PointToPointNetDevice @@ -260,6 +276,7 @@ private: * @see class DropTailQueue */ Ptr m_queue; + /** * The trace source for the packet reception events that the device can * fire. @@ -267,6 +284,7 @@ private: * @see class CallBackTraceSource */ TracedCallback > m_rxTrace; + /** * The trace source for the packet drop events that the device can * fire. diff --git a/src/devices/point-to-point/point-to-point.h b/src/devices/point-to-point/point-to-point.h index f6799ceec..896dbda33 100644 --- a/src/devices/point-to-point/point-to-point.h +++ b/src/devices/point-to-point/point-to-point.h @@ -40,6 +40,6 @@ * beyond the eight bits per byte of the packet sent. That is, we do not * model Flag Sequences, Frame Check Sequences nor do we "escape" any data. * - * The ns3::PointToPointChannel does model a speed-of-light delay which can - * be accessed via the attribute "Delay." + * The ns3::PointToPointChannel does model a speed-of-light or transmission + * delay which can be set and get via the attribute "Delay." */ From 93043030b36889e18e0ff789a4dce906ee198f43 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 29 May 2008 23:24:10 -0700 Subject: [PATCH 2/3] Doxygen organization --- src/common/buffer.h | 2 ++ src/common/chunk.h | 3 +++ src/common/data-rate.h | 3 +++ src/common/error-model.h | 3 +++ src/common/header.h | 2 ++ src/common/packet-metadata.h | 1 + src/common/packet.h | 3 +++ src/common/pcap-writer.h | 2 ++ src/common/tag-buffer.h | 2 ++ src/common/tag-list.h | 2 ++ src/common/tag.h | 2 ++ src/common/trailer.h | 2 ++ src/core/assert.h | 5 +++++ src/core/attribute-accessor-helper.h | 6 ++++++ src/core/attribute-list.h | 2 ++ src/core/attribute.h | 18 ++++++++++++++++++ src/core/boolean.h | 2 ++ src/core/double.h | 2 ++ src/core/empty.h | 3 +++ src/core/enum.h | 2 ++ src/core/fatal-error.h | 3 +-- src/core/global-value.h | 2 ++ src/core/integer.h | 1 + src/core/log.h | 2 +- src/core/object-base.h | 2 ++ src/core/object-factory.h | 2 ++ src/core/object-vector.h | 2 ++ src/core/object.h | 5 +++++ src/core/pointer.h | 2 ++ src/core/ptr.h | 6 ++++++ src/core/string.h | 2 ++ src/core/test.h | 8 ++++++++ src/core/trace-source-accessor.h | 2 ++ src/core/traced-value.h | 7 +++++++ src/core/uinteger.h | 2 ++ src/simulator/event-impl.h | 3 +++ src/simulator/heap-scheduler.h | 3 +++ src/simulator/list-scheduler.h | 3 +++ src/simulator/map-scheduler.h | 3 +++ src/simulator/nstime.h | 3 +++ src/simulator/scheduler.h | 3 +++ src/simulator/simulator.h | 2 ++ src/simulator/timer.h | 2 ++ src/simulator/watchdog.h | 3 +++ 44 files changed, 137 insertions(+), 3 deletions(-) diff --git a/src/common/buffer.h b/src/common/buffer.h index 75f93f780..65081f474 100644 --- a/src/common/buffer.h +++ b/src/common/buffer.h @@ -36,6 +36,8 @@ namespace ns3 { /** + * \ingroup packet + * * \brief automatically resized byte buffer * * This represents a buffer of bytes. Its size is diff --git a/src/common/chunk.h b/src/common/chunk.h index f2a6a9404..44bbe4545 100644 --- a/src/common/chunk.h +++ b/src/common/chunk.h @@ -6,6 +6,9 @@ namespace ns3 { +/** + * \ingroup packet + */ class Chunk : public ObjectBase { public: diff --git a/src/common/data-rate.h b/src/common/data-rate.h index 3ebdbeaab..388c30173 100644 --- a/src/common/data-rate.h +++ b/src/common/data-rate.h @@ -31,6 +31,9 @@ namespace ns3 { /** + * \ingroup common + * \defgroup datarate Data Rate + * * \brief Class for representing data rates * * Allows for natural and familiar use of data rates. Allows construction diff --git a/src/common/error-model.h b/src/common/error-model.h index 5cd050548..309d0e4be 100644 --- a/src/common/error-model.h +++ b/src/common/error-model.h @@ -30,6 +30,9 @@ namespace ns3 { class Packet; /** + * \ingroup common + * \defgroup errormodel Error Model + * * \brief General error model that can be used to corrupt packets * * This object is used to flag packets as being lost/errored or not. diff --git a/src/common/header.h b/src/common/header.h index 42e0bc9aa..cb44d3dae 100644 --- a/src/common/header.h +++ b/src/common/header.h @@ -28,6 +28,8 @@ namespace ns3 { /** + * \ingroup Packet + * * \brief Protocol header serialization and deserialization. * * Every Protocol header which needs to be inserted or removed diff --git a/src/common/packet-metadata.h b/src/common/packet-metadata.h index 37285e960..b5a2096c0 100644 --- a/src/common/packet-metadata.h +++ b/src/common/packet-metadata.h @@ -36,6 +36,7 @@ class Trailer; /** * \internal + * \ingroup packet * \brief handle packet metadata about packet headers and trailers * * This class is used by the Packet class to record every operation diff --git a/src/common/packet.h b/src/common/packet.h index e79d82125..2e5d9ef49 100644 --- a/src/common/packet.h +++ b/src/common/packet.h @@ -96,6 +96,9 @@ private: }; /** + * \ingroup common + * \defgroup packet Packet + * * \brief network packets * * Each network packet contains a byte buffer, a set of tags, and diff --git a/src/common/pcap-writer.h b/src/common/pcap-writer.h index 2a34a5b63..52450a117 100644 --- a/src/common/pcap-writer.h +++ b/src/common/pcap-writer.h @@ -29,6 +29,8 @@ namespace ns3 { class Packet; /** + * \ingroup common + * * \brief Pcap output for Packet logger * * Log Packets to a file in pcap format which can be diff --git a/src/common/tag-buffer.h b/src/common/tag-buffer.h index 2e5836a21..6ef0e94cd 100644 --- a/src/common/tag-buffer.h +++ b/src/common/tag-buffer.h @@ -33,6 +33,8 @@ namespace ns3 { /** + * \ingroup packet + * * \brief read and write tag data * * This class allows subclasses of the ns3::Tag base class diff --git a/src/common/tag-list.h b/src/common/tag-list.h index 10cf3ff60..acfdf7558 100644 --- a/src/common/tag-list.h +++ b/src/common/tag-list.h @@ -29,6 +29,8 @@ namespace ns3 { struct TagListData; /** + * \ingroup packet + * * \brief keep track of the tags stored in a packet. * * This class is mostly private to the Packet implementation and users diff --git a/src/common/tag.h b/src/common/tag.h index c4191864d..8454ae394 100644 --- a/src/common/tag.h +++ b/src/common/tag.h @@ -27,6 +27,8 @@ namespace ns3 { /** + * \ingroup packet + * * \brief tag a set of bytes in a packet * * New kinds of tags can be created by subclassing this base class. diff --git a/src/common/trailer.h b/src/common/trailer.h index e3771605b..70eb25130 100644 --- a/src/common/trailer.h +++ b/src/common/trailer.h @@ -29,6 +29,8 @@ namespace ns3 { /** + * \ingroup packet + * * \brief Protocol trailer serialization and deserialization. * * Every Protocol trailer which needs to be inserted or removed diff --git a/src/core/assert.h b/src/core/assert.h index 54c460549..3dadf537c 100644 --- a/src/core/assert.h +++ b/src/core/assert.h @@ -28,7 +28,12 @@ /** * \ingroup core + * \defgroup debugging Debugging + */ +/** + * \ingroup debugging * \defgroup assert Assert + * * \brief assert functions and macros * * The assert macros are used to verify diff --git a/src/core/attribute-accessor-helper.h b/src/core/attribute-accessor-helper.h index 1e0223b09..f5e329dd9 100644 --- a/src/core/attribute-accessor-helper.h +++ b/src/core/attribute-accessor-helper.h @@ -24,10 +24,16 @@ namespace ns3 { +/** + * \ingroup AttributeHelper + */ template Ptr MakeAccessorHelper (T1 a1); +/** + * \ingroup AttributeHelper + */ template Ptr MakeAccessorHelper (T1 a1, T2 a2); diff --git a/src/core/attribute-list.h b/src/core/attribute-list.h index 922a5dbaf..36bda6735 100644 --- a/src/core/attribute-list.h +++ b/src/core/attribute-list.h @@ -28,6 +28,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \brief a container of attributes to be used during object's construction * and in ns3::Object::Set. * diff --git a/src/core/attribute.h b/src/core/attribute.h index 7061f1a70..aa16c8634 100644 --- a/src/core/attribute.h +++ b/src/core/attribute.h @@ -33,6 +33,15 @@ class Attribute; class ObjectBase; /** + * + * \ingroup core + * \defgroup attribute Attribute + */ + +/** + * + * \ingroup attribute + * * \brief Hold a value for an Attribute. * * Instances of this class should always be wrapped into an Attribute object. @@ -78,6 +87,8 @@ public: /** * \brief allow setting and getting the value of an attribute. * + * \ingroup attribute + * * The goal of this class is to hide from the user how an attribute * is actually set or get to or from a class instance. Implementations * of this base class are usually provided through the MakeAccessorHelper @@ -124,6 +135,8 @@ public: /** * \brief Represent the type of an attribute * + * \ingroup attribute + * * Each type of attribute has an associated unique AttributeChecker * subclass. The type of the subclass can be safely used by users * to infer the type of the associated attribute. i.e., we expect @@ -180,6 +193,11 @@ public: }; +/** + * \brief A class for an empty attribute value + * + * \ingroup attribute + */ class EmptyAttributeValue : public AttributeValue { public: diff --git a/src/core/boolean.h b/src/core/boolean.h index d4186b391..eb15d9506 100644 --- a/src/core/boolean.h +++ b/src/core/boolean.h @@ -26,6 +26,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \brief Hold a bool native type * * \anchor bool diff --git a/src/core/double.h b/src/core/double.h index 60de64150..1ed54ecdd 100644 --- a/src/core/double.h +++ b/src/core/double.h @@ -27,6 +27,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \class ns3::DoubleValue * \brief Hold an floating point type * diff --git a/src/core/empty.h b/src/core/empty.h index 6b89b9cdb..bf3a24248 100644 --- a/src/core/empty.h +++ b/src/core/empty.h @@ -2,6 +2,9 @@ #define EMPTY_H namespace ns3 { +/** + * \brief make Callback use a separate empty type + */ class empty {}; } diff --git a/src/core/enum.h b/src/core/enum.h index 4cea3134a..d9eeb521f 100644 --- a/src/core/enum.h +++ b/src/core/enum.h @@ -27,6 +27,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \brief hold variables of type 'enum' * * This class can be used to hold variables of any kind diff --git a/src/core/fatal-error.h b/src/core/fatal-error.h index 9b72b77f0..8e896cf2f 100644 --- a/src/core/fatal-error.h +++ b/src/core/fatal-error.h @@ -24,8 +24,7 @@ #include /** - * \ingroup core - * \defgroup error Error + * \ingroup debugging * \brief fatal error handling * * \param msg message to output when this macro is hit. diff --git a/src/core/global-value.h b/src/core/global-value.h index db1a82854..e8d1a3232 100644 --- a/src/core/global-value.h +++ b/src/core/global-value.h @@ -29,6 +29,8 @@ namespace ns3 { /** + * \ingroup Core + * * \brief hold a so-called 'global value'. * * Instances of this class are expected to be allocated as static diff --git a/src/core/integer.h b/src/core/integer.h index ea7a20c0e..8ac78e47d 100644 --- a/src/core/integer.h +++ b/src/core/integer.h @@ -27,6 +27,7 @@ namespace ns3 { /** + * \ingroup attribute * \class ns3::IntegerValue * \brief Hold a signed integer type * diff --git a/src/core/log.h b/src/core/log.h index 41b190370..f2565d71a 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -28,7 +28,7 @@ /** - * \ingroup core + * \ingroup debugging * \defgroup logging Logging * \brief Logging functions and macros * diff --git a/src/core/object-base.h b/src/core/object-base.h index 27dd4f735..fa8d5ed41 100644 --- a/src/core/object-base.h +++ b/src/core/object-base.h @@ -42,6 +42,8 @@ namespace ns3 { class AttributeList; /** + * \ingroup object + * * \brief implement the ns-3 type and attribute system * * Every class which wants to integrate in the ns-3 type and attribute diff --git a/src/core/object-factory.h b/src/core/object-factory.h index 01f9341ed..9ae305c08 100644 --- a/src/core/object-factory.h +++ b/src/core/object-factory.h @@ -29,6 +29,8 @@ namespace ns3 { class AttributeValue; /** + * \ingroup object + * * \brief instantiate subclasses of ns3::Object. * * This class can also hold a set of attributes to set diff --git a/src/core/object-vector.h b/src/core/object-vector.h index 5f79ae73d..edf80e9fb 100644 --- a/src/core/object-vector.h +++ b/src/core/object-vector.h @@ -9,6 +9,8 @@ namespace ns3 { /** + * \ingroup object + * * \brief contain a vector of ns3::Object pointers. * * This class it used to get attribute access to an array of diff --git a/src/core/object.h b/src/core/object.h index 00d8036ba..c136e89ae 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -39,6 +39,11 @@ class AttributeList; class TraceSourceAccessor; /** + * \ingroup core + * \defgroup object Object + */ +/** + * \ingroup object * \brief a base class which provides memory management and object aggregation * */ diff --git a/src/core/pointer.h b/src/core/pointer.h index 83ddac3a2..5fcb28718 100644 --- a/src/core/pointer.h +++ b/src/core/pointer.h @@ -26,6 +26,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \brief hold objects of type Ptr */ class PointerValue : public AttributeValue diff --git a/src/core/ptr.h b/src/core/ptr.h index 7aca41da4..2bcbf3c60 100644 --- a/src/core/ptr.h +++ b/src/core/ptr.h @@ -28,6 +28,12 @@ namespace ns3 { /** + * \ingroup core + * \defgroup ptr Smart Pointer + */ +/** + * \ingroup ptr + * * \brief smart pointer class similar to boost::intrusive_ptr * * This smart-pointer class assumes that the underlying diff --git a/src/core/string.h b/src/core/string.h index 65d21590f..8aba4b9ae 100644 --- a/src/core/string.h +++ b/src/core/string.h @@ -7,6 +7,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \class ns3::StringValue * \brief hold variables of type string * diff --git a/src/core/test.h b/src/core/test.h index 1ee298686..358603a3f 100644 --- a/src/core/test.h +++ b/src/core/test.h @@ -33,6 +33,12 @@ namespace ns3 { class TestManager; /** + * \ingroup core + * \defgroup test Test + */ +/** + * \ingroup test + * * \brief base class for new regressions tests * * To add a new regression test, you need to: @@ -65,6 +71,8 @@ protected: }; /** + * \ingroup test + * * \brief gather and run all regression tests */ class TestManager { diff --git a/src/core/trace-source-accessor.h b/src/core/trace-source-accessor.h index 48ea7ac0a..4a76aa598 100644 --- a/src/core/trace-source-accessor.h +++ b/src/core/trace-source-accessor.h @@ -29,6 +29,8 @@ namespace ns3 { class ObjectBase; /** + * \ingroup tracing + * * \brief control access to objects' trace sources * * This class abstracts the kind of trace source to which we want to connect diff --git a/src/core/traced-value.h b/src/core/traced-value.h index 0015e39aa..837c0536a 100644 --- a/src/core/traced-value.h +++ b/src/core/traced-value.h @@ -32,6 +32,13 @@ namespace ns3 { /** + * \ingroup core + * \defgroup tracing Tracing + */ + +/** + * \ingroup tracing + * * \brief trace classes with value semantics * * If you want to trace the change of value of a class or diff --git a/src/core/uinteger.h b/src/core/uinteger.h index f6565b309..c67709272 100644 --- a/src/core/uinteger.h +++ b/src/core/uinteger.h @@ -27,6 +27,8 @@ namespace ns3 { /** + * \ingroup attribute + * * \class ns3::UintegerValue * \brief Hold an unsigned integer type * diff --git a/src/simulator/event-impl.h b/src/simulator/event-impl.h index 526beffd5..10efba66a 100644 --- a/src/simulator/event-impl.h +++ b/src/simulator/event-impl.h @@ -24,6 +24,9 @@ namespace ns3 { +/** + * \ingroup simulator + */ class EventImpl { public: diff --git a/src/simulator/heap-scheduler.h b/src/simulator/heap-scheduler.h index 20e8165e7..3109d0f74 100644 --- a/src/simulator/heap-scheduler.h +++ b/src/simulator/heap-scheduler.h @@ -29,6 +29,9 @@ namespace ns3 { class EventHolder; +/** + * \ingroup scheduler + */ class HeapScheduler : public Scheduler { public: HeapScheduler (); diff --git a/src/simulator/list-scheduler.h b/src/simulator/list-scheduler.h index c4e70398b..0882c3809 100644 --- a/src/simulator/list-scheduler.h +++ b/src/simulator/list-scheduler.h @@ -31,6 +31,9 @@ namespace ns3 { class EventImpl; +/** + * \ingroup scheduler + */ class ListScheduler : public Scheduler { public: ListScheduler (); diff --git a/src/simulator/map-scheduler.h b/src/simulator/map-scheduler.h index cc49ecd34..f01c84a62 100644 --- a/src/simulator/map-scheduler.h +++ b/src/simulator/map-scheduler.h @@ -30,6 +30,9 @@ namespace ns3 { class EventImpl; +/** + * \ingroup scheduler + */ class MapScheduler : public Scheduler { public: MapScheduler (); diff --git a/src/simulator/nstime.h b/src/simulator/nstime.h index 8fef4231c..6b4729b2a 100644 --- a/src/simulator/nstime.h +++ b/src/simulator/nstime.h @@ -60,6 +60,9 @@ precision_t Get (void); /** + * \ingroup simulator + * \defgroup time Time + * * \brief keep track of time unit. * * This template class is used to keep track of the value diff --git a/src/simulator/scheduler.h b/src/simulator/scheduler.h index 276c36c96..14149cddb 100644 --- a/src/simulator/scheduler.h +++ b/src/simulator/scheduler.h @@ -28,6 +28,9 @@ namespace ns3 { /** + * \ingroup simulator + * \defgroup scheduler Scheduler + * * \brief Maintain the event list * * This base class specifies the interface used to maintain the diff --git a/src/simulator/simulator.h b/src/simulator/simulator.h index b1c4a9ecf..15f000cf5 100644 --- a/src/simulator/simulator.h +++ b/src/simulator/simulator.h @@ -35,6 +35,8 @@ class SimulatorPrivate; class SchedulerFactory; /** + * \ingroup simulator + * * \brief Control the scheduling of simulation events. * * The internal simulation clock is maintained diff --git a/src/simulator/timer.h b/src/simulator/timer.h index 1b25638e8..d9da113f0 100644 --- a/src/simulator/timer.h +++ b/src/simulator/timer.h @@ -30,6 +30,8 @@ namespace ns3 { class TimerImpl; /** + * \ingroup simulator + * * \brief a simple Timer class * * A timer is used to hold together a delay, a function to invoke diff --git a/src/simulator/watchdog.h b/src/simulator/watchdog.h index 3bb37a9b4..2edb1cf9e 100644 --- a/src/simulator/watchdog.h +++ b/src/simulator/watchdog.h @@ -27,6 +27,9 @@ namespace ns3 { class TimerImpl; +/** + * \ingroup simulator + */ class Watchdog { public: From 1702eb82050294b758288719f6372c8ac21e7978 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 30 May 2008 10:36:02 -0700 Subject: [PATCH 3/3] more doxygen --- doc/modules | 4 ++-- src/common/chunk.h | 2 ++ src/common/header.h | 2 +- src/node/address.h | 5 +++++ src/node/application.h | 3 +++ src/node/channel.h | 3 +++ src/node/drop-tail-queue.h | 2 ++ src/node/ethernet-header.h | 2 ++ src/node/ethernet-trailer.h | 2 ++ src/node/inet-socket-address.h | 2 ++ src/node/ipv4-address-generator.h | 6 ++++++ src/node/ipv4-address.h | 14 ++++++++++---- src/node/ipv4-route.h | 2 ++ src/node/ipv4.h | 9 ++++++++- src/node/llc-snap-header.h | 5 +++++ src/node/mac48-address.h | 2 ++ src/node/mac64-address.h | 2 ++ src/node/net-device.h | 6 ++++++ src/node/node-list.h | 2 ++ src/node/node.h | 2 ++ src/node/packet-socket-address.h | 5 +++++ src/node/packet-socket-factory.h | 2 ++ src/node/packet-socket.h | 2 ++ src/node/queue.h | 3 +++ src/node/simple-channel.h | 4 ++++ src/node/simple-net-device.h | 5 +++++ src/node/socket-factory.h | 2 ++ src/node/tcp-socket-factory.h | 2 ++ src/node/tcp-socket.h | 2 ++ src/node/udp-socket-factory.h | 2 ++ src/node/udp-socket.h | 2 ++ 31 files changed, 100 insertions(+), 8 deletions(-) diff --git a/doc/modules b/doc/modules index 2f55fff30..afc272c94 100644 --- a/doc/modules +++ b/doc/modules @@ -24,7 +24,7 @@ * in a simulation: ns3::Config. * * @defgroup common Common - * The "core" module contains: + * The "common" module contains: * - a packet class to create and manipulate simulation packets: * ns3::Packet, ns3::Header, and ns3::Trailer. This packet class * also supports per-packet ns3::Tag which are globs of data @@ -62,4 +62,4 @@ * @brief Constants you can change * * @defgroup contrib Contrib - */ \ No newline at end of file + */ diff --git a/src/common/chunk.h b/src/common/chunk.h index 44bbe4545..63d62d283 100644 --- a/src/common/chunk.h +++ b/src/common/chunk.h @@ -8,6 +8,8 @@ namespace ns3 { /** * \ingroup packet + * + * \brief abstract base class for ns3::Header and ns3::Trailer */ class Chunk : public ObjectBase { diff --git a/src/common/header.h b/src/common/header.h index cb44d3dae..8ad22c7e5 100644 --- a/src/common/header.h +++ b/src/common/header.h @@ -28,7 +28,7 @@ namespace ns3 { /** - * \ingroup Packet + * \ingroup packet * * \brief Protocol header serialization and deserialization. * diff --git a/src/node/address.h b/src/node/address.h index d88d5643d..9f69b5750 100644 --- a/src/node/address.h +++ b/src/node/address.h @@ -10,6 +10,11 @@ namespace ns3 { /** + * \ingroup node + * \defgroup address Address + */ +/** + * \ingroup address * \brief a polymophic address class * * This class is very similar in design and spirit to the BSD sockaddr diff --git a/src/node/application.h b/src/node/application.h index d21ee6a50..2834847da 100644 --- a/src/node/application.h +++ b/src/node/application.h @@ -33,6 +33,9 @@ class Node; class RandomVariable; /** + * \ingroup node + * \defgroup application + * * \brief The base class for all ns3 applicationes * * Class Application is the base class for all ns3 applications. diff --git a/src/node/channel.h b/src/node/channel.h index 28648841b..f0471360c 100644 --- a/src/node/channel.h +++ b/src/node/channel.h @@ -27,6 +27,9 @@ namespace ns3 { class NetDevice; /** + * \ingroup node + * \defgroup channel Channel + * * \brief Abstract Channel Base Class. * * A channel is a logical path over which information flows. The path can diff --git a/src/node/drop-tail-queue.h b/src/node/drop-tail-queue.h index 4905a25af..0fe245105 100644 --- a/src/node/drop-tail-queue.h +++ b/src/node/drop-tail-queue.h @@ -28,6 +28,8 @@ namespace ns3 { class TraceContainer; /** + * \ingroup queue + * * \brief A FIFO packet queue that drops tail-end packets on overflow */ class DropTailQueue : public Queue { diff --git a/src/node/ethernet-header.h b/src/node/ethernet-header.h index a006205f0..84c2ce27d 100644 --- a/src/node/ethernet-header.h +++ b/src/node/ethernet-header.h @@ -38,6 +38,8 @@ namespace ns3 { QINQ /**< Double tagged packet. Header includes two VLAN tags */ }; /** + * \ingroup node + * * \brief Packet header for Ethernet * * This class can be used to add a header to an ethernet packet that diff --git a/src/node/ethernet-trailer.h b/src/node/ethernet-trailer.h index 6e9eb77bc..0508bc651 100644 --- a/src/node/ethernet-trailer.h +++ b/src/node/ethernet-trailer.h @@ -29,6 +29,8 @@ namespace ns3 { class Packet; /** + * \ingroup node + * * \brief Packet trailer for Ethernet * * This class can be used to add and verify the FCS at the end of an diff --git a/src/node/inet-socket-address.h b/src/node/inet-socket-address.h index 35a5cc83c..b775c1387 100644 --- a/src/node/inet-socket-address.h +++ b/src/node/inet-socket-address.h @@ -29,6 +29,8 @@ namespace ns3 { /** + * \ingroup address + * * \brief an Inet address class * * This class is similar to inet_sockaddr in the BSD socket diff --git a/src/node/ipv4-address-generator.h b/src/node/ipv4-address-generator.h index f88a89696..da23abae5 100644 --- a/src/node/ipv4-address-generator.h +++ b/src/node/ipv4-address-generator.h @@ -23,6 +23,12 @@ namespace ns3 { +/** + * \ingroup address + * + * \brief This generator assigns addresses sequentially from a provided + * network address; used in topology code. + */ class Ipv4AddressGenerator { public: static void Init (const Ipv4Address net, const Ipv4Mask mask, diff --git a/src/node/ipv4-address.h b/src/node/ipv4-address.h index 18898aeb1..8d5d24530 100644 --- a/src/node/ipv4-address.h +++ b/src/node/ipv4-address.h @@ -30,9 +30,11 @@ namespace ns3 { class Ipv4Mask; -/** Ipv4 addresses are stored in host order in - * this class. - */ +/** + * \ingroup address + * + * \brief Ipv4 addresses are stored in host order in this class. + */ class Ipv4Address { public: Ipv4Address (); @@ -144,7 +146,11 @@ private: friend bool operator < (Ipv4Address const &addrA, Ipv4Address const &addrB); }; - +/** + * \ingroup address + * + * \brief a class to represent an Ipv4 address mask + */ class Ipv4Mask { public: Ipv4Mask (); diff --git a/src/node/ipv4-route.h b/src/node/ipv4-route.h index f0badc2a0..6f2ce0349 100644 --- a/src/node/ipv4-route.h +++ b/src/node/ipv4-route.h @@ -28,6 +28,7 @@ namespace ns3 { /** + * \ingroup ipv4 * \brief A record of an IPv4 route */ class Ipv4Route { @@ -106,6 +107,7 @@ private: std::ostream& operator<< (std::ostream& os, Ipv4Route const& route); /** + * \ingroup ipv4 * \brief A record of an IPv4 multicast route */ class Ipv4MulticastRoute { diff --git a/src/node/ipv4.h b/src/node/ipv4.h index 461c297d9..e743290db 100644 --- a/src/node/ipv4.h +++ b/src/node/ipv4.h @@ -32,10 +32,17 @@ class Node; class NetDevice; class Packet; class Ipv4Route; -class Ipv4Header; // FIXME: ipv4-header.h needs to move from module +class Ipv4Header; // XXX: ipv4-header.h needs to move from module // "internet-node" to module "node" /** + * \ingroup node + * \defgroup ipv4 Ipv4 + */ + +/** + * \ingroup ipv4 + * * \brief Base class for IPv4 routing protocols. * * This class represents the interface between the IPv4 routing core diff --git a/src/node/llc-snap-header.h b/src/node/llc-snap-header.h index f5cec7ebe..a4828fe3e 100644 --- a/src/node/llc-snap-header.h +++ b/src/node/llc-snap-header.h @@ -27,6 +27,11 @@ namespace ns3 { +/** + * \ingroup node + * + * \brief Header for the LLC/SNAP encapsulation + */ class LlcSnapHeader : public Header { public: diff --git a/src/node/mac48-address.h b/src/node/mac48-address.h index 75c356a8e..4572ab484 100644 --- a/src/node/mac48-address.h +++ b/src/node/mac48-address.h @@ -30,6 +30,8 @@ namespace ns3 { class Address; /** + * \ingroup address + * * \brief an EUI-48 address * * This class can contain 48 bit IEEE addresses. diff --git a/src/node/mac64-address.h b/src/node/mac64-address.h index 67d3cfc2f..8d28e5efe 100644 --- a/src/node/mac64-address.h +++ b/src/node/mac64-address.h @@ -28,6 +28,8 @@ namespace ns3 { class Address; /** + * \ingroup address + * * \brief an EUI-64 address * * This class can contain 64 bit IEEE addresses. diff --git a/src/node/net-device.h b/src/node/net-device.h index 4f3e93d6c..34fefd654 100644 --- a/src/node/net-device.h +++ b/src/node/net-device.h @@ -36,6 +36,12 @@ class Channel; class Packet; /** + * \ingroup node + * \defgroup netdevice NetDevice + */ +/** + * \ingroup NetDevice + * * \brief Network layer to device interface * * This interface defines the API which the IP and ARP diff --git a/src/node/node-list.h b/src/node/node-list.h index 85395b414..137363dff 100644 --- a/src/node/node-list.h +++ b/src/node/node-list.h @@ -31,6 +31,8 @@ class CallbackBase; /** + * \ingroup node + * * \brief the list of simulation nodes. * * Every Node created is automatically added to this list. diff --git a/src/node/node.h b/src/node/node.h index 272d0f52c..ed0311871 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -36,6 +36,8 @@ class Address; /** + * \ingroup node + * * \brief A network Node. * * This class holds together: diff --git a/src/node/packet-socket-address.h b/src/node/packet-socket-address.h index 87f254e8c..9f99a9a63 100644 --- a/src/node/packet-socket-address.h +++ b/src/node/packet-socket-address.h @@ -30,6 +30,11 @@ namespace ns3 { class NetDevice; +/** + * \ingroup address + * + * \brief an address for a packet socket + */ class PacketSocketAddress { public: diff --git a/src/node/packet-socket-factory.h b/src/node/packet-socket-factory.h index e33a4bdb4..913d3ff8c 100644 --- a/src/node/packet-socket-factory.h +++ b/src/node/packet-socket-factory.h @@ -27,6 +27,8 @@ namespace ns3 { class Socket; /** + * \ingroup socket + * * This can be used as an interface in a node in order for the node to * generate PacketSockets that can connect to net devices. */ diff --git a/src/node/packet-socket.h b/src/node/packet-socket.h index 680168f1e..31f8cd3fc 100644 --- a/src/node/packet-socket.h +++ b/src/node/packet-socket.h @@ -36,6 +36,8 @@ class NetDevice; class PacketSocketAddress; /** + * \ingroup socket + * * \brief A PacketSocket is a link between an application and a net device. * * A PacketSocket can be used to connect an application to a net diff --git a/src/node/queue.h b/src/node/queue.h index 5603245c4..dba69f5ad 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -33,6 +33,9 @@ namespace ns3 { /** + * \ingroup node + * \defgroup queue Queue + * * \brief Abstract base class for packet Queues * * This class defines the base APIs for packet queues in the ns-3 system diff --git a/src/node/simple-channel.h b/src/node/simple-channel.h index 526948e2e..4680e54ca 100644 --- a/src/node/simple-channel.h +++ b/src/node/simple-channel.h @@ -10,6 +10,10 @@ namespace ns3 { class SimpleNetDevice; class Packet; +/** + * \ingroup channel + * \brief A simple channel, for simple things and testing + */ class SimpleChannel : public Channel { public: diff --git a/src/node/simple-net-device.h b/src/node/simple-net-device.h index 84a255002..19ce5ef3a 100644 --- a/src/node/simple-net-device.h +++ b/src/node/simple-net-device.h @@ -30,6 +30,11 @@ namespace ns3 { class SimpleChannel; class Node; +/** + * \ingroup netdevice + * + * \brief simple net device for simple things and testing + */ class SimpleNetDevice : public NetDevice { public: diff --git a/src/node/socket-factory.h b/src/node/socket-factory.h index 6062760ce..9f17bca6e 100644 --- a/src/node/socket-factory.h +++ b/src/node/socket-factory.h @@ -28,6 +28,8 @@ namespace ns3 { class Socket; /** + * \ingroup socket + * * \brief Object to create transport layer instances that provide a * socket API to applications. * diff --git a/src/node/tcp-socket-factory.h b/src/node/tcp-socket-factory.h index 35909cb54..92cede256 100644 --- a/src/node/tcp-socket-factory.h +++ b/src/node/tcp-socket-factory.h @@ -27,6 +27,8 @@ namespace ns3 { class Socket; /** + * \ingroup socket + * * \brief API to create TCP socket instances * * This abstract class defines the API for TCP sockets. diff --git a/src/node/tcp-socket.h b/src/node/tcp-socket.h index 9092474f4..14ef39c5d 100644 --- a/src/node/tcp-socket.h +++ b/src/node/tcp-socket.h @@ -36,6 +36,8 @@ class Node; class Packet; /** + * \ingroup socket + * * \brief (abstract) base class of all TcpSockets * * This class exists solely for hosting TcpSocket attributes that can diff --git a/src/node/udp-socket-factory.h b/src/node/udp-socket-factory.h index 32789c35a..4e2b74354 100644 --- a/src/node/udp-socket-factory.h +++ b/src/node/udp-socket-factory.h @@ -27,6 +27,8 @@ namespace ns3 { class Socket; /** + * \ingroup socket + * * \brief API to create UDP socket instances * * This abstract class defines the API for UDP socket factory. diff --git a/src/node/udp-socket.h b/src/node/udp-socket.h index 1c81916c2..61d3d2685 100644 --- a/src/node/udp-socket.h +++ b/src/node/udp-socket.h @@ -35,6 +35,8 @@ class Node; class Packet; /** + * \ingroup socket + * * \brief (abstract) base class of all UdpSockets * * This class exists solely for hosting UdpSocket attributes that can