|
a |
|
b/src/DAF/AE/AESender.h |
|
|
1 |
//
|
|
|
2 |
// This program is free software: you can redistribute it and/or modify
|
|
|
3 |
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
4 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
5 |
// (at your option) any later version.
|
|
|
6 |
//
|
|
|
7 |
// This program is distributed in the hope that it will be useful,
|
|
|
8 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
// GNU Lesser General Public License for more details.
|
|
|
11 |
//
|
|
|
12 |
// You should have received a copy of the GNU Lesser General Public License
|
|
|
13 |
// along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
14 |
//
|
|
|
15 |
|
|
|
16 |
#ifndef __RINA_AESender_H_
|
|
|
17 |
#define __RINA_AESender_H_
|
|
|
18 |
|
|
|
19 |
//Standard libraries
|
|
|
20 |
#include <omnetpp.h>
|
|
|
21 |
//RINASim libraries
|
|
|
22 |
#include "AE.h"
|
|
|
23 |
|
|
|
24 |
class AESender : public AE
|
|
|
25 |
{
|
|
|
26 |
//Consts
|
|
|
27 |
const char* S_TIM_START;
|
|
|
28 |
const char* S_TIM_COM;
|
|
|
29 |
const char* S_TIM_STOP;
|
|
|
30 |
|
|
|
31 |
const char* S_PAR_START;
|
|
|
32 |
const char* S_PAR_STOP;
|
|
|
33 |
const char* S_PAR_SEND;
|
|
|
34 |
|
|
|
35 |
const char* S_PAR_DSTAPNAME;
|
|
|
36 |
const char* S_PAR_DSTAPINSTANCE;
|
|
|
37 |
const char* S_PAR_DSTAENAME;
|
|
|
38 |
const char* S_PAR_DSTAEINSTANCE;
|
|
|
39 |
|
|
|
40 |
const char* S_PAR_RATE;
|
|
|
41 |
const char* S_PAR_RATE_VAR;
|
|
|
42 |
const char* S_PAR_SIZE;
|
|
|
43 |
const char* S_PAR_SIZE_VAR;
|
|
|
44 |
|
|
|
45 |
const char* S_MSG_PING;
|
|
|
46 |
const char* S_PAR_PING;
|
|
|
47 |
const char* S_VAL_MODULEPATH;
|
|
|
48 |
|
|
|
49 |
public:
|
|
|
50 |
AESender();
|
|
|
51 |
virtual ~AESender();
|
|
|
52 |
|
|
|
53 |
protected:
|
|
|
54 |
virtual void initialize();
|
|
|
55 |
virtual void finish();
|
|
|
56 |
virtual void handleMessage(cMessage *msg);
|
|
|
57 |
|
|
|
58 |
void handleSelfMessage(cMessage* msg);
|
|
|
59 |
|
|
|
60 |
private:
|
|
|
61 |
std::string myPath;
|
|
|
62 |
|
|
|
63 |
std::string dstApName;
|
|
|
64 |
std::string dstApInstance;
|
|
|
65 |
std::string dstAeName;
|
|
|
66 |
std::string dstAeInstance;
|
|
|
67 |
|
|
|
68 |
simtime_t startAt;
|
|
|
69 |
simtime_t stopAt;
|
|
|
70 |
simtime_t sendAfter;
|
|
|
71 |
|
|
|
72 |
double rate;
|
|
|
73 |
double ratevar;
|
|
|
74 |
|
|
|
75 |
unsigned int size;
|
|
|
76 |
unsigned int sizevar;
|
|
|
77 |
|
|
|
78 |
long send;
|
|
|
79 |
long pingreceived;
|
|
|
80 |
long received;
|
|
|
81 |
long sendSize;
|
|
|
82 |
long pingreceivedSize;
|
|
|
83 |
long receivedSize;
|
|
|
84 |
|
|
|
85 |
simtime_t minDelay;
|
|
|
86 |
simtime_t maxDelay;
|
|
|
87 |
simtime_t firstR;
|
|
|
88 |
simtime_t lastR;
|
|
|
89 |
|
|
|
90 |
void prepareAllocateRequest();
|
|
|
91 |
void preparePing();
|
|
|
92 |
void prepareDeallocateRequest();
|
|
|
93 |
|
|
|
94 |
virtual void processMRead(CDAPMessage* msg);
|
|
|
95 |
virtual void processMReadR(CDAPMessage* msg);
|
|
|
96 |
|
|
|
97 |
};
|
|
|
98 |
|
|
|
99 |
#endif
|