-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdnode_ctrl_simple.hpp
39 lines (37 loc) · 1.16 KB
/
Adnode_ctrl_simple.hpp
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
#pragma once
#include <opnet.h>
#include <protocol_simple.hpp>
#include <vector>
#include <table_manager.hpp>
using namespace std;
namespace opnet
{
class Adnode_ctrl_simple
{
private:
UNINT nodeId;
table_manager* tm;
vector<duplicat_set> repeatTable;
UNINT packetSequenceNumber;
vector<message_packet> need2Forward;
UNINT forwardCount;
vector<pair<double, UNINT>> forwardCountSave;
public:
Adnode_ctrl_simple(UNINT nodeId) {
this->nodeId = nodeId;
this->tm = new table_manager(this->nodeId);
this->packetSequenceNumber = 0;
this->forwardCount = 0;
}
~Adnode_ctrl_simple() {
delete tm;
}
void updateRepeatTable(message_packet mp, UNINT packOri);
pair<OLSR_packet, UNINT> getOLSRPackets(bool hello, bool tc);
void recvPackets(OLSR_packet opack);
void forwardPackets(message_packet mp);
void updateTMWill(double, calType);
UNINT getForwardCount() {return this->forwardCount;}
UNINT getForwardCountSave();
};
} // namespace opnet