wget -c
wget -c
mkdir /tmp/pcap /tmp/tcpdump
tar xzf libpcap-1.3.0.tar.gz
tar xzf tcpdump-4.3.0.tar.gz
cd libpcap-1.3.0
rm config.cache -rf;CC=arm-linux-gcc;./configure --host=arm-linux --with-pcap=linux --prefix=/tmp/pcap
(IF set --with-pcap=null will always get "live packet capture not supported on this system" Error, shooooot)
make clean
make
make install
ls /tmp/pcap/???
/tmp/pcap/bin:
pcap-config
/tmp/pcap/lib:
libpcap.a libpcap.so libpcap.so.1 libpcap.so.1.3.0
cd tcpdump-4.3.0
rm config.cache -rf;CC=arm-linux-gcc;./configure --prefix=/tmp/tcpdump/ --build=i686 --host=arm --with-pcap=linux CC=arm-linux-gcc
make clean
make
arm-linux-gcc -O2 -DHAVE_CONFIG_H -I./missing -D_U_="__attribute__((unused))" -I. -I./../libpcap-1.3.0 -I/usr/include -I./missing -g -O2 -c ./addrtoname.c
In file included from /usr/include/sys/socket.h:40,
from /usr/include/netinet/in.h:25,
from /usr/include/netdb.h:28,
from ./tcpdump-stdinc.h:109,
from ./addrtoname.c:33:
/usr/include/bits/socket.h:427: warning: ‘struct mmsghdr’ declared inside parameter list
/usr/include/bits/socket.h:427: warning: its scope is only this definition or declaration, which is probably not what you want
./addrtoname.c: In function ‘ipxsap_string’:
./addrtoname.c:710: error: invalid 'asm': invalid operand for code 'w'
make: *** [addrtoname.o] Error 1
cp -a Makefile Makefile.old.std
vi Makefile
...
...
...
diff Makefile Makefile.old.std
46c46
< INCLS = -I. -I./../libpcap-1.3.0 -I/usr/include -I./missing
---
> INCLS = -I. -I./../libpcap-1.3.0 -I$(prefix)/include -I./missing
make clean
make
make install
ls /tmp/tcpdump/ -R
/tmp/tcpdump/:
sbin share
/tmp/tcpdump/sbin:
tcpdump tcpdump.4.3.0
/tmp/tcpdump/share:
man
/tmp/tcpdump/share/man:
man1
/tmp/tcpdump/share/man/man1:
tcpdump.1
Then copy tcpdump to your board and execute as `./tcpdump -i eth0`
REFERENCE
http://owen-hsu.blogspot.fr/2011/03/embedded-porting-tcpdump-to-arm-emedded.html (Need VPN 4 GFW)
阅读(4593) | 评论(0) | 转发(0) |