simplest example possible
authorMathieu Lacage <mathieu.lacage@inria.fr>
Mon, 31 Jan 2011 14:18:13 +0100
changeset 54 d65190373bf5
parent 53 85b620c2fee1
child 55 665e73f2fc3c
simplest example possible
example/dce-tcp-simple.cc
example/wscript
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/dce-tcp-simple.cc	Mon Jan 31 14:18:13 2011 +0100
@@ -0,0 +1,34 @@
+#include "ns3/helper-module.h"
+#include "ns3/simulator-module.h"
+#include "ns3/core-module.h"
+
+using namespace ns3;
+
+int main (int argc, char *argv[])
+{
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  NodeContainer nodes;
+  nodes.Create (1);
+
+  InternetStackHelper stack;
+  stack.Install (nodes);
+
+  DceManagerHelper dceManager;
+  dceManager.Install (nodes);
+
+  DceApplicationHelper dce;
+  ApplicationContainer apps;
+
+  dce.SetBinary ("tcp-loopback");
+  dce.SetStackSize (1<<20);
+  apps = dce.Install (nodes.Get (0));
+  apps.Start (Seconds (4.0));
+
+  Simulator::Stop (Seconds(1000100.0));
+  Simulator::Run ();
+  Simulator::Destroy ();
+
+  return 0;
+}
--- a/example/wscript	Mon Jan 31 14:17:52 2011 +0100
+++ b/example/wscript	Mon Jan 31 14:18:13 2011 +0100
@@ -14,6 +14,11 @@
     obj = bld.create_dce_program('tcp-loopback')
     obj.source = ['tcp-loopback.cc']
 
+    obj = bld.create_ns3_program('dce-tcp-simple', 
+                                 ['core', 'simulator', 'point-to-point', 
+                                  'internet-stack', 'dce-manager'])
+    obj.source = 'dce-tcp-simple.cc'
+
     obj = bld.create_ns3_program('dce-iperf', 
                                  ['core', 'simulator', 'point-to-point', 
                                   'internet-stack', 'dce-manager'])