1 .\" @(#)getnetconfig.3n 1.28 93/06/02 SMI; from SVr4
2 .\" $NetBSD: getnetconfig.3,v 1.1 2000/06/02 23:11:11 fvdl Exp $
4 .\" Copyright 1989 AT&T
13 .Nm freenetconfigent ,
16 .Nd get network configuration database entry
21 .Ft "struct netconfig *"
22 .Fn getnetconfig "void *handlep"
24 .Fn setnetconfig "void"
26 .Fn endnetconfig "void *handlep"
27 .Ft "struct netconfig *"
28 .Fn getnetconfigent "const char *netid"
30 .Fn freenetconfigent "struct netconfig *netconfigp"
32 .Fn nc_perror "const char *msg"
36 The library routines described on this page
37 provide the application access to
38 the system network configuration database,
43 returns a pointer to the
46 database, formatted as a
47 .Ft "struct netconfig" .
48 Successive calls will return successive netconfig
49 entries in the netconfig database.
53 can be used to search the entire netconfig
60 at the end of the file.
64 is the handle obtained through
73 the netconfig database.
77 must be called before the first call to
79 and may be called at any other time.
83 need not be called before a call to
88 returns a unique handle to be used by
94 should be called when processing is complete to release resources for reuse.
98 is the handle obtained through
100 Programmers should be aware, however, that the last call to
102 frees all memory allocated by
105 .Ft "struct netconfig"
110 may not be called before
117 to the netconfig structure corresponding
125 (that is, does not name an entry in the netconfig database).
130 frees the netconfig structure pointed to by
132 (previously returned by
133 .Fn getnetconfigent ) .
138 prints a message to the standard error indicating why any of the
139 above routines failed.
140 The message is prepended with the string
143 A newline character is appended at the end of the message.
150 but instead of sending the message
151 to the standard error, will return a pointer to a string that
152 contains the error message.
159 can also be used with the
161 access routines defined in
167 returns a unique handle to be used by
169 In the case of an error,
177 can be used to print the reason for failure.
182 returns a pointer to the current entry in the netconfig
183 database, formatted as a
184 .Ft "struct netconfig" .
190 at the end of the file, or upon failure.
195 returns 0 on success and \-1 on failure
198 was not called previously).
202 returns a pointer to the
203 .Ft "struct netconfig"
204 structure corresponding to
212 returns a pointer to a buffer which contains the error message string.
213 This buffer is overwritten on each call.
214 In multithreaded applications, this buffer is
215 implemented as thread-specific data.
217 .Bl -tag -width /etc/netconfig -compact
218 .It Pa /etc/netconfig