-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEEBTProtocol_SrcPath.h
63 lines (48 loc) · 1.77 KB
/
EEBTProtocol_SrcPath.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
/*
* SimpleBroadcastProtocol.h
*
* Created on: 17.06.2020
* Author: Kevin Küchler
*/
#ifndef BROADCAST_EEBTPPROTOCOL_SRCPATH_H_
#define BROADCAST_EEBTPPROTOCOL_SRCPATH_H_
#include "map"
#include "ns3/wifi-mac.h"
#include "ns3/wifi-phy.h"
#include "ns3/node-container.h"
#include "ns3/wifi-net-device.h"
#include "GameState.h"
#include "SeqNoCache.h"
#include "EEBTPHeader.h"
#include "EEBTProtocol.h"
#include "EEBTPHeader_SrcPath.h"
namespace ns3
{
class GameState;
class EEBTPNode;
class CycleWatchDog;
class EEBTProtocolSrcPath : public EEBTProtocol
{
public:
EEBTProtocolSrcPath();
virtual ~EEBTProtocolSrcPath();
static TypeId GetTypeId();
virtual TypeId GetInstanceTypeId() const;
void Install(Ptr<WifiNetDevice> netDevice, Ptr<CycleWatchDog> cwd);
void Send(Ptr<GameState> gs, FRAME_TYPE ft, Mac48Address recipient, double txPower);
void Send(Ptr<GameState> gs, FRAME_TYPE ft, Mac48Address recipient, uint16_t seqNo, double txPower, Ptr<SendEvent> event);
void Send(Ptr<GameState> gs, EEBTPHeaderSrcPath header, Mac48Address recipient, double txPower, bool isRetransmission);
void Receive(Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t pID, const Address &sender, const Address &receiver, NetDevice::PacketType pType);
void checkParentPathStatus(Ptr<GameState> gs);
protected:
void handleCycleCheck(Ptr<GameState> gs, Ptr<EEBTPNode> node);
void handleNeighborDiscovery(Ptr<GameState> gs, Ptr<EEBTPNode> node);
void handleChildRequest(Ptr<GameState> gs, Ptr<EEBTPNode> node);
void handleChildConfirmation(Ptr<GameState> gs, Ptr<EEBTPNode> node);
void contactNode(Ptr<GameState> gs, Ptr<EEBTPNode> node);
bool checkParentPath(Ptr<GameState> gs);
private:
uint32_t timeToWait;
};
}
#endif /* BROADCAST_EEBTPPROTOCOL_SRCPATH_H_ */