root/crmd/crmd_metadata.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. ra_param_flag2text

   1 #ifndef CRMD_METADATA_H
   2 #define CRMD_METADATA_H
   3 
   4 /*
   5  * Copyright (C) 2017 Andrew Beekhof <andrew@beekhof.net>
   6  *
   7  * This source code is licensed under the GNU General Public License version 2
   8  * or later (GPLv2+) WITHOUT ANY WARRANTY.
   9  */
  10 
  11 enum ra_flags_e {
  12     ra_supports_reload  = 0x01,
  13     ra_uses_private     = 0x02,
  14 };
  15 
  16 enum ra_param_flags_e {
  17     ra_param_unique     = 0x01,
  18     ra_param_private    = 0x02,
  19 };
  20 
  21 struct ra_param_s {
  22     char *rap_name;
  23     uint32_t rap_flags; // bitmask of ra_param_flags_s
  24 };
  25 
  26 struct ra_metadata_s {
  27     char *ra_version;
  28     GList *ra_params;   // ra_param_s
  29     uint32_t ra_flags;  // bitmask of ra_flags_e
  30 };
  31 
  32 GHashTable *metadata_cache_new(void);
  33 void metadata_cache_free(GHashTable *mdc);
  34 void metadata_cache_reset(GHashTable *mdc);
  35 void metadata_cache_fini(void);
  36 
  37 struct ra_metadata_s *metadata_cache_update(GHashTable *mdc,
  38                                             lrmd_rsc_info_t *rsc,
  39                                             const char *metadata_str);
  40 struct ra_metadata_s *metadata_cache_get(GHashTable *mdc, lrmd_rsc_info_t *rsc);
  41 
  42 static inline const char *
  43 ra_param_flag2text(enum ra_param_flags_e flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  44 {
  45     switch (flag) {
  46         case ra_param_unique:
  47             return "unique";
  48         case ra_param_private:
  49             return "private";
  50         default:
  51             return "unknown";
  52     }
  53 }
  54 
  55 #endif

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