FACT++  1.0
tcpip.c File Reference
#include <ctype.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <time.h>
#include <dim.h>
+ Include dependency graph for tcpip.c:

Go to the source code of this file.

Macros

#define closesock(s)   close(s)
 
#define readsock(a, b, c, d)   read(a,b,c)
 
#define writesock(a, b, c, d)   write(a,b,c)
 
#define MY_FD_ZERO(set)   FD_ZERO(set)
 
#define MY_FD_SET(fd, set)   FD_SET(fd, set)
 
#define MY_FD_CLR(fd, set)   FD_CLR(fd, set)
 
#define MY_FD_ISSET(fd, set)   FD_ISSET(fd, set)
 
#define DIMLIB
 
#define ushort   unsigned short
 

Functions

void dim_set_listen_backlog (int size)
 
int dim_get_listen_backlog ()
 
void dim_set_keepalive_timeout (int secs)
 
int dim_get_keepalive_timeout ()
 
void dim_set_write_timeout (int secs)
 
int dim_get_write_timeout ()
 
int dim_set_write_buffer_size (int size)
 
int dim_get_write_buffer_size ()
 
int dim_set_read_buffer_size (int size)
 
int dim_get_read_buffer_size ()
 
int dim_tcpip_init (int thr_flag)
 
void dim_tcpip_stop ()
 
static int enable_sig (int conn_id)
 
static int list_to_fds (fd_set *fds)
 
static int fds_get_entry (fd_set *fds, int *conn_id)
 
static void tcpip_test_write (int conn_id)
 
void tcpip_set_test_write (int conn_id, int timeout)
 
void tcpip_rem_test_write (int conn_id)
 
void tcpip_pipe_sig_handler (int num)
 
static int get_bytes_to_read (int conn_id)
 
static int do_read (int conn_id)
 
void do_accept (int conn_id)
 
void io_sig_handler (int num)
 
void tcpip_task (void *dummy)
 
int tcpip_start_read (int conn_id, char *buffer, int size, void(*ast_routine)())
 
int check_node_addr (char *node, unsigned char *ipaddr)
 
int tcpip_open_client (int conn_id, char *node, char *task, int port)
 
int tcpip_open_server (int conn_id, char *task, int *port)
 
int tcpip_start_listen (int conn_id, void(*ast_routine)())
 
int tcpip_open_connection (int conn_id, int path)
 
void tcpip_get_node_task (int conn_id, char *node, char *task)
 
int tcpip_write (int conn_id, char *buffer, int size)
 
int set_non_blocking (int channel)
 
int set_blocking (int channel)
 
int tcpip_write_nowait (int conn_id, char *buffer, int size)
 
int tcpip_close (int conn_id)
 
int tcpip_failure (int code)
 
int tcpip_would_block (int code)
 
void tcpip_report_error (int code)
 
void tcpip_get_error (char *str, int code)
 

Variables

static int Threads_on = 0
 
static int init_done = FALSE
 
static int queue_id = 0
 
static int DIM_IO_path [2] = {-1,-1}
 
static int DIM_IO_Done = 0
 
static int DIM_IO_valid = 1
 
static int Listen_backlog = SOMAXCONN
 
static int Keepalive_timeout_set = 0
 
static int Write_timeout = WRITE_TMOUT
 
static int Write_timeout_set = 0
 
static int Write_buffer_size = TCP_SND_BUF_SIZE
 
static int Read_buffer_size = TCP_RCV_BUF_SIZE
 
int Tcpip_max_io_data_write = TCP_SND_BUF_SIZE - 16
 
int Tcpip_max_io_data_read = TCP_RCV_BUF_SIZE - 16