1*cf1d77f7Schristos /*	$NetBSD: extended.c,v 1.3 2021/08/14 16:15:00 christos Exp $	*/
233197c6aStron 
333197c6aStron /* extended.c - mdb backend extended routines */
433197c6aStron /* $OpenLDAP$ */
533197c6aStron /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
633197c6aStron  *
7*cf1d77f7Schristos  * Copyright 2000-2021 The OpenLDAP Foundation.
833197c6aStron  * All rights reserved.
933197c6aStron  *
1033197c6aStron  * Redistribution and use in source and binary forms, with or without
1133197c6aStron  * modification, are permitted only as authorized by the OpenLDAP
1233197c6aStron  * Public License.
1333197c6aStron  *
1433197c6aStron  * A copy of this license is available in the file LICENSE in the
1533197c6aStron  * top-level directory of the distribution or, alternatively, at
1633197c6aStron  * <http://www.OpenLDAP.org/license.html>.
1733197c6aStron  */
1833197c6aStron 
198bd9f7cdSchristos #include <sys/cdefs.h>
20*cf1d77f7Schristos __RCSID("$NetBSD: extended.c,v 1.3 2021/08/14 16:15:00 christos Exp $");
218bd9f7cdSchristos 
2233197c6aStron #include "portable.h"
2333197c6aStron 
2433197c6aStron #include <stdio.h>
2533197c6aStron #include <ac/string.h>
2633197c6aStron 
2733197c6aStron #include "back-mdb.h"
2833197c6aStron #include "lber_pvt.h"
2933197c6aStron 
3033197c6aStron static struct exop {
3133197c6aStron 	struct berval *oid;
3233197c6aStron 	BI_op_extended	*extended;
3333197c6aStron } exop_table[] = {
3433197c6aStron 	{ NULL, NULL }
3533197c6aStron };
3633197c6aStron 
3733197c6aStron int
mdb_extended(Operation * op,SlapReply * rs)3833197c6aStron mdb_extended( Operation *op, SlapReply *rs )
3933197c6aStron /*	struct berval		*reqoid,
4033197c6aStron 	struct berval	*reqdata,
4133197c6aStron 	char		**rspoid,
4233197c6aStron 	struct berval	**rspdata,
4333197c6aStron 	LDAPControl *** rspctrls,
4433197c6aStron 	const char**	text,
4533197c6aStron 	BerVarray	*refs
4633197c6aStron ) */
4733197c6aStron {
4833197c6aStron 	int i;
4933197c6aStron 
5033197c6aStron 	for( i=0; exop_table[i].extended != NULL; i++ ) {
5133197c6aStron 		if( ber_bvcmp( exop_table[i].oid, &op->oq_extended.rs_reqoid ) == 0 ) {
5233197c6aStron 			return (exop_table[i].extended)( op, rs );
5333197c6aStron 		}
5433197c6aStron 	}
5533197c6aStron 
5633197c6aStron 	rs->sr_text = "not supported within naming context";
5733197c6aStron 	return rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
5833197c6aStron }
5933197c6aStron 
60