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 $
3 .\" $FreeBSD: src/lib/libc/rpc/getnetconfig.3,v 1.4 2002/12/19 09:40:23 ru Exp $
5 .\" Copyright 1989 AT&T
14 .Nm freenetconfigent ,
17 .Nd get network configuration database entry
22 .Ft "struct netconfig *"
23 .Fn getnetconfig "void *handlep"
25 .Fn setnetconfig "void"
27 .Fn endnetconfig "void *handlep"
28 .Ft "struct netconfig *"
29 .Fn getnetconfigent "const char *netid"
31 .Fn freenetconfigent "struct netconfig *netconfigp"
33 .Fn nc_perror "const char *msg"
37 The library routines described on this page
38 provide the application access to
39 the system network configuration database,
44 returns a pointer to the
47 database, formatted as a
48 .Ft "struct netconfig" .
49 Successive calls will return successive netconfig
50 entries in the netconfig database.
54 can be used to search the entire netconfig
61 at the end of the file.
65 is the handle obtained through
74 the netconfig database.
78 must be called before the first call to
80 and may be called at any other time.
84 need not be called before a call to
89 returns a unique handle to be used by
95 should be called when processing is complete to release resources for reuse.
99 is the handle obtained through
101 Programmers should be aware, however, that the last call to
103 frees all memory allocated by
106 .Ft "struct netconfig"
111 may not be called before
118 to the netconfig structure corresponding
126 (that is, does not name an entry in the netconfig database).
131 frees the netconfig structure pointed to by
133 (previously returned by
134 .Fn getnetconfigent ) .
139 prints a message to the standard error indicating why any of the
140 above routines failed.
141 The message is prepended with the string
144 A newline character is appended at the end of the message.
151 but instead of sending the message
152 to the standard error, will return a pointer to a string that
153 contains the error message.
160 can also be used with the
162 access routines defined in
168 returns a unique handle to be used by
170 In the case of an error,
178 can be used to print the reason for failure.
183 returns a pointer to the current entry in the netconfig
184 database, formatted as a
185 .Ft "struct netconfig" .
191 at the end of the file, or upon failure.
196 returns 0 on success and \-1 on failure
199 was not called previously).
203 returns a pointer to the
204 .Ft "struct netconfig"
205 structure corresponding to
213 returns a pointer to a buffer which contains the error message string.
214 This buffer is overwritten on each call.
215 In multithreaded applications, this buffer is
216 implemented as thread-specific data.
218 .Bl -tag -width /etc/netconfig -compact
219 .It Pa /etc/netconfig