corosync  3.1.0
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  void (*deliver_fn) (
60  void *context,
61  const void *msg,
62  unsigned int msg_len,
63  const struct sockaddr_storage *system_from),
64 
65  void (*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 
119  void *transport_context,
120  unsigned int nodeid);
121 
122  int (*crypto_set) (
123  void *transport_context,
124  const char *cipher_type,
125  const char *hash_type);
126 
128  void *transport_context);
129 
130  int (*iface_set) (
131  void *transport_context,
132  const struct totem_ip_address *local,
133  unsigned short ip_port,
134  unsigned int ring_no);
135 
136  int (*member_add) (
137  void *transport_context,
138  const struct totem_ip_address *local,
139  const struct totem_ip_address *member,
140  int ring_no);
141 
142  int (*member_remove) (
143  void *transport_context,
144  const struct totem_ip_address *member,
145  int ring_no);
146 
148  void *transport_context,
149  const struct totem_ip_address *member,
150  int active);
151 
152  int (*reconfigure) (
153  void *net_context,
154  struct totem_config *totem_config);
155 
157  void *net_context,
158  struct totem_config *totem_config,
160 
161  void (*stats_clear) (
162  void *net_context);
163 };
164 
165 struct transport transport_entries[] = {
166  {
167  .name = "UDP/IP Multicast",
168  .initialize = totemudp_initialize,
169  .buffer_alloc = totemudp_buffer_alloc,
170  .buffer_release = totemudp_buffer_release,
171  .processor_count_set = totemudp_processor_count_set,
172  .token_send = totemudp_token_send,
173  .mcast_flush_send = totemudp_mcast_flush_send,
174  .mcast_noflush_send = totemudp_mcast_noflush_send,
175  .recv_flush = totemudp_recv_flush,
176  .send_flush = totemudp_send_flush,
177  .iface_set = totemudp_iface_set,
178  .iface_check = totemudp_iface_check,
179  .finalize = totemudp_finalize,
180  .net_mtu_adjust = totemudp_net_mtu_adjust,
181  .ifaces_get = totemudp_ifaces_get,
182  .token_target_set = totemudp_token_target_set,
183  .crypto_set = totemudp_crypto_set,
184  .recv_mcast_empty = totemudp_recv_mcast_empty,
185  .member_add = totemudp_member_add,
186  .member_remove = totemudp_member_remove,
187  .reconfigure = totemudp_reconfigure,
188  .crypto_reconfigure_phase = NULL
189  },
190  {
191  .name = "UDP/IP Unicast",
192  .initialize = totemudpu_initialize,
193  .buffer_alloc = totemudpu_buffer_alloc,
194  .buffer_release = totemudpu_buffer_release,
195  .processor_count_set = totemudpu_processor_count_set,
196  .token_send = totemudpu_token_send,
197  .mcast_flush_send = totemudpu_mcast_flush_send,
198  .mcast_noflush_send = totemudpu_mcast_noflush_send,
199  .recv_flush = totemudpu_recv_flush,
200  .send_flush = totemudpu_send_flush,
201  .iface_set = totemudpu_iface_set,
202  .iface_check = totemudpu_iface_check,
203  .finalize = totemudpu_finalize,
204  .net_mtu_adjust = totemudpu_net_mtu_adjust,
205  .ifaces_get = totemudpu_ifaces_get,
206  .token_target_set = totemudpu_token_target_set,
207  .crypto_set = totemudpu_crypto_set,
208  .recv_mcast_empty = totemudpu_recv_mcast_empty,
209  .member_add = totemudpu_member_add,
210  .member_remove = totemudpu_member_remove,
211  .reconfigure = totemudpu_reconfigure,
212  .crypto_reconfigure_phase = NULL
213  },
214  {
215  .name = "Kronosnet",
216  .initialize = totemknet_initialize,
217  .buffer_alloc = totemknet_buffer_alloc,
218  .buffer_release = totemknet_buffer_release,
219  .processor_count_set = totemknet_processor_count_set,
220  .token_send = totemknet_token_send,
221  .mcast_flush_send = totemknet_mcast_flush_send,
222  .mcast_noflush_send = totemknet_mcast_noflush_send,
223  .recv_flush = totemknet_recv_flush,
224  .send_flush = totemknet_send_flush,
225  .iface_set = totemknet_iface_set,
226  .iface_check = totemknet_iface_check,
227  .finalize = totemknet_finalize,
228  .net_mtu_adjust = totemknet_net_mtu_adjust,
229  .ifaces_get = totemknet_ifaces_get,
230  .token_target_set = totemknet_token_target_set,
231  .crypto_set = totemknet_crypto_set,
232  .recv_mcast_empty = totemknet_recv_mcast_empty,
233  .member_add = totemknet_member_add,
234  .member_remove = totemknet_member_remove,
235  .reconfigure = totemknet_reconfigure,
236  .crypto_reconfigure_phase = totemknet_crypto_reconfigure_phase,
237  .stats_clear = totemknet_stats_clear
238  }
239 };
240 
243 
246  int level,
247  int subsys,
248  const char *function,
249  const char *file,
250  int line,
251  const char *format,
252  ...)__attribute__((format(printf, 6, 7)));
253 
255 };
256 
257 #define log_printf(level, format, args...) \
258 do { \
259  instance->totemnet_log_printf ( \
260  level, \
261  instance->totemnet_subsys_id, \
262  __FUNCTION__, __FILE__, __LINE__, \
263  (const char *)format, ##args); \
264 } while (0);
265 
266 static void totemnet_instance_initialize (
267  struct totemnet_instance *instance,
268  struct totem_config *config)
269 {
270  int transport;
271 
274 
275 
276  transport = config->transport_number;
277 
279  "Initializing transport (%s).", transport_entries[transport].name);
280 
281  instance->transport = &transport_entries[transport];
282 }
283 
285  void *net_context,
286  const char *cipher_type,
287  const char *hash_type)
288 {
289  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
290  int res = 0;
291 
292  res = instance->transport->crypto_set (instance->transport_context,
293  cipher_type, hash_type);
294 
295  return res;
296 }
297 
299  void *net_context)
300 {
301  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
302  int res = 0;
303 
304  res = instance->transport->finalize (instance->transport_context);
305 
306  return (res);
307 }
308 
310  qb_loop_t *loop_pt,
311  void **net_context,
312  struct totem_config *totem_config,
313  totemsrp_stats_t *stats,
314  void *context,
315 
316  void (*deliver_fn) (
317  void *context,
318  const void *msg,
319  unsigned int msg_len,
320  const struct sockaddr_storage *system_from),
321 
322  void (*iface_change_fn) (
323  void *context,
324  const struct totem_ip_address *iface_address,
325  unsigned int ring_no),
326 
327  void (*mtu_changed) (
328  void *context,
329  int net_mtu),
330 
331  void (*target_set_completed) (
332  void *context))
333 {
334  struct totemnet_instance *instance;
335  unsigned int res;
336 
337  instance = malloc (sizeof (struct totemnet_instance));
338  if (instance == NULL) {
339  return (-1);
340  }
341  totemnet_instance_initialize (instance, totem_config);
342 
343  res = instance->transport->initialize (loop_pt,
344  &instance->transport_context, totem_config, stats,
345  context, deliver_fn, iface_change_fn, mtu_changed, target_set_completed);
346 
347  if (res == -1) {
348  goto error_destroy;
349  }
350 
351  *net_context = instance;
352  return (0);
353 
354 error_destroy:
355  free (instance);
356  return (-1);
357 }
358 
359 void *totemnet_buffer_alloc (void *net_context)
360 {
361  struct totemnet_instance *instance = net_context;
362  assert (instance != NULL);
363  assert (instance->transport != NULL);
364  return instance->transport->buffer_alloc();
365 }
366 
367 void totemnet_buffer_release (void *net_context, void *ptr)
368 {
369  struct totemnet_instance *instance = net_context;
370  assert (instance != NULL);
371  assert (instance->transport != NULL);
372  instance->transport->buffer_release (ptr);
373 }
374 
376  void *net_context,
377  int processor_count)
378 {
379  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
380  int res = 0;
381 
382  res = instance->transport->processor_count_set (instance->transport_context, processor_count);
383  return (res);
384 }
385 
386 int totemnet_recv_flush (void *net_context)
387 {
388  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
389  int res = 0;
390 
391  res = instance->transport->recv_flush (instance->transport_context);
392 
393  return (res);
394 }
395 
396 int totemnet_send_flush (void *net_context)
397 {
398  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
399  int res = 0;
400 
401  res = instance->transport->send_flush (instance->transport_context);
402 
403  return (res);
404 }
405 
407  void *net_context,
408  const void *msg,
409  unsigned int msg_len)
410 {
411  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
412  int res = 0;
413 
414  res = instance->transport->token_send (instance->transport_context, msg, msg_len);
415 
416  return (res);
417 }
419  void *net_context,
420  const void *msg,
421  unsigned int msg_len)
422 {
423  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
424  int res = 0;
425 
426  res = instance->transport->mcast_flush_send (instance->transport_context, msg, msg_len);
427 
428  return (res);
429 }
430 
432  void *net_context,
433  const void *msg,
434  unsigned int msg_len)
435 {
436  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
437  int res = 0;
438 
439  res = instance->transport->mcast_noflush_send (instance->transport_context, msg, msg_len);
440 
441  return (res);
442 }
443 
444 extern int totemnet_iface_check (void *net_context)
445 {
446  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
447  int res = 0;
448 
449  res = instance->transport->iface_check (instance->transport_context);
450 
451  return (res);
452 }
453 
454 extern int totemnet_net_mtu_adjust (void *net_context, struct totem_config *totem_config)
455 {
456  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
457  int res = 0;
458 
459  instance->transport->net_mtu_adjust (instance->transport_context, totem_config);
460  return (res);
461 }
462 
463 int totemnet_iface_set (void *net_context,
464  const struct totem_ip_address *interface_addr,
465  unsigned short ip_port,
466  unsigned int iface_no)
467 {
468  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
469  int res;
470 
471  res = instance->transport->iface_set (instance->transport_context, interface_addr, ip_port, iface_no);
472 
473  return (res);
474 }
475 
477  void *net_context,
478  char ***status,
479  unsigned int *iface_count)
480 {
481  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
482  unsigned int res;
483 
484  res = instance->transport->ifaces_get (instance->transport_context, status, iface_count);
485 
486  return (res);
487 }
488 
490  void *net_context,
491  unsigned int nodeid)
492 {
493  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
494  unsigned int res;
495 
496  res = instance->transport->token_target_set (instance->transport_context, nodeid);
497 
498  return (res);
499 }
500 
502  void *net_context)
503 {
504  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
505  unsigned int res;
506 
507  res = instance->transport->recv_mcast_empty (instance->transport_context);
508 
509  return (res);
510 }
511 
513  void *net_context,
514  const struct totem_ip_address *local,
515  const struct totem_ip_address *member,
516  int ring_no)
517 {
518  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
519  unsigned int res = 0;
520 
521  if (instance->transport->member_add) {
522  res = instance->transport->member_add (
523  instance->transport_context,
524  local,
525  member,
526  ring_no);
527  }
528 
529  return (res);
530 }
531 
533  void *net_context,
534  const struct totem_ip_address *member,
535  int ring_no)
536 {
537  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
538  unsigned int res = 0;
539 
540  if (instance->transport->member_remove) {
541  res = instance->transport->member_remove (
542  instance->transport_context,
543  member,
544  ring_no);
545  }
546 
547  return (res);
548 }
549 
551  void *net_context,
552  const struct totem_ip_address *member,
553  int active)
554 {
555  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
556  unsigned int res = 0;
557 
558  if (instance->transport->member_set_active) {
559  res = instance->transport->member_set_active (
560  instance->transport_context,
561  member,
562  active);
563  }
564 
565  return (res);
566 }
567 
569  void *net_context,
570  struct totem_config *totem_config)
571 {
572  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
573  unsigned int res = 0;
574 
575  res = instance->transport->reconfigure (
576  instance->transport_context,
577  totem_config);
578 
579  return (res);
580 }
581 
583  void *net_context,
584  struct totem_config *totem_config,
586 {
587  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
588  unsigned int res = 0;
589 
590  if (instance->transport->crypto_reconfigure_phase) {
591  res = instance->transport->crypto_reconfigure_phase (
592  instance->transport_context,
593  totem_config, phase);
594  }
595  return (res);
596 }
597 
599  void *net_context)
600 {
601  struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
602 
603  if (instance->transport->stats_clear) {
604  instance->transport->stats_clear (
605  instance->transport_context);
606  }
607 }
unsigned int nodeid
Definition: coroapi.h:0
#define LOGSYS_LEVEL_NOTICE
Definition: logsys.h:74
struct totem_logging_configuration totem_logging_configuration
Definition: totem.h:207
totem_transport_t transport_number
Definition: totem.h:239
The totem_ip_address struct.
Definition: coroapi.h:111
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
void * transport_context
Definition: totemnet.c:242
struct transport * transport
Definition: totemnet.c:244
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:245
void(*) in totemnet_subsys_id)
Definition: totemnet.c:252
int(* finalize)(void *transport_context)
Definition: totemnet.c:107
int(* mcast_noflush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:96
int(* mcast_flush_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:90
void(* buffer_release)(void *ptr)
Definition: totemnet.c:79
int(* token_target_set)(void *transport_context, unsigned int nodeid)
Definition: totemnet.c:118
void *(* buffer_alloc)(void)
Definition: totemnet.c:77
int(* member_add)(void *transport_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:136
int(* reconfigure)(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:152
int(* initialize)(qb_loop_t *loop_pt, void **transport_instance, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*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(* send_flush)(void *transport_context)
Definition: totemnet.c:103
int(* recv_mcast_empty)(void *transport_context)
Definition: totemnet.c:127
int(* iface_check)(void *transport_context)
Definition: totemnet.c:105
void(* stats_clear)(void *net_context)
Definition: totemnet.c:161
void(* net_mtu_adjust)(void *transport_context, struct totem_config *totem_config)
Definition: totemnet.c:109
int(* member_set_active)(void *transport_context, const struct totem_ip_address *member, int active)
Definition: totemnet.c:147
int(* processor_count_set)(void *transport_context, int processor_count)
Definition: totemnet.c:81
int(* crypto_set)(void *transport_context, const char *cipher_type, const char *hash_type)
Definition: totemnet.c:122
int(* member_remove)(void *transport_context, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:142
int(* iface_set)(void *transport_context, const struct totem_ip_address *local, unsigned short ip_port, unsigned int ring_no)
Definition: totemnet.c:130
int(* recv_flush)(void *transport_context)
Definition: totemnet.c:101
int(* crypto_reconfigure_phase)(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemnet.c:156
int(* token_send)(void *transport_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:85
int(* ifaces_get)(void *transport_context, char ***status, unsigned int *iface_count)
Definition: totemnet.c:113
const char * name
Definition: totemnet.c:50
typedef __attribute__
cfg_message_crypto_reconfig_phase_t
Definition: totem.h:154
int totemknet_mcast_flush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1257
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:1367
int totemknet_finalize(void *knet_context)
Definition: totemknet.c:586
int totemknet_recv_flush(void *knet_context)
Definition: totemknet.c:1235
int totemknet_processor_count_set(void *knet_context, int processor_count)
Definition: totemknet.c:1228
int totemknet_mcast_noflush_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1270
void totemknet_buffer_release(void *ptr)
Definition: totemknet.c:1223
int totemknet_ifaces_get(void *knet_context, char ***status, unsigned int *iface_count)
Definition: totemknet.c:491
void * totemknet_buffer_alloc(void)
Definition: totemknet.c:1217
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:1384
int totemknet_crypto_set(void *knet_context, const char *cipher_type, const char *hash_type)
Definition: totemknet.c:363
int totemknet_member_remove(void *knet_context, const struct totem_ip_address *token_target, int link_no)
Definition: totemknet.c:1506
int totemknet_initialize(qb_loop_t *poll_handle, void **knet_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*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:973
int totemknet_token_send(void *knet_context, const void *msg, unsigned int msg_len)
Definition: totemknet.c:1245
void totemknet_stats_clear(void *knet_context)
Definition: totemknet.c:1669
int totemknet_send_flush(void *knet_context)
Definition: totemknet.c:1240
void totemknet_net_mtu_adjust(void *knet_context, struct totem_config *totem_config)
Definition: totemknet.c:1294
int totemknet_token_target_set(void *knet_context, unsigned int nodeid)
Definition: totemknet.c:1301
int totemknet_reconfigure(void *knet_context, struct totem_config *totem_config)
Definition: totemknet.c:1580
int totemknet_crypto_reconfigure_phase(void *knet_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemknet.c:1610
int totemknet_recv_mcast_empty(void *knet_context)
Definition: totemknet.c:1315
int totemknet_iface_check(void *knet_context)
Definition: totemknet.c:1284
#define log_printf(level, format, args...)
Definition: totemnet.c:257
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:463
int totemnet_member_remove(void *net_context, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:532
int totemnet_token_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:406
int totemnet_send_flush(void *net_context)
Definition: totemnet.c:396
int totemnet_initialize(qb_loop_t *loop_pt, void **net_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*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:309
void totemnet_buffer_release(void *net_context, void *ptr)
Definition: totemnet.c:367
int totemnet_mcast_flush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:418
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:512
int totemnet_finalize(void *net_context)
Definition: totemnet.c:298
int totemnet_crypto_set(void *net_context, const char *cipher_type, const char *hash_type)
Definition: totemnet.c:284
int totemnet_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemnet.c:476
struct transport transport_entries[]
Definition: totemnet.c:165
int totemnet_processor_count_set(void *net_context, int processor_count)
Definition: totemnet.c:375
int totemnet_token_target_set(void *net_context, unsigned int nodeid)
Definition: totemnet.c:489
int totemnet_recv_flush(void *net_context)
Definition: totemnet.c:386
int totemnet_iface_check(void *net_context)
Definition: totemnet.c:444
int totemnet_mcast_noflush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:431
int totemnet_recv_mcast_empty(void *net_context)
Definition: totemnet.c:501
int totemnet_net_mtu_adjust(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:454
void totemnet_stats_clear(void *net_context)
Definition: totemnet.c:598
int totemnet_reconfigure(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:568
int totemnet_member_set_active(void *net_context, const struct totem_ip_address *member, int active)
Definition: totemnet.c:550
void * totemnet_buffer_alloc(void *net_context)
Definition: totemnet.c:359
int totemnet_crypto_reconfigure_phase(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemnet.c:582
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:1505
void totemudp_net_mtu_adjust(void *udp_context, struct totem_config *totem_config)
Definition: totemudp.c:1352
int totemudp_send_flush(void *udp_context)
Definition: totemudp.c:1284
int totemudp_iface_check(void *udp_context)
Definition: totemudp.c:1327
int totemudp_recv_flush(void *udp_context)
Definition: totemudp.c:1248
int totemudp_token_target_set(void *udp_context, unsigned int nodeid)
Definition: totemudp.c:1357
int totemudp_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemudp.c:1337
int totemudp_reconfigure(void *udp_context, struct totem_config *totem_config)
Definition: totemudp.c:1514
int totemudp_mcast_flush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1301
int totemudp_finalize(void *udp_context)
Definition: totemudp.c:383
int totemudp_recv_mcast_empty(void *udp_context)
Definition: totemudp.c:1382
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 totemudp_token_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1289
int totemudp_mcast_noflush_send(void *udp_context, const void *msg, unsigned int msg_len)
Definition: totemudp.c:1314
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:1447
void totemudp_buffer_release(void *ptr)
Definition: totemudp.c:1221
void * totemudp_buffer_alloc(void)
Definition: totemudp.c:1216
int totemudp_member_remove(void *udp_context, const struct totem_ip_address *token_target, int ring_no)
Definition: totemudp.c:1471
int totemudp_initialize(qb_loop_t *poll_handle, void **udp_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*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
void totemudpu_buffer_release(void *ptr)
Definition: totemudpu.c:1025
int totemudpu_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemudpu.c:796
int totemudpu_send_flush(void *udpu_context)
Definition: totemudpu.c:1059
int totemudpu_token_target_set(void *udpu_context, unsigned int nodeid)
Definition: totemudpu.c:1120
int totemudpu_recv_mcast_empty(void *udpu_context)
Definition: totemudpu.c:1146
int totemudpu_processor_count_set(void *udpu_context, int processor_count)
Definition: totemudpu.c:1030
int totemudpu_token_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1066
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:1272
int totemudpu_initialize(qb_loop_t *poll_handle, void **udpu_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*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:924
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:1052
int totemudpu_mcast_noflush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1091
int totemudpu_member_remove(void *udpu_context, const struct totem_ip_address *token_target, int ring_no)
Definition: totemudpu.c:1309
int totemudpu_finalize(void *udpu_context)
Definition: totemudpu.c:423
int totemudpu_mcast_flush_send(void *udpu_context, const void *msg, unsigned int msg_len)
Definition: totemudpu.c:1078
int totemudpu_iface_check(void *udpu_context)
Definition: totemudpu.c:1104
void * totemudpu_buffer_alloc(void)
Definition: totemudpu.c:1020
int totemudpu_reconfigure(void *udpu_context, struct totem_config *totem_config)
Definition: totemudpu.c:1418
void totemudpu_net_mtu_adjust(void *udpu_context, struct totem_config *totem_config)
Definition: totemudpu.c:1114
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:1281