@heading Variables

@deffn %raddb-path
A path to radius configuration directory.

@deffn rad-server-list
@vindex rad-server-list, radscm
A list of radius servers. Each element of the list is:
@lisp
(list ID-STRING HOST-STRING SECRET-STRING AUTH-NUM ACCT-NUM CNTL-NUM)
@end lisp

@noindent
where:

@multitable @columnfractions .40 .45
@deffn ID-STRING         @tab Server ID
@deffn HOST-STRING	@tab Server hostname or IP address
@deffn SECRET-STRING	@tab Shared secret key to use
@deffn AUTH-NUM          @tab Authentication port number
@deffn ACCT-NUM          @tab Accounting port number
@deffn CNTL-NUM          @tab Control channel port number
@end multitable
Thus, each entry can be used as an argument to rad-client-set-server or
rad-client-add-server.

@end table

@heading Functions

@table @code
@deffn rad-send-internal

@lisp
(rad-send-internal PORT-NUMBER CODE-NUMBER PAIR-LIST)
@end lisp

Sends the request to currently selected server.
Arguments are:

@table @var
@deffn PORT-NUMBER
Port number to use.

        @multitable @columnfractions .40 .40
                @deffn 0         @tab Authentication port
                @deffn 1         @tab Accounting port
                @deffn 2         @tab Control port
        @end multitable
        @noindent
The actual port numbers are those configured for
the given server.
@deffn CODE-NUMBER
Request code.
@deffn PAIR-LIST
List of Attribute-value pairs. Each pair is either
@lisp
        (cons ATTR-NAME-STRING  VALUE)
@end lisp
or
@lisp
        (cons ATTR-NUMBER  VALUE)
@end lisp
@end table
@noindent

Return:

On success
@lisp
	(list RETURN-CODE-NUMBER PAIR-LIST)
@end lisp
On failure:
@lisp
	'()
@end lisp

@deffn rad-send

@lisp
(rad-send PORT-NUMBER CODE-NUMBER PAIR-LIST . VERBOSE)
@end lisp

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.

@deffn rad-client-list-servers

@lisp
(rad-client-list-servers)
@end lisp

List currently configured servers. Two column for each server are displayed:
Server ID and IP address.

@deffn rad-get-server

@lisp
(rad-get-server)
@end lisp

Returns the ID of the currently selected server.

@deffn rad-client-set-server

@lisp
(rad-client-set-server LIST)
@end lisp

Selects for use the server described by LIST. A LIST should be:
@lisp
(list ID-STRING HOST-STRING SECRET-STRING AUTH-NUM ACCT-NUM CNTL-NUM)
@end lisp
@noindent
where:

@multitable @columnfractions .40 .45
@deffn ID-STRING         @tab Server ID
@deffn HOST-STRING	@tab Server hostname or IP address
@deffn SECRET-STRING	@tab Shared secret key to use
@deffn AUTH-NUM          @tab Authentication port number
@deffn ACCT-NUM          @tab Accounting port number
@deffn CNTL-NUM          @tab Control channel port number
@end multitable

@deffn rad-client-add-server

@lisp
(rad-client-add-server LIST)
@end lisp

Adds the server described by LIST to the list of active servers.
A LIST should be:
@lisp
(list ID-STRING HOST-STRING SECRET-STRING AUTH-NUM ACCT-NUM CNTL-NUM)
@end lisp
@noindent
where:

@multitable @columnfractions .40 .45
@deffn ID-STRING         @tab Server ID
@deffn HOST-STRING	@tab Server hostname or IP address
@deffn SECRET-STRING	@tab Shared secret key to use
@deffn AUTH-NUM          @tab Authentication port number
@deffn ACCT-NUM          @tab Accounting port number
@deffn CNTL-NUM          @tab Control channel port number
@end multitable

@deffn rad-dict-name->attr

@lisp 
(rad-dict-name->attr NAME-STRING)
@end lisp

Returns a dictionary entry for the given attribute name or #f if
no such name was found in the dictionary.
The entry is a list of the form:

@lisp
	(NAME-STRING ATTR-NUMBER TYPE-NUMBER VENDOR)
@end lisp
@noindent
where:

@multitable @columnfractions .40 .45
	@deffn NAME-STRING	@tab is the attribute name,
        @deffn VALUE-NUMBER	@tab is the attribute number,
	@deffn TYPE-NUMBER	@tab is the attribute type
	@deffn VENDOR		@tab is the vendor PEC, if the attribute is a
			Vendor-Specific one, or #f otherwise.
@end multitable

@deffn rad-dict-name->value

@lisp
(rad-dict-name->value ATTR VALUE-STRING)
@end lisp

Returns the numeric value of the VALUE-STRING symbolic value pertaining
to attribute ATTR. ATTR can be either the attribute name or its number.

@deffn rad-dict-pec->vendor

@lisp
(rad-dict-pec->vendor PEC-NUMBER)
@end lisp

Converts PEC to the vendor name

@deffn rad-read-no-echo

@lisp
        (rad-read-no-echo PROMPT-STRING)
@end lisp

Prints the given PROMPT-STRING, 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.

@deffn rad-client-timeout

@lisp
        (rad-client-timeout NUMBER)
@end lisp

Sets the timeout for waiting to the server reply.

@deffn rad-client-retry

@lisp
(rad-client-retry NUMBER)
@end lisp

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

@deffn rad-format-code

@lisp
(rad-format-code DEST-BOOL CODE-NUMBER)
@end lisp

Format a radius reply code into a human-readable form.
DEST-BOOL has the same meaning as in format.

@deffn rad-format-pair

@lisp
(rad-format-pair DEST-BOOL PAIR)
@end lisp

Format a radius attribute/value pair for output.
DEST-BOOL has the same meaning as in format.
PAIR is eihter
@lisp
		(cons NAME-STRING VALUE)
@end lisp
@noindent
	or
@lisp
		(cons ATTR-NUMBER VALUE)
@end lisp
@noindent
where VALUE may be of any type appropriate for the given attribute.

@deffn rad-print-pairs

@lisp
(rad-print-pairs DEST-BOOL PAIR-LIST)
@end lisp

Output the radius attribute/value pairs from the PAIR-LIST.
DEST-BOOL has the same meaning as in format.
PAIR-LIST is a list of pairs in the form
@lisp
		(cons NAME-STRING VALUE)
@end lisp
@noindent
	or
@lisp
		(cons ATTR-NUMBER VALUE)
@end lisp
@noindent
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.

@deffn rad-format-reply-msg

@lisp
(rad-format-reply-msg PAIR-LIST . TEXT)
@end lisp

Concatenate and print text from all "Reply-Message" pairs from the
PAIR-LIST. If TEXT is specified, it is printed before the concatenated
text.

@deffn rad-list-servers

@lisp
(rad-list-servers)
@end lisp

For each server from @code{rad-server-list} print its ID and hostname
or IP address.

@deffn rad-select-server

@lisp
(rad-select-server ID-STRING)
@end lisp

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

@deffn rad-add-server

@lisp
(rad-add-server ID-STRING)
@end lisp

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

