pacemaker  2.0.2-debe490
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 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This source code is licensed under the GNU Lesser General Public License
5  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
6  */
7 
8 #ifndef CRMCOMMON_PRIVATE__H
9 # define CRMCOMMON_PRIVATE__H
10 
11 /* This header is for the sole use of libcrmcommon, so that functions can be
12  * declared with G_GNUC_INTERNAL for efficiency.
13  */
14 
16  xpf_none = 0x0000,
17  xpf_dirty = 0x0001,
18  xpf_deleted = 0x0002,
19  xpf_created = 0x0004,
20  xpf_modified = 0x0008,
21 
22  xpf_tracking = 0x0010,
23  xpf_processed = 0x0020,
24  xpf_skip = 0x0040,
25  xpf_moved = 0x0080,
26 
27  xpf_acl_enabled = 0x0100,
28  xpf_acl_read = 0x0200,
29  xpf_acl_write = 0x0400,
30  xpf_acl_deny = 0x0800,
31 
32  xpf_acl_create = 0x1000,
33  xpf_acl_denied = 0x2000,
34  xpf_lazy = 0x4000,
35 };
36 
37 typedef struct xml_private_s {
38  long check;
39  uint32_t flags;
40  char *user;
44 
45 G_GNUC_INTERNAL
46 void pcmk__set_xml_flag(xmlNode *xml, enum xml_private_flags flag);
47 
48 G_GNUC_INTERNAL
49 bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy);
50 
51 G_GNUC_INTERNAL
52 int pcmk__element_xpath(const char *prefix, xmlNode *xml, char *buffer,
53  int offset, size_t buffer_size);
54 
55 G_GNUC_INTERNAL
56 void pcmk__free_acls(GList *acls);
57 
58 G_GNUC_INTERNAL
59 void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user);
60 
61 G_GNUC_INTERNAL
62 bool pcmk__check_acl(xmlNode *xml, const char *name,
63  enum xml_private_flags mode);
64 
65 G_GNUC_INTERNAL
66 void pcmk__apply_acl(xmlNode *xml);
67 
68 G_GNUC_INTERNAL
69 void pcmk__post_process_acl(xmlNode *xml);
70 
71 G_GNUC_INTERNAL
72 void pcmk__mark_xml_attr_dirty(xmlAttr *a);
73 
74 static inline xmlAttr *
75 pcmk__first_xml_attr(const xmlNode *xml)
76 {
77  return xml? xml->properties : NULL;
78 }
79 
80 static inline const char *
81 pcmk__xml_attr_value(const xmlAttr *attr)
82 {
83  return ((attr == NULL) || (attr->children == NULL))? NULL
84  : (const char *) attr->children->content;
85 }
86 
87 #endif // CRMCOMMON_PRIVATE__H
void pcmk__free_acls(GList *acls)
Definition: acl.c:43
G_GNUC_INTERNAL int pcmk__element_xpath(const char *prefix, xmlNode *xml, char *buffer, int offset, size_t buffer_size)
Definition: xml.c:1915
G_GNUC_INTERNAL void pcmk__mark_xml_attr_dirty(xmlAttr *a)
Definition: xml.c:183
void pcmk__post_process_acl(xmlNode *xml)
Definition: acl.c:473
bool pcmk__check_acl(xmlNode *xml, const char *name, enum xml_private_flags mode)
Definition: acl.c:557
G_GNUC_INTERNAL void pcmk__set_xml_flag(xmlNode *xml, enum xml_private_flags flag)
Definition: xml.c:130
void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user)
Definition: acl.c:283
GListPtr deleted_objs
xml_private_flags
void pcmk__apply_acl(xmlNode *xml)
Definition: acl.c:224
struct xml_private_s xml_private_t
G_GNUC_INTERNAL bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy)
Definition: xml.c:64
GList * GListPtr
Definition: crm.h:192