RINASim
October 2016
Documentation of framework for OMNeT++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SimpleDV.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 SimpleDV_H_
24
#define SimpleDV_H_
25
26
#include <
IntSimpleRouting.h
>
27
28
namespace
SimpleDV
{
29
30
struct
rtEntry
{
31
std::string
addr
;
32
unsigned
short
metric
;
33
rtEntry
(){
34
addr =
""
;
35
metric = UINT16_MAX;
36
}
37
rtEntry
(
const
std::string &_addr,
const
unsigned
short
&_metric){
38
addr = _addr;
39
metric = _metric;
40
}
41
};
42
43
typedef
std::vector<rtEntry>
entriesL
;
44
typedef
std::vector<rtEntry>::iterator
entriesIt
;
45
46
typedef
std::map<Address, unsigned short>
neighMetric
;
47
typedef
std::map<std::string, neighMetric>
qosNeighMetric
;
48
typedef
neighMetric::iterator
neighMetricIt
;
49
typedef
qosNeighMetric::iterator
qosNeighMetricIt
;
50
51
typedef
std::map<std::string, rtEntry>
tTable
;
52
typedef
std::map<std::string, tTable>
rtTable
;
53
typedef
tTable::iterator
tTableIt
;
54
typedef
rtTable::iterator
rtTableIt
;
55
56
57
58
class
RoutingUpdate
:
public
IntRoutingUpdate
{
59
public
:
60
RoutingUpdate
(
const
Address
&_addr,
const
std::string &_src,
const
std::string& _qos);
61
62
std::string
getSrc
();
63
std::string
getQoS
();
64
65
void
addEntry
(
rtEntry
);
66
67
entriesIt
entriesBegin
();
68
entriesIt
entriesEnd
();
69
70
protected
:
71
std::string
src
;
72
std::string
qos
;
73
entriesL
entries
;
74
};
75
76
class
SimpleDV
:
public
IntSimpleRouting
{
77
public
:
78
//Process a Routing Update, return true => inform FWDG of the update
79
bool
processUpdate(
IntRoutingUpdate
* update);
80
81
82
//Flow inserted/removed
83
void
insertFlow(
const
Address
&addr,
const
std::string &dst,
const
std::string& qos,
const
unsigned
short
&metric);
84
void
removeFlow(
const
Address
&addr,
const
std::string &dst,
const
std::string& qos);
85
86
87
//Get Changes
88
entries2Next
getChanges();
89
entries2Next
getAll();
90
91
void
handleMessage(cMessage *msg);
92
void
finish();
93
94
protected
:
95
// Called after initialize
96
void
onPolicyInit();
97
98
private
:
99
unsigned
short
infMetric
;
100
std::string
myAddr
;
101
qosNeighMetric
neig
;
102
rtTable
table
;
103
104
entries2Next
changes
;
105
106
bool
scheduledUpdate
;
107
void
scheduleUpdate();
108
};
109
110
}
111
112
#endif
/* SimpleDV_H_ */
SimpleDV::SimpleDV::changes
entries2Next changes
Definition:
SimpleDV.h:104
SimpleDV::SimpleDV::table
rtTable table
Definition:
SimpleDV.h:102
SimpleDV::entriesIt
std::vector< rtEntry >::iterator entriesIt
Definition:
SimpleDV.h:44
SimpleDV::rtEntry
Definition:
SimpleDV.h:30
SimpleDV::qosNeighMetricIt
qosNeighMetric::iterator qosNeighMetricIt
Definition:
SimpleDV.h:49
SimpleDV::SimpleDV::neig
qosNeighMetric neig
Definition:
SimpleDV.h:101
SimpleDV::RoutingUpdate::entriesEnd
entriesIt entriesEnd()
Definition:
SimpleDV.cc:51
SimpleDV::tTable
std::map< std::string, rtEntry > tTable
Definition:
SimpleDV.h:51
SimpleDV::rtTableIt
rtTable::iterator rtTableIt
Definition:
SimpleDV.h:54
IntRoutingUpdate
Definition:
IntRoutingUpdate.h:35
SimpleDV::SimpleDV::myAddr
std::string myAddr
Definition:
SimpleDV.h:100
SimpleDV::entriesL
std::vector< rtEntry > entriesL
Definition:
SimpleDV.h:43
SimpleDV::rtEntry::rtEntry
rtEntry()
Definition:
SimpleDV.h:33
SimpleDV::RoutingUpdate::qos
std::string qos
Definition:
SimpleDV.h:72
SimpleDV::rtTable
std::map< std::string, tTable > rtTable
Definition:
SimpleDV.h:52
entries2Next
std::map< qosPaddr, std::string > entries2Next
Definition:
IntPortsLoadRouting.h:23
SimpleDV::RoutingUpdate::RoutingUpdate
RoutingUpdate(const Address &_addr, const std::string &_src, const std::string &_qos)
Definition:
SimpleDV.cc:32
SimpleDV::RoutingUpdate::getSrc
std::string getSrc()
Definition:
SimpleDV.cc:37
SimpleDV::rtEntry::metric
unsigned short metric
Definition:
SimpleDV.h:32
SimpleDV::RoutingUpdate::getQoS
std::string getQoS()
Definition:
SimpleDV.cc:40
SimpleDV::neighMetric
std::map< Address, unsigned short > neighMetric
Definition:
SimpleDV.h:46
SimpleDV::tTableIt
tTable::iterator tTableIt
Definition:
SimpleDV.h:53
SimpleDV::RoutingUpdate::src
std::string src
Definition:
SimpleDV.h:71
SimpleDV::neighMetricIt
neighMetric::iterator neighMetricIt
Definition:
SimpleDV.h:48
IntSimpleRouting
Definition:
IntSimpleRouting.h:39
SimpleDV::RoutingUpdate::entries
entriesL entries
Definition:
SimpleDV.h:73
SimpleDV::RoutingUpdate::entriesBegin
entriesIt entriesBegin()
Definition:
SimpleDV.cc:48
IntSimpleRouting.h
SimpleDV::rtEntry::addr
std::string addr
Definition:
SimpleDV.h:31
SimpleDV::rtEntry::rtEntry
rtEntry(const std::string &_addr, const unsigned short &_metric)
Definition:
SimpleDV.h:37
SimpleDV
Definition:
SimpleDV.cc:25
SimpleDV::qosNeighMetric
std::map< std::string, neighMetric > qosNeighMetric
Definition:
SimpleDV.h:47
Address
Address class holds IPC Process identification.
Definition:
Address.h:42
SimpleDV::SimpleDV::infMetric
unsigned short infMetric
Definition:
SimpleDV.h:99
SimpleDV::SimpleDV::scheduledUpdate
bool scheduledUpdate
Definition:
SimpleDV.h:106
SimpleDV::RoutingUpdate
Definition:
SimpleDV.h:58
SimpleDV::RoutingUpdate::addEntry
void addEntry(rtEntry)
Definition:
SimpleDV.cc:44
policies
DIF
Routing
SimpleRouting
SimpleDV
SimpleDV.h
Generated on Tue Oct 25 2016 21:08:57 for RINASim by
1.8.10