Skip to content

File connection_support.cpp

FileList > connection > connection_support.cpp

Go to the source code of this file

  • #include "config.h"
  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <errno.h>
  • #include <sys/types.h>
  • #include <sys/ioctl.h>
  • #include <assert.h>
  • #include <sys/time.h>
  • #include <sys/uio.h>
  • #include <sys/socket.h>
  • #include <netinet/in.h>
  • #include <unistd.h>
  • #include <fcntl.h>
  • #include <poll.h>
  • #include "porting.h"
  • #include "error_manager.h"
  • #include "connection_globals.h"
  • #include "memory_alloc.h"
  • #include "environment_variable.h"
  • #include "system_parameter.h"
  • #include "boot_sr.h"
  • #include "tcp.h"
  • #include "connection_support.hpp"
  • #include "span.hpp"
  • #include "connection_sr.h"
  • #include "network_interface_cl.h"
  • #include "storage_common.h"
  • #include "heap_file.h"
  • #include "dbtype.h"
  • #include "tz_support.h"
  • #include "db_date.h"
  • #include "show_scan.h"
  • #include "memory_wrapper.hpp"

Public Static Attributes

Type Name
const int CSS_TCP_MIN_NUM_RETRIES = 3

Public Functions

Type Name
int css_check_ip (IP_INFO * ip_info, unsigned char * address)
int css_check_magic (CSS_CONN_ENTRY * conn)
int css_free_ip_info (IP_INFO * ip_info)
const char * css_ha_applier_state_string (HA_LOG_APPLIER_STATE state)
const char * css_ha_mode_string (HA_MODE mode)
const char * css_ha_server_state_string (HA_SERVER_STATE state)
int css_local_host_name (CSS_CONN_ENTRY * conn, char * hostname, size_t namelen)
int css_net_read_header (CSS_CONN_ENTRY * conn, char * buffer, int * maxlen, int timeout)
int css_net_recv (CSS_CONN_ENTRY * conn, char * buffer, int * maxlen, int timeout)
int css_net_send (CSS_CONN_ENTRY * conn, const char * buff, int len, int timeout)
int css_net_send_buffer_only (CSS_CONN_ENTRY * conn, const char * buff, int len, int timeout)
int css_net_send_no_block (SOCKET fd, const char * buffer, int size)
int css_peer_host_name (CSS_CONN_ENTRY * conn, char * hostname, size_t namelen)
int css_platform_independent_poll (POLL_FD * fds, int num_of_fds, int timeout)
int css_read_ip_info (IP_INFO ** out_ip_info, char * filename)
void css_read_remaining_bytes (CSS_CONN_ENTRY * conn, int len)
int css_readn (SOCKET fd, char * ptr, int nbytes, int timeout)
int css_send_data (CSS_CONN_ENTRY * conn, unsigned short rid, const char * buffer, int buffer_size)
int css_send_error (CSS_CONN_ENTRY * conn, unsigned short rid, const char * buffer, int buffer_size)
int css_send_large_data (CSS_CONN_ENTRY * conn, unsigned short rid, const char ** buffers, int * buffers_size, int num_buffers)
int css_send_magic (CSS_CONN_ENTRY * conn)
int css_send_request (CSS_CONN_ENTRY * conn, int command, unsigned short * request_id, const char * arg_buffer, int arg_buffer_size)
int css_send_request_with_socket (SOCKET & socket, int command, unsigned short * request_id, const char * arg_buffer, int arg_buffer_size)
int css_send_two_data (CSS_CONN_ENTRY * conn, unsigned short rid, const char * buffer1, int buffer1_size, const char * buffer2, int buffer2_size)
void css_set_net_header (NET_HEADER * header_p, int type, short function_code, int request_id, int buffer_size, int transaction_id, int invalidate_snapshot, int db_error)
bool tran_is_in_libcas (void)

Public Static Functions

Type Name
int css_net_send2 (CSS_CONN_ENTRY * conn, const char * buff1, int len1, const char * buff2, int len2)
int css_net_send3 (CSS_CONN_ENTRY * conn, const char * buff1, int len1, const char * buff2, int len2, const char * buff3, int len3)
int css_net_send4 (CSS_CONN_ENTRY * conn, const char * buff1, int len1, const char * buff2, int len2, const char * buff3, int len3, const char * buff4, int len4)
int css_net_send_large_data (CSS_CONN_ENTRY * conn, NET_HEADER * header_array, const char ** data_array, int num_array)
int css_net_send_large_data_with_arg (CSS_CONN_ENTRY * conn, const char * header_buffer, int header_len, NET_HEADER * header_array, const char ** data_array, int num_array)
int css_send_io_vector (CSS_CONN_ENTRY * conn, struct iovec * vec_p, ssize_t total_len, int vector_length, int timeout)
int css_send_request_with_data_buffer (CSS_CONN_ENTRY * conn, int request, unsigned short * request_id, const char * arg_buffer, int arg_size, char * reply_buffer, int reply_size)
void css_set_io_vector (struct iovec * vec1_p, struct iovec * vec2_p, const char * buff, int len, int * templen)
int css_sprintf_conn_infoids (SOCKET fd, char * client_user_name, char * client_host_name, int * client_pid)
char * css_trim_str (char * str)
int css_vector_send (SOCKET fd, struct iovec * vec, int * len, int bytes_written, int timeout)

Macros

Type Name
define CSS_TRUNCATE_BUFFER_SIZE 512
define INITIAL_IP_NUM 16

Public Static Attributes Documentation

variable CSS_TCP_MIN_NUM_RETRIES

const int CSS_TCP_MIN_NUM_RETRIES;

Public Functions Documentation

function css_check_ip

int css_check_ip (
    IP_INFO * ip_info,
    unsigned  char * address
) 

function css_check_magic

int css_check_magic (
    CSS_CONN_ENTRY * conn
) 

function css_free_ip_info

int css_free_ip_info (
    IP_INFO * ip_info
) 

function css_ha_applier_state_string

const  char * css_ha_applier_state_string (
    HA_LOG_APPLIER_STATE state
) 

function css_ha_mode_string

const  char * css_ha_mode_string (
    HA_MODE mode
) 

function css_ha_server_state_string

const  char * css_ha_server_state_string (
    HA_SERVER_STATE state
) 

function css_local_host_name

int css_local_host_name (
    CSS_CONN_ENTRY * conn,
    char * hostname,
    size_t namelen
) 

function css_net_read_header

int css_net_read_header (
    CSS_CONN_ENTRY * conn,
    char * buffer,
    int * maxlen,
    int timeout
) 

function css_net_recv

int css_net_recv (
    CSS_CONN_ENTRY * conn,
    char * buffer,
    int * maxlen,
    int timeout
) 

function css_net_send

int css_net_send (
    CSS_CONN_ENTRY * conn,
    const  char * buff,
    int len,
    int timeout
) 

function css_net_send_buffer_only

int css_net_send_buffer_only (
    CSS_CONN_ENTRY * conn,
    const  char * buff,
    int len,
    int timeout
) 

function css_net_send_no_block

int css_net_send_no_block (
    SOCKET fd,
    const  char * buffer,
    int size
) 

function css_peer_host_name

int css_peer_host_name (
    CSS_CONN_ENTRY * conn,
    char * hostname,
    size_t namelen
) 

function css_platform_independent_poll

int css_platform_independent_poll (
    POLL_FD * fds,
    int num_of_fds,
    int timeout
) 

function css_read_ip_info

int css_read_ip_info (
    IP_INFO ** out_ip_info,
    char * filename
) 

function css_read_remaining_bytes

void css_read_remaining_bytes (
    CSS_CONN_ENTRY * conn,
    int len
) 

function css_readn

int css_readn (
    SOCKET fd,
    char * ptr,
    int nbytes,
    int timeout
) 

function css_send_data

int css_send_data (
    CSS_CONN_ENTRY * conn,
    unsigned  short rid,
    const  char * buffer,
    int buffer_size
) 

function css_send_error

int css_send_error (
    CSS_CONN_ENTRY * conn,
    unsigned  short rid,
    const  char * buffer,
    int buffer_size
) 

function css_send_large_data

int css_send_large_data (
    CSS_CONN_ENTRY * conn,
    unsigned  short rid,
    const  char ** buffers,
    int * buffers_size,
    int num_buffers
) 

function css_send_magic

int css_send_magic (
    CSS_CONN_ENTRY * conn
) 

function css_send_request

int css_send_request (
    CSS_CONN_ENTRY * conn,
    int command,
    unsigned  short * request_id,
    const  char * arg_buffer,
    int arg_buffer_size
) 

function css_send_request_with_socket

int css_send_request_with_socket (
    SOCKET & socket,
    int command,
    unsigned  short * request_id,
    const  char * arg_buffer,
    int arg_buffer_size
) 

function css_send_two_data

int css_send_two_data (
    CSS_CONN_ENTRY * conn,
    unsigned  short rid,
    const  char * buffer1,
    int buffer1_size,
    const  char * buffer2,
    int buffer2_size
) 

function css_set_net_header

void css_set_net_header (
    NET_HEADER * header_p,
    int type,
    short function_code,
    int request_id,
    int buffer_size,
    int transaction_id,
    int invalidate_snapshot,
    int db_error
) 

function tran_is_in_libcas

bool tran_is_in_libcas (
    void
) 

Public Static Functions Documentation

function css_net_send2

static int css_net_send2 (
    CSS_CONN_ENTRY * conn,
    const  char * buff1,
    int len1,
    const  char * buff2,
    int len2
) 

function css_net_send3

static int css_net_send3 (
    CSS_CONN_ENTRY * conn,
    const  char * buff1,
    int len1,
    const  char * buff2,
    int len2,
    const  char * buff3,
    int len3
) 

function css_net_send4

static int css_net_send4 (
    CSS_CONN_ENTRY * conn,
    const  char * buff1,
    int len1,
    const  char * buff2,
    int len2,
    const  char * buff3,
    int len3,
    const  char * buff4,
    int len4
) 

function css_net_send_large_data

static int css_net_send_large_data (
    CSS_CONN_ENTRY * conn,
    NET_HEADER * header_array,
    const  char ** data_array,
    int num_array
) 

function css_net_send_large_data_with_arg

static int css_net_send_large_data_with_arg (
    CSS_CONN_ENTRY * conn,
    const  char * header_buffer,
    int header_len,
    NET_HEADER * header_array,
    const  char ** data_array,
    int num_array
) 

function css_send_io_vector

static int css_send_io_vector (
    CSS_CONN_ENTRY * conn,
    struct  iovec * vec_p,
    ssize_t total_len,
    int vector_length,
    int timeout
) 

function css_send_request_with_data_buffer

static int css_send_request_with_data_buffer (
    CSS_CONN_ENTRY * conn,
    int request,
    unsigned  short * request_id,
    const  char * arg_buffer,
    int arg_size,
    char * reply_buffer,
    int reply_size
) 

function css_set_io_vector

static void css_set_io_vector (
    struct  iovec * vec1_p,
    struct  iovec * vec2_p,
    const  char * buff,
    int len,
    int * templen
) 

function css_sprintf_conn_infoids

static int css_sprintf_conn_infoids (
    SOCKET fd,
    char * client_user_name,
    char * client_host_name,
    int * client_pid
) 

function css_trim_str

static char * css_trim_str (
    char * str
) 

function css_vector_send

static int css_vector_send (
    SOCKET fd,
    struct  iovec * vec,
    int * len,
    int bytes_written,
    int timeout
) 

Macro Definition Documentation

define CSS_TRUNCATE_BUFFER_SIZE

#define CSS_TRUNCATE_BUFFER_SIZE `512`

define INITIAL_IP_NUM

#define INITIAL_IP_NUM `16`


The documentation for this class was generated from the following file cubrid/src/connection/connection_support.cpp