Просмотр исходного кода

Add some totem process group interfaces to the API.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1628 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 лет назад
Родитель
Сommit
cd2f61adfd
2 измененных файлов с 86 добавлено и 0 удалено
  1. 17 0
      exec/apidef.c
  2. 69 0
      include/coroapi.h

+ 17 - 0
exec/apidef.c

@@ -51,6 +51,15 @@
 
 LOGSYS_DECLARE_SUBSYS ("APIDEF", LOG_INFO);
 
+/*
+ * Remove compile warnings about type name changes
+ */
+typedef int (*typedef_tpg_join) (corosync_tpg_handle, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_leave) (corosync_tpg_handle, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_groups_mcast) (corosync_tpg_handle, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_groups_send_ok) (corosync_tpg_handle, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+
+
 static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.timer_add_duration = openais_timer_add_duration,
 	.timer_add_absolute = openais_timer_add_absolute,
@@ -75,6 +84,14 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.totem_ifaces_get = totempg_ifaces_get,
 	.totem_ifaces_print = totempg_ifaces_print,
 	.totem_ip_print = totemip_print,
+	.tpg_init = totempg_groups_initialize,
+	.tpg_exit = NULL, /* missing from totempg api */
+	.tpg_join = (typedef_tpg_join)totempg_groups_join,
+	.tpg_leave = (typedef_tpg_leave)totempg_groups_leave,
+	.tpg_joined_mcast = totempg_groups_mcast_joined,
+	.tpg_joined_send_ok = totempg_groups_send_ok_joined,
+	.tpg_groups_mcast = (typedef_tpg_groups_mcast)totempg_groups_mcast_groups,
+	.tpg_groups_send_ok = (typedef_tpg_groups_send_ok)totempg_groups_send_ok_groups,
 	.service_link_and_init = openais_service_link_and_init,
 	.service_unlink_and_exit = openais_service_unlink_and_exit,
 	.plugin_interface_reference = lcr_ifact_reference,

+ 69 - 0
include/coroapi.h

@@ -38,6 +38,13 @@
 
 typedef void * corosync_timer_handle_t;
 
+typedef unsigned int corosync_tpg_handle;
+
+struct corosync_tpg_group {
+	void *group;
+	int group_len;
+};
+
 #define TOTEMIP_ADDRLEN (sizeof(struct in6_addr))
 
 #define PROCESSOR_COUNT_MAX 384
@@ -357,6 +364,68 @@ struct corosync_api_v1 {
 
 	char *(*totem_ip_print) (struct totem_ip_address *addr);
 
+	/*
+	 * Totem open process groups API for those service engines
+	 * wanting their own groups
+	 */
+	int (*tpg_init) (
+		corosync_tpg_handle *handle,
+
+		void (*deliver_fn) (
+			unsigned int nodeid,
+			struct iovec *iovec,
+			int iov_len,
+			int endian_conversion_required),
+
+		void (*confchg_fn) (
+			enum totem_configuration_type configuration_type,
+			unsigned int *member_list, int member_list_entries,
+			unsigned int *left_list, int left_list_entries,
+			unsigned int *joined_list, int joined_list_entries,
+			struct memb_ring_id *ring_id));
+
+	int (*tpg_exit) (
+       		corosync_tpg_handle handle);
+
+	int (*tpg_join) (
+		corosync_tpg_handle handle,
+		struct corosync_tpg_group *groups,
+		int gruop_cnt);
+
+	int (*tpg_leave) (
+		corosync_tpg_handle handle,
+		struct corosync_tpg_group *groups,
+		int gruop_cnt);
+
+	int (*tpg_joined_mcast) (
+		corosync_tpg_handle handle,
+		struct iovec *iovec,
+		int iov_len,
+		int guarantee);
+
+	int (*tpg_joined_send_ok) (
+		corosync_tpg_handle handle,
+		struct iovec *iovec,
+		int iov_len);
+
+	int (*tpg_groups_mcast) (
+		corosync_tpg_handle handle,
+		int guarantee,
+		struct corosync_tpg_group *groups,
+		int groups_cnt,
+		struct iovec *iovec,
+		int iov_len);
+
+	int (*tpg_groups_send_ok) (
+		corosync_tpg_handle handle,
+		struct corosync_tpg_group *groups,
+		int groups_cnt,
+		struct iovec *iovec,
+		int iov_len);
+
+	/*
+	 * Plugin loading and unloading
+	 */
 	int (*plugin_interface_reference) (
 		unsigned int *handle, 
 		char *iface_name,