HP-UX AAA Server A.07.01 Administrator's Guide
Developing Custom Functions
You can define your own mapping and conversion functions, which must reside in
libraries that are located at the paths configured in the SQLMapConvLibs setting of
the global definition in the sqlaccess.config file.Ensure that the names of the
custom functions do not conflict with the names of any other pre-defined or customized
functions.
HP suggests that you use a unique prefix for your custom functions.
Mapping functions use the following prototype:
int32 mappingfunction (void *radrequest, void *data, uint *len)
Where:
radrequest
Pointer to the RADIUS request currently processed.
data
For source mapping: Address where to store the result.
For target mapping: Address from where to copy data.
len
For source mapping: Address of the maximum permissible length
for the data buffer. The function returns the actual length of data
copied to target buffer.
For target mapping: Address of actual length of data in the data
buffer.
Return Values Custom or pre-defined event code. See “Event Names ” (page 273)
for more information on pre-defined event codes.
Conversion functions use the following prototype:
int32 ConversionFunction (void *source, uint *sourceLen, void
*Target, uint *TargetLen)
Where:
source
Address of the data to convert.
sourceLen
Address of the length of the source data.
Target
Address to store the converted data.
TargetLen
Passes address of maximum length allowed for target buffer into
function. Returns the actual data length copied to the target buffer.
Return Values
Custom or pre-defined event code. See “Event Names ” (page 273)
for more information on pre-defined event codes.
Null SQL Statements
SQL action mappings can be defined without an SQL statement. This flexibility is
provided so that you can execute pre-defined or customer defined functions on the
source or target data, where database access is not required. This is useful for situations
such as complex parsing of an attribute that require extracting sub realms from an
Network Access Identifier (NAI).
Implementing SQL Access 233