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

Wireshark-dev: Re: [Wireshark-dev] request help for packet capture using libpcap

From: "Gianluca Varenni" <gianluca.varenni@xxxxxxxxxxxx>
Date: Tue, 6 May 2008 09:01:46 -0700
that's because you are not calling the pcap_dumper function from within the pcap_loop callback.
your "my_callback" function simply prints out "Welcome".
 
Even if you are running on *nix, I suggest you to have a look at the samples included in the WinPcap developer's pack (examples-pcap folder).
 
Have a nice day
GV
 
----- Original Message -----
Sent: Tuesday, May 06, 2008 4:10 AM
Subject: [Wireshark-dev] request help for packet capture using libpcap

Hello ,
 
I have been trying to write a small application using libpcap library.
Purpose is to capture some live network packets(say 100 packets) and store them in a file (pcap_savefile).
 
Please refer the attachment for the code.
 
As per my understanding the pcap_savefile should be in "pcap" format as this is the default file format for libpacp.
But when I pass this file to wireshark, it does not show any packet data.
Also the size of the pcap_savefile is just around 24 bytes for 100 packets.
So I was wondering whether the programm is actually capturing any network packet.
 
Could anyone please suggest how I can improve the programe and store the data in pcap format.
 
Thanks in advance.
 
Regards,
Atdev 

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev