ipc_cfg.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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_REOPEN_LOG_FILES = 8,
  60. MESSAGE_REQ_CFG_NODESTATUSGET = 9
  61. };
  62. /**
  63. * @brief The res_lib_cfg_types enum
  64. */
  65. enum res_lib_cfg_types {
  66. MESSAGE_RES_CFG_RINGSTATUSGET = 0,
  67. MESSAGE_RES_CFG_RINGREENABLE = 1,
  68. MESSAGE_RES_CFG_STATETRACKSTART = 2,
  69. MESSAGE_RES_CFG_STATETRACKSTOP = 3,
  70. MESSAGE_RES_CFG_ADMINISTRATIVESTATESET = 4,
  71. MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET = 5,
  72. MESSAGE_RES_CFG_SERVICELOAD = 6,
  73. MESSAGE_RES_CFG_SERVICEUNLOAD = 7,
  74. MESSAGE_RES_CFG_KILLNODE = 8,
  75. MESSAGE_RES_CFG_TRYSHUTDOWN = 9,
  76. MESSAGE_RES_CFG_TESTSHUTDOWN = 10,
  77. MESSAGE_RES_CFG_GET_NODE_ADDRS = 11,
  78. MESSAGE_RES_CFG_LOCAL_GET = 12,
  79. MESSAGE_RES_CFG_REPLYTOSHUTDOWN = 13,
  80. MESSAGE_RES_CFG_RELOAD_CONFIG = 14,
  81. MESSAGE_RES_CFG_REOPEN_LOG_FILES = 15,
  82. MESSAGE_RES_CFG_NODESTATUSGET = 16
  83. };
  84. /**
  85. * @brief The req_lib_cfg_ringstatusget struct
  86. */
  87. struct req_lib_cfg_ringstatusget {
  88. struct qb_ipc_request_header header __attribute__((aligned(8)));
  89. };
  90. /**
  91. * @brief The res_lib_cfg_ringstatusget struct
  92. */
  93. struct res_lib_cfg_ringstatusget {
  94. struct qb_ipc_response_header header __attribute__((aligned(8)));
  95. mar_uint32_t interface_count __attribute__((aligned(8)));
  96. char interface_name[CFG_MAX_INTERFACES][CFG_INTERFACE_NAME_MAX_LEN] __attribute__((aligned(8)));
  97. char interface_status[CFG_MAX_INTERFACES][CFG_INTERFACE_STATUS_MAX_LEN] __attribute__((aligned(8)));
  98. };
  99. /**
  100. * @brief The req_lib_cfg_nodestatusget struct
  101. */
  102. struct req_lib_cfg_nodestatusget {
  103. struct qb_ipc_request_header header __attribute__((aligned(8)));
  104. unsigned int nodeid __attribute__((aligned(8)));
  105. mar_uint32_t version __attribute__((aligned(8)));
  106. };
  107. /**
  108. * @brief The res_lib_cfg_nodestatusget struct
  109. */
  110. struct res_lib_cfg_nodestatusget {
  111. struct qb_ipc_response_header header __attribute__((aligned(8)));
  112. struct corosync_knet_node_status node_status __attribute__((aligned(8)));
  113. };
  114. /**
  115. * @brief The req_lib_cfg_ringreenable struct
  116. */
  117. struct req_lib_cfg_ringreenable {
  118. struct qb_ipc_request_header header __attribute__((aligned(8)));
  119. };
  120. /**
  121. * @brief The res_lib_cfg_ringreenable struct
  122. */
  123. struct res_lib_cfg_ringreenable {
  124. struct qb_ipc_response_header header __attribute__((aligned(8)));
  125. };
  126. /**
  127. * @brief The req_lib_cfg_killnode struct
  128. */
  129. struct req_lib_cfg_killnode {
  130. struct qb_ipc_request_header header __attribute__((aligned(8)));
  131. unsigned int nodeid __attribute__((aligned(8)));
  132. cs_name_t reason __attribute__((aligned(8)));
  133. };
  134. /**
  135. * @brief The res_lib_cfg_killnode struct
  136. */
  137. struct res_lib_cfg_killnode {
  138. struct qb_ipc_response_header header __attribute__((aligned(8)));
  139. };
  140. /**
  141. * @brief The req_lib_cfg_tryshutdown struct
  142. */
  143. struct req_lib_cfg_tryshutdown {
  144. struct qb_ipc_request_header header __attribute__((aligned(8)));
  145. unsigned int flags;
  146. };
  147. /**
  148. * @brief The res_lib_cfg_tryshutdown struct
  149. */
  150. struct res_lib_cfg_tryshutdown {
  151. struct qb_ipc_response_header header __attribute__((aligned(8)));
  152. };
  153. /**
  154. * @brief The req_lib_cfg_replytoshutdown struct
  155. */
  156. struct req_lib_cfg_replytoshutdown {
  157. struct qb_ipc_request_header header __attribute__((aligned(8)));
  158. unsigned int response;
  159. };
  160. /**
  161. * @brief The res_lib_cfg_replytoshutdown struct
  162. */
  163. struct res_lib_cfg_replytoshutdown {
  164. struct qb_ipc_response_header header __attribute__((aligned(8)));
  165. };
  166. /**
  167. * @brief The res_lib_cfg_testshutdown struct
  168. */
  169. struct res_lib_cfg_testshutdown {
  170. struct qb_ipc_response_header header __attribute__((aligned(8)));
  171. unsigned int flags;
  172. };
  173. /**
  174. * @brief The req_lib_cfg_get_node_addrs struct
  175. */
  176. struct req_lib_cfg_get_node_addrs {
  177. struct qb_ipc_request_header header __attribute__((aligned(8)));
  178. unsigned int nodeid;
  179. };
  180. /**
  181. * @brief The res_lib_cfg_get_node_addrs struct
  182. */
  183. struct res_lib_cfg_get_node_addrs {
  184. struct qb_ipc_response_header header __attribute__((aligned(8)));
  185. unsigned int family;
  186. unsigned int num_addrs;
  187. /* array of TOTEMIP_ADDRLEN items */
  188. char addrs[];
  189. };
  190. /**
  191. * @brief The req_lib_cfg_local_get struct
  192. */
  193. struct req_lib_cfg_local_get {
  194. struct qb_ipc_request_header header __attribute__((aligned(8)));
  195. };
  196. /**
  197. * @brief The res_lib_cfg_local_get struct
  198. */
  199. struct res_lib_cfg_local_get {
  200. struct qb_ipc_response_header header __attribute__((aligned(8)));
  201. mar_uint32_t local_nodeid __attribute__((aligned(8)));
  202. };
  203. /**
  204. * @brief The req_lib_cfg_reload_config struct
  205. */
  206. struct req_lib_cfg_reload_config {
  207. struct qb_ipc_request_header header __attribute__((aligned(8)));
  208. };
  209. /**
  210. * @brief The res_lib_cfg_reload_config struct
  211. */
  212. struct res_lib_cfg_reload_config {
  213. struct qb_ipc_response_header header __attribute__((aligned(8)));
  214. };
  215. /**
  216. * @brief The req_lib_cfg_reopen_log_files struct
  217. */
  218. struct req_lib_cfg_reopen_log_files {
  219. struct qb_ipc_request_header header __attribute__((aligned(8)));
  220. };
  221. /**
  222. * @brief The res_lib_cfg_reopen_log_files struct
  223. */
  224. struct res_lib_cfg_reopen_log_files {
  225. struct qb_ipc_response_header header __attribute__((aligned(8)));
  226. };
  227. /**
  228. * @brief corosync_administrative_target_t enum
  229. */
  230. typedef enum {
  231. AIS_AMF_ADMINISTRATIVETARGET_SERVICEUNIT = 0,
  232. AIS_AMF_ADMINISTRATIVETARGET_SERVICEGROUP = 1,
  233. AIS_AMF_ADMINISTRATIVETARGET_COMPONENTSERVICEINSTANCE = 2,
  234. AIS_AMF_ADMINISTRATIVETARGET_NODE = 3
  235. } corosync_administrative_target_t;
  236. /**
  237. * @brief corosync_administrative_state_t enum
  238. */
  239. typedef enum {
  240. AIS_AMF_ADMINISTRATIVESTATE_UNLOCKED = 0,
  241. AIS_AMF_ADMINISTRATIVESTATE_LOCKED = 1,
  242. AIS_AMF_ADMINISTRATIVESTATE_STOPPING = 2
  243. } corosync_administrative_state_t;
  244. /**
  245. * @brief corosync_shutdown_flags_t enum
  246. */
  247. typedef enum {
  248. CFG_SHUTDOWN_FLAG_REQUEST = 0,
  249. CFG_SHUTDOWN_FLAG_REGARDLESS = 1,
  250. CFG_SHUTDOWN_FLAG_IMMEDIATE = 2,
  251. } corosync_shutdown_flags_t;
  252. #endif /* IPC_CFG_H_DEFINED */