X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Ftcp.h;h=ab910fb9446dc89bb371673df8b5cbf6b45e8685;hb=b0ab9997c3256041087483c0840247821bfa55c8;hp=93e5c1ed07d9ff2561983b14d391d6d3a4c44e2e;hpb=d42ba7958374f7f19500320d17b34267c9ae416c;p=tpg%2Facess2.git diff --git a/Modules/IPStack/tcp.h b/Modules/IPStack/tcp.h index 93e5c1ed..ab910fb9 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)); @@ -67,9 +67,10 @@ struct sTCPListener tInterface *Interface; //!< Listening Interface tVFS_Node Node; //!< Server Directory node int NextID; //!< Name of the next connection - tSpinlock lConnections; //!< Spinlock for connections + tShortSpinlock lConnections; //!< Spinlock for connections tTCPConnection *Connections; //!< Connections (linked list) - tTCPConnection *volatile NewConnections; + tTCPConnection *volatile NewConnections; + tTCPConnection *ConnectionsTail; }; struct sTCPStoredPacket @@ -89,15 +90,15 @@ 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; + tMutex lQueuedPackets; tTCPStoredPacket *QueuedPackets; //!< Non-ACKed packets /** * \} @@ -105,12 +106,11 @@ struct sTCPConnection /** * \brief Unread Packets - * \note Double ended list (fifo) + * \note Ring buffer * \{ */ - tSpinlock lRecievedPackets; - tTCPStoredPacket *RecievedPackets; //!< Unread Packets - tTCPStoredPacket *RecievedPacketsTail; //!< Unread Packets (End of list) + tMutex lRecievedPackets; + tRingBuffer *RecievedBuffer; /** * \} */ @@ -120,7 +120,7 @@ struct sTCPConnection * \note Sorted list to improve times * \{ */ - tSpinlock lFuturePackets; //!< Future packets spinlock + tShortSpinlock lFuturePackets; //!< Future packets spinlock tTCPStoredPacket *FuturePackets; //!< Out of sequence packets /** * \} @@ -136,8 +136,11 @@ struct sTCPConnection enum eTCPConnectionState { TCP_ST_CLOSED, + TCP_ST_SYN_SENT, TCP_ST_HALFOPEN, - TCP_ST_OPEN + TCP_ST_OPEN, + TCP_ST_FIN_SENT, + TCP_ST_FINISHED }; #endif