corosync  2.3.5-dirty
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 
102 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
103 
104 extern int totemsrp_ifaces_get (
105  void *srp_context,
106  unsigned int nodeid,
107  struct totem_ip_address *interfaces,
108  unsigned int interfaces_size,
109  char ***status,
110  unsigned int *iface_count);
111 
112 extern unsigned int totemsrp_my_nodeid_get (
113  void *srp_context);
114 
115 extern int totemsrp_my_family_get (
116  void *srp_context);
117 
118 extern int totemsrp_crypto_set (
119  void *srp_context,
120  const char *cipher_type,
121  const char *hash_type);
122 
123 extern int totemsrp_ring_reenable (
124  void *srp_context);
125 
127  void *srp_context,
128  void (*totem_service_ready) (void));
129 
130 extern int totemsrp_member_add (
131  void *srp_context,
132  const struct totem_ip_address *member,
133  int ring_no);
134 
135 extern int totemsrp_member_remove (
136  void *srp_context,
137  const struct totem_ip_address *member,
138  int ring_no);
139 
141  void *srp_context);
142 
143 void totemsrp_trans_ack (
144  void *srp_context);
145 
146 #endif /* TOTEMSRP_H_DEFINED */
int totemsrp_member_remove(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:4780
uint32_t waiting_trans_ack
Definition: totemsrp.c:519
uint32_t value
int totemsrp_ifaces_get(void *srp_context, unsigned int nodeid, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count)
Definition: totemsrp.c:1062
void totemsrp_service_ready_register(void *srp_context, void(*totem_service_ready)(void))
Definition: totemsrp.c:4758
void totemsrp_finalize(void *srp_context)
Definition: totemsrp.c:1038
totem_configuration_type
Definition: coroapi.h:110
void totemsrp_trans_ack(void *srp_context)
Definition: totemsrp.c:4800
int totemsrp_crypto_set(void *srp_context, const char *cipher_type, const char *hash_type)
Definition: totemsrp.c:1120
int totemsrp_mcast(void *srp_context, struct iovec *iovec, unsigned int iov_len, int priority)
Multicast a message.
Definition: totemsrp.c:2444
int totemsrp_avail(void *srp_context)
Return number of available messages that can be queued.
Definition: totemsrp.c:2513
unsigned int totemsrp_my_nodeid_get(void *srp_context)
Definition: totemsrp.c:1134
int totemsrp_ring_reenable(void *srp_context)
Definition: totemsrp.c:1157
void totemsrp_callback_token_destroy(void *srp_context, void **handle_out)
Definition: totemsrp.c:3447
totem_event_type
Definition: totem.h:212
totemsrp_stats_t stats
Definition: totemsrp.c:511
int totemsrp_member_add(void *srp_context, const struct totem_ip_address *member, int ring_no)
Definition: totemsrp.c:4767
void totemsrp_event_signal(void *srp_context, enum totem_event_type type, int value)
Definition: totemsrp.c:2435
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:3412
int totemsrp_my_family_get(void *srp_context)
Definition: totemsrp.c:1145
char type
Definition: totemrrp.c:518
int totemsrp_initialize(qb_loop_t *poll_handle, void **srp_context, struct totem_config *totem_config, totemmrp_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:832
unsigned int nodeid
Definition: coroapi.h:65
struct memb_ring_id ring_id
Definition: totemsrp.c:64
void totemsrp_threaded_mode_enable(void *srp_context)
Definition: totemsrp.c:4793
totem_callback_token_type
Definition: coroapi.h:117
void totemsrp_net_mtu_adjust(struct totem_config *totem_config)
Definition: totemsrp.c:4754