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
19 .Ft "struct netconfig *"
20 .Fn getnetconfig "void *handlep"
22 .Fn setnetconfig "void"
24 .Fn endnetconfig "void *handlep"
25 .Ft "struct netconfig *"
26 .Fn getnetconfigent "const char *netid"
28 .Fn freenetconfigent "struct netconfig *netconfigp"
30 .Fn nc_perror "const char *msg"
34 The library routines described on this page
35 provide the application access to
36 the system network configuration database,
41 returns a pointer to the
44 database, formatted as a
45 .Ft "struct netconfig" .
46 Successive calls will return successive netconfig
47 entries in the netconfig database.
51 can be used to search the entire netconfig
58 at the end of the file.
62 is the handle obtained through
71 the netconfig database.
75 must be called before the first call to
77 and may be called at any other time.
81 need not be called before a call to
86 returns a unique handle to be used by
92 should be called when processing is complete to release resources for reuse.
96 is the handle obtained through
98 Programmers should be aware, however, that the last call to
100 frees all memory allocated by
103 .Ft "struct netconfig"
108 may not be called before
115 to the netconfig structure corresponding
123 (that is, does not name an entry in the netconfig database).
128 frees the netconfig structure pointed to by
130 (previously returned by
131 .Fn getnetconfigent ) .
136 prints a message to the standard error indicating why any of the
137 above routines failed.
138 The message is prepended with the string
141 A newline character is appended at the end of the message.
148 but instead of sending the message
149 to the standard error, will return a pointer to a string that
150 contains the error message.
157 can also be used with the
159 access routines defined in
165 returns a unique handle to be used by
167 In the case of an error,
175 can be used to print the reason for failure.
180 returns a pointer to the current entry in the netconfig
181 database, formatted as a
182 .Ft "struct netconfig" .
188 at the end of the file, or upon failure.
193 returns 0 on success and \-1 on failure
196 was not called previously).
200 returns a pointer to the
201 .Ft "struct netconfig"
202 structure corresponding to
210 returns a pointer to a buffer which contains the error message string.
211 This buffer is overwritten on each call.
212 In multithreaded applications, this buffer is
213 implemented as thread-specific data.
215 .Bl -tag -width /etc/netconfig -compact
216 .It Pa /etc/netconfig