Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Net::Pcap garbage Output

by Khen1950fx (Canon)
on May 26, 2008 at 21:47 UTC ( [id://688560]=note: print w/replies, xml ) Need Help??


in reply to Net::Pcap garbage Output

I couldn't get Net::Pcap to work for me. Here's a small substitute:

#!/usr/bin/perl use strict; use warnings; use Linux::net::dev; use Net::ARP; use Net::Address::Ethernet qw(get_address); use Sys::HostIP; my $devs = Linux::net::dev::info(); print "Devices (bytes read):\n"; foreach (keys %$devs) { print " $_ ($devs->{$_}->{rbytes})\n"; } my $dev = "eth0"; my $mac = Net::ARP::get_mac("eth0"); print "$mac\n"; $mac = Net::ARP::arp_lookup($dev, '192.168.1.1'); print "192.168.1.1 has got mac $mac\n"; my $sAddress = get_address; print "$sAddress\n"; my $ip_address = Sys::HostIP->ip; print $ip_address, "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://688560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-22 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found