elabinelab.ns 3.36 KB
Newer Older
1 2 3 4
#
# This file is intended to be included into another NS file. It is not
# a stand alone file.
# 
5 6 7 8 9 10
set myboss [$ns node]
set myops  [$ns node]

tb-set-node-inner-elab-role $myboss boss
tb-set-node-inner-elab-role $myops  ops

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
if {[info exists ::TBCOMPAT::elabinelab_hardware("boss")]} {
    namespace eval TBCOMPAT {
        tb-set-hardware $myboss $elabinelab_hardware("boss")
    }
} else {
    tb-set-hardware $myboss pc850
}
if {[info exists ::TBCOMPAT::elabinelab_hardware("ops")]} {
    namespace eval TBCOMPAT {
        tb-set-hardware $myops $elabinelab_hardware("ops")
    }
} else {
    tb-set-hardware $myops pc850
}

if {[info exists ::TBCOMPAT::elabinelab_fixnodes("boss")]} {
    namespace eval TBCOMPAT {
        tb-fix-node $myboss $elabinelab_fixnodes("boss")
    }
}
if {[info exists ::TBCOMPAT::elabinelab_fixnodes("ops")]} {
    namespace eval TBCOMPAT {
        tb-fix-node $myops $elabinelab_fixnodes("ops")
    }
}

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
# Deal with tarfiles
set myboss_tarfiles ""
set myops_tarfiles  ""

if {${::TBCOMPAT::elabinelab_source_tarfile} != ""} {
    append myboss_tarfiles "/usr/src ${::TBCOMPAT::elabinelab_source_tarfile}"
    append myops_tarfiles  "/usr/src ${::TBCOMPAT::elabinelab_source_tarfile}"
}

if {[info exists ::TBCOMPAT::elabinelab_tarfiles("boss")]} {
    if {$myboss_tarfiles != ""} {
	append myboss_tarfiles " "
    }
    namespace eval TBCOMPAT {
	append myboss_tarfiles $elabinelab_tarfiles("boss")
    }
}
if {[info exists ::TBCOMPAT::elabinelab_tarfiles("ops")]} {
    if {$myops_tarfiles != ""} {
	append myops_tarfiles " "
    }
    namespace eval TBCOMPAT {
	append myops_tarfiles $elabinelab_tarfiles("ops")
    }
}
if {$myboss_tarfiles != ""} {
    tb-set-node-tarfiles $myboss $myboss_tarfiles
}
if {$myops_tarfiles != ""} {
    tb-set-node-tarfiles $myops $myops_tarfiles
}

69 70
tb-make-soft-vtype pcslow {pc600 pc850}

71 72 73 74 75 76 77 78 79 80 81
#
# This is passed in by the parser, when wrapping an existing experiment.
# The parser wrapper gets info about the wrapped experiment and passes it
# along in the TBCOMPAT namespace.
#
if { ${::TBCOMPAT::elabinelab_maxpcs} != 0 } {
    set maxpcs ${::TBCOMPAT::elabinelab_maxpcs}
} else {
    set maxpcs 0
}

82 83 84 85 86 87
set lanstr "myboss myops "
for {set i 1} {$i <= $maxpcs} {incr i} {
	set name "mypc${i}"
	set $name [$ns node]
	append lanstr "[set $name] "
	tb-set-node-inner-elab-role [set $name] node
88 89 90 91 92 93 94

	if {[info exists ::TBCOMPAT::elabinelab_nodeos($name)]} {
	    namespace eval TBCOMPAT {
        	tb-set-node-os [set $name] $elabinelab_nodeos($name)
	    }
	}

95 96 97 98 99 100 101
	if {[info exists ::TBCOMPAT::elabinelab_fixnodes($name)]} {
	    namespace eval TBCOMPAT {
        	tb-fix-node [set $name] $elabinelab_fixnodes($name)
	    }
	} else {
	    tb-set-hardware [set $name] pcslow
	}
102 103 104
}
set publiclan [$ns make-lan $lanstr 100Mb 0ms]

105 106
tb-set-ip-lan $myboss $publiclan 10.200.1.252
tb-set-ip-lan $myops  $publiclan 10.200.1.253
107 108 109 110 111
for {set i 1} {$i <= $maxpcs} {incr i} {
	set name "mypc${i}"
	tb-set-ip-lan [set $name] $publiclan 10.200.1.$i
}

112 113 114 115 116 117 118
if {[info exists ::TBCOMPAT::elabinelab_nodeos("boss")]} {
    namespace eval TBCOMPAT {
        tb-set-node-os $myboss $elabinelab_nodeos("boss")
    }
} else {
    tb-set-node-os $myboss FBSD-STD
}
119
tb-set-node-cmdline $myboss /kernel.linkdelay
120 121 122 123 124 125 126 127 128 129

if {[info exists ::TBCOMPAT::elabinelab_nodeos("ops")]} {
    namespace eval TBCOMPAT {
        tb-set-node-os $myops $elabinelab_nodeos("ops")
    }
} else {
    tb-set-node-os $myops  FBSD-STD
}


130