3 |
@c See file radius.texi for copying conditions. |
@c See file radius.texi for copying conditions. |
4 |
@comment ******************************************************************* |
@comment ******************************************************************* |
5 |
@node Radscm, , Builddbm, Utility Programs |
@node Radscm, , Builddbm, Utility Programs |
6 |
@section Radscm: A guile interface to radius functions. |
@section @command{radscm}: A Guile Interface to Radius Functions |
7 |
@pindex radscm |
@pindex radscm |
8 |
@cindex Guile interface |
@cindex Guile interface |
9 |
|
|
10 |
@command{Radscm} is a Scheme interpreter based on Guile with the addition |
@command{radscm} is a Scheme interpreter based on Guile with the addition |
11 |
of special functions and variables for communicating with |
of special functions and variables for communicating with |
12 |
@command{radiusd}. This chapter concentrates on the special features |
@command{radiusd}. This chapter concentrates on the special features |
13 |
provided by @command{radscm}. Please refer to Guile documentation for |
provided by @command{radscm}. Refer to Guile documentation for |
14 |
information about Scheme and Guile @xref{Top,,Overview,guile,The Guile Reference Manual}. |
information about Scheme and Guile (@pxref{Top,,Overview,guile,The |
15 |
|
Guile Reference Manual}). |
16 |
|
|
17 |
@heading Variables |
@heading Variables |
18 |
|
|
19 |
@deffn Variable %raddb-path |
@deffn Variable %raddb-path |
20 |
A path to radius configuration directory. |
A path to the Radius configuration directory. |
21 |
@end deffn |
@end deffn |
22 |
|
|
23 |
@deffn Function rad-server-list |
@deffn Function rad-server-list |
24 |
A list of radius servers. Each element of the list is: |
A list of radius servers. Each element of the list is: |
25 |
|
|
26 |
@lisp |
@lisp |
27 |
(list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM) |
(list @var{ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM |
28 |
|
CNTL-NUM}) |
29 |
@end lisp |
@end lisp |
30 |
|
|
31 |
@noindent |
@noindent |
32 |
where: |
where the arguments are as follows: |
33 |
|
|
34 |
@multitable @columnfractions .40 .45 |
@multitable @columnfractions .40 .45 |
35 |
@item ID-STR @tab Server @sc{id}, |
@item @var{ID-STR} @tab Server @sc{id} |
36 |
@item HOST-STR @tab Server hostname or @IP{}, |
@item @var{HOST-STR} @tab Server hostname or IP |
37 |
@item SECRET-STR @tab Shared secret key to use, |
@item @var{SECRET-STR} @tab Shared secret key to use |
38 |
@item AUTH-NUM @tab Authentication port number, |
@item @var{AUTH-NUM} @tab Authentication port number |
39 |
@item ACCT-NUM @tab Accounting port number, |
@item @var{ACCT-NUM} @tab Accounting port number |
40 |
@item CNTL-NUM @tab Control channel port number. |
@item @var{CNTL-NUM} @tab Control channel port number |
41 |
@end multitable |
@end multitable |
42 |
Thus, each entry can be used as an argument to rad-client-set-server or |
Thus, each entry can be used as an argument to |
43 |
rad-client-add-server. |
@function{rad-client-set-server} or |
44 |
|
@function{rad-client-add-server}. |
45 |
@end deffn |
@end deffn |
46 |
|
|
47 |
@heading Functions |
@heading Functions |
55 |
Port number to use. These values are allowed: |
Port number to use. These values are allowed: |
56 |
|
|
57 |
@multitable @columnfractions .40 .40 |
@multitable @columnfractions .40 .40 |
58 |
@item 0 @tab Authentication port, |
@item 0 @tab Authentication port |
59 |
@item 1 @tab Accounting port, |
@item 1 @tab Accounting port |
60 |
@item 2 @tab Control port. |
@item 2 @tab Control port |
61 |
@end multitable |
@end multitable |
62 |
@noindent |
@noindent |
63 |
The actual port numbers are those configured for |
The actual port numbers are those configured for |
65 |
@item CODE-NUMBER |
@item CODE-NUMBER |
66 |
Request code. |
Request code. |
67 |
@item PAIR-LIST |
@item PAIR-LIST |
68 |
List of Attribute-value pairs. Each pair is either |
List of attribute-value pairs. Each pair is either |
69 |
@lisp |
@lisp |
70 |
(cons ATTR-NAME-STR VALUE) |
(cons @var{ATTR-NAME-STR VALUE}) |
71 |
@end lisp |
@end lisp |
72 |
or |
or |
73 |
@lisp |
@lisp |
74 |
(cons ATTR-NUMBER VALUE) |
(cons @var{ATTR-NUMBER VALUE}) |
75 |
@end lisp |
@end lisp |
76 |
@end table |
@end table |
77 |
@noindent |
@noindent |
78 |
|
|
79 |
Return: |
Return: On success, |
|
|
|
|
On success |
|
80 |
@lisp |
@lisp |
81 |
(list RETURN-CODE-NUMBER PAIR-LIST) |
(list RETURN-CODE-NUMBER PAIR-LIST) |
82 |
@end lisp |
@end lisp |
83 |
On failure: |
On failure, |
84 |
@lisp |
@lisp |
85 |
'() |
'() |
86 |
@end lisp |
@end lisp |
87 |
@end deffn |
@end deffn |
88 |
|
|
89 |
@deffn Function rad-send PORT-NUMBER CODE-NUMBER PAIR-LIST . VERBOSE |
@deffn Function rad-send PORT-NUMBER CODE-NUMBER PAIR-LIST . VERBOSE |
90 |
Sends a radius request. Actually it does the same work as rad-send-internal |
Sends a radius request. Actually it does the same work as |
91 |
but if VERBOSE is specified, the verbose report about interaction with |
@command{rad-send-internal}, |
92 |
|
but if @var{VERBOSE} is specified, the verbose report about interaction with |
93 |
the radius server is printed. |
the radius server is printed. |
94 |
@end deffn |
@end deffn |
95 |
|
|
96 |
@deffn Function rad-client-list-servers |
@deffn Function rad-client-list-servers |
97 |
List currently configured servers. Two columns for each server are displayed: |
List currently configured servers. Two columns for each server are displayed: |
98 |
Server @sc{id} and @IP{}. |
server @sc{id} and IP. |
99 |
@end deffn |
@end deffn |
100 |
|
|
101 |
@deffn Function rad-get-server |
@deffn Function rad-get-server |
103 |
@end deffn |
@end deffn |
104 |
|
|
105 |
@deffn Function rad-client-set-server LIST |
@deffn Function rad-client-set-server LIST |
106 |
Selects for use the server described by LIST. A LIST should be: |
Selects for use the server described by @var{LIST}. Here @var{LIST} |
107 |
|
takes the form |
108 |
|
|
109 |
@lisp |
@lisp |
110 |
(list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM) |
(list @var{ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM |
111 |
|
CNTL-NUM}) |
112 |
@end lisp |
@end lisp |
113 |
@noindent |
@noindent |
114 |
where: |
where the arguments are as follows: |
115 |
|
|
116 |
@multitable @columnfractions .40 .45 |
@multitable @columnfractions .40 .45 |
117 |
@item ID-STR @tab Server @sc{id}, |
@item @var{ID-STR} @tab Server @sc{id} |
118 |
@item HOST-STR @tab Server hostname or @IP{}, |
@item @var{HOST-STR} @tab Server hostname or IP |
119 |
@item SECRET-STR @tab Shared secret key to use, |
@item @var{SECRET-STR} @tab Shared secret key to use |
120 |
@item AUTH-NUM @tab Authentication port number, |
@item @var{AUTH-NUM} @tab Authentication port number |
121 |
@item ACCT-NUM @tab Accounting port number, |
@item @var{ACCT-NUM} @tab Accounting port number |
122 |
@item CNTL-NUM @tab Control channel port number. |
@item @var{CNTL-NUM} @tab Control channel port number |
123 |
@end multitable |
@end multitable |
124 |
@end deffn |
@end deffn |
125 |
|
|
126 |
@deffn Function rad-client-add-server LIST |
@deffn Function rad-client-add-server LIST |
127 |
Adds the server described by LIST to the list of active servers. |
Adds the server described by @var{LIST} to the list of active servers. |
128 |
A LIST should be: |
Here @var{LIST} takes the form |
129 |
|
|
130 |
@lisp |
@lisp |
131 |
(list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM) |
(list @var{ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM |
132 |
|
CNTL-NUM}) |
133 |
@end lisp |
@end lisp |
134 |
|
|
135 |
@noindent |
@noindent |
136 |
where: |
where the arguments are as follows: |
137 |
|
|
138 |
@multitable @columnfractions .40 .45 |
@multitable @columnfractions .40 .45 |
139 |
@item ID-STR @tab Server @sc{id}, |
@item @var{ID-STR} @tab Server @sc{id} |
140 |
@item HOST-STR @tab Server hostname or @IP{}, |
@item @var{HOST-STR} @tab Server hostname or IP |
141 |
@item SECRET-STR @tab Shared secret key to use, |
@item @var{SECRET-STR} @tab Shared secret key to use |
142 |
@item AUTH-NUM @tab Authentication port number, |
@item @var{AUTH-NUM} @tab Authentication port number |
143 |
@item ACCT-NUM @tab Accounting port number, |
@item @var{ACCT-NUM} @tab Accounting port number |
144 |
@item CNTL-NUM @tab Control channel port number. |
@item @var{CNTL-NUM} @tab Control channel port number |
145 |
@end multitable |
@end multitable |
146 |
@end deffn |
@end deffn |
147 |
|
|
148 |
@deffn Function rad-read-no-echo PROMPT-STR |
@deffn Function rad-read-no-echo PROMPT-STR |
149 |
Prints the given PROMPT-STR, disables echoing, reads a string up to the |
Prints the given @var{PROMPT-STR}, disables echoing, reads a string up to the |
150 |
next newline character, restores echoing and returns the string entered. |
next newline character, restores echoing, and returns the string entered. |
151 |
This is the interface to the C getpass(3) function. |
This is the interface to the C @command{getpass(3)} function. |
152 |
@end deffn |
@end deffn |
153 |
|
|
154 |
@deffn Function rad-client-source-ip IP-STR |
@deffn Function rad-client-source-ip IP-STR |
155 |
Sets the @IP{} to be used as source. IP-STR can be either an |
Sets the IP to be used as source. @var{IP-STR} can be either an |
156 |
@IP{} in dotted-quad form or a hostname. |
IP in dotted-quad form or a hostname. |
157 |
@end deffn |
@end deffn |
158 |
|
|
159 |
@deffn Function rad-client-timeout NUMBER |
@deffn Function rad-client-timeout NUMBER |
160 |
Sets the timeout for waiting to the server reply. |
Sets the timeout in seconds for waiting for a server reply. |
161 |
@end deffn |
@end deffn |
162 |
|
|
163 |
@deffn Function rad-client-retry NUMBER |
@deffn Function rad-client-retry NUMBER |
164 |
Sets the number of retries for sending requests to a radius server. |
Sets the number of retries for sending requests to a Radius server. |
165 |
@end deffn |
@end deffn |
166 |
|
|
167 |
@deffn Function rad-format-code DEST-BOOL CODE-NUMBER |
@deffn Function rad-format-code DEST-BOOL CODE-NUMBER |
168 |
Format a radius reply code into a human-readable form. |
Format a radius reply code into a human-readable form. |
169 |
DEST-BOOL has the same meaning as in format. |
@var{DEST-BOOL} has the same meaning as in format. |
170 |
@end deffn |
@end deffn |
171 |
|
|
172 |
@deffn Function rad-format-pair DEST-BOOL PAIR |
@deffn Function rad-format-pair DEST-BOOL PAIR |
173 |
Format a radius attribute/value pair for output. |
Format a radius attribute-value pair for output. |
174 |
DEST-BOOL has the same meaning as in format. |
@var{DEST-BOOL} has the same meaning as in format. |
175 |
PAIR is either |
PAIR is either |
176 |
@lisp |
@lisp |
177 |
(cons NAME-STR VALUE) |
(cons @var{NAME-STR VALUE}) |
178 |
@end lisp |
@end lisp |
179 |
or |
or |
180 |
@lisp |
@lisp |
181 |
(cons ATTR-NUMBER VALUE) |
(cons @var{ATTR-NUMBER VALUE}) |
182 |
@end lisp |
@end lisp |
183 |
@noindent |
@noindent |
184 |
where VALUE may be of any type appropriate for the given attribute. |
where @var{VALUE} may be of any type appropriate for the given attribute. |
185 |
@end deffn |
@end deffn |
186 |
|
|
187 |
@deffn Function rad-print-pairs DEST-BOOL PAIR-LIST |
@deffn Function rad-print-pairs DEST-BOOL PAIR-LIST |
188 |
Output the radius attribute/value pairs from the PAIR-LIST. |
Output the radius attribute-value pairs from @var{PAIR-LIST}. |
189 |
DEST-BOOL has the same meaning as in format. |
@var{DEST-BOOL} has the same meaning as in format. |
190 |
PAIR-LIST is a list of pairs in the form |
@var{PAIR-LIST} is a list of pairs in the form |
191 |
|
|
192 |
@lisp |
@lisp |
193 |
(cons NAME-STR VALUE) |
(cons @var{NAME-STR VALUE}) |
194 |
@end lisp |
@end lisp |
195 |
@noindent |
@noindent |
196 |
or |
or |
197 |
|
|
198 |
@lisp |
@lisp |
199 |
(cons ATTR-NUMBER VALUE) |
(cons @var{ATTR-NUMBER VALUE}) |
200 |
@end lisp |
@end lisp |
201 |
@noindent |
@noindent |
202 |
where VALUE may be of any type appropriate for the given attribute. |
where @var{VALUE} may be of any type appropriate for the given attribute. |
203 |
|
|
204 |
All "Reply-Message" pairs from the list are concatenated and displayed |
All @attr{Reply-Message} pairs from the list are concatenated and displayed |
205 |
as one. |
as one. |
206 |
@end deffn |
@end deffn |
207 |
|
|
208 |
@deffn Function rad-format-reply-msg PAIR-LIST . TEXT |
@deffn Function rad-format-reply-msg PAIR-LIST . TEXT |
209 |
Concatenate and print text from all "Reply-Message" pairs from the |
Concatenate and print text from all @attr{Reply-Message} pairs from |
210 |
PAIR-LIST. If TEXT is specified, it is printed before the concatenated |
@var{PAIR-LIST}. If @var{TEXT} is specified, it is printed before the |
211 |
|
concatenated |
212 |
text. |
text. |
213 |
@end deffn |
@end deffn |
214 |
|
|
215 |
@deffn Function rad-list-servers |
@deffn Function rad-list-servers |
216 |
For each server from @code{rad-server-list} print its @sc{id} and hostname |
For each server from @code{rad-server-list}, print its @sc{id} and hostname |
217 |
or @IP{}. |
or IP. |
218 |
@end deffn |
@end deffn |
219 |
|
|
220 |
@deffn Function rad-select-server ID-STR |
@deffn Function rad-select-server ID-STR |
221 |
Select the server identified by ID-STR as a current server. The server |
Select the server identified by @var{ID-STR} as a current server. The server |
222 |
data are looked up in rad-server-list variable. |
data are looked up in rad-server-list variable. |
223 |
@end deffn |
@end deffn |
224 |
|
|