totemsrp.c File Reference
`#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/qblist.h>`
`#include <qb/qbdefs.h>`
`#include <qb/qbutil.h>`
`#include <qb/qbloop.h>`
`#include <corosync/swab.h>`
`#include <corosync/sq.h>`
`#include <corosync/logsys.h>`
`#include "totemsrp.h"`
`#include "totemnet.h"`
`#include "icmap.h"`
`#include "totemconfig.h"`
`#include "cs_queue.h"`
Include dependency graph for totemsrp.c:

Go to the source code of this file.

## Data Structures

struct | srp_addr
struct | consensus_list_item
struct | token_callback_instance
struct | totemsrp_socket
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...)

## Enumerations

enum | message_type { MESSAGE_TYPE_ORF_TOKEN = 0 , MESSAGE_TYPE_MCAST = 1 , MESSAGE_TYPE_MEMB_MERGE_DETECT = 2 , MESSAGE_TYPE_MEMB_JOIN = 3 , MESSAGE_TYPE_MEMB_COMMIT_TOKEN = 4 , MESSAGE_TYPE_TOKEN_HOLD_CANCEL = 5 }
enum | encapsulation_type { MESSAGE_ENCAPSULATED = 1 , MESSAGE_NOT_ENCAPSULATED = 2 }
enum | memb_state { MEMB_STATE_OPERATIONAL = 1 , MEMB_STATE_GATHER = 2 , MEMB_STATE_COMMIT = 3 , MEMB_STATE_RECOVERY = 4 }

enum

gather_state_from {
TOTEMSRP_GSFROM_CONSENSUS_TIMEOUT = 0 , TOTEMSRP_GSFROM_GATHER_MISSING1 = 1 , TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_OPERATIONAL_STATE = 2 , TOTEMSRP_GSFROM_THE_CONSENSUS_TIMEOUT_EXPIRED = 3 ,
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_COMMIT_STATE = 4 , TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_RECOVERY_STATE = 5 , TOTEMSRP_GSFROM_FAILED_TO_RECEIVE = 6 , TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_OPERATIONAL_STATE = 7 ,
TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_GATHER_STATE = 8 , TOTEMSRP_GSFROM_MERGE_DURING_OPERATIONAL_STATE = 9 , TOTEMSRP_GSFROM_MERGE_DURING_GATHER_STATE = 10 , TOTEMSRP_GSFROM_MERGE_DURING_JOIN = 11 ,
TOTEMSRP_GSFROM_JOIN_DURING_OPERATIONAL_STATE = 12 , TOTEMSRP_GSFROM_JOIN_DURING_COMMIT_STATE = 13 , TOTEMSRP_GSFROM_JOIN_DURING_RECOVERY = 14 , TOTEMSRP_GSFROM_INTERFACE_CHANGE = 15 ,
TOTEMSRP_GSFROM_MAX = TOTEMSRP_GSFROM_INTERFACE_CHANGE
}

## Functions

struct mcast | __attribute__ ((packed))
int | main_deliver_fn (void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from)
int | 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, totempg_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.
void | totemsrp_finalize (void *srp_context)
int | totemsrp_nodestatus_get (void *srp_context, unsigned int nodeid, struct totem_node_status *node_status)
int | totemsrp_ifaces_get (void *srp_context, unsigned int nodeid, unsigned int *interface_id, 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)
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.
int | totemsrp_avail (void *srp_context)
| Return number of available messages that can be queued.
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)
int | totemsrp_iface_set (void *context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
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 iface_no)
int | totemsrp_member_remove (void *context, const struct totem_ip_address *member, int iface_no)
void | totemsrp_threaded_mode_enable (void *context)
void | totemsrp_trans_ack (void *context)
int | totemsrp_reconfigure (void *context, struct totem_config *totem_config)
int | totemsrp_crypto_reconfigure_phase (void *context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
void | totemsrp_stats_clear (void *context, int flags)
void | totemsrp_force_gather (void *context)

## Variables

struct totem_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

## Macro Definition Documentation

## ENDIAN_LOCAL

#define ENDIAN_LOCAL 0xff22

Definition at line 144 of file totemsrp.c.

## LEAVE_DUMMY_NODEID

#define LEAVE_DUMMY_NODEID 0

Definition at line 102 of file totemsrp.c.

## LOCALHOST_IP

#define LOCALHOST_IP inet_addr("127.0.0.1")

Definition at line 95 of file totemsrp.c.

## log_printf

#define log_printf | ( |  | level,
|  |  | format,
|  |  | args... )

Value:
do { \
instance->totemsrp_log_printf ( \
level, instance->totemsrp_subsys_id, \
__FUNCTION__, __FILE__, __LINE__, \
format, ##args); \
} while (0);

Definition at line 690 of file totemsrp.c.

Referenced by main_deliver_fn(), main_iface_change_fn(), totemsrp_initialize(), and totemsrp_mcast().

## LOGSYS_PERROR

#define LOGSYS_PERROR | ( |  | err_num,
|  |  | level,
|  |  | fmt,
|  |  | args... )

Value:
do { \
char _error_str[LOGSYS_MAX_PERROR_MSG_LEN]; \
const char *_error_ptr = qb_strerror_r(err_num, _error_str, sizeof(_error_str)); \
instance->totemsrp_log_printf ( \
level, instance->totemsrp_subsys_id, \
__FUNCTION__, __FILE__, __LINE__, \
fmt ": %s (%d)\n", ##args, _error_ptr, err_num); \
} while(0)
LOGSYS_MAX_PERROR_MSG_LEN
#define LOGSYS_MAX_PERROR_MSG_LEN
Definition logsys.h:87

Definition at line 697 of file totemsrp.c.

## LOGSYS_UTILS_ONLY

#define LOGSYS_UTILS_ONLY 1

Definition at line 84 of file totemsrp.c.

## MAXIOVS

#define MAXIOVS 5

Definition at line 99 of file totemsrp.c.

## QUEUE_RTR_ITEMS_SIZE_MAX

#define QUEUE_RTR_ITEMS_SIZE_MAX 16384 /* allow 16384 retransmit items */

Definition at line 96 of file totemsrp.c.

Referenced by totemsrp_initialize().

## RECEIVED_MESSAGE_QUEUE_SIZE_MAX

#define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */

Definition at line 98 of file totemsrp.c.

## RETRANS_MESSAGE_QUEUE_SIZE_MAX

#define RETRANS_MESSAGE_QUEUE_SIZE_MAX 16384 /* allow 500 messages to be queued */

Definition at line 97 of file totemsrp.c.

Referenced by totemsrp_initialize().

## RETRANSMIT_ENTRIES_MAX

#define RETRANSMIT_ENTRIES_MAX 30

Definition at line 100 of file totemsrp.c.

## SEQNO_START_MSG

#define SEQNO_START_MSG 0x0

Definition at line 121 of file totemsrp.c.

## SEQNO_START_TOKEN

#define SEQNO_START_TOKEN 0x0

Definition at line 122 of file totemsrp.c.

## TOKEN_SIZE_MAX

#define TOKEN_SIZE_MAX 64000 /* bytes */

Definition at line 101 of file totemsrp.c.

## Enumeration Type Documentation

## encapsulation_type

enum encapsulation_type

Enumerator
MESSAGE_ENCAPSULATED |
MESSAGE_NOT_ENCAPSULATED |

Definition at line 155 of file totemsrp.c.

## gather_state_from

enum gather_state_from

Enumerator
TOTEMSRP_GSFROM_CONSENSUS_TIMEOUT |
TOTEMSRP_GSFROM_GATHER_MISSING1 |
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_OPERATIONAL_STATE |
TOTEMSRP_GSFROM_THE_CONSENSUS_TIMEOUT_EXPIRED |
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_COMMIT_STATE |
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_RECOVERY_STATE |
TOTEMSRP_GSFROM_FAILED_TO_RECEIVE |
TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_OPERATIONAL_STATE |
TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_GATHER_STATE |
TOTEMSRP_GSFROM_MERGE_DURING_OPERATIONAL_STATE |
TOTEMSRP_GSFROM_MERGE_DURING_GATHER_STATE |
TOTEMSRP_GSFROM_MERGE_DURING_JOIN |
TOTEMSRP_GSFROM_JOIN_DURING_OPERATIONAL_STATE |
TOTEMSRP_GSFROM_JOIN_DURING_COMMIT_STATE |
TOTEMSRP_GSFROM_JOIN_DURING_RECOVERY |
TOTEMSRP_GSFROM_INTERFACE_CHANGE |
TOTEMSRP_GSFROM_MAX |

Definition at line 542 of file totemsrp.c.

## memb_state

enum memb_state

Enumerator
MEMB_STATE_OPERATIONAL |
MEMB_STATE_GATHER |
MEMB_STATE_COMMIT |
MEMB_STATE_RECOVERY |

Definition at line 277 of file totemsrp.c.

## message_type

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 146 of file totemsrp.c.

## Function Documentation

## __attribute__()

struct mcast __attribute__ | ( | (packed) |  | ) |

## main_deliver_fn()

int main_deliver_fn | ( | void * | context,
|  | const void * | msg,
|  | unsigned int | msg_len,
|  | const struct sockaddr_storage * | system_from )

Definition at line 5063 of file totemsrp.c.

References log_printf, totem_message_header::magic, 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, system_from, totemsrp_stats_t::token_hold_cancel_rx, TOTEM_MH_MAGIC, totemip_sa_print(), totemsrp_instance::totemsrp_log_level_security, totemsrp_message_handlers, and totem_message_header::type.

Referenced by totemsrp_initialize().

## main_iface_change_fn()

int main_iface_change_fn | ( | void * | context,
|  | const struct totem_ip_address * | iface_address,
|  | unsigned int | iface_no )

Definition at line 5135 of file totemsrp.c.

References totem_interface::configured, CS_PRI_RING_ID, icmap_get_global_map(), totemsrp_instance::iface_changes, INTERFACE_MAX, totem_config::interfaces, log_printf, totemsrp_instance::memb_ring_id_create_or_load, totemsrp_instance::my_addrs, totemsrp_instance::my_id, totemsrp_instance::my_ring_id, srp_addr::nodeid, totem_ip_address::nodeid, totem_config::orig_interfaces, memb_ring_id::rep, memb_ring_id::seq, totemsrp_instance::token_ring_id_seq, totemsrp_instance::totem_config, totemconfig_commit_new_params(), totemip_copy(), TOTEMSRP_GSFROM_INTERFACE_CHANGE, totemsrp_instance::totemsrp_log_level_debug, and totemsrp_instance::totemsrp_service_ready_fn.

Referenced by totemsrp_initialize().

## totemsrp_avail()

int totemsrp_avail | ( | void * | srp_context | ) |

Return number of available messages that can be queued.

Definition at line 2568 of file totemsrp.c.

References totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, and totemsrp_instance::waiting_trans_ack.

Referenced by totempg_initialize().

## totemsrp_callback_token_create()

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 )

Definition at line 3496 of file totemsrp.c.

References token_callback_instance::callback_fn, token_callback_instance::callback_type, token_callback_instance::data, token_callback_instance::delete, token_callback_instance::list, totemsrp_instance::token_callback_received_listhead, totemsrp_instance::token_callback_sent_listhead, TOTEM_CALLBACK_TOKEN_RECEIVED, TOTEM_CALLBACK_TOKEN_SENT, and type.

Referenced by totempg_callback_token_create(), totempg_initialize(), and totemsrp_initialize().

## totemsrp_callback_token_destroy()

void totemsrp_callback_token_destroy | ( | void * | srp_context,
|  | void ** | handle_out )

Definition at line 3531 of file totemsrp.c.

References token_callback_instance::list.

Referenced by totempg_callback_token_destroy().

## totemsrp_crypto_reconfigure_phase()

int totemsrp_crypto_reconfigure_phase | ( | void * | context,
|  | struct totem_config * | totem_config,
|  | cfg_message_crypto_reconfig_phase_t | phase )

Definition at line 5258 of file totemsrp.c.

References totemsrp_instance::totemnet_context, and totemnet_crypto_reconfigure_phase().

Referenced by totempg_crypto_reconfigure_phase().

## totemsrp_crypto_set()

int totemsrp_crypto_set | ( | void * | srp_context,
|  | const char * | cipher_type,
|  | const char * | hash_type )

Definition at line 1108 of file totemsrp.c.

References totemsrp_instance::totemnet_context, and totemnet_crypto_set().

Referenced by totempg_crypto_set().

## totemsrp_event_signal()

void totemsrp_event_signal | ( | void * | srp_context,
|  | enum totem_event_type | type,
|  | int | value )

Definition at line 2488 of file totemsrp.c.

References type, and value.

Referenced by totempg_event_signal().

## totemsrp_finalize()

void totemsrp_finalize | ( | void * | srp_context | ) |

Definition at line 1026 of file totemsrp.c.

References totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, totemsrp_instance::recovery_sort_queue, totemsrp_instance::regular_sort_queue, totemsrp_instance::retrans_message_queue, totemsrp_instance::totemnet_context, and totemnet_finalize().

Referenced by totempg_finalize().

## totemsrp_force_gather()

void totemsrp_force_gather | ( | void * | context | ) |

Definition at line 5277 of file totemsrp.c.

Referenced by totempg_force_gather().

## totemsrp_iface_set()

int totemsrp_iface_set | ( | void * | context,
|  | const struct totem_ip_address * | interface_addr,
|  | unsigned short | ip_port,
|  | unsigned int | iface_no )

Definition at line 5114 of file totemsrp.c.

References totemsrp_instance::my_addrs, totemip_copy(), totemsrp_instance::totemnet_context, and totemnet_iface_set().

Referenced by totempg_iface_set().

## totemsrp_ifaces_get()

int totemsrp_ifaces_get | ( | void * | srp_context,
|  | unsigned int | nodeid,
|  | unsigned int * | interface_id,
|  | struct totem_ip_address * | interfaces,
|  | unsigned int | interfaces_size,
|  | char *** | status,
|  | unsigned int * | iface_count )

Definition at line 1070 of file totemsrp.c.

References totem_interface::configured, INTERFACE_MAX, totem_config::interfaces, totem_interface::member_count, totem_interface::member_list, nodeid, totem_ip_address::nodeid, totemsrp_instance::totem_config, totemsrp_instance::totemnet_context, and totemnet_ifaces_get().

Referenced by totempg_ifaces_get().

## totemsrp_initialize()

int totemsrp_initialize | ( | qb_loop_t * | poll_handle,
|  | void ** | srp_context,
|  | struct totem_config * | totem_config,
|  | totempg_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.

Definition at line 818 of file totemsrp.c.

References totem_interface::boundto, totem_config::consensus_timeout, totem_config::downcheck_timeout, totemsrp_stats_t::earliest_token, totem_config::fail_to_recv_const, totem_config::heartbeat_failures_allowed, totemsrp_instance::heartbeat_timeout, totem_config::interfaces, totem_config::join_timeout, totemsrp_stats_t::latest_token, 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, log_printf, totem_logging_configuration::log_printf, totem_logging_configuration::log_subsys_id, LOGSYS_LEVEL_DEBUG, totemsrp_instance::lowest_active_if, main_deliver_fn(), main_iface_change_fn(), totem_config::max_messages, totem_config::max_network_delay, totem_interface::mcast_addr, totemsrp_instance::mcast_address, totemsrp_instance::memb_ring_id_create_or_load, totemsrp_instance::memb_ring_id_store, totem_config::merge_timeout, MESSAGE_QUEUE_MAX, totem_config::miss_count_const, totemsrp_instance::my_id, totem_config::net_mtu, totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, nodeid, srp_addr::nodeid, totem_ip_address::nodeid, QUEUE_RTR_ITEMS_SIZE_MAX, totemsrp_instance::recovery_sort_queue, totemsrp_instance::regular_sort_queue, totemsrp_instance::retrans_message_queue, RETRANS_MESSAGE_QUEUE_SIZE_MAX, ring_id, totem_config::send_join_timeout, totem_config::seqno_unchanged_const, totemsrp_instance::stats, totemsrp_instance::threaded_mode_enabled, totem_config::threads, totem_config::token_hold_timeout, totemsrp_instance::token_recv_event_handle, totem_config::token_retransmit_timeout, totem_config::token_retransmits_before_loss_const, totemsrp_instance::token_sent_event_handle, totem_config::token_timeout, totem_config::token_warning, TOTEM_CALLBACK_TOKEN_RECEIVED, TOTEM_CALLBACK_TOKEN_SENT, totemsrp_instance::totem_config, totem_config::totem_logging_configuration, totem_config::totem_memb_ring_id_create_or_load, totem_config::totem_memb_ring_id_store, totemip_copy(), totemsrp_instance::totemnet_context, totemnet_initialize(), totemsrp_callback_token_create(), totemsrp_instance::totemsrp_confchg_fn, totemsrp_instance::totemsrp_deliver_fn, totemsrp_instance::totemsrp_log_level_debug, totemsrp_instance::totemsrp_log_level_error, totemsrp_instance::totemsrp_log_level_notice, totemsrp_instance::totemsrp_log_level_security, totemsrp_instance::totemsrp_log_level_trace, totemsrp_instance::totemsrp_log_level_warning, totemsrp_instance::totemsrp_log_printf, totemsrp_instance::totemsrp_poll_handle, totemsrp_instance::totemsrp_subsys_id, totemsrp_instance::totemsrp_waiting_trans_ack_cb_fn, totemsrp_instance::use_heartbeat, and totem_config::window_size.

Referenced by totempg_initialize().

## totemsrp_mcast()

int totemsrp_mcast | ( | void * | srp_context,
|  | struct iovec * | iovec,
|  | unsigned int | iov_len,
|  | int | guarantee )

Multicast a message.

Definition at line 2497 of file totemsrp.c.

References addr, totem_message_header::encapsulated, guarantee, mcast::guarantee, mcast::header, log_printf, totem_message_header::magic, message_item::mcast, totemsrp_stats_t::mcast_tx, MESSAGE_NOT_ENCAPSULATED, MESSAGE_TYPE_MCAST, message_item::msg_len, totemsrp_instance::my_id, totemsrp_instance::new_message_queue, totemsrp_instance::new_message_queue_trans, srp_addr::nodeid, totem_message_header::nodeid, totemsrp_instance::stats, mcast::system_from, TOTEM_MH_MAGIC, TOTEM_MH_VERSION, totemsrp_instance::totemsrp_log_level_debug, totemsrp_instance::totemsrp_log_level_trace, totem_message_header::type, totem_message_header::version, and totemsrp_instance::waiting_trans_ack.

## totemsrp_member_add()

int totemsrp_member_add | ( | void * | context,
|  | const struct totem_ip_address * | member,
|  | int | iface_no )

Definition at line 5207 of file totemsrp.c.

References totemsrp_instance::my_addrs, totemsrp_instance::totemnet_context, and totemnet_member_add().

Referenced by totempg_member_add().

## totemsrp_member_remove()

int totemsrp_member_remove | ( | void * | context,
|  | const struct totem_ip_address * | member,
|  | int | iface_no )

Definition at line 5220 of file totemsrp.c.

References totemsrp_instance::totemnet_context, and totemnet_member_remove().

Referenced by totempg_member_remove().

## totemsrp_my_family_get()

int totemsrp_my_family_get | ( | void * | srp_context | ) |

Definition at line 1133 of file totemsrp.c.

References totem_interface::boundto, totem_ip_address::family, totem_config::interfaces, totemsrp_instance::lowest_active_if, and totemsrp_instance::totem_config.

Referenced by totempg_my_family_get().

## totemsrp_my_nodeid_get()

unsigned int totemsrp_my_nodeid_get | ( | void * | srp_context | ) |

Definition at line 1122 of file totemsrp.c.

References totemsrp_instance::my_id, and srp_addr::nodeid.

Referenced by totempg_my_nodeid_get().

## totemsrp_net_mtu_adjust()

void totemsrp_net_mtu_adjust | ( | struct totem_config * | totem_config | ) |

Definition at line 5194 of file totemsrp.c.

References totem_config::net_mtu.

Referenced by totempg_initialize().

## totemsrp_nodestatus_get()

int totemsrp_nodestatus_get | ( | void * | srp_context,
|  | unsigned int | nodeid,
|  | struct totem_node_status * | node_status )

Definition at line 1041 of file totemsrp.c.

References totemsrp_instance::my_proc_list, totemsrp_instance::my_proc_list_entries, nodeid, srp_addr::nodeid, totem_node_status::reachable, TOTEM_NODE_STATUS_STRUCTURE_VERSION, totemsrp_instance::totemnet_context, totemnet_nodestatus_get(), and totem_node_status::version.

Referenced by totempg_nodestatus_get().

## totemsrp_reconfigure()

int totemsrp_reconfigure | ( | void * | context,
|  | struct totem_config * | totem_config )

Definition at line 5249 of file totemsrp.c.

References totemsrp_instance::totemnet_context, and totemnet_reconfigure().

Referenced by totempg_reconfigure().

## totemsrp_service_ready_register()

void totemsrp_service_ready_register | ( | void * | context,
|  | void(* | totem_service_ready )(void) )

Definition at line 5198 of file totemsrp.c.

References totemsrp_instance::totemsrp_service_ready_fn.

Referenced by totempg_service_ready_register().

## totemsrp_stats_clear()

void totemsrp_stats_clear | ( | void * | context,
|  | int | flags )

Definition at line 5267 of file totemsrp.c.

References flags, totemsrp_instance::stats, totemsrp_instance::totemnet_context, totemnet_stats_clear(), and TOTEMPG_STATS_CLEAR_TRANSPORT.

Referenced by totempg_stats_clear().

## totemsrp_threaded_mode_enable()

void totemsrp_threaded_mode_enable | ( | void * | context | ) |

Definition at line 5233 of file totemsrp.c.

References totemsrp_instance::threaded_mode_enabled.

Referenced by totempg_threaded_mode_enable().

## totemsrp_trans_ack()

void totemsrp_trans_ack | ( | void * | context | ) |

Definition at line 5240 of file totemsrp.c.

References totemsrp_instance::totemsrp_waiting_trans_ack_cb_fn, and totemsrp_instance::waiting_trans_ack.

Referenced by totempg_trans_ack().

## Variable Documentation

## __attribute__

struct message_item __attribute__

## addr_entries

int addr_entries

Definition at line 5 of file totemsrp.c.

## aru

unsigned int aru

Definition at line 3 of file totemsrp.c.

## aru_addr

unsigned int aru_addr

Definition at line 4 of file totemsrp.c.

## backlog

unsigned int backlog

Definition at line 6 of file totemsrp.c.

## end_of_commit_token

unsigned char end_of_commit_token[0]

Definition at line 6 of file totemsrp.c.

## end_of_memb_join

unsigned char end_of_memb_join[0]

Definition at line 5 of file totemsrp.c.

## failed_list_entries

unsigned int failed_list_entries

Definition at line 3 of file totemsrp.c.

## fcc

unsigned int fcc

Definition at line 7 of file totemsrp.c.

## gather_state_from_desc

const char* gather_state_from_desc[]

Initial value:
= {
[TOTEMSRP_GSFROM_CONSENSUS_TIMEOUT] = "consensus timeout",
[TOTEMSRP_GSFROM_GATHER_MISSING1] = "MISSING",
[TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_OPERATIONAL_STATE] = "The token was lost in the OPERATIONAL state.",
[TOTEMSRP_GSFROM_THE_CONSENSUS_TIMEOUT_EXPIRED] = "The consensus timeout expired.",
[TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_COMMIT_STATE] = "The token was lost in the COMMIT state.",
[TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_RECOVERY_STATE] = "The token was lost in the RECOVERY state.",
[TOTEMSRP_GSFROM_FAILED_TO_RECEIVE] = "failed to receive",
[TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_OPERATIONAL_STATE] = "foreign message in operational state",
[TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_GATHER_STATE] = "foreign message in gather state",
[TOTEMSRP_GSFROM_MERGE_DURING_OPERATIONAL_STATE] = "merge during operational state",
[TOTEMSRP_GSFROM_MERGE_DURING_GATHER_STATE] = "merge during gather state",
[TOTEMSRP_GSFROM_MERGE_DURING_JOIN] = "merge during join",
[TOTEMSRP_GSFROM_JOIN_DURING_OPERATIONAL_STATE] = "join during operational state",
[TOTEMSRP_GSFROM_JOIN_DURING_COMMIT_STATE] = "join during commit state",
[TOTEMSRP_GSFROM_JOIN_DURING_RECOVERY] = "join during recovery",
[TOTEMSRP_GSFROM_INTERFACE_CHANGE] = "interface change",
}
TOTEMSRP_GSFROM_THE_CONSENSUS_TIMEOUT_EXPIRED
@ TOTEMSRP_GSFROM_THE_CONSENSUS_TIMEOUT_EXPIRED
Definition totemsrp.c:546
TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_GATHER_STATE
@ TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_GATHER_STATE
Definition totemsrp.c:551
TOTEMSRP_GSFROM_FAILED_TO_RECEIVE
@ TOTEMSRP_GSFROM_FAILED_TO_RECEIVE
Definition totemsrp.c:549
TOTEMSRP_GSFROM_CONSENSUS_TIMEOUT
@ TOTEMSRP_GSFROM_CONSENSUS_TIMEOUT
Definition totemsrp.c:543
TOTEMSRP_GSFROM_MERGE_DURING_OPERATIONAL_STATE
@ TOTEMSRP_GSFROM_MERGE_DURING_OPERATIONAL_STATE
Definition totemsrp.c:552
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_OPERATIONAL_STATE
@ TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_OPERATIONAL_STATE
Definition totemsrp.c:545
TOTEMSRP_GSFROM_MERGE_DURING_JOIN
@ TOTEMSRP_GSFROM_MERGE_DURING_JOIN
Definition totemsrp.c:554
TOTEMSRP_GSFROM_INTERFACE_CHANGE
@ TOTEMSRP_GSFROM_INTERFACE_CHANGE
Definition totemsrp.c:558
TOTEMSRP_GSFROM_GATHER_MISSING1
@ TOTEMSRP_GSFROM_GATHER_MISSING1
Definition totemsrp.c:544
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_COMMIT_STATE
@ TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_COMMIT_STATE
Definition totemsrp.c:547
TOTEMSRP_GSFROM_JOIN_DURING_COMMIT_STATE
@ TOTEMSRP_GSFROM_JOIN_DURING_COMMIT_STATE
Definition totemsrp.c:556
TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_RECOVERY_STATE
@ TOTEMSRP_GSFROM_THE_TOKEN_WAS_LOST_IN_THE_RECOVERY_STATE
Definition totemsrp.c:548
TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_OPERATIONAL_STATE
@ TOTEMSRP_GSFROM_FOREIGN_MESSAGE_IN_OPERATIONAL_STATE
Definition totemsrp.c:550
TOTEMSRP_GSFROM_JOIN_DURING_OPERATIONAL_STATE
@ TOTEMSRP_GSFROM_JOIN_DURING_OPERATIONAL_STATE
Definition totemsrp.c:555
TOTEMSRP_GSFROM_MERGE_DURING_GATHER_STATE
@ TOTEMSRP_GSFROM_MERGE_DURING_GATHER_STATE
Definition totemsrp.c:553
TOTEMSRP_GSFROM_JOIN_DURING_RECOVERY
@ TOTEMSRP_GSFROM_JOIN_DURING_RECOVERY
Definition totemsrp.c:557

Definition at line 562 of file totemsrp.c.

## guarantee

int guarantee

Definition at line 6 of file totemsrp.c.

Referenced by req_lib_cpg_mcast::__attribute__(), req_lib_cpg_partial_mcast::__attribute__(), cpg_mcast_joined(), cpg_zcb_mcast_joined(), main_mcast(), totempg_groups_finalize(), totempg_groups_mcast_groups(), totempg_groups_mcast_joined(), and totemsrp_mcast().

## header

struct totem_message_header header

Definition at line 0 of file totemsrp.c.

Referenced by mar_req_coroipcc_zc_alloc_t::__attribute__(), mar_req_coroipcc_zc_execute_t::__attribute__(), mar_req_coroipcc_zc_free_t::__attribute__(), req_exec_barrier_message::__attribute__(), req_exec_cfg_crypto_reconfig::__attribute__(), req_exec_cfg_killnode::__attribute__(), req_exec_cfg_reload_config::__attribute__(), req_exec_cfg_ringreenable::__attribute__(), req_exec_cfg_shutdown::__attribute__(), req_exec_cmap_mcast::__attribute__(), req_exec_cpg_downlist::__attribute__(), req_exec_cpg_downlist_old::__attribute__(), req_exec_cpg_mcast::__attribute__(), req_exec_cpg_partial_mcast::__attribute__(), req_exec_cpg_procjoin::__attribute__(), req_exec_quorum_nodeinfo::__attribute__(), req_exec_quorum_qdevice_reconfigure::__attribute__(), req_exec_quorum_qdevice_reg::__attribute__(), req_exec_quorum_reconfigure::__attribute__(), req_exec_service_build_message::__attribute__(), req_lib_cfg_get_node_addrs::__attribute__(), req_lib_cfg_killnode::__attribute__(), req_lib_cfg_local_get::__attribute__(), req_lib_cfg_nodestatusget::__attribute__(), req_lib_cfg_reload_config::__attribute__(), req_lib_cfg_reopen_log_files::__attribute__(), req_lib_cfg_replytoshutdown::__attribute__(), req_lib_cfg_ringreenable::__attribute__(), req_lib_cfg_ringstatusget::__attribute__(), req_lib_cfg_tryshutdown::__attribute__(), req_lib_cmap_adjust_int::__attribute__(), req_lib_cmap_delete::__attribute__(), req_lib_cmap_get::__attribute__(), req_lib_cmap_iter_finalize::__attribute__(), req_lib_cmap_iter_init::__attribute__(), req_lib_cmap_iter_next::__attribute__(), req_lib_cmap_set::__attribute__(), req_lib_cmap_set_current_map::__attribute__(), req_lib_cmap_track_add::__attribute__(), req_lib_cmap_track_delete::__attribute__(), req_lib_cpg_finalize::__attribute__(), req_lib_cpg_iterationfinalize::__attribute__(), req_lib_cpg_iterationinitialize::__attribute__(), req_lib_cpg_iterationnext::__attribute__(), req_lib_cpg_join::__attribute__(), req_lib_cpg_leave::__attribute__(), req_lib_cpg_local_get::__attribute__(), req_lib_cpg_mcast::__attribute__(), req_lib_cpg_membership_get::__attribute__(), req_lib_cpg_partial_mcast::__attribute__(), req_lib_quorum_model_gettype::__attribute__(), req_lib_quorum_trackstart::__attribute__(), req_lib_votequorum_general::__attribute__(), req_lib_votequorum_getinfo::__attribute__(), req_lib_votequorum_qdevice_master_wins::__attribute__(), req_lib_votequorum_qdevice_poll::__attribute__(), req_lib_votequorum_qdevice_register::__attribute__(), req_lib_votequorum_qdevice_unregister::__attribute__(), req_lib_votequorum_qdevice_update::__attribute__(), req_lib_votequorum_setexpected::__attribute__(), req_lib_votequorum_setvotes::__attribute__(), req_lib_votequorum_trackstart::__attribute__(), res_lib_cfg_get_node_addrs::__attribute__(), res_lib_cfg_killnode::__attribute__(), res_lib_cfg_local_get::__attribute__(), res_lib_cfg_nodestatusget_v1::__attribute__(), res_lib_cfg_nodestatusget_version::__attribute__(), res_lib_cfg_reload_config::__attribute__(), res_lib_cfg_reopen_log_files::__attribute__(), res_lib_cfg_replytoshutdown::__attribute__(), res_lib_cfg_ringreenable::__attribute__(), res_lib_cfg_ringstatusget::__attribute__(), res_lib_cfg_testshutdown::__attribute__(), res_lib_cfg_tryshutdown::__attribute__(), res_lib_cmap_adjust_int::__attribute__(), res_lib_cmap_delete::__attribute__(), res_lib_cmap_get::__attribute__(), res_lib_cmap_iter_finalize::__attribute__(), res_lib_cmap_iter_init::__attribute__(), res_lib_cmap_iter_next::__attribute__(), res_lib_cmap_notify_callback::__attribute__(), res_lib_cmap_set::__attribute__(), res_lib_cmap_track_add::__attribute__(), res_lib_cmap_track_delete::__attribute__(), res_lib_cpg_confchg_callback::__attribute__(), res_lib_cpg_deliver_callback::__attribute__(), res_lib_cpg_finalize::__attribute__(), res_lib_cpg_flowcontrol_callback::__attribute__(), res_lib_cpg_iterationfinalize::__attribute__(), res_lib_cpg_iterationinitialize::__attribute__(), res_lib_cpg_iterationnext::__attribute__(), res_lib_cpg_join::__attribute__(), res_lib_cpg_leave::__attribute__(), res_lib_cpg_local_get::__attribute__(), res_lib_cpg_mcast::__attribute__(), res_lib_cpg_membership_get::__attribute__(), res_lib_cpg_partial_deliver_callback::__attribute__(), res_lib_cpg_partial_send::__attribute__(), res_lib_cpg_totem_confchg_callback::__attribute__(), res_lib_quorum_getquorate::__attribute__(), res_lib_quorum_gettype::__attribute__(), res_lib_quorum_model_gettype::__attribute__(), res_lib_quorum_notification::__attribute__(), res_lib_quorum_v1_nodelist_notification::__attribute__(), res_lib_quorum_v1_quorum_notification::__attribute__(), res_lib_votequorum_expectedvotes_notification::__attribute__(), res_lib_votequorum_getinfo::__attribute__(), res_lib_votequorum_nodelist_notification::__attribute__(), res_lib_votequorum_quorum_notification::__attribute__(), res_lib_votequorum_status::__attribute__(), corosync_sending_allowed(), and cpg_zcb_free().

## high_delivered

unsigned int high_delivered

Definition at line 2 of file totemsrp.c.

## memb_index

int memb_index

Definition at line 4 of file totemsrp.c.

## node_id

unsigned int node_id

Definition at line 5 of file totemsrp.c.

## proc_list_entries

unsigned int proc_list_entries

Definition at line 2 of file totemsrp.c.

## received_flg

unsigned int received_flg

Definition at line 3 of file totemsrp.c.

## retrans_flg

unsigned int retrans_flg

Definition at line 8 of file totemsrp.c.

## ring_id

struct memb_ring_id ring_id

Definition at line 4 of file totemsrp.c.

Referenced by req_exec_barrier_message::__attribute__(), req_exec_service_build_message::__attribute__(), req_lib_votequorum_qdevice_poll::__attribute__(), res_lib_cpg_totem_confchg_callback::__attribute__(), res_lib_quorum_v1_nodelist_notification::__attribute__(), res_lib_quorum_v1_quorum_notification::__attribute__(), res_lib_votequorum_nodelist_notification::__attribute__(), cpg_dispatch(), quorum_dispatch(), sync_memb_list_determine(), sync_save_transitional(), sync_start(), totempg_groups_initialize(), totemsrp_initialize(), votequorum_dispatch(), and votequorum_qdevice_poll().

## ring_seq

unsigned long long ring_seq

Definition at line 4 of file totemsrp.c.

Referenced by res_lib_quorum_notification::__attribute__().

## rtr_list

struct rtr_item rtr_list[0]

Definition at line 10 of file totemsrp.c.

## rtr_list_entries

int rtr_list_entries

Definition at line 9 of file totemsrp.c.

## seq

unsigned int seq

Definition at line 2 of file totemsrp.c.

## system_from

struct srp_addr system_from

Definition at line 1 of file totemsrp.c.

Referenced by main_deliver_fn(), totemknet_initialize(), totemknet_recv_mcast_empty(), totemnet_initialize(), totemudp_initialize(), totemudp_recv_mcast_empty(), totemudpu_initialize(), and totemudpu_recv_mcast_empty().

## this_seqno

int this_seqno

Definition at line 3 of file totemsrp.c.

## token_seq

unsigned int token_seq

Definition at line 2 of file totemsrp.c.

## totemsrp_message_handlers

struct message_handlers totemsrp_message_handlers

Initial value:
= {
6,
{
message_handler_orf_token,
message_handler_mcast,
message_handler_memb_merge_detect,
message_handler_memb_join,
message_handler_memb_commit_token,
message_handler_token_hold_cancel
}
}

Definition at line 678 of file totemsrp.c.

Referenced by main_deliver_fn().