57 #include <sys/types.h>
59 #include <sys/socket.h>
62 #include <sys/ioctl.h>
63 #include <sys/param.h>
64 #include <netinet/in.h>
65 #include <arpa/inet.h>
78 #include <qb/qbdefs.h>
79 #include <qb/qbutil.h>
80 #include <qb/qbloop.h>
86 #define LOGSYS_UTILS_ONLY 1
95 #define LOCALHOST_IP inet_addr("127.0.0.1")
96 #define QUEUE_RTR_ITEMS_SIZE_MAX 16384
97 #define RETRANS_MESSAGE_QUEUE_SIZE_MAX 16384
98 #define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500
100 #define RETRANSMIT_ENTRIES_MAX 30
101 #define TOKEN_SIZE_MAX 64000
102 #define LEAVE_DUMMY_NODEID 0
114 #define SEQNO_START_MSG 0x0
115 #define SEQNO_START_TOKEN 0x0
137 #define ENDIAN_LOCAL 0xff22
432 const char *
function,
435 const char *format, ...)
__attribute__((format(printf, 6, 7)));;
448 unsigned int msg_len,
449 int endian_conversion_required);
453 const unsigned int *member_list,
size_t member_list_entries,
454 const unsigned int *left_list,
size_t left_list_entries,
455 const unsigned int *joined_list,
size_t joined_list_entries,
468 const struct memb_ring_id *memb_ring_id,
526 int endian_conversion_needed);
571 static int message_handler_orf_token (
575 int endian_conversion_needed);
577 static int message_handler_mcast (
581 int endian_conversion_needed);
583 static int message_handler_memb_merge_detect (
587 int endian_conversion_needed);
589 static int message_handler_memb_join (
593 int endian_conversion_needed);
595 static int message_handler_memb_commit_token (
599 int endian_conversion_needed);
601 static int message_handler_token_hold_cancel (
605 int endian_conversion_needed);
609 static unsigned int main_msgs_missing (
void);
611 static void main_token_seqid_get (
614 unsigned int *token_is);
616 static void srp_addr_copy (
struct srp_addr *dest,
const struct srp_addr *src);
618 static void srp_addr_to_nodeid (
619 unsigned int *nodeid_out,
621 unsigned int entries);
623 static int srp_addr_equal (
const struct srp_addr *a,
const struct srp_addr *b);
629 static void messages_deliver_to_app (
struct totemsrp_instance *instance,
int skip,
unsigned int end_point);
631 int fcc_mcasts_allowed);
632 static void messages_free (
struct totemsrp_instance *instance,
unsigned int token_aru);
636 static void target_set_completed (
void *context);
638 static void memb_state_commit_token_target_set (
struct totemsrp_instance *instance);
643 static void orf_token_endian_convert (
const struct orf_token *in,
struct orf_token *out);
645 static void memb_join_endian_convert (
const struct memb_join *in,
struct memb_join *out);
646 static void mcast_endian_convert (
const struct mcast *in,
struct mcast *out);
647 static void memb_merge_detect_endian_convert (
650 static void srp_addr_copy_endian_convert (
struct srp_addr *out,
const struct srp_addr *in);
651 static void timer_function_orf_token_timeout (
void *data);
652 static void timer_function_pause_timeout (
void *data);
653 static void timer_function_heartbeat_timeout (
void *data);
654 static void timer_function_token_retransmit_timeout (
void *data);
655 static void timer_function_token_hold_retransmit_timeout (
void *data);
656 static void timer_function_merge_detect_timeout (
void *data);
658 static void totemsrp_buffer_release (
struct totemsrp_instance *instance,
void *ptr);
664 unsigned int msg_len);
669 unsigned int iface_no);
674 message_handler_orf_token,
675 message_handler_mcast,
676 message_handler_memb_merge_detect,
677 message_handler_memb_join,
678 message_handler_memb_commit_token,
679 message_handler_token_hold_cancel
683 #define log_printf(level, format, args...) \
685 instance->totemsrp_log_printf ( \
686 level, instance->totemsrp_subsys_id, \
687 __FUNCTION__, __FILE__, __LINE__, \
690 #define LOGSYS_PERROR(err_num, level, fmt, args...) \
692 char _error_str[LOGSYS_MAX_PERROR_MSG_LEN]; \
693 const char *_error_ptr = qb_strerror_r(err_num, _error_str, sizeof(_error_str)); \
694 instance->totemsrp_log_printf ( \
695 level, instance->totemsrp_subsys_id, \
696 __FUNCTION__, __FILE__, __LINE__, \
697 fmt ": %s (%d)\n", ##args, _error_ptr, err_num); \
703 return gather_state_from_desc[gsfrom];
741 static void main_token_seqid_get (
744 unsigned int *token_is)
756 static unsigned int main_msgs_missing (
void)
765 uint64_t timestamp_msec;
768 now_msec = (qb_util_nano_current_get () / QB_TIME_NS_IN_MSEC);
773 "Process pause detected for %d ms, flushing membership messages.", (
unsigned int)(now_msec - timestamp_msec));
788 unsigned long long nano_secs = qb_util_nano_current_get ();
790 time_now = (nano_secs / QB_TIME_NS_IN_MSEC);
823 qb_loop_t *poll_handle,
831 unsigned int msg_len,
832 int endian_conversion_required),
836 const unsigned int *member_list,
size_t member_list_entries,
837 const unsigned int *left_list,
size_t left_list_entries,
838 const unsigned int *joined_list,
size_t joined_list_entries,
840 void (*waiting_trans_ack_cb_fn) (
846 if (instance == NULL) {
850 totemsrp_instance_initialize (instance);
888 "Token Timeout (%d ms) retransmit timeout (%d ms)",
891 "token hold (%d ms) retransmits before loss (%d retrans)",
894 "join (%d ms) send_join (%d ms) consensus (%d ms) merge (%d ms)",
901 "downcheck (%d ms) fail to recv const (%d msgs)",
907 "window size per rotation (%d messages) maximum messages per rotation (%d messages)",
911 "missed count const (%d messages)",
915 "send threads (%d threads)", totem_config->
threads);
917 "RRP token expired timeout (%d ms)",
920 "RRP token problem counter (%d ms)",
923 "RRP threshold (%d problem count)",
926 "RRP multicast threshold (%d problem count)",
929 "RRP automatic recovery check timeout (%d ms)",
956 timer_function_pause_timeout (instance);
960 "HeartBeat is Disabled. To enable set heartbeat_failures_allowed > 0");
971 "total heartbeat_timeout (%d ms) is not less than token timeout (%d ms)",
975 "heartbeat_timeout = heartbeat_failures_allowed * token_retransmit_timeout + max_network_delay");
977 "heartbeat timeout should be less than the token timeout. HeartBeat is Diabled !!");
994 main_token_seqid_get,
996 target_set_completed);
1013 token_event_stats_collector,
1019 token_event_stats_collector,
1021 *srp_context = instance;
1034 memb_leave_message_send (instance);
1054 unsigned int nodeid,
1056 unsigned int interfaces_size,
1058 unsigned int *iface_count)
1062 unsigned int found = 0;
1075 if (interfaces_size >= *iface_count) {
1095 if (interfaces_size >= *iface_count) {
1112 const char *cipher_type,
1113 const char *hash_type)
1162 static int srp_addr_equal (
const struct srp_addr *a,
const struct srp_addr *b)
1167 for (i = 0; i < 1; i++) {
1176 static void srp_addr_copy (
struct srp_addr *dest,
const struct srp_addr *src)
1187 static void srp_addr_to_nodeid (
1188 unsigned int *nodeid_out,
1190 unsigned int entries)
1194 for (i = 0; i < entries; i++) {
1195 nodeid_out[i] = srp_addr_in[i].
addr[0].
nodeid;
1199 static void srp_addr_copy_endian_convert (
struct srp_addr *out,
const struct srp_addr *in)
1213 static void memb_set_subtract (
1214 struct srp_addr *out_list,
int *out_list_entries,
1215 struct srp_addr *one_list,
int one_list_entries,
1216 struct srp_addr *two_list,
int two_list_entries)
1222 *out_list_entries = 0;
1224 for (i = 0; i < one_list_entries; i++) {
1225 for (j = 0; j < two_list_entries; j++) {
1226 if (srp_addr_equal (&one_list[i], &two_list[j])) {
1232 srp_addr_copy (&out_list[*out_list_entries], &one_list[i]);
1233 *out_list_entries = *out_list_entries + 1;
1242 static void memb_consensus_set (
1269 static int memb_consensus_isset (
1286 static int memb_consensus_agreed (
1290 int token_memb_entries = 0;
1294 memb_set_subtract (token_memb, &token_memb_entries,
1298 for (i = 0; i < token_memb_entries; i++) {
1299 if (memb_consensus_isset (instance, &token_memb[i]) == 0) {
1314 assert (token_memb_entries >= 1);
1319 static void memb_consensus_notset (
1321 struct srp_addr *no_consensus_list,
1322 int *no_consensus_list_entries,
1324 int comparison_list_entries)
1328 *no_consensus_list_entries = 0;
1331 if (memb_consensus_isset (instance, &instance->
my_proc_list[i]) == 0) {
1332 srp_addr_copy (&no_consensus_list[*no_consensus_list_entries], &instance->
my_proc_list[i]);
1333 *no_consensus_list_entries = *no_consensus_list_entries + 1;
1341 static int memb_set_equal (
1342 struct srp_addr *set1,
int set1_entries,
1343 struct srp_addr *set2,
int set2_entries)
1350 if (set1_entries != set2_entries) {
1353 for (i = 0; i < set2_entries; i++) {
1354 for (j = 0; j < set1_entries; j++) {
1355 if (srp_addr_equal (&set1[j], &set2[i])) {
1371 static int memb_set_subset (
1372 const struct srp_addr *subset,
int subset_entries,
1373 const struct srp_addr *fullset,
int fullset_entries)
1379 if (subset_entries > fullset_entries) {
1382 for (i = 0; i < subset_entries; i++) {
1383 for (j = 0; j < fullset_entries; j++) {
1384 if (srp_addr_equal (&subset[i], &fullset[j])) {
1398 static void memb_set_merge (
1399 const struct srp_addr *subset,
int subset_entries,
1400 struct srp_addr *fullset,
int *fullset_entries)
1406 for (i = 0; i < subset_entries; i++) {
1407 for (j = 0; j < *fullset_entries; j++) {
1408 if (srp_addr_equal (&fullset[j], &subset[i])) {
1414 srp_addr_copy (&fullset[*fullset_entries], &subset[i]);
1415 *fullset_entries = *fullset_entries + 1;
1422 static void memb_set_and_with_ring_id (
1438 for (i = 0; i < set2_entries; i++) {
1439 for (j = 0; j < set1_entries; j++) {
1440 if (srp_addr_equal (&set1[j], &set2[i])) {
1441 if (memcmp (&set1_ring_ids[j], old_ring_id,
sizeof (
struct memb_ring_id)) == 0) {
1448 srp_addr_copy (&and[*and_entries], &set1[j]);
1449 *and_entries = *and_entries + 1;
1456 #ifdef CODE_COVERAGE
1457 static void memb_set_print (
1464 printf (
"List '%s' contains %d entries:\n",
string, list_entries);
1466 for (i = 0; i < list_entries; i++) {
1467 printf (
"Address %d with %d rings\n", i, list[i].
no_addrs);
1468 for (j = 0; j < list[i].
no_addrs; j++) {
1469 printf (
"\tiface %d %s\n", j,
totemip_print (&list[i].addr[j]));
1470 printf (
"\tfamily %d\n", list[i].addr[j].
family);
1478 assert (instance != NULL);
1482 static void totemsrp_buffer_release (
struct totemsrp_instance *instance,
void *ptr)
1484 assert (instance != NULL);
1496 timer_function_token_retransmit_timeout,
1508 timer_function_merge_detect_timeout,
1534 "Saving state aru %x high seq received %x",
1544 "Restoring instance->my_aru %x my high seq received %x",
1551 "Resetting old ring state");
1562 timer_function_pause_timeout,
1572 timer_function_orf_token_timeout,
1582 timer_function_heartbeat_timeout,
1595 static void cancel_token_retransmit_timeout (
struct totemsrp_instance *instance)
1600 static void start_token_hold_retransmit_timeout (
struct totemsrp_instance *instance)
1606 timer_function_token_hold_retransmit_timeout,
1610 static void cancel_token_hold_retransmit_timeout (
struct totemsrp_instance *instance)
1616 static void memb_state_consensus_timeout_expired (
1620 int no_consensus_list_entries;
1623 if (memb_consensus_agreed (instance)) {
1624 memb_consensus_reset (instance);
1626 memb_consensus_set (instance, &instance->
my_id);
1628 reset_token_timeout (instance);
1630 memb_consensus_notset (
1633 &no_consensus_list_entries,
1637 memb_set_merge (no_consensus_list, no_consensus_list_entries,
1650 static void timer_function_pause_timeout (
void *data)
1655 reset_pause_timeout (instance);
1660 old_ring_state_restore (instance);
1665 static void timer_function_orf_token_timeout (
void *data)
1672 "The token was lost in the OPERATIONAL state.");
1674 "A processor failed, forming new configuration.");
1682 "The consensus timeout expired.");
1683 memb_state_consensus_timeout_expired (instance);
1690 "The token was lost in the COMMIT state.");
1697 "The token was lost in the RECOVERY state.");
1698 memb_recovery_state_token_loss (instance);
1704 static void timer_function_heartbeat_timeout (
void *data)
1708 "HeartBeat Timer expired Invoking token loss mechanism in state %d ", instance->
memb_state);
1709 timer_function_orf_token_timeout(data);
1712 static void memb_timer_function_state_gather (
void *data)
1723 memb_join_message_send (instance);
1734 memb_timer_function_state_gather,
1740 static void memb_timer_function_gather_consensus_timeout (
void *data)
1743 memb_state_consensus_timeout_expired (instance);
1746 static void deliver_messages_from_recovery_to_regular (
struct totemsrp_instance *instance)
1751 unsigned int range = 0;
1764 for (i = 1; i <= range; i++) {
1770 recovery_message_item = ptr;
1775 mcast = recovery_message_item->
mcast;
1781 regular_message_item.mcast =
1782 (
struct mcast *)(((
char *)recovery_message_item->
mcast) +
sizeof (
struct mcast));
1783 regular_message_item.msg_len =
1784 recovery_message_item->
msg_len -
sizeof (
struct mcast);
1785 mcast = regular_message_item.mcast;
1794 "comparing if ring id is for this processors old ring seqno %d",
1808 ®ular_message_item, mcast->
seq);
1815 "-not adding msg with seq no %x", mcast->
seq);
1826 int joined_list_entries = 0;
1827 unsigned int aru_save;
1834 char left_node_msg[1024];
1835 char joined_node_msg[1024];
1837 memb_consensus_reset (instance);
1839 old_ring_state_reset (instance);
1841 deliver_messages_from_recovery_to_regular (instance);
1844 "Delivering to app %x to %x",
1847 aru_save = instance->
my_aru;
1860 memb_set_subtract (joined_list, &joined_list_entries,
1888 srp_addr_to_nodeid (trans_memb_list_totemip,
1901 instance->
my_aru = aru_save;
1911 joined_list, joined_list_entries,
1916 srp_addr_to_nodeid (new_memb_list_totemip,
1918 srp_addr_to_nodeid (joined_list_totemip, joined_list,
1919 joined_list_entries);
1923 joined_list_totemip, joined_list_entries, &instance->
my_ring_id);
1985 regular_message = ptr;
1986 free (regular_message->
mcast);
1992 if (joined_list_entries) {
1994 sptr += snprintf(joined_node_msg,
sizeof(joined_node_msg)-sptr,
" joined:");
1995 for (i=0; i< joined_list_entries; i++) {
1996 sptr += snprintf(joined_node_msg+sptr,
sizeof(joined_node_msg)-sptr,
" %d", joined_list_totemip[i]);
2000 joined_node_msg[0] =
'\0';
2005 sptr += snprintf(left_node_msg,
sizeof(left_node_msg)-sptr,
" left:");
2007 sptr += snprintf(left_node_msg+sptr,
sizeof(left_node_msg)-sptr,
" %d", left_list[i]);
2011 left_node_msg[0] =
'\0';
2015 "entering OPERATIONAL state.");
2017 "A new membership (%s:%lld) was formed. Members%s%s",
2029 reset_pause_timeout (instance);
2042 static void memb_state_gather_enter (
2049 &instance->
my_id, 1,
2052 memb_join_message_send (instance);
2063 memb_timer_function_state_gather,
2076 memb_timer_function_gather_consensus_timeout,
2082 cancel_token_retransmit_timeout (instance);
2083 cancel_token_timeout (instance);
2084 cancel_merge_detect_timeout (instance);
2086 memb_consensus_reset (instance);
2088 memb_consensus_set (instance, &instance->
my_id);
2091 "entering GATHER state from %d(%s).",
2092 gather_from, gsfrom_to_msg(gather_from));
2107 static void timer_function_token_retransmit_timeout (
void *data);
2109 static void target_set_completed (
2114 memb_state_commit_token_send (instance);
2118 static void memb_state_commit_enter (
2121 old_ring_state_save (instance);
2123 memb_state_commit_token_update (instance);
2125 memb_state_commit_token_target_set (instance);
2141 "entering COMMIT state.");
2144 reset_token_retransmit_timeout (instance);
2145 reset_token_timeout (instance);
2161 static void memb_state_recovery_enter (
2166 int local_received_flg = 1;
2167 unsigned int low_ring_aru;
2168 unsigned int range = 0;
2169 unsigned int messages_originated = 0;
2178 "entering RECOVERY state.");
2189 memb_state_commit_token_send_recovery (instance, commit_token);
2204 memcpy (&my_new_memb_ring_id_list[i],
2205 &memb_list[i].ring_id,
2208 memb_set_and_with_ring_id (
2210 my_new_memb_ring_id_list,
2224 "position [%d] member %s:", i,
totemip_print (&addr[i].addr[0]));
2226 "previous ring seq %llx rep %s",
2231 "aru %x high delivered %x received flag %d",
2249 local_received_flg = 0;
2253 if (local_received_flg == 1) {
2269 if (sq_lt_compare (memb_list[i].
aru, low_ring_aru)) {
2271 low_ring_aru = memb_list[i].
aru;
2292 "copying all old ring messages from %x-%x.",
2295 for (i = 1; i <= range; i++) {
2302 low_ring_aru + i, &ptr);
2306 sort_queue_item = ptr;
2307 messages_originated++;
2322 sort_queue_item->
mcast,
2327 "Originated %d messages in RECOVERY.", messages_originated);
2332 "Did not need to originate any messages in recovery.");
2342 reset_token_timeout (instance);
2343 reset_token_retransmit_timeout (instance);
2356 token_hold_cancel_send (instance);
2363 struct iovec *iovec,
2364 unsigned int iov_len,
2371 unsigned int addr_idx;
2380 if (cs_queue_is_full (queue_use)) {
2385 memset (&message_item, 0,
sizeof (
struct message_item));
2390 message_item.
mcast = totemsrp_buffer_alloc (instance);
2391 if (message_item.
mcast == 0) {
2398 memset(message_item.
mcast, 0, sizeof (
struct mcast));
2408 addr = (
char *)message_item.
mcast;
2409 addr_idx = sizeof (
struct mcast);
2410 for (i = 0; i < iov_len; i++) {
2411 memcpy (&addr[addr_idx], iovec[i].iov_base, iovec[i].iov_len);
2412 addr_idx += iovec[i].iov_len;
2415 message_item.
msg_len = addr_idx;
2419 cs_queue_item_add (queue_use, &message_item);
2441 cs_queue_avail (queue_use, &avail);
2452 static int orf_token_remcast (
2456 struct sort_queue_item *sort_queue_item;
2460 struct sq *sort_queue;
2468 res = sq_in_range (sort_queue, seq);
2477 res = sq_item_get (sort_queue, seq, &ptr);
2482 sort_queue_item = ptr;
2486 sort_queue_item->
mcast,
2496 static void messages_free (
2498 unsigned int token_aru)
2500 struct sort_queue_item *regular_message;
2503 int log_release = 0;
2504 unsigned int release_to;
2505 unsigned int range = 0;
2507 release_to = token_aru;
2508 if (sq_lt_compare (instance->
my_last_aru, release_to)) {
2528 for (i = 1; i <= range; i++) {
2534 regular_message = ptr;
2535 totemsrp_buffer_release (instance, regular_message->
mcast);
2546 "releasing messages up to and including %x", release_to);
2550 static void update_aru (
2555 struct sq *sort_queue;
2557 unsigned int my_aru_saved = 0;
2567 my_aru_saved = instance->
my_aru;
2568 for (i = 1; i <= range; i++) {
2572 res = sq_item_get (sort_queue, my_aru_saved + i, &ptr);
2580 instance->
my_aru += i - 1;
2586 static int orf_token_mcast (
2589 int fcc_mcasts_allowed)
2593 struct sq *sort_queue;
2594 struct sort_queue_item sort_queue_item;
2595 struct mcast *mcast;
2596 unsigned int fcc_mcast_current;
2601 reset_token_retransmit_timeout (instance);
2612 for (fcc_mcast_current = 0; fcc_mcast_current < fcc_mcasts_allowed; fcc_mcast_current++) {
2613 if (cs_queue_is_empty (mcast_queue)) {
2616 message_item = (
struct message_item *)cs_queue_item_get (mcast_queue);
2624 memset (&sort_queue_item, 0,
sizeof (
struct sort_queue_item));
2628 mcast = sort_queue_item.
mcast;
2635 sq_item_add (sort_queue, &sort_queue_item, message_item->
mcast->
seq);
2639 message_item->
mcast,
2645 cs_queue_item_remove (mcast_queue);
2653 update_aru (instance);
2658 return (fcc_mcast_current);
2665 static int orf_token_rtr (
2668 unsigned int *fcc_allowed)
2673 struct sq *sort_queue;
2675 unsigned int range = 0;
2676 char retransmit_msg[1024];
2685 rtr_list = &orf_token->
rtr_list[0];
2687 strcpy (retransmit_msg,
"Retransmit List: ");
2692 sprintf (value,
"%x ", rtr_list[i].seq);
2693 strcat (retransmit_msg, value);
2695 strcat (retransmit_msg,
"");
2697 "%s", retransmit_msg);
2710 if (memcmp (&rtr_list[i].ring_id, &instance->
my_ring_id,
2717 res = orf_token_remcast (instance, rtr_list[i].seq);
2724 memmove (&rtr_list[i], &rtr_list[i + 1],
2740 range = orf_token->
seq - instance->
my_aru;
2744 (i <= range); i++) {
2749 res = sq_in_range (sort_queue, instance->
my_aru + i);
2757 res = sq_item_inuse (sort_queue, instance->
my_aru + i);
2768 res = sq_item_miss_count (sort_queue, instance->
my_aru + i);
2778 if (instance->
my_aru + i == rtr_list[j].
seq) {
2808 static void timer_function_token_retransmit_timeout (
void *data)
2818 token_retransmit (instance);
2819 reset_token_retransmit_timeout (instance);
2824 static void timer_function_token_hold_retransmit_timeout (
void *data)
2835 token_retransmit (instance);
2840 static void timer_function_merge_detect_timeout(
void *data)
2849 memb_merge_detect_transmit (instance);
2862 static int token_send (
2864 struct orf_token *orf_token,
2868 unsigned int orf_token_size;
2870 orf_token_size =
sizeof (
struct orf_token) +
2871 (orf_token->rtr_list_entries *
sizeof (
struct rtr_item));
2878 if (forward_token == 0) {
2922 struct orf_token orf_token;
2954 res = token_send (instance, &orf_token, 1);
2959 static void memb_state_commit_token_update (
2964 unsigned int high_aru;
3000 if (sq_lt_compare (high_aru, memb_list[i].aru)) {
3001 high_aru = memb_list[i].
aru;
3011 if (sq_lt_compare (memb_list[i].aru, high_aru)) {
3026 static void memb_state_commit_token_target_set (
3043 static int memb_state_commit_token_send_recovery (
3047 unsigned int commit_token_size;
3069 reset_token_retransmit_timeout (instance);
3073 static int memb_state_commit_token_send (
3076 unsigned int commit_token_size;
3098 reset_token_retransmit_timeout (instance);
3106 int token_memb_entries = 0;
3110 memb_set_subtract (token_memb, &token_memb_entries,
3118 lowest_addr = &token_memb[0].
addr[0];
3119 for (i = 1; i < token_memb_entries; i++) {
3127 static int srp_addr_compare (
const void *a,
const void *b)
3135 static void memb_state_commit_token_create (
3141 int token_memb_entries = 0;
3144 "Creating commit token because I am the rep.");
3146 memb_set_subtract (token_memb, &token_memb_entries,
3165 qsort (token_memb, token_memb_entries,
sizeof (
struct srp_addr),
3174 memcpy (addr, token_memb,
3175 token_memb_entries *
sizeof (
struct srp_addr));
3176 memset (memb_list, 0,
3182 char memb_join_data[40000];
3185 unsigned int addr_idx;
3202 addr = (
char *)memb_join;
3203 addr_idx =
sizeof (
struct memb_join);
3204 memcpy (&addr[addr_idx],
3211 memcpy (&addr[addr_idx],
3234 char memb_join_data[40000];
3235 struct memb_join *memb_join = (
struct memb_join *)memb_join_data;
3237 unsigned int addr_idx;
3238 int active_memb_entries;
3242 "sending join/leave message");
3249 &instance->
my_id, 1,
3252 memb_set_subtract (active_memb, &active_memb_entries,
3254 &instance->
my_id, 1);
3273 addr = (
char *)memb_join;
3274 addr_idx =
sizeof (
struct memb_join);
3275 memcpy (&addr[addr_idx],
3277 active_memb_entries *
3280 active_memb_entries *
3282 memcpy (&addr[addr_idx],
3321 static void memb_ring_id_set (
3340 token_hold_cancel_send (instance);
3343 if (callback_handle == 0) {
3346 *handle_out = (
void *)callback_handle;
3347 list_init (&callback_handle->
list);
3349 callback_handle->
data = (
void *) data;
3351 callback_handle->
delete =
delete;
3370 list_del (&h->
list);
3377 static void token_callbacks_execute (
3383 struct list_head *callback_listhead = 0;
3399 for (list = callback_listhead->
next; list != callback_listhead;
3402 token_callback_instance =
list_entry (list,
struct token_callback_instance, list);
3404 list_next = list->
next;
3405 del = token_callback_instance->
delete;
3412 token_callback_instance->
data);
3416 if (res == -1 && del == 1) {
3417 list_add (list, callback_listhead);
3419 free (token_callback_instance);
3443 if (queue_use != NULL) {
3444 backlog = cs_queue_used (queue_use);
3451 static int fcc_calculate (
3453 struct orf_token *token)
3455 unsigned int transmits_allowed;
3456 unsigned int backlog_calc;
3464 instance->
my_cbl = backlog_get (instance);
3473 if (backlog_calc > 0 && transmits_allowed > backlog_calc) {
3474 transmits_allowed = backlog_calc;
3478 return (transmits_allowed);
3484 static void fcc_rtr_limit (
3486 struct orf_token *token,
3487 unsigned int *transmits_allowed)
3491 assert (check >= 0);
3498 *transmits_allowed = 0;
3502 static void fcc_token_update (
3504 struct orf_token *token,
3505 unsigned int msgs_transmitted)
3507 token->
fcc += msgs_transmitted - instance->
my_trc;
3509 instance->
my_trc = msgs_transmitted;
3521 static int message_handler_orf_token (
3525 int endian_conversion_needed)
3527 char token_storage[1500];
3528 char token_convert[1500];
3529 struct orf_token *token = NULL;
3531 unsigned int transmits_allowed;
3532 unsigned int mcasted_retransmit;
3533 unsigned int mcasted_regular;
3534 unsigned int last_aru;
3537 unsigned long long tv_current;
3538 unsigned long long tv_diff;
3540 tv_current = qb_util_nano_current_get ();
3541 tv_diff = tv_current -
tv_old;
3542 tv_old = tv_current;
3545 "Time since last token %0.4f ms", ((
float)tv_diff) / 1000000.0);
3551 #ifdef TEST_DROP_ORF_TOKEN_PERCENTAGE
3552 if (random()%100 < TEST_DROP_ORF_TOKEN_PERCENTAGE) {
3557 if (endian_conversion_needed) {
3558 orf_token_endian_convert ((
struct orf_token *)msg,
3559 (
struct orf_token *)token_convert);
3560 msg = (
struct orf_token *)token_convert;
3567 token = (
struct orf_token *)token_storage;
3568 memcpy (token, msg,
sizeof (
struct orf_token));
3569 memcpy (&token->
rtr_list[0], (
char *)msg + sizeof (
struct orf_token),
3577 start_merge_detect_timeout (instance);
3580 cancel_merge_detect_timeout (instance);
3581 cancel_token_hold_retransmit_timeout (instance);
3587 #ifdef TEST_RECOVERY_MSG_COUNT
3627 messages_free (instance, token->
aru);
3646 reset_heartbeat_timeout(instance);
3649 cancel_heartbeat_timeout(instance);
3664 transmits_allowed = fcc_calculate (instance, token);
3665 mcasted_retransmit = orf_token_rtr (instance, token, &transmits_allowed);
3673 fcc_rtr_limit (instance, token, &transmits_allowed);
3674 mcasted_regular = orf_token_mcast (instance, token, transmits_allowed);
3681 fcc_token_update (instance, token, mcasted_retransmit +
3684 if (sq_lt_compare (instance->
my_aru, token->
aru) ||
3689 if (token->
aru == token->
seq) {
3695 if (token->
aru == last_aru && token->
aru_addr != 0) {
3710 "FAILED TO RECEIVE");
3714 memb_set_merge (&instance->
my_id, 1,
3741 "token retrans flag is %d my set retrans flag%d retrans queue empty %d count %d, aru %x",
3754 "install seq %x aru %x high seq received %x",
3772 "retrans flag count %x token aru %x install seq %x aru %x %x",
3776 memb_state_operational_enter (instance);
3783 token_send (instance, token, forward_token);
3786 tv_current = qb_util_nano_current_get ();
3787 tv_diff = tv_current -
tv_old;
3788 tv_old = tv_current;
3791 ((
float)tv_diff) / 1000000.0);
3794 messages_deliver_to_app (instance, 0,
3802 reset_token_timeout (instance);
3803 reset_token_retransmit_timeout (instance);
3807 start_token_hold_retransmit_timeout (instance);
3817 reset_heartbeat_timeout(instance);
3820 cancel_heartbeat_timeout(instance);
3826 static void messages_deliver_to_app (
3829 unsigned int end_point)
3831 struct sort_queue_item *sort_queue_item_p;
3834 struct mcast *mcast_in;
3835 struct mcast mcast_header;
3836 unsigned int range = 0;
3837 int endian_conversion_required;
3838 unsigned int my_high_delivered_stored = 0;
3854 for (i = 1; i <= range; i++) {
3862 my_high_delivered_stored + i);
3868 my_high_delivered_stored + i, &ptr);
3872 if (res != 0 && skip == 0) {
3883 sort_queue_item_p = ptr;
3885 mcast_in = sort_queue_item_p->
mcast;
3886 assert (mcast_in != (
struct mcast *)0xdeadbeef);
3888 endian_conversion_required = 0;
3890 endian_conversion_required = 1;
3891 mcast_endian_convert (mcast_in, &mcast_header);
3893 memcpy (&mcast_header, mcast_in,
sizeof (
struct mcast));
3900 memb_set_subset (&mcast_header.system_from,
3914 "Delivering MCAST message with seq %x to pending delivery queue",
3921 mcast_header.header.nodeid,
3922 ((
char *)sort_queue_item_p->
mcast) + sizeof (
struct mcast),
3923 sort_queue_item_p->
msg_len - sizeof (
struct mcast),
3924 endian_conversion_required);
3931 static int message_handler_mcast (
3935 int endian_conversion_needed)
3937 struct sort_queue_item sort_queue_item;
3938 struct sq *sort_queue;
3939 struct mcast mcast_header;
3942 if (endian_conversion_needed) {
3943 mcast_endian_convert (msg, &mcast_header);
3945 memcpy (&mcast_header, msg,
sizeof (
struct mcast));
3956 #ifdef TEST_DROP_MCAST_PERCENTAGE
3957 if (random()%100 < TEST_DROP_MCAST_PERCENTAGE) {
3965 if (memcmp (&instance->
my_ring_id, &mcast_header.ring_id,
3971 &mcast_header.system_from, 1,
3977 if (!memb_set_subset (
3978 &mcast_header.system_from,
3983 memb_set_merge (&mcast_header.system_from, 1,
4004 "Received ringid(%s:%lld) seq %x",
4006 mcast_header.ring_id.seq,
4014 sq_in_range (sort_queue, mcast_header.seq) &&
4015 sq_item_inuse (sort_queue, mcast_header.seq) == 0) {
4021 sort_queue_item.
mcast = totemsrp_buffer_alloc (instance);
4022 if (sort_queue_item.
mcast == NULL) {
4025 memcpy (sort_queue_item.
mcast, msg, msg_len);
4026 sort_queue_item.
msg_len = msg_len;
4029 mcast_header.seq)) {
4033 sq_item_add (sort_queue, &sort_queue_item, mcast_header.seq);
4036 update_aru (instance);
4045 static int message_handler_memb_merge_detect (
4049 int endian_conversion_needed)
4054 if (endian_conversion_needed) {
4081 if (!memb_set_subset (
4105 static void memb_join_process (
4107 const struct memb_join *memb_join)
4111 int gather_entered = 0;
4112 int fail_minus_memb_entries = 0;
4125 if (memb_set_equal (proc_list,
4130 memb_set_equal (failed_list,
4135 memb_consensus_set (instance, &memb_join->
system_from);
4137 if (memb_consensus_agreed (instance) && instance->
failed_to_recv == 1) {
4144 memb_state_commit_token_create (instance);
4146 memb_state_commit_enter (instance);
4149 if (memb_consensus_agreed (instance) &&
4150 memb_lowest_in_config (instance)) {
4152 memb_state_commit_token_create (instance);
4154 memb_state_commit_enter (instance);
4159 if (memb_set_subset (proc_list,
4164 memb_set_subset (failed_list,
4176 memb_set_merge (proc_list,
4180 if (memb_set_subset (
4181 &instance->
my_id, 1,
4188 if (memb_set_subset (
4193 if (memb_set_subset (
4198 memb_set_merge (failed_list,
4202 memb_set_subtract (fail_minus_memb,
4203 &fail_minus_memb_entries,
4209 memb_set_merge (fail_minus_memb,
4210 fail_minus_memb_entries,
4221 if (gather_entered == 0 &&
4228 static void memb_join_endian_convert (
const struct memb_join *in,
struct memb_join *out)
4250 srp_addr_copy_endian_convert (&out_proc_list[i], &in_proc_list[i]);
4253 srp_addr_copy_endian_convert (&out_failed_list[i], &in_failed_list[i]);
4278 srp_addr_copy_endian_convert (&out_addr[i], &in_addr[i]);
4283 if (in_memb_list[i].ring_id.
rep.
family != 0) {
4289 out_memb_list[i].
aru =
swab32 (in_memb_list[i].aru);
4296 static void orf_token_endian_convert (
const struct orf_token *in,
struct orf_token *out)
4320 static void mcast_endian_convert (
const struct mcast *in,
struct mcast *out)
4336 static void memb_merge_detect_endian_convert (
4348 static int ignore_join_under_operational (
4350 const struct memb_join *memb_join)
4360 if (memb_set_subset (&instance->
my_id, 1,
4378 static int message_handler_memb_join (
4382 int endian_conversion_needed)
4384 const struct memb_join *memb_join;
4385 struct memb_join *memb_join_convert = alloca (msg_len);
4387 if (endian_conversion_needed) {
4388 memb_join = memb_join_convert;
4389 memb_join_endian_convert (msg, memb_join_convert);
4399 if (pause_flush (instance)) {
4408 if (!ignore_join_under_operational (instance, memb_join)) {
4409 memb_join_process (instance, memb_join);
4414 memb_join_process (instance, memb_join);
4425 memb_join_process (instance, memb_join);
4438 memb_join_process (instance, memb_join);
4439 memb_recovery_state_token_loss (instance);
4447 static int message_handler_memb_commit_token (
4451 int endian_conversion_needed)
4461 "got commit token");
4463 if (endian_conversion_needed) {
4464 memb_commit_token_endian_convert (msg, memb_commit_token_convert);
4466 memcpy (memb_commit_token_convert, msg, msg_len);
4468 memb_commit_token = memb_commit_token_convert;
4471 #ifdef TEST_DROP_COMMIT_TOKEN_PERCENTAGE
4472 if (random()%100 < TEST_DROP_COMMIT_TOKEN_PERCENTAGE) {
4482 memb_set_subtract (sub, &sub_entries,
4486 if (memb_set_equal (addr,
4492 memcpy (instance->
commit_token, memb_commit_token, msg_len);
4493 memb_state_commit_enter (instance);
4507 memb_state_recovery_enter (instance, memb_commit_token);
4514 "Sending initial ORF token");
4517 orf_token_send_initial (instance);
4518 reset_token_timeout (instance);
4519 reset_token_retransmit_timeout (instance);
4526 static int message_handler_token_hold_cancel (
4530 int endian_conversion_needed)
4539 timer_function_token_retransmit_timeout (instance);
4548 unsigned int msg_len)
4553 if (msg_len <
sizeof (
struct message_header)) {
4555 "Received message is too short... ignoring %u.",
4556 (
unsigned int)msg_len);
4560 switch (message_header->
type) {
4581 printf (
"wrong message type\n");
4598 unsigned int iface_no)
4614 "Created or loaded sequence id %llx.%s for this ring.",
4636 totem_config->
net_mtu -=
sizeof (
struct mcast);
4641 void (*totem_service_ready) (
void))
int totemrrp_iface_check(void *rrp_context)
void(*) in log_level_security)
void main_iface_change_fn(void *context, const struct totem_ip_address *iface_address, unsigned int iface_no)
void totemip_copy_endian_convert(struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
struct srp_addr system_from
struct memb_ring_id ring_id
uint32_t waiting_trans_ack
struct srp_addr system_from
struct memb_ring_id ring_id
int totemsrp_log_level_debug
struct memb_ring_id my_ring_id
Totem Single Ring Protocol.
uint64_t memb_commit_token_rx
void(* totemsrp_service_ready_fn)(void)
void(* memb_ring_id_store)(const struct memb_ring_id *memb_ring_id, const struct totem_ip_address *addr)
struct message_header header
unsigned int old_ring_state_high_seq_received
unsigned int proc_list_entries
struct totem_interface * interfaces
unsigned int interface_count
int totemsrp_my_family_get(void *srp_context)
totemsrp_token_stats_t token[TOTEM_TOKEN_STATS_MAX]
const char * totemip_print(const struct totem_ip_address *addr)
unsigned char addr[TOTEMIP_ADDRLEN]
int totemsrp_log_level_error
#define LEAVE_DUMMY_NODEID
struct memb_ring_id ring_id
qb_loop_timer_handle timer_heartbeat_timeout
unsigned int failed_list_entries
unsigned long long int tv_old
#define SEQNO_START_TOKEN
unsigned int token_hold_timeout
struct memb_ring_id ring_id
struct totem_ip_address member_list[PROCESSOR_COUNT_MAX]
int totemip_compare(const void *a, const void *b)
int totemsrp_member_add(void *context, const struct totem_ip_address *member, int ring_no)
void * token_sent_event_handle
struct srp_addr system_from
int totemsrp_log_level_notice
unsigned int totemsrp_my_nodeid_get(void *srp_context)
char rrp_mode[TOTEM_RRP_MODE_BYTES]
void totemsrp_net_mtu_adjust(struct totem_config *totem_config)
int totemsrp_log_level_warning
int totemsrp_crypto_set(void *srp_context, const char *cipher_type, const char *hash_type)
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)
uint64_t memb_merge_detect_rx
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)
struct cs_queue new_message_queue_trans
struct message_header header
unsigned char end_of_commit_token[0]
unsigned char addr[TOTEMIP_ADDRLEN]
char commit_token_storage[40000]
unsigned int rrp_problem_count_timeout
struct list_head token_callback_sent_listhead
struct cs_queue new_message_queue
struct srp_addr my_deliver_memb_list[PROCESSOR_COUNT_MAX]
void totemsrp_callback_token_destroy(void *srp_context, void **handle_out)
uint64_t gather_token_lost
int totemsrp_log_level_trace
void totemip_copy(struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
int totemrrp_ifaces_get(void *rrp_context, char ***status, unsigned int *iface_count)
struct memb_ring_id my_old_ring_id
void * totemrrp_buffer_alloc(void *rrp_context)
unsigned int downcheck_timeout
struct srp_addr my_new_memb_list[PROCESSOR_COUNT_MAX]
uint64_t memb_commit_token_tx
int my_deliver_memb_entries
unsigned int max_network_delay
unsigned int heartbeat_failures_allowed
#define TOTEM_TOKEN_STATS_MAX
struct message_item __attribute__
unsigned long long token_ring_id_seq
struct totem_ip_address mcast_address
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)
unsigned int send_join_timeout
void totemsrp_service_ready_register(void *context, void(*totem_service_ready)(void))
unsigned int rrp_problem_count_threshold
struct srp_addr my_memb_list[PROCESSOR_COUNT_MAX]
uint64_t operational_entered
unsigned long long ring_seq
void(* memb_ring_id_create_or_load)(struct memb_ring_id *memb_ring_id, const struct totem_ip_address *addr)
int totemsrp_mcast(void *srp_context, struct iovec *iovec, unsigned int iov_len, int guarantee)
Multicast a message.
uint64_t operational_token_lost
unsigned int received_flg
uint64_t consensus_timeouts
Totem Network interface - also does encryption/decryption.
unsigned int my_high_delivered
struct message_handlers totemsrp_message_handlers
qb_loop_timer_handle memb_timer_state_gather_consensus_timeout
uint64_t recovery_token_lost
unsigned int token_retransmits_before_loss_const
unsigned char end_of_memb_join[0]
struct message_header header
int totemrrp_finalize(void *rrp_context)
struct list_head token_callback_received_listhead
int totemrrp_member_remove(void *rrp_context, const struct totem_ip_address *member, int iface_no)
struct rtr_item rtr_list[0]
int totemsrp_ring_reenable(void *srp_context)
struct memb_ring_id ring_id
unsigned int seqno_unchanged_const
uint64_t commit_token_lost
unsigned int miss_count_const
int totemrrp_crypto_set(void *rrp_context, const char *cipher_type, const char *hash_type)
uint64_t token_hold_cancel_rx
void(* totemsrp_waiting_trans_ack_cb_fn)(int waiting_trans_ack)
unsigned int join_timeout
int totemrrp_send_flush(void *rrp_context)
struct message_header header
struct totem_ip_address mcast_addr
#define MESSAGE_QUEUE_MAX
int totemrrp_member_add(void *rrp_context, const struct totem_ip_address *member, int iface_no)
unsigned int received_flg
struct totem_ip_address rep
unsigned int last_released
int orf_token_retransmit_size
int totemsrp_avail(void *srp_context)
Return number of available messages that can be queued.
unsigned int rrp_autorecovery_check_timeout
#define RETRANS_MESSAGE_QUEUE_SIZE_MAX
void(* log_printf)(int level, int subsys, const char *function_name, const char *file_name, int file_line, const char *format,...) __attribute__((format(printf
unsigned int fail_to_recv_const
void * token_recv_event_handle
struct totem_ip_address boundto
unsigned int my_high_seq_received
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.
qb_loop_t * totemsrp_poll_handle
qb_loop_timer_handle timer_pause_timeout
qb_loop_timer_handle timer_merge_detect_timeout
int my_merge_detect_timeout_outstanding
int totemsrp_log_level_security
qb_loop_timer_handle timer_orf_token_retransmit_timeout
struct totem_config * totem_config
qb_loop_timer_handle timer_orf_token_timeout
uint32_t continuous_gather
void totemsrp_threaded_mode_enable(void *context)
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.
void totemsrp_event_signal(void *srp_context, enum totem_event_type type, int value)
int totemrrp_recv_flush(void *rrp_context)
uint32_t orf_token_discard
int my_failed_list_entries
struct srp_addr my_left_memb_list[PROCESSOR_COUNT_MAX]
uint64_t token_hold_cancel_tx
unsigned int token_timeout
unsigned int high_delivered
unsigned int consensus_timeout
void main_deliver_fn(void *context, const void *msg, unsigned int msg_len)
#define PROCESSOR_COUNT_MAX
void totemrrp_buffer_release(void *rrp_context, void *ptr)
Totem Network interface - also does encryption/decryption.
char orf_token_retransmit[TOKEN_SIZE_MAX]
struct message_header header
struct sq regular_sort_queue
void totemsrp_finalize(void *srp_context)
void(* totemsrp_log_printf)(int level, int sybsys, const char *function, const char *file, int line, const char *format,...) __attribute__((format(printf
#define QUEUE_RTR_ITEMS_SIZE_MAX
struct srp_addr my_failed_list[PROCESSOR_COUNT_MAX]
struct cs_queue retrans_message_queue
const char * gather_state_from_desc[]
qb_loop_timer_handle memb_timer_state_gather_join_timeout
int my_trans_memb_entries
uint64_t memb_merge_detect_tx
unsigned int high_delivered
struct rtr_item rtr_list[0]
int consensus_list_entries
unsigned int rrp_problem_count_mcast_threshold
int totemrrp_processor_count_set(void *rrp_context, unsigned int processor_count)
void(*) enum memb_stat memb_state)
int totemrrp_mcast_noflush_send(void *rrp_context, const void *msg, unsigned int msg_len)
uint32_t threaded_mode_enabled
enum totem_callback_token_type callback_type
int totemrrp_mcast_recv_empty(void *rrp_context)
#define list_entry(ptr, type, member)
unsigned long long ring_seq
struct totem_logging_configuration totem_logging_configuration
int totemrrp_mcast_flush_send(void *rrp_context, const void *msg, unsigned int msg_len)
struct memb_ring_id ring_id
#define log_printf(level, format, args...)
void totemsrp_trans_ack(void *context)
unsigned int max_messages
uint64_t recovery_entered
qb_loop_timer_handle memb_timer_state_commit_timeout
struct memb_commit_token * commit_token
struct consensus_list_item consensus_list[PROCESSOR_COUNT_MAX]
struct srp_addr my_proc_list[PROCESSOR_COUNT_MAX]
int(* handler_functions[6])(struct totemsrp_instance *instance, const void *msg, size_t msg_len, int endian_conversion_needed)
unsigned int merge_timeout
unsigned int use_heartbeat
struct message_header header
int totemsrp_member_remove(void *context, const struct totem_ip_address *member, int ring_no)
unsigned int token_retransmit_timeout
struct srp_addr my_trans_memb_list[PROCESSOR_COUNT_MAX]
#define RETRANSMIT_ENTRIES_MAX
int totemip_equal(const struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
unsigned int my_token_seq
struct memb_ring_id ring_id
int totemrrp_ring_reenable(void *rrp_context, unsigned int iface_no)
qb_loop_timer_handle timer_orf_token_hold_retransmit_timeout
void(* totemsrp_deliver_fn)(unsigned int nodeid, const void *msg, unsigned int msg_len, int endian_conversion_required)
void(* totemsrp_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)
struct totem_ip_address addr[INTERFACE_MAX]
unsigned int rrp_token_expired_timeout
struct memb_ring_id ring_id
unsigned int my_install_seq
int totemrrp_token_send(void *rrp_context, const void *msg, unsigned int msg_len)
struct sq recovery_sort_queue
void(* totem_memb_ring_id_create_or_load)(struct memb_ring_id *memb_ring_id, const struct totem_ip_address *addr)
int totemrrp_token_target_set(void *rrp_context, struct totem_ip_address *addr, unsigned int iface_no)
totem_callback_token_type
int(* callback_fn)(enum totem_callback_token_type type, const void *)
unsigned int my_high_ring_delivered
void(* totem_memb_ring_id_store)(const struct memb_ring_id *memb_ring_id, const struct totem_ip_address *addr)