diff options
author | Sander Vrijders <[email protected]> | 2017-01-17 19:50:46 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-01-18 12:39:10 +0100 |
commit | b52e886c9042650c70e734be9983614e438b39c8 (patch) | |
tree | cec479b4907b2d69eb8c78a83ed72392e684d339 /main.py | |
parent | a9674f5a94525cc396141ce7c145bbe63324f368 (diff) | |
download | rumba-b52e886c9042650c70e734be9983614e438b39c8.tar.gz rumba-b52e886c9042650c70e734be9983614e438b39c8.zip |
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.
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -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) |