Gets network entry.
Standard C Library (libc.a)
#include <netdb.h> int getnetent_r(netent, net_data) struct netent *netent; struct netent_data *net_data;
The getnetent_r subroutine retrieves network information by opening and sequentially reading the /etc/networks file. This subroutine internally calls the getnetent subroutine and stores the values in the hostent structure.
The getnetent subroutine overwrites the static data returned in subsequent calls. The getnetent_r subroutine does not. Use the endnetent_r subroutine to close the /etc/networks file.
netent | Points to the netent structure. |
net_data | Points to the net_data structure. |
The function returns a 0 if successful and a -1 if unsuccessful.
/etc/networks | Contains official network names. |
endnetent_r Subroutine, getnetbyaddr_r Subroutine, getnetbyname_r Subroutine, and setnetent_r Subroutine.