Net::Ncap is a Perl XS extension to the ncap network data capture library. The ncap documentation describes itself as:

The ncap library is a high level interface for network data capture. The source of network data can be either live traffic or files containing previously captured or generated data. Files can be in ncap format or in pcap format, and can be either normal binary files or network sockets.

For the most part, Net::Ncap follows the API as provided by the ncap library with modifications to make things more Perl-like where appropriate.

Source Code

The Net::Ncap source code is available from these locations:

Net::Ncap v1.01, 2009-09-03


CPAN — Find the Net::Ncap module on a CPAN mirror.

Installing Net::Ncap

First, make sure you have libncap installed; compiling the ncap library will require the presence of libpcap on the build system.

Second, install Net::Ncap like any other perl module; this is an XS extension so a C compiler will be necessary. The easiest way, if you have admin privileges on the target machine, is to use the cpan interactive installation (this will automatically download the Net::Ncap distribution from CPAN):

$ sudo cpan
cpan1> install Net::Ncap
cpan2> quit

Otherwise, in order to manually install, download the .tar.gz distribution file from one of the sources above and unpack it. From within the resulting directory, follow the standard perl module build procedure:

$ perl Makefile.PL
$ make
$ make test
$ sudo make install

Using Net::Ncap

The API for Net::Ncap closely follows that provided by libncap. You can browse the documentation online.

Alternatively, if you followed the installation procedure above, the documentation should be available on your system via one of the following commands:

man Net::Ncap
perldoc Net::Ncap