From: nolade Date: Thu, 13 Mar 2025 14:50:34 +0000 (-0400) Subject: Remove & from the start of a line X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f1da56fd6a30ce29d762bbfe4d59e83cddbf5a2;p=thirdparty%2Ffreeradius-server.git Remove & from the start of a line erl -p -i -e 's/^&//' $(git grep -lE '^&|[^&]&[a-zA-Z]' doc/antora/modules | egrep -v 'raddb|developers|interpreter.adoc|assets') --- diff --git a/doc/antora/modules/howto/pages/installation/upgrade.adoc b/doc/antora/modules/howto/pages/installation/upgrade.adoc index 14ce9853613..8876fa64d88 100644 --- a/doc/antora/modules/howto/pages/installation/upgrade.adoc +++ b/doc/antora/modules/howto/pages/installation/upgrade.adoc @@ -606,13 +606,13 @@ operator does not work the same way as before. Instead of doing: ``` -&Reply-Message += "foo" +Reply-Message += "foo" ``` you should edit the `reply` list, using the `+=` operator: ``` -&reply += { +reply += { &Reply-Message = "foo" } ``` @@ -633,7 +633,7 @@ update reply { In v4, you can remove the `update`, and rewrite the SQL call to: ``` -&reply.Framed-IP-Address := %sql("SELECT ...") +reply.Framed-IP-Address := %sql("SELECT ...") ``` Using double quotes everywhere means that every bit of data gets @@ -824,7 +824,7 @@ The xref:reference:xlat/index.adoc[xlat] expansions just support math natively. For example: ``` -&Reply-Message := "1 + 2 = %{1 + 2}" +Reply-Message := "1 + 2 = %{1 + 2}" ``` will return the string `1 + 2 = 3`. The contents of the expansion can @@ -856,7 +856,7 @@ The caching of group membership into attributes in the `control` list is still available, so ``` -&control.LDAP-Group[*] == "foo" +control.LDAP-Group[*] == "foo" ``` can also be used to test membership after having called the `ldap` module, if `cacheable_name` or `cacheable_dn` are enabled. @@ -1144,7 +1144,7 @@ In v4, it is clearer, simpler, and faster to just use `unlang` syntax correctly. [source,unlang] ---- -&reply.Reply-Message := &User-Name +reply.Reply-Message := &User-Name ... diff --git a/doc/antora/modules/howto/pages/modules/mschap/index.adoc b/doc/antora/modules/howto/pages/modules/mschap/index.adoc index dbfb07390bf..cab033bed05 100644 --- a/doc/antora/modules/howto/pages/modules/mschap/index.adoc +++ b/doc/antora/modules/howto/pages/modules/mschap/index.adoc @@ -121,7 +121,7 @@ bit in the `SMB-Account-Ctrl` value - for example:: # U == user # e == expired -&control.SMB-Account-Ctrl-Text := '[Ue]' +control.SMB-Account-Ctrl-Text := '[Ue]' ``` This will cause the client to receive `error 648 - password expired`. diff --git a/doc/antora/modules/reference/pages/type/cast.adoc b/doc/antora/modules/reference/pages/type/cast.adoc index d8709586bd2..a64876bd5da 100644 --- a/doc/antora/modules/reference/pages/type/cast.adoc +++ b/doc/antora/modules/reference/pages/type/cast.adoc @@ -135,9 +135,9 @@ reply. .Example Copying Attributes [source,unlang] ---- -&control.Reply-Message := { "one", "two" } +control.Reply-Message := { "one", "two" } -&reply.Reply-Message := &control.Reply-Message[*] +reply.Reply-Message := &control.Reply-Message[*] ---- The following example will take an input string `"192.168.0.1"`, split @@ -147,7 +147,7 @@ attribute, which each carry one octet of the IP address. .Example Creating multiple Attributes ---- -&Tmp-Integer-0 := %explode("192.168.0.1", '.') +Tmp-Integer-0 := %explode("192.168.0.1", '.') ---- If you need to cast an entire list to a value, then the value being @@ -164,7 +164,7 @@ expansions] list. .Example Creating multiple Attributes ---- -&reply.Reply-Message := (string) (%explode("192.168.0.1", '.')) +reply.Reply-Message := (string) (%explode("192.168.0.1", '.')) ---- === Other Data Types diff --git a/doc/antora/modules/reference/pages/unlang/attr.adoc b/doc/antora/modules/reference/pages/unlang/attr.adoc index d22eaff4c4a..66a0526691e 100644 --- a/doc/antora/modules/reference/pages/unlang/attr.adoc +++ b/doc/antora/modules/reference/pages/unlang/attr.adoc @@ -3,7 +3,7 @@ .Syntax [source,unlang] ---- -&Attribute-Name +Attribute-Name ---- The `Attribute-Name` operator returns a reference to the named @@ -19,8 +19,8 @@ the value of the named attribute. .Examples [source,unlang] ---- -&User-Name -&NAS-IP-Address +User-Name +NAS-IP-Address ---- == Lists @@ -33,8 +33,8 @@ looks in the input packet list for the named attribute. [source,unlang] ---- -&request.User-Name -&reply.NAS-IP-Address +request.User-Name +reply.NAS-IP-Address ---- == Array References @@ -42,7 +42,7 @@ looks in the input packet list for the named attribute. .Syntax [source,unlang] ---- -&Attribute-Name[] +Attribute-Name[] ---- When an attribute appears multiple times in a list, this syntax allows @@ -59,8 +59,8 @@ protocols which have more than 1000 attributes. .Integer Array index [source,unlang] ---- -&EAP-Message[1] -&reply.NAS-IP-Address[2] +EAP-Message[1] +reply.NAS-IP-Address[2] ---- The `` can also be a special value `n`, which means "the last attribute in the list. @@ -68,7 +68,7 @@ The `` can also be a special value `n`, which means "the last attribute i .Last attribute in a list [source,unlang] ---- -&EAP-Message[n] +EAP-Message[n] ---- The `` can also be a reference to a numerical attribute. @@ -82,9 +82,9 @@ The main utility of attribute indexes is in a xref:unlang/foreach.adoc[foreach] ---- uint32 foo -&foo = 2 +foo = 2 -&EAP-Message[&foo] +EAP-Message[&foo] ---- The `` can also be an expression which is calculated at run time. The expression _must_ not cause the server to call an external database, script, etc. The main purpose of these expressions is to calculated an index without first placing it into another attribute. @@ -96,9 +96,9 @@ The expression _must_ be in an expansion block: `%{...}`. .Expression as an Array index [source,unlang] ---- -&index = 0 +index = 0 -&EAP-Message[%{&index + 1}] +EAP-Message[%{&index + 1}] ---- === Array References in lists @@ -110,7 +110,7 @@ attribute can be omitted, as follow: .Examples [source,unlang] ---- -&request.[0] +request.[0] ---- i.e. "the first child of the `request` list. @@ -124,7 +124,7 @@ Note that the old syntax of `request[...]` is disallowed. .Syntax [source,unlang] ---- -&Attribute-Name.Attribute-Name +Attribute-Name.Attribute-Name ---- In some cases, attributes are nested or grouped. The child reference @@ -136,9 +136,9 @@ the name of another child attribute, separated by the `.` character. [source,unlang] ---- -&TLV-One.Child-one -&TLV-One.Child-one.Child-Three -&reply.TLV[3].Child-Two +TLV-One.Child-one +TLV-One.Child-one.Child-Three +reply.TLV[3].Child-Two ---- == Putting it All Together @@ -148,8 +148,8 @@ All of the above syntaxes can be used interchangeably, at any nesting level. Th .Examples [source,unlang] ---- -&TLV-One.Child-one[3].Child-Three -&reply.TLV[3].Child-Two +TLV-One.Child-one[3].Child-Three +reply.TLV[3].Child-Two ---- == Compatibility with Older Versions of FreeRADIUS diff --git a/doc/antora/modules/reference/pages/unlang/edit.adoc b/doc/antora/modules/reference/pages/unlang/edit.adoc index 14defc9f8a5..04ae581f6d6 100644 --- a/doc/antora/modules/reference/pages/unlang/edit.adoc +++ b/doc/antora/modules/reference/pages/unlang/edit.adoc @@ -8,15 +8,15 @@ attributes. .Syntax [source,unlang] ---- -&attribute := -&attribute = -&attribute += -&attribute -= +attribute := +attribute = +attribute += +attribute -= ... -&list1 := &list2 -&list1 += { &attribute = value, ... } -&list1 += " attribute = value, ... " +list1 := &list2 +list1 += { &attribute = value, ... } +list1 += " attribute = value, ... " ... ---- @@ -97,7 +97,7 @@ retrieving data from a database. .Syntax [source,unlang] ---- -& + ---- List editing can be done for the usual xref:reference:unlang/list.adoc[lists] such as `request`, @@ -166,7 +166,7 @@ assigning the empty list to the destination. ==== [source,unlang] ---- -&reply := {} +reply := {} ---- ==== @@ -197,7 +197,7 @@ given. ==== [source,unlang] ---- -&reply += { +reply += { &Filter-Id = "foo" } ---- @@ -212,7 +212,7 @@ appended to the list. ==== [source,unlang] ---- -&reply += &request.User-Name +reply += &request.User-Name ---- ==== @@ -227,7 +227,7 @@ overriding the contents of a list. ==== [source,unlang] ---- -&reply := { +reply := { &Filter-Id = "foo" } ---- @@ -244,7 +244,7 @@ Attributes can be removed from a list using the `-=` (remove) operator. ==== [source,unlang] ---- -&reply -= &Filter-Id +reply -= &Filter-Id ---- ==== @@ -252,7 +252,7 @@ Attributes can be removed from a list using the `-=` (remove) operator. ==== [source,unlang] ---- -&reply -= &Filter-Id[*] +reply -= &Filter-Id[*] ---- ==== @@ -260,7 +260,7 @@ Attributes can be removed from a list using the `-=` (remove) operator. ==== [source,unlang] ---- -&reply -= { +reply -= { &Filter-Id == "bar" } ---- @@ -295,7 +295,7 @@ copies all of the `request` list contents to the `reply` list. ==== [source,unlang] ---- -&reply := &request +reply := &request ---- ==== @@ -303,7 +303,7 @@ copies all of the `request` list contents to the `reply` list. ==== [source,unlang] ---- -&reply += &request +reply += &request ---- ==== @@ -321,7 +321,7 @@ is, `reply += "request.foo ..."` is not allowed. ==== [source,unlang] ---- -&reply += "Filter-Id = 'foo'" +reply += "Filter-Id = 'foo'" ---- ==== @@ -332,7 +332,7 @@ The above example has the same result as the earlier example of adding ==== [source,unlang] ---- -&reply += "sql("SELECT pairs FROM pair_table WHERE username = '%{User-Name}'") +reply += "sql("SELECT pairs FROM pair_table WHERE username = '%{User-Name}'") ---- ==== @@ -345,7 +345,7 @@ strings, such as `Filter-Id = "foo"`. .Syntax [source,unlang] ---- -& + ---- Attribute editing can be done for any diff --git a/doc/antora/modules/reference/pages/unlang/expression.adoc b/doc/antora/modules/reference/pages/unlang/expression.adoc index 62e15039c17..a4f1a952d33 100644 --- a/doc/antora/modules/reference/pages/unlang/expression.adoc +++ b/doc/antora/modules/reference/pages/unlang/expression.adoc @@ -17,7 +17,7 @@ Expressions can be used inside of xref:xlat/index.adoc[dynamic expansions], or i .Expression in an assignment [source,unlang] ---- -&NAS-Port = 1 + 2 +NAS-Port = 1 + 2 ---- == Operators in an Expression @@ -62,7 +62,7 @@ supported. For example: [source,unlang] ---- -&NAS-Port = 5 + (&User-Name == "bob") +NAS-Port = 5 + (&User-Name == "bob") ---- This expression will return `6` if the users name is `bob`, and `5` otherwise. @@ -76,7 +76,7 @@ You can just put math in-place, as with the following example: [source,unlang] ---- -&Filter-Id = "Adding %{NAS-Port} + 4 = %{&NAS-Port + 4}" +Filter-Id = "Adding %{NAS-Port} + 4 = %{&NAS-Port + 4}" ---- The old ``%{expr:...}` syntax will return an error in v4. That functiuonality is no longer supported. @@ -93,7 +93,7 @@ data types. (And incidentally, `-` is the inverse of `+`!) [source,unlang] ---- -&Reply-Message := "foo" + "bar" +Reply-Message := "foo" + "bar" ---- Will result in `Reply-Message == "foobar"`. @@ -102,7 +102,7 @@ The suffix can then be "subtracted" off, with: [source,unlang] ---- -&Reply-Message -= "bar" +Reply-Message -= "bar" ---- Will result in `Reply-Message == "foo"` !. @@ -130,7 +130,7 @@ syntax. The old syntax of `` is not accepted. [source,unlang] ---- -&NAS-Port-Id = (uint32) "%sql("SELECT...") + 4 +NAS-Port-Id = (uint32) "%sql("SELECT...") + 4 ---- == Errors @@ -144,7 +144,7 @@ A `null` result can be removed via the `||` operator. For example: [source,unlang] ---- -&NAS-Port-Id = (5 - "foo") || 6 +NAS-Port-Id = (5 - "foo") || 6 ---- Will return `6`, as the left side expression of the `||` operator evaluates to `null`. diff --git a/doc/antora/modules/reference/pages/unlang/foreach.adoc b/doc/antora/modules/reference/pages/unlang/foreach.adoc index 4d11b268227..16b99a82515 100644 --- a/doc/antora/modules/reference/pages/unlang/foreach.adoc +++ b/doc/antora/modules/reference/pages/unlang/foreach.adoc @@ -67,7 +67,7 @@ the execution of the loop. .Example of modifying values [source,unlang] ---- -&Tmp-Integer-0 := { 1, 3, 5, 11 } +Tmp-Integer-0 := { 1, 3, 5, 11 } foreach self (&Tmp-Integer-0) { &self += 19 @@ -78,7 +78,7 @@ Once the loop has finished , the `Tmp-Integer-0` attribute will have the followi [source,unlang] ---- -&Tmp-Integer-0 := { 20, 22, 24, 30 } +Tmp-Integer-0 := { 20, 22, 24, 30 } ---- .Pseudocode for variable modification @@ -102,7 +102,7 @@ For attributes, the `` must be `string`. For dynamic expansions, it m [source,unlang] ---- string total -&Tmp-Integer-0 := { 1, 3, 5, 11 } +Tmp-Integer-0 := { 1, 3, 5, 11 } foreach string ref, uint32 self (Tmp-Integer-0) { total += ref diff --git a/doc/antora/modules/reference/pages/unlang/index.adoc b/doc/antora/modules/reference/pages/unlang/index.adoc index c2a4c45ca2a..1393217dbb3 100644 --- a/doc/antora/modules/reference/pages/unlang/index.adoc +++ b/doc/antora/modules/reference/pages/unlang/index.adoc @@ -84,8 +84,8 @@ policies to add attributes to requests, replies, or to other places. .Example [source,unlang] ---- -&reply.Session-Timeout := 3600 -&reply.Framed-IP-Address := 192.0.2.4 +reply.Session-Timeout := 3600 +reply.Framed-IP-Address := 192.0.2.4 ---- == Dynamic Expansions @@ -101,7 +101,7 @@ attributes, databases, and scripts. .Example [source,unlang] ---- -&reply.Framed-IP-Address := %sql("SELECT static_ip from table WHERE user = '%{User-Name}'") +reply.Framed-IP-Address := %sql("SELECT static_ip from table WHERE user = '%{User-Name}'") ---- == Data Types @@ -115,7 +115,7 @@ error. .Example [source,unlang] ---- -&reply += { +reply += { &Framed-IP-Address = 192.0.2.4 &Session-Timeout = 5 &Reply-Message = "hello" diff --git a/doc/antora/modules/reference/pages/unlang/load-balance.adoc b/doc/antora/modules/reference/pages/unlang/load-balance.adoc index 75b5db66e9a..971e227b798 100644 --- a/doc/antora/modules/reference/pages/unlang/load-balance.adoc +++ b/doc/antora/modules/reference/pages/unlang/load-balance.adoc @@ -72,7 +72,7 @@ in a xref:xlat/index.adoc[dynamic expansion]: .Example of Load-Balance SQL module [source,unlang] ---- -&Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") +Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") } ---- diff --git a/doc/antora/modules/reference/pages/unlang/redundant-load-balance.adoc b/doc/antora/modules/reference/pages/unlang/redundant-load-balance.adoc index 27a7a05f14c..3487b8d1d0b 100644 --- a/doc/antora/modules/reference/pages/unlang/redundant-load-balance.adoc +++ b/doc/antora/modules/reference/pages/unlang/redundant-load-balance.adoc @@ -79,7 +79,7 @@ in a xref:xlat/index.adoc[dynamic expansion]: .Example of Redundant-Load-Balance SQL module [source,unlang] ---- -&Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") +Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") } ---- diff --git a/doc/antora/modules/reference/pages/unlang/redundant.adoc b/doc/antora/modules/reference/pages/unlang/redundant.adoc index 4be5911117d..c38a48f5927 100644 --- a/doc/antora/modules/reference/pages/unlang/redundant.adoc +++ b/doc/antora/modules/reference/pages/unlang/redundant.adoc @@ -102,7 +102,7 @@ first run `%sql1(...)`, then if that fails, run `%sql2(...)`, etc. .Example of Redundant SQL module [source,unlang] ---- -&Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") +Reply-Message := %sql_all("SELECT message FROM table WHERE name='%{User-Name}'") ---- The one caveat here is that the arguments passed to the underlying diff --git a/doc/antora/modules/reference/pages/unlang/update.adoc b/doc/antora/modules/reference/pages/unlang/update.adoc index d53dc3e68be..c500daf3cf9 100644 --- a/doc/antora/modules/reference/pages/unlang/update.adoc +++ b/doc/antora/modules/reference/pages/unlang/update.adoc @@ -49,7 +49,7 @@ This example should be converted to the following syntax: [source,unlang] ---- -&request += { +request += { &User-Name = "foo" &Filter-Id = "bar" &NAS-IP-Address = 127.0.0.1 @@ -83,8 +83,8 @@ assign the attributes in place, with a list qualifier. [source,unlang] ---- -&request.User-Name := "foo" -&request.Filter-Id := "bar" +request.User-Name := "foo" +request.Filter-Id := "bar" ---- Note that the following conversion is _not_ correct, as it will @@ -94,7 +94,7 @@ assigned to it. [source,unlang] ---- -&request := { +request := { &User-Name = "foo" &Filter-Id = "bar" } @@ -117,8 +117,8 @@ assign the attributes in place, with a list qualifier. [source,unlang] ---- -&request.User-Name = "foo" -&request.Filter-Id = "bar" +request.User-Name = "foo" +request.Filter-Id = "bar" ---- === Removing Attributes from a list: !* @@ -136,7 +136,7 @@ The conversion is to use the `-=` operator: [source,unlang] ---- -&request -= &User-Name +request -= &User-Name ---- == More Complex Conversions diff --git a/doc/antora/modules/reference/pages/xlat/alternation.adoc b/doc/antora/modules/reference/pages/xlat/alternation.adoc index aeac47e58ad..e584793db3a 100644 --- a/doc/antora/modules/reference/pages/xlat/alternation.adoc +++ b/doc/antora/modules/reference/pages/xlat/alternation.adoc @@ -8,13 +8,13 @@ in an expression. .Old Style - no longer supported [source,unlang] ---- -&Reply-Message := "Hello %{%{User-Name}:-none}" +Reply-Message := "Hello %{%{User-Name}:-none}" ---- .New Alternation [source,unlang] ---- -&Reply-Message := "Hello %{&User-Name || 'none'}" +Reply-Message := "Hello %{&User-Name || 'none'}" ---- This approach also means that nested alternation is no longer necessary: @@ -22,13 +22,13 @@ This approach also means that nested alternation is no longer necessary: .Old Style - no longer supported [source,unlang] ---- -&Reply-Message := "Hello %{%{NAS-Identifer}:-%{%{User-Name}:-none}}" +Reply-Message := "Hello %{%{NAS-Identifer}:-%{%{User-Name}:-none}}" ---- .New Alternation [source,unlang] ---- -&Reply-Message := "Hello %{&NAS-Identifier || &User-Name || 'none'}" +Reply-Message := "Hello %{&NAS-Identifier || &User-Name || 'none'}" ---- [NOTE] diff --git a/doc/antora/modules/reference/pages/xlat/builtin.adoc b/doc/antora/modules/reference/pages/xlat/builtin.adoc index 3567aa03e03..57cefa86446 100644 --- a/doc/antora/modules/reference/pages/xlat/builtin.adoc +++ b/doc/antora/modules/reference/pages/xlat/builtin.adoc @@ -21,10 +21,10 @@ the attributes data as encoded "on the wire". ==== [source,unlang] ---- -&Tmp-String-0 := "Caipirinha" -&Framed-IP-Address := 192.0.2.1 +Tmp-String-0 := "Caipirinha" +Framed-IP-Address := 192.0.2.1 -&reply += { +reply += { &Reply-Message = "The length of %{control.Tmp-String-0} is %length(&control.Tmp-String-0)" &Reply-Message = "The length of %{control.Framed-IP-Address} is %length(&control.Framed-IP-Address)" } @@ -47,7 +47,7 @@ Generate random number from `0` to `-1`. ==== [source,unlang] ---- -&reply.Reply-Message := "The random number is %rand(512}" +reply.Reply-Message := "The random number is %rand(512}" ---- .Output @@ -136,7 +136,7 @@ if (&User-Name == "bob") { &request.Tmp-String-0 := "not bob!" } -&reply.Reply-Message := "%eval(&request.Tmp-String-0}" +reply.Reply-Message := "%eval(&request.Tmp-String-0}" ---- .Output when `User-Name == bob` @@ -163,7 +163,7 @@ With the current time at 16:18, `%nexttime(1h)` will expand to `2520`. [source,unlang] ---- -&reply.Reply-Message := "You should wait for %nexttime(1h)s" +reply.Reply-Message := "You should wait for %nexttime(1h)s" ---- .Output @@ -182,8 +182,8 @@ Substitute text just as easily as it can match it, even using regex patterns. [source,unlang] ---- -&control.Tmp-String-0 := "Caipirinha is a light and refreshing drink!" -&reply.Reply-Message := "%sub(%{control.Tmp-String-0}, / /, ',')" +control.Tmp-String-0 := "Caipirinha is a light and refreshing drink!" +reply.Reply-Message := "%sub(%{control.Tmp-String-0}, / /, ',')" ---- .Output @@ -212,7 +212,7 @@ If no argument is passed, it returns the current time. Otherwise if the argumen [source,unlang] ---- -&Acct-Start-Time := %time(now) +Acct-Start-Time := %time(now) ---- The current time can also be compared to a known date: diff --git a/doc/antora/modules/reference/pages/xlat/concat.adoc b/doc/antora/modules/reference/pages/xlat/concat.adoc index 40a87bc1b37..520016e2d62 100644 --- a/doc/antora/modules/reference/pages/xlat/concat.adoc +++ b/doc/antora/modules/reference/pages/xlat/concat.adoc @@ -13,13 +13,13 @@ expanded string. If you need to concatenate strings together in a policy, just [source,unlang] ---- -&control += { +control += { &Tmp-String-0 = "aaa" &Tmp-String-0 = "bb" &Tmp-String-0 = "c" } -&reply += { +reply += { &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ', ')" &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ',')" } @@ -37,9 +37,9 @@ aaa,bb,c ---- string foo -&foo += { "a", "c", "c", "d" } # abcd +foo += { "a", "c", "c", "d" } # abcd -&foo += &control.Tmp-String-0[*] +foo += &control.Tmp-String-0[*] ---- // Copyright (C) 2023 Network RADIUS SAS. Licenced under CC-by-NC 4.0. diff --git a/doc/antora/modules/reference/pages/xlat/conversion.adoc b/doc/antora/modules/reference/pages/xlat/conversion.adoc index c83746039f7..701a3e1918d 100644 --- a/doc/antora/modules/reference/pages/xlat/conversion.adoc +++ b/doc/antora/modules/reference/pages/xlat/conversion.adoc @@ -12,8 +12,8 @@ Encode a string using Base64. [source,unlang] ---- -&control.Tmp-String-0 := "Caipirinha" -&reply.Reply-Message := "The base64 of %{control.Tmp-String-0} is %base64.encode(%{control.Tmp-String-0})" +control.Tmp-String-0 := "Caipirinha" +reply.Reply-Message := "The base64 of %{control.Tmp-String-0} is %base64.encode(%{control.Tmp-String-0})" ---- .Output @@ -32,8 +32,8 @@ Decode a string previously encoded using Base64. [source,unlang] ---- -&control.Tmp-String-0 := "Q2FpcGlyaW5oYQ==" -&reply.Reply-Message := "The base64.decode of %{control.Tmp-String-0} is %base64.decode(%{control.Tmp-String-0})" +control.Tmp-String-0 := "Q2FpcGlyaW5oYQ==" +reply.Reply-Message := "The base64.decode of %{control.Tmp-String-0} is %base64.decode(%{control.Tmp-String-0})" ---- .Output @@ -52,8 +52,8 @@ Convert string to binary. [source,unlang] ---- -&control.Tmp-String-0 := "10" -&reply.Reply-Message := "The %{control.Tmp-String-0} in binary is %bin(%{control.Tmp-String-0})" +control.Tmp-String-0 := "10" +reply.Reply-Message := "The %{control.Tmp-String-0} in binary is %bin(%{control.Tmp-String-0})" ---- .Output @@ -72,8 +72,8 @@ Convert to hex. [source,unlang] ---- -&control.Tmp-String-0 := "12345" -&reply.Reply-Message := "The value of %{control.Tmp-String-0} in hex is %hex(%{control.Tmp-String-0})" +control.Tmp-String-0 := "12345" +reply.Reply-Message := "The value of %{control.Tmp-String-0} in hex is %hex(%{control.Tmp-String-0})" ---- .Output @@ -92,8 +92,8 @@ Quote URL special characters. [source,unlang] ---- -&control.Tmp-String-0 := "http://example.org/" -&reply += { +control.Tmp-String-0 := "http://example.org/" +reply += { &Reply-Message = "The urlquote of %{control.Tmp-String-0} is %urlquote(%{control.Tmp-String-0})" } ---- @@ -114,8 +114,8 @@ Unquote URL special characters. [source,unlang] ---- -&control.Tmp-String-0 := "http%%3A%%2F%%2Fexample.org%%2F" # Attention for the double %. -&reply += { +control.Tmp-String-0 := "http%%3A%%2F%%2Fexample.org%%2F" # Attention for the double %. +reply += { &Reply-Message = "The urlunquote of %{control.Tmp-String-0} is %urlunquote(%{control.Tmp-String-0})" } ---- diff --git a/doc/antora/modules/reference/pages/xlat/deprecated.adoc b/doc/antora/modules/reference/pages/xlat/deprecated.adoc index 4e66891ee99..b09f469759f 100644 --- a/doc/antora/modules/reference/pages/xlat/deprecated.adoc +++ b/doc/antora/modules/reference/pages/xlat/deprecated.adoc @@ -10,7 +10,7 @@ This expansion has been removed. Instead, just use `%{ ... }`. [source,unlang] ---- -&reply.Reply-Message := "The 1 + 2 = %{1 + 2}" +reply.Reply-Message := "The 1 + 2 = %{1 + 2}" ---- == %integer(...) @@ -19,7 +19,7 @@ This expansion has been removed. Instead, just use `%{(integer) ...}` with math [source,unlang] ---- -&reply.Reply-Message := "Value of Service-Type is %{(integer) &Service-Type}" +reply.Reply-Message := "Value of Service-Type is %{(integer) &Service-Type}" ---- === +%pack(%{Attribute-Name}%{Attribute-Name}...)+ @@ -37,7 +37,7 @@ See also the `unpack` module, which is the inverse to `pack`. [source,unlang] ---- -&reply.Class := "%pack(%{reply.Framed-IP-Address}%{NAS-IP-Address}}" +reply.Class := "%pack(%{reply.Framed-IP-Address}%{NAS-IP-Address}}" ---- It is easier to just use casting and string append: @@ -46,7 +46,7 @@ It is easier to just use casting and string append: [source,unlang] ---- -&reply.Class := (octets) &Framed-IP-Address + (octets) &NAS-IP-Address. +reply.Class := (octets) &Framed-IP-Address + (octets) &NAS-IP-Address. ---- == %string(...) @@ -55,7 +55,7 @@ This expansion has been removed. Instead, just use `%{(string) ...}` with an ex [source,unlang] ---- -&reply.Reply-Message := "The printable version of Class is %{(string) &Class}" +reply.Reply-Message := "The printable version of Class is %{(string) &Class}" ---- == %strlen( ... ) diff --git a/doc/antora/modules/reference/pages/xlat/dict.adoc b/doc/antora/modules/reference/pages/xlat/dict.adoc index 43d487bd227..fde19d7052c 100644 --- a/doc/antora/modules/reference/pages/xlat/dict.adoc +++ b/doc/antora/modules/reference/pages/xlat/dict.adoc @@ -18,13 +18,13 @@ expanded string. If you need to concatenate strings together in a policy, just [source,unlang] ---- -&control += { +control += { &Tmp-String-0 = "aaa" &Tmp-String-0 = "bb" &Tmp-String-0 = "c" } -&reply += { +reply += { &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ', ')" &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ',')" } @@ -42,9 +42,9 @@ aaa,bb,c ---- string foo -&foo += { "a", "c", "c", "d" } # abcd +foo += { "a", "c", "c", "d" } # abcd -&foo += &control.Tmp-String-0[*] +foo += &control.Tmp-String-0[*] ---- == %explode(<&ref>, ) @@ -59,11 +59,11 @@ This expansion is the opposite of `%concat( ... )`. [source,unlang] ---- -&control.Tmp-String-0 := "bob.toba@domain.com" +control.Tmp-String-0 := "bob.toba@domain.com" -&control.Tmp-String-1 := "%explode(&control.Tmp-String-0, '@')" +control.Tmp-String-1 := "%explode(&control.Tmp-String-0, '@')" -&reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" +reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" ---- .Output @@ -82,9 +82,9 @@ Left-pad a string. [source,unlang] ---- -&control.Tmp-String-0 := "123" +control.Tmp-String-0 := "123" -&reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')" +reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')" ---- .Output @@ -103,9 +103,9 @@ Right-pad a string. [source,unlang] ---- -&control.Tmp-String-0 := "123" +control.Tmp-String-0 := "123" -&reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')" +reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')" ---- .Output @@ -124,8 +124,8 @@ Serialize attributes as comma-delimited string. [source,unlang] ---- -&control.Tmp-String-0 := { "This is a string", "This is another one" } -&reply.Reply-Message := "Serialize output: %pairs(&control.[*])" +control.Tmp-String-0 := { "This is a string", "This is another one" } +reply.Reply-Message := "Serialize output: %pairs(&control.[*])" ---- .Output @@ -144,7 +144,7 @@ Get random string built from character classes. [source,unlang] ---- -&reply.Reply-Message := "The random string output is %randstr(aaaaaaaa}" +reply.Reply-Message := "The random string output is %randstr(aaaaaaaa}" ---- .Output @@ -164,8 +164,8 @@ it. This definition is only available in version 2.1.10 and later. [source,unlang] ---- -&control.Tmp-String-0 := "CAIPIRINHA" -&reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})" +control.Tmp-String-0 := "CAIPIRINHA" +reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})" ---- .Output @@ -185,8 +185,8 @@ it. This definition is only available in version 2.1.10 and later. [source,unlang] ---- -&control.Tmp-String-0 := "caipirinha" -&reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0}) +control.Tmp-String-0 := "caipirinha" +reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0}) ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/explode.adoc b/doc/antora/modules/reference/pages/xlat/explode.adoc index b80ffd550f4..8e48c55c35a 100644 --- a/doc/antora/modules/reference/pages/xlat/explode.adoc +++ b/doc/antora/modules/reference/pages/xlat/explode.adoc @@ -10,11 +10,11 @@ This expansion is the inverse of xref:xlat/concat.adoc[concat]. [source,unlang] ---- -&control.Tmp-String-0 := "bob.toba@domain.com" +control.Tmp-String-0 := "bob.toba@domain.com" -&control.Tmp-String-1 := "%explode(&control.Tmp-String-0, '@')" +control.Tmp-String-1 := "%explode(&control.Tmp-String-0, '@')" -&reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" +reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/file.adoc b/doc/antora/modules/reference/pages/xlat/file.adoc index b28ee151627..0bf791fb8ed 100644 --- a/doc/antora/modules/reference/pages/xlat/file.adoc +++ b/doc/antora/modules/reference/pages/xlat/file.adoc @@ -20,7 +20,7 @@ The returned filename is guaranteed to be safe to use. Any portion of the filen ==== [source,unlang] ---- -&filename = "${logdir}/" + %file.escape(%{User-Name}) +filename = "${logdir}/" + %file.escape(%{User-Name}) %exec("/bin/rm", %{filename}) ---- @@ -55,7 +55,7 @@ This function returns the first line of the file. If the file does not exist, o ---- string line -&line := %file.head("/var/log/radius.log") +line := %file.head("/var/log/radius.log") ---- ==== @@ -105,9 +105,9 @@ The function takes an optional second argument, which is the number of lines whi ---- string line -&line := %file.tail("/var/log/radius.log") +line := %file.tail("/var/log/radius.log") -&line := %file.tail("/var/log/radius.log", 2) +line := %file.tail("/var/log/radius.log", 2) ---- ==== diff --git a/doc/antora/modules/reference/pages/xlat/function.adoc b/doc/antora/modules/reference/pages/xlat/function.adoc index 74e9dd068d0..e46236a632a 100644 --- a/doc/antora/modules/reference/pages/xlat/function.adoc +++ b/doc/antora/modules/reference/pages/xlat/function.adoc @@ -35,7 +35,7 @@ if (&User-Name == %md5(&NAS-Identifier)) { .Examples [source,unlang] ---- -&reply.Reply-Message := %sql(SELECT name FROM mytable WHERE username = %{User-Name}) +reply.Reply-Message := %sql(SELECT name FROM mytable WHERE username = %{User-Name}) ---- // Copyright (C) 2023 Network RADIUS SAS. Licenced under CC-by-NC 4.0. diff --git a/doc/antora/modules/reference/pages/xlat/hash.adoc b/doc/antora/modules/reference/pages/xlat/hash.adoc index dcc935e12bc..59b442d8ecf 100644 --- a/doc/antora/modules/reference/pages/xlat/hash.adoc +++ b/doc/antora/modules/reference/pages/xlat/hash.adoc @@ -16,11 +16,11 @@ Generate `HMAC-MD5` of string. [source,unlang] ---- -&control.Tmp-String-0 := "mykey" -&control.Tmp-String-1 := "Caipirinha" -&reply.control.Tmp-Octets-0 := "%hmacmd5(%{control.Tmp-String-0} %{control.Tmp-String-1})" +control.Tmp-String-0 := "mykey" +control.Tmp-String-1 := "Caipirinha" +reply.control.Tmp-Octets-0 := "%hmacmd5(%{control.Tmp-String-0} %{control.Tmp-String-1})" -&reply += { +reply += { &Reply-Message = "The HMAC-MD5 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}" &Reply-Message = "The HMAC-MD5 of %{control.Tmp-String-1} in hex is %hex(control.Tmp-Octets-0)" } @@ -43,11 +43,11 @@ Generate `HMAC-SHA1` of string. [source,unlang] ---- -&control.Tmp-String-0 := "mykey" -&control.Tmp-String-1 := "Caipirinha" -&control.Tmp-Octets-0 := "%hmacsha1(%{control.Tmp-String-0}, %{control.Tmp-String-1})" +control.Tmp-String-0 := "mykey" +control.Tmp-String-1 := "Caipirinha" +control.Tmp-Octets-0 := "%hmacsha1(%{control.Tmp-String-0}, %{control.Tmp-String-1})" -&reply += { +reply += { &Reply-Message = "The HMAC-SHA1 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}" &Reply-Message = "The HMAC-SHA1 of %{control.Tmp-String-1} in hex is %hex(control.Tmp-Octets-0}" } @@ -71,8 +71,8 @@ result is binary data. [source,unlang] ---- -&control.Tmp-String-0 := "Caipirinha" -&reply += { +control.Tmp-String-0 := "Caipirinha" +reply += { &Reply-Message = "md5 of %{control.Tmp-String-0} is octal=%md5(%{control.Tmp-String-0})" &Reply-Message = "md5 of %{control.Tmp-String-0} is hex=%hex(%md5(%{control.Tmp-String-0}))" } @@ -119,8 +119,8 @@ families of digest functions. [source,unlang] ---- -&control.Tmp-String-0 := "Caipirinha" -&reply += { +control.Tmp-String-0 := "Caipirinha" +reply += { &Reply-Message = "The md5 of %{control.Tmp-String-0} in octal is %md5(%{control.Tmp-String-0}}" &Reply-Message = "The md5 of %{control.Tmp-String-0} in hex is %hex(%md5(%{control.Tmp-String-0}}}" } diff --git a/doc/antora/modules/reference/pages/xlat/index.adoc b/doc/antora/modules/reference/pages/xlat/index.adoc index 6b209ebf326..90bb1b9ad06 100644 --- a/doc/antora/modules/reference/pages/xlat/index.adoc +++ b/doc/antora/modules/reference/pages/xlat/index.adoc @@ -48,7 +48,7 @@ information. [source,unlang] ---- -&Reply-Message := "%{User-Name} with a literal %%" +Reply-Message := "%{User-Name} with a literal %%" ---- // Copyright (C) 2021 Network RADIUS SAS. Licenced under CC-by-NC 4.0. diff --git a/doc/antora/modules/reference/pages/xlat/lpad.adoc b/doc/antora/modules/reference/pages/xlat/lpad.adoc index e793fa6aa3d..e4d194603ba 100644 --- a/doc/antora/modules/reference/pages/xlat/lpad.adoc +++ b/doc/antora/modules/reference/pages/xlat/lpad.adoc @@ -8,9 +8,9 @@ Left-pad a string. [source,unlang] ---- -&control.Tmp-String-0 := "123" +control.Tmp-String-0 := "123" -&reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')" +reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/pairs.adoc b/doc/antora/modules/reference/pages/xlat/pairs.adoc index 72c7df63783..87bebe5e095 100644 --- a/doc/antora/modules/reference/pages/xlat/pairs.adoc +++ b/doc/antora/modules/reference/pages/xlat/pairs.adoc @@ -10,8 +10,8 @@ Note that there is no "convert string to pairs" function. Instead, you can simp [source,unlang] ---- -&control.Tmp-String-0 := { "This is a string", "This is another one" } -&reply.Reply-Message := "Serialize output: %pairs(&control.[*])" +control.Tmp-String-0 := { "This is a string", "This is another one" } +reply.Reply-Message := "Serialize output: %pairs(&control.[*])" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/protocol.adoc b/doc/antora/modules/reference/pages/xlat/protocol.adoc index 1ff671b2494..dfbf48b6e67 100644 --- a/doc/antora/modules/reference/pages/xlat/protocol.adoc +++ b/doc/antora/modules/reference/pages/xlat/protocol.adoc @@ -50,8 +50,8 @@ It returns the number of attributes which were decoded. .Output ``` -&Relay-Agent-Information.Circuit-Id = 0xabcdef, &Relay-Agent-Information.Remote-Id = 0x010203040506 -&User-Name = "ABCD" +Relay-Agent-Information.Circuit-Id = 0xabcdef, &Relay-Agent-Information.Remote-Id = 0x010203040506 +User-Name = "ABCD" ``` == %PROTO.encode(_list_) @@ -71,7 +71,7 @@ It returns the raw encoded data ---- %dhcpv4.encode("&Relay-Agent-Information.Circuit-Id = 0xabcdef, &Relay-Agent-Information.Remote-Id = 0x010203040506") %radius.encode("&User-Name = 'ABCD'") -&Tmp-Octets-1 := %dhcpv4.encode(&request.Relay-Agent-Information.[*]) +Tmp-Octets-1 := %dhcpv4.encode(&request.Relay-Agent-Information.[*]) ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/randstr.adoc b/doc/antora/modules/reference/pages/xlat/randstr.adoc index b65f2e5aa57..f3c784b1f1d 100644 --- a/doc/antora/modules/reference/pages/xlat/randstr.adoc +++ b/doc/antora/modules/reference/pages/xlat/randstr.adoc @@ -32,7 +32,7 @@ There is no `h` for "hex". Instead, use `b` to create binary data, followed by [source,unlang] ---- -&reply.Reply-Message := "The random string output is %randstr(8a)" +reply.Reply-Message := "The random string output is %randstr(8a)" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/rpad.adoc b/doc/antora/modules/reference/pages/xlat/rpad.adoc index 2c11bb9261c..8e20957100e 100644 --- a/doc/antora/modules/reference/pages/xlat/rpad.adoc +++ b/doc/antora/modules/reference/pages/xlat/rpad.adoc @@ -8,9 +8,9 @@ Right-pad a string. [source,unlang] ---- -&control.Tmp-String-0 := "123" +control.Tmp-String-0 := "123" -&reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')" +reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/tolower.adoc b/doc/antora/modules/reference/pages/xlat/tolower.adoc index 1fac6f0d7fd..0991fc066f9 100644 --- a/doc/antora/modules/reference/pages/xlat/tolower.adoc +++ b/doc/antora/modules/reference/pages/xlat/tolower.adoc @@ -11,8 +11,8 @@ The lowercase operation is done using the current locale. [source,unlang] ---- -&control.Tmp-String-0 := "CAIPIRINHA" -&reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})" +control.Tmp-String-0 := "CAIPIRINHA" +reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})" ---- .Output diff --git a/doc/antora/modules/reference/pages/xlat/toupper.adoc b/doc/antora/modules/reference/pages/xlat/toupper.adoc index 50167a0e4e6..7a88d073f48 100644 --- a/doc/antora/modules/reference/pages/xlat/toupper.adoc +++ b/doc/antora/modules/reference/pages/xlat/toupper.adoc @@ -11,8 +11,8 @@ The uppercasecase operation is done using the current locale. [source,unlang] ---- -&control.Tmp-String-0 := "caipirinha" -&reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0}) +control.Tmp-String-0 := "caipirinha" +reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0}) ---- .Output