1. /*****************************************************************************
  2. * I.MX6 Android iperf3 porting failed
  3. * 说明:
  4. * 本来想移植一下iperf3到Android系统上测试一下网卡,可能是版本高了点,最后
  5. * 运行客户端的时候会报错,也找了一些解决办法,但还是未能解决。
  6. *
  7. * 2016-4-5 深圳 南山平山村 曾剑锋
  8. ****************************************************************************/
  9.  
  10. 一、参考文档:
  11. . sys/fcntl.h : no such file while cross compiling pcsclite for Android?
  12. http://stackoverflow.com/questions/12384353/sys-fcntl-h-no-such-file-while-cross-compiling-pcsclite-for-android
  13. . Iperf for Android-4.1 移植
  14. http://blog.chinaunix.net/uid-24410388-id-3669153.html
  15. . unable to create a new stream: No such file or directory
  16. https://github.com/esnet/iperf/issues/374
  17. . How to compile iperf3 for Windows
  18. http://www.embeddedsystemtesting.com/2014/08/how-to-compile-iperf3-for-windows.html
  19.  
  20. 二、download:
  21. url: https://github.com/esnet/iperf
  22.  
  23. 三、解决缺少头文件的问题:
  24. 由于直接编译Android shell程序的时候会出现缺少.h文件,于是先执行下面这行代码,貌似可以解决头文件的问题:
  25. ./configure --host=arm-none-linux-gnueabi CXX=arm-none-linux-gnueabi-g++ CXXFLAGS=-static CC=arm-none-linux-gnueabi-gcc CFLAGS=-static
  26.  
  27. 四、get .c file
  28. zengjf@zengjf:~/ipref/iperf-master/src$ ls -al *.c | awk '{print $9}' | sed -e "s/^/src\//" -e "s/$/\\\/"
  29. src/cjson.c\
  30. src/iperf_api.c\
  31. src/iperf_client_api.c\
  32. src/iperf_error.c\
  33. src/iperf_locale.c\
  34. src/iperf_sctp.c\
  35. src/iperf_server_api.c\
  36. src/iperf_tcp.c\
  37. src/iperf_udp.c\
  38. src/iperf_util.c\
  39. src/main.c\
  40. src/net.c\
  41. src/tcp_info.c\
  42. src/tcp_window_size.c\
  43. src/timer.c\
  44. src/t_timer.c\
  45. src/t_units.c\
  46. src/t_uuid.c\
  47. src/units.c\
  48. zengjf@zengjf:~/ipref/iperf-master/src$
  49.  
  50. 五、compile for Android:
  51. cat Android.mk
  52. # external/i2c-tools/Android.mk
  53. LOCAL_PATH:= $(call my-dir)
  54. include $(CLEAR_VARS)
  55.  
  56. LOCAL_SRC_FILES += \
  57. src/cjson.c\
  58. src/iperf_api.c\
  59. src/iperf_client_api.c\
  60. src/iperf_error.c\
  61. src/iperf_locale.c\
  62. src/iperf_sctp.c\
  63. src/iperf_server_api.c\
  64. src/iperf_tcp.c\
  65. src/iperf_udp.c\
  66. src/iperf_util.c\
  67. src/main.c\
  68. src/net.c\
  69. src/tcp_info.c\
  70. src/tcp_window_size.c\
  71. src/timer.c\
  72. src/units.c\
  73. #src/t_timer.c\ # 这里有main函数,需要另外写可执行脚本
  74. #src/t_units.c\ # 这里有main函数,需要另外写可执行脚本
  75. #src/t_uuid.c\ # 这里有main函数,需要另外写可执行脚本
  76.  
  77. LOCAL_C_INCLUDES += \
  78. $(LOCAL_PATH) \
  79. $(LOCAL_PATH)/include \
  80. $(LOCAL_PATH)/src
  81.  
  82. LOCAL_CFLAGS += -O2
  83. LOCAL_CFLAGS += -DHAVE_CONFIG_H
  84.  
  85. LOCAL_LDLIBS += -lpthread
  86.  
  87. LOCAL_SHARED_LIBRARIES := libc libm libcutils libnetutils
  88.  
  89. LOCAL_MODULE := iperf
  90.  
  91. #LOCAL_FORCE_STATIC_EXECUTABLE := true
  92. LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
  93. #LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
  94. #LOCAL_MODULE_TAGS := eng user
  95.  
  96. include $(BUILD_EXECUTABLE)
  97.  
  98. 六、编译结果:
  99. ......
  100. target thumb C: iperf <= /home/zengjf/c_program/ipref/iperf-master/src/cjson.c
  101. target Executable: iperf (out/target/product/sabresd_6dq/obj/EXECUTABLES/iperf_intermediates/LINKED/iperf)
  102. target Symbolic: iperf (out/target/product/sabresd_6dq/symbols/system/xbin/iperf)
  103. target Strip: iperf (out/target/product/sabresd_6dq/obj/EXECUTABLES/iperf_intermediates/iperf)
  104. Install: out/target/product/sabresd_6dq/system/xbin/iperf
  105. make: Leaving directory `/home/zengjf/myandroid'
  106. zengjf@zengjf:~/myandroid$
  107.  
  108. 七、执行效果:
  109. . root@android:/data/local # ./iperf
  110. iperf3: parameter error - must either be a client (-c) or server (-s)
  111.  
  112. Usage: iperf [-s|-c host] [options]
  113. iperf [-h|--help] [-v|--version]
  114.  
  115. Server or Client:
  116. -p, --port # server port to listen on/connect to
  117. -f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes
  118. -i, --interval # seconds between periodic bandwidth reports
  119. -F, --file name xmit/recv the specified file
  120. -A, --affinity n/n,m set CPU affinity
  121. -B, --bind <host> bind to a specific interface
  122. -V, --verbose more detailed output
  123. -J, --json output in JSON format
  124. --logfile f send output to a log file
  125. --forceflush force flushing output at every interval
  126. -d, --debug emit debugging output
  127. -v, --version show version information and quit
  128. -h, --help show this message and quit
  129. Server specific:
  130. -s, --server run in server mode
  131. -D, --daemon run the server as a daemon
  132. -I, --pidfile file write PID file
  133. -, --one-off handle one client connection then exit
  134. Client specific:
  135. -c, --client <host> run in client mode, connecting to <host>
  136. -u, --udp use UDP rather than TCP
  137. -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec ( for unlimited)
  138. (default Mbit/sec for UDP, unlimited for TCP)
  139. (optional slash and packet count for burst mode)
  140. -t, --time # time in seconds to transmit for (default secs)
  141. -n, --bytes #[KMG] number of bytes to transmit (instead of -t)
  142. -k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
  143. -l, --len #[KMG] length of buffer to read or write
  144. (default KB for TCP, KB for UDP)
  145. --cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port)
  146. -P, --parallel # number of parallel client streams to run
  147. -R, --reverse run in reverse mode (server sends, client receives)
  148. -w, --window #[KMG] set window size / socket buffer size
  149. -C, --congestion <algo> set TCP congestion control algorithm (Linux and FreeBSD only)
  150. -M, --set-mss # set TCP/SCTP maximum segment size (MTU - bytes)
  151. -N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
  152. -, --version4 only use IPv4
  153. -, --version6 only use IPv6
  154. -S, --tos N set the IP 'type of service'
  155. -L, --flowlabel N set the IPv6 flow label (only supported on Linux)
  156. -Z, --zerocopy use a 'zero copy' method of sending data
  157. -O, --omit N omit the first n seconds
  158. -T, --title str prefix every output line with this string
  159. --get-server-output get results from server
  160. --udp-counters-64bit use -bit counters in UDP test packets
  161.  
  162. [KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-
  163.  
  164. iperf3 homepage at: http://software.es.net/iperf/
  165. Report bugs to: https://github.com/esnet/iperf
  166. |root@android:/data/local #
  167. . root@android:/data/local # ./iperf -s &
  168. []
  169. -----------------------------------------------------------
  170. Server listening on
  171. -----------------------------------------------------------
  172. root@android:/data/local #
  173. . root@android:/data/local # ./iperf -c 127.0.0.1 -i -w 1M
  174. Connecting to host 127.0.0.1, port
  175. iperf3: error - unable to create a new stream: No such file or directory
  176. Accepted connection from 127.0.0.1, port
  177. iperf3: the client has unexpectedly closed the connection
  178. -----------------------------------------------------------
  179. Server listening on
  180. -----------------------------------------------------------
  181. |root@android:/data/local #
  182. . 最后这部分出现的问题,没找到解决办法,虽然参考文章里面有人说能解决,但我自己尝试那么做了,未解决。

I.MX6 Android iperf3 porting failed的更多相关文章

  1. I.MX6 Android i2c-tools porting

    /************************************************************************** * I.MX6 Android i2c-tool ...

  2. I.MX6 Android U-blox miniPCI 4G porting

    /************************************************************************** * I.MX6 Android U-blox m ...

  3. I.MX6 Ethernet UI patch failed

    /*********************************************************************** * I.MX6 Ethernet UI patch f ...

  4. I.MX6 Android netperf

    /***************************************************************************** * I.MX6 Android netpe ...

  5. I.MX6 bq27441 driver porting

    /************************************************************************** * I.MX6 bq27441 driver p ...

  6. I.MX6 Android frameworks services 文件架构

    /******************************************************************************* * I.MX6 Android fra ...

  7. I.MX6 Android CAN 命令行测试

    /********************************************************************* * I.MX6 Android CAN 命令行测试 * 说 ...

  8. I.MX6 Android can-utils 移植

    /******************************************************************* * I.MX6 Android can-utils 移植 * ...

  9. I.MX6 android mkuserimg.sh

    /************************************************************************** * I.MX6 android mkuserim ...

随机推荐

  1. DOM基础总结

    一.简介 1.什么是DOM 文档对象模型(Document Object Model,DOM)是一种用于HTML和XML文档的编程接口.它给文档提供了一种结构化的表示方法,可以改变文档的内容和呈现方式 ...

  2. 【BZOJ 1798】 [Ahoi2009]Seq 维护序列seq

    Description 老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成. 有长为N的数列,不妨设为a1,a2,…,aN .有如下三种操作形式: (1)把数列中的一段数全部乘一个值; (2 ...

  3. 1061: [Noi2008]志愿者招募 - BZOJ

    Description 申奥成功后,布布经过不懈努力,终于成为奥组委下属公司人力资源部门的主管.布布刚上任就遇到了一个难题:为即将启动的奥运新项目招募一批短期志愿者.经过估算,这个项目需要N 天才能完 ...

  4. AForm

    相信大部分程序员都接触过表单,表单是收集用户输入的不二之选,但是表单的开发又是最繁琐.最复杂的,简单地说,开发表单你需要涉及到很多知识: 布局,表单如何布局排版,看起来最清晰整洁,且符合用户体验 控件 ...

  5. [转载]深入理解ASP.NET MVC之ActionResult

    Action全局观 在上一篇最后,我们进行到了Action调用的“门口”: 1 if (!ActionInvoker.InvokeAction(ControllerContext, actionNam ...

  6. Windows下的Memcache安装与测试教程

    Windows下的Memcache安装 1.下载memcache for windows. 下载地址:http://splinedancer.com/memcached-win32/,推荐下载bina ...

  7. Spring MVC Checkbox And Checkboxes Example

    In Spring MVC, <form:checkbox /> is used to render a HTML checkbox field, the checkbox values ...

  8. 1988-B. 有序集合

    描述 在C++里,有一个神奇的东西,叫做STL,这里提供了很多简单好用的容器,用来实现常用又很难书写的数据结构,如栈(stack)等.其中,有一个容器叫set,译作“有序集合”.首先,这是一个集合,所 ...

  9. C#字符串的常用操作

    一.string关键字与StringBuilder类 C# 字符串是使用 string 关键字声明的一个字符数组.字符串是使用引号声明的,如下例所示: string s = "Hello, ...

  10. OWASP-ZAP

    Zed Attack Proxy简写为ZAP,是一个简单易用的渗透测试工具,是发现Web应用中的漏洞的利器,更是渗透测试爱好者的好东西. ZAP下载地址:https://www.owasp.org/i ...