corosync  2.4.6
totemmrp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005 MontaVista Software, Inc.
3  * Copyright (c) 2006-2011 Red Hat, Inc.
4  *
5  * All rights reserved.
6  *
7  * Author: Steven Dake (sdake@redhat.com)
8  *
9  * This software licensed under BSD license, the text of which follows:
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *
14  * - Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * - Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  * - Neither the name of the MontaVista Software, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived from this
21  * software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33  * THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
43 #ifndef TOTEMMRP_H_DEFINED
44 #define TOTEMMRP_H_DEFINED
45 
46 #include <corosync/totem/totem.h>
47 
51 extern void totemmrp_log_printf_init (
52  void (*log_printf) (int , char *, ...),
53  int log_level_security,
54  int log_level_error,
55  int log_level_warning,
56  int log_level_notice,
57  int log_level_debug);
58 
62 extern int totemmrp_initialize (
63  qb_loop_t *poll_handle,
64  struct totem_config *totem_config,
65  totempg_stats_t *stats,
66 
67  void (*deliver_fn) (
68  unsigned int nodeid,
69  const void *msg,
70  unsigned int msg_len,
71  int endian_conversion_required),
72  void (*confchg_fn) (
73  enum totem_configuration_type configuration_type,
74  const unsigned int *member_list, size_t member_list_entries,
75  const unsigned int *left_list, size_t left_list_entries,
76  const unsigned int *joined_list, size_t joined_list_entries,
77  const struct memb_ring_id *ring_id),
78  void (*waiting_trans_ack_cb_fn) (
79  int waiting_trans_ack));
80 
81 extern void totemmrp_finalize (void);
82 
86 extern int totemmrp_mcast (
87  struct iovec *iovec,
88  unsigned int iov_len,
89  int priority);
90 
94 extern int totemmrp_avail (void);
95 
97  void **handle_out,
99  int delete,
100  int (*callback_fn) (enum totem_callback_token_type type, const void *),
101  const void *data);
102 
104  void *handle_out);
105 
106 extern void totemmrp_event_signal (enum totem_event_type type, int value);
107 
108 extern int totemmrp_ifaces_get (
109  unsigned int nodeid,
110  struct totem_ip_address *interfaces,
111  unsigned int interfaces_size,
112  char ***status,
113  unsigned int *iface_count);
114 
115 extern unsigned int totemmrp_my_nodeid_get (void);
116 
117 extern int totemmrp_my_family_get (void);
118 
119 extern int totemmrp_crypto_set (const char *cipher_type, const char *hash_type);
120 
121 extern int totemmrp_ring_reenable (void);
122 
124  void (*totem_service_ready) (void));
125 
126 extern int totemmrp_member_add (
127  const struct totem_ip_address *member,
128  int ring_no);
129 
130 extern int totemmrp_member_remove (
131  const struct totem_ip_address *member,
132  int ring_no);
133 
135 
136 void totemmrp_trans_ack (void);
137 
138 #endif /* TOTEMMRP_H_DEFINED */
int totemmrp_avail(void)
Return number of available messages that can be queued.
Definition: totemmrp.c:173
int totemmrp_crypto_set(const char *cipher_type, const char *hash_type)
Definition: totemmrp.c:219
void totemmrp_trans_ack(void)
Definition: totemmrp.c:283
uint32_t value
int totemmrp_member_add(const struct totem_ip_address *member, int ring_no)
Definition: totemmrp.c:256
The totem_ip_address struct.
Definition: coroapi.h:111
int totemmrp_my_family_get(void)
Definition: totemmrp.c:233
void totemmrp_threaded_mode_enable(void)
Definition: totemmrp.c:278
totem_configuration_type
The totem_configuration_type enum.
Definition: coroapi.h:132
void totemmrp_event_signal(enum totem_event_type type, int value)
Definition: totemmrp.c:194
int totemmrp_member_remove(const struct totem_ip_address *member, int ring_no)
Definition: totemmrp.c:267
#define log_printf(level, format, args...)
Definition: logsys.h:320
int totemmrp_ring_reenable(void)
Definition: totemmrp.c:238
void totemmrp_log_printf_init(void(*log_printf)(int, char *,...), int log_level_security, int log_level_error, int log_level_warning, int log_level_notice, int log_level_debug)
Initialize the logger.
totem_event_type
Definition: totem.h:219
void totemmrp_service_ready_register(void(*totem_service_ready)(void))
Definition: totemmrp.c:248
The memb_ring_id struct.
Definition: coroapi.h:122
int totemmrp_callback_token_create(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)
Definition: totemmrp.c:178
int totemmrp_initialize(qb_loop_t *poll_handle, 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))
Initialize the group messaging interface.
Definition: totemmrp.c:118
unsigned int totemmrp_my_nodeid_get(void)
Definition: totemmrp.c:228
char type
Definition: totemrrp.c:518
int totemmrp_mcast(struct iovec *iovec, unsigned int iov_len, int priority)
Multicast a message.
Definition: totemmrp.c:162
int totemmrp_ifaces_get(unsigned int nodeid, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count)
Definition: totemmrp.c:199
unsigned int nodeid
Definition: coroapi.h:75
struct memb_ring_id ring_id
Definition: totemsrp.c:64
void totemmrp_callback_token_destroy(void *handle_out)
Definition: totemmrp.c:188
totem_callback_token_type
The totem_callback_token_type enum.
Definition: coroapi.h:142
void totemmrp_finalize(void)
Definition: totemmrp.c:154