OpenTP1 Version 7 Programming Reference C Language
dc_log_audit_print - output audit log data
Format
ANSI C, C++
#include <dclog.h> int dc_log_audit_print(char *msgid,char *compid,DCLONG ctgry, DCLONG result,DCLONG op,char *msg,DCLONG flags) |
K&R C
#include <dclog.h> int dc_log_audit_print(msgid,compid,ctgry,result,op,msg,flags) char *msgid; char *compid; DCLONG ctgry; DCLONG result; DCLONG op; char *msg; DCLONG flags; |
Description
The function dc_log_audit_print() outputs to the audit log file the following information items, in addition to the information specified as arguments: header information, serial number, date and time, relevant program name, relevant process ID, location, subject identification information, object information, object location information, request sender host, and location identification information. The relevant program means the program that generated the audit log data, which is OpenTP1. If an error occurs during output of audit log data, an error message is sent to the standard error output and syslog.
In OpenTP1, numbers from 34000 to 34999 are assigned for message IDs used by the function dc_log_audit_print(). If you create a UAP, make sure that the message IDs output by the UAP are in the range from 34000 to 34999.
For details on the items output as audit log data, see the OpenTP1 Programming Guide.
Arguments whose values are set in the UAP
msgid
Specify an identifier uniquely assigned to each audit log entry (message ID) in the format KFCAnnnnn-x (11 characters) and follow the identifier with a null character. For nnnnn, specify a five-digit serial number in the range from 34000 to 34999. For x, specify E, W, or I as the message type according to the type of information provided by the audit log entry to be output.
compid
Specify any value that identifies the UAP that called the function dc_log_audit_print() (calling program ID). The value you set must be two numeric characters, alphabetic characters, or symbols followed by a null character. In the audit log, the format is *AA, with an asterisk (*) prefixed (AA: character string specified in compid).
ctgry
Specify one of the following values as the audit event type:
DCLOG_CTG_STARTSTOP: Audit event related to a start or stop operation
DCLOG_CTG_AUTH: Audit event related to identification or authentication
DCLOG_CTG_ACCESS: Audit event related to access control
DCLOG_CTG_CONFIG: Audit event related to the configuration definition
DCLOG_CTG_FAIL: Audit event related to failures
DCLOG_CTG_LINK: Audit event related to the linkage status
DCLOG_CTG_EXTERNAL: Audit event related to external services
DCLOG_CTG_CONTENT: Audit event related to access to important information
DCLOG_CTG_MAINTAIN: Audit event related to maintenance
DCLOG_CTG_ANORMALY: Audit event related to anomalies
DCLOG_CTG_MANAGE: Audit event related to management operation
For details on audit event types, see the manual OpenTP1 Operation.
result
Set one of the following values as the audit event result to be included in the audit log data:
DCLOG_RES_SUCCESS: Successful event
DCLOG_RES_FAIL: Failed event
DCLOG_RES_OCCUR: Event that cannot be categorized as success or failure
op
Specify the value to be included as operation information in the audit log data. Make sure that you specify one of the following reserved words according to the audit event type specified by ctgry. If you specify NULL, this item will not be included in the audit log data.
Table 2-1 Correspondence between audit event types and reserved words
Audit event type | Reserved word | Meaning |
---|---|---|
DCLOG_CTG_STARTSTOP (start or stop operation) |
DCLOG_OP_START | Start or activation |
DCLOG_OP_STOP | Termination or stop | |
DCLOG_CTG_AUTH (identification or authentication) |
DCLOG_OP_LOGIN | Login |
DCLOG_OP_LOGOUT | Logout | |
DCLOG_OP_LOGON | Logon | |
DCLOG_OP_LOGOFF | Logoff | |
DCLOG_OP_DISABLE | Account disabled | |
DCLOG_CTG_ACCESS (access control) |
DCLOG_OP_ENFORCE | Enforcement |
DCLOG_CTG_CONFIG (configuration definition) |
DCLOG_OP_REFER | Reference |
DCLOG_OP_ADD | Addition | |
DCLOG_OP_UPDATE | Updating | |
DCLOG_OP_DELETE | Deletion | |
DCLOG_CTG_FAIL (failures) | DCLOG_OP_OCCUR | Occurrence |
DCLOG_CTG_LINK (linkage status) |
DCLOG_OP_UP | Linkage active |
DCLOG_OP_DOWN | Linkage inactive | |
DCLOG_CTG_EXTERNAL (external services) |
DCLOG_OP_REQ | Request |
DCLOG_OP_RES | Response | |
DCLOG_OP_SEND | Sending | |
DCLOG_OP_RECV | Receiving | |
DCLOG_CTG_CONTENT (access to important information) |
DCLOG_OP_REFER | Reference |
DCLOG_OP_ADD | Addition | |
DCLOG_OP_UPDATE | Updating | |
DCLOG_OP_DELETE | Deletion | |
DCLOG_CTG_MAINTAIN (maintenance) |
DCLOG_OP_INSTALL | Installation |
DCLOG_OP_UNINSTALL | Uninstallation | |
DCLOG_OP_UPDATE | Updating | |
DCLOG_OP_BACKUP | Backup | |
DCLOG_OP_MAINTAIN | Maintenance work | |
DCLOG_CTG_ANORMALY (anomalies) |
DCLOG_OP_OCCUR | Occurrence |
DCLOG_CTG_MANAGE (management operation) |
DCLOG_OP_INVOKE | Invocation (the administrator) |
DCLOG_OP_NOTIFY | Notification (the administrator) |
msg
Specify the address of the area that contains the freely specified description to be included in the audit log data. If you specify NULL, this item will not be included in the audit log data.
You can use numeric characters, alphabetic characters, symbols, spaces, double quotation marks ("), and commas (,). The description can have a maximum of 1024 characters, and must be followed by a null character. The null terminator character is not included in the number of characters in the description.
In the log, the specified description is enclosed in double quotation marks ("). If a double quotation mark (") is included in the description, the double quotation mark is prefixed by another double quotation mark.
flags
Specify DCNOFLAGS.
Return value
Return value | Return value (numeric) | Explanation |
---|---|---|
DCLOG_AUDIT_OFF | 1 | Output of audit log data has been disabled. Possible causes are as follows:
|
The message ID specified in the msgid argument has not been specified in the log_audit_message operand in the log service definition. | ||
An invalid message has been specified. | ||
DC_OK | 0 | The function terminated normally. |
DCLOGER_PARAM_ARGS | -1900 | The value specified as an argument is incorrect. |
DCLOGER_DEFFILE | -1904 | Definition analysis failed. |
DCLOGER_PROTO | -1999 | The dc_rpc_open function was not issued. |
DCLOGER_FATAL | -1997 | An error other than the above occurred. |
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.