+
+int btr_exec(struct btr_node *btrn, const char *command, char **value_result)
+{
+ if (!btrn)
+ return -ERRNO_TO_PARA_ERROR(EINVAL);
+ if (!btrn->execute)
+ return -ERRNO_TO_PARA_ERROR(ENOTSUP);
+ return btrn->execute(btrn, command, value_result);
+}
+
+int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result)
+{
+ int ret;
+
+ for (; btrn; btrn = btrn->parent) {
+ struct btr_node *parent = btrn->parent;
+ PARA_CRIT_LOG("parent: %p\n", parent);
+ if (!parent)
+ return -ERRNO_TO_PARA_ERROR(ENOTSUP);
+ if (!parent->execute)
+ continue;
+ ret = parent->execute(parent, command, value_result);
+ if (ret == -ERRNO_TO_PARA_ERROR(ENOTSUP))
+ continue;
+ if (ret < 0)
+ return ret;
+ }
+ return -ERRNO_TO_PARA_ERROR(ENOTSUP);
+}
+
+void *btr_context(struct btr_node *btrn)
+{
+ return btrn->context;
+}