INET Framework for OMNeT++/OMNEST
inet::tcp::TcpLwipVirtualDataReceiveQueue Class Reference

Receive queue that manages "virtual bytes", that is, byte counts only. More...

#include <TcpLwipVirtualDataQueues.h>

Inheritance diagram for inet::tcp::TcpLwipVirtualDataReceiveQueue:
inet::tcp::TcpLwipReceiveQueue

Public Member Functions

 TcpLwipVirtualDataReceiveQueue ()
 Ctor. More...
 
virtual ~TcpLwipVirtualDataReceiveQueue ()
 Virtual dtor. More...
 
virtual void setConnection (TcpLwipConnection *connP) override
 Add a connection queue. More...
 
virtual void notifyAboutIncomingSegmentProcessing (TCPSegment *tcpsegP, uint32 seqNo, const void *bufferP, size_t bufferLengthP) override
 Called when a TCP segment arrives, it should extract the payload from the segment and store it in the receive queue. More...
 
virtual void enqueueTcpLayerData (void *dataP, unsigned int dataLengthP) override
 The method called when data received from LWIP The method should set status of the data in queue to received called after socket->read_data() successfull. More...
 
virtual cPacket * extractBytesUpTo () override
 Should create a packet to be passed up to the app, up to (but NOT including) the given sequence no (usually rcv_nxt). More...
 
virtual uint32 getAmountOfBufferedBytes () const override
 Returns the number of bytes (out-of-order-segments) currently buffered in queue. More...
 
virtual uint32 getQueueLength () const override
 Returns the number of blocks currently buffered in queue. More...
 
virtual void getQueueStatus () const override
 Shows current queue status. More...
 
virtual void notifyAboutSending (const TCPSegment *tcpsegP) override
 notify the queue about output messages More...
 
- Public Member Functions inherited from inet::tcp::TcpLwipReceiveQueue
 TcpLwipReceiveQueue ()
 Ctor. More...
 
virtual ~TcpLwipReceiveQueue ()
 Virtual dtor. More...
 

Protected Attributes

long int bytesInQueueM
 
- Protected Attributes inherited from inet::tcp::TcpLwipReceiveQueue
TcpLwipConnectionconnM
 

Detailed Description

Receive queue that manages "virtual bytes", that is, byte counts only.

Constructor & Destructor Documentation

inet::tcp::TcpLwipVirtualDataReceiveQueue::TcpLwipVirtualDataReceiveQueue ( )

Ctor.

103  :
104  bytesInQueueM(0)
105 {
106 }
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
inet::tcp::TcpLwipVirtualDataReceiveQueue::~TcpLwipVirtualDataReceiveQueue ( )
virtual

Virtual dtor.

109 {
110  // nothing to do here
111 }

Member Function Documentation

void inet::tcp::TcpLwipVirtualDataReceiveQueue::enqueueTcpLayerData ( void *  dataP,
unsigned int  dataLengthP 
)
overridevirtual

The method called when data received from LWIP The method should set status of the data in queue to received called after socket->read_data() successfull.

Implements inet::tcp::TcpLwipReceiveQueue.

128 {
129  bytesInQueueM += dataLengthP;
130 }
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
cPacket * inet::tcp::TcpLwipVirtualDataReceiveQueue::extractBytesUpTo ( )
overridevirtual

Should create a packet to be passed up to the app, up to (but NOT including) the given sequence no (usually rcv_nxt).

It should return nullptr if there's no more data to be passed up – this method is called several times until it returns nullptr.

called after socket->read_data() successfull

Implements inet::tcp::TcpLwipReceiveQueue.

133 {
134  ASSERT(connM);
135 
136  cPacket *dataMsg = nullptr;
137 
138  if (bytesInQueueM) {
139  dataMsg = new cPacket("DATA");
140  dataMsg->setKind(TCP_I_DATA);
141  dataMsg->setByteLength(bytesInQueueM);
142  bytesInQueueM -= dataMsg->getByteLength();
143  }
144 
145  return dataMsg;
146 }
TcpLwipConnection * connM
Definition: TcpLwipQueues.h:216
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
Definition: TCPCommand_m.h:98
uint32 inet::tcp::TcpLwipVirtualDataReceiveQueue::getAmountOfBufferedBytes ( ) const
overridevirtual

Returns the number of bytes (out-of-order-segments) currently buffered in queue.

Implements inet::tcp::TcpLwipReceiveQueue.

149 {
150  return bytesInQueueM;
151 }
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
uint32 inet::tcp::TcpLwipVirtualDataReceiveQueue::getQueueLength ( ) const
overridevirtual

Returns the number of blocks currently buffered in queue.

Implements inet::tcp::TcpLwipReceiveQueue.

154 {
155  return bytesInQueueM ? 1 : 0;
156 }
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
void inet::tcp::TcpLwipVirtualDataReceiveQueue::getQueueStatus ( ) const
overridevirtual

Shows current queue status.

Implements inet::tcp::TcpLwipReceiveQueue.

159 {
160  // TODO
161 }
void inet::tcp::TcpLwipVirtualDataReceiveQueue::notifyAboutIncomingSegmentProcessing ( TCPSegment tcpsegP,
uint32  seqNo,
const void *  bufferP,
size_t  bufferLengthP 
)
overridevirtual

Called when a TCP segment arrives, it should extract the payload from the segment and store it in the receive queue.

The segment object should not be deleted. //FIXME revise this comment

Implements inet::tcp::TcpLwipReceiveQueue.

122 {
123  ASSERT(tcpsegP);
124  ASSERT(bufferP);
125 }
void inet::tcp::TcpLwipVirtualDataReceiveQueue::notifyAboutSending ( const TCPSegment tcpsegP)
overridevirtual

notify the queue about output messages

called when connM send out a packet. for read AckNo, if have

Implements inet::tcp::TcpLwipReceiveQueue.

164 {
165  // nothing to do
166 }
void inet::tcp::TcpLwipVirtualDataReceiveQueue::setConnection ( TcpLwipConnection connP)
overridevirtual

Add a connection queue.

Reimplemented from inet::tcp::TcpLwipReceiveQueue.

114 {
115  ASSERT(connP);
116 
117  bytesInQueueM = 0;
119 }
long int bytesInQueueM
Definition: TcpLwipVirtualDataQueues.h:106
virtual void setConnection(TcpLwipConnection *connP)
Add a connection queue.
Definition: TcpLwipQueues.h:164

Member Data Documentation

long int inet::tcp::TcpLwipVirtualDataReceiveQueue::bytesInQueueM
protected

The documentation for this class was generated from the following files: