summaryrefslogtreecommitdiffstats
path: root/ldb/common/ldb_controls.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldb/common/ldb_controls.c')
-rw-r--r--ldb/common/ldb_controls.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ldb/common/ldb_controls.c b/ldb/common/ldb_controls.c
index e3f855140..6fad5012b 100644
--- a/ldb/common/ldb_controls.c
+++ b/ldb/common/ldb_controls.c
@@ -53,6 +53,26 @@ struct ldb_control *ldb_request_get_control(struct ldb_request *req, const char
return NULL;
}
+/* check if a control with the specified "oid" exist and return it */
+/* returns NULL if not found */
+struct ldb_control *ldb_reply_get_control(struct ldb_reply *rep, const char *oid)
+{
+ int i;
+
+ /* check if there's a paged request control */
+ if (rep->controls != NULL) {
+ for (i = 0; rep->controls[i]; i++) {
+ if (strcmp(oid, rep->controls[i]->oid) == 0) {
+ break;
+ }
+ }
+
+ return rep->controls[i];
+ }
+
+ return NULL;
+}
+
/* saves the current controls list into the "saver" and replace the one in req with a new one excluding
the "exclude" control */
/* returns False on error */