Transport Interfaces Programming Guide

Network Names

The routines to map network names to numbers, and back return a netent structure:


/*
 * 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(), getnetbyaddr(), and getnetent() are the network counterparts to the host routines described above.