Changeset 1da6a23 for fedd/federation/topdl.py
- Timestamp:
- Sep 4, 2009 5:04:07 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- 5ae3857
- Parents:
- f5ae004
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
rf5ae004 r1da6a23 613 613 614 614 615 def topology_to_ns2(t, filters=[] ):615 def topology_to_ns2(t, filters=[], routing="Session"): 616 616 out = """ 617 617 set ns [new Simulator] … … 668 668 for i in s.interfaces: 669 669 e = i.element 670 ip = e.get_attribute("ip4_address")670 ip = i.get_attribute("ip4_address") 671 671 if ip: 672 out += "tb-set-ip-lan $%s $%s %s\n" % (e.name, name, ip) 672 out += "tb-set-ip-lan $%s $%s %s\n" % \ 673 (to_tcl(e.name[0]), name, ip) 673 674 if i.capacity and i.capacity.rate != s.capacity.rate: 674 675 out += "tb-set-node-lan-bandwidth $%s $%s %fkb\n" % \ … … 679 680 iloss = i.get_attribute('loss') 680 681 if loss and iloss != loss : 681 out += "tb-set-node-lan-loss $%s $%s %f " % \682 out += "tb-set-node-lan-loss $%s $%s %f\n" % \ 682 683 (to_tcl_name(e.name[0]), name, float(loss)) 683 684 out+= "\n" … … 712 713 % (name, to_tcl_name(i.element.name[0]), 713 714 delay, cap, loss) 715 ip = i.get_attribute('ip4_address') 716 if ip: 717 out += "tb-set-ip-link $%s $%s %s\n" % \ 718 (to_tcl_name(i.element.name[0]), name, ip) 714 719 out+= "\n" 715 720 for f in filters: 716 721 out+= f(s) 722 out+="$ns rtproto %s" % routing 717 723 out+=""" 718 724 $ns run
Note: See TracChangeset
for help on using the changeset viewer.