PreviousNext

Adding Event-Specific Information

If the dce_aud_start( ) function returns an audit record descriptor to the audit record buffer (meaning that the event needs to be audited), the dce_aud_put_ev_info( ) function call can be used to add event-specific information to the tail of the audit record.

You can opt not to use the dce_aud_put_ev_info( ) function if the information provided by the audit record header is already sufficient for your auditing purposes.

If you elect to use this function, it can be called one or more times, the order of which is preserved in the audit record.

The dce_aud_put_ev_info( ) function has two parameters: the ard parameter, which is the pointer to the audit record descriptor, and the info parameter, which is a dce_aud_ev_info_t type data containing the event-specific information. The programmer can specify the dce_aud_ev_info_t data type to include all the audit information that needs to be collected. For more information on the formats of the audit record, see the OSF DCE Application Development Reference.

In the acct_transfer( ) code point of the bank server example, if you want to record the account numbers of the parties involved in the transfer and the amount of each transaction, the data type declarations and the function calls can be made as follows:

dce_aud_ev_info_t info;

/* account numbers and transfer amounts are all unsigned

32-bit integers */

info.format = aud_c_evt_info_ulong_int;

info.data = acct_from;

dce_aud_put_ev_info(ard, info, &status);

info.data = acct_to;

dce_aud_put_ev_info(ard, info, &status);

info.data = amount;

dce_aud_put_ev_info(ard, info, &status);