Win32::NetPacket
provides an Object-Oriented interface
to the Packet Driver API (packet.dll
). The dynamic link library
packet.dll
is a part of WinPcap
:
the Free Packet Capture Architecture for Windows.
packet.dll
offers a set of low level functions to sniff the network
traffic, send packets to the network, obtain the list of the available network
adapters, retrieve various information about an adapter, ...etc
For more information, see
WinPcap.org
.
Caution:
As explained in the
WinPcap documentation, packet.dll
should be considered
an internal API and, as a consequence, there is no guarantee that this
API will not be changed in future releases of WinPcap
.
Therefore the module is subject to change for every version of
WinPcap
and every version of the module corresponds to a
particular version of WinPcap
. Nevertheless, I try to maintain
the same interface from version to version.
All the packet.dll
functions are not implemented yet (under development...).
See the POD of Win32::NetPacket
.
Current version is 0.03 for WinPcap 3.1
Win32::NetPacket
in your Perl scripts, it
is necessary to install WinPcap
on your machine.
Download the 3.1 version
WinPcap auto-installer (driver +DLLs)
and run the executable.
You can also download
WinDump
(tcpdump for Windows).
The module is in my ppm repository
.
If you are using ActiveState's Perl distribution (Perl 5.6 or Perl 5.8), the easiest way to install
this module is to use ppm
.
Enter (or cut & paste) this command in a DOS console:
ppm install http://www.bribes.org/perl/ppm/Win32-NetPacket.ppd
The documentation, in html format, is at its usual location.
If you want, you can download the source file here:
Win32-NetPacket-0.03.tar.gz
or from the
CPAN
To install the module, read the README file.
You can download the WinPcap
documentation
(with full Packet.dll
doc) in .chm format here:
winpcap31doc.zip
(1.59 Mb).
TestApp
See the code of TestApp.pl
.
Netmeter
See the code of NetMeter.pl
.
Traffic Generator
perl tg.pl -i 1 -n 100 -s 256
-i
option is not specified, the script shows a list of
available adapters and gives the possibility to choose one of them.
See the code of tg.pl
.
wnpdemo.zip