ARB
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <limits.h>
#include "trace.h"
#include <signal.h>
#include <sys/time.h>
#include <netdb.h>
#include <setjmp.h>
#include <aisc_com.h>
#include "server.h"
#include <SigHandler.h>
#include <arb_cs.h>
#include <static_assert.h>
Go to the source code of this file.
Classes | |
struct | Socinf |
struct | Hs_struct |
struct | aisc_bytes_list |
struct | aisc_static_set_mem |
Macros | |
#define | FD_SET_TYPE |
#define | aisc_assert(cond) arb_assert(cond) |
#define | AISC_SERVER_OK 1 |
#define | AISC_SERVER_FAULT 0 |
#define | MAX_QUEUE_LEN 5 |
#define | AISC_MAGIC_NUMBER_FILTER 0xffffff00 |
Typedefs | |
typedef long(* | aisc_talking_function_type )(long *, int, long *, int) |
Variables | |
static aisc_bytes_list * | aisc_server_bytes_first |
static aisc_bytes_list * | aisc_server_bytes_last |
char * | aisc_object_names [] |
char ** | aisc_attribute_names_list [] |
aisc_talking_func_long * | aisc_talking_functions_get [] |
aisc_talking_func_long * | aisc_talking_functions_set [] |
aisc_talking_func_longp * | aisc_talking_functions_copy [] |
aisc_talking_func_longp * | aisc_talking_functions_find [] |
aisc_talking_func_longp * | aisc_talking_functions_create [] |
aisc_talking_func_long | aisc_talking_functions_delete [] |
const char * | aisc_server_error |
const int | ERRORBUFSIZE = 256 |
static char | error_buf [ERRORBUFSIZE] |
static int | aisc_server_con |
static Hs_struct * | aisc_server_hs |
static bool | sigsegv_occurred = false |
static bool | catch_sigsegv = 0 |
static jmp_buf | return_after_segv |
static SigHandler | old_sigsegv_handler |
static int | aisc_server_index = -1 |
static struct aisc_static_set_mem | md |
int * | aisc_main |
static aisc_talking_function_type | aisc_talking_functions [] |
#define FD_SET_TYPE |
Definition at line 17 of file server.c.
Referenced by aisc_accept_calls().
#define aisc_assert | ( | cond | ) | arb_assert(cond) |
Definition at line 40 of file server.c.
Referenced by aisc_broadcast(), aisc_server_sigsegv(), aisc_talking(), and test_address_valid().
#define AISC_SERVER_OK 1 |
Definition at line 42 of file server.c.
Referenced by aisc_accept_calls(), and aisc_talking().
#define AISC_SERVER_FAULT 0 |
Definition at line 43 of file server.c.
Referenced by aisc_talking().
#define MAX_QUEUE_LEN 5 |
Definition at line 44 of file server.c.
Referenced by open_aisc_server().
#define AISC_MAGIC_NUMBER_FILTER 0xffffff00 |
Definition at line 46 of file server.c.
Referenced by aisc_talking().
void aisc_server_errorf | ( | const char * | templat, |
... | |||
) |
Definition at line 122 of file server.c.
References error_buf, EXIT_FAILURE, fflush(), fputs(), va_end(), va_start(), and vfprintf().
Definition at line 151 of file server.c.
References aisc_assert, catch_sigsegv, NULp, result, return_after_segv, and sigsegv_occurred.
Referenced by aisc_talking_copy(), aisc_talking_create(), aisc_talking_debug_info(), aisc_talking_delete(), aisc_talking_find(), aisc_talking_get(), and aisc_talking_sets().
|
static |
Definition at line 200 of file server.c.
References aisc_assert, catch_sigsegv, old_sigsegv_handler, return_after_segv, sigsegv_occurred, and UNINSTALL_SIGHANDLER.
Referenced by open_aisc_server().
Definition at line 218 of file server.c.
Referenced by aisc_get_keystring(), aisc_talking_copy(), aisc_talking_create(), aisc_talking_find(), aisc_talking_get(), and aisc_talking_sets().
Definition at line 225 of file server.c.
References AISC_MAX_ATTR.
Referenced by aisc_talking_copy(), aisc_talking_create(), aisc_talking_find(), aisc_talking_get(), and aisc_talking_sets().
Definition at line 235 of file server.c.
References aisc_server_sigsegv(), arb_open_socket(), fflush(), Hs_struct::fork, Hs_struct::hso, INSTALL_SIGHANDLER, MAX_QUEUE_LEN, NULp, old_sigsegv_handler, Hs_struct::timeout, and Hs_struct::unix_name.
Referenced by ARB_main(), and start_pt_server().
Definition at line 270 of file server.c.
References aisc_bytes_list::data, aisc_bytes_list::next, and aisc_bytes_list::size.
Referenced by aisc_talking_get().
Definition at line 286 of file server.c.
References arb_socket_write(), aisc_bytes_list::data, aisc_bytes_list::next, NULp, and aisc_bytes_list::size.
Referenced by aisc_talking().
Definition at line 297 of file server.c.
References AISC_ATTR_MASK, AISC_CASTSIG, AISC_DUMP, AISC_DUMP_SEP, aisc_get_object_attribute(), aisc_get_object_names(), AISC_MAX_ATTR, AISC_MAX_STRING_LEN, AISC_OBJ_TYPE_MASK, aisc_s_add_to_bytes_queue(), aisc_talking_functions_get, AISC_TYPE_BYTES, AISC_TYPE_COMMON, AISC_TYPE_DOUBLE, AISC_TYPE_INT, AISC_TYPE_STRING, AISC_VAR_TYPE_MASK, double_xfer::as_double, double_xfer::as_int, bytestring::data, error_buf, long, NULp, bytestring::size, STATIC_ASSERT, test_address_valid(), and type.
Definition at line 425 of file server.c.
Referenced by aisc_talking_sets().
Definition at line 429 of file server.c.
References AISC_DUMP, aisc_server_index, aisc_talking_get_index(), and error_buf.
Referenced by aisc_talking_get_index().
|
static |
Definition at line 445 of file server.c.
References AISC_ATTR_MASK, AISC_CASTSIG, AISC_DUMP, AISC_DUMP_SEP, aisc_get_object_attribute(), aisc_get_object_names(), AISC_INDEX, AISC_MAX_ATTR, AISC_OBJ_TYPE_MASK, aisc_talking_functions_set, aisc_talking_set_index(), AISC_TYPE_BYTES, AISC_TYPE_COMMON, AISC_TYPE_DOUBLE, AISC_TYPE_INT, AISC_TYPE_STRING, AISC_VAR_TYPE_MASK, arb_socket_read(), double_xfer::as_double, double_xfer::as_int, bytestring::data, error_buf, long, NULp, bytestring::size, test_address_valid(), and type.
Referenced by aisc_make_sets(), aisc_talking_nset(), and aisc_talking_set().
Definition at line 573 of file server.c.
References AISC_OBJ_TYPE_MASK, aisc_talking_sets(), and NULp.
Definition at line 583 of file server.c.
References AISC_NO_ANSWER, AISC_OBJ_TYPE_MASK, aisc_talking_sets(), and NULp.
Definition at line 599 of file server.c.
References aisc_talking_sets(), aisc_static_set_mem::ibuf, md, aisc_static_set_mem::obuf, aisc_static_set_mem::size, and aisc_static_set_mem::type.
Definition at line 608 of file server.c.
References AISC_ATTR_MASK, aisc_get_object_attribute(), aisc_get_object_names(), AISC_MAX_ATTR, aisc_talking_functions_create, error_buf, father, aisc_static_set_mem::ibuf, long, md, NULp, aisc_static_set_mem::obuf, aisc_static_set_mem::size, test_address_valid(), and aisc_static_set_mem::type.
Definition at line 665 of file server.c.
References AISC_ATTR_MASK, aisc_get_object_attribute(), aisc_get_object_names(), AISC_MAX_ATTR, aisc_talking_functions_copy, error_buf, father, aisc_static_set_mem::ibuf, long, md, NULp, aisc_static_set_mem::obuf, aisc_static_set_mem::size, test_address_valid(), and aisc_static_set_mem::type.
Definition at line 725 of file server.c.
References AISC_ATTR_MASK, aisc_get_object_attribute(), aisc_get_object_names(), AISC_MAX_ATTR, aisc_talking_functions_find, error_buf, father, long, NULp, and test_address_valid().
Definition at line 793 of file server.c.
References AISC_OBJ_TYPE_MASK, aisc_talking_functions_delete, error_buf, NULp, and test_address_valid().
Definition at line 834 of file server.c.
References AISC_ATTR_MASK, aisc_talking_functions_copy, aisc_talking_functions_create, aisc_talking_functions_delete, aisc_talking_functions_find, aisc_talking_functions_get, aisc_talking_functions_set, NULp, and test_address_valid().
Definition at line 912 of file server.c.
References aisc_assert, AISC_CCOM_MESSAGE, arb_socket_write(), long, Socinf::next, Hs_struct::soci, and Socinf::socket.
Referenced by broadcast(), and server_shutdown().
Definition at line 967 of file server.c.
References aisc_assert, AISC_CCOM_ERROR, AISC_CCOM_OK, AISC_MAGIC_NUMBER, AISC_MAGIC_NUMBER_FILTER, AISC_MESSAGE_BUFFER_LEN, AISC_NO_ANSWER, aisc_s_send_bytes_queue(), AISC_SERVER_FAULT, AISC_SERVER_OK, aisc_talking_functions, arb_socket_read(), arb_socket_write(), and long.
Referenced by aisc_accept_calls().
Definition at line 1026 of file server.c.
References AISC_SERVER_OK, aisc_talking(), Socinf::destroy_callback, Socinf::destroy_clientdata, EXIT_SUCCESS, FD_SET_TYPE, Hs_struct::fork, Hs_struct::hso, Socinf::next, Hs_struct::nsoc, NULp, Hs_struct::soci, Socinf::socket, and Hs_struct::timeout.
Referenced by ARB_main(), and start_pt_server().
void aisc_server_shutdown | ( | Hs_struct *& | hs | ) |
Definition at line 1134 of file server.c.
References Hs_struct::hso, Socinf::next, NULp, Hs_struct::soci, Socinf::socket, and Hs_struct::unix_name.
Referenced by ARB_main(), server_shutdown(), and start_pt_server().
Definition at line 1151 of file server.c.
References aisc_server_con, aisc_server_hs, Socinf::destroy_callback, Socinf::destroy_clientdata, fputs(), Socinf::next, Hs_struct::soci, and Socinf::socket.
Referenced by names_init_socket(), and pt_init_socket().
void aisc_remove_destroy_callback | ( | void | ) |
Definition at line 1172 of file server.c.
References aisc_server_con, aisc_server_hs, Socinf::destroy_callback, Socinf::destroy_clientdata, Socinf::next, NULp, Hs_struct::soci, and Socinf::socket.
Referenced by names_destroy_socket(), and pt_destroy_socket().
|
static |
|
static |
char* aisc_object_names[] |
char** aisc_attribute_names_list[] |
aisc_talking_func_long* aisc_talking_functions_get[] |
Referenced by aisc_talking_debug_info(), and aisc_talking_get().
aisc_talking_func_long* aisc_talking_functions_set[] |
Referenced by aisc_talking_debug_info(), and aisc_talking_sets().
aisc_talking_func_longp* aisc_talking_functions_copy[] |
Referenced by aisc_talking_copy(), and aisc_talking_debug_info().
aisc_talking_func_longp* aisc_talking_functions_find[] |
Referenced by aisc_talking_debug_info(), and aisc_talking_find().
aisc_talking_func_longp* aisc_talking_functions_create[] |
Referenced by aisc_talking_create(), and aisc_talking_debug_info().
aisc_talking_func_long aisc_talking_functions_delete[] |
Referenced by aisc_talking_debug_info(), and aisc_talking_delete().
|
static |
Definition at line 114 of file server.c.
Referenced by aisc_server_errorf(), aisc_talking_copy(), aisc_talking_create(), aisc_talking_delete(), aisc_talking_find(), aisc_talking_get(), aisc_talking_get_index(), aisc_talking_sets(), and get_LOCS_ERROR().
|
static |
Definition at line 116 of file server.c.
Referenced by aisc_add_destroy_callback(), and aisc_remove_destroy_callback().
|
static |
Definition at line 117 of file server.c.
Referenced by aisc_add_destroy_callback(), and aisc_remove_destroy_callback().
|
static |
Definition at line 147 of file server.c.
Referenced by aisc_server_sigsegv(), and test_address_valid().
|
static |
Definition at line 148 of file server.c.
Referenced by aisc_server_sigsegv(), and test_address_valid().
|
static |
Definition at line 149 of file server.c.
Referenced by aisc_server_sigsegv(), and test_address_valid().
|
static |
Definition at line 198 of file server.c.
Referenced by aisc_server_sigsegv(), and open_aisc_server().
|
static |
Definition at line 423 of file server.c.
Referenced by aisc_talking_get_index().
|
static |
|
static |
Definition at line 954 of file server.c.
Referenced by aisc_talking().