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 ?


From: "Guy Harris" <[EMAIL PROTECTED]>

Yes.

The WinPcap documentation, and the documentation in older versions of libpcap 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.

If you want the version number of the *library*, then, if WinPcap 3.1b4 has "pcap_lib_version()"


Guy, thank to you for the explanation.

I am already using pcap_lib_version(), I understand it works fine.


About pcap_major_version() and pcap_minor_version():
- if they return the version of an existent dump file, I agree they need a previous call to pcap_open_offline() or pcap_open() to open the file and read its header


- if they return the current version of the file header, used by the library to create a new file, this information is inside the library, no need an open pcap_t handle


What do you think about this two different behaviours ?

And, more complex, if I call pcap_open_offline(), then I want to get the *current library* file header version ?

I think it is better not to overload the same function, but create two distinct APIs:
pcap_file_version_library(void)
pcap_file_version_file(pcap_t session_handle)



Just my two cents (yes, with Euro we have cents too...)

ciao, Massimo



==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

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

Reply via email to