Child: [180d2e] (diff)

Download this file

EFCP.h    114 lines (85 with data), 4.9 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
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
// Copyright Š 2014 PRISTINE Consortium (http://ict-pristine.eu)
//
// 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/.
//
/*
* @file EFCP.h
* @author Marcel Marek
* @date Apr 28, 2014
* @brief
* @detail
*/
#ifndef EFCP_H_
#define EFCP_H_
/*
*
*/
#include <omnetpp.h>
#include "Flow.h"
#include "EFCPTable.h"
#include "ExternConsts.h"
#include "EFCP_defs.h"
#include "RA.h"
//#include "EFCPInstance.h"
//#include "Delimiting.h"
//class EFCPInstance;
//class EFCPTableEntry;
//class EFCPTable;
class EFCP : public cSimpleModule {
private:
bool dtcpPresent; /*!<a Boolean that indicates whether this connection is using DTCP. */
bool winBased; /*!< a Boolean that indicates whether window-based flow control is in use.*/
bool rateBased; /*!<a Boolean indicates whether rate-based flow control is in use.*/
int maxClosedWinQueLen; /*!<an Integer that the number PDUs that can be put on the ClosedWindowQueue before something must be done.*/
bool flowCont; /*!<a Boolean that indicates whether Flow Control is in use. The equivalent of the relation (Window-based OR Rate-based).*/
bool rexmsnPresent; /*!<a Boolean that indicates whether Retransmission Control (potentially with gaps) is in use*/
int dataRexmsnMax; /*!<an Integer that indicates the number of times the retransmission of a PDU will be attempted before some other action must be taken.*/
int sendRate; /*!<an Integer that indicates the number of PDUs that may be sent in a TimePeriod. Used with rate-based flow control.*/
int timePeriod; /*!<an Integer that indicates the length of time in microseconds for pacing rate-based flow control.*/
int initCredit; /*!<an Integer added to the initial sequence number to get right window edge.*/
int seqNumRollOverThresh; /*!<Integer. When the sequence number is increasing beyond this value, the sequence number space is close to rolling over, a new
connection should be instantiated and bound to the same port-ids, so that new PDUs can
be sent on the new connection.*/
int initATimer; /*!<an integer assigned per flow that indicates the maximum time that a
receiver will wait before sending an Ack. Some DIFs may wish to set a maximum value for the DIF. */
int initSenderInactivTimer;/*!<an Integer that should be approximately 2Δt. This must be bounded. A DIF specification may want to specify a maximum value. */
int initRcvrInactivTimer; /*!<an Integer that should be approximately 3Δt. This must be bounded. A DIF specification may want to specify a maximum value.*/
int sendBytesFree; //The number of bytes that this flow can assume it currently has available for Writes
int sendBytesPercentFree; //The percent of bytes that is free for Writes
int sendBytesThresh; //The number of free bytes below which flow control should slow or block the user from doing any more Writes.
int sendBytesPercentThresh; //The percent of free bytes below, which flow control should slow or block the user from doing any more Writes.
int sendBuffFree; //The number of buffers of MaxSDU size that this flow can assume it currently has available for Writes.
int sendBuffPercentFree; //The percent of buffers of MaxSDU size that are free for Writes.
int sendBuffThresh; //The number of free buffers below which flow control should slow or block the user from doing any more Writes.
int sendBuffPercentThresh; //The percent of free buffers below which flow control should not advance or decreases the amount the Right Window Edge is moved.
EFCPTable* efcpTable;
RA* resourceAllocator;
Delimiting* createDelimiting(cModule* efcpi, int portId);
DTCP* createDTCP(cModule* efcpi);
// DTP dtp; //required part of the EFCP
// DTStateVector dtStateV; //data-transfer state vector
// DTCP* dtcp; //optional part of the EFCP
// int portId; //FAI-identifier
// std::map<unsigned int, DTP*> dtpMap; //list of currently existing DTP instances
protected:
virtual void initialize(int step);
// virtual int numInitStages() const {return 4;};
public:
EFCP();
virtual ~EFCP();
EFCPInstance* createEFCPI(Flow* flow, int cepId);
bool deleteEFCPI(Flow *flow);
};
#endif /* EFCP_H_ */