Hi all, I am currently researching on how Wiretap in Wireshark reads the files (eg. pcap). I have gone through the README and README.developer but both of them yields no result. The Wireshark and Ethereal Network Protocol Analyzer Toolkit ebook does not explicitly show which function is called. I have also gone through wtap.c, wtap.h and wtap.def but i still can't find my answer. Any help and guidance is appreciated Thanks Regards, Eddie Choo asked 26 Jul '11, 01:58 eddie choo edited 26 Jul '11, 01:58 |
One Answer:
Do not assume that any of these routines will remain unchanged in future Wireshark releases; if you write code that depends on them, it might have to be rewritten for a future release. answered 26 Jul '11, 19:20 Guy Harris ♦♦ |
Hi Mr Guy Harris, thanks for replying to my questions I have came across one of your mails, you have stated that winpcap/libpcap could also be used to read pcap files. May i know can i pass a file read by winpcap/libpcap directly into wireshark? or it needs to go through wiretap ? Thanks for your time
If a file can be read by libpcap/WinPcap, it's a pcap file - or, in newer versions of libpcap/WinPcap, a pcap file or a pcap-ng file - and thus can also be read by Wiretap. Wiretap is the library that Wireshark uses to read capture files, so any file that is "read ... into Wireshark" goes through Wiretap.
May i know what is your advice if i wanted to use functions to read pcap files? Would you recommend using the libpcap library or the wiretap library? The wiretap library might be more suitable since i will be working on telecommunication protocols but i couldn't find any tutorials out there. libpcap is relatively easier to find its tutorials but i remember you stated somewhere that libpcap is more suitable for TCP/IP. Thanks for your help
If you're only going to read pcap files - or, with newer versions of libpcap, pcap-ng files that have only one link-layer type - libpcap will work just fine. If you need to read other file types, you'll need wiretap.
That has nothing to do with telecommunication protocols vs. TCP/IP, except that some telecommunications protocols are not supported by pcap and pcap-ng - but some are, e.g. MTP2.
Thanks eddie choo & Guy Harris for your posts i got much information about wiretap and Actually i am trying to find the file that wiretap is using to read(which libpcap format packet finally dumped for wiretap) but didnt find it,can you guys help me to get me out.