Hi,<div><br></div><div>I have installed netexpect on ubuntu 12 with apt-get, together with bunch of other packages. This is a fresh install</div><div><br></div><div>Now when I try to run any of the examples, scripts always fail with an error.</div>
<div><br></div><div>Example code:</div><div><br></div><div><div>root@ubuntu1:/home/riverbed/Documents# cat arp.nexp </div><div>spawn_network -i eth3 host 22.0.0.21 and {arp[6:2]} == 1</div><div>set mymac 00:11:22:33:44:55</div>
<div><br></div><div>          expect_network {1} {</div><div>              # Received an ARP request, send ARP reply</div><div><br></div><div>puts $arp  <---- ADDED THIS ON PURPOSE TO TRY TO PRINT $ARP</div><div># puts $arp(sip)     </div>
<div>         send_network -o eth3 \</div><div>                  ether(src = $mymac, dst = $arp(sha) )/ \</div><div>                  arp-reply(tha = $arp(sha), tip = $arp(sip), \</div><div>                            sha = $mymac, sip = 22.0.0.21)</div>
<div>              nexp_continue</div><div>          }</div></div><div><br></div><div><br></div><div>And the error is always:</div><div><br></div><div><div>root@ubuntu1:/home/riverbed/Documents# nexp arp.nexp </div><div>\x00\x01\x08\x00\x06\x04\x00\x01\x00\x0c\x29\x77\x04\x27\x16\x00\x00\x01\x00\x00\x00\x00\x00\x00\x16\x00\x00\x15</div>
<div>(this above is puts $arp output)</div><div><br></div><div>error is bellow:</div><div><br></div><div>can't read "arp(sha)": variable isn't array</div><div>    while executing</div><div>"send_network -o eth3  ether(src = $mymac, dst = $arp(sha) )/  arp-reply(tha = $arp(sha), tip = $arp(sip),  sha = $mymac, sip = 22.0.0.21)"</div>
<div>    invoked from within</div><div>"expect_network {1} {</div><div>              # Received an ARP request, send ARP reply</div><div><br></div><div>puts $arp</div><div># puts $arp(sip)     </div><div>         send_network -o eth3 \</div>
<div>        ..."</div><div>    (file "arp.nexp" line 4)</div></div><div><br></div><div><br></div><div>Thanks for your tips if you could point me to the good direction how to fix this</div><div><br></div><div>
Milos</div>