tcpdump mailing list archives

Re: Libpcap


From: "Gianluca Varenni" <gianluca.varenni () cacetech com>
Date: Thu, 16 Jul 2009 12:02:43 -0700

What do you mean by "it doesn't work correctly"?

1. compilation problems?
2. linking problems?
3. the application runs but fails to list the adapters?
4. the application runs, you can open the adapter but you dont capture any packet?
5. the application runs and captures but it eventually crashes?

GV

----- Original Message ----- From: "Chris Davies" <cjd () slowglass com>
To: <tcpdump-workers () lists tcpdump org>
Sent: Thursday, July 16, 2009 3:13 AM
Subject: [tcpdump-workers] Libpcap


Trying to get libpacp to work in 32 bit mode on 64 bit machines.



I have a program that uses libpcap to snoop on packets for the purposes of
monitoring.

It works very well when compiled on a 32 bit Linux machine and run on a 32
bit Linux and when 64 bit Linux machine and run on a 64 bit Linux.

However it does not work correctly if I run the 32bit binary on a 64 bit
Linux box. Is there something special I should be doing.



A simplified segment of my start code is

   pcap_t* handle = pcap_open_live(dev, BUFSIZ, 1, 1000, errbuf);

   pcap_set_buffer_size(handle,bufSize);

  pcap_compile(handle, &fp, "src port 80",1, net);

  pcap_setfilter(handle, &fp);

  pcap_loop(handle, -1, got_packet, (u_char*)handle);



Is there anything special I should be doing to get it to work on 64 bit
platforms



Chris Davies

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: