ports/net/tcpslice/patches/patch-search_c

80 lines
2.8 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
--- search.c.orig Mon Apr 7 14:09:35 2014
+++ search.c Fri Oct 10 13:15:24 2014
@@ -302,8 +302,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;
@@ -406,7 +406,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;
@@ -418,7 +418,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 &&
@@ -432,9 +432,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 );
@@ -455,7 +455,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;
@@ -464,7 +464,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 );
@@ -512,12 +512,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;