ipc_cfg.h 6.0 KB

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