corosync
2.4.5
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
include
corosync
totem
totempg.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 TOTEMPG_H_DEFINED
44
#define TOTEMPG_H_DEFINED
45
46
#ifdef __cplusplus
47
extern
"C"
{
48
#endif
49
50
#include <sys/types.h>
51
#include <netinet/in.h>
52
#include "
totem.h
"
53
#include <qb/qbloop.h>
54
55
struct
totempg_group
{
56
const
void
*
group
;
57
size_t
group_len
;
58
};
59
60
#define TOTEMPG_AGREED 0
61
#define TOTEMPG_SAFE 1
62
66
extern
int
totempg_initialize
(
67
qb_loop_t* poll_handle,
68
struct
totem_config
*
totem_config
69
);
70
71
extern
void
totempg_finalize
(
void
);
72
73
extern
int
totempg_callback_token_create
(
void
**handle_out,
74
enum
totem_callback_token_type
type
,
75
int
delete
,
76
int
(*callback_fn) (
enum
totem_callback_token_type
type,
const
void
*),
77
const
void
*data);
78
79
extern
void
totempg_callback_token_destroy
(
void
*handle);
80
84
extern
int
totempg_groups_initialize
(
85
void
**instance,
86
87
void
(*deliver_fn) (
88
unsigned
int
nodeid
,
89
const
void
*msg,
90
unsigned
int
msg_len,
91
int
endian_conversion_required),
92
93
void
(*confchg_fn) (
94
enum
totem_configuration_type
configuration_type,
95
const
unsigned
int
*member_list,
size_t
member_list_entries,
96
const
unsigned
int
*left_list,
size_t
left_list_entries,
97
const
unsigned
int
*joined_list,
size_t
joined_list_entries,
98
const
struct
memb_ring_id
*
ring_id
));
99
100
extern
int
totempg_groups_finalize
(
void
*instance);
101
102
extern
int
totempg_groups_join
(
103
void
*instance,
104
const
struct
totempg_group
*groups,
105
size_t
group_cnt);
106
107
extern
int
totempg_groups_leave
(
108
void
*instance,
109
const
struct
totempg_group
*groups,
110
size_t
group_cnt);
111
112
extern
int
totempg_groups_mcast_joined
(
113
void
*instance,
114
const
struct
iovec *iovec,
115
unsigned
int
iov_len,
116
int
guarantee
);
117
118
extern
int
totempg_groups_joined_reserve
(
119
void
*instance,
120
const
struct
iovec *iovec,
121
unsigned
int
iov_len);
122
123
extern
int
totempg_groups_joined_release
(
124
int
msg_count);
125
126
extern
int
totempg_groups_mcast_groups
(
127
void
*instance,
128
int
guarantee
,
129
const
struct
totempg_group
*groups,
130
size_t
groups_cnt,
131
const
struct
iovec *iovec,
132
unsigned
int
iov_len);
133
134
extern
int
totempg_groups_send_ok_groups
(
135
void
*instance,
136
const
struct
totempg_group
*groups,
137
size_t
groups_cnt,
138
const
struct
iovec *iovec,
139
unsigned
int
iov_len);
140
141
extern
int
totempg_ifaces_get
(
142
unsigned
int
nodeid,
143
struct
totem_ip_address
*interfaces,
144
unsigned
int
interfaces_size,
145
char
***status,
146
unsigned
int
*iface_count);
147
148
extern
void
*
totempg_get_stats
(
void
);
149
150
void
totempg_event_signal
(
enum
totem_event_type
type,
int
value
);
151
152
extern
const
char
*
totempg_ifaces_print
(
unsigned
int
nodeid);
153
154
extern
unsigned
int
totempg_my_nodeid_get
(
void
);
155
156
extern
int
totempg_my_family_get
(
void
);
157
158
extern
int
totempg_crypto_set
(
const
char
*cipher_type,
const
char
*hash_type);
159
160
extern
int
totempg_ring_reenable
(
void
);
161
162
extern
void
totempg_service_ready_register
(
163
void
(*totem_service_ready) (
void
));
164
165
extern
int
totempg_member_add
(
166
const
struct
totem_ip_address
*member,
167
int
ring_no);
168
169
extern
int
totempg_member_remove
(
170
const
struct
totem_ip_address
*member,
171
int
ring_no);
172
173
enum
totem_q_level
{
174
TOTEM_Q_LEVEL_LOW
,
175
TOTEM_Q_LEVEL_GOOD
,
176
TOTEM_Q_LEVEL_HIGH
,
177
TOTEM_Q_LEVEL_CRITICAL
178
};
179
180
void
totempg_check_q_level
(
void
*instance);
181
182
typedef
void (*
totem_queue_level_changed_fn
) (
enum
totem_q_level
level);
183
extern
void
totempg_queue_level_register_callback
(
totem_queue_level_changed_fn
);
184
185
extern
void
totempg_threaded_mode_enable
(
void
);
186
187
extern
void
totempg_trans_ack
(
void
);
188
189
#ifdef __cplusplus
190
}
191
#endif
192
193
#endif
/* TOTEMPG_H_DEFINED */
Generated on Sun Apr 5 2020 18:06:22 for corosync by
1.8.3.1