ipc_cmap.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * Copyright (c) 2011 Red Hat, Inc.
  3. *
  4. * All rights reserved.
  5. *
  6. * Author: Jan Friesse (jfriesse@redhat.com)
  7. *
  8. * This software licensed under BSD license, the text of which follows:
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions are met:
  12. *
  13. * - Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * - Neither the name of the Red Hat, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. * THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef IPC_CMAP_H_DEFINED
  35. #define IPC_CMAP_H_DEFINED
  36. #include <netinet/in.h>
  37. #include <corosync/corotypes.h>
  38. #include <corosync/mar_gen.h>
  39. enum req_cmap_types {
  40. MESSAGE_REQ_CMAP_SET = 0,
  41. MESSAGE_REQ_CMAP_DELETE = 1,
  42. MESSAGE_REQ_CMAP_GET = 2,
  43. MESSAGE_REQ_CMAP_ADJUST_INT = 3,
  44. MESSAGE_REQ_CMAP_ITER_INIT = 4,
  45. MESSAGE_REQ_CMAP_ITER_NEXT = 5,
  46. MESSAGE_REQ_CMAP_ITER_FINALIZE = 6,
  47. MESSAGE_REQ_CMAP_TRACK_ADD = 7,
  48. MESSAGE_REQ_CMAP_TRACK_DELETE = 8,
  49. };
  50. enum res_cmap_types {
  51. MESSAGE_RES_CMAP_SET = 0,
  52. MESSAGE_RES_CMAP_DELETE = 1,
  53. MESSAGE_RES_CMAP_GET = 2,
  54. MESSAGE_RES_CMAP_ADJUST_INT = 3,
  55. MESSAGE_RES_CMAP_ITER_INIT = 4,
  56. MESSAGE_RES_CMAP_ITER_NEXT = 5,
  57. MESSAGE_RES_CMAP_ITER_FINALIZE = 6,
  58. MESSAGE_RES_CMAP_TRACK_ADD = 7,
  59. MESSAGE_RES_CMAP_TRACK_DELETE = 8,
  60. MESSAGE_RES_CMAP_NOTIFY_CALLBACK = 9,
  61. };
  62. struct req_lib_cmap_set {
  63. struct qb_ipc_request_header header __attribute__((aligned(8)));
  64. mar_name_t key_name __attribute__((aligned(8)));
  65. mar_size_t value_len __attribute__((aligned(8)));
  66. mar_uint8_t type __attribute__((aligned(8)));
  67. mar_uint8_t value[] __attribute__((aligned(8)));
  68. };
  69. struct res_lib_cmap_set {
  70. struct qb_ipc_response_header header __attribute__((aligned(8)));
  71. };
  72. struct req_lib_cmap_delete {
  73. struct qb_ipc_request_header header __attribute__((aligned(8)));
  74. mar_name_t key_name __attribute__((aligned(8)));
  75. };
  76. struct res_lib_cmap_delete {
  77. struct qb_ipc_response_header header __attribute__((aligned(8)));
  78. };
  79. struct req_lib_cmap_get {
  80. struct qb_ipc_request_header header __attribute__((aligned(8)));
  81. mar_name_t key_name __attribute__((aligned(8)));
  82. mar_size_t value_len __attribute__((aligned(8)));
  83. };
  84. struct res_lib_cmap_get {
  85. struct qb_ipc_response_header header __attribute__((aligned(8)));
  86. mar_size_t value_len __attribute__((aligned(8)));
  87. mar_uint8_t type __attribute__((aligned(8)));
  88. mar_uint8_t value[] __attribute__((aligned(8)));
  89. };
  90. struct req_lib_cmap_adjust_int {
  91. struct qb_ipc_request_header header __attribute__((aligned(8)));
  92. mar_name_t key_name __attribute__((aligned(8)));
  93. mar_int32_t step __attribute__((aligned(8)));
  94. };
  95. struct res_lib_cmap_adjust_int {
  96. struct qb_ipc_response_header header __attribute__((aligned(8)));
  97. };
  98. struct req_lib_cmap_iter_init {
  99. struct qb_ipc_request_header header __attribute__((aligned(8)));
  100. mar_name_t prefix __attribute__((aligned(8)));
  101. };
  102. struct res_lib_cmap_iter_init {
  103. struct qb_ipc_response_header header __attribute__((aligned(8)));
  104. mar_uint64_t iter_handle __attribute__((aligned(8)));
  105. };
  106. struct req_lib_cmap_iter_next {
  107. struct qb_ipc_request_header header __attribute__((aligned(8)));
  108. mar_uint64_t iter_handle __attribute__((aligned(8)));
  109. };
  110. struct res_lib_cmap_iter_next {
  111. struct qb_ipc_response_header header __attribute__((aligned(8)));
  112. mar_name_t key_name __attribute__((aligned(8)));
  113. mar_size_t value_len __attribute__((aligned(8)));
  114. mar_uint8_t type __attribute__((aligned(8)));
  115. };
  116. struct req_lib_cmap_iter_finalize {
  117. struct qb_ipc_request_header header __attribute__((aligned(8)));
  118. mar_uint64_t iter_handle __attribute__((aligned(8)));
  119. };
  120. struct res_lib_cmap_iter_finalize {
  121. struct qb_ipc_response_header header __attribute__((aligned(8)));
  122. };
  123. struct req_lib_cmap_track_add {
  124. struct qb_ipc_request_header header __attribute__((aligned(8)));
  125. mar_name_t key_name __attribute__((aligned(8)));
  126. mar_int32_t track_type __attribute__((aligned(8)));
  127. mar_uint64_t track_inst_handle __attribute__((aligned(8)));
  128. };
  129. struct res_lib_cmap_track_add {
  130. struct qb_ipc_response_header header __attribute__((aligned(8)));
  131. mar_uint64_t track_handle __attribute__((aligned(8)));
  132. };
  133. struct req_lib_cmap_track_delete {
  134. struct qb_ipc_request_header header __attribute__((aligned(8)));
  135. mar_uint64_t track_handle __attribute__((aligned(8)));
  136. };
  137. struct res_lib_cmap_track_delete {
  138. struct qb_ipc_response_header header __attribute__((aligned(8)));
  139. mar_uint64_t track_inst_handle __attribute__((aligned(8)));
  140. };
  141. struct res_lib_cmap_notify_callback {
  142. struct qb_ipc_response_header header __attribute__((aligned(8)));
  143. mar_uint64_t track_inst_handle __attribute__((aligned(8)));
  144. mar_name_t key_name __attribute__((aligned(8)));
  145. mar_int32_t event __attribute__((aligned(8)));
  146. mar_uint8_t new_value_type __attribute__((aligned(8)));
  147. mar_uint8_t old_value_type __attribute__((aligned(8)));
  148. mar_size_t new_value_len __attribute__((aligned(8)));
  149. mar_size_t old_value_len __attribute__((aligned(8)));
  150. /*
  151. * After old_vale_len, there are two items with length of new_value_len
  152. * and old_value_len, only first (as a pointer) is defined
  153. *
  154. * mar_uint8_t *new_value;
  155. * mar_uint8_t *old_value;
  156. */
  157. mar_uint8_t new_value[];
  158. };
  159. #endif /* IPC_CMAP_H_DEFINED */