401f5d4
--- tcpslice-1.2a3.orig/search.c	2000-09-10 10:52:40.000000000 +0200
401f5d4
+++ tcpslice-1.2a3/search.c	2006-07-28 14:56:55.000000000 +0200
401f5d4
@@ -53,7 +53,7 @@
401f5d4
 /* Size of a packet header in bytes; easier than typing the sizeof() all
401f5d4
  * the time ...
401f5d4
  */
401f5d4
-#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr ))
401f5d4
+#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr ))
401f5d4
 
401f5d4
 extern int snaplen;
401f5d4
 
401f5d4
@@ -111,16 +111,24 @@
401f5d4
 static void
401f5d4
 extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr )
401f5d4
 	{
401f5d4
-	memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr));
401f5d4
+	struct pcap_sf_pkthdr hdri;
401f5d4
+
401f5d4
+	memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr));
401f5d4
 
401f5d4
 	if ( pcap_is_swapped( p ) )
401f5d4
 		{
401f5d4
-		hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec);
401f5d4
-		hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec);
401f5d4
-		hdr->len = SWAPLONG(hdr->len);
401f5d4
-		hdr->caplen = SWAPLONG(hdr->caplen);
401f5d4
+		hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec);
401f5d4
+		hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec);
401f5d4
+		hdr->len = SWAPLONG(hdri.len);
401f5d4
+		hdr->caplen = SWAPLONG(hdri.caplen);
401f5d4
+		}
401f5d4
+	else
401f5d4
+		{
401f5d4
+		hdr->ts.tv_sec = hdri.ts.tv_sec;
401f5d4
+		hdr->ts.tv_usec = hdri.ts.tv_usec;
401f5d4
+		hdr->len = hdri.len;
401f5d4
+		hdr->caplen = hdri.caplen;
401f5d4
 		}
401f5d4
-
401f5d4
 	/*
401f5d4
 	 * From bpf/libpcap/savefile.c:
401f5d4
 	 *
401f5d4
--- tcpslice-1.2a3.orig/tcpslice.h	1995-11-02 00:40:53.000000000 +0100
401f5d4
+++ tcpslice-1.2a3/tcpslice.h	2006-07-28 14:56:55.000000000 +0200
401f5d4
@@ -20,6 +20,26 @@
401f5d4
  */
401f5d4
 
401f5d4
 
401f5d4
+#include <time.h>
401f5d4
+/* #include <net/bpf.h> */
401f5d4
+
401f5d4
+/*
401f5d4
+ * This is a timeval as stored in disk in a dumpfile.
401f5d4
+ * It has to use the same types everywhere, independent of the actual
401f5d4
+ * `struct timeval'
401f5d4
+ */
401f5d4
+                                                                                
401f5d4
+struct pcap_timeval {
401f5d4
+    bpf_int32 tv_sec;           /* seconds */
401f5d4
+    bpf_int32 tv_usec;          /* microseconds */
401f5d4
+};
401f5d4
+
401f5d4
+struct pcap_sf_pkthdr {
401f5d4
+    struct pcap_timeval ts;     /* time stamp */
401f5d4
+    bpf_u_int32 caplen;         /* length of portion present */
401f5d4
+    bpf_u_int32 len;            /* length this packet (off wire) */
401f5d4
+};
401f5d4
+
401f5d4
 time_t	gwtm2secs( struct tm *tm );
401f5d4
 
401f5d4
 int	sf_find_end( struct pcap *p, struct timeval *first_timestamp,