ipc_cfg.h 7.4 KB

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