RINASim  October 2016
Documentation of framework for OMNeT++
AEMgmt.cc
Go to the documentation of this file.
1 //
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 // THE SOFTWARE.
31 #include "AEMgmt.h"
32 
33 const char* DAF_PAR_USEFANOTIF = "useFANotifier";
34 const char* DAF_PAR_USEENROLLNOTIF = "useEnrollmentNotifier";
35 
37 
39  //Init signals and listeners
41 
42  //Init pointers
43  initPointers();
44 
46 }
47 
48 void AEMgmt::handleMessage(cMessage *msg) {
49 
50 }
51 
53 /* FANotif = dynamic_cast<FANotifierBase*>( getModuleByPath("^.faNotifier") );
54  if (FANotif) {
55  useFANotifier = true;
56  this->par(DAF_PAR_USEFANOTIF) = true;
57  }
58 */
59  DAFEnrollNotif = dynamic_cast<DAFEnrollmentNotifierBase*>( getModuleByPath("^.enrollmentNotifier") );
60  if (DAFEnrollNotif) {
61  useEnrollmentNotifier = true;
62  this->par(DAF_PAR_USEENROLLNOTIF) = true;
63  }
64 }
65 
67  Enter_Method("receiveData()");
68  //std::string xxx = FANotif->getFullPath();
69 
70  //EnrollmentNotifier processing
73  }
74 
75  //delete msg;
76 }
77 
79  cModule* catcher1 = this->getParentModule();
80 
81  //Signals that this module is emitting
82  sigRIBDSendData = registerSignal(SIG_RIBD_DataSend);
83 
84  //Signals that this module is processing
86  catcher1->subscribe(SIG_CDAP_DateReceive, lisAEMgmtRcvData);
87 }
88 
90  Enter_Method("signalizeSendData()");
91  //Check dstAddress
93  EV << "Destination address cannot be UNSPECIFIED!" << endl;
94  return;
95  }
96 
97  msg->setBitLength(msg->getBitLength() + msg->getHeaderBitLength());
98  //Pass message to CDAP
99  EV << "Emits SendData signal for message " << msg->getName() << endl;
100  emit(sigRIBDSendData, msg);
101 }
LisAEMgmtRcvData * lisAEMgmtRcvData
Definition: AEMgmt.h:75
const char * DAF_PAR_USEENROLLNOTIF
Definition: AEMgmt.cc:34
simsignal_t sigRIBDSendData
Definition: AEMgmt.h:69
virtual void handleMessage(cMessage *msg)
Definition: AEMgmt.cc:48
virtual bool isMessageProcessable(CDAPMessage *msg)
Function checks whether CDAP message can be processed by notifier.
Kind of a Notification Board for DAF .
virtual unsigned int getHeaderBitLength() const
static const Address UNSPECIFIED_ADDRESS
Definition: Address.h:44
virtual Address & getDstAddr()
virtual void initialize()
Definition: AEMgmt.cc:38
bool useEnrollmentNotifier
Definition: AEMgmt.h:60
virtual void signalizeSendData(CDAPMessage *msg)
Definition: AEMgmt.cc:89
Definition: AEMgmt.h:50
virtual void receiveData(CDAPMessage *cimsg)
Definition: AEMgmt.cc:66
const char * DAF_PAR_USEFANOTIF
Definition: AEMgmt.cc:33
virtual void initPointers()
Definition: AEMgmt.cc:52
virtual void receiveMessage(CDAPMessage *msg)
Function checks the type of CDAP message and passes it to appropriate processing method.
void initSignalsAndListeners()
Definition: AEMgmt.cc:78
DAFEnrollmentNotifierBase * DAFEnrollNotif
Definition: AEMgmt.h:57
void initNamingInfo()
Definition: AEMgmtBase.cc:52
const char * SIG_RIBD_DataSend
Definition: RINASignals.cc:45
const char * SIG_CDAP_DateReceive
Definition: RINASignals.cc:81
Define_Module(AEMgmt)