corosync  3.0.3
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,
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_ifaces_get (
105  void *srp_context,
106  unsigned int nodeid,
107  unsigned int *interface_id,
108  struct totem_ip_address *interfaces,
109  unsigned int interfaces_size,
110  char ***status,
111  unsigned int *iface_count);
112 
113 extern unsigned int totemsrp_my_nodeid_get (
114  void *srp_context);
115 
116 extern int totemsrp_my_family_get (
117  void *srp_context);
118 
119 extern int totemsrp_crypto_set (
120  void *srp_context,
121  const char *cipher_type,
122  const char *hash_type);
123 
125  void *srp_context,
126  void (*totem_service_ready) (void));
127 
128 extern int totemsrp_iface_set (
129  void *srp_context,
130  const struct totem_ip_address *interface_addr,
131  unsigned short ip_port,
132  unsigned int iface_no);
133 
134 extern int totemsrp_member_add (
135  void *srp_context,
136  const struct totem_ip_address *member,
137  int ring_no);
138 
139 extern int totemsrp_member_remove (
140  void *srp_context,
141  const struct totem_ip_address *member,
142  int ring_no);
143 
145  void *srp_context);
146 
147 void totemsrp_trans_ack (
148  void *srp_context);
149 
151  void *context,
152  struct totem_config *totem_config);
153 
155  void *srp_context, int flags);
156 
158  void *context);
159 
160 #endif /* TOTEMSRP_H_DEFINED */
totem.h
totem_callback_token_type
totem_callback_token_type
The totem_callback_token_type enum.
Definition: coroapi.h:142
value
uint32_t value
Definition: exec/votequorum.c:2
totem_configuration_type
totem_configuration_type
The totem_configuration_type enum.
Definition: coroapi.h:132
totemsrp_mcast
int totemsrp_mcast(void *srp_context, struct iovec *iovec, unsigned int iov_len, int priority)
Multicast a message.
Definition: totemsrp.c:2456
totemsrp_my_family_get
int totemsrp_my_family_get(void *srp_context)
Definition: totemsrp.c:1110
totemsrp_callback_token_create
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:3454
type
char type
Definition: totem.h:2
totemsrp_event_signal
void totemsrp_event_signal(void *srp_context, enum totem_event_type type, int value)
Definition: totemsrp.c:2447
totempg_stats_t
Definition: totemstats.h:94
totemsrp_crypto_set
int totemsrp_crypto_set(void *srp_context, const char *cipher_type, const char *hash_type)
Definition: totemsrp.c:1085
totemsrp_threaded_mode_enable
void totemsrp_threaded_mode_enable(void *srp_context)
Definition: totemsrp.c:5154
totemsrp_instance::stats
totemsrp_stats_t stats
Definition: totemsrp.c:513
totemsrp_ifaces_get
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:1047
totemsrp_avail
int totemsrp_avail(void *srp_context)
Return number of available messages that can be queued.
Definition: totemsrp.c:2527
flags
uint32_t flags
Definition: exec/votequorum.c:4
totem_config
Definition: totem.h:152
totemsrp_net_mtu_adjust
void totemsrp_net_mtu_adjust(struct totem_config *totem_config)
Definition: totemsrp.c:5115
totemsrp_my_nodeid_get
unsigned int totemsrp_my_nodeid_get(void *srp_context)
Definition: totemsrp.c:1099
totemsrp_stats_clear
void totemsrp_stats_clear(void *srp_context, int flags)
Definition: totemsrp.c:5179
totem_ip_address
The totem_ip_address struct.
Definition: coroapi.h:111
totemsrp_initialize
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:816
memb_ring_id
The memb_ring_id struct.
Definition: coroapi.h:122
totemsrp_member_remove
int totemsrp_member_remove(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:5141
totemsrp_finalize
void totemsrp_finalize(void *srp_context)
Definition: totemsrp.c:1024
totem_event_type
totem_event_type
Definition: totem.h:259
totemsrp_iface_set
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:5039
nodeid
unsigned int nodeid
Definition: coroapi.h:0
ring_id
struct memb_ring_id ring_id
Definition: totemsrp.c:4
totemsrp_callback_token_destroy
void totemsrp_callback_token_destroy(void *srp_context, void **handle_out)
Definition: totemsrp.c:3489
totemsrp_trans_ack
void totemsrp_trans_ack(void *srp_context)
Definition: totemsrp.c:5161
totemsrp_force_gather
void totemsrp_force_gather(void *context)
Definition: totemsrp.c:5189
totemsrp_service_ready_register
void totemsrp_service_ready_register(void *srp_context, void(*totem_service_ready)(void))
Definition: totemsrp.c:5119
totemsrp_reconfigure
int totemsrp_reconfigure(void *context, struct totem_config *totem_config)
Definition: totemsrp.c:5170
totemsrp_member_add
int totemsrp_member_add(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:5128
totemsrp_instance::waiting_trans_ack
uint32_t waiting_trans_ack
Definition: totemsrp.c:521