corosync
2.4.2
|
#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/qbdefs.h>
#include <qb/qbloop.h>
#include <corosync/sq.h>
#include <corosync/list.h>
#include <corosync/swab.h>
#include <corosync/logsys.h>
#include "totemudpu.h"
#include "util.h"
#include "totemcrypto.h"
#include <nss.h>
#include <pk11pub.h>
#include <pkcs11.h>
#include <prerror.h>
Go to the source code of this file.
Data Structures | |
struct | totemudpu_member |
struct | totemudpu_instance |
struct | work_item |
Macros | |
#define | LOGSYS_UTILS_ONLY 1 |
#define | MSG_NOSIGNAL 0 |
#define | MCAST_SOCKET_BUFFER_SIZE (TRANSMITS_ALLOWED * FRAME_SIZE_MAX) |
#define | NETIF_STATE_REPORT_UP 1 |
#define | NETIF_STATE_REPORT_DOWN 2 |
#define | BIND_STATE_UNBOUND 0 |
#define | BIND_STATE_REGULAR 1 |
#define | BIND_STATE_LOOPBACK 2 |
#define | log_printf(level, format, args...) |
#define | LOGSYS_PERROR(err_num, level, fmt, args...) |
Functions | |
int | totemudpu_member_list_rebind_ip (void *udpu_context) |
int | totemudpu_crypto_set (void *udpu_context, const char *cipher_type, const char *hash_type) |
int | totemudpu_finalize (void *udpu_context) |
int | totemudpu_initialize (qb_loop_t *poll_handle, void **udpu_context, struct totem_config *totem_config, totemsrp_stats_t *stats, int interface_no, 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_address), void(*target_set_completed)(void *context)) |
Create an instance. More... | |
void * | totemudpu_buffer_alloc (void) |
void | totemudpu_buffer_release (void *ptr) |
int | totemudpu_processor_count_set (void *udpu_context, int processor_count) |
int | totemudpu_recv_flush (void *udpu_context) |
int | totemudpu_send_flush (void *udpu_context) |
int | totemudpu_token_send (void *udpu_context, const void *msg, unsigned int msg_len) |
int | totemudpu_mcast_flush_send (void *udpu_context, const void *msg, unsigned int msg_len) |
int | totemudpu_mcast_noflush_send (void *udpu_context, const void *msg, unsigned int msg_len) |
int | totemudpu_iface_check (void *udpu_context) |
void | totemudpu_net_mtu_adjust (void *udpu_context, struct totem_config *totem_config) |
const char * | totemudpu_iface_print (void *udpu_context) |
int | totemudpu_iface_get (void *udpu_context, struct totem_ip_address *addr) |
int | totemudpu_token_target_set (void *udpu_context, const struct totem_ip_address *token_target) |
int | totemudpu_recv_mcast_empty (void *udpu_context) |
int | totemudpu_member_add (void *udpu_context, const struct totem_ip_address *member) |
int | totemudpu_member_remove (void *udpu_context, const struct totem_ip_address *token_target) |
int | totemudpu_member_set_active (void *udpu_context, const struct totem_ip_address *member_ip, int active) |
#define BIND_STATE_LOOPBACK 2 |
Definition at line 89 of file totemudpu.c.
#define BIND_STATE_REGULAR 1 |
Definition at line 88 of file totemudpu.c.
#define BIND_STATE_UNBOUND 0 |
Definition at line 87 of file totemudpu.c.
#define log_printf | ( | level, | |
format, | |||
args... | |||
) |
Definition at line 233 of file totemudpu.c.
Referenced by totemudpu_member_add(), totemudpu_member_remove(), and totemudpu_member_set_active().
#define LOGSYS_PERROR | ( | err_num, | |
level, | |||
fmt, | |||
args... | |||
) |
Definition at line 240 of file totemudpu.c.
#define LOGSYS_UTILS_ONLY 1 |
Definition at line 67 of file totemudpu.c.
#define MCAST_SOCKET_BUFFER_SIZE (TRANSMITS_ALLOWED * FRAME_SIZE_MAX) |
Definition at line 83 of file totemudpu.c.
#define MSG_NOSIGNAL 0 |
Definition at line 80 of file totemudpu.c.
Referenced by totemudpu_recv_mcast_empty().
#define NETIF_STATE_REPORT_DOWN 2 |
Definition at line 85 of file totemudpu.c.
#define NETIF_STATE_REPORT_UP 1 |
Definition at line 84 of file totemudpu.c.
void* totemudpu_buffer_alloc | ( | void | ) |
Definition at line 871 of file totemudpu.c.
References FRAME_SIZE_MAX.
void totemudpu_buffer_release | ( | void * | ptr | ) |
Definition at line 876 of file totemudpu.c.
int totemudpu_crypto_set | ( | void * | udpu_context, |
const char * | cipher_type, | ||
const char * | hash_type | ||
) |
Definition at line 250 of file totemudpu.c.
int totemudpu_finalize | ( | void * | udpu_context | ) |
Definition at line 433 of file totemudpu.c.
References totemudpu_instance::token_socket, and totemudpu_instance::totemudpu_poll_handle.
int totemudpu_iface_check | ( | void * | udpu_context | ) |
Definition at line 955 of file totemudpu.c.
int totemudpu_iface_get | ( | void * | udpu_context, |
struct totem_ip_address * | addr | ||
) |
Definition at line 984 of file totemudpu.c.
References totemudpu_instance::my_id.
const char* totemudpu_iface_print | ( | void * | udpu_context | ) |
Definition at line 975 of file totemudpu.c.
References totemudpu_instance::my_id, and totemip_print().
int totemudpu_initialize | ( | qb_loop_t * | poll_handle, |
void ** | udpu_context, | ||
struct totem_config * | totem_config, | ||
totemsrp_stats_t * | stats, | ||
int | interface_no, | ||
void * | context, | ||
void(*)(void *context, const void *msg, unsigned int msg_len) | deliver_fn, | ||
void(*)(void *context, const struct totem_ip_address *iface_address) | iface_change_fn, | ||
void(*)(void *context) | target_set_completed | ||
) |
Create an instance.
Definition at line 775 of file totemudpu.c.
int totemudpu_mcast_flush_send | ( | void * | udpu_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 929 of file totemudpu.c.
int totemudpu_mcast_noflush_send | ( | void * | udpu_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 942 of file totemudpu.c.
int totemudpu_member_add | ( | void * | udpu_context, |
const struct totem_ip_address * | member | ||
) |
Definition at line 1121 of file totemudpu.c.
References log_printf, LOGSYS_LEVEL_NOTICE, and totemip_print().
int totemudpu_member_list_rebind_ip | ( | void * | udpu_context | ) |
Definition at line 1197 of file totemudpu.c.
References totemudpu_member::fd, totemudpu_member::list, list_entry, totemudpu_member::member, totemudpu_instance::member_list, and list_head::next.
int totemudpu_member_remove | ( | void * | udpu_context, |
const struct totem_ip_address * | token_target | ||
) |
Definition at line 1147 of file totemudpu.c.
References totemudpu_member::fd, totemudpu_member::list, list_entry, log_printf, LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_NOTICE, totemudpu_member::member, totemudpu_instance::member_list, list_head::next, totemip_compare(), totemip_print(), and totemudpu_instance::totemudpu_poll_handle.
int totemudpu_member_set_active | ( | void * | udpu_context, |
const struct totem_ip_address * | member_ip, | ||
int | active | ||
) |
Definition at line 1223 of file totemudpu.c.
References totemudpu_member::active, totemudpu_member::list, list_entry, log_printf, LOGSYS_LEVEL_DEBUG, totemudpu_member::member, totemudpu_instance::member_list, list_head::next, totemip_compare(), and totemip_print().
void totemudpu_net_mtu_adjust | ( | void * | udpu_context, |
struct totem_config * | totem_config | ||
) |
Definition at line 965 of file totemudpu.c.
References totem_interface::bindnet, totem_config::crypto_cipher_type, totem_config::crypto_hash_type, crypto_sec_header_size(), totem_ip_address::family, totem_config::interface_count, totem_config::interfaces, totem_config::net_mtu, and totemip_udpip_header_size().
int totemudpu_processor_count_set | ( | void * | udpu_context, |
int | processor_count | ||
) |
Definition at line 881 of file totemudpu.c.
References totem_config::downcheck_timeout, totemudpu_instance::my_memb_entries, totemudpu_instance::timer_netif_check_timeout, totemudpu_instance::totem_config, and totemudpu_instance::totemudpu_poll_handle.
int totemudpu_recv_flush | ( | void * | udpu_context | ) |
Definition at line 903 of file totemudpu.c.
int totemudpu_recv_mcast_empty | ( | void * | udpu_context | ) |
Definition at line 1011 of file totemudpu.c.
References MSG_NOSIGNAL, system_from, totemudpu_instance::token_socket, and totemudpu_instance::totemudpu_iov_recv.
int totemudpu_send_flush | ( | void * | udpu_context | ) |
Definition at line 910 of file totemudpu.c.
int totemudpu_token_send | ( | void * | udpu_context, |
const void * | msg, | ||
unsigned int | msg_len | ||
) |
Definition at line 917 of file totemudpu.c.
int totemudpu_token_target_set | ( | void * | udpu_context, |
const struct totem_ip_address * | token_target | ||
) |
Definition at line 996 of file totemudpu.c.
References totemudpu_instance::context, totemudpu_instance::token_target, and totemudpu_instance::totemudpu_target_set_completed.