]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add some documentation for missing xlat's functions.
authorJorge Pereira <jpereira@freeradius.org>
Tue, 20 Aug 2019 23:43:46 +0000 (20:43 -0300)
committerAlan DeKok <aland@freeradius.org>
Thu, 22 Aug 2019 18:47:30 +0000 (14:47 -0400)
for the below modules:

rlm_dhcpv4
rlm_eap
rlm_json
rlm_ldap
rlm_yubikey

raddb/mods-available/dhcpv4
raddb/mods-available/eap
raddb/mods-available/json
raddb/mods-available/ldap
raddb/mods-available/yubikey

index 94fc4035916631a4c792a6f50079d1f828233d16..693635f51ac3af4f032b494bc25951f1f5cd5d04 100644 (file)
 #
 dhcpv4 {
 }
+
+#
+#  ## Expansions
+#
+#  The rlm_dhcpv4 provides the below xlat's functions to handle the DHCPV4 packets.
+#
+#  ### %{dhcpv4_decode:...}
+#
+#  Decode DHCP option declared in dictionary.rfc2131.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update request {
+#    &Tmp-Octets-0 := 0x520d0103abcdef0206010203040506
+#  }
+#  if ("%{dhcpv4_decode:%{Tmp-Octets-0}}" != 2) {
+#    update reply {
+#      &Reply-Message := "Problems to decode the DHPCv4 fields."
+#    }
+#    reject
+#  }
+#  update reply {
+#    &Reply-Message := "The value of DHCP-Relay-Circuit-Id=%{DHCP-Relay-Circuit-Id}, DHCP-Relay-Remote-Id=%{DHCP-Relay-Remote-Id}"
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#  "The value of DHCP-Relay-Circuit-Id=0xabcdef, DHCP-Relay-Remote-Id=0x010203040506"
+#  ```
+#
+#  ### %{dhcpv4_encode:...}
+#
+#  Encode DHCP option declared in dictionary.rfc2131.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update request {
+#    &DHCP-Relay-Circuit-Id := 0xabcdef
+#    &DHCP-Relay-Remote-Id := 0x010203040506
+#  }
+#  update request {
+#    &Tmp-Octets-0 := "%{dhcpv4_encode:&request:[*]}"
+#  }
+#  if (&Tmp-Octets-0 != 0x520d0103abcdef0206010203040506) {
+#    update reply {
+#      &Reply-Message := "Invalid DHCP packets"
+#    }
+#    reject
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#
+#  ```
index bcdd144cc2663450ed4783494144de585a9ec7b4..2e268d6b082956e5b2fbb814c97194039aa67cfb 100644 (file)
@@ -1389,3 +1389,103 @@ eap {
 
        }
 }
+
+#
+#  ## Expansions
+#
+#  The rlm_eap module provides the below functions to interact with the `3GPP` and `SIM` protocols.
+#
+#  ### %{3gpp_pseudonym_decrypt:...}
+#
+#  TODO
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  TODO
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
+#
+#  ### %{3gpp_pseudonym_encrypt:...}
+#
+#  TODO
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  TODO
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
+#
+#  ### %{3gpp_pseudonym_key_index:...}
+#
+#  TODO
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  TODO
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
+#
+#  ### %{sim_id_method:...}
+#
+#  TODO
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  TODO
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
+#
+#  ### %{sim_id_type:...}
+#
+#  TODO
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  TODO
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
index 32122816d4c779cc8ac21e47a59b6a12e1c7823e..773fc768fb746dfd9513ee0c95f3ddecf3794423 100644 (file)
@@ -80,3 +80,59 @@ json {
 #  }
 #  ----
 #
+
+#
+#  ## Expansions
+#
+#  The rlm_json provides the below xlat's functions to handle the JSON string.
+#
+#  ### %{jpathvalidate:...}
+#
+#  Determine if a jpath expression is valid.
+#
+#  NOTE: Validate parser for everything except unions and expressions.
+#
+#  .Return: _size_t_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update control {
+#      &Tmp-String-0 := '$.my.json.payload[1]'
+#  }
+#  update reply {
+#      &Reply-Message := "Validation of %{control:Tmp-String-0} is %{jpathvalidate:$.my.json.payload[1]}"
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#  Validation of $.my.json.payload[1] is 20:$.my.json.payload[1]
+#  ```
+#
+#  ### %{jsonquote:...}
+#
+#  Escapes string for use as a JSON string.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update control {
+#    &Tmp-String-0 := "caipirinha/gelada"
+#  }
+#  update reply {
+#    &Reply-Message := "The string %{control:Tmp-String-0} should be %{jsonquote:%{control:Tmp-String-0}} to be a valid JSON string."
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#  The string caipirinha/gelada should be caipirinha\\/gelada to be a valid JSON string.
+#  ```
+#
\ No newline at end of file
index 9e37ee012fa0b5a04136ae3711bf1fcf0c3e5909..edd3dc1b2579b31ec2024096b7ad59eee58dfc8b 100644 (file)
@@ -818,3 +818,57 @@ ldap {
                #
        }
 }
+
+#
+#  ## Expansions
+#
+#  The rlm_ldap provides the below xlat's functions.
+#
+#  ### %{ldap_escape:...}
+#
+#  Escape a string for use in an LDAP filter or DN.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update control {
+#      &Tmp-String-0 := "ldap:///ou=profiles,dc=example,dc=com??sub?(objectClass=radiusprofile)"
+#  }
+#  update reply {
+#      &Reply-Message := "The LDAP url is %{ldap_escape:%{control:Tmp-String-0}}"
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#  "The LDAP url is ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
+#  ```
+#
+#  ### %{ldap_unescape:...}
+#
+#  Unescape a string for use in an LDAP filter or DN.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  update control {
+#      &Tmp-String-0 := "ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
+#  }
+#  update reply {
+#      &Reply-Message := "The LDAP url is %{ldap_unescape:%{control:Tmp-String-0}}"
+#  }
+#  ----
+#
+#  .Output
+#
+#  ```
+#  "The LDAP url is ldap:///ou=profiles,dc=example,dc=com??sub?(objectClass=radiusprofile)"
+#  ```
+#
index 8f9451b0e0d532efe3cd37549a506ab2da95876d..80f0921344ea3591c7c1d26aa45ce7fa31c83bf3 100644 (file)
@@ -259,3 +259,28 @@ yubikey {
                }
        }
 }
+
+#
+#  ## Expansions
+#
+#  The rlm_yubikey provides the below xlat's functions.
+#
+#  ### %{modhextohex:...}
+#
+#  Convert Yubikey modhex to standard hex.
+#
+#  .Return: _string_
+#
+#  .Example
+#
+#  [source,unlang]
+#  ----
+#  "%{modhextohex:vvrbuctetdhc}" == "ffc1e0d3d260"
+#  ----
+#
+#  .Output
+#
+#  ```
+#  TODO
+#  ```
+#