X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Ftcp.h;h=cdd3a8f0e99909f3eb49eaa005ebf6f8919ef325;hb=ede46f1819c8b3c51d04829cac8bd95bcc602d8f;hp=87515ce981f910f738d5ef26b8cd26e85861e663;hpb=37e9151e7bc0b7341050286fde4341a8f0f9333c;p=tpg%2Facess2.git diff --git a/Modules/IPStack/tcp.h b/Modules/IPStack/tcp.h index 87515ce9..cdd3a8f0 100644 --- a/Modules/IPStack/tcp.h +++ b/Modules/IPStack/tcp.h @@ -19,7 +19,7 @@ struct sTCPHeader Uint32 SequenceNumber; Uint32 AcknowlegementNumber; #if 0 - struct { + struct { // Lowest to highest unsigned Reserved: 4; unsigned DataOffset: 4; // Size of the header in 32-bit words } __attribute__ ((packed)); @@ -69,12 +69,14 @@ struct sTCPListener int NextID; //!< Name of the next connection tSpinlock lConnections; //!< Spinlock for connections tTCPConnection *Connections; //!< Connections (linked list) - tTCPConnection *volatile NewConnections; + tTCPConnection *volatile NewConnections; + tTCPConnection *ConnectionsTail; }; struct sTCPStoredPacket { struct sTCPStoredPacket *Next; + size_t Length; Uint32 Sequence; Uint8 Data[]; }; @@ -88,16 +90,41 @@ struct sTCPConnection tInterface *Interface; //!< Listening Interface tVFS_Node Node; //!< Node - int NextSequenceSend; //!< Next sequence value for outbound packets - int NextSequenceRcv; //!< Next expected sequence value for inbound + Uint32 NextSequenceSend; //!< Next sequence value for outbound packets + Uint32 NextSequenceRcv; //!< Next expected sequence value for inbound + /** + * \brief Non-ACKed packets + * \note FIFO list + * \{ + */ + tSpinlock lQueuedPackets; tTCPStoredPacket *QueuedPackets; //!< Non-ACKed packets + /** + * \} + */ + /** + * \brief Unread Packets + * \note Ring buffer + * \{ + */ tSpinlock lRecievedPackets; - tTCPStoredPacket *RecievedPackets; //!< Unread Packets - tTCPStoredPacket *RecievedPacketsTail; //!< Unread Packets (End of list) + tRingBuffer *RecievedBuffer; + /** + * \} + */ + /** + * \brief Out of sequence packets + * \note Sorted list to improve times + * \{ + */ + tSpinlock lFuturePackets; //!< Future packets spinlock tTCPStoredPacket *FuturePackets; //!< Out of sequence packets + /** + * \} + */ union { tIPv4 v4;