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

Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] The Protocol Database

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

Scheme Procedure: protoent:name protocol
The "official" protocol name.
Scheme Procedure: protoent:aliases protocol
A list of aliases for the protocol.
Scheme Procedure: protoent:proto protocol
The protocol number.

The following procedures are used to search the protocol database:

Scheme Procedure: getproto [protocol]
Scheme Procedure: getprotobyname name
Scheme Procedure: getprotobynumber number
C Function: scm_getproto (protocol)
Look up a network protocol by name or by number. getprotobyname takes a string argument, and getprotobynumber takes an integer argument. getproto will accept either type, behaving like getprotoent (see below) if no arguments are supplied.

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

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

Scheme Procedure: getprotoent
Return the next entry from the protocol database.

Scheme Procedure: endprotoent
Close the stream used by getprotoent. The return value is unspecified.

Scheme Procedure: setproto [stayopen]
C Function: scm_setproto (stayopen)
If stayopen is omitted, this is equivalent to endprotoent. Otherwise it is equivalent to setprotoent stayopen.

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