Working With Parameter Blocks; Getting Data From The Parameter Block - Netscape DIRECTORY SERVER 6.1 - PLUG-IN Manual

Table of Contents

Advertisement

Working with Parameter Blocks

In the functions you write, you set values in the parameter block that pertain to the
operation you are performing. You can also get data from the parameter block
which you can use within your functions. This process is described in the next
section, "Getting Data from the Parameter Block," on page 29.
You can also set values in the parameter block during the processing of your
plug-in functions. The Directory Server can then use the new data values to
complete an operation which it might be processing. For details on this, see
"Setting Data in the Parameter Block," on page 30.
Some of the data that you can retrieve from the parameter block includes entries,
attributes, search filters, and distinguished names (DNs). Once you retrieve a piece
of data, you can manipulate it using the front-end API functions. For example, you
can use front-end API functions to verify that an entry complies with the schema or
you can split up a search filter into its individual components. For details, see the
section "Calling Front-End Functions," on page 31.

Getting Data from the Parameter Block

When the Directory Server calls your plug-in function, it passes any relevant data
to your function in a parameter block. The parameter block is defined as a
Slapi_PBlock
slapi_pblock_get()
NOTE
In the following example, the
the base DN for the LDAP search operation. It then normalizes the DN, converts all
characters to lowercase, and writes the converted DN to the error log. Note that the
actual DN (not a copy of it) is normalized and converted to lowercase.
Code Example 2-1
#include <slapi-plugin.h>
...
int
searchdn_preop_search( Slapi_PBlock *pb )
{
char *dn;
data type. To access the data in a parameter block, call the
function.
Often,
slapi_pblock_get()
When you call your own functions to modify the value retrieved by
slapi_pblock_get()
parameter block, not a copy of the data.
Getting Data From the Parameter Block
returns a pointer to the actual data.
, you are modifying the actual data in the
searchdn_preop_search()
Chapter 2
Writing a Plug-In Function
function gets the DN of
Writing and Compiling Plug-Ins
29

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NETSCAPE DIRECTORY SERVER 6.1 - PLUG-IN and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Directory server 6.1

Table of Contents