1 --- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200
2 +++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200
4 /* Size of a packet header in bytes; easier than typing the sizeof() all
7 -#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr ))
8 +#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr ))
14 extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr )
16 - memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr));
17 + struct pcap_sf_pkthdr hdri;
19 + memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr));
21 if ( pcap_is_swapped( p ) )
23 - hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec);
24 - hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec);
25 - hdr->len = SWAPLONG(hdr->len);
26 - hdr->caplen = SWAPLONG(hdr->caplen);
27 + hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec);
28 + hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec);
29 + hdr->len = SWAPLONG(hdri.len);
30 + hdr->caplen = SWAPLONG(hdri.caplen);
34 + hdr->ts.tv_sec = hdri.ts.tv_sec;
35 + hdr->ts.tv_usec = hdri.ts.tv_usec;
36 + hdr->len = hdri.len;
37 + hdr->caplen = hdri.caplen;
41 * From bpf/libpcap/savefile.c:
43 --- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100
44 +++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200
50 +/* #include <net/bpf.h> */
53 + * This is a timeval as stored in disk in a dumpfile.
54 + * It has to use the same types everywhere, independent of the actual
58 +struct pcap_timeval {
59 + bpf_int32 tv_sec; /* seconds */
60 + bpf_int32 tv_usec; /* microseconds */
63 +struct pcap_sf_pkthdr {
64 + struct pcap_timeval ts; /* time stamp */
65 + bpf_u_int32 caplen; /* length of portion present */
66 + bpf_u_int32 len; /* length this packet (off wire) */
69 time_t gwtm2secs( struct tm *tm );
71 int sf_find_end( struct pcap *p, struct timeval *first_timestamp,