Switch to unified view

a b/src/policies/DIF/RA/Forwarding/PDUFTGPolicy.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
// Author: Kewin Rausch (kewin.rausch@create-net.org)
17
18
#ifndef __RINA_PDUFTGPOLICY_H
19
#define __RINA_PDUFTGPOLICY_H
20
21
#include <omnetpp.h>
22
23
#include "Flow.h"
24
#include "RMTPort.h"
25
#include "PDUFTGUpdate.h"
26
27
// Forwarding declaration.
28
class PDUFwdTabGenerator;
29
30
// Provides a base class for every policy used in the PDUFTG module.
31
//
32
class PDUFTGPolicy :
33
        public cSimpleModule
34
{
35
private:
36
37
protected:
38
    PDUFwdTabGenerator * fwdtg;
39
40
    void handleMessage(cMessage *msg);
41
    void initialize();
42
43
public:
44
    PDUFTGPolicy();
45
    ~PDUFTGPolicy();
46
47
    // Computes the initial state of the forwarding table.
48
    //
49
    virtual void computeForwardingTable();
50
51
    // Evaluated in term of policy defined flow if a flow exists.
52
    //
53
    virtual PDUFTGInfo * flowExists(Address addr, unsigned short qos);
54
55
    // Insert a new flow which has been open locally to this IPC Process.
56
    //
57
    virtual void insertNewFlow(Address addr, unsigned short qos, RMTPort * port);
58
59
    // Merge an incoming information with the existing ones.
60
    //
61
    virtual void mergeForwardingInfo(PDUFTGUpdate * info);
62
63
    // Removes a local opened flow.
64
    //
65
    virtual void removeFlow(Address addr, unsigned short qos);
66
};
67
68
#endif // __PDUFTGPOLICY_H