Debian Codegraph @

membership/ccm/ccmmisc.h

raw
1
2 /*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18 #ifndef _CCM_MISC_H_
19 #define _CCM_MISC_H_
20
21 #define MAX_MEMLIST_STRING 512
22
23 int ccm_bitmap2str(const char *bitmap,
24 char* memlist, int size);
25 int ccm_str2bitmap(const char *_memlist,
26 int size, char *bitmap);
27
28 void leave_init(void);
29 void leave_reset(void);
30 void leave_cache(int i);
31 int leave_get_next(void);
32 int leave_any(void);
33
34
35 int ccm_mem_bitmapfill(ccm_info_t *info, const char *bitmap);
36 int ccm_mem_strfill(ccm_info_t *info, const char *memlist);
37 gboolean node_is_member(ccm_info_t* info, const char* node);
38
39 gboolean part_of_cluster(int state);
40 int ccm_string2type(const char *type);
41 char* ccm_type2string(enum ccm_type type);
42
43 void ccm_mem_reset(ccm_info_t* info);
44 int ccm_mem_add(ccm_info_t*, int index);
45 int ccm_get_memcount(ccm_info_t* info);
46 int ccm_mem_delete(ccm_info_t* info, int index);
47 int ccm_mem_update(ccm_info_t *info, const char *node,
48 enum change_event_type change_type);
49 int ccm_mem_filluptime(ccm_info_t* info, int* uptime_list,
50 int uptime_size);
51 gboolean i_am_member(ccm_info_t* info);
52 int am_i_member_in_memlist(ccm_info_t *info, const char *memlist);
53 #endif
54
55
56