RINASim  October 2016
Documentation of framework for OMNeT++
NFlowTable.h
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #ifndef __RINA_FAITABLE_H_
24 #define __RINA_FAITABLE_H_
25 
26 //Standard libraries
27 #include <omnetpp.h>
28 //RINASim library
29 #include "Utils.h"
30 #include "NFlowTableEntry.h"
31 
32 typedef std::list<NFlowTableEntry> TFAITable;
33 typedef std::list<NFlowTableEntry*> TFAIPtrs;
34 typedef TFAITable::iterator TFTIter;
35 typedef TFAITable::const_iterator TFTConstIter;
36 typedef TFAIPtrs::iterator TFTPtrsIter;
37 
38 //Statistic collextion
39 extern const char* SIG_STAT_FT_SIZE;
40 
41 class NFlowTable : public cSimpleModule
42 {
43  public:
44  std::string info() const;
45  void insertNew(Flow* flow);
46  void insert(const NFlowTableEntry& entry);
47  void removeByFlow(Flow* flow);
48  unsigned const int getSize() const;
49  NFlowTableEntry* findEntryByFlow(const Flow* flow);
50  NFlowTableEntry* findEntryByApns(const APN& srcApn, const APN& dstApn);
51  NFlowTableEntry* findMgmtEntry(const Flow* flow);
61  void setFaiToFlow(FAIBase* fai, Flow* flow);
64 
65  void updateDisplayString();
66 
67  protected:
68  virtual void initialize();
70  virtual void handleMessage(cMessage *msg);
71 
72  simsignal_t sigStatFTSize;
73 
74  private:
76 };
77 
78 //Free functions
79 /*
80 std::ostream& operator<< (std::ostream& os, const FlowTable& ft);
81 std::ostream& operator<< (std::ostream& os, const TFlowTable& ft);
82 std::ostream& operator<< (std::ostream& os, const TFlowTableEntry& fte);
83 */
84 
85 #endif
void initSignalsAndListeners()
Definition: NFlowTable.cc:202
NFlowTableEntry * findMgmtEntryByDstApni(const APN &dstApn)
Definition: NFlowTable.cc:225
NFlowTableEntry * findEntryByDstAddressAndFwd(const APN &apname)
Definition: NFlowTable.cc:51
Class representing flow object with attributes from specs.
Definition: Flow.h:45
TFAIPtrs findEntriesByDstNeighborAndFwd(const APN &apname)
Definition: NFlowTable.cc:86
unsigned const int getSize() const
Definition: NFlowTable.cc:235
TFAITable NFlowTab
Definition: NFlowTable.h:75
Application Process Name class.
Definition: APN.h:36
void removeByFlow(Flow *flow)
Definition: NFlowTable.cc:148
void insertNew(Flow *flow)
Definition: NFlowTable.cc:136
TFAITable::const_iterator TFTConstIter
Definition: NFlowTable.h:35
void insert(const NFlowTableEntry &entry)
Definition: NFlowTable.cc:143
void changeAllocStatus(Flow *flow, NFlowTableEntry::EAllocateStatus status)
Definition: NFlowTable.cc:173
virtual void handleMessage(cMessage *msg)
Definition: NFlowTable.cc:132
std::list< NFlowTableEntry > TFAITable
Definition: NFlowTable.h:32
NFlowTableEntry * findEntryByInvokeId(long invId)
Definition: NFlowTable.cc:97
TFAIPtrs findEntriesAffectedByMgmt(const APNIPair *apnip)
Definition: NFlowTable.cc:239
TFAIPtrs::iterator TFTPtrsIter
Definition: NFlowTable.h:36
EAllocateStatus
std::list< NFlowTableEntry * > TFAIPtrs
Definition: NFlowTable.h:33
virtual void initialize()
Definition: NFlowTable.cc:30
NFlowTableEntry * findMgmtEntry(const Flow *flow)
Definition: NFlowTable.cc:206
const char * SIG_STAT_FT_SIZE
Definition: NFlowTable.cc:26
std::string info() const
Definition: NFlowTable.cc:38
void setFaiToFlow(FAIBase *fai, Flow *flow)
Definition: NFlowTable.cc:190
NFlowTableEntry * findEntryByApns(const APN &srcApn, const APN &dstApn)
Definition: NFlowTable.cc:75
NFlowTableEntry * findMgmtEntryByDstNeighbor(const Address &addr)
Definition: NFlowTable.cc:122
simsignal_t sigStatFTSize
Definition: NFlowTable.h:72
NFlowTableEntry * findEntryBySrcAddressAndFwd(const APN &apname)
Definition: NFlowTable.cc:61
void updateDisplayString()
Definition: NFlowTable.cc:195
TFAITable::iterator TFTIter
Definition: NFlowTable.h:34
Address class holds IPC Process identification.
Definition: Address.h:42
NFlowTableEntry * findEntryByFlow(const Flow *flow)
Definition: NFlowTable.cc:155
NFlowTableEntry * findMgmtEntryByDstAddr(const Address &addr)
Definition: NFlowTable.cc:215
NFlowTableEntry * findEntryByFai(FAIBase *fai)
Definition: NFlowTable.cc:164