www.delorie.com/gnu/docs/guile/guile_428.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

38.11.2.2 The Network Database

The following functions accept an object representing a network and return a selected component:

Scheme Procedure: netent:name net
The "official" network name.
Scheme Procedure: netent:aliases net
A list of aliases for the network.
Scheme Procedure: netent:addrtype net
The type of the network number. Currently, this returns only AF_INET.
Scheme Procedure: netent:net net
The network number.

The following procedures are used to search the network database:

Scheme Procedure: getnet [net]
Scheme Procedure: getnetbyname net-name
Scheme Procedure: getnetbyaddr net-number
C Function: scm_getnet (net)
Look up a network by name or net number in the network database. The net-name argument must be a string, and the net-number argument must be an integer. getnet will accept either type of argument, behaving like getnetent (see below) if no arguments are given.

The following procedures may be used to step through the network database from beginning to end.

Scheme Procedure: setnetent [stayopen]
Initialize an internal stream from which network objects may be read. This procedure must be called before any calls to getnetent, and may also be called afterward to reset the net entry stream. If stayopen is supplied and is not #f, the database is not closed by subsequent getnetbyname or getnetbyaddr calls, possibly giving an efficiency gain.

Scheme Procedure: getnetent
Return the next entry from the network database.

Scheme Procedure: endnetent
Close the stream used by getnetent. The return value is unspecified.

Scheme Procedure: setnet [stayopen]
C Function: scm_setnet (stayopen)
If stayopen is omitted, this is equivalent to endnetent. Otherwise it is equivalent to setnetent stayopen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003