09 Nov 2016 22:13:16 UTC
- Distribution: Sniffer-HTTP
- Module version: 0.24
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (266 / 100 / 0)
- KwaliteeBus factor: 1
- 19.52% Coverage
- License: unknown
- Activity24 month
- Download (26.45KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCORION Max Maischein
Net::Pcap::FindDevice - find the "best" network device for sniffing
use Net::Pcap; use Net::Pcap::FindDevice; my $device = find_device($ARGV); my $pcap = Net::Pcap::open_live($device, 128000, -1, 500, \$err);
This module exports only one subroutine,
find_device, which employs a dwimish method to find a network device suitable for sniffing with Net::Pcap.
Finds a good Net::Pcap device based on some criteria:
If the parameter given is a regular expression, is used to scan the names and descriptions of the Net::Pcap device list. The name of the first matching element is returned.
If a Net::Pcap device matching the stringified parameter exists, it is returned. If there exists no matching device for the scalar,
If there is only one network device, the name of that device is returned.
If there is only one device left after removing all network devices with IP address 127.0.0.1, the name of that device is returned.
The name of the device with the default gateway (if any) is returned.
Otherwise it gives up and returns
Returns all interfaces that have the ip
IP. The value of
IPmust be given as a string of four numbers.
This method is not exported by default so you need to call it fully specified as
Max Maischein (firstname.lastname@example.org)
Copyright (C) 2005-2011 Max Maischein. All Rights Reserved.
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::Pcap, Wireshark, the Alsace in autumn
Module Install Instructions
To install Sniffer::HTTP, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Sniffer::HTTP
For more information on module installation, please visit the detailed CPAN module installation guide.