ggeettnneettbbyynnaammee() -- Sockets Function (libsocket)

Get a network entry by address
#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tbbyynnaammee(_n_a_m_e)
cchhaarr *_n_a_m_e;

ggeettnneettbbyynnaammee()  fetches  a  network  entry.   It  opens and  searches  file
/eettcc/nneettwwoorrkkss, which describes all  entities on your local network, for the
entry  with   _n_a_m_e.  /eettcc/nneettwwoorrkkss  must  have   been  opened  by  function
sseettnneetteenntt().

ggeettnneettbbyynnaammee()  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 cannot find an entry with _a_d_d_r_e_s_s.

_S_e_e _A_l_s_o
eennddnneetteenntt(), ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), 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()
