Switch to unified view

a b/src/DAF/AE/AEPing.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_AEPING_H_
17
#define __RINA_AEPING_H_
18
19
//Standard libraries
20
#include <omnetpp.h>
21
//RINASim libraries
22
#include "AE.h"
23
24
//Consts
25
extern const char* TIM_START;
26
extern const char* TIM_STOP;
27
extern const char* MSG_PING;
28
extern const char* PAR_START;
29
extern const char* PAR_STOP;
30
extern const char* PAR_PING;
31
extern const char* PAR_RATE;
32
extern const char* PAR_DSTAPNAME;
33
extern const char* PAR_DSTAPINSTANCE;
34
extern const char* PAR_DSTAENAME;
35
extern const char* PAR_DSTAEINSTANCE;
36
37
class AEPing : public AE
38
{
39
  public:
40
    AEPing();
41
    virtual ~AEPing();
42
43
  protected:
44
    virtual void initialize();
45
    virtual void handleMessage(cMessage *msg);
46
47
    void handleSelfMessage(cMessage* msg);
48
49
  private:
50
    std::string dstApName;
51
    std::string dstApInstance;
52
    std::string dstAeName;
53
    std::string dstAeInstance;
54
55
    simtime_t startAt;
56
    simtime_t stopAt;
57
    simtime_t pingAt;
58
    int rate;
59
60
    void prepareAllocateRequest();
61
    void preparePing();
62
    void prepareDeallocateRequest();
63
64
};
65
66
#endif