Writing Extended Operation Functions118 Netscape Directory Server Plug-In Programmer’s Guide • August 2002Writing Extended Operation FunctionsLike other plug-in functions, extended operation functions pass a single parameterblock (Slapi_PBlock) and return an integer value, as shown in the followingexample declaration:int my_ext_func( Slapi_PBlock *pb );Extended operation functions should return a value of 0 if they are successful and anon-zero value if they are unsuccessful.When the Directory Server receives an extended operation request, the front-endcalls the extended operation function with the OID value specified in the request.The front-end makes the following information available to the extended functionin the form of parameters in a parameter block.Typically, your function should perform an operation on the value specified in theSLAPI_EXT_OP_REQ_VALUE parameter. After the extended operation completes,your function should return a single value, according to the following:• If your function has sent a result code back to the client, you should return thevalue SLAPI_PLUGIN_EXTENDED_SENT_RESULT. This indicates that thefront-end does not need to send a result code.• If your function has not sent a result code back to the client (for example, if theresult is LDAP_SUCCESS), your function should return an LDAP result code. Thefront-end will send this result code back to the client.Table 10-1 Extended Function Parameter Block ArgumentsParameter ID Data Type DescriptionSLAPI_EXT_OP_REQ_OID char * Object ID (OID) of the extendedoperation specified in therequest.SLAPI_EXT_OP_REQ_VALUE structberval*Value specified in the request.SLAPI_EXT_OP_RET_OID char * Object ID (OID) that you wantsent back to the client.SLAPI_EXT_OP_RET_VALUE structberval*Value that you want sent backto the client.