use print() - import print_function - should be fine for both py2 and py3
[nepi.git] / examples / ccn_emu_live / dce_4_nodes_linear.py
index 1658ebe..b738798 100644 (file)
@@ -1,13 +1,11 @@
 #!/usr/bin/env python\r
-\r
-###############################################################################\r
 #\r
 #    NEPI, a framework to manage network experiments\r
+#    Copyright (C) 2013 INRIA\r
 #\r
 #    This program is free software: you can redistribute it and/or modify\r
-#    it under the terms of the GNU General Public License as published by\r
-#    the Free Software Foundation, either version 3 of the License, or\r
-#    (at your option) any later version.\r
+#    it under the terms of the GNU General Public License version 2 as\r
+#    published by the Free Software Foundation;\r
 #\r
 #    This program is distributed in the hope that it will be useful,\r
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
@@ -18,8 +16,8 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
 #\r
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>\r
-#\r
-###############################################################################\r
+\r
+\r
 from nepi.execution.ec import ExperimentController \r
 from nepi.execution.runner import ExperimentRunner\r
 from nepi.util.netgraph import TopologyType\r
@@ -102,13 +100,13 @@ repofile = os.path.join(
         "repoFile1.0.8.2")\r
 \r
 def get_simulator(ec):\r
-    simulator = ec.filter_resources("LinuxNS3Simulation")\r
+    simulator = ec.filter_resources("linux::ns3::Simulation")\r
 \r
     if not simulator:\r
-        node = ec.register_resource("LinuxNode")\r
+        node = ec.register_resource("linux::Node")\r
         ec.set(node, "hostname", "localhost")\r
 \r
-        simu = ec.register_resource("LinuxNS3Simulation")\r
+        simu = ec.register_resource("linux::ns3::Simulation")\r
         ec.register_connection(simu, node)\r
         return simu\r
 \r
@@ -138,7 +136,7 @@ def add_dce_ccnd(ec, nid):
     host = ec.netgraph.node_annotation(nid, "host")\r
     \r
     # Add dce ccnd to the dce node\r
-    ccnd = ec.register_resource("ns3::LinuxDceCCND")\r
+    ccnd = ec.register_resource("linux::ns3::dce::CCND")\r
     ec.set (ccnd, "stackSize", 1<<20)\r
     ec.set (ccnd, "debug", 7)\r
     ec.set (ccnd, "capacity", 50000)\r
@@ -158,7 +156,7 @@ def add_dce_ccnr(ec, nid):
     host = ec.netgraph.node_annotation(nid, "host")\r
     \r
     # Add a CCN content repository to the dce node\r
-    ccnr = ec.register_resource("ns3::LinuxDceCCNR")\r
+    ccnr = ec.register_resource("linux::ns3::dce::CCNR")\r
     ec.set (ccnr, "repoFile1", repofile) \r
     ec.set (ccnr, "stackSize", 1<<20)\r
     ec.set (ccnr, "StartTime", "2s")\r
@@ -170,7 +168,7 @@ def add_dce_ccncat(ec, nid):
     host = ec.netgraph.node_annotation(nid, "host")\r
    \r
     # Add a ccncat application to the dce host\r
-    ccncat = ec.register_resource("ns3::LinuxDceCCNCat")\r
+    ccncat = ec.register_resource("linux::ns3::dce::CCNCat")\r
     ec.set (ccncat, "contentName", content_name)\r
     ec.set (ccncat, "stackSize", 1<<20)\r
     ec.set (ccncat, "StartTime", "8s")\r
@@ -184,7 +182,7 @@ def add_dce_fib_entry(ec, nid1, nid2):
     ip2 = net[nid2]\r
 \r
     # Add FIB entry between peer hosts\r
-    ccndc = ec.register_resource("ns3::LinuxDceFIBEntry")\r
+    ccndc = ec.register_resource("linux::ns3::dce::FIBEntry")\r
     ec.set (ccndc, "protocol", "udp") \r
     ec.set (ccndc, "uri", "ccnx:/") \r
     ec.set (ccndc, "host", ip2)\r
@@ -239,7 +237,7 @@ def add_node(ec, nid):
         add_dce_ccncat(ec, nid)\r
 \r
 def wait_guids(ec):\r
-    return ec.filter_resources("ns3::LinuxDceCCNCat")\r
+    return ec.filter_resources("linux::ns3::dce::CCNCat")\r
 \r
 if __name__ == '__main__':\r
 \r