|
corosync
3.1.6
|
#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 <net/ethernet.h>#include <arpa/inet.h>#include <unistd.h>#include <fcntl.h>#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <pthread.h>#include <sched.h>#include <time.h>#include <sys/time.h>#include <sys/poll.h>#include <sys/uio.h>#include <limits.h>#include <qb/qbdefs.h>#include <qb/qbloop.h>#include <corosync/sq.h>#include <corosync/swab.h>#include <corosync/logsys.h>#include <corosync/icmap.h>#include <corosync/totem/totemip.h>#include "totemknet.h"#include "main.h"#include "util.h"#include <libknet.h>#include <corosync/totem/totemstats.h>
Go to the source code of this file.
Data Structures | |
| struct | totemknet_instance |
| struct | work_item |
Macros | |
| #define | MSG_NOSIGNAL 0 |
| #define | CFG_INTERFACE_STATUS_MAX_LEN 512 |
| #define | knet_log_printf_lock(level, subsys, function, file, line, format, args...) |
| #define | knet_log_printf(level, format, args...) |
| #define | libknet_log_printf(level, format, args...) |
| #define | KNET_LOGSYS_PERROR(err_num, level, fmt, args...) |
| #define | OWN_INDEX_NONE -1 |
Functions | |
| int | totemknet_member_list_rebind_ip (void *knet_context) |
| int | totemknet_crypto_set (void *knet_context, const char *cipher_type, const char *hash_type) |
| int | totemknet_nodestatus_get (void *knet_context, unsigned int nodeid, struct totem_node_status *node_status) |
| int | totemknet_ifaces_get (void *knet_context, char ***status, unsigned int *iface_count) |
| int | totemknet_finalize (void *knet_context) |
| int | totemknet_initialize (qb_loop_t *poll_handle, void **knet_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int link_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context)) |
| void * | totemknet_buffer_alloc (void) |
| void | totemknet_buffer_release (void *ptr) |
| int | totemknet_processor_count_set (void *knet_context, int processor_count) |
| int | totemknet_recv_flush (void *knet_context) |
| int | totemknet_send_flush (void *knet_context) |
| 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_iface_check (void *knet_context) |
| void | totemknet_net_mtu_adjust (void *knet_context, struct totem_config *totem_config) |
| int | totemknet_token_target_set (void *knet_context, unsigned int nodeid) |
| int | totemknet_recv_mcast_empty (void *knet_context) |
| int | totemknet_iface_set (void *knet_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no) |
| int | totemknet_member_add (void *knet_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int link_no) |
| int | totemknet_member_remove (void *knet_context, const struct totem_ip_address *token_target, int link_no) |
| 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) |
| int | totemknet_link_get_status (knet_node_id_t node, uint8_t link_no, struct knet_link_status *status) |
| int | totemknet_handle_get_stats (struct knet_handle_stats *stats) |
Variables | |
| struct totemknet_instance * | global_instance |
| #define CFG_INTERFACE_STATUS_MAX_LEN 512 |
Definition at line 91 of file totemknet.c.
| #define knet_log_printf | ( | level, | |
| format, | |||
| args... | |||
| ) |
Definition at line 233 of file totemknet.c.
| #define knet_log_printf_lock | ( | level, | |
| subsys, | |||
| function, | |||
| file, | |||
| line, | |||
| format, | |||
| args... | |||
| ) |
Definition at line 224 of file totemknet.c.
| #define KNET_LOGSYS_PERROR | ( | err_num, | |
| level, | |||
| fmt, | |||
| args... | |||
| ) |
Definition at line 249 of file totemknet.c.
| #define libknet_log_printf | ( | level, | |
| format, | |||
| args... | |||
| ) |
Definition at line 241 of file totemknet.c.
| #define MSG_NOSIGNAL 0 |
Definition at line 83 of file totemknet.c.
| #define OWN_INDEX_NONE -1 |
Definition at line 488 of file totemknet.c.
| void* totemknet_buffer_alloc | ( | void | ) |
Definition at line 1311 of file totemknet.c.
| void totemknet_buffer_release | ( | void * | ptr | ) |
Definition at line 1317 of file totemknet.c.
| int totemknet_crypto_reconfigure_phase | ( | void * | knet_context, |
| struct totem_config * | totem_config, | ||
| cfg_message_crypto_reconfig_phase_t | phase | ||
| ) |
Definition at line 1703 of file totemknet.c.
References totem_config::crypto_index, CRYPTO_RECONFIG_PHASE_ACTIVATE, totemknet_instance::knet_context, knet_log_printf, and LOGSYS_LEVEL_DEBUG.
| int totemknet_crypto_set | ( | void * | knet_context, |
| const char * | cipher_type, | ||
| const char * | hash_type | ||
| ) |
Definition at line 363 of file totemknet.c.
| int totemknet_finalize | ( | void * | knet_context | ) |
Definition at line 664 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::logpipes, LOGSYS_LEVEL_CRIT, LOGSYS_LEVEL_ERROR, and totemknet_instance::poll_handle.
| int totemknet_handle_get_stats | ( | struct knet_handle_stats * | stats | ) |
Definition at line 1808 of file totemknet.c.
References CS_ERR_NOT_EXIST, CS_OK, global_instance, totemknet_instance::knet_handle, and qb_to_cs_error().
| int totemknet_iface_check | ( | void * | knet_context | ) |
Definition at line 1378 of file totemknet.c.
References totemknet_instance::knet_context, and knet_log_printf.
| int totemknet_iface_set | ( | void * | knet_context, |
| const struct totem_ip_address * | local_addr, | ||
| unsigned short | ip_port, | ||
| unsigned int | iface_no | ||
| ) |
Definition at line 1461 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().
| int totemknet_ifaces_get | ( | void * | knet_context, |
| char *** | status, | ||
| unsigned int * | iface_count | ||
| ) |
Definition at line 569 of file totemknet.c.
References totemknet_instance::knet_context, totemknet_instance::knet_handle, and OWN_INDEX_NONE.
| int totemknet_initialize | ( | qb_loop_t * | poll_handle, |
| void ** | knet_context, | ||
| struct totem_config * | totem_config, | ||
| totemsrp_stats_t * | stats, | ||
| void * | context, | ||
| void(*)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from) | deliver_fn, | ||
| void(*)(void *context, const struct totem_ip_address *iface_address, unsigned int link_no) | iface_change_fn, | ||
| void(*)(void *context, int net_mtu) | mtu_changed, | ||
| void(*)(void *context) | target_set_completed | ||
| ) |
Definition at line 1059 of file totemknet.c.
| int totemknet_link_get_status | ( | knet_node_id_t | node, |
| uint8_t | link_no, | ||
| struct knet_link_status * | status | ||
| ) |
Definition at line 1771 of file totemknet.c.
References CS_ERR_BUSY, CS_ERR_INVALID_PARAM, CS_ERR_LIBRARY, CS_ERR_NOT_EXIST, CS_ERR_TRY_AGAIN, CS_OK, global_instance, INTERFACE_MAX, and totemknet_instance::knet_handle.
| int totemknet_mcast_flush_send | ( | void * | knet_context, |
| const void * | msg, | ||
| unsigned int | msg_len | ||
| ) |
Definition at line 1351 of file totemknet.c.
References totemknet_instance::knet_context.
| int totemknet_mcast_noflush_send | ( | void * | knet_context, |
| const void * | msg, | ||
| unsigned int | msg_len | ||
| ) |
Definition at line 1364 of file totemknet.c.
References totemknet_instance::knet_context.
| int totemknet_member_add | ( | void * | knet_context, |
| const struct totem_ip_address * | local, | ||
| const struct totem_ip_address * | member, | ||
| int | link_no | ||
| ) |
Definition at line 1478 of file totemknet.c.
References CS_PRI_NODE_ID, 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().
| int totemknet_member_list_rebind_ip | ( | void * | knet_context | ) |
Definition at line 1646 of file totemknet.c.
| int totemknet_member_remove | ( | void * | knet_context, |
| const struct totem_ip_address * | token_target, | ||
| int | link_no | ||
| ) |
Definition at line 1600 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.
| void totemknet_net_mtu_adjust | ( | void * | knet_context, |
| struct totem_config * | totem_config | ||
| ) |
Definition at line 1388 of file totemknet.c.
References totemknet_instance::knet_context, knet_log_printf, and totem_config::net_mtu.
| int totemknet_nodestatus_get | ( | void * | knet_context, |
| unsigned int | nodeid, | ||
| struct totem_node_status * | node_status | ||
| ) |
Definition at line 491 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.
| int totemknet_processor_count_set | ( | void * | knet_context, |
| int | processor_count | ||
| ) |
Definition at line 1322 of file totemknet.c.
| int totemknet_reconfigure | ( | void * | knet_context, |
| struct totem_config * | totem_config | ||
| ) |
Definition at line 1673 of file totemknet.c.
References totemknet_instance::knet_context.
| int totemknet_recv_flush | ( | void * | knet_context | ) |
Definition at line 1329 of file totemknet.c.
| int totemknet_recv_mcast_empty | ( | void * | knet_context | ) |
Definition at line 1409 of file totemknet.c.
References totemknet_instance::iov_buffer, totemknet_instance::knet_context, totemknet_instance::knet_fd, MSG_NOSIGNAL, and system_from.
| int totemknet_send_flush | ( | void * | knet_context | ) |
Definition at line 1334 of file totemknet.c.
| void totemknet_stats_clear | ( | void * | knet_context | ) |
Definition at line 1762 of file totemknet.c.
References totemknet_instance::knet_context, and totemknet_instance::knet_handle.
| int totemknet_token_send | ( | void * | knet_context, |
| const void * | msg, | ||
| unsigned int | msg_len | ||
| ) |
Definition at line 1339 of file totemknet.c.
References totemknet_instance::knet_context.
| int totemknet_token_target_set | ( | void * | knet_context, |
| unsigned int | nodeid | ||
| ) |
Definition at line 1395 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.
| struct totemknet_instance* global_instance |
Definition at line 187 of file totemknet.c.
Referenced by totemknet_handle_get_stats(), and totemknet_link_get_status().