corosync
totemnet.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 MontaVista Software, Inc.
3 * Copyright (c) 2006-2018 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
36#include <config.h>
37
38#include <assert.h>
39
40#ifdef ENABLE_UDPU
41#include <totemudp.h>
42#include <totemudpu.h>
43#endif
44#include <totemknet.h>
45#include <totemnet.h>
46#include <qb/qbloop.h>
47
48#define LOGSYS_UTILS_ONLY 1
49#include <corosync/logsys.h>
50
51struct transport {
52 const char *name;
53
56 void **transport_instance,
58 totemsrp_stats_t *stats,
59 void *context,
60
61 int (*deliver_fn) (
62 void *context,
63 const void *msg,
64 unsigned int msg_len,
65 const struct sockaddr_storage *system_from),
66
67 int (*iface_change_fn) (
68 void *context,
69 const struct totem_ip_address *iface_address,
70 unsigned int ring_no),
71
72 void (*mtu_changed) (
73 void *context,
74 int net_mtu),
75
76 void (*target_set_completed) (
77 void *context));
78
79 void *(*buffer_alloc) (void);
80
82
84 void *transport_context,
85 int processor_count);
86
88 void *transport_context,
89 const void *msg,
90 unsigned int msg_len);
91
93 void *transport_context,
94 const void *msg,
95 unsigned int msg_len);
96
97
99 void *transport_context,
100 const void *msg,
101 unsigned int msg_len);
102
103 int (*recv_flush) (void *transport_context);
104
105 int (*send_flush) (void *transport_context);
106
107 int (*iface_check) (void *transport_context);
108
109 int (*finalize) (void *transport_context);
110
111 void (*net_mtu_adjust) (void *transport_context, struct totem_config *totem_config);
112
113 const char *(*iface_print) (void *transport_context);
114
116 void *transport_context,
117 char ***status,
118 unsigned int *iface_count);
119
121 void *transport_context,
122 unsigned int nodeid,
124
126 void *transport_context,
127 unsigned int nodeid);
128
130 void *transport_context,
131 const char *cipher_type,
132 const char *hash_type);
133
135 void *transport_context);
136
138 void *transport_context,
139 const struct totem_ip_address *local,
140 unsigned short ip_port,
141 unsigned int ring_no);
142
144 void *transport_context,
145 const struct totem_ip_address *local,
146 const struct totem_ip_address *member,
147 int ring_no);
148
150 void *transport_context,
151 const struct totem_ip_address *member,
152 int ring_no);
153
155 void *transport_context,
156 const struct totem_ip_address *member,
157 int active);
158
160 void *net_context,
161 struct totem_config *totem_config);
162
164 void *net_context,
167
169 void *net_context);
170};
171
173#ifdef ENABLE_UDPU
174 {
175 .name = "UDP/IP Multicast",
176 .initialize = totemudp_initialize,
177 .buffer_alloc = totemudp_buffer_alloc,
178 .buffer_release = totemudp_buffer_release,
179 .processor_count_set = totemudp_processor_count_set,
180 .token_send = totemudp_token_send,
181 .mcast_flush_send = totemudp_mcast_flush_send,
182 .mcast_noflush_send = totemudp_mcast_noflush_send,
183 .recv_flush = totemudp_recv_flush,
184 .send_flush = totemudp_send_flush,
185 .iface_set = totemudp_iface_set,
186 .iface_check = totemudp_iface_check,
187 .finalize = totemudp_finalize,
188 .net_mtu_adjust = totemudp_net_mtu_adjust,
189 .ifaces_get = totemudp_ifaces_get,
190 .nodestatus_get = totemudp_nodestatus_get,
191 .token_target_set = totemudp_token_target_set,
192 .crypto_set = totemudp_crypto_set,
193 .recv_mcast_empty = totemudp_recv_mcast_empty,
194 .member_add = totemudp_member_add,
195 .member_remove = totemudp_member_remove,
196 .reconfigure = totemudp_reconfigure,
197 .crypto_reconfigure_phase = NULL
198 },
199 {
200 .name = "UDP/IP Unicast",
201 .initialize = totemudpu_initialize,
202 .buffer_alloc = totemudpu_buffer_alloc,
203 .buffer_release = totemudpu_buffer_release,
204 .processor_count_set = totemudpu_processor_count_set,
205 .token_send = totemudpu_token_send,
206 .mcast_flush_send = totemudpu_mcast_flush_send,
207 .mcast_noflush_send = totemudpu_mcast_noflush_send,
208 .recv_flush = totemudpu_recv_flush,
209 .send_flush = totemudpu_send_flush,
210 .iface_set = totemudpu_iface_set,
211 .iface_check = totemudpu_iface_check,
212 .finalize = totemudpu_finalize,
213 .net_mtu_adjust = totemudpu_net_mtu_adjust,
214 .ifaces_get = totemudpu_ifaces_get,
215 .nodestatus_get = totemudpu_nodestatus_get,
216 .token_target_set = totemudpu_token_target_set,
217 .crypto_set = totemudpu_crypto_set,
218 .recv_mcast_empty = totemudpu_recv_mcast_empty,
219 .member_add = totemudpu_member_add,
220 .member_remove = totemudpu_member_remove,
221 .reconfigure = totemudpu_reconfigure,
222 .crypto_reconfigure_phase = NULL
223 },
224#else
225 {
226 .name = "UDP/IP Multicast (disabled - expect crash)",
227 },
228 {
229 .name = "UDP/IP Unicast (disabled - expect crash)",
230 },
231#endif
232 {
233 .name = "Kronosnet",
234 .initialize = totemknet_initialize,
235 .buffer_alloc = totemknet_buffer_alloc,
236 .buffer_release = totemknet_buffer_release,
237 .processor_count_set = totemknet_processor_count_set,
238 .token_send = totemknet_token_send,
239 .mcast_flush_send = totemknet_mcast_flush_send,
240 .mcast_noflush_send = totemknet_mcast_noflush_send,
241 .recv_flush = totemknet_recv_flush,
242 .send_flush = totemknet_send_flush,
243 .iface_set = totemknet_iface_set,
244 .iface_check = totemknet_iface_check,
245 .finalize = totemknet_finalize,
246 .net_mtu_adjust = totemknet_net_mtu_adjust,
247 .ifaces_get = totemknet_ifaces_get,
248 .nodestatus_get = totemknet_nodestatus_get,
249 .token_target_set = totemknet_token_target_set,
250 .crypto_set = totemknet_crypto_set,
251 .recv_mcast_empty = totemknet_recv_mcast_empty,
252 .member_add = totemknet_member_add,
253 .member_remove = totemknet_member_remove,
254 .reconfigure = totemknet_reconfigure,
255 .crypto_reconfigure_phase = totemknet_crypto_reconfigure_phase,
256 .stats_clear = totemknet_stats_clear
257 }
258};
259
262
265 int level,
266 int subsys,
267 const char *function,
268 const char *file,
269 int line,
270 const char *format,
271 ...)__attribute__((format(printf, 6, 7)));
272
274};
275
276#define log_printf(level, format, args...) \
277do { \
278 instance->totemnet_log_printf ( \
279 level, \
280 instance->totemnet_subsys_id, \
281 __FUNCTION__, __FILE__, __LINE__, \
282 (const char *)format, ##args); \
283} while (0);
284
285static void totemnet_instance_initialize (
286 struct totemnet_instance *instance,
287 struct totem_config *config)
288{
289 int transport;
290
291 instance->totemnet_log_printf = config->totem_logging_configuration.log_printf;
292 instance->totemnet_subsys_id = config->totem_logging_configuration.log_subsys_id;
293
294 transport = config->transport_number;
295
297 "Initializing transport (%s).", transport_entries[transport].name);
298
300}
301
303 void *net_context,
304 const char *cipher_type,
305 const char *hash_type)
306{
307 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
308 int res = 0;
309
310 res = instance->transport->crypto_set (instance->transport_context,
312
313 return res;
314}
315
317 void *net_context)
318{
319 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
320 int res = 0;
321
322 res = instance->transport->finalize (instance->transport_context);
323
324 return (res);
325}
326
329 void **net_context,
331 totemsrp_stats_t *stats,
332 void *context,
333
334 int (*deliver_fn) (
335 void *context,
336 const void *msg,
337 unsigned int msg_len,
338 const struct sockaddr_storage *system_from),
339
340 int (*iface_change_fn) (
341 void *context,
342 const struct totem_ip_address *iface_address,
343 unsigned int ring_no),
344
345 void (*mtu_changed) (
346 void *context,
347 int net_mtu),
348
349 void (*target_set_completed) (
350 void *context))
351{
352 struct totemnet_instance *instance;
353 unsigned int res;
354
355 instance = malloc (sizeof (struct totemnet_instance));
356 if (instance == NULL) {
357 return (-1);
358 }
359 totemnet_instance_initialize (instance, totem_config);
360
361 res = instance->transport->initialize (loop_pt,
362 &instance->transport_context, totem_config, stats,
363 context, deliver_fn, iface_change_fn, mtu_changed, target_set_completed);
364
365 if (res == -1) {
366 goto error_destroy;
367 }
368
369 *net_context = instance;
370 return (0);
371
373 free (instance);
374 return (-1);
375}
376
378{
379 struct totemnet_instance *instance = net_context;
380 assert (instance != NULL);
381 assert (instance->transport != NULL);
382 return instance->transport->buffer_alloc();
383}
384
386{
387 struct totemnet_instance *instance = net_context;
388 assert (instance != NULL);
389 assert (instance->transport != NULL);
390 instance->transport->buffer_release (ptr);
391}
392
394 void *net_context,
395 int processor_count)
396{
397 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
398 int res = 0;
399
401 return (res);
402}
403
405{
406 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
407 int res = 0;
408
409 res = instance->transport->recv_flush (instance->transport_context);
410
411 return (res);
412}
413
415{
416 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
417 int res = 0;
418
419 res = instance->transport->send_flush (instance->transport_context);
420
421 return (res);
422}
423
425 void *net_context,
426 const void *msg,
427 unsigned int msg_len)
428{
429 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
430 int res = 0;
431
432 res = instance->transport->token_send (instance->transport_context, msg, msg_len);
433
434 return (res);
435}
437 void *net_context,
438 const void *msg,
439 unsigned int msg_len)
440{
441 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
442 int res = 0;
443
444 res = instance->transport->mcast_flush_send (instance->transport_context, msg, msg_len);
445
446 return (res);
447}
448
450 void *net_context,
451 const void *msg,
452 unsigned int msg_len)
453{
454 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
455 int res = 0;
456
457 res = instance->transport->mcast_noflush_send (instance->transport_context, msg, msg_len);
458
459 return (res);
460}
461
463{
464 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
465 int res = 0;
466
467 res = instance->transport->iface_check (instance->transport_context);
468
469 return (res);
470}
471
473{
474 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
475 int res = 0;
476
478 return (res);
479}
480
482 const struct totem_ip_address *interface_addr,
483 unsigned short ip_port,
484 unsigned int iface_no)
485{
486 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
487 int res;
488
489 res = instance->transport->iface_set (instance->transport_context, interface_addr, ip_port, iface_no);
490
491 return (res);
492}
493
495 void *net_context,
496 unsigned int nodeid,
498{
499 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
500 unsigned int res;
501
503
504 return (res);
505}
506
508 void *net_context,
509 char ***status,
510 unsigned int *iface_count)
511{
512 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
513 unsigned int res;
514
515 res = instance->transport->ifaces_get (instance->transport_context, status, iface_count);
516
517 return (res);
518}
519
521 void *net_context,
522 unsigned int nodeid)
523{
524 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
525 unsigned int res;
526
527 res = instance->transport->token_target_set (instance->transport_context, nodeid);
528
529 return (res);
530}
531
533 void *net_context)
534{
535 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
536 unsigned int res;
537
538 res = instance->transport->recv_mcast_empty (instance->transport_context);
539
540 return (res);
541}
542
544 void *net_context,
545 const struct totem_ip_address *local,
546 const struct totem_ip_address *member,
547 int ring_no)
548{
549 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
550 unsigned int res = 0;
551
552 if (instance->transport->member_add) {
553 res = instance->transport->member_add (
554 instance->transport_context,
555 local,
556 member,
557 ring_no);
558 }
559
560 return (res);
561}
562
564 void *net_context,
565 const struct totem_ip_address *member,
566 int ring_no)
567{
568 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
569 unsigned int res = 0;
570
571 if (instance->transport->member_remove) {
572 res = instance->transport->member_remove (
573 instance->transport_context,
574 member,
575 ring_no);
576 }
577
578 return (res);
579}
580
582 void *net_context,
583 const struct totem_ip_address *member,
584 int active)
585{
586 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
587 unsigned int res = 0;
588
589 if (instance->transport->member_set_active) {
590 res = instance->transport->member_set_active (
591 instance->transport_context,
592 member,
593 active);
594 }
595
596 return (res);
597}
598
600 void *net_context,
602{
603 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
604 unsigned int res = 0;
605
606 res = instance->transport->reconfigure (
607 instance->transport_context,
609
610 return (res);
611}
612
614 void *net_context,
617{
618 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
619 unsigned int res = 0;
620
621 if (instance->transport->crypto_reconfigure_phase) {
623 instance->transport_context,
625 }
626 return (res);
627}
628
630 void *net_context)
631{
632 struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
633
634 if (instance->transport->stats_clear) {
635 instance->transport->stats_clear (
636 instance->transport_context);
637 }
638}
unsigned int nodeid
the ID of the node whose info needs updating
Definition coroapi.h:0
#define LOGSYS_LEVEL_NOTICE
Definition logsys.h:74
The totem_ip_address struct.
Definition coroapi.h:111
void * transport_context
Definition totemnet.c:261
struct transport * transport
Definition totemnet.c:263
void(* totemnet_log_printf)(int level, int subsys, const char *function, const char *file, int line, const char *format,...) __attribute__((format(printf
Definition totemnet.c:264
void(*) in totemnet_subsys_id)
Definition totemnet.c:273
int(* finalize)(void *transport_context)
Definition totemnet.c:109
int(* mcast_noflush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:98
int(* mcast_flush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:92
void(* buffer_release)(void *ptr)
Definition totemnet.c:81
int(* token_target_set)(void *transport_context, unsigned int nodeid)
Definition totemnet.c:125
int(* member_add)(void *transport_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition totemnet.c:143
int(* reconfigure)(void *net_context, struct totem_config *totem_config)
Definition totemnet.c:159
int(* send_flush)(void *transport_context)
Definition totemnet.c:105
int(* recv_mcast_empty)(void *transport_context)
Definition totemnet.c:134
int(* iface_check)(void *transport_context)
Definition totemnet.c:107
void(* stats_clear)(void *net_context)
Definition totemnet.c:168
int(* nodestatus_get)(void *transport_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition totemnet.c:120
void(* net_mtu_adjust)(void *transport_context, struct totem_config *totem_config)
Definition totemnet.c:111
void *(* buffer_alloc)(void)
Definition totemnet.c:79
int(* member_set_active)(void *transport_context, const struct totem_ip_address *member, int active)
Definition totemnet.c:154
int(* processor_count_set)(void *transport_context, int processor_count)
Definition totemnet.c:83
int(* crypto_set)(void *transport_context, const char *cipher_type, const char *hash_type)
Definition totemnet.c:129
int(* member_remove)(void *transport_context, const struct totem_ip_address *member, int ring_no)
Definition totemnet.c:149
int(* iface_set)(void *transport_context, const struct totem_ip_address *local, unsigned short ip_port, unsigned int ring_no)
Definition totemnet.c:137
int(* recv_flush)(void *transport_context)
Definition totemnet.c:103
int(* crypto_reconfigure_phase)(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition totemnet.c:163
int(* token_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:87
int(* initialize)(qb_loop_t *loop_pt, void **transport_instance, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Definition totemnet.c:54
int(* ifaces_get)(void *transport_context, char ***status, unsigned int *iface_count)
Definition totemnet.c:115
const char * name
Definition totemnet.c:52
typedef __attribute__
cfg_message_crypto_reconfig_phase_t
Definition totem.h:160
int totemknet_mcast_flush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition totemknet.c:1453
int totemknet_iface_set(void *knet_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition totemknet.c:1549
int totemknet_finalize(void *knet_context)
Definition totemknet.c:664
int totemknet_recv_flush(void *knet_context)
Definition totemknet.c:1431
void * totemknet_buffer_alloc(void)
Definition totemknet.c:1413
int totemknet_processor_count_set(void *knet_context, int processor_count)
Definition totemknet.c:1424
int totemknet_mcast_noflush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition totemknet.c:1466
void totemknet_buffer_release(void *ptr)
Definition totemknet.c:1419
int totemknet_initialize(qb_loop_t *poll_handle, void **knet_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int link_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Definition totemknet.c:1139
int totemknet_ifaces_get(void *knet_context, char ***status, unsigned int *iface_count)
Definition totemknet.c:569
int totemknet_member_add(void *knet_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int link_no)
Definition totemknet.c:1566
int totemknet_crypto_set(void *knet_context, const char *cipher_type, const char *hash_type)
Definition totemknet.c:394
int totemknet_member_remove(void *knet_context, const struct totem_ip_address *token_target, int link_no)
Definition totemknet.c:1705
int totemknet_token_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition totemknet.c:1441
int totemknet_nodestatus_get(void *knet_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition totemknet.c:491
void totemknet_stats_clear(void *knet_context)
Definition totemknet.c:1870
int totemknet_send_flush(void *knet_context)
Definition totemknet.c:1436
void totemknet_net_mtu_adjust(void *knet_context, struct totem_config *totem_config)
Definition totemknet.c:1490
int totemknet_token_target_set(void *knet_context, unsigned int nodeid)
Definition totemknet.c:1497
int totemknet_reconfigure(void *knet_context, struct totem_config *totem_config)
Definition totemknet.c:1778
int totemknet_crypto_reconfigure_phase(void *knet_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition totemknet.c:1811
int totemknet_recv_mcast_empty(void *knet_context)
Definition totemknet.c:1511
int totemknet_iface_check(void *knet_context)
Definition totemknet.c:1480
int totemnet_initialize(qb_loop_t *loop_pt, void **net_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Definition totemnet.c:327
#define log_printf(level, format, args...)
Definition totemnet.c:276
int totemnet_iface_set(void *net_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
Definition totemnet.c:481
int totemnet_member_remove(void *net_context, const struct totem_ip_address *member, int ring_no)
Definition totemnet.c:563
void * totemnet_buffer_alloc(void *net_context)
Definition totemnet.c:377
int totemnet_token_send(void *net_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:424
int totemnet_send_flush(void *net_context)
Definition totemnet.c:414
void totemnet_buffer_release(void *net_context, void *ptr)
Definition totemnet.c:385
int totemnet_mcast_flush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:436
int totemnet_member_add(void *net_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition totemnet.c:543
int totemnet_finalize(void *net_context)
Definition totemnet.c:316
int totemnet_crypto_set(void *net_context, const char *cipher_type, const char *hash_type)
Definition totemnet.c:302
int totemnet_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition totemnet.c:507
struct transport transport_entries[]
Definition totemnet.c:172
int totemnet_processor_count_set(void *net_context, int processor_count)
Definition totemnet.c:393
int totemnet_token_target_set(void *net_context, unsigned int nodeid)
Definition totemnet.c:520
int totemnet_recv_flush(void *net_context)
Definition totemnet.c:404
int totemnet_iface_check(void *net_context)
Definition totemnet.c:462
int totemnet_mcast_noflush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition totemnet.c:449
int totemnet_recv_mcast_empty(void *net_context)
Definition totemnet.c:532
int totemnet_net_mtu_adjust(void *net_context, struct totem_config *totem_config)
Definition totemnet.c:472
int totemnet_nodestatus_get(void *net_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition totemnet.c:494
void totemnet_stats_clear(void *net_context)
Definition totemnet.c:629
int totemnet_reconfigure(void *net_context, struct totem_config *totem_config)
Definition totemnet.c:599
int totemnet_member_set_active(void *net_context, const struct totem_ip_address *member, int active)
Definition totemnet.c:581
int totemnet_crypto_reconfigure_phase(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition totemnet.c:613
Totem Network interface - also does encryption/decryption.
struct srp_addr system_from
Definition totemsrp.c:1
int totemudp_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition totemudp.c:1479
void totemudp_net_mtu_adjust(void *udp_context, struct totem_config *totem_config)
Definition totemudp.c:1340
void * totemudp_buffer_alloc(void)
Definition totemudp.c:1175
int totemudp_send_flush(void *udp_context)
Definition totemudp.c:1243
int totemudp_iface_check(void *udp_context)
Definition totemudp.c:1286
int totemudp_recv_flush(void *udp_context)
Definition totemudp.c:1207
int totemudp_nodestatus_get(void *udp_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition totemudp.c:1296
int totemudp_token_target_set(void *udp_context, unsigned int nodeid)
Definition totemudp.c:1345
int totemudp_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition totemudp.c:1325
int totemudp_reconfigure(void *udp_context, struct totem_config *totem_config)
Definition totemudp.c:1488
int totemudp_mcast_flush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition totemudp.c:1260
int totemudp_finalize(void *udp_context)
Definition totemudp.c:352
int totemudp_recv_mcast_empty(void *udp_context)
Definition totemudp.c:1370
int totemudp_crypto_set(void *udp_context, const char *cipher_type, const char *hash_type)
Definition totemudp.c:249
int totemudp_processor_count_set(void *udp_context, int processor_count)
Definition totemudp.c:1185
int totemudp_token_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition totemudp.c:1248
int totemudp_mcast_noflush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition totemudp.c:1273
int totemudp_member_add(void *udp_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition totemudp.c:1421
void totemudp_buffer_release(void *ptr)
Definition totemudp.c:1180
int totemudp_initialize(qb_loop_t *poll_handle, void **udp_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
Definition totemudp.c:1089
int totemudp_member_remove(void *udp_context, const struct totem_ip_address *token_target, int ring_no)
Definition totemudp.c:1445
void totemudpu_buffer_release(void *ptr)
Definition totemudpu.c:989
int totemudpu_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition totemudpu.c:760
int totemudpu_send_flush(void *udpu_context)
Definition totemudpu.c:1023
int totemudpu_token_target_set(void *udpu_context, unsigned int nodeid)
Definition totemudpu.c:1084
void * totemudpu_buffer_alloc(void)
Definition totemudpu.c:984
int totemudpu_recv_mcast_empty(void *udpu_context)
Definition totemudpu.c:1110
int totemudpu_processor_count_set(void *udpu_context, int processor_count)
Definition totemudpu.c:994
int totemudpu_token_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition totemudpu.c:1030
int totemudpu_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
Definition totemudpu.c:1228
int totemudpu_crypto_set(void *udpu_context, const char *cipher_type, const char *hash_type)
Definition totemudpu.c:244
int totemudpu_recv_flush(void *udpu_context)
Definition totemudpu.c:1016
int totemudpu_mcast_noflush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition totemudpu.c:1055
int totemudpu_member_remove(void *udpu_context, const struct totem_ip_address *token_target, int ring_no)
Definition totemudpu.c:1265
int totemudpu_finalize(void *udpu_context)
Definition totemudpu.c:377
int totemudpu_mcast_flush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition totemudpu.c:1042
int totemudpu_iface_check(void *udpu_context)
Definition totemudpu.c:1068
int totemudpu_reconfigure(void *udpu_context, struct totem_config *totem_config)
Definition totemudpu.c:1374
int totemudpu_initialize(qb_loop_t *poll_handle, void **udpu_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, int(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), int(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
Definition totemudpu.c:888
void totemudpu_net_mtu_adjust(void *udpu_context, struct totem_config *totem_config)
Definition totemudpu.c:1078
int totemudpu_nodestatus_get(void *udpu_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition totemudpu.c:732
int totemudpu_member_add(void *udpu_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition totemudpu.c:1237