|
corosync
2.4.3
|
#include <config.h>#include <assert.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 <sys/uio.h>#include <limits.h>#include <qb/qbdefs.h>#include <qb/qbutil.h>#include <qb/qbloop.h>#include <corosync/swab.h>#include <corosync/sq.h>#include <corosync/list.h>#include <corosync/logsys.h>#include "totemsrp.h"#include "totemrrp.h"#include "totemnet.h"#include "cs_queue.h"
Go to the source code of this file.
Data Structures | |
| struct | consensus_list_item |
| struct | token_callback_instance |
| struct | totemsrp_socket |
| struct | message_header |
| struct | mcast |
| struct | rtr_item |
| struct | orf_token |
| struct | memb_join |
| struct | memb_merge_detect |
| struct | token_hold_cancel |
| struct | memb_commit_token_memb_entry |
| struct | memb_commit_token |
| struct | message_item |
| struct | sort_queue_item |
| struct | totemsrp_instance |
| struct | message_handlers |
Macros | |
| #define | LOGSYS_UTILS_ONLY 1 |
| #define | LOCALHOST_IP inet_addr("127.0.0.1") |
| #define | QUEUE_RTR_ITEMS_SIZE_MAX 16384 /* allow 16384 retransmit items */ |
| #define | RETRANS_MESSAGE_QUEUE_SIZE_MAX 16384 /* allow 500 messages to be queued */ |
| #define | RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */ |
| #define | MAXIOVS 5 |
| #define | RETRANSMIT_ENTRIES_MAX 30 |
| #define | TOKEN_SIZE_MAX 64000 /* bytes */ |
| #define | LEAVE_DUMMY_NODEID 0 |
| #define | SEQNO_START_MSG 0x0 |
| #define | SEQNO_START_TOKEN 0x0 |
| #define | ENDIAN_LOCAL 0xff22 |
| #define | log_printf(level, format, args...) |
| #define | LOGSYS_PERROR(err_num, level, fmt, args...) |
Functions | |
| struct message_header | __attribute__ ((packed)) |
| void | main_deliver_fn (void *context, const void *msg, unsigned int msg_len) |
| void | main_iface_change_fn (void *context, const struct totem_ip_address *iface_address, unsigned int iface_no) |
| int | totemsrp_initialize (qb_loop_t *poll_handle, void **srp_context, struct totem_config *totem_config, totemmrp_stats_t *stats, void(*deliver_fn)(unsigned int nodeid, const void *msg, unsigned int msg_len, int endian_conversion_required), void(*confchg_fn)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id), void(*waiting_trans_ack_cb_fn)(int waiting_trans_ack)) |
| Create a protocol instance. More... | |
| void | totemsrp_finalize (void *srp_context) |
| int | totemsrp_ifaces_get (void *srp_context, unsigned int nodeid, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count) |
| int | totemsrp_crypto_set (void *srp_context, const char *cipher_type, const char *hash_type) |
| unsigned int | totemsrp_my_nodeid_get (void *srp_context) |
| int | totemsrp_my_family_get (void *srp_context) |
| int | totemsrp_ring_reenable (void *srp_context) |
| void | totemsrp_event_signal (void *srp_context, enum totem_event_type type, int value) |
| int | totemsrp_mcast (void *srp_context, struct iovec *iovec, unsigned int iov_len, int guarantee) |
| Multicast a message. More... | |
| int | totemsrp_avail (void *srp_context) |
| Return number of available messages that can be queued. More... | |
| int | totemsrp_callback_token_create (void *srp_context, void **handle_out, enum totem_callback_token_type type, int delete, int(*callback_fn)(enum totem_callback_token_type type, const void *), const void *data) |
| void | totemsrp_callback_token_destroy (void *srp_context, void **handle_out) |
| void | totemsrp_net_mtu_adjust (struct totem_config *totem_config) |
| void | totemsrp_service_ready_register (void *context, void(*totem_service_ready)(void)) |
| int | totemsrp_member_add (void *context, const struct totem_ip_address *member, int ring_no) |
| int | totemsrp_member_remove (void *context, const struct totem_ip_address *member, int ring_no) |
| void | totemsrp_threaded_mode_enable (void *context) |
| void | totemsrp_trans_ack (void *context) |
Variables | |
| char | type |
| char | encapsulated |
| unsigned short | endian_detector |
| unsigned int | nodeid |
| struct message_header | header |
| struct srp_addr | system_from |
| unsigned int | seq |
| int | this_seqno |
| struct memb_ring_id | ring_id |
| unsigned int | node_id |
| int | guarantee |
| unsigned int | token_seq |
| unsigned int | aru |
| unsigned int | aru_addr |
| unsigned int | backlog |
| unsigned int | fcc |
| int | retrans_flg |
| int | rtr_list_entries |
| struct rtr_item | rtr_list [0] |
| unsigned int | proc_list_entries |
| unsigned int | failed_list_entries |
| unsigned long long | ring_seq |
| unsigned char | end_of_memb_join [0] |
| unsigned int | high_delivered |
| unsigned int | received_flg |
| int | memb_index |
| int | addr_entries |
| unsigned char | end_of_commit_token [0] |
| struct message_item | __attribute__ |
| const char * | gather_state_from_desc [] |
| struct message_handlers | totemsrp_message_handlers |
| unsigned long long int | tv_old |
| #define ENDIAN_LOCAL 0xff22 |
Definition at line 137 of file totemsrp.c.
Referenced by main_deliver_fn().
| #define LEAVE_DUMMY_NODEID 0 |
Definition at line 102 of file totemsrp.c.
| #define LOCALHOST_IP inet_addr("127.0.0.1") |
Definition at line 95 of file totemsrp.c.
| #define log_printf | ( | level, | |
| format, | |||
| args... | |||
| ) |
Definition at line 691 of file totemsrp.c.
Referenced by main_deliver_fn(), and main_iface_change_fn().
| #define LOGSYS_PERROR | ( | err_num, | |
| level, | |||
| fmt, | |||
| args... | |||
| ) |
Definition at line 698 of file totemsrp.c.
| #define LOGSYS_UTILS_ONLY 1 |
Definition at line 86 of file totemsrp.c.
| #define MAXIOVS 5 |
Definition at line 99 of file totemsrp.c.
| #define QUEUE_RTR_ITEMS_SIZE_MAX 16384 /* allow 16384 retransmit items */ |
Definition at line 96 of file totemsrp.c.
| #define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */ |
Definition at line 98 of file totemsrp.c.
| #define RETRANS_MESSAGE_QUEUE_SIZE_MAX 16384 /* allow 500 messages to be queued */ |
Definition at line 97 of file totemsrp.c.
| #define RETRANSMIT_ENTRIES_MAX 30 |
Definition at line 100 of file totemsrp.c.
| #define SEQNO_START_MSG 0x0 |
Definition at line 114 of file totemsrp.c.
| #define SEQNO_START_TOKEN 0x0 |
Definition at line 115 of file totemsrp.c.
| #define TOKEN_SIZE_MAX 64000 /* bytes */ |
Definition at line 101 of file totemsrp.c.
| enum encapsulation_type |
| Enumerator | |
|---|---|
| MESSAGE_ENCAPSULATED | |
| MESSAGE_NOT_ENCAPSULATED | |
Definition at line 148 of file totemsrp.c.
| enum gather_state_from |
Definition at line 537 of file totemsrp.c.
| enum memb_state |
| Enumerator | |
|---|---|
| MEMB_STATE_OPERATIONAL | |
| MEMB_STATE_GATHER | |
| MEMB_STATE_COMMIT | |
| MEMB_STATE_RECOVERY | |
Definition at line 278 of file totemsrp.c.
| enum message_type |
| Enumerator | |
|---|---|
| MESSAGE_TYPE_ORF_TOKEN | |
| MESSAGE_TYPE_MCAST | |
| MESSAGE_TYPE_MEMB_MERGE_DETECT | |
| MESSAGE_TYPE_MEMB_JOIN | |
| MESSAGE_TYPE_MEMB_COMMIT_TOKEN | |
| MESSAGE_TYPE_TOKEN_HOLD_CANCEL | |
Definition at line 139 of file totemsrp.c.
| struct message_header __attribute__ | ( | (packed) | ) |
| void main_deliver_fn | ( | void * | context, |
| const void * | msg, | ||
| unsigned int | msg_len | ||
| ) |
Definition at line 5029 of file totemsrp.c.
References message_header::endian_detector, ENDIAN_LOCAL, message_handlers::handler_functions, log_printf, totemsrp_stats_t::mcast_rx, totemsrp_stats_t::memb_commit_token_rx, totemsrp_stats_t::memb_join_rx, totemsrp_stats_t::memb_merge_detect_rx, MESSAGE_TYPE_MCAST, MESSAGE_TYPE_MEMB_COMMIT_TOKEN, MESSAGE_TYPE_MEMB_JOIN, MESSAGE_TYPE_MEMB_MERGE_DETECT, MESSAGE_TYPE_ORF_TOKEN, MESSAGE_TYPE_TOKEN_HOLD_CANCEL, totemsrp_stats_t::orf_token_rx, totemsrp_stats_t::rx_msg_dropped, totemsrp_instance::stats, totemsrp_stats_t::token_hold_cancel_rx, totemsrp_instance::totemsrp_log_level_security, and message_header::type.
| void main_iface_change_fn | ( | void * | context, |
| const struct totem_ip_address * | iface_address, | ||
| unsigned int | iface_no | ||
| ) |
Definition at line 5080 of file totemsrp.c.
References srp_addr::addr, totemsrp_instance::iface_changes, totem_config::interface_count, totem_config::interfaces, log_printf, totemsrp_instance::memb_ring_id_create_or_load, totem_interface::member_count, totem_interface::member_list, totemsrp_instance::my_id, totemsrp_instance::my_memb_list, totemsrp_instance::my_ring_id, totem_ip_address::nodeid, memb_ring_id::rep, memb_ring_id::seq, totemsrp_instance::token_ring_id_seq, totemsrp_instance::totem_config, totemip_copy(), totemip_print(), totemsrp_instance::totemsrp_log_level_debug, totemsrp_member_add(), and totemsrp_instance::totemsrp_service_ready_fn.
| int totemsrp_avail | ( | void * | srp_context | ) |
Return number of available messages that can be queued.
Definition at line 2560 of file totemsrp.c.
References totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, and totemsrp_instance::waiting_trans_ack.
Referenced by totemmrp_avail().
| int totemsrp_callback_token_create | ( | void * | srp_context, |
| void ** | handle_out, | ||
| enum totem_callback_token_type | type, | ||
| int | delete, | ||
| int(*)(enum totem_callback_token_type type, const void *) | callback_fn, | ||
| const void * | data | ||
| ) |
Definition at line 3479 of file totemsrp.c.
Referenced by totemmrp_callback_token_create().
| void totemsrp_callback_token_destroy | ( | void * | srp_context, |
| void ** | handle_out | ||
| ) |
Definition at line 3514 of file totemsrp.c.
Referenced by totemmrp_callback_token_destroy().
| int totemsrp_crypto_set | ( | void * | srp_context, |
| const char * | cipher_type, | ||
| const char * | hash_type | ||
| ) |
Definition at line 1124 of file totemsrp.c.
References totemsrp_instance::totemrrp_context, and totemrrp_crypto_set().
Referenced by totemmrp_crypto_set().
| void totemsrp_event_signal | ( | void * | srp_context, |
| enum totem_event_type | type, | ||
| int | value | ||
| ) |
Definition at line 2482 of file totemsrp.c.
Referenced by totemmrp_event_signal().
| void totemsrp_finalize | ( | void * | srp_context | ) |
Definition at line 1042 of file totemsrp.c.
Referenced by totemmrp_finalize().
| int totemsrp_ifaces_get | ( | void * | srp_context, |
| unsigned int | nodeid, | ||
| struct totem_ip_address * | interfaces, | ||
| unsigned int | interfaces_size, | ||
| char *** | status, | ||
| unsigned int * | iface_count | ||
| ) |
Definition at line 1066 of file totemsrp.c.
References srp_addr::addr, totem_config::interface_count, totemsrp_instance::my_left_memb_entries, totemsrp_instance::my_left_memb_list, totemsrp_instance::my_memb_entries, totemsrp_instance::my_memb_list, totem_ip_address::nodeid, totemsrp_instance::totem_config, totemsrp_instance::totemrrp_context, and totemrrp_ifaces_get().
Referenced by totemmrp_ifaces_get().
| int totemsrp_initialize | ( | qb_loop_t * | poll_handle, |
| void ** | srp_context, | ||
| struct totem_config * | totem_config, | ||
| totemmrp_stats_t * | stats, | ||
| void(*)(unsigned int nodeid, const void *msg, unsigned int msg_len, int endian_conversion_required) | deliver_fn, | ||
| void(*)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id) | confchg_fn, | ||
| void(*)(int waiting_trans_ack) | waiting_trans_ack_cb_fn | ||
| ) |
Create a protocol instance.
Definition at line 832 of file totemsrp.c.
| int totemsrp_mcast | ( | void * | srp_context, |
| struct iovec * | iovec, | ||
| unsigned int | iov_len, | ||
| int | guarantee | ||
| ) |
Multicast a message.
Definition at line 2491 of file totemsrp.c.
References consensus_list_item::addr, totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, and totemsrp_instance::waiting_trans_ack.
Referenced by totemmrp_mcast().
| int totemsrp_member_add | ( | void * | context, |
| const struct totem_ip_address * | member, | ||
| int | ring_no | ||
| ) |
Definition at line 5133 of file totemsrp.c.
References totemsrp_instance::totemrrp_context, and totemrrp_member_add().
Referenced by main_iface_change_fn(), and totemmrp_member_add().
| int totemsrp_member_remove | ( | void * | context, |
| const struct totem_ip_address * | member, | ||
| int | ring_no | ||
| ) |
Definition at line 5146 of file totemsrp.c.
References totemsrp_instance::totemrrp_context, and totemrrp_member_remove().
Referenced by totemmrp_member_remove().
| int totemsrp_my_family_get | ( | void * | srp_context | ) |
Definition at line 1149 of file totemsrp.c.
References totem_interface::boundto, totem_ip_address::family, totem_config::interfaces, and totemsrp_instance::totem_config.
Referenced by totemmrp_my_family_get().
| unsigned int totemsrp_my_nodeid_get | ( | void * | srp_context | ) |
Definition at line 1138 of file totemsrp.c.
References totem_interface::boundto, totem_config::interfaces, totem_ip_address::nodeid, and totemsrp_instance::totem_config.
Referenced by totemmrp_my_nodeid_get().
| void totemsrp_net_mtu_adjust | ( | struct totem_config * | totem_config | ) |
Definition at line 5120 of file totemsrp.c.
References totem_config::net_mtu.
| int totemsrp_ring_reenable | ( | void * | srp_context | ) |
Definition at line 1161 of file totemsrp.c.
References totem_config::interface_count, totemsrp_instance::totem_config, totemsrp_instance::totemrrp_context, and totemrrp_ring_reenable().
Referenced by totemmrp_ring_reenable().
| void totemsrp_service_ready_register | ( | void * | context, |
| void(*)(void) | totem_service_ready | ||
| ) |
Definition at line 5124 of file totemsrp.c.
References totemsrp_instance::totemsrp_service_ready_fn.
Referenced by totemmrp_service_ready_register().
| void totemsrp_threaded_mode_enable | ( | void * | context | ) |
Definition at line 5159 of file totemsrp.c.
References totemsrp_instance::threaded_mode_enabled.
Referenced by totemmrp_threaded_mode_enable().
| void totemsrp_trans_ack | ( | void * | context | ) |
Definition at line 5166 of file totemsrp.c.
References totemsrp_instance::totemsrp_waiting_trans_ack_cb_fn, and totemsrp_instance::waiting_trans_ack.
Referenced by totemmrp_trans_ack().
| struct message_item __attribute__ |
| int addr_entries |
Definition at line 65 of file totemsrp.c.
| unsigned int aru |
Definition at line 63 of file totemsrp.c.
| unsigned int aru_addr |
Definition at line 64 of file totemsrp.c.
| unsigned int backlog |
Definition at line 66 of file totemsrp.c.
| char encapsulated |
Definition at line 61 of file totemsrp.c.
| unsigned char end_of_commit_token[0] |
Definition at line 66 of file totemsrp.c.
| unsigned char end_of_memb_join[0] |
Definition at line 65 of file totemsrp.c.
| unsigned short endian_detector |
Definition at line 62 of file totemsrp.c.
| unsigned int failed_list_entries |
Definition at line 63 of file totemsrp.c.
| unsigned int fcc |
Definition at line 67 of file totemsrp.c.
| const char* gather_state_from_desc[] |
Definition at line 557 of file totemsrp.c.
| int guarantee |
Definition at line 66 of file totemsrp.c.
| struct message_header header |
Definition at line 60 of file totemsrp.c.
Referenced by corosync_sending_allowed().
| unsigned int high_delivered |
Definition at line 62 of file totemsrp.c.
| int memb_index |
Definition at line 64 of file totemsrp.c.
| unsigned int node_id |
Definition at line 65 of file totemsrp.c.
| unsigned int nodeid |
Definition at line 63 of file totemsrp.c.
| unsigned int proc_list_entries |
Definition at line 62 of file totemsrp.c.
| unsigned int received_flg |
Definition at line 63 of file totemsrp.c.
| unsigned int retrans_flg |
Definition at line 68 of file totemsrp.c.
| struct memb_ring_id ring_id |
Definition at line 64 of file totemsrp.c.
Referenced by votequorum_dispatch().
| unsigned long long ring_seq |
Definition at line 64 of file totemsrp.c.
| struct rtr_item rtr_list[0] |
Definition at line 70 of file totemsrp.c.
| int rtr_list_entries |
Definition at line 69 of file totemsrp.c.
| unsigned int seq |
Definition at line 62 of file totemsrp.c.
| struct srp_addr system_from |
Definition at line 61 of file totemsrp.c.
Referenced by totemudp_recv_mcast_empty(), and totemudpu_recv_mcast_empty().
| int this_seqno |
Definition at line 63 of file totemsrp.c.
| unsigned int token_seq |
Definition at line 62 of file totemsrp.c.
| struct message_handlers totemsrp_message_handlers |
Definition at line 679 of file totemsrp.c.
| unsigned long long int tv_old |
Definition at line 3944 of file totemsrp.c.
| char type |
Definition at line 60 of file totemsrp.c.
1.8.13