RINASim  October 2016
Documentation of framework for OMNeT++
IntPortsLoadRouting.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 __INTPORTSLOADROUTING_H
17 #define __INTPORTSLOADROUTING_H
18 
19 #include <IntRouting.h>
20 #include <string>
21 
22 typedef std::pair<std::string, std::string> qosPaddr;
23 typedef std::map<qosPaddr, std::string> entries2Next;
24 typedef std::pair<qosPaddr, std::string> entries2NextItem;
25 typedef entries2Next::iterator entries2NextIt;
26 
28 {
29 public:
30 
31  // Process a Routing Update, return true => inform FWDG of the update.
32  virtual bool processUpdate(IntRoutingUpdate * update) = 0;
33 
34  // New flow inserted.
35  virtual void insertFlow(
36  const Address &addr,
37  const std::string &dst,
38  const std::string &qos,
39  const unsigned short &metric,
40  bool sendUpdate) = 0;
41 
42  // Existing flow removal.
43  virtual void removeFlow(
44  const Address &addr,
45  const std::string &dst,
46  const std::string &qos,
47  bool sendUpdate) = 0;
48 
49  // Get Changes.
50  virtual entries2Next getChanges() = 0;
51  virtual entries2Next getAll() = 0;
52 
53  // Force the scheduling of a routing update message.
54  virtual void scheduleUpdate() = 0;
55 
56 protected:
57  // Called after initialize.
58  virtual void onPolicyInit() = 0;
59 };
60 
61 #endif // __INTPORTSLOADROUTING_H
virtual void insertFlow(const Address &addr, const std::string &dst, const std::string &qos, const unsigned short &metric, bool sendUpdate)=0
virtual entries2Next getChanges()=0
virtual void removeFlow(const Address &addr, const std::string &dst, const std::string &qos, bool sendUpdate)=0
std::pair< qosPaddr, std::string > entries2NextItem
std::map< qosPaddr, std::string > entries2Next
virtual void scheduleUpdate()=0
virtual entries2Next getAll()=0
virtual bool processUpdate(IntRoutingUpdate *update)=0
entries2Next::iterator entries2NextIt
void sendUpdate(IntRoutingUpdate *update)
Definition: IntRouting.cc:62
virtual void onPolicyInit()=0
std::pair< std::string, std::string > qosPaddr
Address class holds IPC Process identification.
Definition: Address.h:42