ipc_cfg.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. * Copyright (c) 2005 MontaVista Software, Inc.
  3. * Copyright (c) 2009-2012 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_KILLNODE = 2,
  44. MESSAGE_REQ_CFG_TRYSHUTDOWN = 3,
  45. MESSAGE_REQ_CFG_REPLYTOSHUTDOWN = 4,
  46. MESSAGE_REQ_CFG_GET_NODE_ADDRS = 5,
  47. MESSAGE_REQ_CFG_LOCAL_GET = 6,
  48. MESSAGE_REQ_CFG_CRYPTO_SET = 7
  49. };
  50. enum res_lib_cfg_types {
  51. MESSAGE_RES_CFG_RINGSTATUSGET = 0,
  52. MESSAGE_RES_CFG_RINGREENABLE = 1,
  53. MESSAGE_RES_CFG_STATETRACKSTART = 2,
  54. MESSAGE_RES_CFG_STATETRACKSTOP = 3,
  55. MESSAGE_RES_CFG_ADMINISTRATIVESTATESET = 4,
  56. MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET = 5,
  57. MESSAGE_RES_CFG_SERVICELOAD = 6,
  58. MESSAGE_RES_CFG_SERVICEUNLOAD = 7,
  59. MESSAGE_RES_CFG_KILLNODE = 8,
  60. MESSAGE_RES_CFG_TRYSHUTDOWN = 9,
  61. MESSAGE_RES_CFG_TESTSHUTDOWN = 10,
  62. MESSAGE_RES_CFG_GET_NODE_ADDRS = 11,
  63. MESSAGE_RES_CFG_LOCAL_GET = 12,
  64. MESSAGE_RES_CFG_REPLYTOSHUTDOWN = 13,
  65. MESSAGE_RES_CFG_CRYPTO_SET = 14,
  66. };
  67. struct req_lib_cfg_ringstatusget {
  68. struct qb_ipc_request_header header __attribute__((aligned(8)));
  69. };
  70. struct res_lib_cfg_ringstatusget {
  71. struct qb_ipc_response_header header __attribute__((aligned(8)));
  72. mar_uint32_t interface_count __attribute__((aligned(8)));
  73. char interface_name[16][128] __attribute__((aligned(8)));
  74. char interface_status[16][512] __attribute__((aligned(8)));
  75. };
  76. struct req_lib_cfg_ringreenable {
  77. struct qb_ipc_request_header header __attribute__((aligned(8)));
  78. };
  79. struct res_lib_cfg_ringreenable {
  80. struct qb_ipc_response_header header __attribute__((aligned(8)));
  81. };
  82. struct req_lib_cfg_killnode {
  83. struct qb_ipc_request_header header __attribute__((aligned(8)));
  84. unsigned int nodeid __attribute__((aligned(8)));
  85. cs_name_t reason __attribute__((aligned(8)));
  86. };
  87. struct res_lib_cfg_killnode {
  88. struct qb_ipc_response_header header __attribute__((aligned(8)));
  89. };
  90. struct req_lib_cfg_tryshutdown {
  91. struct qb_ipc_request_header header __attribute__((aligned(8)));
  92. unsigned int flags;
  93. };
  94. struct res_lib_cfg_tryshutdown {
  95. struct qb_ipc_response_header header __attribute__((aligned(8)));
  96. };
  97. struct req_lib_cfg_replytoshutdown {
  98. struct qb_ipc_request_header header __attribute__((aligned(8)));
  99. unsigned int response;
  100. };
  101. struct res_lib_cfg_replytoshutdown {
  102. struct qb_ipc_response_header header __attribute__((aligned(8)));
  103. };
  104. struct res_lib_cfg_testshutdown {
  105. struct qb_ipc_response_header header __attribute__((aligned(8)));
  106. unsigned int flags;
  107. };
  108. struct req_lib_cfg_get_node_addrs {
  109. struct qb_ipc_request_header header __attribute__((aligned(8)));
  110. unsigned int nodeid;
  111. };
  112. struct res_lib_cfg_get_node_addrs {
  113. struct qb_ipc_response_header header __attribute__((aligned(8)));
  114. unsigned int family;
  115. unsigned int num_addrs;
  116. char addrs[TOTEMIP_ADDRLEN][0];
  117. };
  118. struct req_lib_cfg_local_get {
  119. struct qb_ipc_request_header header __attribute__((aligned(8)));
  120. };
  121. struct res_lib_cfg_local_get {
  122. struct qb_ipc_response_header header __attribute__((aligned(8)));
  123. mar_uint32_t local_nodeid __attribute__((aligned(8)));
  124. };
  125. struct req_lib_cfg_crypto_set {
  126. struct qb_ipc_response_header header __attribute__((aligned(8)));
  127. mar_uint32_t type __attribute__((aligned(8)));
  128. };
  129. struct res_lib_cfg_crypto_set {
  130. struct qb_ipc_response_header header __attribute__((aligned(8)));
  131. };
  132. typedef enum {
  133. AIS_AMF_ADMINISTRATIVETARGET_SERVICEUNIT = 0,
  134. AIS_AMF_ADMINISTRATIVETARGET_SERVICEGROUP = 1,
  135. AIS_AMF_ADMINISTRATIVETARGET_COMPONENTSERVICEINSTANCE = 2,
  136. AIS_AMF_ADMINISTRATIVETARGET_NODE = 3
  137. } corosync_administrative_target_t;
  138. typedef enum {
  139. AIS_AMF_ADMINISTRATIVESTATE_UNLOCKED = 0,
  140. AIS_AMF_ADMINISTRATIVESTATE_LOCKED = 1,
  141. AIS_AMF_ADMINISTRATIVESTATE_STOPPING = 2
  142. } corosync_administrative_state_t;
  143. typedef enum {
  144. CFG_SHUTDOWN_FLAG_REQUEST = 0,
  145. CFG_SHUTDOWN_FLAG_REGARDLESS = 1,
  146. CFG_SHUTDOWN_FLAG_IMMEDIATE = 2,
  147. } corosync_shutdown_flags_t;
  148. #endif /* IPC_CFG_H_DEFINED */