-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatasource.h
63 lines (48 loc) · 1.51 KB
/
datasource.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* DataSource header
*/
#ifndef DATASOURCE_H
#define DATASOURCE_H
#include "eventlist.h"
#include "loggertypes.h"
#include "datapacket.h"
#include "datasink.h"
#include <list>
class FlowGenerator;
class DataSource : public EventSource, public PacketSink
{
public:
DataSource(TrafficLogger *logger, uint64_t flowsize, simtime_picosec duration);
virtual ~DataSource() {};
/* Different types of endhost that implement DataSource */
enum EndHost {
TCP, // TCP New Reno
DCTCP, // Datacenter TCP
D_TCP, // Deadline TCP
D_DCTCP, // Deadline DCTCP
PKTPAIR, // Packet pair
TIMELY,
EC_OFFLOAD
};
virtual void printStatus() = 0;
virtual void doNextEvent() = 0;
virtual void receivePacket(Packet &pkt) = 0;
void connect(simtime_picosec start_time, route_t &route_fwd, route_t &route_rev, DataSink &sink);
void setFlowGenerator(FlowGenerator *flowgen);
void setDeadline(simtime_picosec deadline);
uint64_t _flowsize;
simtime_picosec _duration;
simtime_picosec _start_time;
simtime_picosec _deadline;
uint64_t _packets_sent;
uint64_t _highest_sent;
uint64_t _last_acked;
bool _enable_deadline;
DataSink *_sink;
route_t *_route_fwd;
route_t *_route_rev;
FlowGenerator *_flowgen;
PacketFlow _flow;
uint32_t _node_id;
};
#endif /* DATASOURCE_H */