Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getnetent(3)

getnetbyaddr(3)

setnetent(3)

endnetent(3)

getnetbyname(3)  —  Subroutines

OSF  —  Environment_Note_Added

NAME

getnetbyname − Gets network entry by name

LIBRARY

Sockets Library (libc.a)

SYNOPSIS

#include <netdb.h>

struct netent ∗getnetbyname (
char ∗name );

PARAMETERS

nameSpecifies the official network name or alias. 

DESCRIPTION

The getnetbyname() function returns a pointer to a structure of type netent. Its members specify data in fields from a record line in the /etc/networks network-name database file. The netdb.h header file defines the protoent structure. 

The getnetbyname() function searches the networks file sequentially until a match with the name parameter occurs. When EOF (End-of-File) is reached without a match, an error value is returned by this function. 

Use the endnetent() function to close the /etc/networks file. 

NOTES

The return value points to static data, which is overwritten by any subsequently called functions using the same structure. 

RETURN VALUES

Upon successful completion, a pointer to a servent structure is returned.  A null pointer is returned when an error occurs or when the end of the networks name file is reached. 

FILES

/etc/networks
This file is the DARPA Internet network-name database. Each record in the file occupies a single line and has three fields consisting of the official service name, network number, and alias.

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/networks 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: getnetent(3), getnetbyaddr(3), setnetent(3), endnetent(3)

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