RINASim  October 2016
Documentation of framework for OMNeT++
AEPing.h
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #ifndef __RINA_AEPING_H_
24 #define __RINA_AEPING_H_
25 
26 //Standard libraries
27 #include <omnetpp.h>
28 //RINASim libraries
29 #include "AE.h"
30 
31 class AEPing : public AE
32 {
33  //Consts
34  const char* TIM_START;
35  const char* TIM_STOP;
36  const char* MSG_PING;
37  const char* PAR_START;
38  const char* PAR_STOP;
39  const char* PAR_PING;
40  const char* PAR_RATE;
41  const char* PAR_SIZE;
42  const char* PAR_DSTAPNAME;
43  const char* PAR_DSTAPINSTANCE;
44  const char* PAR_DSTAENAME;
45  const char* PAR_DSTAEINSTANCE;
46  const char* VAL_MODULEPATH;
47 
48  public:
49  AEPing();
50  virtual ~AEPing();
51  virtual void afterOnStart();
52 
53  protected:
54  std::string dstApName;
55  std::string dstApInstance;
56  std::string dstAeName;
57  std::string dstAeInstance;
58 
59  simtime_t startAt;
60  simtime_t stopAt;
61  simtime_t pingAt;
62  int rate;
63  unsigned int size;
64 
65 
66  void initPing();
67  void handleSelfMessage(cMessage* msg);
68 
70  void preparePing();
72 
73  //=== AEPing interface starts here ===
74  virtual void initialize();
75  virtual void handleMessage(cMessage *msg);
76 
77  void onStart();
78  void connect();
79  virtual void onPing();
80  virtual void onStop();
81 
82  virtual void processMRead(CDAPMessage* msg);
83  virtual void processMReadR(CDAPMessage* msg);
84  //=== AEPing interface ends here ===
85 
86  private:
87  std::string myPath;
88 };
89 
90 #endif
const char * MSG_PING
Definition: AEPing.h:36
void handleSelfMessage(cMessage *msg)
Definition: AEPing.cc:123
simtime_t startAt
Definition: AEPing.h:59
Definition: AEPing.h:31
const char * PAR_DSTAPINSTANCE
Definition: AEPing.h:43
const char * PAR_START
Definition: AEPing.h:37
void prepareAllocateRequest()
Definition: AEPing.cc:51
AEPing()
Definition: AEPing.cc:27
std::string dstApInstance
Definition: AEPing.h:55
Definition: AE.h:44
void connect()
Definition: AEPing.cc:149
virtual void onStop()
Definition: AEPing.cc:198
void initPing()
Definition: AEPing.cc:73
simtime_t pingAt
Definition: AEPing.h:61
std::string dstApName
Definition: AEPing.h:54
const char * TIM_START
Definition: AEPing.h:34
virtual ~AEPing()
Definition: AEPing.cc:44
virtual void processMReadR(CDAPMessage *msg)
Definition: AEPing.cc:231
const char * PAR_DSTAPNAME
Definition: AEPing.h:42
const char * PAR_DSTAEINSTANCE
Definition: AEPing.h:45
const char * VAL_MODULEPATH
Definition: AEPing.h:46
const char * PAR_DSTAENAME
Definition: AEPing.h:44
std::string dstAeName
Definition: AEPing.h:56
virtual void handleMessage(cMessage *msg)
Definition: AEPing.cc:139
unsigned int size
Definition: AEPing.h:63
const char * PAR_PING
Definition: AEPing.h:39
void onStart()
Definition: AEPing.cc:145
void prepareDeallocateRequest()
Definition: AEPing.cc:67
virtual void processMRead(CDAPMessage *msg)
Definition: AEPing.cc:204
virtual void afterOnStart()
Definition: AEPing.cc:163
std::string myPath
Definition: AEPing.h:87
void preparePing()
Definition: AEPing.cc:57
const char * PAR_SIZE
Definition: AEPing.h:41
const char * PAR_STOP
Definition: AEPing.h:38
const char * TIM_STOP
Definition: AEPing.h:35
int rate
Definition: AEPing.h:62
simtime_t stopAt
Definition: AEPing.h:60
virtual void onPing()
Definition: AEPing.cc:181
virtual void initialize()
Definition: AEPing.cc:116
const char * PAR_RATE
Definition: AEPing.h:40
std::string dstAeInstance
Definition: AEPing.h:57