4
0

ipc_evt.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. /*
  2. * Copyright (c) 2004-2005 Mark Haverkamp
  3. * Copyright (c) 2004-2005 Open Source Development Lab
  4. *
  5. * All rights reserved.
  6. *
  7. * This software licensed under BSD license, the text of which follows:
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions are met:
  11. *
  12. * - Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. * - Redistributions in binary form must reproduce the above copyright notice,
  15. * this list of conditions and the following disclaimer in the documentation
  16. * and/or other materials provided with the distribution.
  17. * - Neither the name of the Open Source Developement Lab nor the names of its
  18. * contributors may be used to endorse or promote products derived from this
  19. * software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  25. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  26. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  27. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  28. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  29. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  30. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  31. * THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #ifndef IPC_EVT_H_DEFINED
  34. #define IPC_EVT_H_DEFINED
  35. #include <netinet/in.h>
  36. #include "saAis.h"
  37. #include "saEvt.h"
  38. #include "saClm.h"
  39. #include "ipc_gen.h"
  40. #include "mar_evt.h"
  41. enum req_evt_types {
  42. MESSAGE_REQ_EVT_OPEN_CHANNEL = 0,
  43. MESSAGE_REQ_EVT_OPEN_CHANNEL_ASYNC = 1,
  44. MESSAGE_REQ_EVT_CLOSE_CHANNEL = 2,
  45. MESSAGE_REQ_EVT_UNLINK_CHANNEL = 3,
  46. MESSAGE_REQ_EVT_SUBSCRIBE = 4,
  47. MESSAGE_REQ_EVT_UNSUBSCRIBE = 5,
  48. MESSAGE_REQ_EVT_PUBLISH = 6,
  49. MESSAGE_REQ_EVT_CLEAR_RETENTIONTIME = 7,
  50. MESSAGE_REQ_EVT_EVENT_DATA = 8
  51. };
  52. enum res_evt_types {
  53. MESSAGE_RES_EVT_OPEN_CHANNEL = 0,
  54. MESSAGE_RES_EVT_CLOSE_CHANNEL = 1,
  55. MESSAGE_RES_EVT_UNLINK_CHANNEL = 2,
  56. MESSAGE_RES_EVT_SUBSCRIBE = 3,
  57. MESSAGE_RES_EVT_UNSUBSCRIBE = 4,
  58. MESSAGE_RES_EVT_PUBLISH = 5,
  59. MESSAGE_RES_EVT_CLEAR_RETENTIONTIME = 6,
  60. MESSAGE_RES_EVT_CHAN_OPEN_CALLBACK = 7,
  61. MESSAGE_RES_EVT_EVENT_DATA = 8,
  62. MESSAGE_RES_EVT_AVAILABLE = 9
  63. };
  64. /*
  65. * MESSAGE_REQ_EVT_OPEN_CHANNEL
  66. * MESSAGE_REQ_EVT_OPEN_CHANNEL_ASYNC
  67. *
  68. * ico_head Request head
  69. * ico_open_flag: Channel open flags
  70. * ico_channel_name: Name of channel to open
  71. * ico_c_handle: Local lib channel handle (used in returned event data)
  72. * ico_timeout: Used only by open
  73. * ico_invocation: Used only by async open
  74. *
  75. */
  76. struct req_evt_channel_open {
  77. mar_req_header_t ico_head __attribute__((aligned(8)));
  78. mar_uint8_t ico_open_flag __attribute__((aligned(8)));
  79. mar_name_t ico_channel_name __attribute__((aligned(8)));
  80. mar_evtchannelhandle_t ico_c_handle __attribute__((aligned(8)));
  81. mar_time_t ico_timeout __attribute__((aligned(8)));
  82. mar_invocation_t ico_invocation __attribute__((aligned(8)));
  83. };
  84. /*
  85. * MESSAGE_RES_EVT_OPEN_CHANNEL
  86. *
  87. * Used by both the blocing and non-blocking
  88. * versions. Only the error code in the header is used by the async
  89. * open. The channel handle will be returnd via the channel open
  90. * callback.
  91. *
  92. *
  93. * ico_head: Results head
  94. * ico_error: Request results
  95. * ico_channel_handle: Server side channel handle (used in channel ops)
  96. *
  97. */
  98. struct res_evt_channel_open {
  99. mar_res_header_t ico_head __attribute__((aligned(8)));
  100. mar_uint32_t ico_channel_handle __attribute__((aligned(8)));/* svr chan handle */
  101. };
  102. /*
  103. * MESSAGE_RES_EVT_CHAN_OPEN_CALLBACK
  104. *
  105. * ica_head: Results head.
  106. * ica_c_handle: Lib size channel handle. So we can look
  107. * up the new open channel info from the callback.
  108. * ica_channel_handle: Server side handle.
  109. * ica_invocation: Supplied by the user in the open call. Passed to
  110. * the callback so the user can assocate the callback
  111. * to the particular open.
  112. */
  113. struct res_evt_open_chan_async {
  114. mar_res_header_t ica_head __attribute__((aligned(8)));
  115. mar_evtchannelhandle_t ica_c_handle __attribute__((aligned(8)));
  116. mar_uint32_t ica_channel_handle __attribute__((aligned(8)));
  117. mar_invocation_t ica_invocation __attribute__((aligned(8)));
  118. };
  119. /*
  120. * MESSAGE_REQ_EVT_CLOSE_CHANNEL
  121. *
  122. * icc_head: Request head
  123. * icc_channel_handle: Server handle of channel to close
  124. *
  125. */
  126. struct req_evt_channel_close {
  127. mar_req_header_t icc_head __attribute__((aligned(8)));
  128. mar_uint32_t icc_channel_handle __attribute__((aligned(8)));
  129. };
  130. /*
  131. * MESSAGE_RES_EVT_CLOSE_CHANNEL
  132. *
  133. * icc_head: Results head
  134. *
  135. */
  136. struct res_evt_channel_close {
  137. mar_res_header_t icc_head __attribute__((aligned(8)));
  138. };
  139. /*
  140. * MESSAGE_REQ_EVT_UNLINK_CHANNEL
  141. *
  142. * iuc_head: Request head
  143. * iuc_channel_name: Name of channel to unlink
  144. *
  145. */
  146. struct req_evt_channel_unlink {
  147. mar_req_header_t iuc_head __attribute__((aligned(8)));
  148. mar_name_t iuc_channel_name __attribute__((aligned(8)));
  149. };
  150. /*
  151. * MESSAGE_RES_EVT_UNLINK_CHANNEL
  152. *
  153. * iuc_head: Results head
  154. *
  155. */
  156. struct res_evt_channel_unlink {
  157. mar_res_header_t iuc_head __attribute__((aligned(8)));
  158. };
  159. /*
  160. * MESSAGE_REQ_EVT_SUBSCRIBE
  161. *
  162. * ics_head: Request head
  163. * ics_channel_handle: Server handle of channel
  164. * ics_sub_id: Subscription ID
  165. * ics_filter_size: Size of supplied filter data
  166. * ics_filter_count: Number of filters supplied
  167. * ics_filter_data: Filter data
  168. *
  169. */
  170. struct req_evt_event_subscribe {
  171. mar_req_header_t ics_head __attribute__((aligned(8)));
  172. mar_uint32_t ics_channel_handle __attribute__((aligned(8)));
  173. mar_evtsubscriptionid_t ics_sub_id __attribute__((aligned(8)));
  174. mar_uint32_t ics_filter_size __attribute__((aligned(8)));
  175. mar_uint32_t ics_filter_count __attribute__((aligned(8)));
  176. mar_uint8_t ics_filter_data[0] __attribute__((aligned(8)));
  177. };
  178. /*
  179. * MESSAGE_RES_EVT_SUBSCRIBE
  180. *
  181. * ics_head: Result head
  182. * ics_error: Request results
  183. *
  184. */
  185. struct res_evt_event_subscribe {
  186. mar_res_header_t ics_head __attribute__((aligned(8)));
  187. };
  188. /*
  189. * MESSAGE_REQ_EVT_UNSUBSCRIBE
  190. *
  191. * icu_head: Request head
  192. * icu_channel_handle: Server handle of channel
  193. * icu_sub_id: Subscription ID
  194. *
  195. */
  196. struct req_evt_event_unsubscribe {
  197. mar_req_header_t icu_head __attribute__((aligned(8)));
  198. mar_uint32_t icu_channel_handle __attribute__((aligned(8)));
  199. mar_evtsubscriptionid_t icu_sub_id __attribute__((aligned(8)));
  200. };
  201. /*
  202. * MESSAGE_RES_EVT_UNSUBSCRIBE
  203. *
  204. * icu_head: Results head
  205. * icu_error: request result
  206. *
  207. */
  208. struct res_evt_event_unsubscribe {
  209. mar_res_header_t icu_head __attribute__((aligned(8)));
  210. };
  211. /*
  212. * MESSAGE_REQ_EVT_EVENT_DATA
  213. * MESSAGE_RES_EVT_AVAILABLE
  214. *
  215. * evd_head: Request Head
  216. */
  217. struct res_evt_event_data {
  218. mar_res_header_t evd_head __attribute__((aligned(8)));
  219. };
  220. /*
  221. * MESSAGE_REQ_EVT_PUBLISH (1)
  222. * MESSAGE_RES_EVT_EVENT_DATA (2)
  223. * MESSAGE_REQ_EXEC_EVT_EVENTDATA (3)
  224. * MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA (4)
  225. *
  226. * led_head: Request/Results head
  227. * led_addr: address of node (4 only)
  228. * led_receive_time: Time that the message was received (4 only)
  229. * led_svr_channel_handle: Server channel handle (1 only)
  230. * led_lib_channel_handle: Lib channel handle (2 only)
  231. * led_chan_name: Channel name (3 and 4 only)
  232. * led_chan_unlink_id: directs delivery to unlinked channels.
  233. * led_event_id: Event ID (2, 3 and 4 only)
  234. * led_msg_id: message ID (2, 3 and 4 only)
  235. * led_sub_id: Subscription ID (2 only)
  236. * led_publisher_node_id: Node ID of event publisher
  237. * led_publisher_name: Node name of event publisher
  238. * led_retention_time: Event retention time
  239. * led_publish_time: Publication time of the event
  240. * led_priority: Event priority
  241. * led_user_data_offset: Offset to user data
  242. * led_user_data_size: Size of user data
  243. * led_patterns_number: Number of patterns in the event
  244. * led_body: Pattern and user data
  245. */
  246. struct lib_event_data {
  247. mar_res_header_t led_head __attribute__((aligned(8)));
  248. mar_uint32_t led_nodeid __attribute__((aligned(8)));
  249. mar_time_t led_receive_time __attribute__((aligned(8)));
  250. mar_uint32_t led_svr_channel_handle __attribute__((aligned(8)));
  251. mar_evtchannelhandle_t led_lib_channel_handle __attribute__((aligned(8)));
  252. mar_name_t led_chan_name __attribute__((aligned(8)));
  253. mar_uint64_t led_chan_unlink_id __attribute__((aligned(8)));
  254. mar_evteventid_t led_event_id __attribute__((aligned(8)));
  255. mar_uint64_t led_msg_id __attribute__((aligned(8)));
  256. mar_evtsubscriptionid_t led_sub_id __attribute__((aligned(8)));
  257. mar_uint32_t led_publisher_node_id __attribute__((aligned(8)));
  258. mar_name_t led_publisher_name __attribute__((aligned(8)));
  259. mar_time_t led_retention_time __attribute__((aligned(8)));
  260. mar_time_t led_publish_time __attribute__((aligned(8)));
  261. mar_evteventpriority_t led_priority __attribute__((aligned(8)));
  262. mar_uint32_t led_user_data_offset __attribute__((aligned(8)));
  263. mar_uint32_t led_user_data_size __attribute__((aligned(8)));
  264. mar_uint32_t led_patterns_number __attribute__((aligned(8)));
  265. mar_uint8_t led_body[0] __attribute__((aligned(8)));
  266. };
  267. /*
  268. * MESSAGE_RES_EVT_PUBLISH
  269. *
  270. * iep_head: Result head
  271. * iep_error: Request results
  272. * iep_event_id: Event ID of published message
  273. *
  274. */
  275. struct res_evt_event_publish {
  276. mar_res_header_t iep_head __attribute__((aligned(8)));
  277. mar_evteventid_t iep_event_id __attribute__((aligned(8)));
  278. };
  279. /*
  280. * MESSAGE_REQ_EVT_CLEAR_RETENTIONTIME
  281. *
  282. * Request message:
  283. *
  284. * iec_head: Request head
  285. * iec_event_id: ID of event to clear
  286. * iec_channel_handle: Server handle of associate channel
  287. *
  288. */
  289. struct req_evt_event_clear_retentiontime {
  290. mar_req_header_t iec_head __attribute__((aligned(8)));
  291. mar_evteventid_t iec_event_id __attribute__((aligned(8)));
  292. mar_uint32_t iec_channel_handle __attribute__((aligned(8)));
  293. };
  294. /*
  295. * MESSAGE_RES_EVT_CLEAR_RETENTIONTIME
  296. *
  297. * iec_head: Results head
  298. * iec_error: Request result
  299. *
  300. */
  301. struct res_evt_event_clear_retentiontime {
  302. mar_res_header_t iec_head __attribute__((aligned(8)));
  303. };
  304. #endif /* AIS_EVT_H_DEFINED */