Back to index

openldap  2.4.31
extended.c
Go to the documentation of this file.
00001 /* extended.c - mdb backend extended routines */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 2000-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #include "portable.h"
00018 
00019 #include <stdio.h>
00020 #include <ac/string.h>
00021 
00022 #include "back-mdb.h"
00023 #include "lber_pvt.h"
00024 
00025 static struct exop {
00026        struct berval *oid;
00027        BI_op_extended       *extended;
00028 } exop_table[] = {
00029        { NULL, NULL }
00030 };
00031 
00032 int
00033 mdb_extended( Operation *op, SlapReply *rs )
00034 /*     struct berval        *reqoid,
00035        struct berval *reqdata,
00036        char          **rspoid,
00037        struct berval **rspdata,
00038        LDAPControl *** rspctrls,
00039        const char**  text,
00040        BerVarray     *refs 
00041 ) */
00042 {
00043        int i;
00044 
00045        for( i=0; exop_table[i].extended != NULL; i++ ) {
00046               if( ber_bvcmp( exop_table[i].oid, &op->oq_extended.rs_reqoid ) == 0 ) {
00047                      return (exop_table[i].extended)( op, rs );
00048               }
00049        }
00050 
00051        rs->sr_text = "not supported within naming context";
00052        return rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
00053 }
00054