corosync
2.4.2
|
#include <config.h>
#include <assert.h>
#include <pthread.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/un.h>
#include <sys/ioctl.h>
#include <sys/param.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 <sched.h>
#include <time.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <limits.h>
#include <corosync/sq.h>
#include <corosync/list.h>
#include <corosync/swab.h>
#include <qb/qbdefs.h>
#include <qb/qbloop.h>
#include <corosync/logsys.h>
#include "totemnet.h"
#include "totemrrp.h"
Go to the source code of this file.
Data Structures | |
struct | passive_instance |
struct | active_instance |
struct | rrp_algo |
struct | totemrrp_instance |
struct | message_header |
struct | deliver_fn_context |
Macros | |
#define | LOGSYS_UTILS_ONLY 1 |
#define | STATUS_STR_LEN 512 |
#define | MESSAGE_TYPE_RING_TEST_ACTIVE 6 |
#define | MESSAGE_TYPE_RING_TEST_ACTIVATE 7 |
#define | ENDIAN_LOCAL 0xff22 |
#define | ARR_SEQNO_START_TOKEN 0x0 |
#define | PASSIVE_RECV_COUNT_THRESHOLD (INT_MAX / 2) |
#define | RRP_ALGOS_COUNT 3 |
#define | log_printf(level, format, args...) |
Functions | |
void | rrp_deliver_fn (void *context, const void *msg, unsigned int msg_len) |
void | rrp_iface_change_fn (void *context, const struct totem_ip_address *iface_addr) |
struct message_header | __attribute__ ((packed)) |
int | totemrrp_finalize (void *rrp_context) |
int | totemrrp_initialize (qb_loop_t *poll_handle, void **rrp_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_addr, unsigned int iface_no), void(*token_seqid_get)(const void *msg, unsigned int *seqid, unsigned int *token_is), unsigned int(*msgs_missing)(void), void(*target_set_completed)(void *context)) |
Create an instance. More... | |
void * | totemrrp_buffer_alloc (void *rrp_context) |
void | totemrrp_buffer_release (void *rrp_context, void *ptr) |
int | totemrrp_processor_count_set (void *rrp_context, unsigned int processor_count) |
int | totemrrp_token_target_set (void *rrp_context, struct totem_ip_address *addr, unsigned int iface_no) |
int | totemrrp_recv_flush (void *rrp_context) |
int | totemrrp_send_flush (void *rrp_context) |
int | totemrrp_token_send (void *rrp_context, const void *msg, unsigned int msg_len) |
int | totemrrp_mcast_flush_send (void *rrp_context, const void *msg, unsigned int msg_len) |
int | totemrrp_mcast_noflush_send (void *rrp_context, const void *msg, unsigned int msg_len) |
int | totemrrp_iface_check (void *rrp_context) |
int | totemrrp_ifaces_get (void *rrp_context, char ***status, unsigned int *iface_count) |
int | totemrrp_crypto_set (void *rrp_context, const char *cipher_type, const char *hash_type) |
int | totemrrp_ring_reenable (void *rrp_context, unsigned int iface_no) |
int | totemrrp_mcast_recv_empty (void *rrp_context) |
int | totemrrp_member_add (void *rrp_context, const struct totem_ip_address *member, int iface_no) |
int | totemrrp_member_remove (void *rrp_context, const struct totem_ip_address *member, int iface_no) |
void | totemrrp_membership_changed (void *rrp_context, enum totem_configuration_type configuration_type, const struct srp_addr *member_list, size_t member_list_entries, const struct srp_addr *left_list, size_t left_list_entries, const struct srp_addr *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id) |
Variables | |
char | type |
char | encapsulated |
unsigned short | endian_detector |
int | ring_number |
int | nodeid_activator |
struct deliver_fn_context | __attribute__ |
struct rrp_algo | none_algo |
struct rrp_algo | passive_algo |
struct rrp_algo | active_algo |
struct rrp_algo * | rrp_algos [] |
#define ARR_SEQNO_START_TOKEN 0x0 |
Definition at line 537 of file totemrrp.c.
#define ENDIAN_LOCAL 0xff22 |
Definition at line 526 of file totemrrp.c.
Referenced by rrp_deliver_fn().
#define log_printf | ( | level, | |
format, | |||
args... | |||
) |
Definition at line 634 of file totemrrp.c.
Referenced by rrp_deliver_fn().
#define LOGSYS_UTILS_ONLY 1 |
Definition at line 66 of file totemrrp.c.
#define MESSAGE_TYPE_RING_TEST_ACTIVATE 7 |
Definition at line 524 of file totemrrp.c.
Referenced by rrp_deliver_fn().
#define MESSAGE_TYPE_RING_TEST_ACTIVE 6 |
Definition at line 523 of file totemrrp.c.
Referenced by rrp_deliver_fn().
#define PASSIVE_RECV_COUNT_THRESHOLD (INT_MAX / 2) |
Definition at line 550 of file totemrrp.c.
#define RRP_ALGOS_COUNT 3 |
Definition at line 632 of file totemrrp.c.
#define STATUS_STR_LEN 512 |
Definition at line 190 of file totemrrp.c.
Referenced by totemrrp_ring_reenable().
struct message_header __attribute__ | ( | (packed) | ) |
void rrp_deliver_fn | ( | void * | context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 1861 of file totemrrp.c.
References deliver_fn_context::context, message_header::endian_detector, ENDIAN_LOCAL, totemrrp_stats_t::faulty, deliver_fn_context::iface_no, deliver_fn_context::instance, log_printf, rrp_algo::mcast_recv, MESSAGE_TYPE_RING_TEST_ACTIVATE, MESSAGE_TYPE_RING_TEST_ACTIVE, totemrrp_instance::my_nodeid, totemrrp_instance::net_handles, message_header::nodeid_activator, message_header::ring_number, totemrrp_instance::rrp_algo, totemrrp_instance::stats, rrp_algo::token_recv, totemnet_token_send(), totemrrp_instance::totemrrp_log_level_debug, totemrrp_instance::totemrrp_log_level_notice, totemrrp_ring_reenable(), totemrrp_instance::totemrrp_token_seqid_get, and message_header::type.
Referenced by totemrrp_initialize().
void rrp_iface_change_fn | ( | void * | context, |
const struct totem_ip_address * | iface_addr | ||
) |
Definition at line 1961 of file totemrrp.c.
References deliver_fn_context::context, deliver_fn_context::iface_no, deliver_fn_context::instance, totemrrp_instance::my_nodeid, totem_ip_address::nodeid, and totemrrp_instance::totemrrp_iface_change_fn.
Referenced by totemrrp_initialize().
void* totemrrp_buffer_alloc | ( | void * | rrp_context | ) |
Definition at line 2118 of file totemrrp.c.
References totemrrp_instance::net_handles, and totemnet_buffer_alloc().
Referenced by totemsrp_ring_reenable().
void totemrrp_buffer_release | ( | void * | rrp_context, |
void * | ptr | ||
) |
Definition at line 2125 of file totemrrp.c.
References totemrrp_instance::net_handles, and totemnet_buffer_release().
Referenced by totemsrp_ring_reenable().
int totemrrp_crypto_set | ( | void * | rrp_context, |
const char * | cipher_type, | ||
const char * | hash_type | ||
) |
Definition at line 2240 of file totemrrp.c.
References totemrrp_instance::net_handles, and totemnet_crypto_set().
Referenced by totemsrp_crypto_set().
int totemrrp_finalize | ( | void * | rrp_context | ) |
Definition at line 1974 of file totemrrp.c.
References totemrrp_instance::context, deliver_fn_context::context, deliver_fn_context::instance, totemrrp_instance::interface_count, totemrrp_instance::net_handles, totemnet_finalize(), and totemrrp_instance::totemrrp_target_set_completed.
Referenced by totemsrp_finalize().
int totemrrp_iface_check | ( | void * | rrp_context | ) |
Definition at line 2216 of file totemrrp.c.
References rrp_algo::iface_check, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_ring_reenable().
int totemrrp_ifaces_get | ( | void * | rrp_context, |
char *** | status, | ||
unsigned int * | iface_count | ||
) |
Definition at line 2225 of file totemrrp.c.
References totemrrp_instance::interface_count, and totemrrp_instance::status.
Referenced by totemsrp_ifaces_get().
int totemrrp_initialize | ( | qb_loop_t * | poll_handle, |
void ** | rrp_context, | ||
struct totem_config * | totem_config, | ||
totemsrp_stats_t * | stats, | ||
void * | context, | ||
void(*)(void *context, const void *msg, unsigned int msg_len) | deliver_fn, | ||
void(*)(void *context, const struct totem_ip_address *iface_addr, unsigned int iface_no) | iface_change_fn, | ||
void(*)(const void *msg, unsigned int *seqid, unsigned int *token_is) | token_seqid_get, | ||
unsigned int(*)(void) | msgs_missing, | ||
void(*)(void *context) | target_set_completed | ||
) |
Create an instance.
Definition at line 2003 of file totemrrp.c.
References totemrrp_instance::context, deliver_fn_context::context, totemrrp_instance::deliver_fn_context, totemrrp_stats_t::faulty, deliver_fn_context::iface_no, deliver_fn_context::instance, totem_config::interface_count, totemrrp_stats_t::interface_count, totemrrp_instance::interface_count, totem_config::interfaces, totemrrp_instance::interfaces, 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_warning, totem_logging_configuration::log_printf, totem_logging_configuration::log_subsys_id, totemrrp_instance::net_handles, totemrrp_instance::poll_handle, totemsrp_stats_t::rrp, rrp_deliver_fn(), rrp_iface_change_fn(), totemrrp_instance::stats, totemrrp_instance::totem_config, totem_config::totem_logging_configuration, totemnet_initialize(), totemnet_net_mtu_adjust(), totemrrp_instance::totemrrp_deliver_fn, totemrrp_instance::totemrrp_iface_change_fn, totemrrp_instance::totemrrp_log_level_debug, totemrrp_instance::totemrrp_log_level_error, totemrrp_instance::totemrrp_log_level_notice, totemrrp_instance::totemrrp_log_level_security, totemrrp_instance::totemrrp_log_level_warning, totemrrp_instance::totemrrp_log_printf, totemrrp_instance::totemrrp_msgs_missing, totemrrp_instance::totemrrp_subsys_id, totemrrp_instance::totemrrp_target_set_completed, and totemrrp_instance::totemrrp_token_seqid_get.
Referenced by totemsrp_initialize().
int totemrrp_mcast_flush_send | ( | void * | rrp_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 2182 of file totemrrp.c.
References rrp_algo::mcast_flush_send, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_avail().
int totemrrp_mcast_noflush_send | ( | void * | rrp_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 2196 of file totemrrp.c.
References rrp_algo::mcast_noflush_send, totemrrp_instance::processor_count, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_avail().
int totemrrp_mcast_recv_empty | ( | void * | rrp_context | ) |
Definition at line 2282 of file totemrrp.c.
References rrp_algo::mcast_recv_empty, and totemrrp_instance::rrp_algo.
int totemrrp_member_add | ( | void * | rrp_context, |
const struct totem_ip_address * | member, | ||
int | iface_no | ||
) |
Definition at line 2293 of file totemrrp.c.
References rrp_algo::member_add, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_member_add().
int totemrrp_member_remove | ( | void * | rrp_context, |
const struct totem_ip_address * | member, | ||
int | iface_no | ||
) |
Definition at line 2306 of file totemrrp.c.
References rrp_algo::member_remove, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_member_remove().
void totemrrp_membership_changed | ( | void * | rrp_context, |
enum totem_configuration_type | configuration_type, | ||
const struct srp_addr * | member_list, | ||
size_t | member_list_entries, | ||
const struct srp_addr * | left_list, | ||
size_t | left_list_entries, | ||
const struct srp_addr * | joined_list, | ||
size_t | joined_list_entries, | ||
const struct memb_ring_id * | ring_id | ||
) |
Definition at line 2319 of file totemrrp.c.
References rrp_algo::membership_changed, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_ring_reenable().
int totemrrp_processor_count_set | ( | void * | rrp_context, |
unsigned int | processor_count | ||
) |
Definition at line 2132 of file totemrrp.c.
References totemrrp_instance::processor_count, rrp_algo::processor_count_set, and totemrrp_instance::rrp_algo.
Referenced by totemsrp_ring_reenable().
int totemrrp_recv_flush | ( | void * | rrp_context | ) |
Definition at line 2154 of file totemrrp.c.
References rrp_algo::recv_flush, and totemrrp_instance::rrp_algo.
int totemrrp_ring_reenable | ( | void * | rrp_context, |
unsigned int | iface_no | ||
) |
Definition at line 2259 of file totemrrp.c.
References totemrrp_instance::interface_count, rrp_algo::ring_reenable, totemrrp_instance::rrp_algo, totemrrp_instance::status, and STATUS_STR_LEN.
Referenced by rrp_deliver_fn(), and totemsrp_ring_reenable().
int totemrrp_send_flush | ( | void * | rrp_context | ) |
Definition at line 2163 of file totemrrp.c.
References totemrrp_instance::rrp_algo, and rrp_algo::send_flush.
int totemrrp_token_send | ( | void * | rrp_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 2171 of file totemrrp.c.
References totemrrp_instance::rrp_algo, and rrp_algo::token_send.
Referenced by totemsrp_avail().
int totemrrp_token_target_set | ( | void * | rrp_context, |
struct totem_ip_address * | addr, | ||
unsigned int | iface_no | ||
) |
Definition at line 2144 of file totemrrp.c.
References totemrrp_instance::rrp_algo, and rrp_algo::token_target_set.
Referenced by totemsrp_avail().
struct deliver_fn_context __attribute__ |
struct rrp_algo active_algo |
Definition at line 606 of file totemrrp.c.
char encapsulated |
Definition at line 519 of file totemrrp.c.
unsigned short endian_detector |
Definition at line 520 of file totemrrp.c.
int nodeid_activator |
Definition at line 522 of file totemrrp.c.
struct rrp_algo none_algo |
Definition at line 566 of file totemrrp.c.
struct rrp_algo passive_algo |
Definition at line 586 of file totemrrp.c.
int ring_number |
Definition at line 521 of file totemrrp.c.
struct rrp_algo* rrp_algos[] |
Definition at line 626 of file totemrrp.c.
char type |
Definition at line 518 of file totemrrp.c.
Referenced by cmap_get(), cmap_get_string(), cmap_set(), and coroparse_configparse().