src/devices/csma/csma-ipv4-topology.cc
changeset 2500 1fb9430f642d
parent 2470 254581fb9e9c
child 2502 50d0da37f02f
--- a/src/devices/csma/csma-ipv4-topology.cc	Wed Feb 27 19:51:34 2008 +0100
+++ b/src/devices/csma/csma-ipv4-topology.cc	Wed Feb 27 20:23:57 2008 +0100
@@ -42,8 +42,9 @@
   Ptr<Queue> q = Queue::CreateDefault ();
 
   // assume full-duplex
-  Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> (node, addr, 
-                                                       ns3::CsmaNetDevice::IP_ARP);
+  Ptr<CsmaNetDevice> nd = CreateObjectWith<CsmaNetDevice> ("Node", node, 
+                                                           "Address", addr, 
+                                                           "EncapsulationMode", "IpArp");
   node->AddDevice (nd);
 
   nd->AddQueue(q);
@@ -59,16 +60,18 @@
 {
   Ptr<Queue> q = Queue::CreateDefault ();
 
-  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
-                                                        ns3::CsmaNetDevice::LLC);
+  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
+                                                            "Address", addr,
+                                                            "EncapsulationMode", "Llc");
   n1->AddDevice (nd0);
   nd0->SetSendEnable (true);
   nd0->SetReceiveEnable (false);
   nd0->AddQueue(q);
   nd0->Attach (ch);
 
-  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
-                                                        ns3::CsmaNetDevice::LLC);
+  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
+                                                            "Address", addr,
+                                                            "EncapsulationMode", "Llc");
   n1->AddDevice (nd1);
   nd1->SetSendEnable (false);
   nd1->SetReceiveEnable (true);
@@ -83,16 +86,18 @@
 {
   Ptr<Queue> q = Queue::CreateDefault ();
 
-  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
-                                                        ns3::CsmaNetDevice::RAW);
+  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
+                                                            "Address", addr,
+                                                            "EncapsulationMode", "Raw");
   n1->AddDevice (nd0);
   nd0->SetSendEnable (true);
   nd0->SetReceiveEnable (false);
   nd0->AddQueue(q);
   nd0->Attach (ch);
 
-  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
-                                                        ns3::CsmaNetDevice::RAW);
+  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
+                                                            "Address", addr,
+                                                            "EncapsulationMode", "Raw");
   n1->AddDevice (nd1);
   nd1->SetSendEnable (false);
   nd1->SetReceiveEnable (true);