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

11.9 radscm: A Guile Interface to Radius Functions

radscm is a Scheme interpreter based on Guile with the addition of special functions and variables for communicating with radiusd. This chapter concentrates on the special features provided by radscm. Refer to Guile documentation for information about Scheme and Guile (see (guile)Top section `Overview' in The Guile Reference Manual).

Variables

Variable: %raddb-path

A path to the Radius configuration directory.

Function: rad-server-list

A list of radius servers. Each element of the list is:

 
(list id-str host-str secret-str auth-num acct-num
      cntl-num)

where the arguments are as follows:

id-str

Server ID

host-str

Server hostname or IP

secret-str

Shared secret key to use

auth-num

Authentication port number

acct-num

Accounting port number

cntl-num

Control channel port number

Thus, each entry can be used as an argument to rad-client-set-server or rad-client-add-server.

Functions

Function: rad-send-internal port-number code-number pair-list

Sends the request to currently selected server. Arguments are:

port-number

Port number to use. These values are allowed:

0

Authentication port

1

Accounting port

2

Control port

The actual port numbers are those configured for the given server.

code-number

Request code.

pair-list

List of attribute-value pairs. Each pair is either

 
        (cons attr-name-str value)

or

 
        (cons attr-number value)

Return: On success,

 
        (list return-code-number pair-list)

On failure,

 
        '()
Function: rad-send port-number code-number pair-list . verbose

Sends a radius request. Actually it does the same work as rad-send-internal, but if verbose is specified, the verbose report about interaction with the radius server is printed.

Function: rad-client-list-servers

List currently configured servers. Two columns for each server are displayed: server ID and IP.

Function: rad-get-server

Returns the ID of the currently selected server.

Function: rad-client-set-server list

Selects for use the server described by list. Here list takes the form

 
(list id-str host-str secret-str auth-num acct-num
      cntl-num)

where the elements are as follows:

id-str

Server ID

host-str

Server hostname or IP

secret-str

Shared secret key to use

auth-num

Authentication port number

acct-num

Accounting port number

cntl-num

Control channel port number

Function: rad-client-add-server list

Adds the server described by list to the list of active servers. Here list takes the form

 
(list id-str host-str secret-str auth-num acct-num
      cntl-num)

where the elements are as follows:

id-str

Server ID

host-str

Server hostname or IP

secret-str

Shared secret key to use

auth-num

Authentication port number

acct-num

Accounting port number

cntl-num

Control channel port number

Function: rad-read-no-echo prompt-str

Prints the given prompt-str, disables echoing, reads a string up to the next newline character, restores echoing, and returns the string entered. This is the interface to the C getpass(3) function.

Function: rad-client-source-ip ip-str

Sets the IP to be used as source. ip-str can be either an IP in dotted-quad form or a hostname.

Function: rad-client-timeout number

Sets the timeout in seconds for waiting for a server reply.

Function: rad-client-retry number

Sets the number of retries for sending requests to a Radius server.

Function: rad-format-code dest-bool code-number

Format a radius reply code into a human-readable form. dest-bool has the same meaning as in format (see (guile)Formatted Output section `Formatted Output' in The Guile Reference Manual.)

Function: rad-format-pair dest-bool pair

Format a radius attribute-value pair for output. dest-bool has the same meaning as in format. pair is either

 
                (cons name-str value)

or

 
                (cons attr-number value)

where value may be of any type appropriate for the given attribute.

Function: rad-print-pairs dest-bool pair-list

Output the radius attribute-value pairs from pair-list. dest-bool has the same meaning as in format. pair-list is a list of pairs in the form

 
                (cons name-str value)

or

 
                (cons attr-number value)

where value may be of any type appropriate for the given attribute.

All Reply-Message pairs from the list are concatenated and displayed as one.

Function: rad-format-reply-msg pair-list . text

Concatenate and print text from all Reply-Message pairs from pair-list. If text is specified, it is printed before the concatenated text.

Function: rad-list-servers

For each server from rad-server-list, print its ID and hostname or IP.

Function: rad-select-server ID-STR

Select the server identified by id-str as a current server. The server data are looked up in rad-server-list variable.

Function: rad-add-server id-str

Add the server identified by id-str to the list of current servers. The server data are looked up in rad-server-list variable.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Sergey Poznyakoff on December, 6 2008 using texi2html 1.78.