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