ipc_cfg.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. /*
  2. * Copyright (c) 2005 MontaVista Software, Inc.
  3. * Copyright (c) 2009-2013 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. #define CFG_INTERFACE_NAME_MAX_LEN 128
  41. #define CFG_INTERFACE_STATUS_MAX_LEN 512
  42. /*
  43. * Too keep future ABI compatibility, this value
  44. * is intentionaly bigger then INTERFACE_MAX
  45. */
  46. #define CFG_MAX_INTERFACES 16
  47. /**
  48. * @brief The req_lib_cfg_types enum
  49. */
  50. enum req_lib_cfg_types {
  51. MESSAGE_REQ_CFG_RINGSTATUSGET = 0,
  52. MESSAGE_REQ_CFG_RINGREENABLE = 1,
  53. MESSAGE_REQ_CFG_KILLNODE = 2,
  54. MESSAGE_REQ_CFG_TRYSHUTDOWN = 3,
  55. MESSAGE_REQ_CFG_REPLYTOSHUTDOWN = 4,
  56. MESSAGE_REQ_CFG_GET_NODE_ADDRS = 5,
  57. MESSAGE_REQ_CFG_LOCAL_GET = 6,
  58. MESSAGE_REQ_CFG_RELOAD_CONFIG = 7,
  59. MESSAGE_REQ_CFG_CRYPTO_SET = 8
  60. };
  61. /**
  62. * @brief The res_lib_cfg_types enum
  63. */
  64. enum res_lib_cfg_types {
  65. MESSAGE_RES_CFG_RINGSTATUSGET = 0,
  66. MESSAGE_RES_CFG_RINGREENABLE = 1,
  67. MESSAGE_RES_CFG_STATETRACKSTART = 2,
  68. MESSAGE_RES_CFG_STATETRACKSTOP = 3,
  69. MESSAGE_RES_CFG_ADMINISTRATIVESTATESET = 4,
  70. MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET = 5,
  71. MESSAGE_RES_CFG_SERVICELOAD = 6,
  72. MESSAGE_RES_CFG_SERVICEUNLOAD = 7,
  73. MESSAGE_RES_CFG_KILLNODE = 8,
  74. MESSAGE_RES_CFG_TRYSHUTDOWN = 9,
  75. MESSAGE_RES_CFG_TESTSHUTDOWN = 10,
  76. MESSAGE_RES_CFG_GET_NODE_ADDRS = 11,
  77. MESSAGE_RES_CFG_LOCAL_GET = 12,
  78. MESSAGE_RES_CFG_REPLYTOSHUTDOWN = 13,
  79. MESSAGE_RES_CFG_CRYPTO_SET = 14,
  80. MESSAGE_RES_CFG_RELOAD_CONFIG = 15
  81. };
  82. /**
  83. * @brief The req_lib_cfg_ringstatusget struct
  84. */
  85. struct req_lib_cfg_ringstatusget {
  86. struct qb_ipc_request_header header __attribute__((aligned(8)));
  87. };
  88. /**
  89. * @brief The res_lib_cfg_ringstatusget struct
  90. */
  91. struct res_lib_cfg_ringstatusget {
  92. struct qb_ipc_response_header header __attribute__((aligned(8)));
  93. mar_uint32_t interface_count __attribute__((aligned(8)));
  94. char interface_name[CFG_MAX_INTERFACES][CFG_INTERFACE_NAME_MAX_LEN] __attribute__((aligned(8)));
  95. char interface_status[CFG_MAX_INTERFACES][CFG_INTERFACE_STATUS_MAX_LEN] __attribute__((aligned(8)));
  96. };
  97. /**
  98. * @brief The req_lib_cfg_ringreenable struct
  99. */
  100. struct req_lib_cfg_ringreenable {
  101. struct qb_ipc_request_header header __attribute__((aligned(8)));
  102. };
  103. /**
  104. * @brief The res_lib_cfg_ringreenable struct
  105. */
  106. struct res_lib_cfg_ringreenable {
  107. struct qb_ipc_response_header header __attribute__((aligned(8)));
  108. };
  109. /**
  110. * @brief The req_lib_cfg_killnode struct
  111. */
  112. struct req_lib_cfg_killnode {
  113. struct qb_ipc_request_header header __attribute__((aligned(8)));
  114. unsigned int nodeid __attribute__((aligned(8)));
  115. cs_name_t reason __attribute__((aligned(8)));
  116. };
  117. /**
  118. * @brief The res_lib_cfg_killnode struct
  119. */
  120. struct res_lib_cfg_killnode {
  121. struct qb_ipc_response_header header __attribute__((aligned(8)));
  122. };
  123. /**
  124. * @brief The req_lib_cfg_tryshutdown struct
  125. */
  126. struct req_lib_cfg_tryshutdown {
  127. struct qb_ipc_request_header header __attribute__((aligned(8)));
  128. unsigned int flags;
  129. };
  130. /**
  131. * @brief The res_lib_cfg_tryshutdown struct
  132. */
  133. struct res_lib_cfg_tryshutdown {
  134. struct qb_ipc_response_header header __attribute__((aligned(8)));
  135. };
  136. /**
  137. * @brief The req_lib_cfg_replytoshutdown struct
  138. */
  139. struct req_lib_cfg_replytoshutdown {
  140. struct qb_ipc_request_header header __attribute__((aligned(8)));
  141. unsigned int response;
  142. };
  143. /**
  144. * @brief The res_lib_cfg_replytoshutdown struct
  145. */
  146. struct res_lib_cfg_replytoshutdown {
  147. struct qb_ipc_response_header header __attribute__((aligned(8)));
  148. };
  149. /**
  150. * @brief The res_lib_cfg_testshutdown struct
  151. */
  152. struct res_lib_cfg_testshutdown {
  153. struct qb_ipc_response_header header __attribute__((aligned(8)));
  154. unsigned int flags;
  155. };
  156. /**
  157. * @brief The req_lib_cfg_get_node_addrs struct
  158. */
  159. struct req_lib_cfg_get_node_addrs {
  160. struct qb_ipc_request_header header __attribute__((aligned(8)));
  161. unsigned int nodeid;
  162. };
  163. /**
  164. * @brief The res_lib_cfg_get_node_addrs struct
  165. */
  166. struct res_lib_cfg_get_node_addrs {
  167. struct qb_ipc_response_header header __attribute__((aligned(8)));
  168. unsigned int family;
  169. unsigned int num_addrs;
  170. /* array of TOTEMIP_ADDRLEN items */
  171. char addrs[];
  172. };
  173. /**
  174. * @brief The req_lib_cfg_local_get struct
  175. */
  176. struct req_lib_cfg_local_get {
  177. struct qb_ipc_request_header header __attribute__((aligned(8)));
  178. };
  179. /**
  180. * @brief The res_lib_cfg_local_get struct
  181. */
  182. struct res_lib_cfg_local_get {
  183. struct qb_ipc_response_header header __attribute__((aligned(8)));
  184. mar_uint32_t local_nodeid __attribute__((aligned(8)));
  185. };
  186. /**
  187. * @brief The req_lib_cfg_reload_config struct
  188. */
  189. struct req_lib_cfg_reload_config {
  190. struct qb_ipc_request_header header __attribute__((aligned(8)));
  191. };
  192. /**
  193. * @brief The res_lib_cfg_reload_config struct
  194. */
  195. struct res_lib_cfg_reload_config {
  196. struct qb_ipc_response_header header __attribute__((aligned(8)));
  197. };
  198. /**
  199. * @brief corosync_administrative_target_t enum
  200. */
  201. typedef enum {
  202. AIS_AMF_ADMINISTRATIVETARGET_SERVICEUNIT = 0,
  203. AIS_AMF_ADMINISTRATIVETARGET_SERVICEGROUP = 1,
  204. AIS_AMF_ADMINISTRATIVETARGET_COMPONENTSERVICEINSTANCE = 2,
  205. AIS_AMF_ADMINISTRATIVETARGET_NODE = 3
  206. } corosync_administrative_target_t;
  207. /**
  208. * @brief corosync_administrative_state_t enum
  209. */
  210. typedef enum {
  211. AIS_AMF_ADMINISTRATIVESTATE_UNLOCKED = 0,
  212. AIS_AMF_ADMINISTRATIVESTATE_LOCKED = 1,
  213. AIS_AMF_ADMINISTRATIVESTATE_STOPPING = 2
  214. } corosync_administrative_state_t;
  215. /**
  216. * @brief corosync_shutdown_flags_t enum
  217. */
  218. typedef enum {
  219. CFG_SHUTDOWN_FLAG_REQUEST = 0,
  220. CFG_SHUTDOWN_FLAG_REGARDLESS = 1,
  221. CFG_SHUTDOWN_FLAG_IMMEDIATE = 2,
  222. } corosync_shutdown_flags_t;
  223. #endif /* IPC_CFG_H_DEFINED */