corosync
2.3.6
|
#include <config.h>
#include <pthread.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/poll.h>
#include <sys/uio.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <sched.h>
#include <time.h>
#include <semaphore.h>
#include <string.h>
#include <qb/qbdefs.h>
#include <qb/qblog.h>
#include <qb/qbloop.h>
#include <qb/qbutil.h>
#include <qb/qbipcs.h>
#include <corosync/swab.h>
#include <corosync/corotypes.h>
#include <corosync/corodefs.h>
#include <corosync/list.h>
#include <corosync/totem/totempg.h>
#include <corosync/logsys.h>
#include <corosync/icmap.h>
#include "quorum.h"
#include "totemsrp.h"
#include "logconfig.h"
#include "totemconfig.h"
#include "main.h"
#include "sync.h"
#include "timer.h"
#include "util.h"
#include "apidef.h"
#include "service.h"
#include "schedwrk.h"
Go to the source code of this file.
Data Structures | |
struct | sending_allowed_private_data_struct |
struct | scheduler_pause_timeout_data |
Macros | |
#define | IPC_LOGSYS_SIZE 8192*128 |
#define | SERVER_BACKLOG 5 |
#define | LOCALHOST_IP inet_addr("127.0.0.1") |
#define | RLIMIT_MEMLOCK RLIMIT_VMEM |
Functions | |
LOGSYS_DECLARE_SYSTEM ("corosync", LOGSYS_MODE_OUTPUT_STDERR|LOGSYS_MODE_OUTPUT_SYSLOG, LOG_DAEMON, LOG_INFO) | |
LOGSYS_DECLARE_SUBSYS ("MAIN") | |
qb_loop_t * | cs_poll_handle_get (void) |
int | cs_poll_dispatch_add (qb_loop_t *handle, int fd, int events, void *data, int(*dispatch_fn)(int fd, int revents, void *data)) |
int | cs_poll_dispatch_delete (qb_loop_t *handle, int fd) |
void | corosync_state_dump (void) |
void | corosync_shutdown_request (void) |
int | main_mcast (const struct iovec *iovec, unsigned int iov_len, unsigned int guarantee) |
void | corosync_recheck_the_q_level (void *data) |
int | corosync_sending_allowed (unsigned int service, unsigned int id, const void *msg, void *sending_allowed_private_data) |
void | corosync_sending_allowed_release (void *sending_allowed_private_data) |
int | message_source_is_local (const mar_message_source_t *source) |
void | message_source_set (mar_message_source_t *source, void *conn) |
int | main (int argc, char **argv, char **envp) |
Variables | |
struct sched_param | global_sched_param |
#define RLIMIT_MEMLOCK RLIMIT_VMEM |
void corosync_recheck_the_q_level | ( | void * | data | ) |
Definition at line 753 of file main.c.
References corosync_recheck_the_q_level(), cs_ipcs_q_level_get(), cs_poll_handle_get(), TOTEM_Q_LEVEL_CRITICAL, and totempg_check_q_level().
Referenced by corosync_recheck_the_q_level(), and cs_ipcs_q_level_get().
int corosync_sending_allowed | ( | unsigned int | service, |
unsigned int | id, | ||
const void * | msg, | ||
void * | sending_allowed_private_data | ||
) |
Definition at line 767 of file main.c.
References corosync_quorum_is_quorate(), corosync_service, CS_LIB_ALLOW_INQUORATE, CS_LIB_FLOW_CONTROL_NOT_REQUIRED, header, sending_allowed_private_data_struct::reserved_msgs, and totempg_groups_joined_reserve().
Referenced by cs_ipcs_dispatch_iov_send().
void corosync_sending_allowed_release | ( | void * | sending_allowed_private_data | ) |
Definition at line 810 of file main.c.
References sending_allowed_private_data_struct::reserved_msgs, and totempg_groups_joined_release().
Referenced by cs_ipcs_dispatch_iov_send().
void corosync_shutdown_request | ( | void | ) |
Definition at line 234 of file main.c.
References corosync_service_unlink_all(), corosync_state_dump(), log_printf, and LOGSYS_LEVEL_NOTICE.
void corosync_state_dump | ( | void | ) |
Definition at line 187 of file main.c.
References corosync_service, corosync_service_engine::exec_dump_fn, get_run_dir(), icmap_fini(), log_printf, LOGSYS_LEVEL_ERROR, LOGSYS_PERROR, SERVICES_COUNT_MAX, and corosync_api_v1::timer_delete.
Referenced by corosync_shutdown_request().
int cs_poll_dispatch_add | ( | qb_loop_t * | handle, |
int | fd, | ||
int | events, | ||
void * | data, | ||
int(*)(int fd, int revents, void *data) | dispatch_fn | ||
) |
qb_loop_t* cs_poll_handle_get | ( | void | ) |
Definition at line 164 of file main.c.
Referenced by corosync_recheck_the_q_level(), corosync_service_defaults_link_and_init(), corosync_service_unlink_all(), corosync_service_unlink_and_exit(), corosync_timer_add_absolute(), corosync_timer_add_duration(), corosync_timer_delete(), corosync_timer_expire_time_get(), cs_ipcs_dispatch_iov_send(), cs_ipcs_init(), cs_ipcs_private_data_get(), cs_ipcs_q_level_get(), and cs_ipcs_response_send().
LOGSYS_DECLARE_SUBSYS | ( | "MAIN" | ) |
LOGSYS_DECLARE_SYSTEM | ( | "corosync" | , |
LOGSYS_MODE_OUTPUT_STDERR| | LOGSYS_MODE_OUTPUT_SYSLOG, | ||
LOG_DAEMON | , | ||
LOG_INFO | |||
) |
int main | ( | int | argc, |
char ** | argv, | ||
char ** | envp | ||
) |
Definition at line 1151 of file main.c.
References _logsys_subsys_create(), apidef_get(), coroparse_configparse(), COROSYNC_DONE_DIR_NOT_PRESENT, COROSYNC_DONE_EXIT, COROSYNC_DONE_ICMAP, COROSYNC_DONE_LOGCONFIGREAD, COROSYNC_DONE_MAINCONFIGREAD, corosync_exit_error, corosync_log_config_read(), CS_OK, get_run_dir(), icmap_get_global_map(), icmap_init(), totem_config::ip_version, totem_logging_configuration::log_level_debug, totem_logging_configuration::log_level_error, totem_logging_configuration::log_level_notice, totem_logging_configuration::log_level_security, totem_logging_configuration::log_level_trace, totem_logging_configuration::log_level_warning, totem_logging_configuration::log_printf, log_printf, totem_logging_configuration::log_subsys_id, logsys_config_apply(), LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_ERROR, LOGSYS_LEVEL_INFO, LOGSYS_LEVEL_NOTICE, LOGSYS_LEVEL_TRACE, LOGSYS_LEVEL_WARNING, logsys_system_fini(), logsys_thread_start(), PACKAGE_FEATURES, schedwrk_init(), scheduler_pause_timeout_data::totem_config, totem_config_keyread(), totem_config_read(), totem_config_validate(), TOTEM_CONFIG_WARNING_MEMBERS_DEPRECATED, TOTEM_CONFIG_WARNING_MEMBERS_IGNORED, TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED, totem_config::totem_logging_configuration, totem_config::totem_memb_ring_id_create_or_load, totem_config::totem_memb_ring_id_store, totempg_finalize(), totempg_groups_initialize(), totempg_groups_join(), totempg_initialize(), totempg_service_ready_register(), and VERSION.
int main_mcast | ( | const struct iovec * | iovec, |
unsigned int | iov_len, | ||
unsigned int | guarantee | ||
) |
Definition at line 652 of file main.c.
References addr, COROSYNC_DONE_STORE_RINGID, corosync_exit_error, corosync_service, get_run_dir(), icmap_fast_inc(), log_printf, LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_ERROR, LOGSYS_PERROR, memb_ring_id::rep, memb_ring_id::seq, service_stats_tx, totemip_copy(), totemip_print(), and totempg_groups_mcast_joined().
int message_source_is_local | ( | const mar_message_source_t * | source | ) |
Definition at line 821 of file main.c.
References totempg_my_nodeid_get().
void message_source_set | ( | mar_message_source_t * | source, |
void * | conn | ||
) |
Definition at line 832 of file main.c.
References totempg_my_nodeid_get().