用于将网络名映射到网络号以及将网络号映射到网络名的例程将返回 netent 结构:
/*
* Assumes that a network number fits in 32 bits.
*/
struct netent {
char *n_name; /* official name of net */
char **n_aliases; /* alias list */
int n_addrtype; /* net address type */
int n_net; /* net number, host byte order */
};
getnetbyname(3SOCKET)、getnetbyaddr_r(3SOCKET) 以及 getnetent(3SOCKET) 是前面介绍的主机例程的网络对应项。