[Netexpect-users] Can't run netexpect - receiving error "arp(sha)": variable isn't array

Milos Kostic-Veljkovic miloskv at gmail.com
Mon Aug 27 19:09:39 UTC 2012


Hi,

I have installed netexpect on ubuntu 12 with apt-get, together with bunch
of other packages. This is a fresh install

Now when I try to run any of the examples, scripts always fail with an
error.

Example code:

root at ubuntu1:/home/riverbed/Documents# cat arp.nexp
spawn_network -i eth3 host 22.0.0.21 and {arp[6:2]} == 1
set mymac 00:11:22:33:44:55

          expect_network {1} {
              # Received an ARP request, send ARP reply

puts $arp  <---- ADDED THIS ON PURPOSE TO TRY TO PRINT $ARP
# puts $arp(sip)
         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)
              nexp_continue
          }


And the error is always:

root at ubuntu1:/home/riverbed/Documents# nexp arp.nexp
\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
(this above is puts $arp output)

error is bellow:

can't read "arp(sha)": variable isn't array
    while executing
"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)"
    invoked from within
"expect_network {1} {
              # Received an ARP request, send ARP reply

puts $arp
# puts $arp(sip)
         send_network -o eth3 \
        ..."
    (file "arp.nexp" line 4)


Thanks for your tips if you could point me to the good direction how to fix
this

Milos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/netexpect-users/attachments/20120827/20d22680/attachment.html>


More information about the Netexpect-users mailing list