Changeset 4a53c72
- Timestamp:
- May 17, 2010 9:08:23 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 5e4025d
- Parents:
- 2e0a952
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
r2e0a952 r4a53c72 592 592 593 593 for eidx, e in enumerate(t.elements): 594 if e.name: name = e.name [0]594 if e.name: name = e.name 595 595 else: name = "unnamed_node%d" % eidx 596 596 … … 713 713 if len(s.interfaces) > 2: 714 714 # Lan 715 members = [ to_tcl_name("${%s}") % i.element.name [0]\715 members = [ to_tcl_name("${%s}") % i.element.name \ 716 716 for i in s.interfaces] 717 717 out += 'set %s [$ns make-lan "%s" %fkb %fms ]\n' % \ … … 725 725 if ip: 726 726 out += "tb-set-ip-lan ${%s} ${%s} %s\n" % \ 727 (to_tcl_name(e.name [0]), name, ip)727 (to_tcl_name(e.name), name, ip) 728 728 if i.capacity and i.capacity.rate != s.capacity.rate: 729 729 out += "tb-set-node-lan-bandwidth ${%s} ${%s} %fkb\n" % \ 730 (to_tcl_name(e.name [0]), name, i.capacity.rate)730 (to_tcl_name(e.name), name, i.capacity.rate) 731 731 if i.latency and i.latency.time != delay: 732 732 out += "tb-set-node-lan-delay ${%s} ${%s} %fms\n" % \ 733 (to_tcl_name(e.name [0]), name, i.latency.time)733 (to_tcl_name(e.name), name, i.latency.time) 734 734 iloss = i.get_attribute('loss') 735 735 if loss and iloss != loss : 736 736 out += "tb-set-node-lan-loss ${%s} ${%s} %f\n" % \ 737 (to_tcl_name(e.name [0]), name, float(loss))737 (to_tcl_name(e.name), name, float(loss)) 738 738 out+= "\n" 739 739 elif len(s.interfaces) == 2: … … 742 742 743 743 out += "set %s [$ns duplex-link ${%s} ${%s} %fkb %fms DropTail]\n" %\ 744 (name, to_tcl_name(f.element.name [0]),745 to_tcl_name(t.element.name [0]),744 (name, to_tcl_name(f.element.name), 745 to_tcl_name(t.element.name), 746 746 s.capacity.rate, delay) 747 747 if loss: … … 765 765 766 766 out += "tb-set-link-simplex-params ${%s} ${%s} %fms %fkb %f\n"\ 767 % (name, to_tcl_name(i.element.name [0]),767 % (name, to_tcl_name(i.element.name), 768 768 delay, cap, loss) 769 769 ip = i.get_attribute('ip4_address') 770 770 if ip: 771 771 out += "tb-set-ip-link ${%s} ${%s} %s\n" % \ 772 (to_tcl_name(i.element.name [0]), name, ip)772 (to_tcl_name(i.element.name), name, ip) 773 773 out+= "\n" 774 774 for f in filters:
Note: See TracChangeset
for help on using the changeset viewer.