|
|
Berkeley Sockets/iX Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 4 Name Service RoutinesGETNETENT |
|
The getnetent, getnetbyname, and getnetbyaddr subroutines each return a pointer to an object with the following structure. This structure contains fields found in the network protocol database, /etc/networks.
The members of this structure are as follows:
The getnetent subroutine reads the next line of the file, opening the file if necessary. The setnetent subroutine opens and rewinds the file. If the stayopen flag is non-zero, the network database is not closed after each call to getnetent (either directly, or indirectly through one of the other getnet calls). The endnetent subroutine closes the file. The getnetbyname subroutine sequentially searches from the beginning of the file until a network name (among either the official names or the aliases) matching its parameter name is found, or until EOF is encountered. The getnetbyaddr subroutine sequentially searches from the beginning of the file until a network number matching its parameter net is found, or until EOF is encountered. The parameter net must be in network order. The parameter type must be the constant AF_INET. Network numbers are supplied in host order. (Refer to the inet section.) All information is contained in a static area, so it must be copied if it is to be saved. Only Internet network numbers are currently understood. The getnetent, getnetbyname, and getnetbyaddr subroutines return a null pointer (0) on EOF or when they are unable to open NETWORKS.NET.SYS. The getnetbyaddr subroutine also returns a null pointer if its parameter type is invalid. The name of the networks file on MPE/iX is NETWORKS.NET.SYS, as opposed to /etc/networks on HP-UX. |
|