Commit 353e0f37 authored by Leigh B Stoller's avatar Leigh B Stoller

Parser support for MLE stuff; tb-set-link-layer $link 1

Default is 2, of course.
parent 179ab667
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006, 2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -214,6 +214,9 @@ LanLink instproc init {s nodes bw d type} {
# XXX Allow user to set the accesspoint.
$self set accesspoint {}
# Optional layer
$self set layer {}
# A simulated lanlink unless we find otherwise
$self set simulated 1
# Figure out if this is a lanlink that has at least
......@@ -716,6 +719,7 @@ Link instproc updatedb {DB} {
$self instvar protocol
$self instvar mustdelay
$self instvar fixed_iface
$self instvar layer
$sim spitxml_data "virt_lan_lans" [list "vname"] [list $self]
......@@ -802,6 +806,11 @@ Link instproc updatedb {DB} {
lappend fields "fixed_iface"
}
# Set the layer
if { $layer != {} } {
lappend fields "layer"
}
set values [list $self $nodeportraw $netmask $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $backfill($nodeport) $rbackfill($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $encap $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok $protocol $node $port $ip $mustdelay]
if { [info exists ebandwidth($nodeport)] } {
......@@ -826,6 +835,10 @@ Link instproc updatedb {DB} {
if {$fixed_iface($nodeport) != 0} {
lappend values $fixed_iface($nodeport)
}
# Set the layer
if { $layer != {} } {
lappend values $layer
}
$sim spitxml_data "virt_lans" $fields $values
}
......
......@@ -62,6 +62,7 @@ proc tb-set-encapsulate {onoff} {}
proc tb-set-vlink-emulation {style} {}
proc tb-set-sim-os {os} {}
proc tb-set-jail-os {os} {}
proc tb-set-link-layer {link layer} {}
proc tb-set-delay-os {os} {}
proc tb-set-delay-capacity {cap} {}
proc tb-use-ipassign {onoff} {}
......
......@@ -1954,3 +1954,20 @@ proc tb-fix-interface {vnode lanlink iface} {
$lanlink set_fixed_iface $vnode $iface
}
#
# Set the layer.
#
proc tb-set-link-layer {link mylayer} {
if {[$link info class] != "Link"} {
perror "\[tb-set-link-layer] $link is not a link."
return
}
if {$mylayer != 1} {
perror "\[tb-set-link-layer] Only layer 1 is allowed."
return
}
$link instvar layer
$link set layer $mylayer
}
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