ggeettpprroottooeenntt() -- Sockets Function (libsocket)

Get protocol entry
#iinncclluuddee <nneettddbb.hh>
ssttrruucctt pprroottooeenntt *ggeettpprroottooeenntt();

ggeettpprroottooeenntt() reads  the next entry  from file /eettcc/pprroottooccoollss,  which holds
information  about all  protocols  recognized by  your  local network.   If
necessary, it  opens the file.  It  returns a pointer to  an object of type
pprroottooeenntt, which is defined in header file <nneettddbb.hh>:

struct protoent {
    char *p_name;   /* official name of protocol */
    char **p_aliases;   /* alias list */
    int p_proto;    /* protocol number */
};

The following details each member:

pp_nnaammee
     The official name of the protocol.

pp_aalliiaasseess
     This  points to  a  zero-terminated list  of alternate  names for  the
     protocol.

pp_pprroottoo
     The number of the protocol.

To close /eettcc/pprroottooccoollss, call function eennddpprroottooeenntt().

ggeettpprroottooeenntt() returns NULL if an error  occurs, or if it encounters the end
of the file.

_S_e_e _A_l_s_o
eennddpprroottooeenntt(),  ggeettpprroottoobbyynnaammee(),  ggeettpprroottoobbyynnuummbbeerr(), lliibbssoocckkeett,  nneettddbb.hh,
sseettpprroottooeenntt()

_N_o_t_e_s
This function uses a static data  space.  If your application needs to save
these data, it must copy them before any subsequent calls overwrite them.

At present, only the Internet protocols are understood.
