root/include/crm/pengine/complex.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /* 
   2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
   3  * 
   4  * This program is free software; you can redistribute it and/or
   5  * modify it under the terms of the GNU Lesser General Public
   6  * License as published by the Free Software Foundation; either
   7  * version 2 of the License, or (at your option) any later version.
   8  * 
   9  * This software is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12  * General Public License for more details.
  13  * 
  14  * You should have received a copy of the GNU Lesser General Public
  15  * License along with this library; if not, write to the Free Software
  16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  17  */
  18 #ifndef PENGINE_COMPLEX__H
  19 #  define PENGINE_COMPLEX__H
  20 
  21 #  define n_object_classes 3
  22 
  23 /*#define PE_OBJ_F_     ""*/
  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     /* parameter result must be free'd */
  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

/* [previous][next][first][last][top][bottom][index][help] */