getnetconfig(3N) getnetconfig(3N)
NAME
getnetconfig, setnetconfig, endnetconfig, getnetconfigent,
freenetconfigent - get network configuration database entry
SYNOPSIS
#include <netconfig.h>
void *setnetconfig(void);
struct netconfig *getnetconfig(void *handlep);
int endnetconfig(void *handlep);
struct netconfig *getnetconfigent(char *netid);
int freenetconfigent(struct netconfig *netconfigp);
DESCRIPTION
The five library routines described on this page are part of the Reli-
ant UNIX transport service selection component. They provide applica-
tion access to the system network configuration database,
/etc/netconfig. In addition to the netconfig file and the routines for
accessing it, Network Selection includes the environment variable
NETPATH [see environ(5)] and the NETPATH access routines described in
getnetpath(3N).
A call to setnetconfig() opens and resets the netconfig file.
setnetconfig() must be called before the first call to getnetconfig()
in order to open the file. setnetconfig() returns a unique handle to
be used by getnetconfig().
When first called, getnetconfig() returns a pointer to the current
entry in the netconfig database, formatted as a struct netconfig.
getnetconfig() can thus be used to search the entire netconfig file.
getnetconfig() returns NULL at end of file.
endnetconfig() should be called when processing is complete to release
the memory space allocated internally by getnetconfig() for reuse by
netconfig structures. endnetconfig() may not be called before
setnetconfig(). endnetconfig() returns 0 on success and -1 on failure
(e.g., if setnetconfig() was not called previously).
getnetconfigent(netid) returns a pointer to the struct netconfig
structure corresponding to netid. It returns NULL if netid is invalid
(i.e., does not name an entry in the netconfig database). It returns
NULL and sets errno in case of failure (e.g., if setnetconfig() was
not called previously).
freenetconfigent(netconfigp) frees the netconfig structure pointed to
by netconfigp (previously returned by getnetconfigent()).
Page 1 Reliant UNIX 5.44 Printed 11/98
getnetconfig(3N) getnetconfig(3N)
SEE ALSO
getnetpath(3N), netconfig(4), environ(5).
Page 2 Reliant UNIX 5.44 Printed 11/98