pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
crmcommon_private.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018-2019 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef CRMCOMMON_PRIVATE__H
11 # define CRMCOMMON_PRIVATE__H
12 
13 /* This header is for the sole use of libcrmcommon, so that functions can be
14  * declared with G_GNUC_INTERNAL for efficiency.
15  */
16 
18  xpf_none = 0x0000,
19  xpf_dirty = 0x0001,
20  xpf_deleted = 0x0002,
21  xpf_created = 0x0004,
22  xpf_modified = 0x0008,
23 
24  xpf_tracking = 0x0010,
25  xpf_processed = 0x0020,
26  xpf_skip = 0x0040,
27  xpf_moved = 0x0080,
28 
29  xpf_acl_enabled = 0x0100,
30  xpf_acl_read = 0x0200,
31  xpf_acl_write = 0x0400,
32  xpf_acl_deny = 0x0800,
33 
34  xpf_acl_create = 0x1000,
35  xpf_acl_denied = 0x2000,
36  xpf_lazy = 0x4000,
37 };
38 
39 typedef struct xml_private_s {
40  long check;
41  uint32_t flags;
42  char *user;
46 
47 G_GNUC_INTERNAL
48 void pcmk__set_xml_flag(xmlNode *xml, enum xml_private_flags flag);
49 
50 G_GNUC_INTERNAL
51 bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy);
52 
53 G_GNUC_INTERNAL
54 int pcmk__element_xpath(const char *prefix, xmlNode *xml, char *buffer,
55  int offset, size_t buffer_size);
56 
57 G_GNUC_INTERNAL
58 void pcmk__free_acls(GList *acls);
59 
60 G_GNUC_INTERNAL
61 void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user);
62 
63 G_GNUC_INTERNAL
64 bool pcmk__check_acl(xmlNode *xml, const char *name,
65  enum xml_private_flags mode);
66 
67 G_GNUC_INTERNAL
68 void pcmk__apply_acl(xmlNode *xml);
69 
70 G_GNUC_INTERNAL
71 void pcmk__apply_creation_acl(xmlNode *xml, bool check_top);
72 
73 G_GNUC_INTERNAL
74 void pcmk__mark_xml_attr_dirty(xmlAttr *a);
75 
76 static inline xmlAttr *
77 pcmk__first_xml_attr(const xmlNode *xml)
78 {
79  return xml? xml->properties : NULL;
80 }
81 
82 static inline const char *
83 pcmk__xml_attr_value(const xmlAttr *attr)
84 {
85  return ((attr == NULL) || (attr->children == NULL))? NULL
86  : (const char *) attr->children->content;
87 }
88 
89 #endif // CRMCOMMON_PRIVATE__H
void pcmk__free_acls(GList *acls)
Definition: acl.c:45
G_GNUC_INTERNAL int pcmk__element_xpath(const char *prefix, xmlNode *xml, char *buffer, int offset, size_t buffer_size)
Definition: xml.c:2030
G_GNUC_INTERNAL void pcmk__mark_xml_attr_dirty(xmlAttr *a)
Definition: xml.c:193
void pcmk__apply_creation_acl(xmlNode *xml, bool check_top)
Definition: acl.c:565
bool pcmk__check_acl(xmlNode *xml, const char *name, enum xml_private_flags mode)
Definition: acl.c:635
G_GNUC_INTERNAL void pcmk__set_xml_flag(xmlNode *xml, enum xml_private_flags flag)
Definition: xml.c:140
void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user)
Definition: acl.c:313
GListPtr deleted_objs
xml_private_flags
const char * target
Definition: pcmk_fence.c:28
void pcmk__apply_acl(xmlNode *xml)
Definition: acl.c:242
struct xml_private_s xml_private_t
G_GNUC_INTERNAL bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy)
Definition: xml.c:74
char * name
Definition: pcmk_fence.c:30
GList * GListPtr
Definition: crm.h:214