getnetbyaddr

Searches the network database sequentially from the beginning of the database for a network record with a given address.

Format

#include  <netdb.h>

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

Arguments

net
The network number, in host byte order, of the network database entry required.
type
The type of network sought. Currently, only AF_INET (defined in <socket.h>) is supported.)

Description

This routine finds the first network record in the network database with the given address.

The getnetent, getnetbyaddr, and getnetbyname routines all use a common static area for their return values. This means that subsequent calls to any of these routines will overwrite any existing network entry. You must make a copy of the network entry if you wish to save it.

Return Values
NULL  Indicates EOF or an error. 
A pointer to an object having the netent structure. See the <netdb.h> header file for a description of the netent structure. 


Previous Page | Next Page | Table of Contents | Index