10 typedef struct sTCPHeader tTCPHeader;
11 typedef struct sTCPListener tTCPListener;
12 typedef struct sTCPStoredPacket tTCPStoredPacket;
13 typedef struct sTCPConnection tTCPConnection;
19 Uint32 SequenceNumber;
20 Uint32 AcknowlegementNumber;
24 unsigned DataOffset: 4; // Size of the header in 32-bit words
25 } __attribute__ ((packed));
30 struct { // Lowest to Highest
31 unsigned FIN: 1; // Last packet
32 unsigned SYN: 1; // Synchronise Sequence Numbers
33 unsigned RST: 1; // Reset Connection
34 unsigned PSH: 1; // Push Function
35 unsigned ACK: 1; // Acknowlegement field is significant
36 unsigned URG: 1; // Urgent pointer is significant
37 unsigned ECE: 1; // ECN-Echo
38 unsigned CWR: 1; // Congestion Window Reduced
39 } __attribute__ ((packed)) Flags;
49 } __attribute__ ((packed));
65 struct sTCPListener *Next; //!< Next server in the list
66 Uint16 Port; //!< Listening port (0 disables the server)
67 tInterface *Interface; //!< Listening Interface
68 tVFS_Node Node; //!< Server Directory node
69 int NextID; //!< Name of the next connection
70 tSpinlock lConnections; //!< Spinlock for connections
71 tTCPConnection *Connections; //!< Connections (linked list)
72 tTCPConnection *volatile NewConnections;
75 struct sTCPStoredPacket
77 struct sTCPStoredPacket *Next;
85 struct sTCPConnection *Next;
86 int State; //!< Connection state (see ::eTCPConnectionState)
87 Uint16 LocalPort; //!< Local port
88 Uint16 RemotePort; //!< Remote port
89 tInterface *Interface; //!< Listening Interface
90 tVFS_Node Node; //!< Node
92 int NextSequenceSend; //!< Next sequence value for outbound packets
93 int NextSequenceRcv; //!< Next expected sequence value for inbound
96 * \brief Non-ACKed packets
100 tSpinlock lQueuedPackets;
101 tTCPStoredPacket *QueuedPackets; //!< Non-ACKed packets
107 * \brief Unread Packets
108 * \note Double ended list (fifo)
111 tSpinlock lRecievedPackets;
112 tTCPStoredPacket *RecievedPackets; //!< Unread Packets
113 tTCPStoredPacket *RecievedPacketsTail; //!< Unread Packets (End of list)
119 * \brief Out of sequence packets
120 * \note Sorted list to improve times
123 tSpinlock lFuturePackets; //!< Future packets spinlock
124 tTCPStoredPacket *FuturePackets; //!< Out of sequence packets
132 } RemoteIP; //!< Remote IP Address
133 // Type is determined by LocalInterface->Type
136 enum eTCPConnectionState