Massimo Sala wrote:

I feel useful to read pcap_major_version() and pcap_minor_version() at the
application startup.
Unfortunately they require a open pcap_t handle, so I cannot check the version
before pcap_open().

Do they really need the handle to work ?

Yes.

The WinPcap documentation, and the documentation in older versions of libpcap (whence the WinPcap documentation probably got its description of those functions) is incorrect; "pcap_major_version()" and "pcap_minor_version()" are *NOT* the major and minor version number of the library, they're the major and minor version number of the format of the file itself, so you need an open file in order to get those versions.

(The libpcap file format includes a major and minor version field in the file header, so that files written by older versions of libpcap can be handled - there was, for example, a change between version 2.2 and version 2.3, where the "captured length" and "actual length" fields in the per-packet header were interchanged. The current file format version is 2.4.)

If you want the version number of the *library*, then, if WinPcap 3.1b4 has "pcap_lib_version()" (which first appeared in libpcap 0.8), if you call "pcap_lib_version()", you should get a string that identifies the version of WinPcap being used, as well as the version of libpcap upon which it's based. That function isn't available in libpcap before 0.8, so it's presumably not available in versions of WinPcap based on versions of libpcap before 0.8.


================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/[email protected]/

To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to