4 + optional_strlen(bd_info->mountpoint);
}
+ /* BMC MAC */
+ len += HWADDR_SIZE;
+
return len;
}
if (conf->method == CONFIG_METHOD_STATIC) {
len += 4 + optional_strlen(conf->static_config.address);
len += 4 + optional_strlen(conf->static_config.gateway);
+ len += 4 + optional_strlen(conf->static_config.url);
}
return len;
len += 4 + 4; /* ipmi_bootdev, ipmi_bootdev_persistent */
+ len += 4; /* allow_writes */
+
len += 4 + optional_strlen(config->lang);
return len;
pos += pb_protocol_serialise_string(pos, bd_info->mountpoint);
}
+ if (sysinfo->bmc_mac)
+ memcpy(pos, sysinfo->bmc_mac, HWADDR_SIZE);
+ else
+ memset(pos, 0, HWADDR_SIZE);
+ pos += HWADDR_SIZE;
+
assert(pos <= buf + buf_len);
(void)buf_len;
conf->static_config.address);
pos += pb_protocol_serialise_string(pos,
conf->static_config.gateway);
+ pos += pb_protocol_serialise_string(pos,
+ conf->static_config.url);
}
return pos - buf;
*(uint32_t *)pos = config->ipmi_bootdev_persistent;
pos += 4;
+ *(uint32_t *)pos = config->allow_writes;
+ pos += 4;
+
pos += pb_protocol_serialise_string(pos, config->lang);
assert(pos <= buf + buf_len);
sysinfo->blockdevs[i] = bd_info;
}
- rc = 0;
+ for (i = 0; i < HWADDR_SIZE; i++) {
+ if (pos[i] != 0) {
+ sysinfo->bmc_mac = talloc_memdup(sysinfo, pos, HWADDR_SIZE);
+ break;
+ }
+ }
+
+ pos += HWADDR_SIZE;
+ len -= HWADDR_SIZE;
+
+ rc = 0;
out:
return rc;
}
if (read_string(iface, buf, len, &iface->static_config.gateway))
return -1;
+
+ if (read_string(iface, buf, len, &iface->static_config.url))
+ return -1;
}
return 0;
goto out;
config->ipmi_bootdev_persistent = !!tmp;
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->allow_writes = !!tmp;
+
if (read_string(config, &pos, &len, &str))
goto out;