+
+int pb_protocol_deserialise_temp_autoboot(struct autoboot_option *opt,
+ const struct pb_protocol_message *message)
+{
+ unsigned int len, tmp;
+ const char *pos;
+ int rc = -1;
+ char *str;
+
+ len = message->payload_len;
+ pos = message->payload;
+
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+
+ opt->boot_type = tmp;
+ if (opt->boot_type == BOOT_DEVICE_TYPE) {
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ opt->type = tmp;
+
+ } else if (opt->boot_type == BOOT_DEVICE_UUID) {
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->uuid = str;
+
+ } else {
+ return -1;
+ }
+
+ rc = 0;
+
+out:
+ return rc;
+}