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

For plug-in
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 39.
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 40.
Some of the data that you can retrieve from the parameter block include 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
"Calling Front-End Functions," on page 41.

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
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()
operation. It then normalizes the DN, converts
search
Chapter 2
Writing a Plug-in Function
function gets the DN of
Writing and Compiling Plug-ins
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netscape directory server 7.0

Table of Contents