tcptrace交叉编译

    1. tcptrace交叉编译

tcptrace的官网是http://www.tcptrace.org/

可以直接从中下载源码,安装编译是比较方便的,这里主要是进行移植工作。

tcpreplay一样也需要有libpcap包。

执行configure,命令如下:

#./configure --host=arm-linux --target=arm-none-linux-gnueabi CC=arm-none-linux-gnueabi-gcc --with-libpcap=/usr/local/libpcap CFLAGS=-I/usr/local/libpcap/include  LDFLAGS="-static" --prefix=/arm-linux


出现:checking how to print unsigned long long... configure: error: can not run test program while cross compiling

答:找到configure文件中的中对应行,删除exit命令即可。

出现:tcptrace.h:217:29: error: 'struct tcphdr' has no member named 'th_off'

答:将Makefile中的如下两行做修改:

PCAP_INCS    = -I/usr/local/libpcap/include -I. -I../pcap

PCAP_LDFLAGS = -L/usr/local/libpcap/lib -Llib -Lpcap -L../pcap -L./cygwin-libs

Makefile中的CFLAGS中加入-D_BSD_SOURCE

出现:tcpdump.c:(.text+0x34): undefined reference to `pcap_offline_read'

答:使用libpcap1.7.4版本即可(问题在libpcap1.8.1版本上出现)。但是复制到android系统后还是提示同样的错误。无效,退回到libpcap1.8.1版本。

libpcap文件夹中的,pcap/pcap.h文件中,在400行左右加入如下,将该函数进行导出:

PCAP_API int    pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);

亦失败。换成libpcap0.9.8版本即可。

出现:configure: error: cannot determine linux version when cross-compiling

答在configure文件中,注释掉相关检测即可。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值