I’m trying to prototype using Ruby for a networking class that I’m
taking, and I need to be able to use libpcap. I found ‘pcaplet’ and
have been trying to get set up with that, but when trying to execute the
following line:
$network = Pcaplet.new(’-s 1500’)
I get the following error:
/usr/lib/ruby/1.8/pcaplet.rb:51:in ‘lookupdev’: no suitable device found
(Pcap::PcapError)
from /usr/lib/ruby/1.8/pcaplet.rb:51:in ‘initialize’
from test.rb:3
I’m running on Ubuntu 6.10 under Microsoft Virtual PC 2007 as I don’t
have Linux installed directly on my laptop.
/usr/lib/ruby/1.8/pcaplet.rb:51:in ‘lookupdev’: no suitable device
found
(Pcap::PcapError)
from /usr/lib/ruby/1.8/pcaplet.rb:51:in ‘initialize’
from test.rb:3
You need to specify the interface to listen on. For example:
/usr/lib/ruby/1.8/pcaplet.rb:51:in ‘lookupdev’: no suitable device
found
(Pcap::PcapError)
from /usr/lib/ruby/1.8/pcaplet.rb:51:in ‘initialize’
from test.rb:3
You need to specify the interface to listen on. For example:
Thanks for your quick reply, your solution worked like a charm. I was
following a Ruby/Pcap tutorial from Arstechnica.com and they didn’t make
any mention of specifying the interface.
Thanks for your quick reply, your solution worked like a charm. I was
following a Ruby/Pcap tutorial from Arstechnica.com and they didn’t
make
any mention of specifying the interface.
Unfortunately Ruby/Pcap is a very thin wrapper to the underlying
library, which makes it a little less Rubyish than one would like -
in particular passing in configuration strings is just ugly. Still,
it works as advertised and is great for quick sniffing/logging tasks.
My colleague Romek and I use it extensively for our DNS work and he
covered it very briefly as part of our RailsConf Europe presentation
last year. Needless to say there were some baffled faces in the
audience lol
Ellie
Being and Doing are merely useful abstractions for the ‘time’-
dependent asymmetries of phase space.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.