RINASim  October 2016
Documentation of framework for OMNeT++
IntRouting.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 INTROUTING_H_
24 #define INTROUTING_H_
25 
26 #include <omnetpp.h>
27 
28 #include <vector>
29 #include <string>
30 #include "RINASignals.h"
31 #include "IntRoutingUpdate.h"
32 #include "Address.h"
33 #include "IntPDUFG.h"
34 
35 class LisRoutingRecv;
36 
37 class IntRouting : public cSimpleModule {
38 public:
39  //Destructor
40  virtual void finish();
41 
42  void receiveUpdate(IntRoutingUpdate * update);
43 
44  //Process a Routing Update, return true => inform FWDG of the update
45  virtual bool processUpdate(IntRoutingUpdate * update) = 0;
46 
47 
48 protected:
50 
51  // Initialize cons, signals, etc.
52  void initialize();
53  // Sends a Routing Update
54  void sendUpdate(IntRoutingUpdate * update);
55 
56  // Called after initialize
57  virtual void onPolicyInit() = 0;
58 
59 private:
61  simsignal_t sigRoutingUpdate;
63 };
64 
65 /* Listener for routing updates. */
66 class LisRoutingRecv : public cListener {
67 public:
68  LisRoutingRecv(IntRouting * _module);
69  void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *details);
70 protected:
72 };
73 
74 #endif /* INTROUTING_H_ */
IntPDUFG * fwdg
Definition: IntRouting.h:62
IntRouting * module
Definition: IntRouting.h:71
virtual bool processUpdate(IntRoutingUpdate *update)=0
virtual void finish()
Definition: IntRouting.cc:25
Address myAddress
Definition: IntRouting.h:49
virtual void onPolicyInit()=0
simsignal_t sigRoutingUpdate
Definition: IntRouting.h:61
void receiveUpdate(IntRoutingUpdate *update)
Definition: IntRouting.cc:67
LisRoutingRecv(IntRouting *_module)
Definition: IntRouting.cc:74
void sendUpdate(IntRoutingUpdate *update)
Definition: IntRouting.cc:62
void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *details)
Definition: IntRouting.cc:78
Address class holds IPC Process identification.
Definition: Address.h:42
void initialize()
Definition: IntRouting.cc:32
LisRoutingRecv * listener
Definition: IntRouting.h:60