Commit 14e1d714 authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

New TB stuff. tbprerun now deals with the tbcmds file and runs extract_tb.

test.ns is a new style example test_oldstyle.ns is the same configuration
oldstyle syntax.  Both should work fine and achieve identical results.
parent 3ea29ec9
......@@ -37,6 +37,8 @@ $logfile = "$prefix.log";
$ptopfile = "/tmp/testbed$$.ptop";
$id = "$pid-$eid";
$tbcmdfile = "tbcmds";
# This will hold the list of nodes currently assigned.
@nodes = ();
......@@ -59,6 +61,11 @@ if (! -r $nsfile) {
exit(1);
}
# remove a tbcmdfile is it exists
if (-r $tbcmdfile) {
unlink $tbcmdfile;
}
&tbs_out("Parsing ns input.\n");
if (&tbs_exec("parse.tcl $id $nsfile $irfile")) {
&tbs_out("Parsing failed.\n");
......@@ -70,8 +77,14 @@ if (! -r $irfile) {
exit(1);
}
#&tbs_out("Backward Compatability.\n");
if (&tbs_exec("extract_tb $nsfile $tbcmdfile")) {
&tbs_out("Backward Compatability Failed.\n");
exit(1);
}
#&tbs_out("Post parsing NS input.");
if (&tbs_exec("postparse $nsfile $irfile")) {
if (&tbs_exec("postparse $tbcmdfile $irfile")) {
&tbs_out("Postparsing failed.\n");
exit(1);
}
......@@ -136,14 +149,14 @@ if (&tbs_exec("postassign $irfile")) {
#&tbs_out("!!! Any further errors will result in partial DB state.\n");
&tbs_out("Allocating IP addresses.\n");
if (&tbs_exec("handle_ip $irfile $nsfile")) {
if (&tbs_exec("handle_ip $irfile $tbcmdfile")) {
&tbs_out("Failed to allocate IP addresses.\n");
&cleanup();
exit(1);
}
&tbs_out("Setting up OS state.\n");
if (&tbs_exec("handle_os $irfile $nsfile")) {
if (&tbs_exec("handle_os $irfile $tbcmdfile")) {
&tbs_out("Failed to set up OS state.\n");
&cleanup();
exit(1);
......
source tb_compat.tcl
set ns [new Simulator]
set node0 [$ns node]
......@@ -7,15 +9,15 @@ set node2 [$ns node]
$ns duplex-link $node0 $node1 100Mb 150ms DropTail
$ns duplex-link $node1 $node2 100Mb .1ms DropTail
#TB set-link-loss node1 node2 0.5
tb-set-link-loss $node1 $node2 0.5
#TB set-ip node0 192.168.14.52
#TB set-ip-interface node2 node1 192.168.5.1
#TB set-hardware node2 shark-shelf
tb-set-ip $node0 192.168.14.52
tb-set-ip-interface $node2 $node1 192.168.5.1
tb-set-hardware $node2 shark-shelf
#TB create-os MY-OS my-os.img 1
#TB set-node-os node1 FBSD40-STD
#TB set-dnard-os node2 1-8 MY-OS
tb-create-os MY-OS my-os.img 1
tb-set-node-os $node1 FBSD40-STD
tb-set-dnard-os $node2 1-8 MY-OS
# Node 0 should have the default
......
set ns [new Simulator]
set node0 [$ns node]
set node1 [$ns node]
set node2 [$ns node]
$ns duplex-link $node0 $node1 100Mb 150ms DropTail
$ns duplex-link $node1 $node2 100Mb .1ms DropTail
#TB set-link-loss node1 node2 0.5
#TB set-ip node0 192.168.14.52
#TB set-ip-interface node2 node1 192.168.5.1
#TB set-hardware node2 shark-shelf
#TB create-os MY-OS my-os.img 1
#TB set-node-os node1 FBSD40-STD
#TB set-dnard-os node2 1-8 MY-OS
# Node 0 should have the default
$ns run
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment