From: Alan T. DeKok Date: Fri, 24 Feb 2023 19:51:49 +0000 (-0500) Subject: don't use the "update" keyword in examples X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0c75be28af9f07e6aed5a4418519429388464b1;p=thirdparty%2Ffreeradius-server.git don't use the "update" keyword in examples --- diff --git a/doc/antora/modules/reference/pages/unlang/break.adoc b/doc/antora/modules/reference/pages/unlang/break.adoc index 41a9dab5a1b..331d5055a94 100644 --- a/doc/antora/modules/reference/pages/unlang/break.adoc +++ b/doc/antora/modules/reference/pages/unlang/break.adoc @@ -18,8 +18,8 @@ foreach &Class { break } - update reply { - Reply-Message += "Contains %{Foreach-Variable-0}" + &reply += { + Reply-Message = "Contains %{Foreach-Variable-0}" } } ---- diff --git a/doc/antora/modules/reference/pages/unlang/caller.adoc b/doc/antora/modules/reference/pages/unlang/caller.adoc index 092cdc9708f..09fd04f24a3 100644 --- a/doc/antora/modules/reference/pages/unlang/caller.adoc +++ b/doc/antora/modules/reference/pages/unlang/caller.adoc @@ -46,8 +46,8 @@ request to the current RADIUS reply packet, as the contents of the [source,unlang] ---- caller dhcpv4 { - update reply { - &Filter-Id := &parent.request:Client-Identifier + &reply += { + &Filter-Id = &parent.request:Client-Identifier } } ---- diff --git a/doc/antora/modules/reference/pages/unlang/condition/regex.adoc b/doc/antora/modules/reference/pages/unlang/condition/regex.adoc index 59d55b55b80..0e0809ef0ee 100644 --- a/doc/antora/modules/reference/pages/unlang/condition/regex.adoc +++ b/doc/antora/modules/reference/pages/unlang/condition/regex.adoc @@ -129,8 +129,8 @@ more information on regular expression matching. [source,unlang] ---- if (&User-Name =~ /^(.*)@example\.com$/) { - update reply { - Reply-Message := "Hello %{1}" + &reply += { + Reply-Message = "Hello %{1}" } } ---- diff --git a/doc/antora/modules/reference/pages/unlang/detach.adoc b/doc/antora/modules/reference/pages/unlang/detach.adoc index 602f7709022..86648b12ba7 100644 --- a/doc/antora/modules/reference/pages/unlang/detach.adoc +++ b/doc/antora/modules/reference/pages/unlang/detach.adoc @@ -19,12 +19,10 @@ access any attributes in the parent. [source,unlang] ---- subrequest Disconnect-Request { - update request { - &User-Name := &parent.request.User-Name - &NAS-IP-Address := &parent.request.NAS-IP-Address - &NAS-Port := &parent.request.NAS-Port - &Acct-Session-Id := &parent.request.Acct-Session-Id - } + &User-Name := &parent.request.User-Name + &NAS-IP-Address := &parent.request.NAS-IP-Address + &NAS-Port := &parent.request.NAS-Port + &Acct-Session-Id := &parent.request.Acct-Session-Id detach radius @@ -52,16 +50,12 @@ seconds. Only integer seconds can be set. [source,unlang] ---- subrequest Disconnect-Request { - update request { - &User-Name := &parent.request.User-Name - &NAS-IP-Address := &parent.request.NAS-IP-Address - &NAS-Port := &parent.request.NAS-Port - &Acct-Session-Id := &parent.request.Acct-Session-Id - } + &User-Name := &parent.request.User-Name + &NAS-IP-Address := &parent.request.NAS-IP-Address + &NAS-Port := &parent.request.NAS-Port + &Acct-Session-Id := &parent.request.Acct-Session-Id - update control { - Request-Lifetime := 60 - } + &control.Request-Lifetime := 60 detach radius diff --git a/doc/antora/modules/reference/pages/unlang/foreach.adoc b/doc/antora/modules/reference/pages/unlang/foreach.adoc index 3e8b8af3f37..35f1741bf76 100644 --- a/doc/antora/modules/reference/pages/unlang/foreach.adoc +++ b/doc/antora/modules/reference/pages/unlang/foreach.adoc @@ -30,8 +30,8 @@ The attributes being looped over cannot be modified or deleted. [source,unlang] ---- foreach &Class { - update reply { - Reply-Message += "Contains %{Foreach-Variable-0}" + &reply += { + Reply-Message = "Contains %{Foreach-Variable-0}" } } ---- @@ -40,8 +40,8 @@ foreach &Class { [source,unlang] ---- foreach &TLV[*].Child-1 { - update reply { - Reply-Message += "TLV contains %{Foreach-Variable-0}" + &reply += { + Reply-Message = "TLV contains %{Foreach-Variable-0}" } } ---- diff --git a/doc/antora/modules/reference/pages/unlang/module.adoc b/doc/antora/modules/reference/pages/unlang/module.adoc index ac2af93bbad..c72d3798d6a 100644 --- a/doc/antora/modules/reference/pages/unlang/module.adoc +++ b/doc/antora/modules/reference/pages/unlang/module.adoc @@ -45,8 +45,8 @@ perform different actions based on the behaviour of the modules. ---- sql if (notfound) { - update reply { - Reply-Message = "We don't know who you are" + &reply += { + &Reply-Message = "We don't know who you are" } reject } diff --git a/doc/antora/modules/reference/pages/unlang/module_builtin.adoc b/doc/antora/modules/reference/pages/unlang/module_builtin.adoc index 955a0afe0d0..e556d0f0bb6 100644 --- a/doc/antora/modules/reference/pages/unlang/module_builtin.adoc +++ b/doc/antora/modules/reference/pages/unlang/module_builtin.adoc @@ -31,8 +31,8 @@ Causes the request to be immediately rejected. [source,unlang] ---- if (!&User-Name) { - update reply { - Reply-Message := "We don't know who you are" + &reply += { + &Reply-Message = "We don't know who you are" } reject } diff --git a/doc/antora/modules/reference/pages/unlang/parallel.adoc b/doc/antora/modules/reference/pages/unlang/parallel.adoc index aa0b645301c..98f33c634e2 100644 --- a/doc/antora/modules/reference/pages/unlang/parallel.adoc +++ b/doc/antora/modules/reference/pages/unlang/parallel.adoc @@ -58,8 +58,8 @@ parallel { Each module or subsection runs as a new child request, i.e. a xref:unlang/subrequest.adoc[subrequest]. Each child request is an identical copy of the parent request. Policies in the child can update the -original parent by using `update parent.request`, or `update -parent.reply`. Please see the xref:unlang/list.adoc[list] syntax for a +original parent by referencing `&parent.request`, or +`&parent.reply`. Please see the xref:unlang/list.adoc[list] syntax for a more complete description of how to refer to parent requests. The child requests are required because each subsection is run @@ -84,8 +84,8 @@ parallel { radius1 if (fail) { linelog1 - update parent.reply { - &Reply-Message += "radius1 failed" + &parent.reply += { + &Reply-Message = "radius1 failed" } } } @@ -93,8 +93,8 @@ parallel { radius2 if (fail) { linelog2 - update parent.reply { - &Reply-Message += "radius2 failed" + &parent.reply += { + &Reply-Message = "radius2 failed" } } } @@ -115,7 +115,7 @@ xref:unlang/detach.adoc[detach] keyword. The `parallel empty { ... }` syntax creates empty child requests. These requests contain no attributes. Attributes in the child request -must be added manually via an xref:unlang/update.adoc[update] statement. +must be added manually via an xref:unlang/edit.adoc[edit] statement. The `empty` keyword is most useful when it is necessary to manually determine which attributes go into a child request. @@ -136,16 +136,16 @@ a different way from the parent `User-Name`, and it sees a ---- parallel empty { group { - update request { - &User-Name := "%{&parent.request.User-Name}@example.org" - &User-Password := "hello" + &request := { + &User-Name = "%{&parent.request.User-Name}@example.org" + &User-Password = "hello" } radius1 } group { - update request { - &User-Name := "%{&parent.request.User-Name}@example.com" - &User-Password := &parent.request.User-Password + &request := { + &User-Name = "%{&parent.request.User-Name}@example.com" + &User-Password = &parent.request.User-Password } radius2 } diff --git a/doc/antora/modules/reference/pages/unlang/subrequest.adoc b/doc/antora/modules/reference/pages/unlang/subrequest.adoc index 26d69308739..ad846d97a9f 100644 --- a/doc/antora/modules/reference/pages/unlang/subrequest.adoc +++ b/doc/antora/modules/reference/pages/unlang/subrequest.adoc @@ -55,12 +55,10 @@ and can create any kind of packet. [source,unlang] ---- subrequest Disconnect-Request { - update request { - &User-Name := &parent.request.User-Name - &NAS-IP-Address := &parent.request.NAS-IP-Address - &NAS-Port := &parent.request.NAS-Port - &Acct-Session-Id := &parent.request.Acct-Session-Id - } + &User-Name := &parent.request.User-Name + &NAS-IP-Address := &parent.request.NAS-IP-Address + &NAS-Port := &parent.request.NAS-Port + &Acct-Session-Id := &parent.request.Acct-Session-Id radius } @@ -78,10 +76,7 @@ parsed in the context of the new protocol. [source,unlang] ---- subrequest dhcpv4.Discover { - update request { - &Your-IP-Address := &parent.request.Framed-IP-Address - ... - } + &Your-IP-Address := &parent.request.Framed-IP-Address ... } @@ -108,12 +103,10 @@ request, the child can no longer access any attributes in the parent. [source,unlang] ---- subrequest Disconnect-Request { - update request { - &User-Name := &parent.request.User-Name - &NAS-IP-Address := &parent.request.NAS-IP-Address - &NAS-Port := &parent.request.NAS-Port - &Acct-Session-Id := &parent.request.Acct-Session-Id - } + &User-Name := &parent.request.User-Name + &NAS-IP-Address := &parent.request.NAS-IP-Address + &NAS-Port := &parent.request.NAS-Port + &Acct-Session-Id := &parent.request.Acct-Session-Id detach radius