HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
10 Writing extended operation plug-ins
This chapter explains how to write plug-in functions to handle extended operations. Extended
operations are defined in the LDAP v3 protocol.
10.1 How extended operation plug-ins work
You can define your own operation that you want the HP-UX Directory Server to perform. If
you create a custom extended operation, you assign an object identifier (OID) to identify that
operation. LDAP clients request the operation by sending an extended operation request. Within
the request, the client specifies:
The OID of the extended operation.
Data specific to the extended operation.
When the Directory Server receives the request, the server calls the plug-in registered with the
specified OID. The plug-in function has access to both the OID and the data in the client's request.
The plug-in function can send a response back to the client containing an OID plus any additional
data that might be needed.
In order to use extended operations, you need to configure both the Directory Server and the
client so that they understand the specific extended operation that you want to perform.
10.2 Writing extended operation functions
Like other plug-in functions, extended operation functions pass a single parameter block
(Slapi_PBlock) and return an integer value, as shown in the following example declaration:
int my_ext_func( Slapi_PBlock *pb );
Extended operation functions should return a value of 0 if they are successful, and a nonzero
value if they are unsuccessful.
When the Directory Server receives an extended operation request, the front end calls the extended
operation function with the OID value specified in the request. The front end makes the following
information available to the extended function in the form of parameters in a parameter block.
Table 10-1 Extended function parameter block arguments
DescriptionData typeParameter ID
Object ID (OID) of the extended operation specified
in the request.
char *SLAPI_EXT_OP_REQ_OID
Value specified in the request.
struct berval*SLAPI_EXT_OP_REQ_VALUE
Object ID (OID) that you want sent back to the
client.
char *SLAPI_EXT_OP_RET_OID
Value that you want sent back to the client.
struct berval*SLAPI_EXT_OP_RET_VALUE
10.1 How extended operation plug-ins work 83