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;
22 struct { // Lowest to highest
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;
73 tTCPConnection *ConnectionsTail;
76 struct sTCPStoredPacket
78 struct sTCPStoredPacket *Next;
86 struct sTCPConnection *Next;
87 int State; //!< Connection state (see ::eTCPConnectionState)
88 Uint16 LocalPort; //!< Local port
89 Uint16 RemotePort; //!< Remote port
90 tInterface *Interface; //!< Listening Interface
91 tVFS_Node Node; //!< Node
93 int NextSequenceSend; //!< Next sequence value for outbound packets
94 int NextSequenceRcv; //!< Next expected sequence value for inbound
97 * \brief Non-ACKed packets
101 tSpinlock lQueuedPackets;
102 tTCPStoredPacket *QueuedPackets; //!< Non-ACKed packets
108 * \brief Unread Packets
109 * \note Double ended list (fifo)
112 tSpinlock lRecievedPackets;
113 tTCPStoredPacket *RecievedPackets; //!< Unread Packets
114 tTCPStoredPacket *RecievedPacketsTail; //!< Unread Packets (End of list)
120 * \brief Out of sequence packets
121 * \note Sorted list to improve times
124 tSpinlock lFuturePackets; //!< Future packets spinlock
125 tTCPStoredPacket *FuturePackets; //!< Out of sequence packets
133 } RemoteIP; //!< Remote IP Address
134 // Type is determined by LocalInterface->Type
137 enum eTCPConnectionState