totemnet.c
Go to the documentation of this file.
/*
* Copyright (c) 2005 MontaVista Software, Inc.
* Copyright (c) 2006-2018 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Steven Dake (sdake@redhat.com)
* This software licensed under BSD license, the text of which follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the MontaVista Software, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <config.h>
#include <assert.h>
#include <totemudp.h>
#include <totemudpu.h>
#include <totemknet.h>
#include <totemnet.h>
#include <qb/qbloop.h>
#define LOGSYS_UTILS_ONLY 1
#include <corosync/logsys.h>
struct transport {
const char *name;
int (*initialize) (
qb_loop_t *loop_pt,
void **transport_instance,
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 ring_no),
void (*mtu_changed) (
void *context,
int net_mtu),
void (*target_set_completed) (
void *context));
void *(*buffer_alloc) (void);
void (*buffer_release) (void *ptr);
int (*processor_count_set) (
void *transport_context,
int processor_count);
int (*token_send) (
void *transport_context,
const void *msg,
unsigned int msg_len);
int (*mcast_flush_send) (
void *transport_context,
const void *msg,
unsigned int msg_len);
int (*mcast_noflush_send) (
void *transport_context,
const void *msg,
unsigned int msg_len);
int (*recv_flush) (void *transport_context);
int (*send_flush) (void *transport_context);
int (*iface_check) (void *transport_context);
int (*finalize) (void *transport_context);
void (*net_mtu_adjust) (void *transport_context, struct totem_config *totem_config);
const char *(*iface_print) (void *transport_context);
int (*ifaces_get) (
void *transport_context,
char ***status,
unsigned int *iface_count);
int (*nodestatus_get) (
void *transport_context,
unsigned int nodeid,
struct totem_node_status *node_status);
int (*token_target_set) (
void *transport_context,
unsigned int nodeid);
int (*crypto_set) (
void *transport_context,
const char *cipher_type,
const char *hash_type);
int (*recv_mcast_empty) (
void *transport_context);
int (*iface_set) (
void *transport_context,
const struct totem_ip_address *local,
unsigned short ip_port,
unsigned int ring_no);
int (*member_add) (
void *transport_context,
const struct totem_ip_address *local,
const struct totem_ip_address *member,
int ring_no);
int (*member_remove) (
void *transport_context,
const struct totem_ip_address *member,
int ring_no);
int (*member_set_active) (
void *transport_context,
const struct totem_ip_address *member,
int active);
int (*reconfigure) (
void *net_context,
struct totem_config *totem_config);
int (*crypto_reconfigure_phase) (
void *net_context,
struct totem_config *totem_config,
cfg_message_crypto_reconfig_phase_t phase);
void (*stats_clear) (
void *net_context);
};
struct transport transport_entries[] = {
{
.name = "UDP/IP Multicast",
.initialize = totemudp_initialize,
.buffer_alloc = totemudp_buffer_alloc,
.buffer_release = totemudp_buffer_release,
.processor_count_set = totemudp_processor_count_set,
.token_send = totemudp_token_send,
.mcast_flush_send = totemudp_mcast_flush_send,
.mcast_noflush_send = totemudp_mcast_noflush_send,
.recv_flush = totemudp_recv_flush,
.send_flush = totemudp_send_flush,
.iface_set = totemudp_iface_set,
.iface_check = totemudp_iface_check,
.finalize = totemudp_finalize,
.net_mtu_adjust = totemudp_net_mtu_adjust,
.ifaces_get = totemudp_ifaces_get,
.nodestatus_get = totemudp_nodestatus_get,
.token_target_set = totemudp_token_target_set,
.crypto_set = totemudp_crypto_set,
.recv_mcast_empty = totemudp_recv_mcast_empty,
.member_add = totemudp_member_add,
.member_remove = totemudp_member_remove,
.reconfigure = totemudp_reconfigure,
.crypto_reconfigure_phase = NULL
},
{
.name = "UDP/IP Unicast",
.initialize = totemudpu_initialize,
.buffer_alloc = totemudpu_buffer_alloc,
.buffer_release = totemudpu_buffer_release,
.processor_count_set = totemudpu_processor_count_set,
.token_send = totemudpu_token_send,
.mcast_flush_send = totemudpu_mcast_flush_send,
.mcast_noflush_send = totemudpu_mcast_noflush_send,
.recv_flush = totemudpu_recv_flush,
.send_flush = totemudpu_send_flush,
.iface_set = totemudpu_iface_set,
.iface_check = totemudpu_iface_check,
.finalize = totemudpu_finalize,
.net_mtu_adjust = totemudpu_net_mtu_adjust,
.ifaces_get = totemudpu_ifaces_get,
.nodestatus_get = totemudpu_nodestatus_get,
.token_target_set = totemudpu_token_target_set,
.crypto_set = totemudpu_crypto_set,
.recv_mcast_empty = totemudpu_recv_mcast_empty,
.member_add = totemudpu_member_add,
.member_remove = totemudpu_member_remove,
.reconfigure = totemudpu_reconfigure,
.crypto_reconfigure_phase = NULL
},
{
.name = "Kronosnet",
.initialize = totemknet_initialize,
.buffer_alloc = totemknet_buffer_alloc,
.buffer_release = totemknet_buffer_release,
.processor_count_set = totemknet_processor_count_set,
.token_send = totemknet_token_send,
.mcast_flush_send = totemknet_mcast_flush_send,
.mcast_noflush_send = totemknet_mcast_noflush_send,
.recv_flush = totemknet_recv_flush,
.send_flush = totemknet_send_flush,
.iface_set = totemknet_iface_set,
.iface_check = totemknet_iface_check,
.finalize = totemknet_finalize,
.net_mtu_adjust = totemknet_net_mtu_adjust,
.ifaces_get = totemknet_ifaces_get,
.nodestatus_get = totemknet_nodestatus_get,
.token_target_set = totemknet_token_target_set,
.crypto_set = totemknet_crypto_set,
.recv_mcast_empty = totemknet_recv_mcast_empty,
.member_add = totemknet_member_add,
.member_remove = totemknet_member_remove,
.reconfigure = totemknet_reconfigure,
.crypto_reconfigure_phase = totemknet_crypto_reconfigure_phase,
.stats_clear = totemknet_stats_clear
}
};
struct totemnet_instance {
void *transport_context;
struct transport *transport;
void (*totemnet_log_printf) (
int level,
int subsys,
const char *function,
const char *file,
int line,
const char *format,
...)__attribute__((format(printf, 6, 7)));
int totemnet_subsys_id;
};
#define log_printf(level, format, args...) \
do { \
instance->totemnet_log_printf ( \
level, \
instance->totemnet_subsys_id, \
__FUNCTION__, __FILE__, __LINE__, \
(const char *)format, ##args); \
} while (0);
static void totemnet_instance_initialize (
struct totemnet_instance *instance,
struct totem_config *config)
{
int transport;
instance->totemnet_log_printf = config->totem_logging_configuration.log_printf;
instance->totemnet_subsys_id = config->totem_logging_configuration.log_subsys_id;
transport = config->transport_number;
log_printf (LOGSYS_LEVEL_NOTICE,
"Initializing transport (%s).", transport_entries[transport].name);
instance->transport = &transport_entries[transport];
}
int totemnet_crypto_set (
void *net_context,
const char *cipher_type,
const char *hash_type)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->crypto_set (instance->transport_context,
cipher_type, hash_type);
return res;
}
int totemnet_finalize (
void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->finalize (instance->transport_context);
return (res);
}
int totemnet_initialize (
qb_loop_t *loop_pt,
void **net_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 ring_no),
void (*mtu_changed) (
void *context,
int net_mtu),
void (*target_set_completed) (
void *context))
{
struct totemnet_instance *instance;
unsigned int res;
instance = malloc (sizeof (struct totemnet_instance));
if (instance == NULL) {
return (-1);
}
totemnet_instance_initialize (instance, totem_config);
res = instance->transport->initialize (loop_pt,
&instance->transport_context, totem_config, stats,
context, deliver_fn, iface_change_fn, mtu_changed, target_set_completed);
if (res == -1) {
goto error_destroy;
}
*net_context = instance;
return (0);
error_destroy:
free (instance);
return (-1);
}
void *totemnet_buffer_alloc (void *net_context)
{
struct totemnet_instance *instance = net_context;
assert (instance != NULL);
assert (instance->transport != NULL);
return instance->transport->buffer_alloc();
}
void totemnet_buffer_release (void *net_context, void *ptr)
{
struct totemnet_instance *instance = net_context;
assert (instance != NULL);
assert (instance->transport != NULL);
instance->transport->buffer_release (ptr);
}
int totemnet_processor_count_set (
void *net_context,
int processor_count)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->processor_count_set (instance->transport_context, processor_count);
return (res);
}
int totemnet_recv_flush (void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->recv_flush (instance->transport_context);
return (res);
}
int totemnet_send_flush (void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->send_flush (instance->transport_context);
return (res);
}
int totemnet_token_send (
void *net_context,
const void *msg,
unsigned int msg_len)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->token_send (instance->transport_context, msg, msg_len);
return (res);
}
int totemnet_mcast_flush_send (
void *net_context,
const void *msg,
unsigned int msg_len)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->mcast_flush_send (instance->transport_context, msg, msg_len);
return (res);
}
int totemnet_mcast_noflush_send (
void *net_context,
const void *msg,
unsigned int msg_len)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->mcast_noflush_send (instance->transport_context, msg, msg_len);
return (res);
}
extern int totemnet_iface_check (void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
res = instance->transport->iface_check (instance->transport_context);
return (res);
}
extern int totemnet_net_mtu_adjust (void *net_context, struct totem_config *totem_config)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res = 0;
instance->transport->net_mtu_adjust (instance->transport_context, totem_config);
return (res);
}
int totemnet_iface_set (void *net_context,
const struct totem_ip_address *interface_addr,
unsigned short ip_port,
unsigned int iface_no)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
int res;
res = instance->transport->iface_set (instance->transport_context, interface_addr, ip_port, iface_no);
return (res);
}
extern int totemnet_nodestatus_get (
void *net_context,
unsigned int nodeid,
struct totem_node_status *node_status)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res;
res = instance->transport->nodestatus_get (instance->transport_context, nodeid, node_status);
return (res);
}
int totemnet_ifaces_get (
void *net_context,
char ***status,
unsigned int *iface_count)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res;
res = instance->transport->ifaces_get (instance->transport_context, status, iface_count);
return (res);
}
int totemnet_token_target_set (
void *net_context,
unsigned int nodeid)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res;
res = instance->transport->token_target_set (instance->transport_context, nodeid);
return (res);
}
extern int totemnet_recv_mcast_empty (
void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res;
res = instance->transport->recv_mcast_empty (instance->transport_context);
return (res);
}
extern int totemnet_member_add (
void *net_context,
const struct totem_ip_address *local,
const struct totem_ip_address *member,
int ring_no)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res = 0;
if (instance->transport->member_add) {
res = instance->transport->member_add (
instance->transport_context,
local,
member,
ring_no);
}
return (res);
}
extern int totemnet_member_remove (
void *net_context,
const struct totem_ip_address *member,
int ring_no)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res = 0;
if (instance->transport->member_remove) {
res = instance->transport->member_remove (
instance->transport_context,
member,
ring_no);
}
return (res);
}
int totemnet_member_set_active (
void *net_context,
const struct totem_ip_address *member,
int active)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res = 0;
if (instance->transport->member_set_active) {
res = instance->transport->member_set_active (
instance->transport_context,
member,
active);
}
return (res);
}
int totemnet_reconfigure (
void *net_context,
struct totem_config *totem_config)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res = 0;
res = instance->transport->reconfigure (
instance->transport_context,
totem_config);
return (res);
}
int totemnet_crypto_reconfigure_phase (
void *net_context,
struct totem_config *totem_config,
cfg_message_crypto_reconfig_phase_t phase)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
unsigned int res = 0;
if (instance->transport->crypto_reconfigure_phase) {
res = instance->transport->crypto_reconfigure_phase (
instance->transport_context,
totem_config, phase);
}
return (res);
}
void totemnet_stats_clear (
void *net_context)
{
struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
if (instance->transport->stats_clear) {
instance->transport->stats_clear (
instance->transport_context);
}
}
config.h
nodeid
unsigned int nodeid
Definition: coroapi.h:0
logsys.h
LOGSYS_LEVEL_NOTICE
#define LOGSYS_LEVEL_NOTICE
Definition: logsys.h:74
totem_config
Definition: totem.h:159
totem_config::totem_logging_configuration
struct totem_logging_configuration totem_logging_configuration
Definition: totem.h:207
totem_config::transport_number
totem_transport_t transport_number
Definition: totem.h:239
totem_ip_address
The totem_ip_address struct.
Definition: coroapi.h:111
totem_logging_configuration::log_subsys_id
int log_subsys_id
Definition: totem.h:116
totem_logging_configuration::log_printf
void(* log_printf)(int level, int subsys, const char *function_name, const char *file_name, int file_line, const char *format,...) __attribute__((format(printf
Definition: totem.h:101
totem_node_status
Definition: totem.h:264
totemnet_instance
Definition: totemnet.c:249
totemnet_instance::transport_context
void * transport_context
Definition: totemnet.c:250
totemnet_instance::transport
struct transport * transport
Definition: totemnet.c:252
totemnet_instance::totemnet_log_printf
void(* totemnet_log_printf)(int level, int subsys, const char *function, const char *file, int line, const char *format,...) __attribute__((format(printf
Definition: totemnet.c:253
totemnet_instance::totemnet_subsys_id
void(*) in totemnet_subsys_id)
Definition: totemnet.c:260
totemsrp_stats_t
Definition: totemstats.h:53
transport
Definition: totemnet.c:49
transport::finalize
int(* finalize)(void *transport_context)
Definition: totemnet.c:107
transport::mcast_noflush_send
int(* mcast_noflush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:96
transport::mcast_flush_send
int(* mcast_flush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:90
transport::buffer_release
void(* buffer_release)(void *ptr)
Definition: totemnet.c:79
transport::token_target_set
int(* token_target_set)(void *transport_context, unsigned int nodeid)
Definition: totemnet.c:123
transport::buffer_alloc
void *(* buffer_alloc)(void)
Definition: totemnet.c:77
transport::member_add
int(* member_add)(void *transport_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:141
transport::reconfigure
int(* reconfigure)(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:157
transport::initialize
int(* initialize)(qb_loop_t *loop_pt, void **transport_instance, 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 ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Definition: totemnet.c:52
transport::send_flush
int(* send_flush)(void *transport_context)
Definition: totemnet.c:103
transport::recv_mcast_empty
int(* recv_mcast_empty)(void *transport_context)
Definition: totemnet.c:132
transport::iface_check
int(* iface_check)(void *transport_context)
Definition: totemnet.c:105
transport::stats_clear
void(* stats_clear)(void *net_context)
Definition: totemnet.c:166
transport::nodestatus_get
int(* nodestatus_get)(void *transport_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemnet.c:118
transport::net_mtu_adjust
void(* net_mtu_adjust)(void *transport_context, struct totem_config *totem_config)
Definition: totemnet.c:109
transport::member_set_active
int(* member_set_active)(void *transport_context, const struct totem_ip_address *member, int active)
Definition: totemnet.c:152
transport::processor_count_set
int(* processor_count_set)(void *transport_context, int processor_count)
Definition: totemnet.c:81
transport::crypto_set
int(* crypto_set)(void *transport_context, const char *cipher_type, const char *hash_type)
Definition: totemnet.c:127
transport::member_remove
int(* member_remove)(void *transport_context, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:147
transport::iface_set
int(* iface_set)(void *transport_context, const struct totem_ip_address *local, unsigned short ip_port, unsigned int ring_no)
Definition: totemnet.c:135
transport::recv_flush
int(* recv_flush)(void *transport_context)
Definition: totemnet.c:101
transport::crypto_reconfigure_phase
int(* crypto_reconfigure_phase)(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemnet.c:161
transport::token_send
int(* token_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:85
transport::ifaces_get
int(* ifaces_get)(void *transport_context, char ***status, unsigned int *iface_count)
Definition: totemnet.c:113
transport::name
const char * name
Definition: totemnet.c:50
__attribute__
typedef __attribute__
cfg_message_crypto_reconfig_phase_t
cfg_message_crypto_reconfig_phase_t
Definition: totem.h:154
totemknet_mcast_flush_send
int totemknet_mcast_flush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1351
totemknet_iface_set
int totemknet_iface_set(void *knet_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemknet.c:1461
totemknet_finalize
int totemknet_finalize(void *knet_context)
Definition: totemknet.c:664
totemknet_recv_flush
int totemknet_recv_flush(void *knet_context)
Definition: totemknet.c:1329
totemknet_processor_count_set
int totemknet_processor_count_set(void *knet_context, int processor_count)
Definition: totemknet.c:1322
totemknet_mcast_noflush_send
int totemknet_mcast_noflush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1364
totemknet_buffer_release
void totemknet_buffer_release(void *ptr)
Definition: totemknet.c:1317
totemknet_ifaces_get
int totemknet_ifaces_get(void *knet_context, char ***status, unsigned int *iface_count)
Definition: totemknet.c:569
totemknet_buffer_alloc
void * totemknet_buffer_alloc(void)
Definition: totemknet.c:1311
totemknet_member_add
int totemknet_member_add(void *knet_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int link_no)
Definition: totemknet.c:1478
totemknet_crypto_set
int totemknet_crypto_set(void *knet_context, const char *cipher_type, const char *hash_type)
Definition: totemknet.c:363
totemknet_member_remove
int totemknet_member_remove(void *knet_context, const struct totem_ip_address *token_target, int link_no)
Definition: totemknet.c:1600
totemknet_initialize
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))
Definition: totemknet.c:1059
totemknet_token_send
int totemknet_token_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1339
totemknet_nodestatus_get
int totemknet_nodestatus_get(void *knet_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemknet.c:491
totemknet_stats_clear
void totemknet_stats_clear(void *knet_context)
Definition: totemknet.c:1762
totemknet_send_flush
int totemknet_send_flush(void *knet_context)
Definition: totemknet.c:1334
totemknet_net_mtu_adjust
void totemknet_net_mtu_adjust(void *knet_context, struct totem_config *totem_config)
Definition: totemknet.c:1388
totemknet_token_target_set
int totemknet_token_target_set(void *knet_context, unsigned int nodeid)
Definition: totemknet.c:1395
totemknet_reconfigure
int totemknet_reconfigure(void *knet_context, struct totem_config *totem_config)
Definition: totemknet.c:1673
totemknet_crypto_reconfigure_phase
int totemknet_crypto_reconfigure_phase(void *knet_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemknet.c:1703
totemknet_recv_mcast_empty
int totemknet_recv_mcast_empty(void *knet_context)
Definition: totemknet.c:1409
totemknet_iface_check
int totemknet_iface_check(void *knet_context)
Definition: totemknet.c:1378
totemknet.h
log_printf
#define log_printf(level, format, args...)
Definition: totemnet.c:265
totemnet_iface_set
int totemnet_iface_set(void *net_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemnet.c:471
totemnet_member_remove
int totemnet_member_remove(void *net_context, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:553
totemnet_token_send
int totemnet_token_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:414
totemnet_send_flush
int totemnet_send_flush(void *net_context)
Definition: totemnet.c:404
totemnet_initialize
int totemnet_initialize(qb_loop_t *loop_pt, void **net_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 ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Definition: totemnet.c:317
totemnet_buffer_release
void totemnet_buffer_release(void *net_context, void *ptr)
Definition: totemnet.c:375
totemnet_mcast_flush_send
int totemnet_mcast_flush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:426
totemnet_member_add
int totemnet_member_add(void *net_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:533
totemnet_finalize
int totemnet_finalize(void *net_context)
Definition: totemnet.c:306
totemnet_crypto_set
int totemnet_crypto_set(void *net_context, const char *cipher_type, const char *hash_type)
Definition: totemnet.c:292
totemnet_ifaces_get
int totemnet_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemnet.c:497
transport_entries
struct transport transport_entries[]
Definition: totemnet.c:170
totemnet_processor_count_set
int totemnet_processor_count_set(void *net_context, int processor_count)
Definition: totemnet.c:383
totemnet_token_target_set
int totemnet_token_target_set(void *net_context, unsigned int nodeid)
Definition: totemnet.c:510
totemnet_recv_flush
int totemnet_recv_flush(void *net_context)
Definition: totemnet.c:394
totemnet_iface_check
int totemnet_iface_check(void *net_context)
Definition: totemnet.c:452
totemnet_mcast_noflush_send
int totemnet_mcast_noflush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:439
totemnet_recv_mcast_empty
int totemnet_recv_mcast_empty(void *net_context)
Definition: totemnet.c:522
totemnet_net_mtu_adjust
int totemnet_net_mtu_adjust(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:462
totemnet_nodestatus_get
int totemnet_nodestatus_get(void *net_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemnet.c:484
totemnet_stats_clear
void totemnet_stats_clear(void *net_context)
Definition: totemnet.c:619
totemnet_reconfigure
int totemnet_reconfigure(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:589
totemnet_member_set_active
int totemnet_member_set_active(void *net_context, const struct totem_ip_address *member, int active)
Definition: totemnet.c:571
totemnet_buffer_alloc
void * totemnet_buffer_alloc(void *net_context)
Definition: totemnet.c:367
totemnet_crypto_reconfigure_phase
int totemnet_crypto_reconfigure_phase(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemnet.c:603
totemnet.h
Totem Network interface - also does encryption/decryption.
system_from
struct srp_addr system_from
Definition: totemsrp.c:1
totemudp_iface_set
int totemudp_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemudp.c:1534
totemudp_net_mtu_adjust
void totemudp_net_mtu_adjust(void *udp_context, struct totem_config *totem_config)
Definition: totemudp.c:1381
totemudp_send_flush
int totemudp_send_flush(void *udp_context)
Definition: totemudp.c:1284
totemudp_iface_check
int totemudp_iface_check(void *udp_context)
Definition: totemudp.c:1327
totemudp_recv_flush
int totemudp_recv_flush(void *udp_context)
Definition: totemudp.c:1248
totemudp_nodestatus_get
int totemudp_nodestatus_get(void *udp_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemudp.c:1337
totemudp_token_target_set
int totemudp_token_target_set(void *udp_context, unsigned int nodeid)
Definition: totemudp.c:1386
totemudp_ifaces_get
int totemudp_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemudp.c:1366
totemudp_reconfigure
int totemudp_reconfigure(void *udp_context, struct totem_config *totem_config)
Definition: totemudp.c:1543
totemudp_mcast_flush_send
int totemudp_mcast_flush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1301
totemudp_finalize
int totemudp_finalize(void *udp_context)
Definition: totemudp.c:383
totemudp_recv_mcast_empty
int totemudp_recv_mcast_empty(void *udp_context)
Definition: totemudp.c:1411
totemudp_crypto_set
int totemudp_crypto_set(void *udp_context, const char *cipher_type, const char *hash_type)
Definition: totemudp.c:249
totemudp_processor_count_set
int totemudp_processor_count_set(void *udp_context, int processor_count)
Definition: totemudp.c:1226
totemudp_token_send
int totemudp_token_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1289
totemudp_mcast_noflush_send
int totemudp_mcast_noflush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1314
totemudp_member_add
int totemudp_member_add(void *udp_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemudp.c:1476
totemudp_buffer_release
void totemudp_buffer_release(void *ptr)
Definition: totemudp.c:1221
totemudp_buffer_alloc
void * totemudp_buffer_alloc(void)
Definition: totemudp.c:1216
totemudp_member_remove
int totemudp_member_remove(void *udp_context, const struct totem_ip_address *token_target, int ring_no)
Definition: totemudp.c:1500
totemudp_initialize
int totemudp_initialize(qb_loop_t *poll_handle, void **udp_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 ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
Definition: totemudp.c:1131
totemudp.h
totemudpu_buffer_release
void totemudpu_buffer_release(void *ptr)
Definition: totemudpu.c:1053
totemudpu_ifaces_get
int totemudpu_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemudpu.c:824
totemudpu_send_flush
int totemudpu_send_flush(void *udpu_context)
Definition: totemudpu.c:1087
totemudpu_token_target_set
int totemudpu_token_target_set(void *udpu_context, unsigned int nodeid)
Definition: totemudpu.c:1148
totemudpu_recv_mcast_empty
int totemudpu_recv_mcast_empty(void *udpu_context)
Definition: totemudpu.c:1174
totemudpu_processor_count_set
int totemudpu_processor_count_set(void *udpu_context, int processor_count)
Definition: totemudpu.c:1058
totemudpu_token_send
int totemudpu_token_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1094
totemudpu_iface_set
int totemudpu_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemudpu.c:1300
totemudpu_initialize
int totemudpu_initialize(qb_loop_t *poll_handle, void **udpu_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 ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
Definition: totemudpu.c:952
totemudpu_crypto_set
int totemudpu_crypto_set(void *udpu_context, const char *cipher_type, const char *hash_type)
Definition: totemudpu.c:244
totemudpu_recv_flush
int totemudpu_recv_flush(void *udpu_context)
Definition: totemudpu.c:1080
totemudpu_mcast_noflush_send
int totemudpu_mcast_noflush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1119
totemudpu_member_remove
int totemudpu_member_remove(void *udpu_context, const struct totem_ip_address *token_target, int ring_no)
Definition: totemudpu.c:1337
totemudpu_finalize
int totemudpu_finalize(void *udpu_context)
Definition: totemudpu.c:423
totemudpu_mcast_flush_send
int totemudpu_mcast_flush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1106
totemudpu_iface_check
int totemudpu_iface_check(void *udpu_context)
Definition: totemudpu.c:1132
totemudpu_buffer_alloc
void * totemudpu_buffer_alloc(void)
Definition: totemudpu.c:1048
totemudpu_reconfigure
int totemudpu_reconfigure(void *udpu_context, struct totem_config *totem_config)
Definition: totemudpu.c:1446
totemudpu_net_mtu_adjust
void totemudpu_net_mtu_adjust(void *udpu_context, struct totem_config *totem_config)
Definition: totemudpu.c:1142
totemudpu_nodestatus_get
int totemudpu_nodestatus_get(void *udpu_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemudpu.c:796
totemudpu_member_add
int totemudpu_member_add(void *udpu_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemudpu.c:1309
totemudpu.h