Accesses the host information in the audit host database.
Security Library (libc.a)
#include <usersec.h> int getaudithostattr (Hostname, Attribute, Value, Type) char *Hostname; char *Attribute; void *Value; int Type; char *IDtohost (ID); char *ID; char *hosttoID (Hostname, Count); char *Hostname; int Count; char *nexthost (void); int putaudithostattr (Hostname, Attribute, Value, Type); char *Hostname; char *Attribute; void *Value; int Type;
These subroutines access the audit host information.
The getaudithostattr subroutine reads a specified attribute from the host database. If the database is not already open, this subroutine does an implicit open for reading.
Similarly the putaudithostattr subroutine writes a specified attribute into the host database. If the database is not already open, this subroutine does an implicit open for reading and writing. Data changed by the putaudithostattr must be explicitly committed by calling the putaudithostattr subroutine with a Type of SEC_COMMIT. Until all the data is committed, only these subroutines within the process return written data.
New entries in the host database must first be created by invoking putaudithostattr with the SEC_NEW type.
The IDtohost subroutine converts an 8 byte host identifier into a hostname.
The hosttoID subroutine converts a hostname to a pointer to an array of valid 8 byte host identifiers. A pointer to the array of identifiers is returned on success. A NULL pointer is returned on failure. The number of known host identifiers is returned in *Count.
The nexthost subroutine returns a pointer to the name of the next host in the audit host database.
|Attribute||Specifies which attribute is read. The following possible
attributes are defined in the usersec.h file:
|Count||Specifies the number of 8 byte host identifier entries that are available in the IDarray parameter or that have been returned in the IDarray parameter.|
|Hostname||Specifies the name of the host for the operation.|
|ID||An 8 byte host identifier.|
|IDarray||Specifies a pointer to an array of 1 or more 8 byte host identifiers.|
|Type||Specifies the type of attribute expected. Valid types are defined in usersec.h. The only valid Type value is SEC_LIST.|
|Value||The return value for read operations and the new value for write operations.|
On successful completion, the getaudithostattr, IDtohost, hosttoID, nexthost, or putaudithostattr subroutine returns 0. If unsuccessful, the subroutine returns non-zero.
The getaudithostattr, IDtohost, hosttoID,
nexthost, or putaudithostattr subroutine fails if the
following is true:
|EINVAL||If invalid attribute Name or if Count is equal to zero for the hosttoID subroutine.|
|ENOENT||If there is no matching Hostname entry in the database.|
The auditmerge command, auditpr command, auditselect command, auditstream command.
The auditread (auditread, auditread_r Subroutines) subroutine, setaudithostdb or endaudithostdb subroutine.