Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

SAF Parameters

This section discusses the SAF parameters in detail. The parameters are:

pb (parameter block)

The pb parameter is a pointer to a pblock data structure that contains values specified by the directive that invokes the SAF. A pblock data structure contains a series of name-value pairs.

The following example shows a directive that invokes the basic-nsca function:


AuthTrans fn=basic-ncsa auth-type=basic dbm=/<Install_Root>
	/<Instance_Directory>/userdb/rs

In this case, the pb parameter passed to basic-ncsa contains name-value pairs that correspond to auth-type=basic and dbm=/<Install_Root>/<Instance_Directory>/userdb/rs.

NSAPI provides a set of functions for working with pblock data structures. For example, pblock_findval() returns the value for a given name in a pblock. See Parameter Block Manipulation Routines, for a summary of the most commonly used functions for working with parameter blocks.

sn (session)

The sn parameter is a pointer to a session data structure. This parameter contains variables related to an entire session, that is, the time between the opening and closing of the TCP/IP connection between the client and the server. The same sn pointer is passed to each SAF called within each request for an entire session. The following list describes the most important fields in this data structure see Chapter 4, NSAPI Function Reference for information about NSAPI routines for manipulating the session data structure.

rq (request)

The rq parameter is a pointer to a request data structure. This parameter contains variables related to the current request, such as the request headers, URI, and local file system path. The same request pointer is passed to each SAF called in the request-response process for an HTTP request.

The following list describes the most important fields in this data structure. See Chapter 4, NSAPI Function Reference for information about NSAPI routines for manipulating the request data structure.

The rq parameter is the primary mechanism for passing information throughout the request-response process. On input to a SAF, rq contains the values that were inserted or modified by previously executed SAFs. On output, rq contains any modifications or additional information inserted by the SAF. Some SAFs depend on the existence of specific information provided at an earlier step in the process. For example, a PathCheck SAF retrieves values in rq->vars that were previously inserted by an AuthTrans SAF.