add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
--- a/examples/csma-broadcast.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/csma-broadcast.cc Thu Mar 13 11:10:38 2008 -0700
@@ -149,12 +149,10 @@
// 512 bytes (default) at a rate of 500 Kb/s (default) from n0
NS_LOG_INFO ("Create Applications.");
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("255.255.255.255", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("255.255.255.255", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.0));
@@ -162,20 +160,16 @@
// Create an optional packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n1,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
sink->Stop (Seconds (10.0));
// Create an optional packet sink to receive these packets
- sink = CreateObject<PacketSink> (
- "Node", n2,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n2->AddApplication (sink);
// Start the sink
--- a/examples/csma-multicast.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/csma-multicast.cc Thu Mar 13 11:10:38 2008 -0700
@@ -278,14 +278,12 @@
// Configure a multicast packet generator that generates a packet
// every few seconds
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress (multicastGroup, port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0),
- "DataRate", DataRate ("255b/s"),
- "PacketSize", Uinteger (128));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress (multicastGroup, port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0),
+ "DataRate", DataRate ("255b/s"),
+ "PacketSize", Uinteger (128));
n0->AddApplication (ooff);
//
// Tell the application when to start and stop.
@@ -297,10 +295,8 @@
// If you enable logging on this (above) it will print a log statement
// for every packet received
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n4,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n4->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
--- a/examples/csma-one-subnet.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/csma-one-subnet.cc Thu Mar 13 11:10:38 2008 -0700
@@ -160,12 +160,10 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.1.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.1.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
//
@@ -176,12 +174,10 @@
//
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
- ooff = CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (InetSocketAddress ("10.1.1.1", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.1.1", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n3->AddApplication (ooff);
ooff->Start(Seconds(1.1));
--- a/examples/csma-packet-socket.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/csma-packet-socket.cc Thu Mar 13 11:10:38 2008 -0700
@@ -62,8 +62,7 @@
static Ptr<CsmaNetDevice>
CreateCsmaDevice (Ptr<Node> node, Ptr<CsmaChannel> channel)
{
- Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> ("Node", node,
- "Address", Mac48Address::Allocate (),
+ Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> ("Address", Mac48Address::Allocate (),
"EncapsulationMode", String ("Llc"));
node->AddDevice (device);
device->Attach (channel);
@@ -141,24 +140,20 @@
// from n0 to n1
NS_LOG_INFO ("Create Applications.");
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (n0ToN1),
- "Protocol", TypeId::LookupByName ("Packet"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (n0ToN1),
+ "Protocol", TypeId::LookupByName ("Packet"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.0));
ooff->Stop (Seconds(10.0));
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
- ooff = CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (n3ToN0),
- "Protocol", TypeId::LookupByName ("Packet"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (n3ToN0),
+ "Protocol", TypeId::LookupByName ("Packet"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n3->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.1));
--- a/examples/mixed-global-routing.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/mixed-global-routing.cc Thu Mar 13 11:10:38 2008 -0700
@@ -186,14 +186,12 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.3.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable (1),
- "OffTime", ConstantVariable (0),
- "DataRate", DataRate("300bps"),
- "PacketSize", Uinteger (50));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable (1),
+ "OffTime", ConstantVariable (0),
+ "DataRate", DataRate("300bps"),
+ "PacketSize", Uinteger (50));
n0->AddApplication (ooff);
// Start the application
ooff->Start (Seconds (1.0));
--- a/examples/simple-alternate-routing.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/simple-alternate-routing.cc Thu Mar 13 11:10:38 2008 -0700
@@ -183,12 +183,10 @@
// Create a flow from n3 to n1, starting at time 1.1 seconds
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (InetSocketAddress ("10.1.1.1", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable (1),
- "OffTime", ConstantVariable (0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.1.1", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable (1),
+ "OffTime", ConstantVariable (0));
n3->AddApplication (ooff);
// Start the application
ooff->Start (Seconds (1.1));
@@ -196,10 +194,8 @@
// Create a packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n1,
- "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.1));
--- a/examples/simple-error-model.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/simple-error-model.cc Thu Mar 13 11:10:38 2008 -0700
@@ -143,31 +143,25 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.3.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.0));
ooff->Stop (Seconds(10.0));
// Create an optional packet sink to receive these packets
- Ptr<PacketSink> sink = CreateObject<PacketSink> (
- "Node", n3,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ Ptr<PacketSink> sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n3->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
sink->Stop (Seconds (10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
- ooff = CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (InetSocketAddress ("10.1.2.1", port)),
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.2.1", port)),
"Protocol", TypeId::LookupByName ("Udp"),
"OnTime", ConstantVariable(1),
"OffTime", ConstantVariable(0));
@@ -177,9 +171,7 @@
ooff->Stop (Seconds(10.0));
// Create a packet sink to receive these packets
- sink = CreateObject<PacketSink> (
- "Node", n1,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
"Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
--- a/examples/simple-global-routing.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/simple-global-routing.cc Thu Mar 13 11:10:38 2008 -0700
@@ -160,11 +160,10 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> ("Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.3.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable (1),
- "OffTime", ConstantVariable (0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable (1),
+ "OffTime", ConstantVariable (0));
n0->AddApplication (ooff);
// Start the application
ooff->Start (Seconds (1.0));
@@ -173,30 +172,26 @@
// Create a packet sink to receive these packets
// The last argument "true" disables output from the Receive callback
Ptr<PacketSink> sink =
- CreateObject<PacketSink> ("Node", n3,
- "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n3->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
sink->Stop (Seconds (10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
- ooff = CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (InetSocketAddress ("10.1.2.1", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable (1),
- "OffTime", ConstantVariable (0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.2.1", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable (1),
+ "OffTime", ConstantVariable (0));
n3->AddApplication (ooff);
// Start the application
ooff->Start (Seconds (1.1));
ooff->Stop (Seconds (10.0));
// Create a packet sink to receive these packets
- sink = CreateObject<PacketSink> ("Node", n1,
- "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ sink = CreateObject<PacketSink> ("Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.1));
--- a/examples/simple-point-to-point-olsr.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/simple-point-to-point-olsr.cc Thu Mar 13 11:10:38 2008 -0700
@@ -167,42 +167,34 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.4.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.4.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.0));
// Create an optional packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n4,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n3->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
- ooff = CreateObject<OnOffApplication> (
- "Node", n4,
- "Remote", Address (InetSocketAddress ("10.1.2.1", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.2.1", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n3->AddApplication (ooff);
// Start the application
ooff->Start (Seconds(1.1));
// Create a packet sink to receive these packets
- sink = CreateObject<PacketSink> (
- "Node", n1,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.1));
--- a/examples/simple-point-to-point.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/simple-point-to-point.cc Thu Mar 13 11:10:38 2008 -0700
@@ -136,42 +136,34 @@
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
Ptr<OnOffApplication> ooff =
- CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.3.2", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start (Seconds(1.0));
// Create an optional packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n3,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n3->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
- ooff = CreateObject<OnOffApplication> (
- "Node", n3,
- "Remote", Address (InetSocketAddress ("10.1.2.1", port)),
- "Protocol", TypeId::LookupByName ("Udp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.2.1", port)),
+ "Protocol", TypeId::LookupByName ("Udp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n3->AddApplication (ooff);
// Start the application
ooff->Start(Seconds(1.1));
// Create a packet sink to receive these packets
- sink = CreateObject<PacketSink> (
- "Node", n1,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
- "Protocol", TypeId::LookupByName ("Udp"));
+ sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
+ "Protocol", TypeId::LookupByName ("Udp"));
n1->AddApplication (sink);
// Start the sink
sink->Start (Seconds (1.1));
@@ -180,22 +172,18 @@
// Create a file transfer from n0 to n3, starting at time 1.2
uint16_t servPort = 500;
- ooff = CreateObject<OnOffApplication> (
- "Node", n0,
- "Remote", Address (InetSocketAddress ("10.1.3.2", servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"),
- "OnTime", ConstantVariable(1),
- "OffTime", ConstantVariable(0));
+ ooff = CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"),
+ "OnTime", ConstantVariable(1),
+ "OffTime", ConstantVariable(0));
n0->AddApplication (ooff);
// Start the application
ooff->Start (Seconds(1.2));
ooff->Stop (Seconds(1.35));
// Create a packet sink to receive these TCP packets
- sink = CreateObject<PacketSink> (
- "Node", n3,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"));
+ sink = CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"));
n3->AddApplication (sink);
sink->Start (Seconds (1.2));
--- a/examples/tcp-large-transfer-errors.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/tcp-large-transfer-errors.cc Thu Mar 13 11:10:38 2008 -0700
@@ -198,10 +198,8 @@
// Create a packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n2,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"));
n2->AddApplication (sink);
sink->Start (Seconds (0.0));
sink->Stop (Seconds (10000.0));
--- a/examples/tcp-large-transfer.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/tcp-large-transfer.cc Thu Mar 13 11:10:38 2008 -0700
@@ -198,10 +198,8 @@
// Create a packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n2,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"));
n2->AddApplication (sink);
sink->Start (Seconds (0.0));
sink->Stop (Seconds (100.0));
--- a/examples/tcp-small-transfer-oneloss.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/tcp-small-transfer-oneloss.cc Thu Mar 13 11:10:38 2008 -0700
@@ -180,10 +180,8 @@
// Create a packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n2,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"));
n2->AddApplication (sink);
sink->Start (Seconds (0.0));
sink->Stop (Seconds (100.0));
--- a/examples/tcp-small-transfer.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/tcp-small-transfer.cc Thu Mar 13 11:10:38 2008 -0700
@@ -190,10 +190,8 @@
// Create a packet sink to receive these packets
Ptr<PacketSink> sink =
- CreateObject<PacketSink> (
- "Node", n2,
- "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
- "Protocol", TypeId::LookupByName ("Tcp"));
+ CreateObject<PacketSink> ("Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
+ "Protocol", TypeId::LookupByName ("Tcp"));
n2->AddApplication (sink);
sink->Start (Seconds (0.0));
sink->Stop (Seconds (100.0));
--- a/examples/udp-echo.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/examples/udp-echo.cc Thu Mar 13 11:10:38 2008 -0700
@@ -161,8 +161,7 @@
//
uint16_t port = 9; // well-known echo port number
- Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
//
// Create a UdpEchoClient application to send UDP datagrams from node zero to
@@ -173,12 +172,11 @@
Time interPacketInterval = Seconds (1.);
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (maxPacketCount),
- "Interval", interPacketInterval,
- "PacketSize", Uinteger (packetSize));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (maxPacketCount),
+ "Interval", interPacketInterval,
+ "PacketSize", Uinteger (packetSize));
n0->AddApplication (client);
//
// Tell the applications when to start and stop.
--- a/samples/main-adhoc-wifi.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/samples/main-adhoc-wifi.cc Thu Mar 13 11:10:38 2008 -0700
@@ -149,13 +149,12 @@
destination.SetSingleDevice (0);
destination.SetPhysicalAddress (devices.Get (1)->GetAddress ());
Ptr<Application> app =
- CreateObject<OnOffApplication> ("Node", c.Get (0),
- "Remote", Address (destination),
- "Protocol", TypeId::LookupByName ("Packet"),
- "OnTime", ConstantVariable (250),
- "OffTime", ConstantVariable (0),
- "DataRate", DataRate (60000000),
- "PacketSize", Uinteger (2000));
+ CreateObject<OnOffApplication> ("Remote", Address (destination),
+ "Protocol", TypeId::LookupByName ("Packet"),
+ "OnTime", ConstantVariable (250),
+ "OffTime", ConstantVariable (0),
+ "DataRate", DataRate (60000000),
+ "PacketSize", Uinteger (2000));
c.Get (0)->AddApplication (app);
app->Start (Seconds (0.5));
--- a/samples/main-ap-wifi.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/samples/main-ap-wifi.cc Thu Mar 13 11:10:38 2008 -0700
@@ -144,11 +144,10 @@
destination.SetSingleDevice (0);
destination.SetPhysicalAddress (staDevs.Get(1)->GetAddress ());
Ptr<Application> app =
- CreateObject<OnOffApplication> ("Node", stas.Get (0),
- "Remote", Address (destination),
- "Protocol", TypeId::LookupByName ("Packet"),
- "OnTime", ConstantVariable (42),
- "OffTime", ConstantVariable (0));
+ CreateObject<OnOffApplication> ("Remote", Address (destination),
+ "Protocol", TypeId::LookupByName ("Packet"),
+ "OnTime", ConstantVariable (42),
+ "OffTime", ConstantVariable (0));
stas.Get (0)->AddApplication (app);
app->Start (Seconds (0.5));
app->Stop (Seconds (43.0));
--- a/src/devices/csma/csma-ipv4-topology.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/csma/csma-ipv4-topology.cc Thu Mar 13 11:10:38 2008 -0700
@@ -44,9 +44,8 @@
Ptr<Queue> q = CreateObject<DropTailQueue> ();
// assume full-duplex
- Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> ("Node", node,
- "Address", addr,
- "EncapsulationMode", String ("IpArp"));
+ Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", String ("IpArp"));
node->AddDevice (nd);
nd->AddQueue(q);
@@ -62,18 +61,16 @@
{
Ptr<Queue> q = CreateObject<DropTailQueue> ();
- Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Node", n1,
- "Address", addr,
- "EncapsulationMode", String ("Llc"));
+ Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", String ("Llc"));
n1->AddDevice (nd0);
nd0->SetSendEnable (true);
nd0->SetReceiveEnable (false);
nd0->AddQueue(q);
nd0->Attach (ch);
- Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", n1,
- "Address", addr,
- "EncapsulationMode", String ("Llc"));
+ Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", String ("Llc"));
n1->AddDevice (nd1);
nd1->SetSendEnable (false);
nd1->SetReceiveEnable (true);
@@ -88,18 +85,16 @@
{
Ptr<Queue> q = CreateObject<DropTailQueue> ();
- Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Node", n1,
- "Address", addr,
- "EncapsulationMode", String ("Raw"));
+ Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", String ("Raw"));
n1->AddDevice (nd0);
nd0->SetSendEnable (true);
nd0->SetReceiveEnable (false);
nd0->AddQueue(q);
nd0->Attach (ch);
- Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", n1,
- "Address", addr,
- "EncapsulationMode", String ("Raw"));
+ Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", String ("Raw"));
n1->AddDevice (nd1);
nd1->SetSendEnable (false);
nd1->SetReceiveEnable (true);
--- a/src/devices/csma/csma-net-device.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/csma/csma-net-device.cc Thu Mar 13 11:10:38 2008 -0700
@@ -45,11 +45,6 @@
static TypeId tid = TypeId ("CsmaNetDevice")
.SetParent<NetDevice> ()
.AddConstructor<CsmaNetDevice> ()
- .AddAttribute ("Node", "The node with which this device is associated",
- TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
- Ptr<Node> (0),
- MakePtrAccessor (&CsmaNetDevice::m_node),
- MakePtrChecker<Node> ())
.AddAttribute ("Address", "The address of this device.",
Mac48Address ("ff:ff:ff:ff:ff:ff"),
MakeMac48AddressAccessor (&CsmaNetDevice::m_address),
@@ -702,6 +697,11 @@
{
return m_node;
}
+void
+CsmaNetDevice::SetNode (Ptr<Node> node)
+{
+ m_node = node;
+}
bool
CsmaNetDevice::NeedsArp (void) const
{
--- a/src/devices/csma/csma-net-device.h Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/csma/csma-net-device.h Thu Mar 13 11:10:38 2008 -0700
@@ -222,6 +222,7 @@
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual Ptr<Node> GetNode (void) const;
+ virtual void SetNode (Ptr<Node> node);
virtual bool NeedsArp (void) const;
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
--- a/src/devices/csma/csma-topology.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/csma/csma-topology.cc Thu Mar 13 11:10:38 2008 -0700
@@ -48,9 +48,8 @@
Ptr<CsmaChannel> ch,
Mac48Address addr)
{
- Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", Ptr<Node> (n1),
- "Address", addr,
- "EncapsulationMode", "EthernetV1");
+ Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Address", addr,
+ "EncapsulationMode", "EthernetV1");
Ptr<Queue> q = Queue::CreateDefault ();
nd1->AddQueue(q);
--- a/src/devices/point-to-point/point-to-point-net-device.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/point-to-point/point-to-point-net-device.cc Thu Mar 13 11:10:38 2008 -0700
@@ -42,11 +42,6 @@
static TypeId tid = TypeId ("PointToPointNetDevice")
.SetParent<NetDevice> ()
.AddConstructor<PointToPointNetDevice> ()
- .AddAttribute ("Node", "The node with which this device is associated",
- TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
- Ptr<Node> (0),
- MakePtrAccessor (&PointToPointNetDevice::m_node),
- MakePtrChecker<Node> ())
.AddAttribute ("Address", "The address of this device.",
Mac48Address ("ff:ff:ff:ff:ff:ff"),
MakeMac48AddressAccessor (&PointToPointNetDevice::m_address),
@@ -379,6 +374,11 @@
{
return m_node;
}
+void
+PointToPointNetDevice::SetNode (Ptr<Node> node)
+{
+ m_node = node;
+}
bool
PointToPointNetDevice::NeedsArp (void) const
{
--- a/src/devices/point-to-point/point-to-point-net-device.h Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/point-to-point/point-to-point-net-device.h Thu Mar 13 11:10:38 2008 -0700
@@ -164,6 +164,7 @@
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual Ptr<Node> GetNode (void) const;
+ virtual void SetNode (Ptr<Node> node);
virtual bool NeedsArp (void) const;
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
--- a/src/devices/point-to-point/point-to-point-topology.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/point-to-point/point-to-point-topology.cc Thu Mar 13 11:10:38 2008 -0700
@@ -48,16 +48,14 @@
{
Ptr<PointToPointChannel> channel = CreateObject<PointToPointChannel> ("BitRate", bps, "Delay", delay);
- Ptr<PointToPointNetDevice> net1 = CreateObject<PointToPointNetDevice> ("Node", n1,
- "Address", Mac48Address::Allocate ());
+ Ptr<PointToPointNetDevice> net1 = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
n1->AddDevice (net1);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net1->AddQueue(q);
net1->Attach (channel);
- Ptr<PointToPointNetDevice> net2 = CreateObject<PointToPointNetDevice> ("Node", n2,
- "Address", Mac48Address::Allocate ());
+ Ptr<PointToPointNetDevice> net2 = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
n2->AddDevice (net2);
q = CreateObject<DropTailQueue> ();
--- a/src/devices/wifi/wifi-net-device.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/wifi/wifi-net-device.cc Thu Mar 13 11:10:38 2008 -0700
@@ -228,6 +228,11 @@
{
return m_node;
}
+void
+WifiNetDevice::SetNode (Ptr<Node> node)
+{
+ m_node = node;
+}
bool
WifiNetDevice::NeedsArp (void) const
{
--- a/src/devices/wifi/wifi-net-device.h Wed Mar 12 11:35:00 2008 -0700
+++ b/src/devices/wifi/wifi-net-device.h Thu Mar 13 11:10:38 2008 -0700
@@ -74,6 +74,7 @@
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual Ptr<Node> GetNode (void) const;
+ virtual void SetNode (Ptr<Node> node);
virtual bool NeedsArp (void) const;
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
--- a/src/internet-node/tcp-l4-protocol.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/internet-node/tcp-l4-protocol.cc Thu Mar 13 11:10:38 2008 -0700
@@ -324,11 +324,6 @@
{
static TypeId tid = TypeId ("TcpL4Protocol")
.SetParent<Ipv4L4Protocol> ()
- .AddAttribute ("Node", "The node to which this protocol is associated",
- TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
- Ptr<Node> (0),
- MakePtrAccessor (&TcpL4Protocol::m_node),
- MakePtrChecker<Node> ())
.AddAttribute ("RttEstimatorFactory",
"How RttEstimator objects are created.",
GetDefaultRttEstimatorFactory (),
--- a/src/internet-node/udp-l4-protocol.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/internet-node/udp-l4-protocol.cc Thu Mar 13 11:10:38 2008 -0700
@@ -46,11 +46,6 @@
static TypeId tid = TypeId ("UdpL4Protocol")
.SetParent<Ipv4L4Protocol> ()
.AddConstructor<UdpL4Protocol> ()
- .AddAttribute ("Node", "The node which contains this protocol.",
- TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
- Ptr<Node> (0),
- MakePtrAccessor (&UdpL4Protocol::m_node),
- MakePtrChecker<Node> ())
;
return tid;
}
--- a/src/internet-node/udp-socket.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/internet-node/udp-socket.cc Thu Mar 13 11:10:38 2008 -0700
@@ -412,7 +412,7 @@
Ptr<Node> rxNode = CreateObject<InternetNode> ();
Ptr<PointToPointNetDevice> rxDev1, rxDev2;
{ // first interface
- rxDev1 = CreateObject<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
+ rxDev1 = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
rxNode->AddDevice (rxDev1);
rxDev1->AddQueue(CreateObject<DropTailQueue> ());
Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
@@ -423,7 +423,7 @@
}
{ // second interface
- rxDev2 = CreateObject<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
+ rxDev2 = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
rxNode->AddDevice (rxDev2);
rxDev2->AddQueue(CreateObject<DropTailQueue> ());
Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
@@ -437,7 +437,7 @@
Ptr<Node> txNode = CreateObject<InternetNode> ();
Ptr<PointToPointNetDevice> txDev;
{
- txDev = CreateObject<PointToPointNetDevice> ("Node", txNode, "Address", Mac48Address::Allocate ());
+ txDev = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
txNode->AddDevice (txDev);
txDev->AddQueue(CreateObject<DropTailQueue> ());
Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
--- a/src/node/application.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/node/application.cc Thu Mar 13 11:10:38 2008 -0700
@@ -40,10 +40,6 @@
{
static TypeId tid = TypeId ("Application")
.SetParent<Object> ()
- .AddAttribute ("Node", "The on which this application resides",
- Ptr<Node> (0),
- MakePtrAccessor (&Application::m_node),
- MakePtrChecker<Node> ())
;
return tid;
}
@@ -92,6 +88,12 @@
return m_node;
}
+void
+Application::SetNode (Ptr<Node> node)
+{
+ m_node = node;
+}
+
// Protected methods
// StartApp and StopApp will likely be overridden by application subclasses
void Application::StartApplication()
--- a/src/node/application.h Wed Mar 12 11:35:00 2008 -0700
+++ b/src/node/application.h Thu Mar 13 11:10:38 2008 -0700
@@ -102,6 +102,8 @@
* \returns the Node to which this Application object is attached.
*/
Ptr<Node> GetNode() const;
+
+ void SetNode (Ptr<Node> node);
private:
/**
--- a/src/node/net-device.h Wed Mar 12 11:35:00 2008 -0700
+++ b/src/node/net-device.h Thu Mar 13 11:10:38 2008 -0700
@@ -221,6 +221,8 @@
*/
virtual Ptr<Node> GetNode (void) const = 0;
+ virtual void SetNode (Ptr<Node> node) = 0;
+
/**
* \returns true if ARP is needed, false otherwise.
*
--- a/src/node/node.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/src/node/node.cc Thu Mar 13 11:10:38 2008 -0700
@@ -96,6 +96,7 @@
{
uint32_t index = m_devices.size ();
m_devices.push_back (device);
+ device->SetNode (this);
device->SetIfIndex(index);
device->SetReceiveCallback (MakeCallback (&Node::ReceiveFromDevice, this));
NotifyDeviceAdded (device);
@@ -117,6 +118,7 @@
{
uint32_t index = m_applications.size ();
m_applications.push_back (application);
+ application->SetNode (this);
return index;
}
Ptr<Application>
--- a/tutorial/point-to-point-ipv4-topology.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/point-to-point-ipv4-topology.cc Thu Mar 13 11:10:38 2008 -0700
@@ -45,8 +45,7 @@
NS_ASSERT (channel->GetNDevices () <= 1);
Ptr<PointToPointNetDevice> nd =
- CreateObject<PointToPointNetDevice> ("Node", node,
- "Address", Mac48Address::Allocate ());
+ CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
node->AddDevice (nd);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
nd->AddQueue(q);
--- a/tutorial/tutorial-bus-network.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-bus-network.cc Thu Mar 13 11:10:38 2008 -0700
@@ -44,17 +44,16 @@
Ptr<Node> n0 = bus.GetNode (0);
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.0.1"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.0.1"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<Node> n1 = bus.GetNode (1);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1, "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-csma-echo-ascii-trace.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-csma-echo-ascii-trace.cc Thu Mar 13 11:10:38 2008 -0700
@@ -69,17 +69,15 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-csma-echo-pcap-trace.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-csma-echo-pcap-trace.cc Thu Mar 13 11:10:38 2008 -0700
@@ -70,17 +70,15 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-csma-echo.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-csma-echo.cc Thu Mar 13 11:10:38 2008 -0700
@@ -68,17 +68,15 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-linear-dumbbell.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-linear-dumbbell.cc Thu Mar 13 11:10:38 2008 -0700
@@ -127,53 +127,45 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client0 =
- CreateObject<UdpEchoClient> (
- "Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.2.1"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (100),
- "Interval", Seconds (0.01),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.2.1"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (100),
+ "Interval", Seconds (0.01),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client0);
Ptr<UdpEchoClient> client1 =
- CreateObject<UdpEchoClient> (
- "Node", n1,
- "RemoteIpv4", Ipv4Address ("10.1.2.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (100),
- "Interval", Seconds (0.01),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.2.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (100),
+ "Interval", Seconds (0.01),
+ "PacketSize", Uinteger (1024));
n1->AddApplication (client1);
Ptr<UdpEchoClient> client2 =
- CreateObject<UdpEchoClient> (
- "Node", n2,
- "RemoteIpv4", Ipv4Address ("10.1.2.3"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (100),
- "Interval", Seconds (0.01),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.2.3"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (100),
+ "Interval", Seconds (0.01),
+ "PacketSize", Uinteger (1024));
n2->AddApplication (client2);
Ptr<UdpEchoClient> client3 =
- CreateObject<UdpEchoClient> (
- "Node", n3,
- "RemoteIpv4", Ipv4Address ("10.1.2.4"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (100),
- "Interval", Seconds (0.01),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.2.4"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (100),
+ "Interval", Seconds (0.01),
+ "PacketSize", Uinteger (1024));
n3->AddApplication (client3);
Ptr<UdpEchoServer> server4 =
- CreateObject<UdpEchoServer> ("Node", n4, "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n4->AddApplication (server4);
Ptr<UdpEchoServer> server5 =
- CreateObject<UdpEchoServer> ("Node", n5, "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n5->AddApplication (server5);
Ptr<UdpEchoServer> server6 =
- CreateObject<UdpEchoServer> ("Node", n6, "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n6->AddApplication (server6);
Ptr<UdpEchoServer> server7 =
- CreateObject<UdpEchoServer> ("Node", n7, "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n7->AddApplication (server7);
server4->Start(Seconds(1.));
--- a/tutorial/tutorial-point-to-point.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-point-to-point.cc Thu Mar 13 11:10:38 2008 -0700
@@ -61,17 +61,15 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-star-routing.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-star-routing.cc Thu Mar 13 11:10:38 2008 -0700
@@ -148,8 +148,7 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n4,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
"RemotePort", Uinteger (port),
"MaxPackets", Uinteger (1),
"Interval", Seconds(1.),
@@ -157,8 +156,7 @@
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/tutorial/tutorial-star.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/tutorial/tutorial-star.cc Thu Mar 13 11:10:38 2008 -0700
@@ -148,17 +148,15 @@
uint16_t port = 7;
Ptr<UdpEchoClient> client =
- CreateObject<UdpEchoClient> ("Node", n0,
- "RemoteIpv4", Ipv4Address ("10.1.1.2"),
- "RemotePort", Uinteger (port),
- "MaxPackets", Uinteger (1),
- "Interval", Seconds(1.),
- "PacketSize", Uinteger (1024));
+ CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"),
+ "RemotePort", Uinteger (port),
+ "MaxPackets", Uinteger (1),
+ "Interval", Seconds(1.),
+ "PacketSize", Uinteger (1024));
n0->AddApplication (client);
Ptr<UdpEchoServer> server =
- CreateObject<UdpEchoServer> ("Node", n1,
- "Port", Uinteger (port));
+ CreateObject<UdpEchoServer> ("Port", Uinteger (port));
n1->AddApplication (server);
server->Start(Seconds(1.));
--- a/utils/print-introspected-doxygen.cc Wed Mar 12 11:35:00 2008 -0700
+++ b/utils/print-introspected-doxygen.cc Thu Mar 13 11:10:38 2008 -0700
@@ -17,13 +17,11 @@
Ptr<Node> node = CreateObject<InternetNode> ();
node->AggregateObject (CreateObject<MobilityModelNotifier> ());
- Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Node", node,
- "Address", Mac48Address::Allocate ());
+ Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
node->AddDevice (p2p);
p2p->AddQueue (CreateObject<DropTailQueue> ());
- Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Node", node,
- "Address", Mac48Address::Allocate (),
- "EncapsulationMode", String ("Llc"));
+ Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Address", Mac48Address::Allocate (),
+ "EncapsulationMode", String ("Llc"));
node->AddDevice (csma);
csma->AddQueue (CreateObject<DropTailQueue> ());