Skip to content
Permalink
Browse files

Add some documentation for missing xlat's functions.

for the below modules:

rlm_dhcpv4
rlm_eap
rlm_json
rlm_ldap
rlm_yubikey
  • Loading branch information
jpereira authored and alandekok committed Aug 20, 2019
1 parent 65d9213 commit af18effb0673344d14563cc9cacc3898278c1955
Showing with 301 additions and 0 deletions.
  1. +66 −0 raddb/mods-available/dhcpv4
  2. +100 −0 raddb/mods-available/eap
  3. +56 −0 raddb/mods-available/json
  4. +54 −0 raddb/mods-available/ldap
  5. +25 −0 raddb/mods-available/yubikey
@@ -33,3 +33,69 @@
#
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
#
# ```
#
# ```
@@ -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
# ```
@@ -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.
# ```
#
@@ -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)"
# ```
#
@@ -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
# ```
#

0 comments on commit af18eff

Please sign in to comment.
You can’t perform that action at this time.