*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> getprotoent (3c)              
Title
Content
Arch
Section
 

Contents


GETPROTOENT(3N)						       GETPROTOENT(3N)


NAME    [Toc]    [Back]

     getprotoent, getprotobynumber, getprotobyname, getprotoent_r,
     getprotobynumber_r, getprotobyname_r, fgetprotoent, fgetprotoent_r,
     setprotoent, endprotoent -	get protocol entry

SYNOPSIS    [Toc]    [Back]

     #include <netdb.h>

     struct protoent *getprotoent(void);

     struct protoent *getprotoent_r(struct protoent *entry, char *buffer, int buflen);

     struct protoent *getprotobyname(const char	*name);

     struct protoent *getprotobyname_r(const char *name, struct	protoent *entry, char *buffer, int buflen);

     struct protoent *getprotobynumber(int proto);

     struct protoent *getprotobynumber_r(int proto, struct protoent *entry, char *buffer, int buflen);

     struct protoent *fgetprotoent(FILE	*f);

     struct protoent *fgetprotoent_r(FILE *f, struct protoent *entry, char *buffer, int	buflen);

     void setprotoent(int stayopen);

     void endprotoent(void)

DESCRIPTION    [Toc]    [Back]

     getprotoent, getprotobyname, and getprotobynumber each return a pointer
     to	an object with the following structure containing the broken-out
     fields of a line in the network protocol data base	file, /etc/protocols,
     or	the NIS	protocols map.

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

     The members of this structure are:

     p_name	The official name of the protocol.

     p_aliases	A zero terminated list of alternate names for the protocol.

     p_proto	The protocol number.

     Getprotoent reads the  next  line	of  the	 file,	opening	 the  file  if
     necessary.





									Page 1






GETPROTOENT(3N)						       GETPROTOENT(3N)



     Setprotoent opens and rewinds the file.  If the  stayopen	flag  is  nonzero,
  the	 net  data  base  will	not  be	 closed	 after	each  call  to
     getprotobyname or getprotobynumber.

     Endprotoent closes	the file.

     Getprotobyname  and  getprotobynumber  sequentially   search   from   the
     beginning	of  the	file until a matching protocol name or protocol	number
     is	found, or until	EOF is encountered.

     The primitives documented in this manual entry first  consult  Sun's  NIS
     distributed  lookup  service,  if	NIS  is	 enabled,  and	then  the file
     /etc/protocols.

     getprotoent_r,  getprotobynumber_r	 and  getprotobyname_r	are  reentrant
     versions of the corresponding function calls.

     fgetprotoent and fgetprotoent_r will read entries off of the passed  file
     handle.

NOTE    [Toc]    [Back]

     The Mips ABI specifies nothing but	local files so applications which wish
     to	use anything else must compile with libc prior to libnsl in the
     library list.  When nsd is	running	changes	to the local protocols file
     may not be	noticed	by getprotoent() until the enumeration cache file has
     timed out.

DIAGNOSTICS    [Toc]    [Back]

     All functions that	return struct protoent * will return a null (0)
     pointer in	the case of EOF	or failure.

FILES    [Toc]    [Back]

     /etc/protocols

SEE ALSO    [Toc]    [Back]

      
      
     ypserv(1M), protocols(4)

DIAGNOSTICS    [Toc]    [Back]

     Null pointer (0) returned on EOF or error.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
getprotobyname Tru64 Get a protocol entry by protocol name
getprotobyname_r Tru64 Get a protocol entry by protocol name
getprotoent Tru64 Get a protocol entry
getprotoent_r Tru64 Get a protocol entry
getprotobynumber_r Tru64 Get a protocol entry by number
getprotobynumber Tru64 Get a protocol entry by number
rpccp_add_element HP-UX Adds an element to a profile in a name service entry; if the specified entry does not exist, creates the entry
rpccp_add_member HP-UX Adds a member to a group in a name service entry; if the specified entry does not exist, creates the entry
DXmSvnFlushEntry Tru64 Displays the specified entry on the screen if it is the next logically displayed entry.
DXmSvnGetEntryNumber Tru64 Retrieves (returns) an entry number for a specified entry tag value.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service