Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] wtap_dump_file_seek() and _tell()

From: Ed Beroset <beroset@xxxxxxxxxxxxxx>
Date: Sun, 03 Mar 2013 14:10:37 -0500
According to svn, version 36318 (March 2011) added, among other things, the following lines to the wiretap/wtap-int.h file:

extern gint64 wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err);
extern gint64 wtap_dump_file_tell(wtap_dumper *wdh);

However, unlike most of the corresponding functions which are implemented in wiretap/file_access.c these two have no implementations. In 18 places within the code involving seven files (5view.c, k12,c, lanalyzer.c, netmon.c, netscaler.c, netxray.c, visual.c) either an ftell or fseek is used which does an implicit conversion from WFILE_T to struct FILE * which is an incompatibility with C++. I could have added casts to each location, but it seems that the neater way to do this would be to actually implement these function. I understand that seek() and tell() won't work every time (e.g. pipes or stdin), but these places in the code are doing it anyway. How should we best resolve this? Should I implement the functions?

Ed