1 .\" @(#)getnetconfig.3n 1.28 93/06/02 SMI; from SVr4
2 .\" Copyright 1989 AT&T
11 .Nm freenetconfigent ,
14 .Nd get network configuration database entry
17 .Ft "struct netconfig *"
18 .Fn getnetconfig "void *handlep"
20 .Fn setnetconfig "void"
22 .Fn endnetconfig "void *handlep"
23 .Ft "struct netconfig *"
24 .Fn getnetconfigent "const char *netid"
26 .Fn freenetconfigent "struct netconfig *netconfigp"
28 .Fn nc_perror "const char *msg"
32 The library routines described on this page
33 provide the application access to
34 the system network configuration database,
39 returns a pointer to the
42 database, formatted as a
43 .Ft "struct netconfig" .
44 Successive calls will return successive netconfig
45 entries in the netconfig database.
49 can be used to search the entire netconfig
56 at the end of the file.
60 is the handle obtained through
69 the netconfig database.
73 must be called before the first call to
75 and may be called at any other time.
79 need not be called before a call to
84 returns a unique handle to be used by
90 should be called when processing is complete to release resources for reuse.
94 is the handle obtained through
96 Programmers should be aware, however, that the last call to
98 frees all memory allocated by
101 .Ft "struct netconfig"
106 may not be called before
113 to the netconfig structure corresponding
121 (that is, does not name an entry in the netconfig database).
126 frees the netconfig structure pointed to by
128 (previously returned by
129 .Fn getnetconfigent ) .
134 prints a message to the standard error indicating why any of the
135 above routines failed.
136 The message is prepended with the string
139 A newline character is appended at the end of the message.
146 but instead of sending the message
147 to the standard error, will return a pointer to a string that
148 contains the error message.
155 can also be used with the
157 access routines defined in
163 returns a unique handle to be used by
165 In the case of an error,
173 can be used to print the reason for failure.
178 returns a pointer to the current entry in the netconfig
179 database, formatted as a
180 .Ft "struct netconfig" .
186 at the end of the file, or upon failure.
191 returns 0 on success and \-1 on failure
194 was not called previously).
198 returns a pointer to the
199 .Ft "struct netconfig"
200 structure corresponding to
208 returns a pointer to a buffer which contains the error message string.
209 This buffer is overwritten on each call.
210 In multithreaded applications, this buffer is
211 implemented as thread-specific data.
213 .Bl -tag -width /etc/netconfig -compact
214 .It Pa /etc/netconfig
217 These functions are part of libtirpc.