From b52e886c9042650c70e734be9983614e438b39c8 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 17 Jan 2017 19:50:46 +0100 Subject: rhumba: Change example script and update rhumba.py This changes the example script for instantiating a network with 2 nodes and a normal DIF between them. It also renames libarcfire.py to rhumba.py and updates its classes to the current example. --- main.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index ea7ae17..1b61543 100755 --- a/main.py +++ b/main.py @@ -1,19 +1,26 @@ #!/usr/bin/env python -# An example script using libarcfire.py +# An example script using rhumba.py -from libarcfire import * +from rhumba import * +n1 = NormalDIF("n1", policies = {"rmt.pff": "lfa", + "security-manager": "passwd"}) -exp = IRATIExperiment("prova") -exp.dif_add(ShimEthDIF("300", 0, ["a", "b"])) -exp.dif_add(ShimEthDIF("400", 0, ["b", "c"])) +e1 = ShimEthDIF("e1") -n1 = NormalDIF("n1", ["a", "b", "c"]) -n1.policy_add(Policy("rmt.pff", "lfa")) -n1.policy_add(Policy("security-manager", "passwd", passwd="xyz")) -n1.appmap_add("rina-echo-time.server") -exp.dif_add(n1) +a = Node("a", + difs = [n1, e1], + dif_registrations = {n1 : [e1]}, + registrations = {"a.crap" : [n1]}, + bindings = {"a.crap" : "/usr/bin/crap"}) + +b = Node("b", + difs = [e1, n1], + dif_registrations = {n1 : [e1]}) + +exp = IRATIExperiment("paperino", + nodes = [a, b]) print(exp) -- cgit v1.2.3