swaroop has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

How do I find libpcap version in perl programming. My idea is , I would like to use specific version of libpcap module. Anyway to define it using , Net::Pcap modules ?

Thanks.

Replies are listed 'Best First'.
Re: libpcap version
by ikegami (Patriarch) on Jan 26, 2006 at 05:47 UTC

    What about the PCAP_VERSION_MAJOR and PCAP_VERSION_MINOR constants? Do they hold what you need?

    Update: I think the values for these constants come from lipcap's pcap_major_version and pcap_minor_version functions.

    According to the man page,

    pcap_major_version() returns the major number of the file format of the savefile; pcap_minor_version() returns the minor number of the file format of the savefile. The version number is stored in the header of the savefile.

    Not quite what you want. What you want is Net::Pcap's lib_version function. It calls libpcap's pcap_lib_version function.

    According to the man page,

    pcap_lib_version() returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number.

Re: libpcap version
by jkeenan1 (Deacon) on Jan 26, 2006 at 03:02 UTC
    Why would this CPAN module not be sufficient: Net-Pcap?

    Jim Keenan

      Net::Pcap uses libpcap and bpf library's. I just want to know how to get what libpcap version in my perl code. And also , any way to bind to specific verion of libpcap ( as libpcap is a shared module ).

      Thanks