]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
typos and fixes
authorAlan T. DeKok <aland@freeradius.org>
Sun, 2 Jun 2019 18:11:12 +0000 (14:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 2 Jun 2019 18:11:12 +0000 (14:11 -0400)
doc/unlang/cond_attr.adoc
doc/unlang/switch.adoc

index 64d64d4ee9cb629632769bd8ae2ee9f658f3b4f3..460ec5c64ff73f77047b170fcc41c028ecd72ed8 100644 (file)
@@ -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.
index c6dea5acb11ff1486b87b7c916f180e8624462db..01abbbac422ad5e40c490fc61522f7c6bcc84af0 100644 (file)
@@ -17,10 +17,11 @@ switch <expansion> {
 ----
 
 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