1 /* extended.c - bdb backend extended routines */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2000-2021 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16 
17 #include "portable.h"
18 
19 #include <stdio.h>
20 #include <ac/string.h>
21 
22 #include "back-bdb.h"
23 #include "lber_pvt.h"
24 
25 static struct exop {
26 	struct berval *oid;
27 	BI_op_extended	*extended;
28 } exop_table[] = {
29 	{ NULL, NULL }
30 };
31 
32 int
bdb_extended(Operation * op,SlapReply * rs)33 bdb_extended( Operation *op, SlapReply *rs )
34 /*	struct berval		*reqoid,
35 	struct berval	*reqdata,
36 	char		**rspoid,
37 	struct berval	**rspdata,
38 	LDAPControl *** rspctrls,
39 	const char**	text,
40 	BerVarray	*refs
41 ) */
42 {
43 	int i;
44 
45 	for( i=0; exop_table[i].extended != NULL; i++ ) {
46 		if( ber_bvcmp( exop_table[i].oid, &op->oq_extended.rs_reqoid ) == 0 ) {
47 			return (exop_table[i].extended)( op, rs );
48 		}
49 	}
50 
51 	rs->sr_text = "not supported within naming context";
52 	return rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
53 }
54 
55