I.MX6 Android iperf3 porting failed
/*****************************************************************************
* I.MX6 Android iperf3 porting failed
* 说明:
* 本来想移植一下iperf3到Android系统上测试一下网卡,可能是版本高了点,最后
* 运行客户端的时候会报错,也找了一些解决办法,但还是未能解决。
*
* 2016-4-5 深圳 南山平山村 曾剑锋
****************************************************************************/ 一、参考文档:
. sys/fcntl.h : no such file while cross compiling pcsclite for Android?
http://stackoverflow.com/questions/12384353/sys-fcntl-h-no-such-file-while-cross-compiling-pcsclite-for-android
. Iperf for Android-4.1 移植
http://blog.chinaunix.net/uid-24410388-id-3669153.html
. unable to create a new stream: No such file or directory
https://github.com/esnet/iperf/issues/374
. How to compile iperf3 for Windows
http://www.embeddedsystemtesting.com/2014/08/how-to-compile-iperf3-for-windows.html 二、download:
url: https://github.com/esnet/iperf 三、解决缺少头文件的问题:
由于直接编译Android shell程序的时候会出现缺少.h文件,于是先执行下面这行代码,貌似可以解决头文件的问题:
./configure --host=arm-none-linux-gnueabi CXX=arm-none-linux-gnueabi-g++ CXXFLAGS=-static CC=arm-none-linux-gnueabi-gcc CFLAGS=-static 四、get .c file
zengjf@zengjf:~/ipref/iperf-master/src$ ls -al *.c | awk '{print $9}' | sed -e "s/^/src\//" -e "s/$/\\\/"
src/cjson.c\
src/iperf_api.c\
src/iperf_client_api.c\
src/iperf_error.c\
src/iperf_locale.c\
src/iperf_sctp.c\
src/iperf_server_api.c\
src/iperf_tcp.c\
src/iperf_udp.c\
src/iperf_util.c\
src/main.c\
src/net.c\
src/tcp_info.c\
src/tcp_window_size.c\
src/timer.c\
src/t_timer.c\
src/t_units.c\
src/t_uuid.c\
src/units.c\
zengjf@zengjf:~/ipref/iperf-master/src$ 五、compile for Android:
cat Android.mk
# external/i2c-tools/Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) LOCAL_SRC_FILES += \
src/cjson.c\
src/iperf_api.c\
src/iperf_client_api.c\
src/iperf_error.c\
src/iperf_locale.c\
src/iperf_sctp.c\
src/iperf_server_api.c\
src/iperf_tcp.c\
src/iperf_udp.c\
src/iperf_util.c\
src/main.c\
src/net.c\
src/tcp_info.c\
src/tcp_window_size.c\
src/timer.c\
src/units.c\
#src/t_timer.c\ # 这里有main函数,需要另外写可执行脚本
#src/t_units.c\ # 这里有main函数,需要另外写可执行脚本
#src/t_uuid.c\ # 这里有main函数,需要另外写可执行脚本 LOCAL_C_INCLUDES += \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/src LOCAL_CFLAGS += -O2
LOCAL_CFLAGS += -DHAVE_CONFIG_H LOCAL_LDLIBS += -lpthread LOCAL_SHARED_LIBRARIES := libc libm libcutils libnetutils LOCAL_MODULE := iperf #LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
#LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
#LOCAL_MODULE_TAGS := eng user include $(BUILD_EXECUTABLE) 六、编译结果:
......
target thumb C: iperf <= /home/zengjf/c_program/ipref/iperf-master/src/cjson.c
target Executable: iperf (out/target/product/sabresd_6dq/obj/EXECUTABLES/iperf_intermediates/LINKED/iperf)
target Symbolic: iperf (out/target/product/sabresd_6dq/symbols/system/xbin/iperf)
target Strip: iperf (out/target/product/sabresd_6dq/obj/EXECUTABLES/iperf_intermediates/iperf)
Install: out/target/product/sabresd_6dq/system/xbin/iperf
make: Leaving directory `/home/zengjf/myandroid'
zengjf@zengjf:~/myandroid$ 七、执行效果:
. root@android:/data/local # ./iperf
iperf3: parameter error - must either be a client (-c) or server (-s) Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version] Server or Client:
-p, --port # server port to listen on/connect to
-f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-F, --file name xmit/recv the specified file
-A, --affinity n/n,m set CPU affinity
-B, --bind <host> bind to a specific interface
-V, --verbose more detailed output
-J, --json output in JSON format
--logfile f send output to a log file
--forceflush force flushing output at every interval
-d, --debug emit debugging output
-v, --version show version information and quit
-h, --help show this message and quit
Server specific:
-s, --server run in server mode
-D, --daemon run the server as a daemon
-I, --pidfile file write PID file
-, --one-off handle one client connection then exit
Client specific:
-c, --client <host> run in client mode, connecting to <host>
-u, --udp use UDP rather than TCP
-b, --bandwidth #[KMG][/#] target bandwidth in bits/sec ( for unlimited)
(default Mbit/sec for UDP, unlimited for TCP)
(optional slash and packet count for burst mode)
-t, --time # time in seconds to transmit for (default secs)
-n, --bytes #[KMG] number of bytes to transmit (instead of -t)
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
-l, --len #[KMG] length of buffer to read or write
(default KB for TCP, KB for UDP)
--cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)
-w, --window #[KMG] set window size / socket buffer size
-C, --congestion <algo> set TCP congestion control algorithm (Linux and FreeBSD only)
-M, --set-mss # set TCP/SCTP maximum segment size (MTU - bytes)
-N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
-, --version4 only use IPv4
-, --version6 only use IPv6
-S, --tos N set the IP 'type of service'
-L, --flowlabel N set the IPv6 flow label (only supported on Linux)
-Z, --zerocopy use a 'zero copy' method of sending data
-O, --omit N omit the first n seconds
-T, --title str prefix every output line with this string
--get-server-output get results from server
--udp-counters-64bit use -bit counters in UDP test packets [KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga- iperf3 homepage at: http://software.es.net/iperf/
Report bugs to: https://github.com/esnet/iperf
|root@android:/data/local #
. root@android:/data/local # ./iperf -s &
[]
-----------------------------------------------------------
Server listening on
-----------------------------------------------------------
root@android:/data/local #
. root@android:/data/local # ./iperf -c 127.0.0.1 -i -w 1M
Connecting to host 127.0.0.1, port
iperf3: error - unable to create a new stream: No such file or directory
Accepted connection from 127.0.0.1, port
iperf3: the client has unexpectedly closed the connection
-----------------------------------------------------------
Server listening on
-----------------------------------------------------------
|root@android:/data/local #
. 最后这部分出现的问题,没找到解决办法,虽然参考文章里面有人说能解决,但我自己尝试那么做了,未解决。
I.MX6 Android iperf3 porting failed的更多相关文章
- I.MX6 Android i2c-tools porting
/************************************************************************** * I.MX6 Android i2c-tool ...
- I.MX6 Android U-blox miniPCI 4G porting
/************************************************************************** * I.MX6 Android U-blox m ...
- I.MX6 Ethernet UI patch failed
/*********************************************************************** * I.MX6 Ethernet UI patch f ...
- I.MX6 Android netperf
/***************************************************************************** * I.MX6 Android netpe ...
- I.MX6 bq27441 driver porting
/************************************************************************** * I.MX6 bq27441 driver p ...
- I.MX6 Android frameworks services 文件架构
/******************************************************************************* * I.MX6 Android fra ...
- I.MX6 Android CAN 命令行测试
/********************************************************************* * I.MX6 Android CAN 命令行测试 * 说 ...
- I.MX6 Android can-utils 移植
/******************************************************************* * I.MX6 Android can-utils 移植 * ...
- I.MX6 android mkuserimg.sh
/************************************************************************** * I.MX6 android mkuserim ...
随机推荐
- Beaglebone Back学习五(PWM测试)
PWM测试 参考链接 1 Enable PWM on BeagleBone with Device Tree overlays 2Using PWM on the Beaglebone Black 3 ...
- CentOS 下 Codeblocks 的 安装 + 汉化 以及 基本使用介绍
Codeblocks 安装 注:在root用户下运行下列命令 1.安装gcc,需要c和c++两部分,默认安装下,CentOS不安装编译器的,在终端输入以下命令即可 yum install gcc yu ...
- Mysql 如何删除数据表中的重复数据!
1.使用distinct查询所有不重复的记录 2.创建数据表相同结构的临时表,将第一步的数据复制进去 create temporary table if not exists student_temp ...
- Ubuntu下Sublime Text 3无法输入中文的解决方案
1. 保存下面的代码到文件sublime_imfix.c中: /* * sublime-imfix.c * Use LD_PRELOAD to interpose some function to f ...
- php源代码安装常见错误与解决办法分享
错误:configure: error: libevent >= 1.4.11 could not be found 解决:yum -y install libevent libevent-de ...
- 【BZOJ 1951】 [Sdoi2010]古代猪文
Description “在那山的那边海的那边有一群小肥猪.他们活泼又聪明,他们调皮又灵敏.他们自由自在生活在那绿色的大草坪,他们善良勇敢相互都关心……” ——选自猪王国民歌 很久很久以前,在山的那边 ...
- javascript高级编程笔记04(基本概念)
Function类型 Es5中规范了另一个函数对象的属性:caller,这个属性中保存着调用当前函数的函数的引用,如果是在全局作用域中调用当前函数,这它的值为null function outer() ...
- TWaver3D入门探索——3D拓扑图之人在江湖
俗话说,有人的地方就有江湖,江湖就是帮派林立错综复杂的关系网.今天我们就来展示这样一个小小的江湖. 故事背景 崇祯末年,民不聊生,烽烟四起-- 江湖都是有背景的,我们的3D江湖也需要一个背景.江湖就是 ...
- Oracle数据库-建库、建表空间,建用户
Oracle安装完后,其中有一个缺省的数据库,除了这个缺省的数据库外,我们还可以创建自己的数据库. 对于初学者来说,为了避免麻烦,可以用'Database Configuration Assistan ...
- 【概率】COGS 1487:麻球繁衍
Description 万有引力定律: “使物体相互靠近的力的大小与物体的质量成正比——而物体的质量又由同一种力决定.这是一个有趣并且有益的例子,说明了科学是如何用A证明B,再用B证明A的.”——安布 ...