-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenoManager.h
66 lines (50 loc) · 1.61 KB
/
RenoManager.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
64
65
//
// Generated file, do not edit! Created by nedtool 5.3 from Volt.msg.
//
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef __RENOMANAGER_H
#define __RENOMANAGER_H
#include <omnetpp.h>
#include "EventTimeout.h"
#define EVENT_TIMEOUT_KIND 1
// nedtool version check
#define MSGC_VERSION 0x0503
#if (MSGC_VERSION!=OMNETPP_VERSION)
# error Version mismatch! Probably this file was generated by an earlier version of nedtool: 'make clean' should help.
#endif
/* RenoController */
class RenoManager {
private:
int maxSize; // INT_MAX
int size;
int msgSendingAmount;
bool isSlowStartStage = true;
std::map<int, EventTimeout*> window;
void logAvailableWin();
public:
RenoManager();
virtual ~RenoManager();
/* Retorna el tamaño máximo de la ventana de congestión */
int getMaxSize();
/* Retorna el tamaño actual de la ventana de congestión */
int getSize();
/* Dado el tamaño de la ventana y cuanto ya está ocupada
* devuelve la cantidad de mensajes que se pueden agregar */
int getAvailableWin();
/* Setea el tamaño de la ventana de congestión */
void setSize(int newSize);
/* Agrega un evento que representa que un mensaje fue enviado y está
* en la sub red. */
void addTimeoutMsg(EventTimeout * msg);
/* Quita un mensaje de la ventana de congestión y lo devuelve */
EventTimeout * popTimeoutMsg(int seqN);
/* Devuelve si el estado actual de Reno es arranque lento */
bool getSlowStart();
/* Setea si el estado de Reno es arranque lento */
void setSlowStart(bool state);
protected:
//
};
#endif // ifndef __RENOMANAGER_H