Logo Search packages:      
Sourcecode: ldb version File versions  Download package

int ldb_build_extended_req ( struct ldb_request **  ret_req,
struct ldb_context *  ldb,
void *  mem_ctx,
const char *  oid,
void *  data,
struct ldb_control **  controls,
void *  context,
ldb_request_callback_t  callback 
)

Helper function to build a extended request

Parameters:
ret_req the request structure is returned here (talloced on mem_ctx)
ldb the context associated with the database (from ldb_init())
mem_ctx a talloc emmory context (used as parent of ret_req)
oid the OID of the extended operation.
data a void pointer a the extended operation specific parameters, it needs to be NULL or a valid talloc pointer! talloc_get_type() will be used on it
controls an array of controls
context the callback function context
the callback function to handle the async replies
Returns:
result code (LDB_SUCCESS on success, or a failure code)

Definition at line 829 of file ldb.c.

References LDB_ERR_OPERATIONS_ERROR, and LDB_SUCCESS.

{
      struct ldb_request *req;

      *ret_req = NULL;

      req = talloc(mem_ctx, struct ldb_request);
      if (req == NULL) {
            ldb_set_errstring(ldb, "Out of Memory");
            return LDB_ERR_OPERATIONS_ERROR;
      }

      req->operation = LDB_EXTENDED;
      req->op.extended.oid = oid;
      req->op.extended.data = data;
      req->controls = controls;
      req->context = context;
      req->callback = callback;

      *ret_req = req;

      return LDB_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index