Chapter Contents

Previous

Next
getprotoent

getprotoent



Gets Protocol Information

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
PORTABILITY
IMPLEMENTATION
RELATED FUNCTIONS


SYNOPSIS

#include <netdb.h>

struct protoent *getprotoent(void);


DESCRIPTION

Given a network name, getprotoent returns a pointer to the next network entry in the protoent structure defined in <netdb.h> . Refer to <netdb.h> for details on the protoent structure. The source of the data in this structure is the protocols file, that is, a file with the same format as the /etc/protocols file on a UNIX operating system.

Refer to Search Logic for information on the logic used to determine the location of the protocols file.


RETURN VALUE

If getprotoent succeeds, it returns a pointer to the protoent structure. A null pointer indicates an error occurred or there were no more network entries.


CAUTION

The value that getprotoent returns points to a static structure within the library. You must copy the information from this structure before you make further getprotobyname , getprotobynumber , or getprotoent calls.


PORTABILITY

getprotoent is portable to other environments, including most UNIX systems, that implement BSD sockets.


IMPLEMENTATION

getprotoent is ported directly from the BSD UNIX Socket Library.


RELATED FUNCTIONS

endprotoent , setprotoent , getprotobyname , getprotobynumber


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.