*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> endnetpath (3)              
Title
Content
Arch
Section
 

GETNETPATH(3)

Contents


NAME    [Toc]    [Back]

     getnetpath, setnetpath, endnetpath - get /etc/netconfig entry corresponding
 to NETPATH component

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <netconfig.h>

     struct netconfig *
     getnetpath(void *handlep);

     void *
     setnetpath(void);

     int
     endnetpath(void *handlep);

DESCRIPTION    [Toc]    [Back]

     The routines described in this page provide the application access to the
     system network configuration database, /etc/netconfig, as it is
     ``filtered'' by the NETPATH environment variable (see environ(7)).  See
     getnetconfig(3) for other routines that also access the network configuration
 database directly.  The NETPATH variable is a list of colon-separated
 network identifiers.

     getnetpath() returns a pointer to the netconfig database entry corresponding
 to the first valid NETPATH component.  The netconfig entry is
     formatted as a struct netconfig.  On each subsequent call, getnetpath()
     returns a pointer to the netconfig entry that corresponds to the next
     valid NETPATH component.  getnetpath() can thus be used to search the
     netconfig database for all networks included in the NETPATH variable.
     When NETPATH has been exhausted, getnetpath() returns NULL.

     A call to setnetpath() ``binds'' to or ``rewinds'' NETPATH.  setnetpath()
     must be called before the first call to getnetpath() and may be called at
     any other time. It returns a handle that is used by getnetpath().

     getnetpath() silently ignores invalid NETPATH components.  A NETPATH component
 is invalid if there is no corresponding entry in the netconfig
     database.

     If the NETPATH variable is unset, getnetpath() behaves as if NETPATH were
     set to the sequence of ``default'' or ``visible'' networks in the netconfig
 database, in the order in which they are listed.

     endnetpath() may be called to ``unbind'' from NETPATH when processing is
     complete, releasing resources for reuse.  Programmers should be aware,
     however, that endnetpath() frees all memory allocated by getnetpath() for
     the struct netconfig data structure.

RETURN VALUES    [Toc]    [Back]

     setnetpath() returns a handle that is used by getnetpath().  In case of
     an error, setnetpath() returns NULL.

     endnetpath() returns 0 on success and -1 on failure (for example, if
     setnetpath() was not called previously).  nc_perror() or nc_sperror() can
     be used to print out the reason for failure.  See getnetconfig(3).

     When first called, getnetpath() returns a pointer to the netconfig
     database entry corresponding to the first valid NETPATH component. When
     NETPATH has been exhausted, getnetpath() returns NULL.

SEE ALSO    [Toc]    [Back]

      
      
     getnetconfig(3), netconfig(5), environ(7)

BSD                             April 22, 2000                             BSD
[ Back ]
 Similar pages
Name OS Title
getnetpath IRIX get netconfig entry corresponding to NETPATH component
DXmSvnInsertComponent Tru64 Inserts a new component into each SVN entry.
DXmSvnRemoveComponent Tru64 Removes a component from each SVN entry.
DXmSvnSelectComponent Tru64 Selects an entry using a specific component.
DXmSvnSetComponentWidget Tru64 Adds an SVN subwidget component to an entry.
DXmSvnSetComponentPixmap Tru64 Adds a pixmap component to an entry.
DXmSvnSetComponentText Tru64 Adds a read-only component string to an entry.
XmStringPeekNextComponent IRIX A compound string function that returns the component type of the next component fetched
XmStringPeekNextComponent Tru64 A compound string function that returns the component type of the next component fetched
XmStringPeekNextComponent HP-UX A compound string function that returns the component type of the next component to be fetched
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service