totem.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * Copyright (c) 2005 MontaVista Software, Inc.
  3. * Copyright (c) 2006-2008 Red Hat, Inc.
  4. *
  5. * Author: Steven Dake (sdake@redhat.com)
  6. *
  7. * All rights reserved.
  8. *
  9. * This software licensed under BSD license, the text of which follows:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * - Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  20. * contributors may be used to endorse or promote products derived from this
  21. * software without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  33. * THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. #ifndef TOTEM_H_DEFINED
  36. #define TOTEM_H_DEFINED
  37. #include "totemip.h"
  38. #define MESSAGE_SIZE_MAX 1024*1024 /* (1MB) */
  39. #define PROCESSOR_COUNT_MAX 384
  40. #define FRAME_SIZE_MAX 9000
  41. #define TRANSMITS_ALLOWED 16
  42. #define SEND_THREADS_MAX 16
  43. #define INTERFACE_MAX 2
  44. /*
  45. * Array location of various timeouts as
  46. * specified in openais.conf. The last enum
  47. * specifies the size of the timeouts array and
  48. * needs to remain the last item in the list.
  49. */
  50. enum {
  51. TOTEM_RETRANSMITS_BEFORE_LOSS,
  52. TOTEM_TOKEN,
  53. TOTEM_RETRANSMIT_TOKEN,
  54. TOTEM_HOLD_TOKEN,
  55. TOTEM_JOIN,
  56. TOTEM_CONSENSUS,
  57. TOTEM_MERGE,
  58. TOTEM_DOWNCHECK,
  59. TOTEM_FAIL_RECV_CONST,
  60. MAX_TOTEM_TIMEOUTS /* Last item */
  61. } totem_timeout_types;
  62. struct totem_interface {
  63. struct totem_ip_address bindnet;
  64. struct totem_ip_address boundto;
  65. struct totem_ip_address mcast_addr;
  66. uint16_t ip_port;
  67. };
  68. struct totem_logging_configuration {
  69. void (*log_printf) (char *, int, int, char *, ...) __attribute__((format(printf, 4, 5)));
  70. int log_level_security;
  71. int log_level_error;
  72. int log_level_warning;
  73. int log_level_notice;
  74. int log_level_debug;
  75. };
  76. struct totem_config {
  77. int version;
  78. /*
  79. * network
  80. */
  81. struct totem_interface *interfaces;
  82. int interface_count;
  83. unsigned int node_id;
  84. /*
  85. * key information
  86. */
  87. unsigned char private_key[128];
  88. int private_key_len;
  89. /*
  90. * Totem configuration parameters
  91. */
  92. unsigned int token_timeout;
  93. unsigned int token_retransmit_timeout;
  94. unsigned int token_hold_timeout;
  95. unsigned int token_retransmits_before_loss_const;
  96. unsigned int join_timeout;
  97. unsigned int send_join_timeout;
  98. unsigned int consensus_timeout;
  99. unsigned int merge_timeout;
  100. unsigned int downcheck_timeout;
  101. unsigned int fail_to_recv_const;
  102. unsigned int seqno_unchanged_const;
  103. unsigned int rrp_token_expired_timeout;
  104. unsigned int rrp_problem_count_timeout;
  105. unsigned int rrp_problem_count_threshold;
  106. char rrp_mode[64];
  107. struct totem_logging_configuration totem_logging_configuration;
  108. unsigned int secauth;
  109. unsigned int net_mtu;
  110. unsigned int threads;
  111. unsigned int heartbeat_failures_allowed;
  112. unsigned int max_network_delay;
  113. unsigned int window_size;
  114. unsigned int max_messages;
  115. char *vsf_type;
  116. };
  117. #define TOTEM_CONFIGURATION_TYPE
  118. enum totem_configuration_type {
  119. TOTEM_CONFIGURATION_REGULAR,
  120. TOTEM_CONFIGURATION_TRANSITIONAL
  121. };
  122. enum totem_callback_token_type {
  123. TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
  124. TOTEM_CALLBACK_TOKEN_SENT = 2
  125. };
  126. #define MEMB_RING_ID
  127. struct memb_ring_id {
  128. struct totem_ip_address rep;
  129. unsigned long long seq;
  130. } __attribute__((packed));
  131. #endif /* TOTEM_H_DEFINED */