]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update documentation for %(unpack: )
authorNick Porter <nick@portercomputing.co.uk>
Wed, 19 May 2021 16:02:00 +0000 (17:02 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 26 May 2021 16:30:12 +0000 (12:30 -0400)
doc/antora/modules/raddb/pages/mods-available/unpack.adoc
raddb/mods-available/unpack
src/modules/rlm_unpack/rlm_unpack.c

index d8ab5f1f6fa5a8be112008b24e0b4b2e048bff0e..5527d2a1d7be897bc98e2c77e363fbc15efb7837 100644 (file)
@@ -19,15 +19,15 @@ NOTE: The module is useful only for `xlat`.
 To use it, add it to the `raddb/mods-enabled/` directory.  Then,
 use it on the right-hand side of a variable assignment.
 
- %{unpack:<data> <offset> <data_type>}
+ %(unpack:<data> <offset> <data_type>)
 
 The arguments are three fields:
 
 data::
 
-Either `&Attribute-Name` the name of the attribute to unpack.
-MUST be a `string` or `octets` type.
-or 0xabcdef e.g. hex data.
+Either `octets` or `string` type data, litteral or expanded attributes.
+If `string` type data contains a representaion of hex data, e.g. 0xabcdef
+that is first converted to `octets`.
 
 offset::
 
@@ -44,7 +44,7 @@ the data type to unpack at that offset. e.g. `integer`, `ipaddr`, `byte`, `short
 
 if we have `Class = 0x00000001020304`, then
 
-  %{unpack:&Class 4 uint16}
+  %(unpack:%{Class} 4 uint16)
 
 will unpack octets `4` and `5` as a `uint16`, which has value `0x0304`.
 
index ff5e37b88bdd9191e956eeb06667126a045924e4..30944e428d2a6d381a6748303276ff4f8bd5a1c2 100644 (file)
 #  To use it, add it to the `raddb/mods-enabled/` directory.  Then,
 #  use it on the right-hand side of a variable assignment.
 #
-#   %{unpack:<data> <offset> <data_type>}
+#   %(unpack:<data> <offset> <data_type>)
 #
 #  The arguments are three fields:
 #
 #  data::
 #
-#  Either `&Attribute-Name` the name of the attribute to unpack.
-#  MUST be a `string` or `octets` type.
-#  or 0xabcdef e.g. hex data.
+#  Either `octets` or `string` type data, litteral or expanded attributes.
+#  If `string` type data contains a representaion of hex data, e.g. 0xabcdef
+#  that is first converted to `octets`.
 #
 #  offset::
 #
@@ -47,7 +47,7 @@
 #
 #  if we have `Class = 0x00000001020304`, then
 #
-#    %{unpack:&Class 4 uint16}
+#    %(unpack:%{Class} 4 uint16)
 #
 #  will unpack octets `4` and `5` as a `uint16`, which has value `0x0304`.
 #
index 3921881be0200a1aaca4e320d84b2225efc65ee7..7b24f379f77698983d88d2fc6fedd252cd4e8762 100644 (file)
@@ -58,7 +58,7 @@ static xlat_arg_parser_t const unpack_xlat_args[] = {
  *
  * Example:
 @verbatim
-%{unpack:&Class 0 integer}
+%(unpack:%{Class} 0 integer)
 @endverbatim
  * Expands Class, treating octet at offset 0 (bytes 0-3) as an "integer".
  *