3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #define PROTO_TCP_CONN_STATE_ESTABILISH 0x1
25 #define PROTO_TCP_CONN_STATE_ESTABILISHED 0x2
26 #define PROTO_TCP_CONN_STATE_DISCONNECTED 0x4
27 #define PROTO_TCP_CONN_STATE_WAIT 0x8
28 #define PROTO_TCP_CONN_STATE_READY 0x10
29 #define PROTO_TCP_CONN_STATE_CLOSE 0x20
30 #define PROTO_TCP_CONN_STATE_ESTABILISHERROR 0x40
32 /* TCP connection structure */
33 typedef struct proto_tcp_conn_context
{
34 struct proto_tcp_conn_context
*next
, *prev
;
57 unsigned short offset
;
62 /* TCPv6 connection structure */
63 typedef struct proto_tcp6_conn_context
{
64 struct proto_tcp6_conn_context
*next
, *prev
;
87 unsigned short offset
;
92 /* TCP server backlog structure */
93 typedef struct proto_tcp_backlog_context
{
94 struct proto_tcp_backlog_context
*next
, *prev
;
102 proto_tcp_conn_t
*conn
;
103 } proto_tcp_backlog_t
;
105 /* TCPv6 server backlog structure */
106 typedef struct proto_tcp6_backlog_context
{
107 struct proto_tcp6_backlog_context
*next
, *prev
;
115 proto_tcp6_conn_t
*conn
;
116 } proto_tcp6_backlog_t
;
118 /* TCP layer structure */
119 typedef struct proto_tcp_t
{
120 net_port port_source
; // 2
121 net_port port_dest
; // 4
126 unsigned char res
:4; // 13
127 unsigned char data_offset
:4;
129 unsigned char flags
; // 14
131 unsigned short window
; // 16
133 unsigned short checksum
; // 18
135 // unsigned char *options;
139 extern unsigned init_net_proto_tcp ();
140 extern unsigned init_net_proto_tcp6 ();