Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_ldap_metadata.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework LDAP Internal Header
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_LDAP_METADATA_H__
10 #define __AFW_LDAP_METADATA_H__
11 
12 
21 #include "afw_ldap.h"
22 #include "afw_ldap_internal.h"
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 
32  void *data;
33  afw_ldap_ber_to_value_p_cb_t to_value;
34  afw_ldap_value_to_ber_p_cb_t to_ber;
35 };
36 
37 
39 
40  /* attribute_type or NULL. */
41  afw_ldap_metadata_attribute_type_t *attribute_type;
42 
43  /* Associated property type object. */
44  const afw_object_t *property_type_object;
45 
46  /* Pointer to next attribute for object type or NULL if end. */
48 
49  /* Indicates attribute is required. */
50  afw_boolean_t is_required;
51 
52 };
53 
54 
57 
58  /* Use count. FIXME Start using. */
59  unsigned int use_count;
60 
61  /* Subpool for metadata. */
62  const afw_pool_t *p;
63 
64  /* Value of subschemaSubentry from rootDSE. */
65  const afw_utf8_t * subschema_subentry;
66 
67  /* RootDSE. */
68  const afw_object_t *rootdse_object;
69 
70  /* Schema, */
71  const afw_object_t *schema_object;
72 
73  /* An object for each attribute type. */
74  apr_hash_t *attribute_type_objects;
75 
76  /* An object for each syntax. */
77  apr_hash_t *ldap_syntax_objects;
78 
79  /* An object for each matching rule. */
80  apr_hash_t *matching_rule_objects;
81 
82  /* An object for each matching rule use. */
83  apr_hash_t *matching_rule_use_objects;
84 
85  /* An object for each object class. */
86  apr_hash_t *object_class_objects;
87 
88  /* An object for each value meta object. */
89  apr_hash_t *value_meta_objects;
90 
91  /* An object for each object type. */
92  apr_hash_t *object_type_objects;
93 
94  /* First afw_ldap_object_type_attribute_t * for each object type. */
95  apr_hash_t *object_type_attributes;
96 
97  /* An afw_ldap_metadata_attribute_type_t for each attributeType. */
98  apr_hash_t *attribute_types;
99 
100 };
101 
102 
103 /* @brief Runtime attribute type info. */
105 
106  /* oid without {} part. */
107  const afw_utf8_t *syntax_oid;
108 
109  /* Associated attribute type object. */
110  const afw_object_t *attribute_type_object;
111 
112  /* Attribute type/property name. */
113  const afw_utf8_t *property_name;
114 
115  /* Associated property type object. */
116  const afw_object_t *property_type_object;
117 
118  /* Syntax Handler. */
119  const afw_ldap_metadata_syntax_handler_t *syntax_handler;
120 
121  /* Data type id value. */
122  const afw_value_t *data_type_id_value;
123 
124  /* Lower Bound. */
125  afw_integer_t lower_bound;
126 
127  /* Upper Bound. */
128  afw_integer_t upper_bound;
129 
130  /* Lower Bound present. */
131  afw_boolean_t lower_bound_present;
132 
133  /* Upper Bound present. */
134  afw_boolean_t upper_bound_present;
135 
136  /* Is single value. */
137  afw_boolean_t is_single;
138 
139  /* Allow Read */
140  afw_boolean_t never_allow_read;
141 
142  /* Allow Write */
143  afw_boolean_t never_allow_write;
144 
145  /* Operational */
146  afw_boolean_t operational;
147 };
148 
149 
192 void
195  afw_xctx_t *xctx);
196 
200 void
203  const afw_utf8_t * object_type_id,
204  const afw_query_criteria_t * criteria,
205  void * context,
206  afw_object_cb_t callback,
207  afw_xctx_t *xctx);
208 
212 void
215  const afw_utf8_t * object_type,
216  const afw_utf8_t * object_id,
217  void * context,
218  afw_object_cb_t callback,
219  afw_xctx_t *xctx);
220 
229  afw_ldap_object_type_attribute_t *first_attribute,
230  const afw_utf8_t *name);
231 
232 
233 /* Tests whether an object type is handled by afw_ldap_metadata.c. */
235 afw_ldap_metadata_handles(
236  const afw_utf8_t *object_type);
237 
238 const afw_value_t *
239 afw_ldap_metadata_bv_to_value(
242  const afw_utf8_t *attribute_name, struct berval * *bv,
243  const afw_pool_t *p,
244  afw_xctx_t *xctx);
245 
246 struct berval **
247 afw_ldap_metadata_value_to_bv(
249  const afw_utf8_t *attribute_name, const afw_value_t *value,
250  afw_xctx_t *xctx);
251 
252 #ifdef __cplusplus
253 }
254 #endif
255 
256 #endif /* __AFW_LDAP_METADATA_H__ */
Header for AFW LDAP Adaptor.
Adaptive Framework LDAP Internal Header
void afw_ldap_metadata_get_object(afw_ldap_internal_adaptor_session_t *self, const afw_utf8_t *object_type, const afw_utf8_t *object_id, void *context, afw_object_cb_t callback, afw_xctx_t *xctx)
Called by afw_ldap_adaptor_session() to get a metadata object.
void afw_ldap_metadata_retrieve_objects(afw_ldap_internal_adaptor_session_t *self, const afw_utf8_t *object_type_id, const afw_query_criteria_t *criteria, void *context, afw_object_cb_t callback, afw_xctx_t *xctx)
Called by afw_ldap_adaptor_session() to retrieve metadata objects.
afw_ldap_object_type_attribute_t * afw_ldap_metadata_get_object_type_attribute(afw_ldap_object_type_attribute_t *first_attribute, const afw_utf8_t *name)
Return afw_ldap_object_type_attribute_t * for name.
void afw_ldap_metadata_load(afw_ldap_internal_adaptor_t *adaptor, afw_xctx_t *xctx)
Load LDAP adaptors Metadata .
afw_boolean_t(* afw_object_cb_t)(const afw_object_t *object, void *context, afw_xctx_t *xctx)
Typedef for afw_adaptor_session_object callback.
Definition: afw_common.h:1176
_Bool afw_boolean_t
Definition: afw_common.h:373
apr_int64_t afw_integer_t
typedef for big signed int.
Definition: afw_common.h:321
Interface afw_object public struct.
Interface afw_pool public struct.
Parsed query criteria.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.