corosync  3.1.5
totemsrp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-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 TOTEMSRP_H_DEFINED
44 #define TOTEMSRP_H_DEFINED
45 
46 #include <corosync/totem/totem.h>
47 #include <qb/qbloop.h>
48 
53  qb_loop_t *poll_handle,
54  void **srp_context,
55  struct totem_config *totem_config,
56  totempg_stats_t *stats,
57 
58  void (*deliver_fn) (
59  unsigned int nodeid,
60  const void *msg,
61  unsigned int msg_len,
62  int endian_conversion_required),
63  void (*confchg_fn) (
64  enum totem_configuration_type configuration_type,
65  const unsigned int *member_list, size_t member_list_entries,
66  const unsigned int *left_list, size_t left_list_entries,
67  const unsigned int *joined_list, size_t joined_list_entries,
68  const struct memb_ring_id *ring_id),
69  void (*waiting_trans_ack_cb_fn) (
70  int waiting_trans_ack));
71 
72 void totemsrp_finalize (void *srp_context);
73 
77 int totemsrp_mcast (
78  void *srp_context,
79  struct iovec *iovec,
80  unsigned int iov_len,
81  int priority);
82 
86 int totemsrp_avail (void *srp_context);
87 
89  void *srp_context,
90  void **handle_out,
92  int delete,
93  int (*callback_fn) (enum totem_callback_token_type type, const void *),
94  const void *data);
95 
97  void *srp_context,
98  void **handle_out);
99 
100 void totemsrp_event_signal (void *srp_context, enum totem_event_type type, int value);
101 
103 
104 extern int totemsrp_nodestatus_get (void *srp_context, unsigned int nodeid,
105  struct totem_node_status *node_status);
106 
107 extern int totemsrp_ifaces_get (
108  void *srp_context,
109  unsigned int nodeid,
110  unsigned int *interface_id,
111  struct totem_ip_address *interfaces,
112  unsigned int interfaces_size,
113  char ***status,
114  unsigned int *iface_count);
115 
116 extern unsigned int totemsrp_my_nodeid_get (
117  void *srp_context);
118 
119 extern int totemsrp_my_family_get (
120  void *srp_context);
121 
122 extern int totemsrp_crypto_set (
123  void *srp_context,
124  const char *cipher_type,
125  const char *hash_type);
126 
128  void *srp_context,
129  void (*totem_service_ready) (void));
130 
131 extern int totemsrp_iface_set (
132  void *srp_context,
133  const struct totem_ip_address *interface_addr,
134  unsigned short ip_port,
135  unsigned int iface_no);
136 
137 extern int totemsrp_member_add (
138  void *srp_context,
139  const struct totem_ip_address *member,
140  int ring_no);
141 
142 extern int totemsrp_member_remove (
143  void *srp_context,
144  const struct totem_ip_address *member,
145  int ring_no);
146 
148  void *srp_context);
149 
150 void totemsrp_trans_ack (
151  void *srp_context);
152 
154  void *context,
155  struct totem_config *totem_config);
156 
158  void *context,
159  struct totem_config *totem_config,
161 
163  void *srp_context, int flags);
164 
166  void *context);
167 
168 #endif /* TOTEMSRP_H_DEFINED */
totem_configuration_type
The totem_configuration_type enum.
Definition: coroapi.h:132
unsigned int nodeid
Definition: coroapi.h:0
totem_callback_token_type
The totem_callback_token_type enum.
Definition: coroapi.h:142
uint32_t flags
uint32_t value
The memb_ring_id struct.
Definition: coroapi.h:122
The totem_ip_address struct.
Definition: coroapi.h:111
totem_event_type
Definition: totem.h:289
cfg_message_crypto_reconfig_phase_t
Definition: totem.h:154
char type
Definition: totem.h:2
struct memb_ring_id ring_id
Definition: totemsrp.c:4
int totemsrp_my_family_get(void *srp_context)
Definition: totemsrp.c:1134
int totemsrp_member_remove(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:5190
int totemsrp_iface_set(void *srp_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemsrp.c:5086
void totemsrp_force_gather(void *context)
Definition: totemsrp.c:5247
void totemsrp_stats_clear(void *srp_context, int flags)
Definition: totemsrp.c:5237
int totemsrp_member_add(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:5177
int totemsrp_initialize(qb_loop_t *poll_handle, void **srp_context, 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))
Create a protocol instance.
Definition: totemsrp.c:819
int totemsrp_callback_token_create(void *srp_context, 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: totemsrp.c:3496
void totemsrp_trans_ack(void *srp_context)
Definition: totemsrp.c:5210
void totemsrp_net_mtu_adjust(struct totem_config *totem_config)
Definition: totemsrp.c:5164
int totemsrp_nodestatus_get(void *srp_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemsrp.c:1042
void totemsrp_threaded_mode_enable(void *srp_context)
Definition: totemsrp.c:5203
int totemsrp_crypto_set(void *srp_context, const char *cipher_type, const char *hash_type)
Definition: totemsrp.c:1109
int totemsrp_avail(void *srp_context)
Return number of available messages that can be queued.
Definition: totemsrp.c:2569
void totemsrp_service_ready_register(void *srp_context, void(*totem_service_ready)(void))
Definition: totemsrp.c:5168
void totemsrp_finalize(void *srp_context)
Definition: totemsrp.c:1027
int totemsrp_crypto_reconfigure_phase(void *context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemsrp.c:5228
unsigned int totemsrp_my_nodeid_get(void *srp_context)
Definition: totemsrp.c:1123
void totemsrp_event_signal(void *srp_context, enum totem_event_type type, int value)
Definition: totemsrp.c:2489
void totemsrp_callback_token_destroy(void *srp_context, void **handle_out)
Definition: totemsrp.c:3531
int totemsrp_mcast(void *srp_context, struct iovec *iovec, unsigned int iov_len, int priority)
Multicast a message.
Definition: totemsrp.c:2498
int totemsrp_ifaces_get(void *srp_context, unsigned int nodeid, unsigned int *interface_id, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count)
Definition: totemsrp.c:1071
int totemsrp_reconfigure(void *context, struct totem_config *totem_config)
Definition: totemsrp.c:5219