From: Alan T. DeKok Date: Fri, 9 May 2025 19:40:58 +0000 (-0400) Subject: docs: updated miscelleneous functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=520e1df48523e646f7fd1730d4d9dbd0176eaeaa;p=thirdparty%2Ffreeradius-server.git docs: updated miscelleneous functions --- diff --git a/doc/antora/modules/reference/nav.adoc b/doc/antora/modules/reference/nav.adoc index 91271e77b9e..228ecc51fbd 100644 --- a/doc/antora/modules/reference/nav.adoc +++ b/doc/antora/modules/reference/nav.adoc @@ -102,6 +102,7 @@ **** xref:xlat/misc/config.adoc[Server Configuration] **** xref:xlat/misc/length.adoc[length] **** xref:xlat/misc/misc.adoc[Miscellaneous] +**** xref:xlat/misc/pairs.print.adoc[pairs.print] **** xref:xlat/misc/rand.adoc[rand] *** xref:xlat/character.adoc[Single Letter Expansions] diff --git a/doc/antora/modules/reference/pages/xlat/misc/index.adoc b/doc/antora/modules/reference/pages/xlat/misc/index.adoc index 3502fc3fc97..c0cc5b849ed 100644 --- a/doc/antora/modules/reference/pages/xlat/misc/index.adoc +++ b/doc/antora/modules/reference/pages/xlat/misc/index.adoc @@ -11,6 +11,7 @@ which operate on inputs, and produce an output. | xref:xlat/misc/config.adoc[Server Configuration] | Examine configuration items | xref:xlat/misc/length.adoc[length] | Get the length of data | xref:xlat/misc/misc.adoc[Miscellaneous] | Functions to execute regular expression search on string, using pattern. +| xref:xlat/misc/pairs.adoc[pairs.print] | print attributes with name and value. | xref:xlat/misc/rand.adoc[rand] | random integers |=== diff --git a/doc/antora/modules/reference/pages/xlat/misc/pairs.adoc b/doc/antora/modules/reference/pages/xlat/misc/pairs.adoc new file mode 100644 index 00000000000..296c0c2ab14 --- /dev/null +++ b/doc/antora/modules/reference/pages/xlat/misc/pairs.adoc @@ -0,0 +1,27 @@ += %pairs.print(.[*]) + +Print attributes with name and value. + +.Return: _string_ + +Note that there is no "parse string into pairs" function. Instead, +you can simply assign the string to a structural attribute (`group`, +`tlv`, etc.) and the string will be parsed as assigning a value to a +given attribute. + +.Example + +[source,unlang] +---- +control.Tmp-String-0 := { "This is a string", "This is another one" } +reply.Reply-Message := "Serialize output: %pairs.print('control.[*]')" +---- + +.Output + +``` +Serialize output: Tmp-String-0 = "\"This is a string\", Tmp-String-0 = \"This is another one\"" +``` + +// Copyright (C) 2025 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// This documentation was developed by Network RADIUS SAS.