From: Alan T. DeKok Date: Sun, 2 Jun 2019 18:11:12 +0000 (-0400) Subject: typos and fixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a74b1ab1eaf34af5e2decc16029963f13fdffdd;p=thirdparty%2Ffreeradius-server.git typos and fixes --- diff --git a/doc/unlang/cond_attr.adoc b/doc/unlang/cond_attr.adoc index 64d64d4ee9c..460ec5c64ff 100644 --- a/doc/unlang/cond_attr.adoc +++ b/doc/unlang/cond_attr.adoc @@ -1,4 +1,4 @@ -= The &Attribute-Name Operator += The &Attribute-Name Reference .Syntax [source,unlang] @@ -6,28 +6,37 @@ &Attribute-Name ---- -The `&Attribute-Name` operator returns a reference to the named attribute. +The `&Attribute-Name` operator returns a reference to the named +attribute. -When used as an existence check, the condition evaluates to `true` if -the attribute exists. Otherwise, the condition evaluates to `false`. +When used as an existence check in a condition, the condition +evaluates to `true` if the attribute exists. Otherwise, the condition +evaluates to `false`. -Older versions of the server did not use the `&` character. Version 3 -does not require it, but a warning will be printed in debugging mode if the -`&` is omitted. +When used elsewhere, such as in link:switch.adoc[switch], it returns +the value of the named attribute. -The `&` character was added in version 3 in order to disambiguate the -grammar of `unlang`. Previously, older versions of the server could -interpret a string such as `hello-there` either as a literal string -"hello-there", or as a reference to an attribute named -`hello-there`. This ambiguity caused problems. +Older versions of the server did not use the `&` character to +distinguish attribute names from other strings. Version 4 requires +the user of the `&` before attribute names. + +Without the `&`, the server could interpret a string as `hello-there` +either as a literal string "hello-there", or as a reference to an +attribute named `hello-there`. This ambiguity made it difficult to +parse the configuration files correctly in all cases. Adding the leading `&` character means that attribute references are now easily distinguishable from literal strings. +The attribute reference can also be qualified with a +link:attr_list.adoc[list] reference. When no list is given, the +server looks in the input packet list for the named attribute. + *Examples:* `&User-Name` + -`&NAS-IP-Address` +`&NAS-IP-Address` + +`&reply:Reply-Message` // Copyright (C) 2019 Network RADIUS SAS. Licenced under CC-by-NC 4.0. // Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/unlang/switch.adoc b/doc/unlang/switch.adoc index c6dea5acb11..01abbbac422 100644 --- a/doc/unlang/switch.adoc +++ b/doc/unlang/switch.adoc @@ -17,10 +17,11 @@ switch { ---- A `switch` statement causes the server to evaluate _expansion_, which -can be an link:cond_attr.adoc[&Attribute-Name] or link:cond_data[data]. -The result is compared against _match-1_ and _match-2_ to find a -match. If no string matches, then the server looks for the default -link:case.adoc[case] statement, which has no associated match. +can be an link:cond_attr.adoc[&Attribute-Name] or +link:cond_data.adoc[data]. The result is compared against _match-1_ +and _match-2_ to find a match. If no string matches, then the server +looks for the default link:case.adoc[case] statement, which has no +associated match. The matching is done via equality. The `switch` statement is mostly syntactic sugar and is used to simplify the visual form of the