Expose confdb write to the library.
[openais.git] / include / ipc_evt.h
blobf36ad9ebf957e231654ecc648350ba73ba966813
1 /*
2 * Copyright (c) 2004-2005 Mark Haverkamp
3 * Copyright (c) 2004-2005 Open Source Development Lab
5 * All rights reserved.
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:
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.
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.
34 #ifndef IPC_EVT_H_DEFINED
35 #define IPC_EVT_H_DEFINED
37 #include <netinet/in.h>
38 #include "saAis.h"
39 #include "saEvt.h"
40 #include "saClm.h"
41 #include "ipc_gen.h"
42 #include "mar_evt.h"
44 enum req_evt_types {
45 MESSAGE_REQ_EVT_OPEN_CHANNEL = 0,
46 MESSAGE_REQ_EVT_OPEN_CHANNEL_ASYNC = 1,
47 MESSAGE_REQ_EVT_CLOSE_CHANNEL = 2,
48 MESSAGE_REQ_EVT_UNLINK_CHANNEL = 3,
49 MESSAGE_REQ_EVT_SUBSCRIBE = 4,
50 MESSAGE_REQ_EVT_UNSUBSCRIBE = 5,
51 MESSAGE_REQ_EVT_PUBLISH = 6,
52 MESSAGE_REQ_EVT_CLEAR_RETENTIONTIME = 7,
53 MESSAGE_REQ_EVT_EVENT_DATA = 8
56 enum res_evt_types {
57 MESSAGE_RES_EVT_OPEN_CHANNEL = 0,
58 MESSAGE_RES_EVT_CLOSE_CHANNEL = 1,
59 MESSAGE_RES_EVT_UNLINK_CHANNEL = 2,
60 MESSAGE_RES_EVT_SUBSCRIBE = 3,
61 MESSAGE_RES_EVT_UNSUBSCRIBE = 4,
62 MESSAGE_RES_EVT_PUBLISH = 5,
63 MESSAGE_RES_EVT_CLEAR_RETENTIONTIME = 6,
64 MESSAGE_RES_EVT_CHAN_OPEN_CALLBACK = 7,
65 MESSAGE_RES_EVT_EVENT_DATA = 8,
66 MESSAGE_RES_EVT_AVAILABLE = 9
69 /*
70 * MESSAGE_REQ_EVT_OPEN_CHANNEL
71 * MESSAGE_REQ_EVT_OPEN_CHANNEL_ASYNC
73 * ico_head Request head
74 * ico_open_flag: Channel open flags
75 * ico_channel_name: Name of channel to open
76 * ico_c_handle: Local lib channel handle (used in returned event data)
77 * ico_timeout: Used only by open
78 * ico_invocation: Used only by async open
81 struct req_evt_channel_open {
82 mar_req_header_t ico_head __attribute__((aligned(8)));
83 mar_uint8_t ico_open_flag __attribute__((aligned(8)));
84 mar_name_t ico_channel_name __attribute__((aligned(8)));
85 mar_evtchannelhandle_t ico_c_handle __attribute__((aligned(8)));
86 mar_time_t ico_timeout __attribute__((aligned(8)));
87 mar_invocation_t ico_invocation __attribute__((aligned(8)));
91 * MESSAGE_RES_EVT_OPEN_CHANNEL
93 * Used by both the blocing and non-blocking
94 * versions. Only the error code in the header is used by the async
95 * open. The channel handle will be returnd via the channel open
96 * callback.
99 * ico_head: Results head
100 * ico_error: Request results
101 * ico_channel_handle: Server side channel handle (used in channel ops)
104 struct res_evt_channel_open {
106 mar_res_header_t ico_head __attribute__((aligned(8)));
107 mar_uint32_t ico_channel_handle __attribute__((aligned(8)));/* svr chan handle */
112 * MESSAGE_RES_EVT_CHAN_OPEN_CALLBACK
114 * ica_head: Results head.
115 * ica_c_handle: Lib size channel handle. So we can look
116 * up the new open channel info from the callback.
117 * ica_channel_handle: Server side handle.
118 * ica_invocation: Supplied by the user in the open call. Passed to
119 * the callback so the user can assocate the callback
120 * to the particular open.
122 struct res_evt_open_chan_async {
123 mar_res_header_t ica_head __attribute__((aligned(8)));
124 mar_evtchannelhandle_t ica_c_handle __attribute__((aligned(8)));
125 mar_uint32_t ica_channel_handle __attribute__((aligned(8)));
126 mar_invocation_t ica_invocation __attribute__((aligned(8)));
132 * MESSAGE_REQ_EVT_CLOSE_CHANNEL
134 * icc_head: Request head
135 * icc_channel_handle: Server handle of channel to close
138 struct req_evt_channel_close {
139 mar_req_header_t icc_head __attribute__((aligned(8)));
140 mar_uint32_t icc_channel_handle __attribute__((aligned(8)));
144 * MESSAGE_RES_EVT_CLOSE_CHANNEL
146 * icc_head: Results head
149 struct res_evt_channel_close {
150 mar_res_header_t icc_head __attribute__((aligned(8)));
154 * MESSAGE_REQ_EVT_UNLINK_CHANNEL
156 * iuc_head: Request head
157 * iuc_channel_name: Name of channel to unlink
160 struct req_evt_channel_unlink {
161 mar_req_header_t iuc_head __attribute__((aligned(8)));
162 mar_name_t iuc_channel_name __attribute__((aligned(8)));
166 * MESSAGE_RES_EVT_UNLINK_CHANNEL
168 * iuc_head: Results head
171 struct res_evt_channel_unlink {
172 mar_res_header_t iuc_head __attribute__((aligned(8)));
176 * MESSAGE_REQ_EVT_SUBSCRIBE
178 * ics_head: Request head
179 * ics_channel_handle: Server handle of channel
180 * ics_sub_id: Subscription ID
181 * ics_filter_size: Size of supplied filter data
182 * ics_filter_count: Number of filters supplied
183 * ics_filter_data: Filter data
186 struct req_evt_event_subscribe {
187 mar_req_header_t ics_head __attribute__((aligned(8)));
188 mar_uint32_t ics_channel_handle __attribute__((aligned(8)));
189 mar_evtsubscriptionid_t ics_sub_id __attribute__((aligned(8)));
190 mar_uint32_t ics_filter_size __attribute__((aligned(8)));
191 mar_uint32_t ics_filter_count __attribute__((aligned(8)));
192 mar_uint8_t ics_filter_data[0] __attribute__((aligned(8)));
197 * MESSAGE_RES_EVT_SUBSCRIBE
199 * ics_head: Result head
200 * ics_error: Request results
203 struct res_evt_event_subscribe {
204 mar_res_header_t ics_head __attribute__((aligned(8)));
208 * MESSAGE_REQ_EVT_UNSUBSCRIBE
210 * icu_head: Request head
211 * icu_channel_handle: Server handle of channel
212 * icu_sub_id: Subscription ID
215 struct req_evt_event_unsubscribe {
216 mar_req_header_t icu_head __attribute__((aligned(8)));
217 mar_uint32_t icu_channel_handle __attribute__((aligned(8)));
218 mar_evtsubscriptionid_t icu_sub_id __attribute__((aligned(8)));
223 * MESSAGE_RES_EVT_UNSUBSCRIBE
225 * icu_head: Results head
226 * icu_error: request result
229 struct res_evt_event_unsubscribe {
230 mar_res_header_t icu_head __attribute__((aligned(8)));
235 * MESSAGE_REQ_EVT_EVENT_DATA
236 * MESSAGE_RES_EVT_AVAILABLE
238 * evd_head: Request Head
240 struct res_evt_event_data {
241 mar_res_header_t evd_head __attribute__((aligned(8)));
245 * MESSAGE_REQ_EVT_PUBLISH (1)
246 * MESSAGE_RES_EVT_EVENT_DATA (2)
247 * MESSAGE_REQ_EXEC_EVT_EVENTDATA (3)
248 * MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA (4)
250 * led_head: Request/Results head
251 * led_addr: address of node (4 only)
252 * led_receive_time: Time that the message was received (4 only)
253 * led_svr_channel_handle: Server channel handle (1 only)
254 * led_lib_channel_handle: Lib channel handle (2 only)
255 * led_chan_name: Channel name (3 and 4 only)
256 * led_chan_unlink_id: directs delivery to unlinked channels.
257 * led_event_id: Event ID (2, 3 and 4 only)
258 * led_msg_id: message ID (2, 3 and 4 only)
259 * led_sub_id: Subscription ID (2 only)
260 * led_publisher_node_id: Node ID of event publisher
261 * led_publisher_name: Node name of event publisher
262 * led_retention_time: Event retention time
263 * led_publish_time: Publication time of the event
264 * led_priority: Event priority
265 * led_user_data_offset: Offset to user data
266 * led_user_data_size: Size of user data
267 * led_patterns_number: Number of patterns in the event
268 * led_body: Pattern and user data
270 struct lib_event_data {
271 mar_res_header_t led_head __attribute__((aligned(8)));
272 mar_uint32_t led_nodeid __attribute__((aligned(8)));
273 mar_time_t led_receive_time __attribute__((aligned(8)));
274 mar_uint32_t led_svr_channel_handle __attribute__((aligned(8)));
275 mar_evtchannelhandle_t led_lib_channel_handle __attribute__((aligned(8)));
276 mar_name_t led_chan_name __attribute__((aligned(8)));
277 mar_uint64_t led_chan_unlink_id __attribute__((aligned(8)));
278 mar_evteventid_t led_event_id __attribute__((aligned(8)));
279 mar_uint64_t led_msg_id __attribute__((aligned(8)));
280 mar_evtsubscriptionid_t led_sub_id __attribute__((aligned(8)));
281 mar_uint32_t led_publisher_node_id __attribute__((aligned(8)));
282 mar_name_t led_publisher_name __attribute__((aligned(8)));
283 mar_time_t led_retention_time __attribute__((aligned(8)));
284 mar_time_t led_publish_time __attribute__((aligned(8)));
285 mar_evteventpriority_t led_priority __attribute__((aligned(8)));
286 mar_uint32_t led_user_data_offset __attribute__((aligned(8)));
287 mar_uint32_t led_user_data_size __attribute__((aligned(8)));
288 mar_uint32_t led_patterns_number __attribute__((aligned(8)));
289 mar_uint8_t led_body[0] __attribute__((aligned(8)));
293 * MESSAGE_RES_EVT_PUBLISH
295 * iep_head: Result head
296 * iep_error: Request results
297 * iep_event_id: Event ID of published message
300 struct res_evt_event_publish {
301 mar_res_header_t iep_head __attribute__((aligned(8)));
302 mar_evteventid_t iep_event_id __attribute__((aligned(8)));
306 * MESSAGE_REQ_EVT_CLEAR_RETENTIONTIME
308 * Request message:
310 * iec_head: Request head
311 * iec_event_id: ID of event to clear
312 * iec_channel_handle: Server handle of associate channel
315 struct req_evt_event_clear_retentiontime {
317 mar_req_header_t iec_head __attribute__((aligned(8)));
318 mar_evteventid_t iec_event_id __attribute__((aligned(8)));
319 mar_uint32_t iec_channel_handle __attribute__((aligned(8)));
324 * MESSAGE_RES_EVT_CLEAR_RETENTIONTIME
326 * iec_head: Results head
327 * iec_error: Request result
330 struct res_evt_event_clear_retentiontime {
331 mar_res_header_t iec_head __attribute__((aligned(8)));
334 #endif /* AIS_EVT_H_DEFINED */