Commit 4f0c3572 authored by Mac Newbold's avatar Mac Newbold
Browse files

Add the long-awaited check for nodes that have too many lans/links. For

now it is just hardcoded to 4, but could be done from the db too. Gives
errors like this one, from a topo where node2 and node6 each have 5 links:

*** /usr/testbed/devel/newbold/lib/ns2ir/parse.tcl:
    Too many links/LANs to node node2! Maximum is 4.
*** /usr/testbed/devel/newbold/lib/ns2ir/parse.tcl:
    Too many links/LANs to node node6! Maximum is 4.
*** /usr/testbed/devel/newbold/bin/batchexp:
    NS Parse failed!
parent 5eb5c6ed
......@@ -152,6 +152,16 @@ Node instproc updatedb {DB} {
Node instproc add_lanlink {lanlink} {
$self instvar portlist
$self instvar iplist
# 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
set maxlanlinks 4
if { $maxlanlinks == [llength $portlist] } {
# adding this one would put us over
perror "Too many links/LANs to node $self! Maximum is $maxlanlinks."
}
lappend portlist $lanlink
lappend iplist ""
return [expr [llength $portlist] - 1]
......
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