struct s_hardware *hardware)
{
char available_dmi_commands[1024];
+ reset_more_printf();
memset(available_dmi_commands, 0, sizeof(available_dmi_commands));
- printf("Available DMI modules on your system:\n");
+ more_printf("Available DMI modules on your system:\n");
if (hardware->dmi.base_board.filled == true)
- printf("\t%s\n", CLI_DMI_BASE_BOARD);
+ more_printf("\t%s\n", CLI_DMI_BASE_BOARD);
if (hardware->dmi.battery.filled == true)
- printf("\t%s\n", CLI_DMI_BATTERY);
+ more_printf("\t%s\n", CLI_DMI_BATTERY);
if (hardware->dmi.bios.filled == true)
- printf("\t%s\n", CLI_DMI_BIOS);
+ more_printf("\t%s\n", CLI_DMI_BIOS);
if (hardware->dmi.chassis.filled == true)
- printf("\t%s\n", CLI_DMI_CHASSIS);
+ more_printf("\t%s\n", CLI_DMI_CHASSIS);
for (int i = 0; i < hardware->dmi.memory_count; i++) {
if (hardware->dmi.memory[i].filled == true) {
- printf("\tbank <number>\n");
+ more_printf("\tbank <number>\n");
break;
}
}
for (int i = 0; i < hardware->dmi.memory_module_count; i++) {
if (hardware->dmi.memory_module[i].filled == true) {
- printf("\tmodule <number>\n");
+ more_printf("\tmodule <number>\n");
break;
}
}
if (hardware->dmi.processor.filled == true)
- printf("\t%s\n", CLI_DMI_PROCESSOR);
+ more_printf("\t%s\n", CLI_DMI_PROCESSOR);
if (hardware->dmi.system.filled == true)
- printf("\t%s\n", CLI_DMI_SYSTEM);
+ more_printf("\t%s\n", CLI_DMI_SYSTEM);
if (hardware->dmi.ipmi.filled == true)
- printf("\t%s\n", CLI_DMI_IPMI);
+ more_printf("\t%s\n", CLI_DMI_IPMI);
if (hardware->dmi.cache_count)
- printf("\t%s\n", CLI_DMI_CACHE);
+ more_printf("\t%s\n", CLI_DMI_CACHE);
if (strlen(hardware->dmi.oem_strings))
more_printf("\t%s\n", CLI_DMI_OEM);
if (hardware->dmi.hardware_security.filled)
- printf("\t%s\n", CLI_DMI_SECURITY);
+ more_printf("\t%s\n", CLI_DMI_SECURITY);
}
static void show_dmi_base_board(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.base_board.filled == false) {
- printf("base_board information not found on your system, see "
+ more_printf("base_board information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
struct s_hardware *hardware)
{
if (hardware->dmi.system.filled == false) {
- printf("system information not found on your system, see "
+ more_printf("system information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- printf("System\n");
- printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
- printf(" Product Name : %s\n", hardware->dmi.system.product_name);
- printf(" Version : %s\n", hardware->dmi.system.version);
- printf(" Serial : %s\n", hardware->dmi.system.serial);
- printf(" UUID : %s\n", hardware->dmi.system.uuid);
- printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
- printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
- printf(" Family : %s\n", hardware->dmi.system.family);
+ reset_more_printf();
+ more_printf("System\n");
+ more_printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
+ more_printf(" Product Name : %s\n", hardware->dmi.system.product_name);
+ more_printf(" Version : %s\n", hardware->dmi.system.version);
+ more_printf(" Serial : %s\n", hardware->dmi.system.serial);
+ more_printf(" UUID : %s\n", hardware->dmi.system.uuid);
+ more_printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
+ more_printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
+ more_printf(" Family : %s\n", hardware->dmi.system.family);
if (strlen(hardware->dmi.system.configuration_options)) {
- printf("System Configuration Options\n");
- printf("%s\n", hardware->dmi.system.configuration_options);
+ more_printf("System Configuration Options\n");
+ more_printf("%s\n", hardware->dmi.system.configuration_options);
}
if (hardware->dmi.system.system_reset.filled) {
- printf("System Reset\n");
- printf(" Status : %s\n",
+ more_printf("System Reset\n");
+ more_printf(" Status : %s\n",
(hardware->dmi.system.system_reset.status ? "Enabled" : "Disabled"));
- printf(" Watchdog Timer : %s\n",
+ more_printf(" Watchdog Timer : %s\n",
(hardware->dmi.system.system_reset.watchdog ? "Present" : "Not Present"));
if (strlen(hardware->dmi.system.system_reset.boot_option))
- printf(" Boot Option : %s\n", hardware->dmi.system.system_reset.boot_option);
+ more_printf(" Boot Option : %s\n", hardware->dmi.system.system_reset.boot_option);
if (strlen(hardware->dmi.system.system_reset.boot_option_on_limit))
- printf(" Boot Option On Limit : %s\n", hardware->dmi.system.system_reset.boot_option_on_limit);
+ more_printf(" Boot Option On Limit : %s\n", hardware->dmi.system.system_reset.boot_option_on_limit);
if (strlen(hardware->dmi.system.system_reset.reset_count))
- printf(" Reset Count : %s\n", hardware->dmi.system.system_reset.reset_count);
+ more_printf(" Reset Count : %s\n", hardware->dmi.system.system_reset.reset_count);
if (strlen(hardware->dmi.system.system_reset.reset_limit))
- printf(" Reset Limit : %s\n", hardware->dmi.system.system_reset.reset_limit);
+ more_printf(" Reset Limit : %s\n", hardware->dmi.system.system_reset.reset_limit);
if (strlen(hardware->dmi.system.system_reset.timer_interval))
- printf(" Timer Interval : %s\n", hardware->dmi.system.system_reset.timer_interval);
+ more_printf(" Timer Interval : %s\n", hardware->dmi.system.system_reset.timer_interval);
if (strlen(hardware->dmi.system.system_reset.timeout))
- printf(" Timeout : %s\n", hardware->dmi.system.system_reset.timeout);
+ more_printf(" Timeout : %s\n", hardware->dmi.system.system_reset.timeout);
}
- printf("System Boot Information\n");
- printf(" Status : %s\n", hardware->dmi.system.system_boot_status);
+ more_printf("System Boot Information\n");
+ more_printf(" Status : %s\n", hardware->dmi.system.system_boot_status);
}
static void show_dmi_bios(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.bios.filled == false) {
- printf("bios information not found on your system, see "
+ more_printf("bios information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
"`show list' to see which module is available.\n");
return;
}
- printf("Chassis\n");
- printf(" Manufacturer : %s\n",
+ reset_more_printf();
+ more_printf("Chassis\n");
+ more_printf(" Manufacturer : %s\n",
hardware->dmi.chassis.manufacturer);
- printf(" Type : %s\n", hardware->dmi.chassis.type);
- printf(" Lock : %s\n", hardware->dmi.chassis.lock);
- printf(" Version : %s\n",
+ more_printf(" Type : %s\n", hardware->dmi.chassis.type);
+ more_printf(" Lock : %s\n", hardware->dmi.chassis.lock);
+ more_printf(" Version : %s\n",
hardware->dmi.chassis.version);
- printf(" Serial : %s\n", hardware->dmi.chassis.serial);
- printf(" Asset Tag : %s\n",
+ more_printf(" Serial : %s\n", hardware->dmi.chassis.serial);
+ more_printf(" Asset Tag : %s\n",
del_multi_spaces(hardware->dmi.chassis.asset_tag));
- printf(" Boot up state : %s\n",
+ more_printf(" Boot up state : %s\n",
hardware->dmi.chassis.boot_up_state);
- printf(" Power supply state : %s\n",
+ more_printf(" Power supply state : %s\n",
hardware->dmi.chassis.power_supply_state);
- printf(" Thermal state : %s\n",
+ more_printf(" Thermal state : %s\n",
hardware->dmi.chassis.thermal_state);
- printf(" Security Status : %s\n",
+ more_printf(" Security Status : %s\n",
hardware->dmi.chassis.security_status);
- printf(" OEM Information : %s\n",
+ more_printf(" OEM Information : %s\n",
hardware->dmi.chassis.oem_information);
- printf(" Height : %u\n", hardware->dmi.chassis.height);
- printf(" NB Power Cords : %u\n",
+ more_printf(" Height : %u\n", hardware->dmi.chassis.height);
+ more_printf(" NB Power Cords : %u\n",
hardware->dmi.chassis.nb_power_cords);
}
more_printf("IPMI module not available\n");
return;
}
- printf("IPMI\n");
- printf(" Interface Type : %s\n",
+ reset_more_printf();
+ more_printf("IPMI\n");
+ more_printf(" Interface Type : %s\n",
hardware->dmi.ipmi.interface_type);
- printf(" Specification Ver. : %u.%u\n",
+ more_printf(" Specification Ver. : %u.%u\n",
hardware->dmi.ipmi.major_specification_version,
hardware->dmi.ipmi.minor_specification_version);
- printf(" I2C Slave Address : 0x%02x\n",
+ more_printf(" I2C Slave Address : 0x%02x\n",
hardware->dmi.ipmi.I2C_slave_address);
- printf(" Nv Storage Address : %u\n",
+ more_printf(" Nv Storage Address : %u\n",
hardware->dmi.ipmi.nv_address);
uint32_t high = hardware->dmi.ipmi.base_address >> 32;
uint32_t low = hardware->dmi.ipmi.base_address & 0xFFFF;
- printf(" Base Address : %08X%08X\n",
+ more_printf(" Base Address : %08X%08X\n",
high,(low & ~1));
- printf(" IRQ : %d\n",
+ more_printf(" IRQ : %d\n",
hardware->dmi.ipmi.irq);
}
struct s_hardware *hardware)
{
if (hardware->dmi.battery.filled == false) {
- printf("battery information not found on your system, see "
+ more_printf("battery information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- printf("Battery \n");
- printf(" Vendor : %s\n",
+ reset_more_printf();
+ more_printf("Battery \n");
+ more_printf(" Vendor : %s\n",
hardware->dmi.battery.manufacturer);
- printf(" Manufacture Date : %s\n",
+ more_printf(" Manufacture Date : %s\n",
hardware->dmi.battery.manufacture_date);
- printf(" Serial : %s\n", hardware->dmi.battery.serial);
- printf(" Name : %s\n", hardware->dmi.battery.name);
- printf(" Chemistry : %s\n",
+ more_printf(" Serial : %s\n", hardware->dmi.battery.serial);
+ more_printf(" Name : %s\n", hardware->dmi.battery.name);
+ more_printf(" Chemistry : %s\n",
hardware->dmi.battery.chemistry);
- printf(" Design Capacity : %s\n",
+ more_printf(" Design Capacity : %s\n",
hardware->dmi.battery.design_capacity);
- printf(" Design Voltage : %s\n",
+ more_printf(" Design Voltage : %s\n",
hardware->dmi.battery.design_voltage);
- printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
- printf(" SBDS Manuf. Date : %s\n",
+ more_printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
+ more_printf(" SBDS Manuf. Date : %s\n",
hardware->dmi.battery.sbds_manufacture_date);
- printf(" SBDS Chemistry : %s\n",
+ more_printf(" SBDS Chemistry : %s\n",
hardware->dmi.battery.sbds_chemistry);
- printf(" Maximum Error : %s\n",
+ more_printf(" Maximum Error : %s\n",
hardware->dmi.battery.maximum_error);
- printf(" OEM Info : %s\n",
+ more_printf(" OEM Info : %s\n",
hardware->dmi.battery.oem_info);
}
struct s_hardware *hardware)
{
if (hardware->dmi.processor.filled == false) {
- printf("processor information not found on your system, see "
+ more_printf("processor information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
bank = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE || bank < 0) {
- printf("This bank number is incorrect\n");
+ more_printf("This bank number is incorrect\n");
return;
}
if ((bank >= hardware->dmi.memory_count) || (bank < 0)) {
- printf("Bank %d number doesn't exist\n", bank);
+ more_printf("Bank %d number doesn't exist\n", bank);
return;
}
if (hardware->dmi.memory[bank].filled == false) {
- printf("Bank %d doesn't contain any information\n", bank);
+ more_printf("Bank %d doesn't contain any information\n", bank);
return;
}
- printf("Memory Bank %d\n", bank);
- printf(" Form Factor : %s\n",
+ reset_more_printf();
+ more_printf("Memory Bank %d\n", bank);
+ more_printf(" Form Factor : %s\n",
hardware->dmi.memory[bank].form_factor);
- printf(" Type : %s\n", hardware->dmi.memory[bank].type);
- printf(" Type Detail : %s\n",
+ more_printf(" Type : %s\n", hardware->dmi.memory[bank].type);
+ more_printf(" Type Detail : %s\n",
hardware->dmi.memory[bank].type_detail);
- printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
- printf(" Size : %s\n", hardware->dmi.memory[bank].size);
- printf(" Device Set : %s\n",
+ more_printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
+ more_printf(" Size : %s\n", hardware->dmi.memory[bank].size);
+ more_printf(" Device Set : %s\n",
hardware->dmi.memory[bank].device_set);
- printf(" Device Loc. : %s\n",
+ more_printf(" Device Loc. : %s\n",
hardware->dmi.memory[bank].device_locator);
- printf(" Bank Locator : %s\n",
+ more_printf(" Bank Locator : %s\n",
hardware->dmi.memory[bank].bank_locator);
- printf(" Total Width : %s\n",
+ more_printf(" Total Width : %s\n",
hardware->dmi.memory[bank].total_width);
- printf(" Data Width : %s\n",
+ more_printf(" Data Width : %s\n",
hardware->dmi.memory[bank].data_width);
- printf(" Error : %s\n", hardware->dmi.memory[bank].error);
- printf(" Vendor : %s\n",
+ more_printf(" Error : %s\n", hardware->dmi.memory[bank].error);
+ more_printf(" Vendor : %s\n",
hardware->dmi.memory[bank].manufacturer);
- printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
- printf(" Asset Tag : %s\n",
+ more_printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
+ more_printf(" Asset Tag : %s\n",
hardware->dmi.memory[bank].asset_tag);
- printf(" Part Number : %s\n",
+ more_printf(" Part Number : %s\n",
hardware->dmi.memory[bank].part_number);
}
struct s_hardware *hardware)
{
if (!hardware->dmi.cache_count) {
- printf("cache information not found on your system, see "
+ more_printf("cache information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
int cache = strtol(argv[0], NULL, 10);
if (argc != 1 || cache > hardware->dmi.cache_count) {
- printf("show cache [0-%d]\n", hardware->dmi.cache_count-1);
+ more_printf("show cache [0-%d]\n", hardware->dmi.cache_count-1);
return;
}
module = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE || module < 0) {
- printf("This module number is incorrect\n");
+ more_printf("This module number is incorrect\n");
return;
}
if ((module >= hardware->dmi.memory_module_count) || (module < 0)) {
- printf("Module number %d doesn't exist\n", module);
+ more_printf("Module number %d doesn't exist\n", module);
return;
}
if (hardware->dmi.memory_module[module].filled == false) {
- printf("Module %d doesn't contain any information\n", module);
+ more_printf("Module %d doesn't contain any information\n", module);
return;
}
- printf("Memory Module %d\n", module);
- printf(" Socket Designation : %s\n",
+ reset_more_printf();
+ more_printf("Memory Module %d\n", module);
+ more_printf(" Socket Designation : %s\n",
hardware->dmi.memory_module[module].socket_designation);
- printf(" Bank Connections : %s\n",
+ more_printf(" Bank Connections : %s\n",
hardware->dmi.memory_module[module].bank_connections);
- printf(" Current Speed : %s\n",
+ more_printf(" Current Speed : %s\n",
hardware->dmi.memory_module[module].speed);
- printf(" Type : %s\n",
+ more_printf(" Type : %s\n",
hardware->dmi.memory_module[module].type);
- printf(" Installed Size : %s\n",
+ more_printf(" Installed Size : %s\n",
hardware->dmi.memory_module[module].installed_size);
- printf(" Enabled Size : %s\n",
+ more_printf(" Enabled Size : %s\n",
hardware->dmi.memory_module[module].enabled_size);
- printf(" Error Status : %s\n",
+ more_printf(" Error Status : %s\n",
hardware->dmi.memory_module[module].error_status);
}
detect_dmi(hardware);
if (hardware->is_dmi_valid == false) {
- printf("No valid DMI table found, exiting.\n");
+ more_printf("No valid DMI table found, exiting.\n");
return;
}
- printf("DMI Table version %u.%u found\n",
+ reset_more_printf();
+ more_printf("DMI Table version %u.%u found\n",
hardware->dmi.dmitable.major_version,
hardware->dmi.dmitable.minor_version);
return;
}
+ reset_more_printf();
more_printf("Memory Banks\n");
for (int i = 0; i < hardware->dmi.memory_count; i++) {
if (hardware->dmi.memory[i].filled == true) {
struct s_hardware *hardware)
{
cli_detect_pci(hardware);
-
+ reset_more_printf();
more_printf("PCI\n");
more_printf(" NB Devices : %d\n", hardware->nb_pci_devices);
}
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
int bus = 0, slot = 0, func = 0;
+ reset_more_printf();
/* Sanitize arguments */
if (argc <= 0) {
- printf("show device <number>\n");
+ more_printf("show device <number>\n");
return;
} else
pcidev = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE) {
- printf("This PCI device number is incorrect\n");
+ more_printf("This PCI device number is incorrect\n");
return;
}
if ((pcidev > hardware->nb_pci_devices) || (pcidev <= 0)) {
- printf("PCI device %d doesn't exist\n", pcidev);
+ more_printf("PCI device %d doesn't exist\n", pcidev);
return;
}
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
}
if (pci_device == NULL) {
- printf("We were enabled to find PCI device %d\n", pcidev);
+ more_printf("We were enabled to find PCI device %d\n", pcidev);
return;
}
if (pci_device->dev_info->linux_kernel_module_count == 0)
strlcpy(kernel_modules, "unknown", 7);
- printf("PCI Device %d\n", pcidev);
+ more_printf("PCI Device %d\n", pcidev);
if (nopciids == false) {
- printf("Vendor Name : %s\n",
+ more_printf("Vendor Name : %s\n",
pci_device->dev_info->vendor_name);
- printf("Product Name : %s\n",
+ more_printf("Product Name : %s\n",
pci_device->dev_info->product_name);
- printf("Class Name : %s\n",
+ more_printf("Class Name : %s\n",
pci_device->dev_info->class_name);
}
if (nomodulesfiles == false) {
- printf("Kernel module : %s\n", kernel_modules);
+ more_printf("Kernel module : %s\n", kernel_modules);
}
- printf("Vendor ID : %04x\n", pci_device->vendor);
- printf("Product ID : %04x\n", pci_device->product);
- printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
- printf("SubProduct ID : %04x\n", pci_device->sub_product);
- printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
+ more_printf("Vendor ID : %04x\n", pci_device->vendor);
+ more_printf("Product ID : %04x\n", pci_device->product);
+ more_printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
+ more_printf("SubProduct ID : %04x\n", pci_device->sub_product);
+ more_printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
pci_device->class[1], pci_device->class[0]);
- printf("Revision : %02x\n", pci_device->revision);
+ more_printf("Revision : %02x\n", pci_device->revision);
if ((pci_device->dev_info->irq > 0)
&& (pci_device->dev_info->irq < 255))
more_printf("IRQ : %0d\n", pci_device->dev_info->irq);
- printf("Latency : %0d\n", pci_device->dev_info->latency);
- printf("PCI Bus : %02d\n", bus);
- printf("PCI Slot : %02d\n", slot);
- printf("PCI Func : %02d\n", func);
+ more_printf("Latency : %0d\n", pci_device->dev_info->latency);
+ more_printf("PCI Bus : %02d\n", bus);
+ more_printf("PCI Slot : %02d\n", slot);
+ more_printf("PCI Func : %02d\n", func);
if (hardware->is_pxe_valid == true) {
if ((hardware->pxe.pci_device != NULL)
&& (hardware->pxe.pci_device == pci_device)) {
- printf("Mac Address : %s\n", hardware->pxe.mac_addr);
- printf("PXE : Current boot device\n");
+ more_printf("Mac Address : %s\n", hardware->pxe.mac_addr);
+ more_printf("PXE : Current boot device\n");
}
}
}
if (hardware->pci_detection == false) {
detect_pci(hardware);
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
- printf
+ more_printf
("The pci.ids file is missing, device names can't be computed.\n");
- printf("Please put one in same dir as hdt\n");
+ more_printf("Please put one in same dir as hdt\n");
error = true;
}
if ((hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) &&
(hardware->modules_alias_return_code == -ENOMODULESALIAS)) {
- printf
+ more_printf
("The modules.pcimap or modules.alias files are missing, device names can't be computed.\n");
- printf("Please put one of them in same dir as hdt\n");
+ more_printf("Please put one of them in same dir as hdt\n");
error = true;
}
if (error == true) {
char tempbuf[10];
- printf("Press enter to continue\n");
+ more_printf("Press enter to continue\n");
fgets(tempbuf, sizeof(tempbuf), stdin);
}
}