diff options
author | Roy Li <rongqing.li@windriver.com> | 2014-09-09 08:21:25 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2014-09-09 10:32:51 -0400 |
commit | 28e26a9b0ad37d0c92ba42b2727215eef1edf5a2 (patch) | |
tree | 392cf25c04376b9ed9a2184308dd59976490d9df /meta-networking/recipes-support/tcpdump | |
parent | d6929e301945c2d2cbff7b4f20cd4a1c394abf2d (diff) | |
download | meta-openembedded-28e26a9b0ad37d0c92ba42b2727215eef1edf5a2.tar.gz |
tcpslice: add recipe under tcpdump
tcpslice is a tool for extracting parts of a tcpdump packet trace,
so put it under tcpdump dir
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support/tcpdump')
3 files changed, 125 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch new file mode 100644 index 000000000..386b7f83a --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] | ||
2 | |||
3 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
4 | |||
5 | --- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200 | ||
6 | +++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200 | ||
7 | @@ -53,7 +53,7 @@ | ||
8 | /* Size of a packet header in bytes; easier than typing the sizeof() all | ||
9 | * the time ... | ||
10 | */ | ||
11 | -#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr )) | ||
12 | +#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr )) | ||
13 | |||
14 | extern int snaplen; | ||
15 | |||
16 | @@ -111,16 +111,24 @@ | ||
17 | static void | ||
18 | extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr ) | ||
19 | { | ||
20 | - memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr)); | ||
21 | + struct pcap_sf_pkthdr hdri; | ||
22 | + | ||
23 | + memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr)); | ||
24 | |||
25 | if ( pcap_is_swapped( p ) ) | ||
26 | { | ||
27 | - hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec); | ||
28 | - hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec); | ||
29 | - hdr->len = SWAPLONG(hdr->len); | ||
30 | - hdr->caplen = SWAPLONG(hdr->caplen); | ||
31 | + hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec); | ||
32 | + hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec); | ||
33 | + hdr->len = SWAPLONG(hdri.len); | ||
34 | + hdr->caplen = SWAPLONG(hdri.caplen); | ||
35 | + } | ||
36 | + else | ||
37 | + { | ||
38 | + hdr->ts.tv_sec = hdri.ts.tv_sec; | ||
39 | + hdr->ts.tv_usec = hdri.ts.tv_usec; | ||
40 | + hdr->len = hdri.len; | ||
41 | + hdr->caplen = hdri.caplen; | ||
42 | } | ||
43 | - | ||
44 | /* | ||
45 | * From bpf/libpcap/savefile.c: | ||
46 | * | ||
47 | --- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100 | ||
48 | +++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200 | ||
49 | @@ -20,6 +20,26 @@ | ||
50 | */ | ||
51 | |||
52 | |||
53 | +#include <time.h> | ||
54 | +/* #include <net/bpf.h> */ | ||
55 | + | ||
56 | +/* | ||
57 | + * This is a timeval as stored in disk in a dumpfile. | ||
58 | + * It has to use the same types everywhere, independent of the actual | ||
59 | + * `struct timeval' | ||
60 | + */ | ||
61 | + | ||
62 | +struct pcap_timeval { | ||
63 | + bpf_int32 tv_sec; /* seconds */ | ||
64 | + bpf_int32 tv_usec; /* microseconds */ | ||
65 | +}; | ||
66 | + | ||
67 | +struct pcap_sf_pkthdr { | ||
68 | + struct pcap_timeval ts; /* time stamp */ | ||
69 | + bpf_u_int32 caplen; /* length of portion present */ | ||
70 | + bpf_u_int32 len; /* length this packet (off wire) */ | ||
71 | +}; | ||
72 | + | ||
73 | time_t gwtm2secs( struct tm *tm ); | ||
74 | |||
75 | int sf_find_end( struct pcap *p, struct timeval *first_timestamp, | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch new file mode 100644 index 000000000..0a7359311 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] | ||
2 | |||
3 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
4 | diff -ur tcpdump-3.8.1/tcpslice/tcpslice.c tcpdump-3.8.1.new/tcpslice/tcpslice.c | ||
5 | --- tcpslice/tcpslice.c 2004-01-15 17:35:53.000000000 +0100 | ||
6 | +++ tcpslice/tcpslice.c 2004-01-15 16:12:57.000000000 +0100 | ||
7 | @@ -35,7 +35,7 @@ | ||
8 | #include <sys/file.h> | ||
9 | #include <sys/stat.h> | ||
10 | |||
11 | -#include <net/bpf.h> | ||
12 | +/* #include <net/bpf.h> */ | ||
13 | |||
14 | #include <ctype.h> | ||
15 | #ifdef HAVE_FCNTL_H | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb b/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb new file mode 100644 index 000000000..203d143b5 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "tcpslice" | ||
2 | DESCRIPTION = "A tool for extracting parts of a tcpdump packet trace." | ||
3 | HOMEPAGE = "http://www.tcpdump.org/related.html" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | LICENSE = "BSD-4-Clause" | ||
7 | LIC_FILES_CHKSUM = "file://tcpslice.c;endline=20;md5=99519e2e5234d1662a4ce16baa62c64e" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.ee.lbl.gov/${BP}.tar.gz \ | ||
10 | file://tcpslice-1.2a3-time.patch \ | ||
11 | file://tcpslice-CVS.20010207-bpf.patch \ | ||
12 | " | ||
13 | SRC_URI[md5sum] = "e329cbeb7e589f132d92c3447c477190" | ||
14 | SRC_URI[sha256sum] = "4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840" | ||
15 | |||
16 | inherit autotools-brokensep | ||
17 | |||
18 | DEPENDS += "libpcap" | ||
19 | |||
20 | # We do not want to autoreconf. We must specify srcdir as ".". | ||
21 | # We have to set the ac_cv_* cache variables as well as pass the normal | ||
22 | # cross-compilation options to configure! | ||
23 | # | ||
24 | do_configure () { | ||
25 | oe_runconf \ | ||
26 | --srcdir="." \ | ||
27 | ac_cv_build=${BUILD_SYS} \ | ||
28 | ac_cv_host=${HOST_SYS} \ | ||
29 | ac_cv_target=${HOST_SYS} | ||
30 | } | ||
31 | |||
32 | do_install_prepend () { | ||
33 | mkdir -p ${D}/usr/sbin | ||
34 | } | ||
35 | |||