|
a |
|
b/src/policies/DIF/RA/PDUFG/IntPDUFG.h |
|
|
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 PDUFTG_H_
|
|
|
17 |
#define PDUFTG_H_
|
|
|
18 |
|
|
|
19 |
#include <omnetpp.h>
|
|
|
20 |
|
|
|
21 |
#include "PDUFGNeighbor.h"
|
|
|
22 |
#include "IntPDUForwarding.h"
|
|
|
23 |
#include "DA.h"
|
|
|
24 |
|
|
|
25 |
// This is mapped as string --> port because Address do not have <, > operators overloads.
|
|
|
26 |
typedef std::list<PDUFGNeighbor *> NeighborState;
|
|
|
27 |
typedef NeighborState::iterator EIter;
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
class IntPDUFG : public cSimpleModule {
|
|
|
31 |
public:
|
|
|
32 |
|
|
|
33 |
//Constructor/Destructor
|
|
|
34 |
IntPDUFG();
|
|
|
35 |
~IntPDUFG();
|
|
|
36 |
|
|
|
37 |
// Find the next known neighbor to reach the destination.
|
|
|
38 |
virtual PDUFGNeighbor * getNextNeighbor(const Address &destination, const unsigned short & qos);
|
|
|
39 |
|
|
|
40 |
//
|
|
|
41 |
// Flow up/down operations:
|
|
|
42 |
//
|
|
|
43 |
|
|
|
44 |
// Inserts a new flow through which a neighbor can be reached.
|
|
|
45 |
void insertFlowInfo(Address addr, unsigned short qos, RMTPort * port);
|
|
|
46 |
// Removes an existing flow from the existing ones.
|
|
|
47 |
void removeFlowInfo(RMTPort * port);
|
|
|
48 |
|
|
|
49 |
// A new flow has been inserted/or removed
|
|
|
50 |
virtual void insertedFlow(const Address &addr, const unsigned short &qos, RMTPort * port) = 0;
|
|
|
51 |
virtual void removedFlow(const Address &addr, const unsigned short &qos, RMTPort * port) = 0;
|
|
|
52 |
|
|
|
53 |
//Routing has processes a routing update
|
|
|
54 |
virtual void routingUpdated() = 0;
|
|
|
55 |
|
|
|
56 |
protected:
|
|
|
57 |
// Contains the list of N-DIF neighbors of this IPC Address.
|
|
|
58 |
//
|
|
|
59 |
NeighborState neiState;
|
|
|
60 |
|
|
|
61 |
// Initialize.
|
|
|
62 |
void initialize();
|
|
|
63 |
|
|
|
64 |
// Called after initialize
|
|
|
65 |
virtual void onPolicyInit() = 0;
|
|
|
66 |
|
|
|
67 |
private:
|
|
|
68 |
IntPDUForwarding * fwd;
|
|
|
69 |
};
|
|
|
70 |
|
|
|
71 |
#endif /* PDUFTG_H_ */
|