ais_amf.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * Copyright (c) 2002-2003 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. #ifndef AIS_AMF_H_DEFINED
  35. #define AIS_AMF_H_DEFINED
  36. #include "saAis.h"
  37. typedef void (*SaAmfHealthcheckCallbackT) (
  38. SaInvocationT invocation,
  39. const SaNameT *compName,
  40. SaAmfHealthcheckT checkType);
  41. typedef void (*SaAmfReadinessStateSetCallbackT) (
  42. SaInvocationT invocation,
  43. const SaNameT *compName,
  44. SaAmfReadinessStateT readinessState);
  45. typedef void (*SaAmfComponentTerminateCallbackT) (
  46. SaInvocationT invocation,
  47. const SaNameT *compName);
  48. typedef void (*SaAmfCSISetCallbackT) (
  49. SaInvocationT invocation,
  50. const SaNameT *compName,
  51. const SaNameT *csiName,
  52. SaAmfCSIFlagsT csiFlags,
  53. SaAmfHAStateT *haState,
  54. SaNameT *activeCompName,
  55. SaAmfCSITransitionDescriptorT transitionDescriptor);
  56. typedef void (*SaAmfCSIRemoveCallbackT) (
  57. SaInvocationT invocation,
  58. const SaNameT *compName,
  59. const SaNameT *csiName,
  60. const SaAmfCSIFlagsT *csiFlags);
  61. typedef void (*SaAmfProtectionGroupTrackCallbackT) (
  62. const SaNameT *csiName,
  63. SaAmfProtectionGroupNotificationT *notificationBuffer,
  64. SaUint32T numberOfItems,
  65. SaUint32T numberOfMembers,
  66. SaErrorT error);
  67. typedef void (*SaAmfExternalComponentRestartCallbackT) (
  68. SaInvocationT invocation,
  69. const SaNameT *externalCompName);
  70. typedef void (*SaAmfExternalComponentControlCallbackT) (
  71. const SaInvocationT invocation,
  72. const SaNameT *externalCompName,
  73. SaAmfExternalComponentActionT controlAction);
  74. typedef void (*SaAmfPendingOperationConfirmCallbackT) (
  75. const SaInvocationT invocation,
  76. const SaNameT *compName,
  77. SaAmfPendingOperationFlagsT pendingOperationFlags);
  78. typedef void (*SaAmfPendingOperationExpiredCallbackT) (
  79. const SaNameT *compName,
  80. SaAmfPendingOperationFlagsT pendingOperationFlags);
  81. typedef struct {
  82. SaAmfHealthcheckCallbackT
  83. saAmfHealthcheckCallback;
  84. SaAmfReadinessStateSetCallbackT
  85. saAmfReadinessStateSetCallback;
  86. SaAmfComponentTerminateCallbackT
  87. saAmfComponentTerminateCallback;
  88. SaAmfCSISetCallbackT
  89. saAmfCSISetCallback;
  90. SaAmfCSIRemoveCallbackT
  91. saAmfCSIRemoveCallback;
  92. SaAmfProtectionGroupTrackCallbackT
  93. saAmfProtectionGroupTrackCallback;
  94. SaAmfExternalComponentRestartCallbackT
  95. saAmfExternalComponentRestartCallback;
  96. SaAmfExternalComponentControlCallbackT
  97. saAmfExternalComponentControlCallback;
  98. SaAmfPendingOperationConfirmCallbackT
  99. saAmfPendingOperationConfirmCallback;
  100. SaAmfPendingOperationExpiredCallbackT
  101. saAmfPendingOperationExpiredCallback;
  102. } SaAmfCallbacksT;
  103. /*
  104. * Interfaces
  105. */
  106. #ifdef __cplusplus
  107. extern "C" {
  108. #endif
  109. SaErrorT
  110. saAmfInitialize (
  111. SaAmfHandleT *amfHandle,
  112. const SaAmfCallbacksT *amfCallbacks,
  113. const SaVersionT *version);
  114. SaErrorT
  115. saAmfSelectionObjectGet (
  116. const SaAmfHandleT *amfHandle,
  117. SaSelectionObjectT *selectionObject);
  118. SaErrorT
  119. saAmfDispatch (
  120. const SaAmfHandleT *amfHandle,
  121. SaDispatchFlagsT dispatchFlags);
  122. SaErrorT
  123. saAmfFinalize (
  124. const SaAmfHandleT *amfHandle);
  125. SaErrorT
  126. saAmfComponentRegister (
  127. const SaAmfHandleT *amfHandle,
  128. const SaNameT *compName,
  129. const SaNameT *proxyCompName);
  130. SaErrorT
  131. saAmfComponentUnregister (
  132. const SaAmfHandleT *amfHandle,
  133. const SaNameT *compName,
  134. const SaNameT *proxyCompName);
  135. SaErrorT
  136. saAmfCompNameGet (
  137. const SaAmfHandleT *amfHandle,
  138. SaNameT *compName);
  139. SaErrorT
  140. saAmfReadinessStateGet (
  141. const SaNameT *compName,
  142. SaAmfReadinessStateT *readinessState);
  143. SaErrorT
  144. saAmfStoppingComplete (
  145. SaInvocationT invocation,
  146. SaErrorT error);
  147. SaErrorT
  148. saAmfHAStateGet (
  149. const SaNameT *compName,
  150. const SaNameT *csiName,
  151. SaAmfHAStateT *haState);
  152. SaErrorT
  153. saAmfProtectionGroupTrackStart (
  154. const SaAmfHandleT *amfHandle,
  155. const SaNameT *csiName,
  156. SaUint8T trackFlags,
  157. const SaAmfProtectionGroupNotificationT *notificationBuffer,
  158. SaUint32T numberOfItems);
  159. SaErrorT
  160. saAmfProtectionGroupTrackStop (
  161. const SaAmfHandleT *amfHandle,
  162. const SaNameT *csiName);
  163. SaErrorT
  164. saAmfErrorReport (
  165. const SaNameT *reportingComponent,
  166. const SaNameT *erroneousComponent,
  167. SaTimeT errorDetectionTime,
  168. const SaAmfErrorDescriptorT *errorDescriptor,
  169. const SaAmfAdditionalDataT *additionalData);
  170. SaErrorT
  171. saAmfErrorCancelAll (
  172. const SaNameT *compName);
  173. SaErrorT
  174. saAmfComponentCapabilityModelGet (
  175. const SaNameT *compName,
  176. SaAmfComponentCapabilityModelT *componentCapabilityModel);
  177. SaErrorT
  178. saAmfPendingOperationGet (
  179. const SaNameT *compName,
  180. SaAmfPendingOperationFlagsT *pendingOperationFlags);
  181. SaErrorT
  182. saAmfResponse (
  183. SaInvocationT invocation,
  184. SaErrorT error);
  185. #ifdef __cplusplus
  186. }
  187. #endif
  188. #endif /* AIS_AMF_H_DEFINED */