corosync
2.3.2
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
include
corosync
totem
totem.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 MontaVista Software, Inc.
3
* Copyright (c) 2006-2012 Red Hat, Inc.
4
*
5
* Author: Steven Dake (sdake@redhat.com)
6
*
7
* All rights reserved.
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
#ifndef TOTEM_H_DEFINED
36
#define TOTEM_H_DEFINED
37
#include "
totemip.h
"
38
#include <
corosync/hdb.h
>
39
40
#ifdef HAVE_SMALL_MEMORY_FOOTPRINT
41
#define PROCESSOR_COUNT_MAX 16
42
#define MESSAGE_SIZE_MAX 1024*64
43
#define MESSAGE_QUEUE_MAX 512
44
#else
45
#define PROCESSOR_COUNT_MAX 384
46
#define MESSAGE_SIZE_MAX 1024*1024
/* (1MB) */
47
#define MESSAGE_QUEUE_MAX ((4 * MESSAGE_SIZE_MAX) / totem_config->net_mtu)
48
#endif
/* HAVE_SMALL_MEMORY_FOOTPRINT */
49
50
#define FRAME_SIZE_MAX 10000
51
#define TRANSMITS_ALLOWED 16
52
#define SEND_THREADS_MAX 16
53
#define INTERFACE_MAX 2
54
58
#define MAX_NO_CONT_GATHER 3
59
/*
60
* Maximum number of continuous failures get from sendmsg call
61
*/
62
#define MAX_NO_CONT_SENDMSG_FAILURES 30
63
64
struct
totem_interface
{
65
struct
totem_ip_address
bindnet
;
66
struct
totem_ip_address
boundto
;
67
struct
totem_ip_address
mcast_addr
;
68
uint16_t
ip_port
;
69
uint16_t
ttl
;
70
int
member_count
;
71
struct
totem_ip_address
member_list
[
PROCESSOR_COUNT_MAX
];
72
};
73
74
struct
totem_logging_configuration
{
75
void (*
log_printf
) (
76
int
level,
77
int
subsys,
78
const
char
*function_name,
79
const
char
*file_name,
80
int
file_line,
81
const
char
*format,
82
...)
__attribute__
((format(printf, 6, 7)));
83
84
int
log_level_security
;
85
int
log_level_error
;
86
int
log_level_warning
;
87
int
log_level_notice
;
88
int
log_level_debug
;
89
int
log_level_trace
;
90
int
log_subsys_id
;
91
};
92
93
enum
{
TOTEM_PRIVATE_KEY_LEN
= 128 };
94
enum
{
TOTEM_RRP_MODE_BYTES
= 64 };
95
96
typedef
enum
{
97
TOTEM_TRANSPORT_UDP
= 0,
98
TOTEM_TRANSPORT_UDPU
= 1,
99
TOTEM_TRANSPORT_RDMA
= 2
100
}
totem_transport_t
;
101
102
struct
totem_config
{
103
int
version
;
104
105
/*
106
* network
107
*/
108
struct
totem_interface
*
interfaces
;
109
unsigned
int
interface_count
;
110
unsigned
int
node_id
;
111
unsigned
int
clear_node_high_bit
;
112
113
/*
114
* key information
115
*/
116
unsigned
char
private_key
[
TOTEM_PRIVATE_KEY_LEN
];
117
118
unsigned
int
private_key_len
;
119
120
/*
121
* Totem configuration parameters
122
*/
123
unsigned
int
token_timeout
;
124
125
unsigned
int
token_retransmit_timeout
;
126
127
unsigned
int
token_hold_timeout
;
128
129
unsigned
int
token_retransmits_before_loss_const
;
130
131
unsigned
int
join_timeout
;
132
133
unsigned
int
send_join_timeout
;
134
135
unsigned
int
consensus_timeout
;
136
137
unsigned
int
merge_timeout
;
138
139
unsigned
int
downcheck_timeout
;
140
141
unsigned
int
fail_to_recv_const
;
142
143
unsigned
int
seqno_unchanged_const
;
144
145
unsigned
int
rrp_token_expired_timeout
;
146
147
unsigned
int
rrp_problem_count_timeout
;
148
149
unsigned
int
rrp_problem_count_threshold
;
150
151
unsigned
int
rrp_problem_count_mcast_threshold
;
152
153
unsigned
int
rrp_autorecovery_check_timeout
;
154
155
char
rrp_mode
[
TOTEM_RRP_MODE_BYTES
];
156
157
struct
totem_logging_configuration
totem_logging_configuration
;
158
159
unsigned
int
net_mtu
;
160
161
unsigned
int
threads
;
162
163
unsigned
int
heartbeat_failures_allowed
;
164
165
unsigned
int
max_network_delay
;
166
167
unsigned
int
window_size
;
168
169
unsigned
int
max_messages
;
170
171
const
char
*
vsf_type
;
172
173
unsigned
int
broadcast_use
;
174
175
char
*
crypto_cipher_type
;
176
177
char
*
crypto_hash_type
;
178
179
totem_transport_t
transport_number
;
180
181
unsigned
int
miss_count_const
;
182
183
int
ip_version
;
184
};
185
186
#define TOTEM_CONFIGURATION_TYPE
187
enum
totem_configuration_type
{
188
TOTEM_CONFIGURATION_REGULAR
,
189
TOTEM_CONFIGURATION_TRANSITIONAL
190
};
191
192
#define TOTEM_CALLBACK_TOKEN_TYPE
193
enum
totem_callback_token_type
{
194
TOTEM_CALLBACK_TOKEN_RECEIVED
= 1,
195
TOTEM_CALLBACK_TOKEN_SENT
= 2
196
};
197
198
enum
totem_event_type
{
199
TOTEM_EVENT_DELIVERY_CONGESTED
,
200
TOTEM_EVENT_NEW_MSG
,
201
};
202
203
#define MEMB_RING_ID
204
struct
memb_ring_id
{
205
struct
totem_ip_address
rep;
206
unsigned
long
long
seq
;
207
}
__attribute__
((packed));
208
209
typedef
struct
{
210
int
is_dirty
;
211
time_t
last_updated
;
212
}
totem_stats_header_t
;
213
214
typedef
struct
{
215
totem_stats_header_t
hdr
;
216
uint32_t
iface_changes
;
217
}
totemnet_stats_t
;
218
219
typedef
struct
{
220
totem_stats_header_t
hdr
;
221
totemnet_stats_t
*
net
;
222
char
*
algo_name
;
223
uint8_t *
faulty
;
224
uint32_t
interface_count
;
225
}
totemrrp_stats_t
;
226
227
228
typedef
struct
{
229
uint32_t
rx
;
230
uint32_t
tx
;
231
int
backlog_calc
;
232
}
totemsrp_token_stats_t
;
233
234
typedef
struct
{
235
totem_stats_header_t
hdr
;
236
totemrrp_stats_t
*
rrp
;
237
uint64_t
orf_token_tx
;
238
uint64_t
orf_token_rx
;
239
uint64_t
memb_merge_detect_tx
;
240
uint64_t
memb_merge_detect_rx
;
241
uint64_t
memb_join_tx
;
242
uint64_t
memb_join_rx
;
243
uint64_t
mcast_tx
;
244
uint64_t
mcast_retx
;
245
uint64_t
mcast_rx
;
246
uint64_t
memb_commit_token_tx
;
247
uint64_t
memb_commit_token_rx
;
248
uint64_t
token_hold_cancel_tx
;
249
uint64_t
token_hold_cancel_rx
;
250
uint64_t
operational_entered
;
251
uint64_t
operational_token_lost
;
252
uint64_t
gather_entered
;
253
uint64_t
gather_token_lost
;
254
uint64_t
commit_entered
;
255
uint64_t
commit_token_lost
;
256
uint64_t
recovery_entered
;
257
uint64_t
recovery_token_lost
;
258
uint64_t
consensus_timeouts
;
259
uint64_t
rx_msg_dropped
;
260
uint32_t
continuous_gather
;
261
uint32_t
continuous_sendmsg_failures
;
262
263
int
earliest_token
;
264
int
latest_token
;
265
#define TOTEM_TOKEN_STATS_MAX 100
266
totemsrp_token_stats_t
token[
TOTEM_TOKEN_STATS_MAX
];
267
268
}
totemsrp_stats_t
;
269
270
271
#define TOTEM_CONFIGURATION_TYPE
272
273
typedef
struct
{
274
totem_stats_header_t
hdr
;
275
totemsrp_stats_t
*
srp
;
276
}
totemmrp_stats_t
;
277
278
typedef
struct
{
279
totem_stats_header_t
hdr
;
280
totemmrp_stats_t
*
mrp
;
281
uint32_t
msg_reserved
;
282
uint32_t
msg_queue_avail
;
283
}
totempg_stats_t
;
284
285
#endif
/* TOTEM_H_DEFINED */
Generated on Mon Feb 3 2014 11:07:20 for corosync by
1.8.3.1