Download this file

IntPDUFG.h    72 lines (54 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef PDUFTG_H_
#define PDUFTG_H_
#include <omnetpp.h>
#include "PDUFGNeighbor.h"
#include "IntPDUForwarding.h"
#include "DA.h"
// This is mapped as string --> port because Address do not have <, > operators overloads.
typedef std::list<PDUFGNeighbor *> NeighborState;
typedef NeighborState::iterator EIter;
class IntPDUFG : public cSimpleModule {
public:
//Constructor/Destructor
IntPDUFG();
~IntPDUFG();
// Find the next known neighbor to reach the destination.
virtual PDUFGNeighbor * getNextNeighbor(const Address &destination, const unsigned short & qos);
//
// Flow up/down operations:
//
// Inserts a new flow through which a neighbor can be reached.
void insertFlowInfo(Address addr, unsigned short qos, RMTPort * port);
// Removes an existing flow from the existing ones.
void removeFlowInfo(RMTPort * port);
// A new flow has been inserted/or removed
virtual void insertedFlow(const Address &addr, const unsigned short &qos, RMTPort * port) = 0;
virtual void removedFlow(const Address &addr, const unsigned short &qos, RMTPort * port) = 0;
//Routing has processes a routing update
virtual void routingUpdated() = 0;
protected:
// Contains the list of N-DIF neighbors of this IPC Address.
//
NeighborState neiState;
// Initialize.
void initialize();
// Called after initialize
virtual void onPolicyInit() = 0;
private:
IntPDUForwarding * fwd;
};
#endif /* PDUFTG_H_ */