$OpenBSD: patch-search_c,v 1.2 2006/04/02 14:45:10 sturm Exp $ --- search.c.orig Sun Sep 10 10:52:40 2000 +++ search.c Sun Apr 2 13:24:33 2006 @@ -279,8 +279,8 @@ find_header( pcap_t *p, u_char *buf, int * 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; @@ -383,7 +383,7 @@ sf_find_end( pcap_t *p, struct timeval * /* 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; @@ -395,7 +395,7 @@ timeval_diff( struct timeval *tv1, struc /* 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 && @@ -409,9 +409,9 @@ sf_timestamp_less_than( struct timeval * */ 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 ); @@ -432,7 +432,7 @@ interpolated_position( struct timeval *m */ 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; @@ -441,7 +441,7 @@ read_up_to( pcap_t *p, struct timeval *d for ( ; ; ) { - struct timeval *timestamp; + struct bpf_timeval *timestamp; pos = FTELL( pcap_file( p ) ); buf = pcap_next( p, &hdr ); @@ -490,12 +490,12 @@ read_up_to( pcap_t *p, struct timeval *d 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;