Adapted for newer version of libp7
This commit is contained in:
parent
678ee10811
commit
32480e6b7b
|
@ -23,59 +23,58 @@
|
|||
|
||||
int dump(p7_handle_t *handle)
|
||||
{
|
||||
/* get response buffer */
|
||||
const p7_packet_t *resp = p7_get_response(handle);
|
||||
/* get server info */
|
||||
const p7_server_t *info = p7_get_info(handle);
|
||||
|
||||
/* send get info command and check response */
|
||||
int err;
|
||||
if ((err = p7_send_cmdsys_getinfo(handle)))
|
||||
return (err);
|
||||
if (resp->type != p7_pt_ack || !resp->extended)
|
||||
return (p7_error_unknown);
|
||||
|
||||
/* dump information */
|
||||
/* - wiped out things - */
|
||||
if (resp->preprog_rom_wiped)
|
||||
/* Wiped out things */
|
||||
if (info->preprog_rom_wiped)
|
||||
log("Warning: Preprogrammed ROM information looks wiped out !\n");
|
||||
if (resp->bootcode_wiped)
|
||||
if (info->bootcode_wiped)
|
||||
log("Warning: Bootcode information looks wiped out !\n");
|
||||
if (info->os_wiped)
|
||||
log("Warning: OS information looks wiped out!\n");
|
||||
|
||||
/* - preprogrammed ROM - */
|
||||
if (!resp->preprog_rom_wiped) {
|
||||
printf("Preprogrammed ROM capacity : " numformat "o\n",
|
||||
resp->preprog_rom_capacity);
|
||||
printf("Preprogrammed ROM version : %02u.%02u.%04u\n",
|
||||
resp->preprog_rom_version.major, resp->preprog_rom_version.minor,
|
||||
resp->preprog_rom_version.rev);
|
||||
printf("Preprogrammed ROM type : %s\n",
|
||||
resp->preprog_rom_version.type);
|
||||
/* Preprogrammed ROM */
|
||||
if (!info->preprog_rom_wiped) {
|
||||
printf("Preprogrammed ROM capacity: " numformat "o\n",
|
||||
info->preprog_rom_capacity);
|
||||
printf("Preprogrammed ROM version: %02u.%02u.%04u\n",
|
||||
info->preprog_rom_version.major, info->preprog_rom_version.minor,
|
||||
info->preprog_rom_version.rev);
|
||||
printf("Preprogrammed ROM type: %s\n",
|
||||
info->preprog_rom_version.type);
|
||||
}
|
||||
/* - ROM - */
|
||||
printf("ROM capacity: " numformat "o\n", resp->flash_rom_capacity);
|
||||
/* - RAM - */
|
||||
printf("RAM capacity: " numformat "o\n", resp->ram_capacity);
|
||||
/* - Bootcode - */
|
||||
if (!resp->bootcode_wiped) {
|
||||
|
||||
/* ROM and RAM */
|
||||
printf("ROM capacity: " numformat "o\n", info->flash_rom_capacity);
|
||||
printf("RAM capacity: " numformat "o\n", info->ram_capacity);
|
||||
|
||||
/* Bootcode */
|
||||
if (!info->bootcode_wiped) {
|
||||
printf("Bootcode version: %02u.%02u.%02u\n",
|
||||
resp->bootcode_version.major, resp->bootcode_version.minor,
|
||||
resp->bootcode_version.rev);
|
||||
printf("Bootcode type: %s\n", resp->bootcode_version.type);
|
||||
printf("Bootcode offset: " addrformat "\n", resp->bootcode_offset);
|
||||
printf("Bootcode size: " numformat "o\n", resp->bootcode_size);
|
||||
info->bootcode_version.major, info->bootcode_version.minor,
|
||||
info->bootcode_version.rev);
|
||||
printf("Bootcode type: %s\n", info->bootcode_version.type);
|
||||
printf("Bootcode offset: " addrformat "\n", info->bootcode_offset);
|
||||
printf("Bootcode size: " numformat "o\n", info->bootcode_size);
|
||||
}
|
||||
/* - OS - */
|
||||
printf("OS version: %02u.%02u.%02u\n",
|
||||
resp->os_version.major, resp->os_version.minor, resp->os_version.rev);
|
||||
printf("OS type: %s\n", resp->os_version.type);
|
||||
printf("OS offset: " addrformat "\n", resp->os_offset);
|
||||
printf("OS size: " numformat "o\n", resp->os_size);
|
||||
/* - Miscallenous info - */
|
||||
|
||||
/* OS */
|
||||
if (!info->os_wiped) {
|
||||
printf("OS version: %02u.%02u.%02u\n", info->os_version.major,
|
||||
info->os_version.minor, info->os_version.rev);
|
||||
printf("OS type: %s\n", info->os_version.type);
|
||||
printf("OS offset: " addrformat "\n", info->os_offset);
|
||||
printf("OS size: " numformat "o\n", info->os_size);
|
||||
}
|
||||
|
||||
/* Miscallenous information */
|
||||
printf("Protocol version: %01u.%02u\n",
|
||||
resp->protocol_version.major, resp->protocol_version.minor);
|
||||
printf("Product ID: %s\n", resp->product_id);
|
||||
printf("Username: %s\n", resp->username);
|
||||
printf("Hardware ID: %s\n", resp->hwid);
|
||||
printf("CPU ID (probably out of date): %s\n", resp->cpuid);
|
||||
info->protocol_version.major, info->protocol_version.minor);
|
||||
printf("Product ID: %s\n", info->product_id);
|
||||
printf("Username: %s\n", info->username);
|
||||
printf("Hardware ID: %s\n", info->hwid);
|
||||
printf("CPU ID (probably out of date): %s\n", info->cpuid);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
Reference in New Issue