2 * Copyright (c) 2004 MontaVista Software, Inc.
3 * Copyright (c) 2006 Sun Microsystems, Inc.
7 * Author: Steven Dake (sdake@mvista.com)
9 * This software licensed under BSD license, the text of which follows:
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
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.
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.
35 #ifndef OPENAIS_EVS_H_DEFINED
36 #define OPENAIS_EVS_H_DEFINED
38 #include <sys/types.h>
39 #include <netinet/in.h>
42 * @defgroup openais Other API services provided by openais
45 * @addtogroup evs_openais
50 typedef uint64_t evs_handle_t
;
59 EVS_TYPE_UNORDERED
, /* not implemented */
60 EVS_TYPE_FIFO
, /* same as agreed */
62 EVS_TYPE_SAFE
/* not implemented */
69 EVS_ERR_TRY_AGAIN
= 6,
70 EVS_ERR_INVALID_PARAM
= 7,
71 EVS_ERR_NO_MEMORY
= 8,
72 EVS_ERR_BAD_HANDLE
= 9,
74 EVS_ERR_NOT_EXIST
= 12,
76 EVS_ERR_NOT_SUPPORTED
= 20,
77 EVS_ERR_SECURITY
= 29,
78 EVS_ERR_TOO_MANY_GROUPS
=30
81 #define TOTEMIP_ADDRLEN (sizeof(struct in6_addr))
83 /** These are the things that get passed around */
86 unsigned short family
;
87 unsigned char addr
[TOTEMIP_ADDRLEN
];
94 typedef void (*evs_deliver_fn_t
) (
99 typedef void (*evs_confchg_fn_t
) (
100 unsigned int *member_list
, int member_list_entries
,
101 unsigned int *left_list
, int left_list_entries
,
102 unsigned int *joined_list
, int joined_list_entries
);
105 evs_deliver_fn_t evs_deliver_fn
;
106 evs_confchg_fn_t evs_confchg_fn
;
112 * Create a new evs connection
114 evs_error_t
evs_initialize (
115 evs_handle_t
*handle
,
116 evs_callbacks_t
*callbacks
);
119 * Close the evs handle
121 evs_error_t
evs_finalize (
122 evs_handle_t handle
);
125 * Get a file descriptor on which to poll. evs_handle_t is NOT a
126 * file descriptor and may not be used directly.
128 evs_error_t
evs_fd_get (
133 * Dispatch messages and configuration changes
135 evs_error_t
evs_dispatch (
137 evs_dispatch_t dispatch_types
);
140 * Join one or more groups.
141 * messages multicasted with evs_mcast_joined will be sent to every
142 * group that has been joined on handle handle. Any message multicasted
143 * to a group that has been previously joined will be delivered in evs_dispatch
145 evs_error_t
evs_join (
147 struct evs_group
*groups
,
151 * Leave one or more groups
153 evs_error_t
evs_leave (
155 struct evs_group
*groups
,
159 * Multicast to groups joined with evs_join.
160 * The iovec described by iovec will be multicasted to all groups joined with
161 * the evs_join interface for handle.
163 evs_error_t
evs_mcast_joined (
165 evs_guarantee_t guarantee
,
170 * Multicast to specified groups.
171 * Messages will be multicast to groups specified in the api call and not those
172 * that have been joined (unless they are in the groups parameter).
174 evs_error_t
evs_mcast_groups (
176 evs_guarantee_t guarantee
,
177 struct evs_group
*groups
,
183 * Get membership information from evs
185 evs_error_t
evs_membership_get (
187 unsigned int *local_nodeid
,
188 unsigned int *member_list
,
189 unsigned int *member_list_entries
);
191 #endif /* OPENAIS_EVS_H_DEFINED */