diff options
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-support/tcpdump')
7 files changed, 252 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch new file mode 100644 index 000000000..b71435a04 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch @@ -0,0 +1,36 @@ +From 8ee1ab1ac89557d48ac1ab7ddcc3c51be9b734ad Mon Sep 17 00:00:00 2001 +From: "Hongjun.Yang" <hongjun.yang@windriver.com> +Date: Wed, 22 Oct 2014 10:02:48 +0800 +Subject: [PATCH] Add ptest for tcpdump + +Upstream-Status: Pending + +Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com> + +--- + Makefile.in | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 0941f0e..3ce40c6 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -437,9 +437,17 @@ distclean: + tests/failure-outputs.txt + rm -rf autom4te.cache tests/DIFF tests/NEW + +-check: tcpdump ++buildtest-TESTS: tcpdump ++ ++runtest-PTEST: + (cd tests && ./TESTrun.sh) + ++install-ptest: ++ cp -r tests $(DESTDIR) ++ cp -r config.h $(DESTDIR) ++ install -m 0755 Makefile $(DESTDIR) ++ ln -sf /usr/sbin/tcpdump $(DESTDIR)/tcpdump ++ + extags: $(TAGFILES) + ctags $(TAGFILES) + diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest new file mode 100755 index 000000000..c03a8b8ef --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest @@ -0,0 +1,5 @@ +#!/bin/sh +make -k runtest-PTEST | sed -e '/: passed/ s/^/PASS: /g' \ + -e '/: failed/ s/^/FAIL: /g' \ + -e 's/: passed//g' \ + -e 's/: failed//g' diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch new file mode 100644 index 000000000..8cefadf28 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch @@ -0,0 +1,34 @@ +From 741d77e42fc4af49804f7ee43b7237e01633cbcd Mon Sep 17 00:00:00 2001 +From: Roy Li <rongqing.li@windriver.com> +Date: Tue, 8 Jul 2014 13:20:47 +0800 +Subject: [PATCH] unnecessary to check libpcap + +Upstream-Status: Pending + +since the check of libpcap did not consider the cross-compile, lead to the +below error: + This autoconf log indicates errors, it looked at host include and/or + library paths while determining system capabilities. + +In fact, the libpcap has been added into the tcpdump's DEPENDS, not need to +check if libpcap existed. + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +--- + configure.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.in b/configure.in +index b2305a5..b3b5dbf 100644 +--- a/configure.in ++++ b/configure.in +@@ -418,7 +418,7 @@ dnl Some platforms may need -lnsl for getrpcbynumber. + AC_SEARCH_LIBS(getrpcbynumber, nsl, + AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()])) + +-AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) ++#AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) + + # + # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb new file mode 100644 index 000000000..d38540e34 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb @@ -0,0 +1,51 @@ +SUMMARY = "A sophisticated network protocol analyzer" +HOMEPAGE = "http://www.tcpdump.org/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867" +SECTION = "net" +DEPENDS = "libpcap" + +SRC_URI = " \ + http://www.tcpdump.org/release/${BP}.tar.gz \ + file://unnecessary-to-check-libpcap.patch \ + file://add-ptest.patch \ + file://run-ptest \ +" + +SRC_URI[md5sum] = "9bbc1ee33dab61302411b02dd0515576" +SRC_URI[sha256sum] = "798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79" + +export LIBS=" -lpcap" + +inherit autotools-brokensep ptest +CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}" + +PACKAGECONFIG ??= "openssl" +PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl" +PACKAGECONFIG[smi] = "--with-smi, --without-smi,libsmi" +PACKAGECONFIG[libcap-ng] = "--with-cap-ng=yes,--with-cap-ng=no,libcap-ng" + +EXTRA_AUTORECONF += " -I m4" + +do_configure_prepend() { + mkdir -p ${S}/m4 + if [ -f aclocal.m4 ]; then + mv aclocal.m4 ${S}/m4 + fi + # AC_CHECK_LIB(dlpi.. was looking to host /lib + sed -i 's:-L/lib::g' ./configure.in +} +do_configure_append() { + sed -i 's:-L/usr/lib::' ./Makefile + sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile + sed -i 's:-I/usr/include::' ./Makefile +} + +do_install_append() { + # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0 + rm -f ${D}${sbindir}/tcpdump.${PV} +} + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch new file mode 100644 index 000000000..386b7f83a --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch @@ -0,0 +1,75 @@ +Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +--- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200 ++++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200 +@@ -53,7 +53,7 @@ + /* Size of a packet header in bytes; easier than typing the sizeof() all + * the time ... + */ +-#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr )) ++#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr )) + + extern int snaplen; + +@@ -111,16 +111,24 @@ + static void + extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr ) + { +- memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr)); ++ struct pcap_sf_pkthdr hdri; ++ ++ memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr)); + + if ( pcap_is_swapped( p ) ) + { +- hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec); +- hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec); +- hdr->len = SWAPLONG(hdr->len); +- hdr->caplen = SWAPLONG(hdr->caplen); ++ hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec); ++ hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec); ++ hdr->len = SWAPLONG(hdri.len); ++ hdr->caplen = SWAPLONG(hdri.caplen); ++ } ++ else ++ { ++ hdr->ts.tv_sec = hdri.ts.tv_sec; ++ hdr->ts.tv_usec = hdri.ts.tv_usec; ++ hdr->len = hdri.len; ++ hdr->caplen = hdri.caplen; + } +- + /* + * From bpf/libpcap/savefile.c: + * +--- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100 ++++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200 +@@ -20,6 +20,26 @@ + */ + + ++#include <time.h> ++/* #include <net/bpf.h> */ ++ ++/* ++ * This is a timeval as stored in disk in a dumpfile. ++ * It has to use the same types everywhere, independent of the actual ++ * `struct timeval' ++ */ ++ ++struct pcap_timeval { ++ bpf_int32 tv_sec; /* seconds */ ++ bpf_int32 tv_usec; /* microseconds */ ++}; ++ ++struct pcap_sf_pkthdr { ++ struct pcap_timeval ts; /* time stamp */ ++ bpf_u_int32 caplen; /* length of portion present */ ++ bpf_u_int32 len; /* length this packet (off wire) */ ++}; ++ + time_t gwtm2secs( struct tm *tm ); + + int sf_find_end( struct pcap *p, struct timeval *first_timestamp, diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch new file mode 100644 index 000000000..0a7359311 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch @@ -0,0 +1,15 @@ +Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +diff -ur tcpdump-3.8.1/tcpslice/tcpslice.c tcpdump-3.8.1.new/tcpslice/tcpslice.c +--- tcpslice/tcpslice.c 2004-01-15 17:35:53.000000000 +0100 ++++ tcpslice/tcpslice.c 2004-01-15 16:12:57.000000000 +0100 +@@ -35,7 +35,7 @@ + #include <sys/file.h> + #include <sys/stat.h> + +-#include <net/bpf.h> ++/* #include <net/bpf.h> */ + + #include <ctype.h> + #ifdef HAVE_FCNTL_H diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb new file mode 100644 index 000000000..e65739a5c --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb @@ -0,0 +1,36 @@ +SUMMARY = "tcpslice" +DESCRIPTION = "A tool for extracting parts of a tcpdump packet trace." +HOMEPAGE = "http://www.tcpdump.org/related.html" +SECTION = "net" + +LICENSE = "BSD-4-Clause" +LIC_FILES_CHKSUM = "file://tcpslice.c;endline=20;md5=99519e2e5234d1662a4ce16baa62c64e" + +SRC_URI = "ftp://ftp.ee.lbl.gov/${BP}.tar.gz \ + file://tcpslice-1.2a3-time.patch \ + file://tcpslice-CVS.20010207-bpf.patch \ + " +SRC_URI[md5sum] = "e329cbeb7e589f132d92c3447c477190" +SRC_URI[sha256sum] = "4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840" + +inherit autotools-brokensep + +DEPENDS += "libpcap" + +# We do not want to autoreconf. We must specify srcdir as ".". +# We have to set the ac_cv_* cache variables as well as pass the normal +# cross-compilation options to configure! +# +do_configure () { + oe_runconf \ + --srcdir="." \ + ac_cv_build=${BUILD_SYS} \ + ac_cv_host=${HOST_SYS} \ + ac_cv_target=${HOST_SYS} +} + +do_install () { + mkdir -p ${D}/usr/sbin + install -c -m 555 tcpslice ${D}/usr/sbin +} + |