forked from keithw/datagrump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.hh
40 lines (29 loc) · 997 Bytes
/
controller.hh
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
31
32
33
34
35
36
37
38
39
40
#ifndef CONTROLLER_HH
#define CONTROLLER_HH
#include <stdint.h>
/* Flow controller interface */
class Controller
{
private:
bool debug_; /* Enables debugging output */
/* Add member variables here */
public:
/* Public interface for the flow controller */
/* You can change these if you prefer, but will need to change
the call site as well (in datagrump-sender.cc) */
/* Default constructor */
Controller( const bool debug );
/* Get current window size, in packets */
unsigned int window_size( void );
/* A packet was sent */
void packet_was_sent( const uint64_t sequence_number,
const uint64_t send_timestamp );
/* An ack was received */
void ack_received( const uint64_t sequence_number_acked,
const uint64_t send_timestamp_acked,
const uint64_t recv_timestamp_acked,
const uint64_t timestamp_ack_received );
/* How long to wait if there are no acks before sending one more packet */
unsigned int timeout_ms( void );
};
#endif