totemsrp.h File Reference

Totem Single Ring Protocol. More...

`#include <corosync/totem/totem.h>`
`#include <qb/qbloop.h>`
Include dependency graph for totemsrp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

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_mcast (void *srp_context, struct iovec *iovec, unsigned int iov_len, int priority)
| 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)
void | totemsrp_event_signal (void *srp_context, enum totem_event_type type, int value)
void | totemsrp_net_mtu_adjust (struct totem_config *totem_config)
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)
unsigned int | totemsrp_my_nodeid_get (void *srp_context)
int | totemsrp_my_family_get (void *srp_context)
int | totemsrp_crypto_set (void *srp_context, const char *cipher_type, const char *hash_type)
void | totemsrp_service_ready_register (void *srp_context, void(*totem_service_ready)(void))
int | totemsrp_iface_set (void *srp_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
int | totemsrp_member_add (void *srp_context, const struct totem_ip_address *member, int ring_no)
int | totemsrp_member_remove (void *srp_context, const struct totem_ip_address *member, int ring_no)
void | totemsrp_threaded_mode_enable (void *srp_context)
void | totemsrp_trans_ack (void *srp_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 *srp_context, int flags)
void | totemsrp_force_gather (void *context)

## Detailed Description

Totem Single Ring Protocol.

depends on poll abstraction, POSIX, IPV4

Definition in file totemsrp.h.

## Function Documentation

## 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, nodeid, 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(*)(enum totem_callback_token_type type, const void *) | callback_fn,
|  | 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, nodeid, 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 nodeid.

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 nodeid, 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
| ) |  |

extern

Definition at line 1108 of file totemsrp.c.

References nodeid, 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 nodeid.

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, nodeid, 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 * | srp_context,
|  | const struct totem_ip_address * | interface_addr,
|  | unsigned short | ip_port,
|  | unsigned int | iface_no
| ) |  |

extern

Definition at line 5114 of file totemsrp.c.

References totemsrp_instance::my_addrs, nodeid, 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
| ) |  |

extern

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(*)(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 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, srp_addr::nodeid, 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, 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 | priority
| ) |  |

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, 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 * | srp_context,
|  | const struct totem_ip_address * | member,
|  | int | ring_no
| ) |  |

extern

Definition at line 5207 of file totemsrp.c.

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

Referenced by totempg_member_add().

## totemsrp_member_remove()

int totemsrp_member_remove | ( | void * | srp_context,
|  | const struct totem_ip_address * | member,
|  | int | ring_no
| ) |  |

extern

Definition at line 5220 of file totemsrp.c.

References nodeid, 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 | ) |

extern

Definition at line 1133 of file totemsrp.c.

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

Referenced by totempg_my_family_get().

## totemsrp_my_nodeid_get()

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

extern

Definition at line 1122 of file totemsrp.c.

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

Referenced by totempg_my_nodeid_get().

## totemsrp_net_mtu_adjust()

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

extern

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
| ) |  |

extern

Definition at line 1041 of file totemsrp.c.

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

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 nodeid, totemsrp_instance::totemnet_context, and totemnet_reconfigure().

Referenced by totempg_reconfigure().

## totemsrp_service_ready_register()

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

Definition at line 5198 of file totemsrp.c.

References nodeid, and totemsrp_instance::totemsrp_service_ready_fn.

Referenced by totempg_service_ready_register().

## totemsrp_stats_clear()

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

Definition at line 5267 of file totemsrp.c.

References flags, nodeid, 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 * | srp_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 * | srp_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().