Accesses the port information in the port database.
Security Library (libc.a)
int getportattr (Port, Attribute, Value, Type)
char * Port;
char * Attribute;
void * Value;
int putportattr (Port, Attribute, Value, Type) char *Port; char *Attribute; void *Value; int Type;
The getportattr or putportattr subroutine accesses port information. The getportattr subroutine reads a specified attribute from the port database. If the database is not already open, the getportattr subroutine implicitly opens the database for reading. The putportattr subroutine writes a specified attribute into the port database. If the database is not already open, the putportattr subroutine implicitly opens the database for reading and writing. The data changed by the putportattr subroutine must be explicitly committed by calling the putportattr subroutine with a Type parameter equal to the SEC_COMMIT value. Until all the data is committed, only these subroutines within the process return the written data.
Values returned by these subroutines are in dynamically allocated buffers. You do not need to move the values prior to the next call.
Use the setuserdb or enduserdb subroutine to open and close the port database.
|Port||Specifies the name of the port for which an attribute is read.|
|Attribute||Specifies the name of the attribute read. This attribute can be
one of the following values defined in the usersec.h
|Value||Specifies the address of a buffer in which the attribute is stored with putportattr or is to be read getportattr.|
|Type||Specifies the type of attribute expected. The following types are
valid and defined in the usersec.h file:
Access Control: The calling process must have access to the port information in the port database.
The getportattr and putportattr subroutines return a value of 0 if completed successfully. Otherwise, a value of -1 is returned and the errno global value is set to indicate the error.
These subroutines are unsuccessful
if the following values are true:
|EACCES||Indicates that access permission is denied for the data requested.|
|ENOENT||Indicates that the Port parameter does not exist or the attribute is not defined for the specified port.|
|ENOATTR||Indicates that the specified port attribute does not exist for the specified port.|
|EINVAL||Indicates that the Attribute parameter does not contain one of the defined attributes or is a null value.|
|EINVAL||Indicates that the Value parameter does not point to a valid buffer or to valid data for this type of attribute.|
|EPERM||Operation is not permitted.|
These subroutines are part of Base Operating System (BOS) Runtime.
The setuserdb or enduserdb subroutine.
List of Security and Auditing Services in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.
Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.