totemknet.h File Reference
`#include <sys/types.h>`
`#include <sys/socket.h>`
`#include <qb/qbloop.h>`
`#include <corosync/totem/totem.h>`
Include dependency graph for totemknet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

int

totemknet_initialize (qb_loop_t *poll_handle, void **knet_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))

| Create an instance.
void * | totemknet_buffer_alloc (void)
void | totemknet_buffer_release (void *ptr)
int | totemknet_processor_count_set (void *knet_context, int processor_count)
int | totemknet_token_send (void *knet_context, const void *msg, unsigned int msg_len)
int | totemknet_mcast_flush_send (void *knet_context, const void *msg, unsigned int msg_len)
int | totemknet_mcast_noflush_send (void *knet_context, const void *msg, unsigned int msg_len)
int | totemknet_recv_flush (void *knet_context)
int | totemknet_send_flush (void *knet_context)
int | totemknet_iface_check (void *knet_context)
int | totemknet_finalize (void *knet_context)
void | totemknet_net_mtu_adjust (void *knet_context, struct totem_config *totem_config)
int | totemknet_nodestatus_get (void *knet_context, unsigned int nodeid, struct totem_node_status *node_status)
int | totemknet_ifaces_get (void *net_context, char ***status, unsigned int *iface_count)
int | totemknet_iface_set (void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
int | totemknet_token_target_set (void *knet_context, unsigned int nodeid)
int | totemknet_crypto_set (void *knet_context, const char *cipher_type, const char *hash_type)
int | totemknet_recv_mcast_empty (void *knet_context)
int | totemknet_member_add (void *knet_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
int | totemknet_member_remove (void *knet_context, const struct totem_ip_address *member, int ring_no)
int | totemknet_member_set_active (void *knet_context, const struct totem_ip_address *member_ip, int active)
int | totemknet_reconfigure (void *knet_context, struct totem_config *totem_config)
int | totemknet_crypto_reconfigure_phase (void *knet_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
void | totemknet_stats_clear (void *knet_context)
void | totemknet_configure_log_level (void)

## Function Documentation

## totemknet_buffer_alloc()

void * totemknet_buffer_alloc | ( | void |  | ) |

extern

Definition at line 1402 of file totemknet.c.

## totemknet_buffer_release()

void totemknet_buffer_release | ( | void * | ptr | ) |

extern

Definition at line 1408 of file totemknet.c.

## totemknet_configure_log_level()

void totemknet_configure_log_level | ( | void |  | ) |

extern

Definition at line 884 of file totemknet.c.

References global_instance, log_printf, logsys_config_debug_get(), LOGSYS_DEBUG_OFF, LOGSYS_DEBUG_ON, LOGSYS_DEBUG_TRACE, LOGSYS_LEVEL_DEBUG, and LOGSYS_LEVEL_ERROR.

Referenced by totemknet_initialize().

## totemknet_crypto_reconfigure_phase()

int totemknet_crypto_reconfigure_phase | ( | void * | knet_context,
|  | struct totem_config * | totem_config,
|  | cfg_message_crypto_reconfig_phase_t | phase )

extern

Definition at line 1800 of file totemknet.c.

References totem_config::crypto_index, CRYPTO_RECONFIG_PHASE_ACTIVATE, CRYPTO_RECONFIG_PHASE_CLEANUP, totemknet_instance::knet_context, totemknet_instance::knet_handle, knet_log_printf, LOGSYS_LEVEL_DEBUG, and LOGSYS_LEVEL_ERROR.

## totemknet_crypto_set()

int totemknet_crypto_set | ( | void * | knet_context,
|  | const char * | cipher_type,
|  | const char * | hash_type )

extern

Definition at line 388 of file totemknet.c.

## totemknet_finalize()

int totemknet_finalize | ( | void * | knet_context | ) |

extern

Definition at line 658 of file totemknet.c.

References CS_PRI_NODE_ID, totemknet_instance::knet_context, totemknet_instance::knet_fd, totemknet_instance::knet_handle, knet_log_printf, totemknet_instance::log_mutex, totemknet_instance::logpipes, LOGSYS_LEVEL_CRIT, LOGSYS_LEVEL_ERROR, and totemknet_instance::poll_handle.

## totemknet_iface_check()

int totemknet_iface_check | ( | void * | knet_context | ) |

extern

Definition at line 1469 of file totemknet.c.

References totemknet_instance::knet_context, and knet_log_printf.

## totemknet_iface_set()

int totemknet_iface_set | ( | void * | net_context,
|  | const struct totem_ip_address * | local_addr,
|  | unsigned short | ip_port,
|  | unsigned int | iface_no )

extern

Definition at line 1538 of file totemknet.c.

References totemknet_instance::ip_port, totemknet_instance::knet_context, knet_log_printf, totemknet_instance::my_ids, totemip_copy(), and totemip_print().

## totemknet_ifaces_get()

int totemknet_ifaces_get | ( | void * | net_context,
|  | char *** | status,
|  | unsigned int * | iface_count )

extern

Definition at line 563 of file totemknet.c.

References CFG_INTERFACE_STATUS_MAX_LEN, totem_interface::configured, INTERFACE_MAX, totem_config::interfaces, totemknet_instance::knet_context, totemknet_instance::knet_handle, knet_log_printf, totemknet_instance::link_status, LOGSYS_LEVEL_ERROR, totemknet_instance::our_nodeid, OWN_INDEX_NONE, and totemknet_instance::totem_config.

## totemknet_initialize()

int totemknet_initialize | ( | qb_loop_t * | poll_handle,
|  | void ** | knet_context,
|  | struct totem_config * | totem_config,
|  | totemsrp_stats_t * | stats,
|  | void * | context,
|  | int(* | deliver_fn )(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from),
|  | int(* | iface_change_fn )(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no),
|  | void(* | mtu_changed )(void *context, int net_mtu),
|  | void(* | target_set_completed )(void *context) )

extern

Create an instance.

Definition at line 1133 of file totemknet.c.

References _logsys_subsys_create(), totem_interface::bindnet, totem_interface::boundto, CFG_INTERFACE_STATUS_MAX_LEN, totemknet_instance::context, totem_config::crypto_index, CS_OK, global_instance, icmap_get_string(), INTERFACE_MAX, totem_config::interfaces, totem_config::ip_dscp, totem_interface::ip_port, totemknet_instance::ip_port, totem_config::knet_compression_model, totemknet_instance::knet_context, totemknet_instance::knet_fd, totemknet_instance::knet_handle, knet_log_printf, KNET_LOGSYS_PERROR, totem_config::knet_mtu, totem_config::knet_pmtud_interval, totemknet_instance::knet_subsys_id, totem_config::link_mode, totemknet_instance::link_mode, totemknet_instance::link_status, totem_logging_configuration::log_level_debug, totem_logging_configuration::log_level_error, totem_logging_configuration::log_level_notice, totem_logging_configuration::log_level_warning, totem_logging_configuration::log_printf, totem_logging_configuration::log_subsys_id, totemknet_instance::logpipes, LOGSYS_LEVEL_CRIT, LOGSYS_LEVEL_INFO, LOGSYS_LEVEL_WARNING, totemknet_instance::loopback_link, totemknet_instance::my_ids, totem_config::node_id, totem_ip_address::nodeid, totemknet_instance::our_nodeid, totemknet_instance::poll_handle, stats_knet_add_handle(), system_from, totemknet_instance::timer_netif_check_timeout, totemknet_instance::totem_config, totem_config::totem_logging_configuration, totemip_copy(), totemknet_configure_log_level(), totemknet_instance::totemknet_deliver_fn, totemknet_instance::totemknet_iface_change_fn, totemknet_instance::totemknet_log_level_debug, totemknet_instance::totemknet_log_level_error, totemknet_instance::totemknet_log_level_notice, totemknet_instance::totemknet_log_level_security, totemknet_instance::totemknet_log_level_warning, totemknet_instance::totemknet_log_printf, totemknet_instance::totemknet_mtu_changed, totemknet_instance::totemknet_subsys_id, and totemknet_instance::totemknet_target_set_completed.

## totemknet_mcast_flush_send()

int totemknet_mcast_flush_send | ( | void * | knet_context,
|  | const void * | msg,
|  | unsigned int | msg_len )

extern

Definition at line 1442 of file totemknet.c.

References totemknet_instance::knet_context.

## totemknet_mcast_noflush_send()

int totemknet_mcast_noflush_send | ( | void * | knet_context,
|  | const void * | msg,
|  | unsigned int | msg_len )

extern

Definition at line 1455 of file totemknet.c.

References totemknet_instance::knet_context.

## totemknet_member_add()

int totemknet_member_add | ( | void * | knet_context,
|  | const struct totem_ip_address * | local,
|  | const struct totem_ip_address * | member,
|  | int | ring_no )

extern

Definition at line 1555 of file totemknet.c.

References CS_PRI_NODE_ID, icmap_set_string(), totem_config::interfaces, totemknet_instance::ip_port, totemknet_instance::knet_context, totemknet_instance::knet_handle, totem_interface::knet_link_priority, knet_log_printf, KNET_LOGSYS_PERROR, totem_interface::knet_ping_interval, totem_interface::knet_ping_precision, totem_interface::knet_ping_timeout, totem_interface::knet_pong_count, totem_interface::knet_transport, totemknet_instance::link_mode, LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_ERROR, totemknet_instance::loopback_link, totem_ip_address::nodeid, totemknet_instance::our_nodeid, stats_knet_add_member(), totemknet_instance::totem_config, totemip_print(), and totemip_totemip_to_sockaddr_convert().

## totemknet_member_remove()

int totemknet_member_remove | ( | void * | knet_context,
|  | const struct totem_ip_address * | member,
|  | int | ring_no )

extern

Definition at line 1694 of file totemknet.c.

References CS_PRI_NODE_ID, totemknet_instance::knet_context, totemknet_instance::knet_handle, knet_log_printf, KNET_LOGSYS_PERROR, LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_ERROR, totem_ip_address::nodeid, totemknet_instance::our_nodeid, stats_knet_del_member(), and totemknet_instance::token_target.

## totemknet_member_set_active()

int totemknet_member_set_active | ( | void * | knet_context,
|  | const struct totem_ip_address * | member_ip,
|  | int | active )

extern

## totemknet_net_mtu_adjust()

void totemknet_net_mtu_adjust | ( | void * | knet_context,
|  | struct totem_config * | totem_config )

extern

Definition at line 1479 of file totemknet.c.

References totemknet_instance::knet_context, knet_log_printf, and totem_config::net_mtu.

## totemknet_nodestatus_get()

int totemknet_nodestatus_get | ( | void * | knet_context,
|  | unsigned int | nodeid,
|  | struct totem_node_status * | node_status )

extern

Definition at line 485 of file totemknet.c.

References totem_interface::configured, CS_ERR_INVALID_PARAM, CS_ERR_NOT_EXIST, totem_node_status::external, totem_config::interfaces, totemknet_instance::knet_context, totemknet_instance::knet_handle, knet_log_printf, totem_node_status::link_status, LOGSYS_LEVEL_WARNING, nodeid, totem_node_status::nodeid, totem_node_status::onwire_max, totem_node_status::onwire_min, totem_node_status::onwire_ver, totem_node_status::reachable, totem_node_status::remote, and totemknet_instance::totem_config.

## totemknet_processor_count_set()

int totemknet_processor_count_set | ( | void * | knet_context,
|  | int | processor_count )

extern

Definition at line 1413 of file totemknet.c.

## totemknet_reconfigure()

int totemknet_reconfigure | ( | void * | knet_context,
|  | struct totem_config * | totem_config )

extern

Definition at line 1767 of file totemknet.c.

References totem_config::crypto_changed, totem_config::crypto_cipher_type, totem_config::crypto_hash_type, totem_config::crypto_index, totem_config::crypto_model, icmap_set_string(), totemknet_instance::knet_context, and knet_log_printf.

## totemknet_recv_flush()

int totemknet_recv_flush | ( | void * | knet_context | ) |

extern

Definition at line 1420 of file totemknet.c.

## totemknet_recv_mcast_empty()

int totemknet_recv_mcast_empty | ( | void * | knet_context | ) |

extern

Definition at line 1500 of file totemknet.c.

References totemknet_instance::iov_buffer, totemknet_instance::knet_context, totemknet_instance::knet_fd, MSG_NOSIGNAL, and system_from.

## totemknet_send_flush()

int totemknet_send_flush | ( | void * | knet_context | ) |

extern

Definition at line 1425 of file totemknet.c.

## totemknet_stats_clear()

void totemknet_stats_clear | ( | void * | knet_context | ) |

extern

Definition at line 1859 of file totemknet.c.

References totemknet_instance::knet_context, and totemknet_instance::knet_handle.

## totemknet_token_send()

int totemknet_token_send | ( | void * | knet_context,
|  | const void * | msg,
|  | unsigned int | msg_len )

extern

Definition at line 1430 of file totemknet.c.

References totemknet_instance::knet_context, and totemknet_instance::token_target.

## totemknet_token_target_set()

int totemknet_token_target_set | ( | void * | knet_context,
|  | unsigned int | nodeid )

extern

Definition at line 1486 of file totemknet.c.

References totemknet_instance::context, totemknet_instance::knet_context, nodeid, totem_ip_address::nodeid, totemknet_instance::token_target, and totemknet_instance::totemknet_target_set_completed.