tcp_conn.h File Reference

TCP protocol support. More...

#include "ip_addr.h"
#include "locking.h"

Include dependency graph for tcp_conn.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcp_conn_alias
 TCP port alias structure. More...
struct  tcp_connection
 TCP connection structure. More...
struct  tcp_req

Defines

#define DEFAULT_TCP_CONNECT_TIMEOUT   10
#define DEFAULT_TCP_CONNECTION_LIFETIME   120
#define DEFAULT_TCP_MAX_CONNECTIONS   2048
#define DEFAULT_TCP_SEND_TIMEOUT   10
#define F_CONN_NON_BLOCKING   1
#define F_CONN_REMOVED   2
#define init_tcp_req(r)
#define TCP_ALIAS_HASH_SIZE   1024
#define TCP_BUF_SIZE   65535
#define TCP_CHILD_SELECT_TIMEOUT   2
#define TCP_CHILD_TIMEOUT   5
#define TCP_CON_MAX_ALIASES   4
#define tcp_id_hash(id)   (id&(TCP_ID_HASH_SIZE-1))
#define TCP_ID_HASH_SIZE   1024
#define TCP_MAIN_SELECT_TIMEOUT   5
#define tcpconn_listadd(head, c, next, prev)
 add a tcpconn to a list list head, new element, next member, prev member
#define tcpconn_listrm(head, c, next, prev)
 remove a tcpconn from a list
#define TCPCONN_LOCK   lock_get(tcpconn_lock);
#define TCPCONN_UNLOCK   lock_release(tcpconn_lock);

Enumerations

enum  conn_cmds {
  CONN_DESTROY = -3, CONN_ERROR = -2, CONN_EOF = -1, CONN_RELEASE,
  CONN_GET_FD, CONN_NEW
}
enum  tcp_conn_states {
  S_CONN_ERROR = -2, S_CONN_BAD = -1, S_CONN_OK = 0, S_CONN_INIT,
  S_CONN_EOF, S_CONN_ACCEPT, S_CONN_CONNECT
}
enum  tcp_req_errors {
  TCP_REQ_INIT, TCP_REQ_OK, TCP_READ_ERROR, TCP_REQ_OVERRUN,
  TCP_REQ_BAD_LEN
}
enum  tcp_req_states {
  H_SKIP_EMPTY, H_SKIP, H_LF, H_LFCR,
  H_BODY, H_STARTWS, H_CONT_LEN1, H_CONT_LEN2,
  H_CONT_LEN3, H_CONT_LEN4, H_CONT_LEN5, H_CONT_LEN6,
  H_CONT_LEN7, H_CONT_LEN8, H_CONT_LEN9, H_CONT_LEN10,
  H_CONT_LEN11, H_CONT_LEN12, H_CONT_LEN13, H_L_COLON,
  H_CONT_LEN_BODY, H_CONT_LEN_BODY_PARSE, H_PING_CRLFCRLF, H_SKIP_EMPTY_CR_FOUND,
  H_SKIP_EMPTY_CRLF_FOUND, H_SKIP_EMPTY_CRLFCR_FOUND
}

Functions

static unsigned tcp_addr_hash (struct ip_addr *ip, unsigned short port)


Detailed Description

TCP protocol support.

Definition in file tcp_conn.h.


Define Documentation

#define DEFAULT_TCP_CONNECT_TIMEOUT   10

If a connect doesn't complete in this time, timeout

Definition at line 49 of file tcp_conn.h.

#define DEFAULT_TCP_CONNECTION_LIFETIME   120

TCP connection lifetime, in seconds

Definition at line 47 of file tcp_conn.h.

Referenced by tls_tcpconn_init().

#define DEFAULT_TCP_MAX_CONNECTIONS   2048

Maximum number of connections

Definition at line 50 of file tcp_conn.h.

#define DEFAULT_TCP_SEND_TIMEOUT   10

If a send can't write for more then 10s, timeout

Definition at line 48 of file tcp_conn.h.

#define F_CONN_NON_BLOCKING   1

Definition at line 58 of file tcp_conn.h.

#define F_CONN_REMOVED   2

no longer in "main" listen fd list

Definition at line 59 of file tcp_conn.h.

#define init_tcp_req (  ) 

Definition at line 139 of file tcp_conn.h.

#define TCP_ALIAS_HASH_SIZE   1024

Definition at line 172 of file tcp_conn.h.

Referenced by tcp_addr_hash().

#define TCP_BUF_SIZE   65535

TCP buffer size

Definition at line 46 of file tcp_conn.h.

Referenced by tls_read().

#define TCP_CHILD_SELECT_TIMEOUT   2

the same as above but for children

Definition at line 54 of file tcp_conn.h.

#define TCP_CHILD_TIMEOUT   5

After 5 seconds, the child "returns" the connection to the tcp master process

Definition at line 51 of file tcp_conn.h.

#define TCP_CON_MAX_ALIASES   4

Maximum number of port aliases

Definition at line 44 of file tcp_conn.h.

#define tcp_id_hash ( id   )     (id&(TCP_ID_HASH_SIZE-1))

Definition at line 187 of file tcp_conn.h.

#define TCP_ID_HASH_SIZE   1024

Definition at line 173 of file tcp_conn.h.

#define TCP_MAIN_SELECT_TIMEOUT   5

how often "tcp main" checks for timeout

Definition at line 53 of file tcp_conn.h.

#define tcpconn_listadd ( head,
c,
next,
prev   ) 

add a tcpconn to a list list head, new element, next member, prev member

Definition at line 150 of file tcp_conn.h.

#define tcpconn_listrm ( head,
c,
next,
prev   ) 

Value:

do{ \
      if ((head)==(c)) (head)=(c)->next; \
      if ((c)->next) (c)->next->prev=(c)->prev; \
      if ((c)->prev) (c)->prev->next=(c)->next; \
   }while(0)
remove a tcpconn from a list

Definition at line 161 of file tcp_conn.h.

#define TCPCONN_LOCK   lock_get(tcpconn_lock);

Definition at line 169 of file tcp_conn.h.

#define TCPCONN_UNLOCK   lock_release(tcpconn_lock);

Definition at line 170 of file tcp_conn.h.


Enumeration Type Documentation

enum conn_cmds

Enumerator:
CONN_DESTROY 
CONN_ERROR 
CONN_EOF 
CONN_RELEASE 
CONN_GET_FD 
CONN_NEW 

Definition at line 77 of file tcp_conn.h.

Enumerator:
S_CONN_ERROR 
S_CONN_BAD 
S_CONN_OK 
S_CONN_INIT 
S_CONN_EOF 
S_CONN_ACCEPT 
S_CONN_CONNECT 

Definition at line 72 of file tcp_conn.h.

Enumerator:
TCP_REQ_INIT 
TCP_REQ_OK 
TCP_READ_ERROR 
TCP_REQ_OVERRUN 
TCP_REQ_BAD_LEN 

Definition at line 62 of file tcp_conn.h.

Enumerator:
H_SKIP_EMPTY 
H_SKIP 
H_LF 
H_LFCR 
H_BODY 
H_STARTWS 
H_CONT_LEN1 
H_CONT_LEN2 
H_CONT_LEN3 
H_CONT_LEN4 
H_CONT_LEN5 
H_CONT_LEN6 
H_CONT_LEN7 
H_CONT_LEN8 
H_CONT_LEN9 
H_CONT_LEN10 
H_CONT_LEN11 
H_CONT_LEN12 
H_CONT_LEN13 
H_L_COLON 
H_CONT_LEN_BODY 
H_CONT_LEN_BODY_PARSE 
H_PING_CRLFCRLF 
H_SKIP_EMPTY_CR_FOUND 
H_SKIP_EMPTY_CRLF_FOUND 
H_SKIP_EMPTY_CRLFCR_FOUND 

Definition at line 64 of file tcp_conn.h.


Function Documentation

static unsigned tcp_addr_hash ( struct ip_addr ip,
unsigned short  port 
) [inline, static]

Definition at line 175 of file tcp_conn.h.

References ip_addr::addr32, ip_addr::len, LM_CRIT, TCP_ALIAS_HASH_SIZE, and ip_addr::u.


Generated on Thu May 24 20:00:44 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6