corosync  2.3.2
totemrrp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005 MontaVista Software, Inc.
3  * Copyright (c) 2006-2007, 2009 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 TOTEMRRP_H_DEFINED
44 #define TOTEMRRP_H_DEFINED
45 
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <qb/qbloop.h>
49 #include <corosync/totem/totem.h>
50 
51 #define TOTEMRRP_NOFLUSH 0
52 #define TOTEMRRP_FLUSH 1
53 
57 extern int totemrrp_initialize (
58  qb_loop_t *poll_handle,
59  void **rrp_context,
60  struct totem_config *totem_config,
62  void *context,
63 
64  void (*deliver_fn) (
65  void *context,
66  const void *msg,
67  unsigned int msg_len),
68 
69  void (*iface_change_fn) (
70  void *context,
71  const struct totem_ip_address *iface_addr,
72  unsigned int iface_no),
73 
74  void (*token_seqid_get) (
75  const void *msg,
76  unsigned int *seqid,
77  unsigned int *token_is),
78 
79  unsigned int (*msgs_missing) (void),
80 
81  void (*target_set_completed) (
82  void *context)
83  );
84 
85 extern void *totemrrp_buffer_alloc (
86  void *rrp_context);
87 
88 extern void totemrrp_buffer_release (
89  void *rrp_context,
90  void *ptr);
91 
93  void *rrp_context,
94  unsigned int processor_count);
95 
96 extern int totemrrp_token_send (
97  void *rrp_context,
98  const void *msg,
99  unsigned int msg_len);
100 
101 extern int totemrrp_mcast_noflush_send (
102  void *rrp_context,
103  const void *msg,
104  unsigned int msg_len);
105 
106 extern int totemrrp_mcast_flush_send (
107  void *rrp_context,
108  const void *msg,
109  unsigned int msg_len);
110 
111 extern int totemrrp_recv_flush (
112  void *rrp_context);
113 
114 extern int totemrrp_send_flush (
115  void *rrp_context);
116 
117 extern int totemrrp_token_target_set (
118  void *rrp_context,
119  struct totem_ip_address *target,
120  unsigned int iface_no);
121 
122 extern int totemrrp_iface_check (void *rrp_context);
123 
124 extern int totemrrp_finalize (void *rrp_context);
125 
126 extern int totemrrp_ifaces_get (
127  void *rrp_context,
128  char ***status,
129  unsigned int *iface_count);
130 
131 extern int totemrrp_crypto_set (
132  void *rrp_context,
133  const char *cipher_type,
134  const char *hash_type);
135 
136 extern int totemrrp_ring_reenable (
137  void *rrp_context,
138  unsigned int iface_no);
139 
140 extern int totemrrp_mcast_recv_empty (
141  void *rrp_context);
142 
143 extern int totemrrp_member_add (
144  void *net_context,
145  const struct totem_ip_address *member,
146  int iface_no);
147 
148 extern int totemrrp_member_remove (
149  void *net_context,
150  const struct totem_ip_address *member,
151  int iface_no);
152 
153 #endif /* TOTEMRRP_H_DEFINED */