}
fr_assert(state->key != NULL);
- fr_assert(vp->da->type == state->key->da->type);
-
if (fr_type_is_structural(vp->vp_type)) {
if (fr_pair_list_copy(state->key, &state->key->vp_group, &vp->vp_group) < 0) {
REDEBUG("Failed copying children of %s", gext->key->name);
--- /dev/null
+#
+# 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
+
+&my-tlv := {
+ &a = 1
+ &b = 2
+ &c = "foo"
+ &d = 127.0.0.1
+}
+
+
+&out = ""
+
+#
+# Home-brew concat!
+#
+foreach string child (&my-tlv.[*]) {
+ &out += &child
+ &out += " "
+}
+
+#
+# Sad trailing space, but we can delete it!
+#
+&out -= ' '
+
+if (&out != '1 2 foo 127.0.0.1') {
+ test_fail
+}
+
+success
type = Access-Request
}
+ dictionary {
+ tlv my-tlv {
+ uint32 a
+ uint32 b
+ string c
+ ipaddr d
+ }
+ }
+
recv Access-Request {
&control.Password.Cleartext := "hello"