aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/m4/odp_pcap.m4
diff options
context:
space:
mode:
authorStuart Haslam <stuart.haslam@linaro.org>2015-10-14 13:06:27 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-10-20 19:06:20 +0300
commit2f677e99f4a75663ffc1a7626584156f10f90e44 (patch)
tree6affe3cef80ce3f4052c79306e90efd40c3da0e6 /platform/linux-generic/m4/odp_pcap.m4
parent6b1de1d617cc202a0c473e4043a6063f2f76b9e3 (diff)
linux-generic: pktio: add pcap pktio type
Create a new pktio type that allows for reading from and writing to a pcap capture file. This is intended to be used as a simple way of injecting test packets into an application for functional testing and can be used as it is with some of the existing example applications. To use this interface the name passed to odp_pktio_open() must begin with "pcap:" and be in the format; pcap:in=test.pcap:out=test_out.pcap:loops=10 in the name of the input pcap file. If no input file is given attempts to receive from the pktio will just return no packets. out the name of the output pcap file. If no output file is given any packets transmitted over the interface will just be freed. loops the number of times to iterate through the input file, set to 0 to loop indefinitely. The default value is 1. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/m4/odp_pcap.m4')
-rw-r--r--platform/linux-generic/m4/odp_pcap.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/linux-generic/m4/odp_pcap.m4 b/platform/linux-generic/m4/odp_pcap.m4
new file mode 100644
index 000000000..734b79005
--- /dev/null
+++ b/platform/linux-generic/m4/odp_pcap.m4
@@ -0,0 +1,15 @@
+#########################################################################
+# Check for libpcap availability
+#########################################################################
+have_pcap=no
+AC_CHECK_HEADER(pcap/pcap.h,
+ [AC_CHECK_HEADER(pcap/bpf.h,
+ [AC_CHECK_LIB(pcap, pcap_open_offline, have_pcap=yes, [])],
+ [])],
+[])
+
+AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
+if test $have_pcap == yes; then
+ AM_CFLAGS="$AM_CFLAGS -DHAVE_PCAP"
+ LIBS="$LIBS -lpcap"
+fi