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/tcpslice | |
parent | d6929e301945c2d2cbff7b4f20cd4a1c394abf2d (diff) | |
download | meta-openembedded-contrib-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/tcpslice')
-rw-r--r-- | meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch | 75 | ||||
-rw-r--r-- | meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch | 15 |
2 files changed, 90 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 0000000000..386b7f83ac --- /dev/null +++ b/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-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 0000000000..0a7359311d --- /dev/null +++ b/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 |