1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef PENGINE_COMPLEX__H
19 # define PENGINE_COMPLEX__H
20
21 # define n_object_classes 3
22
23
24
25 # define PE_OBJ_T_NATIVE "native"
26 # define PE_OBJ_T_GROUP "group"
27 # define PE_OBJ_T_INCARNATION "clone"
28 # define PE_OBJ_T_MASTER "master"
29
30 enum pe_obj_types {
31 pe_unknown = -1,
32 pe_native = 0,
33 pe_group = 1,
34 pe_clone = 2,
35 pe_master = 3,
36 pe_container = 4,
37 };
38
39 enum pe_obj_types get_resource_type(const char *name);
40 const char *get_resource_typename(enum pe_obj_types type);
41
42 typedef struct resource_object_functions_s {
43 gboolean(*unpack) (resource_t *, pe_working_set_t *);
44 resource_t *(*find_rsc) (resource_t * parent, const char *search, node_t * node, int flags);
45
46 char *(*parameter) (resource_t *, node_t *, gboolean, const char *, pe_working_set_t *);
47 void (*print) (resource_t *, const char *, long, void *);
48 gboolean(*active) (resource_t *, gboolean);
49 enum rsc_role_e (*state) (const resource_t *, gboolean);
50 node_t *(*location) (resource_t *, GListPtr *, gboolean);
51 void (*free) (resource_t *);
52 } resource_object_functions_t;
53
54 extern resource_object_functions_t resource_class_functions[];
55 void get_meta_attributes(GHashTable * meta_hash, resource_t * rsc, node_t * node,
56 pe_working_set_t * data_set);
57 void get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc, node_t * node,
58 pe_working_set_t * data_set);
59
60 #ifdef ENABLE_VERSIONED_ATTRS
61 void pe_get_versioned_attributes(xmlNode * meta_hash, resource_t * rsc, node_t * node,
62 pe_working_set_t * data_set);
63 #endif
64
65 typedef struct resource_alloc_functions_s resource_alloc_functions_t;
66
67 gboolean is_parent(resource_t *child, resource_t *rsc);
68 resource_t *uber_parent(resource_t * rsc);
69
70 #endif