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)
Guy Harris wrote:
The first of those behaviors are already implemented with pcap_major_version() and pcap_minor_version(). Arguably, they should have better names, but, as they already exist, the names aren't going to change. I'm not sure the names are a compelling reason to add new functions.
I agree, they are two issues 1) have a good name for WinPcap APIs 2) add (or not) new APIs
1) have a good name for WinPcap APIs
For the first issue, I agree to keep pcap_major_version() and pcap_minor_version() for backward compatibility.
A simple
#define pcap_file_major_version(pcap_t) (pcap_major_version(pcap_t)) #define pcap_file_minor_version(pcap_t) (pcap_minor_version(pcap_t))
in pcap.h isn't so hard... and I think it is very useful to avoid misunderstandings
(and write in the docs "deprecated" for the old two APIs).
Guy Harris wrote:
Note that, in the future, libpcap might write more than one file format...
In that case, I'm not sure what functions that return the major and minor version number that would be used when writing a file would return - the version numbers of the new format, or the version numbers of the old format?
For what purpose do you need the version of the file that would be written?
2) add (or not) new APIs
I feel it is useful.
For the new API pcap_file_version_library(void) I suggest to return the header version used by libpcap to create a new file.
ciao, Massimo
================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/[email protected]/
To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================
