diff --git a/tbsetup/ns2ir/node.tcl b/tbsetup/ns2ir/node.tcl index e7d9cd664684b00b8439de6dfd491962a6b4c39b..8de1e5d04600fd6bb07616daf07c9fa1542534c6 100644 --- a/tbsetup/ns2ir/node.tcl +++ b/tbsetup/ns2ir/node.tcl @@ -97,6 +97,9 @@ Node instproc init {s} { $self set simulated 0 } $self set nsenode_vportlist {} + + # This is a mote thing. + $self set numeric_id {} } # The following procs support renaming (see README) @@ -155,6 +158,7 @@ Node instproc updatedb {DB} { $self instvar X_ $self instvar Y_ $self instvar orientation_ + $self instvar numeric_id var_import ::TBCOMPAT::default_osids var_import ::GLOBALS::use_physnaming var_import ::TBCOMPAT::physnodes @@ -254,6 +258,11 @@ Node instproc updatedb {DB} { lappend values $inner_elab_role } + if { $numeric_id != {} } { + lappend fields "numeric_id" + lappend values $numeric_id + } + $sim spitxml_data "virt_nodes" $fields $values if {$topo != ""} { @@ -559,3 +568,12 @@ Node instproc console {} { return $console_ } + +# +# Set numeric ID (a mote thing) +# +Node instproc set_numeric_id {myid} { + $self instvar numeric_id + + set numeric_id $myid +} diff --git a/tbsetup/ns2ir/tb_compat.tcl.in b/tbsetup/ns2ir/tb_compat.tcl.in index a8ea1cb2f45b7dfc6ff8816306c45f16431ac2e0..ade8a5c39bdc1ecd9b21a938e822592f6bdc2b8f 100644 --- a/tbsetup/ns2ir/tb_compat.tcl.in +++ b/tbsetup/ns2ir/tb_compat.tcl.in @@ -1489,3 +1489,15 @@ proc tb-set-security-level {level} { } set security_level $level } + +# +# Set numeric ID (this is a mote thing) +# +proc tb-set-node-id {vnode myid} { + if {[$vnode info class] != "Node"} { + perror "\[tb-set-node-id] $vnode is not a node." + return + } + $vnode set_numeric_id $myid +} +