1ENDNETENT(P)               POSIX Programmer's Manual              ENDNETENT(P)
2
3
4

NAME

6       endnetent,  getnetbyaddr,  getnetbyname, getnetent, setnetent - network
7       database functions
8

SYNOPSIS

10       #include <netdb.h>
11
12       void endnetent(void);
13       struct netent *getnetbyaddr(uint32_t net, int type);
14       struct netent *getnetbyname(const char *name);
15       struct netent *getnetent(void);
16       void setnetent(int stayopen);
17
18

DESCRIPTION

20       These functions shall retrieve information about networks. This  infor‐
21       mation  is  considered  to be stored in a database that can be accessed
22       sequentially or  randomly.  The  implementation  of  this  database  is
23       unspecified.
24
25       The  setnetent()  function  shall open and rewind the database.  If the
26       stayopen argument is non-zero, the connection to the net database shall
27       not be closed after each call to getnetent() (either directly, or indi‐
28       rectly through one of the other getnet*() functions), and the implemen‐
29       tation may maintain an open file descriptor to the database.
30
31       The  getnetent()  function  shall  read the next entry of the database,
32       opening and closing a connection to the database as necessary.
33
34       The getnetbyaddr() function shall search the database from  the  begin‐
35       ning,  and  find the first entry for which the address family specified
36       by type matches the  n_addrtype  member  and  the  network  number  net
37       matches the n_net member, opening and closing a connection to the data‐
38       base as necessary.  The net argument shall be  the  network  number  in
39       host byte order.
40
41       The  getnetbyname()  function shall search the database from the begin‐
42       ning and find the first entry for which the network name  specified  by
43       name matches the n_name member, opening and closing a connection to the
44       database as necessary.
45
46       The getnetbyaddr(), getnetbyname(),  and  getnetent()  functions  shall
47       each return a pointer to a netent structure, the members of which shall
48       contain the fields of an entry in the network database.
49
50       The endnetent() function shall close the database, releasing  any  open
51       file descriptor.
52
53       These  functions need not be reentrant. A function that is not required
54       to be reentrant is not required to be thread-safe.
55

RETURN VALUE

57       Upon successful completion, getnetbyaddr(), getnetbyname(), and  getne‐
58       tent()  shall  return  a pointer to a netent structure if the requested
59       entry was found, and a null pointer if the  end  of  the  database  was
60       reached or the requested entry was not found. Otherwise, a null pointer
61       shall be returned.
62

ERRORS

64       No errors are defined.
65
66       The following sections are informative.
67

EXAMPLES

69       None.
70

APPLICATION USAGE

72       The  getnetbyaddr(),  getnetbyname(),  and  getnetent()  functions  may
73       return  pointers to static data, which may be overwritten by subsequent
74       calls to any of these functions.
75

RATIONALE

77       None.
78

FUTURE DIRECTIONS

80       None.
81

SEE ALSO

83       The Base Definitions volume of IEEE Std 1003.1-2001, <netdb.h>
84
86       Portions of this text are reprinted and reproduced in  electronic  form
87       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
88       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
89       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
90       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
91       event of any discrepancy between this version and the original IEEE and
92       The Open Group Standard, the original IEEE and The Open Group  Standard
93       is  the  referee document. The original Standard can be obtained online
94       at http://www.opengroup.org/unix/online.html .
95
96
97
98IEEE/The Open Group                  2003                         ENDNETENT(P)
Impressum