Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getprotobynumber(3)

getprotobyname(3)

setprotoent(3)

endprotoent(3)

getprotoent(3)  —  Subroutines

OSF  —  Environment_Note_Added

NAME

getprotoent − Gets protocol entry from the /etc/protocols file

LIBRARY

Sockets Library (libc.a)

SYNOPSIS

#include <netdb.h> struct protoent ∗getprotoent ( void );

DESCRIPTION

The getprotoent() (get protocol entry) function retrieves protocol information from the /etc/protocols file.The getprotoent() function returns a pointer to a protoent structure, which contains the fields for a line of information in the /etc/protocols file.  The netdb.h header file defines the protoent structure. 

An application program can use the getprotoent() function to access a protocol name, its aliases, and protocol number.  Use the endprotoent() function to close the /etc/protocols file. 

NOTES

The return value points to static data that is overwritten by subsequent calls. 

RETURN VALUES

Upon successful completion, the getprotoent() function returns a pointer to a protoent structure. 

If an error occurs or the end of the file is reached, the getprotoent() function returns a null pointer. 

FILES

/etc/protocols
Contains protocol information.

ENVIRONMENT NOTES

This section describes system features that are not generic to OSF/1 but that are provided in this OSF/1 implementation. 

Digital Extensions

The system searches either the local /etc/protocols file or the NIS distributed networks file for the requested information.  To determine which file or files to search, and in which order, the system uses the switches in the /etc/svc.conf file. 
 

RELATED INFORMATION

Functions: getprotobynumber(3), getprotobyname(3), setprotoent(3), endprotoent(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026