Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getnetbyaddr(3) — OSF/1 X2.0-8 MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getnetent(3)

getnetbyname(3)

setnetent(3)

endnetent(3)

getnetbyaddr(3)  —  Subroutines

OSF  —  Environment_Note_Added

NAME

getnetbyaddr − Gets network entry by address

LIBRARY

Sockets Library (libc.a)

SYNOPSIS

#include <netdb.h>

struct netent ∗getnetbyaddr (
long net,
int type );

PARAMETERS

netSpecifies the number of the network in host-byte order. 

typeSpecifies the Internet Domain address format. The value AF_INET must be used. 

DESCRIPTION

The getnetbyaddr() 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 netent structure. 

The getnetbyaddr() function searches the networks file sequentially until a match with the net and type parameters occurs. The net parameter must specify the network number in host-byte order. The type parameter must be the constant AF_INET. When EOF (End-of-File) is reached without a match, an error value is returned by this parameter. 

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 netent 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
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 aliases.

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), getnetbyname(3), setnetent(3), endnetent(3)

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