totem.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. #ifndef MESSAGE_SIZE_MAX
  39. #define MESSAGE_SIZE_MAX 1024*1024 /* (1MB) */
  40. #endif /* MESSAGE_SIZE_MAX */
  41. #ifndef MESSAGE_QUEUE_MAX
  42. #define MESSAGE_QUEUE_MAX MESSAGE_SIZE_MAX / totem_config->net_mtu
  43. #endif /* MESSAGE_QUEUE_MAX */
  44. #define PROCESSOR_COUNT_MAX 384
  45. #define FRAME_SIZE_MAX 9000
  46. #define TRANSMITS_ALLOWED 16
  47. #define SEND_THREADS_MAX 16
  48. #define INTERFACE_MAX 2
  49. struct totem_interface {
  50. struct totem_ip_address bindnet;
  51. struct totem_ip_address boundto;
  52. struct totem_ip_address mcast_addr;
  53. uint16_t ip_port;
  54. };
  55. struct totem_logging_configuration {
  56. void (*log_printf) (
  57. int subsys,
  58. char *function_name,
  59. char *file_name,
  60. int file_line,
  61. unsigned int level,
  62. char *format,
  63. ...) __attribute__((format(printf, 6, 7)));
  64. int log_level_security;
  65. int log_level_error;
  66. int log_level_warning;
  67. int log_level_notice;
  68. int log_level_debug;
  69. int log_subsys_id;
  70. };
  71. struct totem_config {
  72. int version;
  73. /*
  74. * network
  75. */
  76. struct totem_interface *interfaces;
  77. int interface_count;
  78. unsigned int node_id;
  79. /*
  80. * key information
  81. */
  82. unsigned char private_key[128];
  83. int private_key_len;
  84. /*
  85. * Totem configuration parameters
  86. */
  87. unsigned int token_timeout;
  88. unsigned int token_retransmit_timeout;
  89. unsigned int token_hold_timeout;
  90. unsigned int token_retransmits_before_loss_const;
  91. unsigned int join_timeout;
  92. unsigned int send_join_timeout;
  93. unsigned int consensus_timeout;
  94. unsigned int merge_timeout;
  95. unsigned int downcheck_timeout;
  96. unsigned int fail_to_recv_const;
  97. unsigned int seqno_unchanged_const;
  98. unsigned int rrp_token_expired_timeout;
  99. unsigned int rrp_problem_count_timeout;
  100. unsigned int rrp_problem_count_threshold;
  101. char rrp_mode[64];
  102. struct totem_logging_configuration totem_logging_configuration;
  103. unsigned int secauth;
  104. unsigned int net_mtu;
  105. unsigned int threads;
  106. unsigned int heartbeat_failures_allowed;
  107. unsigned int max_network_delay;
  108. unsigned int window_size;
  109. unsigned int max_messages;
  110. char *vsf_type;
  111. };
  112. #define TOTEM_CONFIGURATION_TYPE
  113. enum totem_configuration_type {
  114. TOTEM_CONFIGURATION_REGULAR,
  115. TOTEM_CONFIGURATION_TRANSITIONAL
  116. };
  117. #define TOTEM_CALLBACK_TOKEN_TYPE
  118. enum totem_callback_token_type {
  119. TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
  120. TOTEM_CALLBACK_TOKEN_SENT = 2
  121. };
  122. #define MEMB_RING_ID
  123. struct memb_ring_id {
  124. struct totem_ip_address rep;
  125. unsigned long long seq;
  126. } __attribute__((packed));
  127. #endif /* TOTEM_H_DEFINED */