Libtrap: Internal development docs  1.16.1
Modules | Data Structures | Macros | Functions
TCP/IP and UNIX socket communication interface module
Collaboration diagram for TCP/IP and UNIX socket communication interface module:

Modules

 TCPIP output IFC
 
 TCPIP input IFC
 

Data Structures

union  tcpip_socket_addr
 

Macros

#define MAX_RECOVERY_TRY   10
 
#define RECOVERY_WAIT_USEC   500000
 
#define USEC_IN_SEC   1000000
 
#define ACK_MESS_SIZE   1
 
#define CRIT_1VS2SEND   10000
 
#define MAX(a, b)   ((a)<(b)?(b):(a))
 
#define MIN(a, b)   ((a)>(b)?(b):(a))
 

Functions

char *trap_default_socket_path_format __attribute__ ((used))
 
static void * get_in_addr (struct sockaddr *sa)
 Get sockaddr, IPv4 or IPv6. More...
 
static int check_portrange (const char *port)
 Check if the given port is a correct port number. More...
 

Detailed Description

Macro Definition Documentation

◆ ACK_MESS_SIZE

#define ACK_MESS_SIZE   1

Definition at line 86 of file ifc_tcpip.c.

◆ CRIT_1VS2SEND

#define CRIT_1VS2SEND   10000

Definition at line 87 of file ifc_tcpip.c.

◆ MAX

#define MAX (   a,
 
)    ((a)<(b)?(b):(a))

Definition at line 89 of file ifc_tcpip.c.

◆ MAX_RECOVERY_TRY

#define MAX_RECOVERY_TRY   10

Definition at line 82 of file ifc_tcpip.c.

◆ MIN

#define MIN (   a,
 
)    ((a)>(b)?(b):(a))

Definition at line 92 of file ifc_tcpip.c.

◆ RECOVERY_WAIT_USEC

#define RECOVERY_WAIT_USEC   500000

Definition at line 84 of file ifc_tcpip.c.

◆ USEC_IN_SEC

#define USEC_IN_SEC   1000000

Definition at line 85 of file ifc_tcpip.c.

Function Documentation

◆ __attribute__()

char* trap_default_socket_path_format __attribute__ ( (used)  )

Unix sockets for service IFC and UNIX IFC have default path format defined by UNIX_PATH_FILENAME_FORMAT

◆ check_portrange()

static int check_portrange ( const char *  port)
static

Check if the given port is a correct port number.

Port number for TCP socket must be a number in the range from 1 to 65535. It can also be a service name that is translated by getaddrinfo().

Parameters
[in]portPort to check.
Returns
EXIT_FAILURE if port is not given or it is a number < 1 or > 65535; EXIT_SUCCESS when port is a valid number or it is a service name.

Definition at line 138 of file ifc_tcpip.c.

◆ get_in_addr()

static void* get_in_addr ( struct sockaddr *  sa)
static

Get sockaddr, IPv4 or IPv6.

Parameters
[in]sastructure with input socket address
Returns
converted ponter to address

Definition at line 119 of file ifc_tcpip.c.