| 1 |
= Keywords |
| 2 |
|
| 3 |
The following tables list the keywords used in `Unlang`. These keywords |
| 4 |
implement the "flow control" of the policies. |
| 5 |
|
| 6 |
== Flow Control Keywords |
| 7 |
|
| 8 |
The _flow control_ keywords allow _if / then / else_ checks, simple |
| 9 |
looping, etc. |
| 10 |
|
| 11 |
.Flow Control |
| 12 |
[options="header"] |
| 13 |
[cols="30%,70%"] |
| 14 |
|===== |
| 15 |
| Keyword | Description |
| 16 |
| xref:break.adoc[break] | Exit early from a `foreach` loop. |
| 17 |
| xref:case.adoc[case] | Match inside of a `switch`. |
| 18 |
| xref:else.adoc[else] | Do something when an `if` does not match. |
| 19 |
| xref:elsif.adoc[elsif] | Check for condition when a previous `if` does not match. |
| 20 |
| xref:foreach.adoc[foreach] | Loop over a list of attributes. |
| 21 |
| xref:if.adoc[if] | Check for a condition, and execute a sub-policy if it matches. |
| 22 |
| xref:return.adoc[return] | Immediately stop processing a section. |
| 23 |
| xref:switch.adoc[switch] | Check for multiple values. |
| 24 |
|===== |
| 25 |
|
| 26 |
== Attribute Editing Keywords |
| 27 |
|
| 28 |
The _attribute editing_ keywords allow policies to add, delete, and |
| 29 |
modify attributes in any list or packet. |
| 30 |
|
| 31 |
.Attribute Editing |
| 32 |
[options="header"] |
| 33 |
[cols="30%,70%"] |
| 34 |
|===== |
| 35 |
| Keyword | Description |
| 36 |
| xref:update.adoc[update] | Add or filter attributes to a list |
| 37 |
|===== |
| 38 |
|
| 39 |
== Grouping Keywords |
| 40 |
|
| 41 |
The _grouping_ keywords allow policies to be organized into groups, |
| 42 |
including load-balancing. |
| 43 |
|
| 44 |
.Grouping |
| 45 |
[options="header"] |
| 46 |
[cols="30%,70%"] |
| 47 |
|===== |
| 48 |
| Keyword | Description |
| 49 |
| xref:group.adoc[group] | Group a series of statements. |
| 50 |
| xref:load-balance.adoc[load-balance] | Define a load balancing group without fail-over. |
| 51 |
| xref:redundant.adoc[redundant] | Define a redundant group with fail-over. |
| 52 |
| xref:redundant-load-balance.adoc[redundant-load-balance] | Define a redundant group with fail-over and load balancing. |
| 53 |
|===== |
| 54 |
|
| 55 |
== Module Keywords |
| 56 |
|
| 57 |
The _module_ keywords refer pre-packaged libraries that implement |
| 58 |
specific functionality, such as connecting to SQL, LDAP, etc. The |
| 59 |
name used here is not the literal string `module`. Instead, it is the |
| 60 |
name of an instance of a pre-packaged module such as `sql`, or `ldap`, or |
| 61 |
`eap`. |
| 62 |
|
| 63 |
The documentation below describes how to reference modules. That is, |
| 64 |
how to use `sql`, etc. in the policies. Please see |
| 65 |
`raddb/mods-available/` for configuration examples for each module. |
| 66 |
|
| 67 |
.Modules |
| 68 |
[options="header"] |
| 69 |
[cols="30%,70%"] |
| 70 |
|===== |
| 71 |
| Keyword | Description |
| 72 |
| xref:module.adoc[<module>] | Execute a named module, e.g., `sql`. |
| 73 |
| xref:module_method.adoc[<module>.<method>] | Execute a particular method of a named module, e.g., `pap.authorize` |
| 74 |
| xref:module_builtin.adoc[reject] | Built-in modules, e.g., `reject`, or `ok`, etc. |
| 75 |
|===== |
| 76 |
|
| 77 |
// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. |
| 78 |
// Development of this documentation was sponsored by Network RADIUS SAS. |