Re: [tcpdump-workers] Cannot find -lpcap when statically compiling a C project

2015-11-20 Thread liu wen
thank you very much! then how to compile the source codes to make a libpcap.a from the libpcap source codes? On Fri, Nov 20, 2015 at 6:58 PM, Guy Harris wrote: > > On Nov 20, 2015, at 12:32 AM, Jamie Bainbridge > wrote: > > > Fedora has glibc-static, but no libpcap-static. > > Then he'll have t

Re: [tcpdump-workers] Cannot find -lpcap when statically compiling a C project

2015-11-19 Thread liu wen
On Fri, Nov 20, 2015 at 12:52 AM, Guy Harris wrote: > > On Nov 19, 2015, at 3:29 PM, liu wen wrote: > > > I want to statically compile a C project in a laptop(fedora), using > command > > line like: > > > > gcc -o myprogram -static main.c ... -levent -lpcap &

[tcpdump-workers] Cannot find -lpcap when statically compiling a C project

2015-11-19 Thread liu wen
I want to statically compile a C project in a laptop(fedora), using command line like: gcc -o myprogram -static main.c ... -levent -lpcap but I get error: /usr/bin/ld: cannot find -lpcap /usr/bin/ld: cannot find -lc I tried to locate libpcap.a and find no such a file if I compile dynamically,

[tcpdump-workers] kernel/system add wrong MAC address when I use raw socket to send IP packets

2015-11-13 Thread liu wen
I have three laptops in a WLAN, A and C uses wlan0, but B is connected to wirelss router via cable and it uses eth0. I wrote a C program to do TCP hijacking experiment. And then modified it to C++ program. 1) A establishes a TCP connection with B 2) C runs the program and masquerade a

Re: [tcpdump-workers] why does pcap_dispatch return 0?

2015-10-14 Thread liu wen
e: > > On Oct 11, 2015, at 5:00 PM, liu wen wrote: > > > then I run the program on host A and send packets from host B, meanwhile > I > > use a tcpdump to capture packets on A (tcpdump -i eth0 port 8000 ) > > the tcpdump can capture the packet, but in the program,

Re: [tcpdump-workers] why does pcap_dispatch return 0?

2015-10-12 Thread liu wen
thank you! ubuntu: Linux 3.13.0-61-generic fedora: Linux 3.11.10-100-fc18.x86_64 On Tue, Oct 13, 2015 at 1:37 AM, Guy Harris wrote: > > On Oct 12, 2015, at 4:01 PM, liu wen wrote: > > > On Oct 12, 2015, at 1:53 PM, liu wen wrote: > > > >>> I tried the prog

[tcpdump-workers] Fwd: why does pcap_dispatch return 0?

2015-10-12 Thread liu wen
-- Forwarded message -- From: Guy Harris Date: Tue, Oct 13, 2015 at 12:17 AM Subject: Re: [tcpdump-workers] why does pcap_dispatch return 0? To: liu wen On Oct 12, 2015, at 1:53 PM, liu wen wrote: > I tried the program (compile and then run) on two laptops, one w

[tcpdump-workers] why does pcap_dispatch return 0?

2015-10-11 Thread liu wen
I'm using libpcap and libevent in a program. the related source codes are: const u_int16_t RELAY_PORT = 8000; pcap_t *create_pcap(const void *dev, pcap_sty