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;
84 struct sTCPConnection *Next;
85 int State; //!< Connection state (see ::eTCPConnectionState)
86 Uint16 LocalPort; //!< Local port
87 Uint16 RemotePort; //!< Remote port
88 tInterface *Interface; //!< Listening Interface
89 tVFS_Node Node; //!< Node
91 int NextSequenceSend; //!< Next sequence value for outbound packets
92 int NextSequenceRcv; //!< Next expected sequence value for inbound
94 tTCPStoredPacket *QueuedPackets; //!< Non-ACKed packets
96 tSpinlock lRecievedPackets;
97 tTCPStoredPacket *RecievedPackets; //!< Unread Packets
98 tTCPStoredPacket *RecievedPacketsTail; //!< Unread Packets (End of list)
100 tTCPStoredPacket *FuturePackets; //!< Out of sequence packets
105 } RemoteIP; //!< Remote IP Address
106 // Type is determined by LocalInterface->Type
109 enum eTCPConnectionState