Main Page | Class List | File List | Class Members | File Members

tcp.h File Reference

#include "tcpproxy.h"

Go to the source code of this file.

Defines

#define TCP_PROTO   6
#define IP_VERSION   4
#define IP_START_TTL   254
#define TCP_LINK_MSS   1402
#define TCP_TWO_MSL   60000
#define TCP_WIN_CLAMP_SIZE   12618

Typedefs

typedef tcp_cid Ttcp_cid
typedef enum tcp_state Ttcp_state
typedef tcp_cb Ttcp_cb

Enumerations

enum  tcp_state {
  TCPS_FREE = 0, TCPS_NEW, TCPS_SYN_SENT, TCPS_SYN_RECV,
  TCPS_ESTABLISHED, TCPS_FIN_WAIT1, TCPS_FIN_WAIT2, TCPS_TIME_WAIT,
  TCPS_CLOSED, TCPS_CLOSE_WAIT, TCPS_LAST_ACK, TCPS_CLOSING,
  TCPS_MAX_STATES
}
enum  { TCP_INIT_MH_SEQ = 1, TCP_INIT_MH_ACK = 2, TCP_INIT_FH_SEQ = 4, TCP_INIT_FH_ACK = 8 }

Functions

void init_tcp ()
void cleanup_tcp ()
int seq_cmp (unsigned a, unsigned b)
int tcp_data_size (Tpacket_data *pd)
void tcp_timeout (void *ptr)
int handle_tcp (Tpacket_data *pd)


Define Documentation

#define IP_START_TTL   254
 

Definition at line 12 of file tcp.h.

Referenced by send_tcp_rst().

#define IP_VERSION   4
 

Definition at line 11 of file tcp.h.

Referenced by send_tcp_rst().

#define TCP_LINK_MSS   1402
 

Definition at line 13 of file tcp.h.

#define TCP_PROTO   6
 

Definition at line 10 of file tcp.h.

Referenced by send_tcp_rst(), and tcp_chksum().

#define TCP_TWO_MSL   60000
 

Definition at line 14 of file tcp.h.

Referenced by tcps_close_wait(), tcps_closing(), tcps_fin_wait1(), tcps_fin_wait2(), and tcps_new().

#define TCP_WIN_CLAMP_SIZE   12618
 

Definition at line 15 of file tcp.h.


Typedef Documentation

typedef struct tcp_cb Ttcp_cb
 

typedef struct tcp_cid Ttcp_cid
 

typedef enum tcp_state Ttcp_state
 


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
TCP_INIT_MH_SEQ 
TCP_INIT_MH_ACK 
TCP_INIT_FH_SEQ 
TCP_INIT_FH_ACK 

Definition at line 44 of file tcp.h.

enum tcp_state
 

Enumeration values:
TCPS_FREE 
TCPS_NEW 
TCPS_SYN_SENT 
TCPS_SYN_RECV 
TCPS_ESTABLISHED 
TCPS_FIN_WAIT1 
TCPS_FIN_WAIT2 
TCPS_TIME_WAIT 
TCPS_CLOSED 
TCPS_CLOSE_WAIT 
TCPS_LAST_ACK 
TCPS_CLOSING 
TCPS_MAX_STATES 

Definition at line 27 of file tcp.h.


Function Documentation

void cleanup_tcp  ) 
 

Definition at line 52 of file tcp.c.

Referenced by main().

int handle_tcp Tpacket_data pd  ) 
 

Definition at line 668 of file tcp.c.

References alloc_tcp_cb(), allow_conn(), tcp_cb::cid, clamp_tcp_win(), clear_timer(), tcp_cid::daddr, dealloc_packet_data(), dealloc_tcp_cb(), packet_data::dir, tcp_cid::dport, DPRINT, tcp_cb::fh_ack, tcp_cb::fh_seq, tcp_cb::init, packet_data::ip, packet_data::ipq_pm, tcp_cb::mh_ack, mh_ack_rcvd(), tcp_cb::mh_seq, tcp_cb::mut, mutex_lock(), mutex_unlock(), tcp_cb::out_queue, PACKET_DIR_IN, queue_hipri(), queue_tcp(), reset_tcp_queue(), tcp_cid::saddr, send_tcp_rst(), seq_cmp(), tcp_cid::sport, tcp_cb::state, tcp_chksum(), tcp_data_size(), TCP_INIT_FH_ACK, TCP_INIT_FH_SEQ, TCP_INIT_MH_ACK, TCP_INIT_MH_SEQ, TCP_MAX_CONN, tcp_switch, tcp_tab_mut, tcp_timeout(), TCPS_CLOSED, TCPS_FREE, and packet_data::trans.

Referenced by handle_packet().

void init_tcp  ) 
 

Definition at line 34 of file tcp.c.

References tcp_cb::out_queue, tcp_cb::state, TCP_MAX_CONN, tcp_tab_mut, and TCPS_FREE.

Referenced by main().

int seq_cmp unsigned  a,
unsigned  b
[inline]
 

Definition at line 66 of file tcp.c.

Referenced by add_tcp_sent(), handle_tcp(), and mh_ack_rcvd().

int tcp_data_size Tpacket_data pd  )  [inline]
 

Definition at line 305 of file tcp.c.

References packet_data::ip, packet_data::ipq_pm, and packet_data::trans.

Referenced by handle_tcp(), and scheduler().

void tcp_timeout void *  ptr  ) 
 

Definition at line 634 of file tcp.c.

References dealloc_tcp_cb(), DPRINT, EPRINT, tcp_cb::mut, mutex_lock(), mutex_unlock(), tcp_cb::state, TCPS_CLOSED, TCPS_LAST_ACK, TCPS_SYN_SENT, and TCPS_TIME_WAIT.

Referenced by clear_tcp_timers(), handle_tcp(), tcps_close_wait(), tcps_closing(), tcps_fin_wait1(), tcps_fin_wait2(), tcps_new(), and tcps_syn_sent().


Generated on Sun May 14 13:36:53 2006 by  doxygen 1.4.2