Chinaunix首页 | 论坛 | 博客
  • 博客访问: 534782
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: LINUX

2012-09-10 15:49:10

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)
阅读(4494) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~