-
Notifications
You must be signed in to change notification settings - Fork 78
/
rat.hh
49 lines (33 loc) · 1.06 KB
/
rat.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
41
42
43
44
45
46
47
48
49
#ifndef RAT_HH
#define RAT_HH
#include <vector>
#include <string>
#include <limits>
#include "packet.hh"
#include "whiskertree.hh"
#include "memory.hh"
class Rat
{
private:
const WhiskerTree & _whiskers;
Memory _memory;
unsigned int _packets_sent, _packets_received;
bool _track;
double _last_send_time;
int _the_window;
double _intersend_time;
unsigned int _flow_id;
int _largest_ack;
public:
Rat( WhiskerTree & s_whiskers, const bool s_track=false );
void packets_received( const std::vector< Packet > & packets );
void reset( const double & tickno ); /* start new flow */
template <class NextHop>
void send( const unsigned int id, NextHop & next, const double & tickno,
const unsigned int packets_sent_cap = std::numeric_limits<unsigned int>::max() );
const WhiskerTree & whiskers( void ) const { return _whiskers; }
Rat & operator=( const Rat & ) { assert( false ); return *this; }
double next_event_time( const double & tickno ) const;
const unsigned int & packets_sent( void ) const { return _packets_sent; }
};
#endif