]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
document actions and retries
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Nov 2022 11:58:03 +0000 (06:58 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Nov 2022 14:53:08 +0000 (09:53 -0500)
doc/antora/modules/reference/pages/unlang/actions.adoc [new file with mode: 0644]
doc/antora/modules/reference/pages/unlang/case.adoc
doc/antora/modules/reference/pages/unlang/else.adoc
doc/antora/modules/reference/pages/unlang/elsif.adoc
doc/antora/modules/reference/pages/unlang/group.adoc
doc/antora/modules/reference/pages/unlang/if.adoc
doc/antora/modules/reference/pages/unlang/module.adoc

diff --git a/doc/antora/modules/reference/pages/unlang/actions.adoc b/doc/antora/modules/reference/pages/unlang/actions.adoc
new file mode 100644 (file)
index 0000000..d6984de
--- /dev/null
@@ -0,0 +1,69 @@
+= Actions and Return Codes
+
+The xref:unlang/module.adoc[module] syntax allows for the module
+return codes to be over-ridden on a per-module basis.  The `actions`
+section allows for section return codes to be over-ridden on a
+per-section basis.
+
+.Syntax
+[source, unlang]
+----
+actions {
+       fail = 1
+       ok = handled
+       reject = return
+       retry {
+               max_rtx_time = 1
+               max_rtx_count = 3
+               max_rtx_duration = 3
+       }
+}
+----
+
+section priority overrides are specified in an `actions` block, which
+_must_ be the last thing in a section.  Actions can be set in blocks for the
+following keywords:
+
+* `case`
+* `if`
+* `else`
+* `elsif`
+* `group`
+
+== Override Syntax
+
+The format of an override is `<rcode> = (<integer>|<action>)` - That is,
+a number greater than or equal to 0, or a named action.
+
+.Named Actions
+[options="header"]
+[cols="30%,70%"]
+|=====
+| Action       | Description
+| break                | "break" out of the parent block and stop processing it.
+| default      | Use the defaut priority for this rcode.
+| reject       | return a `reject` rcode.
+| retry                | re-run the section, as given by the the `retry` subsection.
+| return       | return out of the parent block and stop processing it.
+|=====
+
+include::partial$rcode_table.adoc[]
+
+== Retry subsection
+
+The `retry` subsection is optional, and is only used when the
+right-hand side of an action is `retry`.
+
+.Retry Configuration
+[options="header"]
+[cols="30%,70%"]
+|=====
+| Configuration                | Description
+| max_rtx_count                | maximum number of times this section is retried.
+| max_rtx_time         | maximum time for one try before it is time out, and another retry made.
+| max_rtx_duration     | maximum time for all retries before the section returns `fail`
+|=====
+
+All times and durations are parsed as the data type `time_delta`.
+
+If no value is given, it is assumed to be zero.
index 526436e163d01e5f1ac923126008056b5b87c209..1a0f7f5c1ba1269787cf27c9992bdc16b25acd7e 100644 (file)
@@ -42,5 +42,7 @@ switch &User-Name {
 }
 ----
 
+The last entry in a `case` section can also be an xref:unlang/actions.adoc[actions] subsection.
+
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.
index 71ee7268bc0be65474ce558146c98ed27abc1ad7..4e4926f1eaa9c2e346214d2ac16164d3e25ffd1a 100644 (file)
@@ -26,5 +26,7 @@ else {
 }
 ----
 
+The last entry in an `else` section can also be an xref:unlang/actions.adoc[actions] subsection.
+
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.
index 800136f9c1ed8e616d3d175543efbe861417cf90..125d0f4fa676fd5a704bb0b4cd364063fa736c5a 100644 (file)
@@ -39,5 +39,7 @@ elsif (&User-Name == "doug") {
 }
 ----
 
+The last entry in an `elsif` section can also be an xref:unlang/actions.adoc[actions] subsection.
+
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.
index 520a023281a60bacfe8d8db8c338516df41672da..aa0e40f6b8db4dcc013a296add4ecf79ef9ebef6 100644 (file)
@@ -35,5 +35,7 @@ group {
 }
 ----
 
+The last entry in a `group` section can also be an xref:unlang/actions.adoc[actions] subsection.
+
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.
index e2d7c68086adc59e60c7136c9728e2c1b2877adc..e6c519f82976e37d370b494548bf7d13f1e681f5 100644 (file)
@@ -25,5 +25,7 @@ if (&User-Name == "bob") {
 }
 ----
 
+The last entry in an `if` section can also be an xref:unlang/actions.adoc[actions] subsection.
+
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.
index 449a03ad989858fcf2cbe11b7ed7a899a340bcae..af9669b1f25cb90a4e0a5631da7d0e2ce60f51a8 100644 (file)
@@ -55,6 +55,8 @@ if (notfound) {
 == Module Return Code priority overrides
 
 In the case of modules, rcodes can be modified on a per-call basis.
+These over-rides use the same syntax as the
+xref:unlang/actions.adoc[actions] subsection.
 
 Module priority overrides are specified in a block inline with the module call.
 The format of an override is `<rcode> = (0+|<rcode>|return)` - That is,
@@ -81,6 +83,9 @@ ldap { <1>
 <4> Sets the priority of `reject` to be `return`.  If the module returns
     `reject`, the current section will immediately exit.
 
+See the xref:unlang/actions.adoc[actions] page for more information on
+the syntax of the `actions` section.
+
 
 // Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // Development of this documentation was sponsored by Network RADIUS SAS.