TCB_STUB Structure

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
TCB_STUB Structure
C
typedef struct {
  PTR_BASE bufferTxStart;
  PTR_BASE bufferRxStart;
  PTR_BASE bufferEnd;
  PTR_BASE txHead;
  PTR_BASE txTail;
  PTR_BASE rxHead;
  PTR_BASE rxTail;
  DWORD eventTime;
  WORD eventTime2;
  union {
    WORD delayedACKTime;
    WORD closeWaitTime;
  } OverlappedTimers;
  TCP_STATE smState;
  struct {
    unsigned char vUnackedKeepalives : 3;
    unsigned char bServer : 1;
    unsigned char bTimerEnabled : 1;
    unsigned char bTimer2Enabled : 1;
    unsigned char bDelayedACKTimerEnabled : 1;
    unsigned char bOneSegmentReceived : 1;
    unsigned char bHalfFullFlush : 1;
    unsigned char bTXASAP : 1;
    unsigned char bTXASAPWithoutTimerReset : 1;
    unsigned char bTXFIN : 1;
    unsigned char bSocketReset : 1;
    unsigned char bSSLHandshaking : 1;
    unsigned char filler : 2;
  } Flags;
  WORD_VAL remoteHash;
  PTR_BASE sslTxHead;
  PTR_BASE sslRxHead;
  BYTE sslStubID;
  BYTE sslReqMessage;
  BYTE vMemoryMedium;
} TCB_STUB;
Description

TCP Control Block (TCB) stub data storage. Stubs are stored in local PIC RAM for speed. Current size is 34 bytes (PIC18), 36 bytes (PIC24/dsPIC), or 56 (PIC32)

Members
Members 
Description 
PTR_BASE bufferTxStart; 
First byte of TX buffer 
PTR_BASE bufferRxStart; 
First byte of RX buffer. TX buffer ends 1 byte prior 
PTR_BASE bufferEnd; 
Last byte of RX buffer 
PTR_BASE txHead; 
Head pointer for TX 
PTR_BASE txTail; 
Tail pointer for TX 
PTR_BASE rxHead; 
Head pointer for RX 
PTR_BASE rxTail; 
Tail pointer for RX 
DWORD eventTime; 
Packet retransmissions, state changes 
WORD eventTime2; 
Window updates, automatic transmission 
WORD delayedACKTime; 
Delayed Acknowledgement timer 
WORD closeWaitTime; 
TCP_CLOSE_WAIT timeout timer 
TCP_STATE smState; 
State of this socket 
unsigned char vUnackedKeepalives : 3; 
Count of how many keepalives have been sent with no response 
unsigned char bServer : 1; 
Socket should return to listening state when closed 
unsigned char bTimerEnabled : 1; 
Timer is enabled 
unsigned char bTimer2Enabled : 1; 
Second timer is enabled 
unsigned char bDelayedACKTimerEnabled : 1; 
DelayedACK timer is enabled 
unsigned char bOneSegmentReceived : 1; 
A segment has been received 
unsigned char bHalfFullFlush : 1; 
Flush is for being half full 
unsigned char bTXASAP : 1; 
Transmit as soon as possible (for Flush) 
unsigned char bTXASAPWithoutTimerReset : 1; 
Transmit as soon as possible (for Flush), but do not reset retransmission timers 
unsigned char bTXFIN : 1; 
FIN needs to be transmitted 
unsigned char bSocketReset : 1; 
Socket has been reset (self-clearing semaphore) 
unsigned char bSSLHandshaking : 1; 
Socket is in an SSL handshake 
unsigned char filler : 2; 
Future expansion 
WORD_VAL remoteHash; 
Consists of remoteIP, remotePort, localPort for connected sockets. It is a localPort number only for listening server sockets. 
PTR_BASE sslTxHead; 
Position of data being written in next SSL application record Also serves as cache of localSSLPort when smState = TCP_LISTENING 
PTR_BASE sslRxHead; 
Position of incoming data not yet handled by SSL 
BYTE sslStubID; 
Which sslStub is associated with this connection 
BYTE sslReqMessage; 
Currently requested SSL message 
BYTE vMemoryMedium; 
Which memory medium the TCB is actually stored 
Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.