2007-01-10 14:16:11 +03:00
/*
Unix SMB / CIFS implementation .
structures for clustering
Copyright ( C ) Andrew Tridgell 2006
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2007-01-10 14:16:11 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2007-01-10 14:16:11 +03:00
*/
# ifndef __CLUSTER_H__
# define __CLUSTER_H__
2011-05-02 04:55:20 +04:00
# include "librpc/gen_ndr/server_id.h"
2010-12-05 22:31:09 +03:00
2007-01-10 14:16:11 +03:00
/*
test for same cluster id
*/
2011-05-02 04:05:46 +04:00
# define cluster_id_equal(id_1, id_2) ((id_1)->pid == (id_2)->pid \
2011-05-08 20:28:17 +04:00
& & ( id_1 ) - > task_id = = ( id_2 ) - > task_id \
2011-05-02 04:53:18 +04:00
& & ( id_1 ) - > vnn = = ( id_2 ) - > vnn )
2007-01-10 14:16:11 +03:00
2007-02-08 03:58:17 +03:00
/*
test for same cluster node
*/
2011-05-02 04:53:18 +04:00
# define cluster_node_equal(id1, id2) ((id1)->vnn == (id2)->vnn)
2007-02-08 03:58:17 +03:00
2011-05-03 04:40:33 +04:00
struct imessaging_context ;
typedef void ( * cluster_message_fn_t ) ( struct imessaging_context * , DATA_BLOB ) ;
2007-02-08 03:58:17 +03:00
2007-01-10 14:16:11 +03:00
/* prototypes */
2011-05-08 20:28:17 +04:00
struct server_id cluster_id ( uint64_t id , uint32_t task_id ) ;
2013-04-11 11:42:15 +04:00
struct db_context * cluster_db_tmp_open ( TALLOC_CTX * mem_ctx , struct loadparm_context * lp_ctx , const char * dbbase , int flags ) ;
2007-02-08 03:58:17 +03:00
void * cluster_backend_handle ( void ) ;
2011-05-03 04:40:33 +04:00
NTSTATUS cluster_message_init ( struct imessaging_context * msg , struct server_id server ,
2007-02-08 03:58:17 +03:00
cluster_message_fn_t handler ) ;
2007-02-09 04:52:13 +03:00
NTSTATUS cluster_message_send ( struct server_id server , DATA_BLOB * data ) ;
2007-01-10 14:16:11 +03:00
# endif