Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
getprotoent(3)
Edit
PageHistory
Diff
Info
LikePages
GETPROTOENT !!!GETPROTOENT NAME SYNOPSIS DESCRIPTION RETURN VALUE FILES CONFORMING TO SEE ALSO ---- !!NAME getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent - get protocol entry !!SYNOPSIS __#include __''name''__); struct protoent *getprotobynumber(int__ ''proto''__); void setprotoent(int__ ''stayopen''__); void endprotoent(void); __ !!DESCRIPTION The __getprotoent()__ function reads the next line from the file ''/etc/protocols'' and returns a structure ''protoent'' containing the broken out fields from the line. The ''/etc/protocols'' file is opened if necessary. The __getprotobyname()__ function returns a ''protoent'' structure for the line from ''/etc/protocols'' that matches the protocol name ''name''. The __getprotobynumber()__ function returns a ''protoent'' structure for the line that matches the protocol number ''number''. The __setprotoent()__ function opens and rewinds the ''/etc/protocols'' file. If ''stayopen'' is true (1), then the file will not be closed between calls to __getprotobyname()__ or __getprotobynumber()__. The __endprotoent()__ function closes ''/etc/protocols''. The ''protoent'' structure is defined in '''' as follows: struct protoent { char *p_name; /* official protocol name */ char **p_aliases; /* alias list */ int p_proto; /* protocol number */ } The members of the ''protoent'' structure are: ''p_name'' The official name of the protocol. ''p_aliases'' A zero terminated list of alternative names for the protocol. ''p_proto'' The protocol number. !!RETURN VALUE The __getprotoent()__, __getprotobyname()__ and __getprotobynumber()__ functions return the ''protoent'' structure, or a NULL pointer if an error occurs or the end of the file is reached. !!FILES ''/etc/protocols'' protocol database file !!CONFORMING TO BSD 4.3 !!SEE ALSO getservent(3), getnetent(3), protocols(5) ----
16 pages link to
getprotoent(3)
:
Man3g
endnetent(3)
endservent(3)
getnetbyaddr(3)
getnetbyname(3)
getnetent(3)
getservbyname(3)
getservbyport(3)
getservent(3)
socket(2)
nsswitch.conf(5)
protocols(5)
setnetent(3)
setservent(3)
getsockopt(2)
setsockopt(2)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.