forked from unpbook/unpv13e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unprtt.h
30 lines (24 loc) · 1 KB
/
unprtt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef __unp_rtt_h
#define __unp_rtt_h
#include "unp.h"
struct rtt_info {
float rtt_rtt; /* most recent measured RTT, in seconds */
float rtt_srtt; /* smoothed RTT estimator, in seconds */
float rtt_rttvar; /* smoothed mean deviation, in seconds */
float rtt_rto; /* current RTO to use, in seconds */
int rtt_nrexmt; /* # times retransmitted: 0, 1, 2, ... */
uint32_t rtt_base; /* # sec since 1/1/1970 at start */
};
#define RTT_RXTMIN 2 /* min retransmit timeout value, in seconds */
#define RTT_RXTMAX 60 /* max retransmit timeout value, in seconds */
#define RTT_MAXNREXMT 3 /* max # times to retransmit */
/* function prototypes */
void rtt_debug(struct rtt_info *);
void rtt_init(struct rtt_info *);
void rtt_newpack(struct rtt_info *);
int rtt_start(struct rtt_info *);
void rtt_stop(struct rtt_info *, uint32_t);
int rtt_timeout(struct rtt_info *);
uint32_t rtt_ts(struct rtt_info *);
extern int rtt_d_flag; /* can be set to nonzero for addl info */
#endif /* __unp_rtt_h */