HP-UX AAA Server A.08.02 Administrator's Guide

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 292) 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).
Null Source and Target Mapping
You can also specify SQL action mappings without the source or target mapping. In this case, no
data will be input to the SQL statement and/or the SQL statement execution will not return any
data. An example of an SQL action containing only SQL statements is an expired session cleanup
operation as shown in Example 7:
Example 7 SQL Action with Null Source and Target Mappings
SQLAction CleanupExpiredSessions {
TimedEvent 120 ## Invoke the action every 120 seconds.
{
output
DBR(-1:*) RET(ERROR)
DBR(0:0) RET(ACK)
DBR(*:*) RET(NAK)
SQLStatement db_oci {
DELETE FROM RAD_SESS_TABLE
WHERE (current_timestamp -
sess_start_time) > '+000000001 00:00:00'
}
}
}
The SQL action CleanupExpiredSessions executes an SQL statement every 120 seconds that
deletes all the rows from the session table RAD_SESS_TABLE containing information for expired
sessions. In this example, a session is considered expired if its starting time, sess_start_time
indicates that its older than 24 hours.
Time Synchronization
If multiple AAA Server access a common database using SQL Access, time synchronization is
critical. Features such as accounting and session management rely on time stamps stored in the
database tables. This can best be provided by utilizing the database timestamps in the SQL actions
in place of the local AAA Server timestamps.
270 SQL Access