+ if (read_string(config->network.dns_servers, &pos, &len, &str))
+ goto out;
+ config->network.dns_servers[i] = str;
+ }
+
+ if (read_string(config, &pos, &len, &str))
+ goto out;
+ config->http_proxy = str;
+ if (read_string(config, &pos, &len, &str))
+ goto out;
+ config->https_proxy = str;
+
+ if (read_u32(&pos, &len, &config->n_autoboot_opts))
+ goto out;
+ config->autoboot_opts = talloc_array(config, struct autoboot_option,
+ config->n_autoboot_opts);
+
+ for (i = 0; i < config->n_autoboot_opts; i++) {
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->autoboot_opts[i].boot_type = (int)tmp;
+ if (config->autoboot_opts[i].boot_type == BOOT_DEVICE_TYPE) {
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->autoboot_opts[i].type = tmp;
+ } else {
+ if (read_string(config, &pos, &len, &str))
+ goto out;
+ config->autoboot_opts[i].uuid = str;
+ }
+ }
+
+ if (read_u32(&pos, &len, &config->ipmi_bootdev))
+ goto out;
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->ipmi_bootdev_persistent = !!tmp;
+
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->allow_writes = !!tmp;
+
+ if (read_u32(&pos, &len, &config->n_consoles))
+ goto out;
+
+ config->consoles = talloc_array(config, char *, config->n_consoles);
+ for (i = 0; i < config->n_consoles; i++) {
+ if (read_string(config->consoles, &pos, &len, &str))
+ goto out;
+ config->consoles[i] = str;
+ }
+
+ if (read_string(config, &pos, &len, &str))
+ goto out;
+
+ config->boot_console = str;
+
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->manual_console = !!tmp;
+
+ if (read_string(config, &pos, &len, &str))
+ goto out;
+
+ config->lang = str;
+
+ rc = 0;
+
+out:
+ return rc;
+}
+
+int pb_protocol_deserialise_plugin_option(struct plugin_option *opt,
+ const struct pb_protocol_message *message)
+{
+ unsigned int len, i, tmp;
+ const char *pos;
+ int rc = -1;
+ char *str;
+
+ len = message->payload_len;
+ pos = message->payload;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->id = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->name = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->vendor = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->vendor_id = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->version = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->date = str;
+
+ if (read_string(opt, &pos, &len, &str))
+ goto out;
+ opt->plugin_file = str;
+
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ opt->n_executables = tmp;
+
+ opt->executables = talloc_zero_array(opt, char *, opt->n_executables);
+ if (!opt->executables)
+ goto out;
+
+ for (i = 0; i < opt->n_executables; i++) {
+ if (read_string(opt, &pos, &len, &str))