Parent: [180d2e] (diff)

Child: [569601] (diff)

Download this file

RIBd.h    132 lines (114 with data), 4.6 kB

  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
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//
// Copyright Š 2014 PRISTINE Consortium (http://ict-pristine.eu)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
/**
* @file RIBd.cc
* @author Vladimir Vesely (ivesely@fit.vutbr.cz)
* @date Apr 30, 2014
* @brief Kind of a Notification Board for DIF
* @detail
*/
#ifndef RIBDAEMON_H_
#define RIBDAEMON_H_
//Standard libraries
#include <omnetpp.h>
//RINASim libraries
#include "RIBdBase.h"
#include "ExternConsts.h"
#include "RIBdListeners.h"
#include "RINASignals.h"
#include "PDU.h"
#include "IntRoutingUpdate.h"
//Constants
extern const char* MSG_CONGEST;
extern const char* MSG_FLO;
extern const char* CLS_FLOW;
extern const char* MSG_FLOPOSI;
extern const char* MSG_FLONEGA;
extern const int VAL_DEFINSTANCE;
extern const int VAL_FLOWPOSI;
extern const int VAL_FLOWNEGA;
extern const char* VAL_FLREQ;
extern const char* VAL_FLREQPOSI;
extern const char* VAL_FLREQNEGA;
extern const char* MSG_ROUTINGUPDATE;
class RIBd : public RIBdBase {
public:
virtual void sendCreateRequestFlow(Flow* flow);
virtual void sendCreateResponseNegative(Flow* flow);
virtual void sendCreateResponsePostive(Flow* flow);
virtual void sendDeleteRequestFlow(Flow* flow);
virtual void sendDeleteResponseFlow(Flow* flow);
virtual void receiveData(CDAPMessage* cimsg);
virtual void receiveAllocationRequestFromFai(Flow* flow);
virtual void receiveCreateFlowPositiveFromRa(Flow* flow);
virtual void receiveCreateFlowNegativeFromRa(Flow* flow);
/* Handles information coming from PDUFTG module. */
virtual void receiveRoutingUpdateFromRouting(IntRoutingUpdate * update);
virtual void sendCongestionNotification(PDU* pdu);
void signalizeSendData(CDAPMessage* msg);
void signalizeCreateRequestFlow(Flow* flow);
void signalizeDeleteRequestFlow(Flow* flow);
void signalizeDeleteResponseFlow(Flow* flow);
void signalizeAllocateResponsePositive(Flow* flow);
void signalizeAllocateResponseNegative(Flow* flow);
void signalizeCreateFlow(Flow* flow);
void signalizeCreateResponseFlowPositive(Flow* flow);
void signalizeCreateResponseFlowNegative(Flow* flow);
void signalizeCongestionNotification(CongestionDescriptor* congDesc);
protected:
virtual void initialize();
virtual void handleMessage(cMessage *msg);
void initCdapBindings();
void initSignalsAndListeners();
//Signals
simsignal_t sigRIBDSendData;
simsignal_t sigRIBDCreReqFlo;
simsignal_t sigRIBDDelReqFlo;
simsignal_t sigRIBDDelResFlo;
simsignal_t sigRIBDCreResFloPosi;
simsignal_t sigRIBDCreResFloNega;
simsignal_t sigRIBDAllocResPosi;
simsignal_t sigRIBDAllocResNega;
simsignal_t sigRIBDCreFlow;
simsignal_t sigRIBDCongNotif;
/* Emit update received signal. */
//simsignal_t sigRIBDFwdUpdateRecv;
simsignal_t sigRIBDRoutingUpdateRecv;
//Listeners
LisRIBDRcvData* lisRIBDRcvData;
LisRIBDCreReq* lisRIBDCreReq;
LisRIBDCreReq* lisRIBDCreReqByForward;
LisRIBDAllReqFromFai* lisRIBDAllReqFromFai;
LisRIBDCreResNega* lisRIBDCreResNega;
LisRIBDCreResNega* lisRIBDCreResNegaFromFa;
LisRIBDCreResPosi* lisRIBDCreResPosi;
LisRIBDCreResPosi* lisRIBDCreResPosiForward;
LisRIBDDelReq* lisRIBDDelReq;
LisRIBDDelRes* lisRIBDDelRes;
LisRIBDCreFloPosi* lisRIBDCreFloPosi;
LisRIBDCreFloNega* lisRIBDCreFloNega;
LisRIBDCongesNotif* lisRIBDCongNotif;
/* Listen for PDUFTG update messages. */
LisRIBDRoutingUpdate* lisRIBDRoutingUpdate;
void processMCreate(CDAPMessage* msg);
void processMCreateR(CDAPMessage* msg);
void processMDelete(CDAPMessage* msg);
void processMDeleteR(CDAPMessage* msg);
void processMWrite(CDAPMessage* msg);
void processMStart(CDAPMessage* msg);
};
#endif /* RIBDAEMON_H_ */