+ rc = 0;
+
+out:
+ return rc;
+}
+
+int pb_protocol_deserialise_boot_option(struct boot_option *opt,
+ const struct pb_protocol_message *message)
+{
+ unsigned int len;
+ const char *pos;
+ int rc = -1;
+
+ len = message->payload_len;
+ pos = message->payload;
+
+ if (read_string(opt, &pos, &len, &opt->device_id))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->id))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->name))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->description))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->icon_file))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->boot_image_file))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->initrd_file))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->dtb_file))
+ goto out;
+
+ if (read_string(opt, &pos, &len, &opt->boot_args))
+ goto out;
+
+ if (len < sizeof(bool))
+ goto out;
+ opt->is_default = *(bool *)(pos);
+
+ rc = 0;
+
+out:
+ return rc;
+}
+
+int pb_protocol_deserialise_boot_command(struct boot_command *cmd,
+ const struct pb_protocol_message *message)
+{
+ unsigned int len;
+ const char *pos;
+ int rc = -1;
+
+ len = message->payload_len;
+ pos = message->payload;
+
+ if (read_string(cmd, &pos, &len, &cmd->option_id))
+ goto out;
+
+ if (read_string(cmd, &pos, &len, &cmd->boot_image_file))
+ goto out;
+
+ if (read_string(cmd, &pos, &len, &cmd->initrd_file))
+ goto out;
+
+ if (read_string(cmd, &pos, &len, &cmd->dtb_file))
+ goto out;