File: emarp.tcl

package info (click to toggle)
ns2 2.35%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 78,780 kB
  • ctags: 27,490
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 816; awk: 525; csh: 355
file content (16 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
set ns [new Simulator]
$ns use-scheduler RealTime
set x [new ArpAgent]
$x config
set a1 131.243.1.39
set a2 131.243.1.80
set a3 131.243.1.81
$ns at 0.0 "$x resolve $a1"
$ns at 1.0 "$x resolve $a2"
$ns at 2.0 "$x resolve $a3"
#
# put the lookups in {} so the string doesn't get expanded
# right away by the interpreter...
#
$ns at 8.0 {puts "[$ns now] $a1: [$x lookup $a1], $a2: [$x lookup $a2], $a3: [$x lookup $a3]"}
$ns run