Commit 011697a7 authored by Shashi Guruprasad's avatar Shashi Guruprasad

Skipped the max links and bw checks for the case when the lanlink only has

simulated nodes.
parent d34b47b8
......@@ -134,12 +134,27 @@ LanLink instproc init {s nodes bw d type} {
# By default, a local link
$self set widearea 0
# A simulated lanlink unless we find otherwise
$self set simulated 1
# Figure out if this is a lanlink that has at least
# 1 non-simulated node in it.
foreach node $nodes {
if { [$node set simulated] == 0 } {
$self set simulated 0
break
}
}
# Make sure BW is reasonable.
# XXX: Should come from DB instead of hardwired max.
# Measured in kbps
set maxbw 100000
if { $bw > $maxbw } {
# XXX skip this check for a simulated lanlink even if it
# causes nse to not keep up with real time. The actual max
# for simulated links will be added later
if { [$self set simulated] != 1 && $bw > $maxbw } {
perror "Bandwidth requested ($bw) exceeds maximum of $maxbw kbps!"
return
}
......
......@@ -152,12 +152,15 @@ Node instproc updatedb {DB} {
Node instproc add_lanlink {lanlink} {
$self instvar portlist
$self instvar iplist
$self instvar simulated
# Check if we're making too many lanlinks to this node
# XXX Could come from db from node_types if necessary
# For now, no more than 4 links or interfaces per node
# XXX Ignore if the lanlink is simulated i.e. one that
# has all simulated nodes in it.
set maxlanlinks 4
if { $maxlanlinks == [llength $portlist] } {
if { [$lanlink set simulated] != 1 && $maxlanlinks == [llength $portlist] } {
# adding this one would put us over
perror "Too many links/LANs to node $self! Maximum is $maxlanlinks."
}
......
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