--- a/src/devices/csma-cd/csma-cd-ipv4-topology.cc Fri Jul 27 13:07:36 2007 -0700
+++ b/src/devices/csma-cd/csma-cd-ipv4-topology.cc Fri Jul 27 14:40:50 2007 -0700
@@ -35,26 +35,20 @@
namespace ns3 {
-void
+uint32_t
CsmaCdIpv4Topology::AddIpv4CsmaCdNode(Ptr<Node> n1,
Ptr<CsmaCdChannel> ch,
MacAddress addr)
{
Ptr<Queue> q = Queue::CreateDefault ();
- // Use the first net device in the node to transmit
+ // assume full-duplex
Ptr<CsmaCdNetDevice> nd0 = Create<CsmaCdNetDevice> (n1, addr,
ns3::CsmaCdNetDevice::IP_ARP,
- true, false);
+ true, true);
nd0->AddQueue(q);
nd0->Attach (ch);
-
- // Use the second net device in the node to transmit
- Ptr<CsmaCdNetDevice> nd1 = Create<CsmaCdNetDevice> (n1, addr,
- ns3::CsmaCdNetDevice::IP_ARP,
- false, true);
- nd1->AddQueue(q);
- nd1->Attach (ch);
+ return nd0->GetIfIndex ();
}
--- a/src/devices/csma-cd/csma-cd-ipv4-topology.h Fri Jul 27 13:07:36 2007 -0700
+++ b/src/devices/csma-cd/csma-cd-ipv4-topology.h Fri Jul 27 14:40:50 2007 -0700
@@ -58,8 +58,10 @@
* connect to a CsmaCdChannel. This means that Ethernet headers
* and trailers will be added to the packet before sending out on
* the net device.
+ *
+ * \return ifIndex of the device
*/
- static void AddIpv4CsmaCdNode( Ptr<Node> n1,
+ static uint32_t AddIpv4CsmaCdNode( Ptr<Node> n1,
Ptr<CsmaCdChannel> ch,
MacAddress addr);