[ns] accessing variables

Renan renan at sc.usp.br
Thu Feb 26 17:08:52 PST 2004


Hi ns users,
I have defined a procedure inside my tcl script that looks like this :

proc set_udp_pair {index src_node dst_node src_agent dst_agent} {
    global ns
    set udp($index) [new Agent/UDP]
    $ns attach-agent $src_node $udp($index)
    set sink($index) [new Agent/UDP]
    $ns attach-agent $dst_node $sink($index)
    $ns connect $udp($index) $sink($index)
    $sink($index) listen
    set udpapp($index) [new Application/UdpApp $udp($index)]
    set sinkapp($index) [new Application/UdpApp $sink($index)]
    $udpapp($index) connect $sinkapp($index)

}

Is there a way to access the udpapp variable outside of this procedure ??


Thanks,

Renan




More information about the Ns-users mailing list