Provided by:
manpages-es_1.55-10_all 
NOMBRE
getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent
- obtienen una entrada del fichero de protocolos
SINOPSIS
#include <netdb.h>
struct protoent *getprotoent(void);
struct protoent *getprotobyname(const char *nombre);
struct protoent *getprotobynumber(int proto);
void setprotoent(int dejaloabierto);
void endprotoent(void);
DESCRIPCI'ON
La funcion getprotoent() lee la siguiente linea del fichero
/etc/protocols y devuelve una estructura protoent que contiene los
campos de que consta la linea. El fichero /etc/protocols se abre si es
necesario.
La funcion getprotobyname() devuelve una estructura protoent para la
linea de /etc/protocols que concuerde con el nombre de protocolo
nombre.
La funcion getprotobynumber() devuelve una estructura protoent para la
linea que concuerde con el numero de protocolo proto.
La funcion setprotoent() abre y rebobina el fichero /etc/protocols. Si
dejaloabierto es verdad (1), entonces el fichero no se cerrara entre
llamadas a getprotobyname() o a getprotobynumber().
La funcion endprotoent() cierra /etc/protocols.
La estructura protoent se define en <netdb.h> asi:
struct protoent {
char *p_name; /* nombre oficial de protocolo */
char **p_aliases; /* lista de sinonimos */
int p_proto; /* numero de protocolo */
}
Los miembros de la estructura protoent son:
p_name El nombre oficial del protocolo.
p_aliases
Una lista terminada en cero de nombres alternos para el
protocolo.
p_proto
El numero del protocolo.
VALOR DEVUELTO
Las funciones getprotoent(), getprotobyname() y getprotobynumber()
devuelven la estructura protoent, o un puntero NULL si ocurre un error
o si se llega al final del fichero.
FICHEROS
/etc/protocols
fichero con los datos de protocolos
CONFORME A
BSD 4.3
V'EASE TAMBI'EN
getservent(3), getnetent(3), protocols(5)