HASH, x.
There is no definition for this word
-- nobody knows what hash is.

Ambrose Bierce, The Devil's Dictionary


The module 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

In order to use 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).

Example scripts

The following demo scripts are translations in Perl of the example programs from the WinPcap development pack. The three scripts in a zip file: wnpdemo.zip

Back to Top

BP 2003-2006 J-L Morel - Contact : jl_morel@bribes.org [Validation HTML 4.0!]