#pragma ident "%Z%%M% %I% %E% SMI"
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "ldap-int.h"
/*
* ldap_extended_operation - initiate an arbitrary ldapv3 extended operation.
* the oid and data of the extended operation are supplied. Returns an
* LDAP error code.
*
* Example:
* struct berval exdata;
* char *exoid;
* int err, msgid;
* ... fill in oid and data ...
* err = ldap_extended_operation( ld, exoid, &exdata, NULL, NULL, &msgid );
*/
int
const char *exoid,
int *msgidp
)
{
/*
* the ldapv3 extended operation request looks like this:
*
* ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
* requestName LDAPOID,
* requestValue OCTET STRING
* }
*
* all wrapped up in an LDAPMessage sequence.
*/
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
/* only ldapv3 or higher can do extended operations */
return( rc );
}
return( rc );
}
#if 0
return( rc );
}
}
#endif
/* create a message to send */
!= LDAP_SUCCESS ) {
return( rc );
}
/* fill it in */
return( rc );
}
!= LDAP_SUCCESS ) {
return( rc );
}
/* send the message */
ber );
}
/*
* ldap_extended_operation_s - perform an arbitrary ldapv3 extended operation.
* the oid and data of the extended operation are supplied. LDAP_SUCCESS
* is returned upon success, the ldap error code otherwise.
*
* Example:
* struct berval exdata, exretval;
* char *exoid;
* int rc;
* ... fill in oid and data ...
* rc = ldap_extended_operation_s( ld, exoid, &exdata, &exretval );
*/
int
const char *requestoid,
const struct berval *requestdata,
char **retoidp,
)
{
return( err );
}
== -1 ) {
}
0 )) != LDAP_SUCCESS ) {
ldap_msgfree( result );
return( err );
}
}
/*
* Pull the oid returned by the server and the data out of an extended
* operation result. Return an LDAP error code.
*/
int
char **retoidp, /* may be NULL */
int freeit
)
{
char *m, *e, *roid;
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( !NSLDAPI_VALID_LDAPMESSAGE_EXRESULT_POINTER( res )) {
return( LDAP_PARAM_ERROR );
}
m = e = NULL;
return( LDAP_NOT_SUPPORTED );
}
goto decoding_error;
}
goto decoding_error;
}
}
NSLDAPI_FREE( roid );
}
goto decoding_error;
}
}
ber_bvfree( rdata );
}
if ( freeit ) {
ldap_msgfree( res );
}
return( LDAP_SUCCESS );
return( LDAP_DECODING_ERROR );
}