ipc_cfg.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright (c) 2005 MontaVista Software, Inc.
  3. * Copyright (c) 2009 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. #ifndef IPC_CFG_H_DEFINED
  36. #define IPC_CFG_H_DEFINED
  37. #include <netinet/in.h>
  38. #include <corosync/corotypes.h>
  39. enum req_lib_cfg_types {
  40. MESSAGE_REQ_CFG_RINGSTATUSGET = 0,
  41. MESSAGE_REQ_CFG_RINGREENABLE = 1,
  42. MESSAGE_REQ_CFG_STATETRACKSTART = 2,
  43. MESSAGE_REQ_CFG_STATETRACKSTOP = 3,
  44. MESSAGE_REQ_CFG_ADMINISTRATIVESTATESET = 4,
  45. MESSAGE_REQ_CFG_ADMINISTRATIVESTATEGET = 5,
  46. MESSAGE_REQ_CFG_SERVICELOAD = 6,
  47. MESSAGE_REQ_CFG_SERVICEUNLOAD = 7,
  48. MESSAGE_REQ_CFG_KILLNODE = 8,
  49. MESSAGE_REQ_CFG_TRYSHUTDOWN = 9,
  50. MESSAGE_REQ_CFG_REPLYTOSHUTDOWN = 10,
  51. MESSAGE_REQ_CFG_GET_NODE_ADDRS = 11,
  52. MESSAGE_REQ_CFG_LOCAL_GET = 12
  53. };
  54. enum res_lib_cfg_types {
  55. MESSAGE_RES_CFG_RINGSTATUSGET = 0,
  56. MESSAGE_RES_CFG_RINGREENABLE = 1,
  57. MESSAGE_RES_CFG_STATETRACKSTART = 2,
  58. MESSAGE_RES_CFG_STATETRACKSTOP = 3,
  59. MESSAGE_RES_CFG_ADMINISTRATIVESTATESET = 4,
  60. MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET = 5,
  61. MESSAGE_RES_CFG_SERVICELOAD = 6,
  62. MESSAGE_RES_CFG_SERVICEUNLOAD = 7,
  63. MESSAGE_RES_CFG_KILLNODE = 8,
  64. MESSAGE_RES_CFG_TRYSHUTDOWN = 9,
  65. MESSAGE_RES_CFG_TESTSHUTDOWN = 10,
  66. MESSAGE_RES_CFG_GET_NODE_ADDRS = 11,
  67. MESSAGE_RES_CFG_LOCAL_GET = 12,
  68. MESSAGE_RES_CFG_REPLYTOSHUTDOWN = 13
  69. };
  70. struct req_lib_cfg_statetrack {
  71. coroipc_request_header_t header;
  72. uint8_t track_flags;
  73. corosync_cfg_state_notification_t *notification_buffer_address;
  74. };
  75. struct res_lib_cfg_statetrack {
  76. coroipc_response_header_t header;
  77. };
  78. struct req_lib_cfg_statetrackstop {
  79. coroipc_request_header_t header;
  80. };
  81. struct res_lib_cfg_statetrackstop {
  82. coroipc_response_header_t header;
  83. };
  84. struct req_lib_cfg_administrativestateset {
  85. coroipc_request_header_t header;
  86. cs_name_t comp_name;
  87. corosync_cfg_administrative_target_t administrative_target;
  88. corosync_cfg_administrative_state_t administrative_state;
  89. };
  90. struct res_lib_cfg_administrativestateset {
  91. coroipc_response_header_t header;
  92. };
  93. struct req_lib_cfg_administrativestateget {
  94. coroipc_request_header_t header;
  95. cs_name_t comp_name;
  96. corosync_cfg_administrative_target_t administrative_target;
  97. corosync_cfg_administrative_state_t administrative_state;
  98. };
  99. struct res_lib_cfg_administrativestateget {
  100. coroipc_response_header_t header __attribute__((aligned(8)));
  101. };
  102. struct req_lib_cfg_ringstatusget {
  103. coroipc_request_header_t header __attribute__((aligned(8)));
  104. };
  105. struct res_lib_cfg_ringstatusget {
  106. coroipc_response_header_t header __attribute__((aligned(8)));
  107. mar_uint32_t interface_count __attribute__((aligned(8)));
  108. char interface_name[16][128] __attribute__((aligned(8)));
  109. char interface_status[16][512] __attribute__((aligned(8)));
  110. };
  111. struct req_lib_cfg_ringreenable {
  112. coroipc_request_header_t header __attribute__((aligned(8)));
  113. };
  114. struct res_lib_cfg_ringreenable {
  115. coroipc_response_header_t header __attribute__((aligned(8)));
  116. };
  117. struct req_lib_cfg_serviceload {
  118. coroipc_response_header_t header __attribute__((aligned(8)));
  119. char service_name[256] __attribute__((aligned(8)));
  120. unsigned int service_ver;
  121. };
  122. struct res_lib_cfg_serviceload {
  123. coroipc_response_header_t header __attribute__((aligned(8)));
  124. };
  125. struct req_lib_cfg_serviceunload {
  126. coroipc_response_header_t header __attribute__((aligned(8)));
  127. char service_name[256] __attribute__((aligned(8)));
  128. unsigned int service_ver;
  129. };
  130. struct res_lib_cfg_serviceunload {
  131. coroipc_response_header_t header __attribute__((aligned(8)));
  132. };
  133. struct req_lib_cfg_killnode {
  134. coroipc_request_header_t header __attribute__((aligned(8)));
  135. unsigned int nodeid __attribute__((aligned(8)));
  136. cs_name_t reason __attribute__((aligned(8)));
  137. };
  138. struct res_lib_cfg_killnode {
  139. coroipc_response_header_t header __attribute__((aligned(8)));
  140. };
  141. struct req_lib_cfg_tryshutdown {
  142. coroipc_request_header_t header __attribute__((aligned(8)));
  143. unsigned int flags;
  144. };
  145. struct res_lib_cfg_tryshutdown {
  146. coroipc_response_header_t header __attribute__((aligned(8)));
  147. };
  148. struct req_lib_cfg_replytoshutdown {
  149. coroipc_request_header_t header __attribute__((aligned(8)));
  150. unsigned int response;
  151. };
  152. struct res_lib_cfg_replytoshutdown {
  153. coroipc_response_header_t header __attribute__((aligned(8)));
  154. };
  155. struct res_lib_cfg_testshutdown {
  156. coroipc_response_header_t header __attribute__((aligned(8)));
  157. unsigned int flags;
  158. };
  159. struct req_lib_cfg_get_node_addrs {
  160. coroipc_request_header_t header __attribute__((aligned(8)));
  161. unsigned int nodeid;
  162. };
  163. struct res_lib_cfg_get_node_addrs {
  164. coroipc_response_header_t header __attribute__((aligned(8)));
  165. unsigned int family;
  166. unsigned int num_addrs;
  167. char addrs[TOTEMIP_ADDRLEN][0];
  168. };
  169. struct req_lib_cfg_local_get {
  170. coroipc_request_header_t header __attribute__((aligned(8)));
  171. };
  172. struct res_lib_cfg_local_get {
  173. coroipc_response_header_t header __attribute__((aligned(8)));
  174. mar_uint32_t local_nodeid __attribute__((aligned(8)));
  175. };
  176. typedef enum {
  177. AIS_AMF_ADMINISTRATIVETARGET_SERVICEUNIT = 0,
  178. AIS_AMF_ADMINISTRATIVETARGET_SERVICEGROUP = 1,
  179. AIS_AMF_ADMINISTRATIVETARGET_COMPONENTSERVICEINSTANCE = 2,
  180. AIS_AMF_ADMINISTRATIVETARGET_NODE = 3
  181. } corosync_administrative_target_t;
  182. typedef enum {
  183. AIS_AMF_ADMINISTRATIVESTATE_UNLOCKED = 0,
  184. AIS_AMF_ADMINISTRATIVESTATE_LOCKED = 1,
  185. AIS_AMF_ADMINISTRATIVESTATE_STOPPING = 2
  186. } corosync_administrative_state_t;
  187. typedef enum {
  188. CFG_SHUTDOWN_FLAG_REQUEST = 0,
  189. CFG_SHUTDOWN_FLAG_REGARDLESS = 1,
  190. CFG_SHUTDOWN_FLAG_IMMEDIATE = 2,
  191. } corosync_shutdown_flags_t;
  192. #endif /* IPC_CFG_H_DEFINED */