[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2

getnetbyaddr_r Subroutine

Purpose

Gets network entry by address.

Library

Standard C Library (libc.a)

Syntax

#include<netdb.h>
int getnetbyaddr_r(net, type, netent, net_data)

register in_addr_t net;
register int type;
struct netent *netent;
struct netent_data *net_data;

Description

The getnetbyaddr_r subroutine retrieves information from the /etc/networks file using the Name parameter as a search key.

The getnetbyaddr_r subroutine internally calls the getnetbyaddr subroutine and stores the information in the structure data.

The getnetbyaddr subroutine overwrites the static data returned in subsequent calls. The getnetbyaddr_r subroutine does not.

Use the endnetent_r subroutine to close the /etc/networks file.

Parameters

Net Specifies the number of the network to be located.
Type Specifies the address family for the network. The only supported values are AF_INET, and AF_INET6.
netent Points to the netent structure.
net_data Points to the net_data structure.

Return Values

The function returns a 0 if successful and a -1 if unsuccessful.

Files

/etc/networks Contains official network names.

Related Information

endnetent_r Subroutine, getnetbyname_r Subroutine, getnetent_r Subroutine, and setnetent_r Subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]