Skip to content

Commit

Permalink
add TMP TLV and test
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 3, 2024
1 parent 342658b commit d4e526e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions share/dictionary/freeradius/dictionary.freeradius.internal
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ ATTRIBUTE Tmp-Time-Delta-7 1807 time_delta
ATTRIBUTE Tmp-Time-Delta-8 1808 time_delta
ATTRIBUTE Tmp-Time-Delta-9 1809 time_delta

ATTRIBUTE Tmp-TLV-0 1810 tlv
ATTRIBUTE a .1 uint32
ATTRIBUTE b .2 uint32
ATTRIBUTE c .3 string
ATTRIBUTE d .4 ipaddr

#
# 1810 - 1879 - unused
#
Expand Down
39 changes: 39 additions & 0 deletions src/tests/keywords/foreach-tlv.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# PRE: foreach
#
# Loop over children of a TLV.
#
# Note that the only data types compatible with all data types are "string" or "octets"
#
string out

&Tmp-TLV-0 := {
&a = 1
&b = 2
&c = "foo"
&d = 127.0.0.1
}

&request += {
&Tmp-TLV-0 = {
&a = 2112
&b = 6809
&c = "bar"
&d = 192.0.2.1
}
}


&out = ""

#
# Home-brew concat!
#
foreach child (&Tmp-TLV-0[*]) {
&out += &child.c
&out += " "
}

&out -= " "

"%{out}"

0 comments on commit d4e526e

Please sign in to comment.