Previous Topic: IR APINext Topic: tcllca: The LCA Extension


UTF8 Interpreted Audit Record

Contains two string fields that describe a CA ControlMinder audit record field. A null terminated list of SEOS_UTF8AUDLOGINTERP structures represents one CA ControlMinder audit event record.

typedef struct tagSeosUTF8LogInterpreted
{
	char *Label;		Label of an audit field in the record
	char *Value;		Value assigned in the audit record to the field
} SEOS_UTF8AUDLOGINTERP; 	Interpreted audit record

Functions

int eacIRApi_LogInit(IRApiDataPosition *pos);

This function:

  1. Gets the audit file names (from the CA ControlMinder or PMD settings).
  2. Resets the offset in order to get the oldest log file, and opens it to read the audit record.
  3. Initializes the IRApiDataPosition pointer for calling eacIRApi_LogGetNext().
  4. Initializes threads and events for IR API and PMD synchronization.

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_PART_FAIL

Partial failure (an audit file could not be initialized)

IR_EAC_GENERAL_FAIL

General failure - IR API should be initialized

*pos

(OUT) A pointer to IRApiDataPosition structure.

int eacIRApi_LogGetNext(IRApiDataPosition *pos, SEOS_UTF8AUDLOGINTERP **ppUtfMsg, int *log_type);

Returns the next log record and its type according to a given data position.

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_NO_MORE_DATA

No more data in all audit files (PMD and localhost)

IR_EAC_DATA_LOST

Data lost

IR_EAC_PSBLY_DATA_LOST

Possibly data lost

IR_EAC_GENERAL_FAIL

Failure in current audit file

*pos

(IN) A pointer to IRApiDataPosition - represents the position to get the next log record from (CA ControlMinder or PMD audit file and offset).

**ppUtfMsg

(OUT) A pointer to (UTF8 strings) interpreted record.

*log_type

(OUT) A pointer to an integer representing the next log record type.

int eacIRApi_LogTerminate(void);

Closes all log files for read, terminates all threads and reset events.

Call this function when you are finished working with the API.

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_PART_FAIL

Partial failure (some audit files could not be closed)

IR_EAC_GENERAL_FAIL

General failure

int eacIRApi_LogReset(void *buff, int size);

Opens log file (if it still exists) according to a given data position. It enables you to go back to an old (saved) state and continue from there.

Note: To create the data for using parameter 1 (void *buff), use the function eacIRApi_CopyDataPosition.

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_PART_FAIL

One or more audit files could not be initialized

IR_EAC_GENERAL_FAIL

Library should be terminated

*buff

(IN) A pointer to the buffer that contains the data needed for resetting the new data position.

size

(IN) An integer representing the data size.

void eacIRApi_LogFreeInterpretRecord(void);

This function frees the last interpreted record.

There are no return values for this function.

Note: eacIRApi_LogGetNext calls the same internal function each time it runs, so you do not need to use eacIRApi_LogFreeInterpretRecord before calling for next log record.

char *eacIR_LogGetVersion(void);

Returns the API version (according to the CA ControlMinder build number) as a string.

The return value is the version number as a string.

int eacIRApi_CopyDataPosition(void **pos)

Copies the current audit position to the allocated memory position specified. You need to use eacIRApi_GetDataPositionSize to return the size of the memory that should be allocated to the position specified.

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_GENERAL_FAIL

Library should be terminated

**pos

(OUT) The address of the buffer pointer where the copied data is located.

size_t eacIRApi_GetDataPositionSize(void)

Returns the size of the allocated memory needed for copying the current data position.

int eacIRApi_GetLastError(SEOS_UTF8AUDLOGINTERP **pUtfMsg)

Returns the last error description. You should call this function whenever another function returns IR_EAC_GENERAL_FAIL. A description of the last error is allocated in an array of SEOS_UTF8AUDLOGINTERP structures (in the same way the audit record is allocated for the eacIRApi_LogGetNext function).

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_GENERAL_FAIL

Library should be terminated

**pUtfMsg

(OUT) A pointer to a UTF8 strings last error description.

int eacIRApi_ConvertOldData(void *oldbuff, size_t oldsize, void **newbuff, size_t *newsize)

Converts old data position, saved with the obsolete IR API, so that it is suitable for the new IR API (when upgrading IRecorder).

Possible return values are:

Value

Meaning

IR_EAC_SUCCESS

Success

IR_EAC_GENERAL_FAIL

Library should be terminated

*oldbuff

(IN) A pointer to the old buffer.

oldsize

(IN) The size of the old buffer.

**newbuff

(OUT) A pointer to the new buffer.

*newsize

(OUT) The size of the new buffer.