ggeettnneetteenntt() -- Sockets Function

Fetch a network entry
#iinncclluuddee <nneettddbb.hh>
ssttrruucctt nneetteenntt *ggeettnneetteenntt();

ggeettnneetteenntt()  fetches a  network  entry.  It  reads  the next  line of  file
/eettcc/nneettwwoorrkk,  which  describes  all entities  on  your  local network;  if
necessary, it opens this file.

ggeettnneetteenntt() returns a pointer to an object of type nneetteenndd, which is defined
in header file <nneettddbb.hh>:


struct netent {
    char *n_name;   /* official name of net */
    char **n_aliases;   /* alias list */
    int n_addrtype; /* net number type */
    unsigned long n_net;    /* net number */
};

The following describes the members:

nn_nnaammee
     The official name of the network.

nn_aalliiaasseess
     This  points to  a  zero-terminated list  of alternate  names for  the
     network.

nn_aaddddrrttyyppee
     The type of the  network number returned; currently, only type AAFF_IINNEETT
     is recognized.

nn_nneett
     The network's  number.  Network numbers are  returned in the machine's
     byte order.

ggeettnneetteenntt() returns a pointer to the nneetteenntt structure it built.  It returns
NULL if something went wrong or if it has reached the end of /eettcc/nneettwwoorrkkss.
You must call function eennddnneetteenntt() to close /eettcc/nneettwwoorrkkss.

_S_e_e _A_l_s_o
ggeettnneettbbyyaaddddrr(),    ggeettnneettbbyynnaammee(),    eennddnneetteenntt(),   lliibbssoocckkeett,    nneettddbb.hh,
sseettnneetteenntt()
