eacd3f66fa
ok okan@
81 lines
2.8 KiB
Plaintext
81 lines
2.8 KiB
Plaintext
$OpenBSD: patch-search_c,v 1.3 2008/06/05 19:43:57 rui Exp $
|
|
--- search.c.orig Sat Aug 19 09:42:43 2006
|
|
+++ search.c Wed Jun 4 12:14:33 2008
|
|
@@ -306,8 +306,8 @@ find_header( pcap_t *p, u_char *buf, int buf_len,
|
|
* present in the dump file.
|
|
*/
|
|
int
|
|
-sf_find_end( pcap_t *p, struct timeval *first_timestamp,
|
|
- struct timeval *last_timestamp )
|
|
+sf_find_end( pcap_t *p, struct bpf_timeval *first_timestamp,
|
|
+ struct bpf_timeval *last_timestamp )
|
|
{
|
|
time_t first_time = first_timestamp->tv_sec;
|
|
off_t len_file;
|
|
@@ -410,7 +410,7 @@ sf_find_end( pcap_t *p, struct timeval *first_timestam
|
|
/* Takes two timeval's and returns the difference, tv2 - tv1, as a double. */
|
|
|
|
static double
|
|
-timeval_diff( struct timeval *tv1, struct timeval *tv2 )
|
|
+timeval_diff( struct bpf_timeval *tv1, struct bpf_timeval *tv2 )
|
|
{
|
|
double result = (tv2->tv_sec - tv1->tv_sec);
|
|
result += (tv2->tv_usec - tv1->tv_usec) / 1000000.0;
|
|
@@ -422,7 +422,7 @@ timeval_diff( struct timeval *tv1, struct timeval *tv2
|
|
/* Returns true if timestamp t1 is chronologically less than timestamp t2. */
|
|
|
|
int
|
|
-sf_timestamp_less_than( struct timeval *t1, struct timeval *t2 )
|
|
+sf_timestamp_less_than( struct bpf_timeval *t1, struct bpf_timeval *t2 )
|
|
{
|
|
return t1->tv_sec < t2->tv_sec ||
|
|
(t1->tv_sec == t2->tv_sec &&
|
|
@@ -436,9 +436,9 @@ sf_timestamp_less_than( struct timeval *t1, struct tim
|
|
*/
|
|
|
|
static off_t
|
|
-interpolated_position( struct timeval *min_time, off_t min_pos,
|
|
- struct timeval *max_time, off_t max_pos,
|
|
- struct timeval *desired_time )
|
|
+interpolated_position( struct bpf_timeval *min_time, off_t min_pos,
|
|
+ struct bpf_timeval *max_time, off_t max_pos,
|
|
+ struct bpf_timeval *desired_time )
|
|
{
|
|
double full_span = timeval_diff( max_time, min_time );
|
|
double desired_span = timeval_diff( desired_time, min_time );
|
|
@@ -459,7 +459,7 @@ interpolated_position( struct timeval *min_time, off_t
|
|
*/
|
|
|
|
static int
|
|
-read_up_to( pcap_t *p, struct timeval *desired_time )
|
|
+read_up_to( pcap_t *p, struct bpf_timeval *desired_time )
|
|
{
|
|
struct pcap_pkthdr hdr;
|
|
const u_char *buf;
|
|
@@ -468,7 +468,7 @@ read_up_to( pcap_t *p, struct timeval *desired_time )
|
|
|
|
for ( ; ; )
|
|
{
|
|
- struct timeval *timestamp;
|
|
+ struct bpf_timeval *timestamp;
|
|
|
|
pos = FTELL( pcap_file( p ) );
|
|
buf = pcap_next( p, &hdr );
|
|
@@ -516,12 +516,12 @@ read_up_to( pcap_t *p, struct timeval *desired_time )
|
|
|
|
int
|
|
sf_find_packet( pcap_t *p,
|
|
- struct timeval *min_time, off_t min_pos,
|
|
- struct timeval *max_time, off_t max_pos,
|
|
- struct timeval *desired_time )
|
|
+ struct bpf_timeval *min_time, off_t min_pos,
|
|
+ struct bpf_timeval *max_time, off_t max_pos,
|
|
+ struct bpf_timeval *desired_time )
|
|
{
|
|
int status = 1;
|
|
- struct timeval min_time_copy, max_time_copy;
|
|
+ struct bpf_timeval min_time_copy, max_time_copy;
|
|
u_int num_bytes = MAX_BYTES_FOR_DEFINITE_HEADER;
|
|
int num_bytes_read;
|
|
off_t desired_pos, present_pos;
|