RINASim  October 2016
Documentation of framework for OMNeT++
PortsLoadLS.h
Go to the documentation of this file.
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 __PORTSLOADLS_H
17 #define __PORTSLOADLS_H
18 
19 #include <IntPortsLoadRouting.h>
20 #include <PortsLoadRU.h>
21 #include <PLLSCommon.h>
22 
24 {
25 public:
26  // Process a Routing Update, return true => inform FWDG of the update.
27  bool processUpdate(IntRoutingUpdate * update);
28 
29  // New flow inserted.
30  virtual void insertFlow(
31  const Address &addr,
32  const std::string &dst,
33  const std::string &qos,
34  const unsigned short &metric,
35  bool sendUpdate);
36 
37  // Existing flow removal.
38  virtual void removeFlow(
39  const Address &addr,
40  const std::string &dst,
41  const std::string &qos,
42  bool sendUpdate);
43 
44  // Get changes.
47 
48  void handleMessage(cMessage *msg);
49  void finish();
50 
51  // Force the scheduling of a routing update message.
52  virtual void scheduleUpdate();
53 
54 protected:
55  // Called after initialize.
56  void onPolicyInit();
57 
58 private:
59  unsigned short infMetric;
60  std::string myAddr;
64  unsigned int secId;
65  linksSt getChangedEntries (const std::string &qos);
66 
67  // Number of seconds to wait to send the next routing update packet.
68  unsigned int updateTimeout;
69 
71  void addRecursive(
72  entries2Next &ret,
73  const std::string &qos,
74  const std::string &next,
75  TreeNode * t);
76 
78 
80 
81  void printTreeNode(TreeNode *t, const std::string &next);
82 };
83 
84 #endif // __PORTSLOADLS_H
qosNeighMetric neig
Definition: PortsLoadLS.h:61
std::map< std::string, linksU > linksSt
Definition: PLLSCommon.h:38
virtual void insertFlow(const Address &addr, const std::string &dst, const std::string &qos, const unsigned short &metric, bool sendUpdate)
Definition: PortsLoadLS.cc:5
linksSt getChangedEntries(const std::string &qos)
Definition: PortsLoadLS.cc:297
entries2Next table
Definition: PortsLoadLS.h:79
virtual void removeFlow(const Address &addr, const std::string &dst, const std::string &qos, bool sendUpdate)
Definition: PortsLoadLS.cc:31
entries2Next getChanges()
Definition: PortsLoadLS.cc:75
void handleMessage(cMessage *msg)
Definition: PortsLoadLS.cc:264
void addRecursive(entries2Next &ret, const std::string &qos, const std::string &next, TreeNode *t)
Definition: PortsLoadLS.cc:201
std::map< std::string, addrSet > qos2addrSet
Definition: PLLSCommon.h:56
unsigned int updateTimeout
Definition: PortsLoadLS.h:68
std::map< qosPaddr, std::string > entries2Next
entries2Next getAll()
Definition: PortsLoadLS.cc:107
void finish()
Definition: PortsLoadLS.cc:311
bool scheduledUpdate
Definition: PortsLoadLS.h:77
std::string myAddr
Definition: PortsLoadLS.h:60
std::map< std::string, linksSt > linksStCol
Definition: PLLSCommon.h:41
std::map< std::string, neighMetric > qosNeighMetric
Definition: PLLSCommon.h:49
bool processUpdate(IntRoutingUpdate *update)
Definition: PortsLoadLS.cc:213
linksStCol netState
Definition: PortsLoadLS.h:62
virtual void scheduleUpdate()
Definition: PortsLoadLS.cc:62
unsigned short infMetric
Definition: PortsLoadLS.h:59
void printTreeNode(TreeNode *t, const std::string &next)
Definition: PortsLoadLS.cc:333
unsigned int secId
Definition: PortsLoadLS.h:64
void onPolicyInit()
Definition: PortsLoadLS.cc:246
void sendUpdate(IntRoutingUpdate *update)
Definition: IntRouting.cc:62
qos2addrSet lastChanges
Definition: PortsLoadLS.h:63
Address class holds IPC Process identification.
Definition: Address.h:42
TreeNode constructTree(linksSt &ls)
Definition: PortsLoadLS.cc:129