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