mainparse.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright (c) 2002-2004 MontaVista Software, Inc.
  3. *
  4. * All rights reserved.
  5. *
  6. * Author: Steven Dake (sdake@mvista.com)
  7. *
  8. * This software licensed under BSD license, the text of which follows:
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions are met:
  12. *
  13. * - Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. * THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #include <netinet/in.h>
  35. #include "../include/saAis.h"
  36. #include "../include/list.h"
  37. #include "aispoll.h"
  38. #include "totemsrp.h"
  39. #include "totempg.h"
  40. #ifndef PARSE_H_DEFINED
  41. #define PARSE_H_DEFINED
  42. typedef enum {
  43. GROUPCAPABILITYMODEL_2N,
  44. GROUPCAPABILITYMODEL_NPLUSM,
  45. GROUPCAPABILITYMODEL_NWAY,
  46. GROUPCAPABILITYMODEL_NWAYACTIVE,
  47. GROUPCAPABILITYMODEL_NOREDUNDANCY
  48. } SaAmfGroupCapabilityModelT;
  49. enum amfOperationalAdministrativeState {
  50. AMF_DISABLED_UNLOCKED = 0,
  51. AMF_DISABLED_LOCKED = 1,
  52. AMF_ENABLED_UNLOCKED = 2,
  53. AMF_ENABLED_STOPPING = 3
  54. };
  55. struct openais_config {
  56. /*
  57. * logging
  58. */
  59. int logmode;
  60. char *logfile;
  61. /*
  62. * Event service
  63. */
  64. unsigned int evt_delivery_queue_size;
  65. unsigned int evt_delivery_queue_resume;
  66. struct totem_config totem_config;
  67. };
  68. struct saAmfUnit {
  69. SaNameT name;
  70. struct list_head saAmfComponentHead;
  71. struct list_head saAmfUnitList;
  72. enum amfOperationalAdministrativeState operationalAdministrativeState;
  73. struct saAmfGroup *saAmfGroup;
  74. };
  75. struct saAmfProtectionGroup {
  76. SaNameT name;
  77. struct list_head saAmfMembersHead;
  78. struct list_head saAmfProtectionGroupList;
  79. };
  80. struct saAmfGroup {
  81. SaNameT name;
  82. SaAmfGroupCapabilityModelT model;
  83. SaUint32T saAmfActiveUnitsDesired;
  84. SaUint32T saAmfStandbyUnitsDesired;
  85. struct list_head saAmfGroupList;
  86. struct list_head saAmfProtectionGroupHead;
  87. struct list_head saAmfUnitHead;
  88. };
  89. /*
  90. * State machines for states in AMF
  91. */
  92. enum amfOperationalState {
  93. AMF_OPER_DISABLED,
  94. AMF_OPER_ENABLED
  95. };
  96. enum amfAdministrativeState {
  97. AMF_ADMIN_UNLOCKED,
  98. AMF_ADMIN_LOCKED,
  99. AMF_ADMIN_STOPPING
  100. };
  101. enum amfEnabledUnlockedState {
  102. AMF_ENABLED_UNLOCKED_INITIAL = 0,
  103. AMF_ENABLED_UNLOCKED_IN_SERVICE_REQUESTED,
  104. AMF_ENABLED_UNLOCKED_IN_SERVICE_COMPLETED,
  105. AMF_ENABLED_UNLOCKED_ACTIVE_REQUESTED,
  106. AMF_ENABLED_UNLOCKED_ACTIVE_COMPLETED,
  107. AMF_ENABLED_UNLOCKED_STANDBY_REQUESTED,
  108. AMF_ENABLED_UNLOCKED_STANDBY_COMPLETED
  109. };
  110. enum amfDisabledUnlockedState {
  111. AMF_DISABLED_UNLOCKED_REGISTEREDORERRORCANCEL = 0,
  112. AMF_DISABLED_UNLOCKED_FAILED,
  113. AMF_DISABLED_UNLOCKED_QUIESCED_REQUESTED,
  114. AMF_DISABLED_UNLOCKED_QUIESCED_COMPLETED,
  115. AMF_DISABLED_UNLOCKED_OUT_OF_SERVICE_REQUESTED,
  116. AMF_DISABLED_UNLOCKED_OUT_OF_SERVICE_COMPLETED
  117. };
  118. enum amfDisabledLockedState {
  119. AMF_DISABLED_LOCKED_INITIAL = 0,
  120. AMF_DISABLED_LOCKED_QUIESCED_REQUESTED,
  121. AMF_DISABLED_LOCKED_QUIESCED_COMPLETED,
  122. AMF_DISABLED_LOCKED_OUT_OF_SERVICE_REQUESTED,
  123. AMF_DISABLED_LOCKED_OUT_OF_SERVICE_COMPLETED
  124. };
  125. enum amfEnabledStoppingState {
  126. AMF_ENABLED_STOPPING_INITIAL = 0,
  127. AMF_ENABLED_STOPPING_STOPPING_REQUESTED,
  128. AMF_ENABLED_STOPPING_STOPPING_COMPLETED
  129. };
  130. struct saAmfComponent {
  131. int registered;
  132. int local;
  133. struct conn_info *conn_info;
  134. struct totem_ip_address source_addr;
  135. SaNameT name;
  136. SaAmfReadinessStateT currentReadinessState;
  137. SaAmfReadinessStateT newReadinessState;
  138. SaAmfHAStateT currentHAState;
  139. SaAmfHAStateT newHAState;
  140. enum amfEnabledUnlockedState enabledUnlockedState;
  141. enum amfDisabledUnlockedState disabledUnlockedState;
  142. SaAmfComponentCapabilityModelT componentCapabilityModel;
  143. SaAmfProbableCauseT probableCause;
  144. int healthcheckInterval;
  145. poll_timer_handle timer_healthcheck;
  146. int healthcheck_outstanding;
  147. struct saAmfComponent *saAmfProxyComponent;
  148. struct list_head saAmfComponentList;
  149. struct list_head saAmfProtectionGroupList;
  150. struct saAmfUnit *saAmfUnit;
  151. struct saAmfProtectionGroup *saAmfProtectionGroup;
  152. };
  153. extern struct list_head saAmfGroupHead;
  154. extern struct saAmfComponent *findComponent (SaNameT *name);
  155. extern int openais_amf_config_read (char **error_string);
  156. extern int openais_main_config_read (char **error_string,
  157. struct openais_config *openais_config,
  158. int interface_max);
  159. #endif /* PARSE_H_DEFINED */