📄 radscm.texi
字号:
@c This is part of the Radius manual.@c Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc.@c Written by Sergey Poznyakoff@c See file radius.texi for copying conditions.@comment *******************************************************************@node Radscm, , Builddbm, Utility Programs@section @command{radscm}: A Guile Interface to Radius Functions@pindex radscm@cindex Guile interface@command{radscm} is a Scheme interpreter based on Guile with the additionof special functions and variables for communicating with@command{radiusd}. This chapter concentrates on the special featuresprovided by @command{radscm}. Refer to Guile documentation forinformation about Scheme and Guile (@pxref{Top,,Overview,guile,TheGuile Reference Manual}).@heading Variables@deffn Variable %raddb-pathA path to the Radius configuration directory.@end deffn@deffn Function rad-server-listA list of radius servers. Each element of the list is:@smalllisp(list @var{id-str host-str secret-str auth-num acct-num cntl-num})@end smalllisp@noindentwhere the arguments are as follows:@multitable @columnfractions .40 .45@item @var{id-str} @tab Server @sc{id}@item @var{host-str} @tab Server hostname or IP@item @var{secret-str} @tab Shared secret key to use@item @var{auth-num} @tab Authentication port number@item @var{acct-num} @tab Accounting port number@item @var{cntl-num} @tab Control channel port number@end multitableThus, each entry can be used as an argument to@code{rad-client-set-server} or@code{rad-client-add-server}.@end deffn@heading Functions@deffn Function rad-send-internal @var{port-number} @var{code-number} @var{pair-list}Sends the request to currently selected server.Arguments are:@table @var@item port-numberPort number to use. These values are allowed:@multitable @columnfractions .40 .40@item 0 @tab Authentication port@item 1 @tab Accounting port@item 2 @tab Control port@end multitable@noindentThe actual port numbers are those configured forthe given server.@item code-numberRequest code.@item pair-listList of attribute-value pairs. Each pair is either@smalllisp (cons @var{attr-name-str value})@end smalllispor@smalllisp (cons @var{attr-number value})@end smalllisp@end table@noindentReturn: On success,@smalllisp (list @var{return-code-number pair-list})@end smalllispOn failure,@smalllisp '()@end smalllisp@end deffn@deffn Function rad-send @var{port-number} @var{code-number} @var{pair-list} . @var{verbose}Sends a radius request. Actually it does the same work as@command{rad-send-internal},but if @var{verbose} is specified, the verbose report about interaction withthe radius server is printed.@end deffn@deffn Function rad-client-list-serversList currently configured servers. Two columns for each server are displayed:server @sc{id} and IP.@end deffn@deffn Function rad-get-serverReturns the @sc{id} of the currently selected server.@end deffn@deffn Function rad-client-set-server @var{list}Selects for use the server described by @var{list}. Here @var{list}takes the form@smalllisp(list @var{id-str host-str secret-str auth-num acct-num cntl-num})@end smalllisp@noindentwhere the elements are as follows:@multitable @columnfractions .40 .45@item @var{id-str} @tab Server @sc{id}@item @var{host-str} @tab Server hostname or IP@item @var{secret-str} @tab Shared secret key to use@item @var{auth-num} @tab Authentication port number@item @var{acct-num} @tab Accounting port number@item @var{cntl-num} @tab Control channel port number@end multitable@end deffn@deffn Function rad-client-add-server @var{list}Adds the server described by @var{list} to the list of active servers.Here @var{list} takes the form@smalllisp(list @var{id-str host-str secret-str auth-num acct-num cntl-num})@end smalllisp@noindentwhere the elements are as follows:@multitable @columnfractions .40 .45@item @var{id-str} @tab Server @sc{id}@item @var{host-str} @tab Server hostname or IP@item @var{secret-str} @tab Shared secret key to use@item @var{auth-num} @tab Authentication port number@item @var{acct-num} @tab Accounting port number@item @var{cntl-num} @tab Control channel port number@end multitable@end deffn@deffn Function rad-read-no-echo @var{prompt-str}Prints the given @var{prompt-str}, disables echoing, reads a string up to thenext newline character, restores echoing, and returns the string entered.This is the interface to the C @command{getpass(3)} function.@end deffn@deffn Function rad-client-source-ip @var{ip-str}Sets the IP to be used as source. @var{ip-str} can be either anIP in dotted-quad form or a hostname.@end deffn@deffn Function rad-client-timeout @var{number}Sets the timeout in seconds for waiting for a server reply.@end deffn@deffn Function rad-client-retry @var{number}Sets the number of retries for sending requests to a Radius server.@end deffn@deffn Function rad-format-code @var{dest-bool} @var{code-number}Format a radius reply code into a human-readable form.@var{dest-bool} has the same meaning as in @code{format}(@pxref{Formatted Output,,Formatted Output,guile,The Guile Reference Manual}.)@end deffn@deffn Function rad-format-pair @var{dest-bool} @var{pair}Format a radius attribute-value pair for output.@var{dest-bool} has the same meaning as in @code{format}.@var{pair} is either@smalllisp (cons @var{name-str value})@end smalllispor@smalllisp (cons @var{attr-number value})@end smalllisp@noindentwhere @var{value} may be of any type appropriate for the given attribute.@end deffn@deffn Function rad-print-pairs @var{dest-bool} @var{pair-list}Output the radius attribute-value pairs from @var{pair-list}.@var{dest-bool} has the same meaning as in format.@var{pair-list} is a list of pairs in the form@smalllisp (cons @var{name-str value})@end smalllisp@noindentor@smalllisp (cons @var{attr-number value})@end smalllisp@noindentwhere @var{value} may be of any type appropriate for the given attribute.All @attr{Reply-Message} pairs from the list are concatenated and displayedas one.@end deffn@deffn Function rad-format-reply-msg @var{pair-list} . @var{text}Concatenate and print text from all @attr{Reply-Message} pairs from@var{pair-list}. If @var{text} is specified, it is printed before theconcatenated text.@end deffn@deffn Function rad-list-serversFor each server from @code{rad-server-list}, print its @sc{id} and hostnameor IP.@end deffn@deffn Function rad-select-server @var{ID-STR}Select the server identified by @var{id-str} as a current server. The serverdata are looked up in rad-server-list variable.@end deffn@deffn Function rad-add-server @var{id-str}Add the server identified by @var{id-str} to the list of current servers.The server data are looked up in rad-server-list variable.@end deffn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -