2 * Copyright (c) 2002-2006 MontaVista Software, Inc.
6 * Author: Steven Dake (sdake@mvista.com)
8 * This software licensed under BSD license, the text of which follows:
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
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 MontaVista Software, 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.
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.
34 #ifndef OPENAIS_SERVICE_H_DEFINED
35 #define OPENAIS_SERVICE_H_DEFINED
37 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
38 #define SERVICE_HANDLER_MAXIMUM_COUNT 64
40 enum openais_flow_control
{
41 OPENAIS_FLOW_CONTROL_REQUIRED
= 1,
42 OPENAIS_FLOW_CONTROL_NOT_REQUIRED
= 2
45 struct openais_lib_handler
{
46 void (*lib_handler_fn
) (void *conn
, void *msg
);
49 enum openais_flow_control flow_control
;
52 struct openais_exec_handler
{
53 void (*exec_handler_fn
) (void *msg
, unsigned int nodeid
);
54 void (*exec_endian_convert_fn
) (void *msg
);
57 struct openais_service_handler
{
60 unsigned int private_data_size
;
61 enum openais_flow_control flow_control
;
62 int (*lib_init_fn
) (void *conn
);
63 int (*lib_exit_fn
) (void *conn
);
64 struct openais_lib_handler
*lib_service
;
65 int lib_service_count
;
66 struct openais_exec_handler
*exec_service
;
67 int (*exec_init_fn
) (struct objdb_iface_ver0
*);
68 int (*config_init_fn
) (struct objdb_iface_ver0
*);
69 void (*exec_dump_fn
) (void);
70 int exec_service_count
;
72 enum totem_configuration_type configuration_type
,
73 unsigned int *member_list
, int member_list_entries
,
74 unsigned int *left_list
, int left_list_entries
,
75 unsigned int *joined_list
, int joined_list_entries
,
76 struct memb_ring_id
*ring_id
);
77 void (*sync_init
) (void);
78 int (*sync_process
) (void);
79 void (*sync_activate
) (void);
80 void (*sync_abort
) (void);
83 struct openais_service_handler_iface_ver0
{
85 struct openais_service_handler
*(*openais_get_service_handler_ver0
) (void);
88 extern int openais_service_objdb_add (
89 struct objdb_iface_ver0
*objdb
,
94 extern int openais_service_handler_register (
95 struct openais_service_handler
*handler
);
97 extern int openais_service_default_objdb_set (struct objdb_iface_ver0
*objdb
);
99 extern int openais_service_link_all (
100 struct objdb_iface_ver0
*objdb
);
102 extern int openais_service_init_all (
104 struct objdb_iface_ver0
*objdb
);
106 extern struct openais_service_handler
*ais_service
[];
108 #endif /* SERVICE_H_DEFINED */