ipc_cfg.h 6.8 KB

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