-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSinkManager.hpp
executable file
·83 lines (67 loc) · 2.02 KB
/
SinkManager.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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
// SinkManager.hpp
// AggregationNS3
//
// Created by Alper Sinan Akyurek on 8/12/16.
// Copyright © 2016 Alper Sinan Akyurek. All rights reserved.
//
#ifndef SinkManager_hpp
#define SinkManager_hpp
#include <ns3/network-module.h>
#include <ns3/internet-module.h>
#include "TransmissionManager.hpp"
/**
This class manages the Sink Node to receive the measurements and process them
for statistics.
**/
class SinkManager : public ns3::Object
{
public:
/** Smart pointer to a Socket **/
typedef ns3::Ptr< ns3::Socket > TSocketPtr;
/** Smart pointer to a Node **/
typedef ns3::Ptr< ns3::Node > TNodePtr;
/** IPv4 Address type **/
typedef ns3::Ipv4Address TAddress;
/** Smart pointer to a Packet **/
typedef ns3::Ptr< ns3::Packet > TPacketPtr;
/** Internet Socket Address type **/
typedef ns3::InetSocketAddress TSocketAddress;
/** Special Socket Port values **/
enum PortValues
{
/** Port number used by all Transmission Managers **/
portNumber = TransmissionManager::portNumber
};
private:
/** The receiving socket pointer **/
TSocketPtr m_receivingSocket;
/** Pointer to the actual sink node **/
TNodePtr m_installedNode;
private:
/**
Receive a packet destined to the sink.
\param socket Socket of reception
**/
void
ReceivePacket( TSocketPtr socket );
/**
Sets the socket address of the sink node to the socket
**/
void
SetSinkAddress( void );
public:
/**
ns3 related Type ID definition
\return Type ID of this class
**/
static ns3::TypeId
GetTypeId( void );
/**
Install the sink manager on the given node.
\param node Node to be installed on.
**/
void
InstallOnNode( const TNodePtr & node );
};
#endif /* SinkManager_hpp */