*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> getnetbyaddr (3)              
Title
Content
Arch
Section
 

getnetbyaddr(3)

Contents


NAME    [Toc]    [Back]

       getnetbyaddr,  getnetbyaddr_r  -  Get  a  network entry by
       address

SYNOPSIS    [Toc]    [Back]

       #include <netdb.h>

       struct netent *getnetbyaddr(
               in_addr_t num,
               int type );

       [Tru64 UNIX]  The following obsolete function is supported
       in  order to maintain backward compatibility with previous
       versions of the operating system.  You should not  use  it
       in new designs.  int getnetbyaddr_r(
               int num,
               int type,
               struct netent *net,
               struct netent_data *net_data );

       [Tru64  UNIX]  The  following  definition  of  the getnetbyaddr()
 function does not conform  to  current  standards
       and  is  supported only for backward compatibility: struct
       netent *getnetbyaddr(
               int num,
               int type );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       getnetbyaddr():  XNS4.0, XNS5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies the number of the network  in  host-byte  order.
       [Tru64  UNIX]  For  getnetbyaddr_r(),  this  points to the
       netent structure.  The netdb.h  header  file  defines  the
       netent  structure.   Specifies the Internet domain address
       format.  The  value  AF_INET   must   be   used.    [Tru64
       UNIX]  Specifies  the  number  of the network in host-byte
       order.  [Tru64 UNIX]  Is data for the  networks  database.
       The netdb.h header file defines the netent_data structure.

DESCRIPTION    [Toc]    [Back]

       The getnetbyaddr() function returns a pointer to a  structure
  of  type  netent.  Its members specify data obtained
       from either the local /etc/networks file or the  NIS  distributed
  networks  file. To determine which file or files
       to search,  and  in  which  order,  the  system  uses  the
       switches  in  the  /etc/svc.conf file.  The netdb.h header
       file defines the netent structure.

       The getnetbyaddr() function searches the network  database
       file  sequentially  until  a  match  with the num and type
       parameters occurs. The num 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 networks file.

NOTES    [Toc]    [Back]

       The getnetbyaddr() function and  its  backward  compatible
       version  return a pointer to thread-specific data.  Subsequent
 calls to these or related functions  from  the  same
       thread overwrite this data.

       [Tru64 UNIX]  The getnetbyaddr_r() function is an obsolete
       reentrant version of the getnetbyaddr() function.    It is
       supported in order to maintain backward compatibility with
       previous versions of the operating system and  should  not
       be used in new designs.  Note that you must set the net_fp
       field of the netent_data  structure  to  NULL  before  its
       first  access  by  either  the  setnetent_r()  or  getnetbyaddr_r()
 function.

       You  must  initialize  the  _net_stayopen  option  of  the
       netent_data structure if you are not using the setnetent()
       function.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion,  the  getnetbyaddr()  function
       and  its backward compatible version return a pointer to a
       netent structure.   If it fails or reaches the end of  the
       /etc/networks name file, it returns a null pointer.

       [Tru64  UNIX]  Upon  successful  completion,  the  getnetbyaddr_r()
 function stores the  netent  structure  in  the
       location  pointed  to  by  net,  and  returns a value of 0
       (zero).  Upon failure, it returns a value of -1.

ERRORS    [Toc]    [Back]

       Current industry standards do not define error values  for
       the getnetbyaddr() function.

       [Tru64  UNIX]  If  any of the following conditions occurs,
       the getnetbyaddr_r() function sets  errno  to  the  corresponding
 value:

       The  net  or  net_data  parameter  is invalid.  The search
       failed.

FILES    [Toc]    [Back]

       The Internet network name database file.  Each  record  in
       the  file occupies a single line and has three fields: the
       official network name, the network number, and alias.

SEE ALSO    [Toc]    [Back]

      
      
       Functions:  endnetent(3),  getnetent(3),  getnetbyname(3),
       setnetent(3).

       Files: networks(4), svc.conf(4).

       Networks: nis_intro(7).

       Standards: standards(5).

       Network Programmer's Guide



                                                  getnetbyaddr(3)
[ Back ]
 Similar pages
Name OS Title
getipnodebyaddr Tru64 Get a network host entry by address
gethostbyaddr Tru64 Get a network host entry by address
gethostbyaddr_r Tru64 Get a network host entry by address
getipnodebyname Tru64 Get a network host entry by name for a specific address family
inet_network Tru64 Translate an Internet dot-formatted address string to a network address integer
inet_netof Tru64 Translate an Internet address into its network address component
inet_addr Tru64 Translate an Internet network address string to an Internet address integer
inet_ntop Linux Parse network address structures
inet_makeaddr Tru64 Translate an Internet network address and
inet_pton Linux Create a network address structure
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service