smartmontools SVN Rev 5618
Utility to control and monitor storage systems with "S.M.A.R.T."
|
#include "config.h"
#include <stdio.h>
#include "atacmds.h"
#include "knowndrives.h"
#include "utility.h"
#include <stdexcept>
#include "drivedb.h"
Go to the source code of this file.
Classes | |
class | drive_database |
Drive database class. More... | |
class | stdin_iterator |
struct | token_info |
Macros | |
#define | MODEL_STRING_LENGTH 40 |
#define | FIRMWARE_STRING_LENGTH 8 |
#define | TABLEPRINTWIDTH 19 |
Typedefs | |
typedef stdin_iterator | parse_ptr |
Enumerations | |
enum | dbentry_type { DBENTRY_VERSION , DBENTRY_ATA_DEFAULT , DBENTRY_ATA , DBENTRY_USB } |
Functions | |
static dbentry_type | get_modelfamily_type (const char *modelfamily) |
static dbentry_type | get_dbentry_type (const drive_settings *dbentry) |
static void | parse_version (std::string &dbversion, const char *verstr) |
static bool | compile (regular_expression ®ex, const char *pattern) |
static bool | match (const char *pattern, const char *str) |
static const drive_settings * | lookup_drive (const char *model, const char *firmware, std::string *dbversion=nullptr) |
static bool | parse_db_presets (const char *presets, ata_vendor_attr_defs *defs, firmwarebug_defs *firmwarebugs, std::string *type) |
static bool | parse_default_presets (const char *presets, ata_vendor_attr_defs &defs) |
static bool | parse_presets (const char *presets, ata_vendor_attr_defs &defs, firmwarebug_defs &firmwarebugs) |
static bool | parse_usb_type (const char *presets, std::string &type) |
static void | parse_usb_names (const char *names, usb_dev_info &info) |
int | lookup_usb_device (int vendor_id, int product_id, int bcd_device, usb_dev_info &info, usb_dev_info &info2) |
static int | showonepreset (const drive_settings *dbentry) |
int | showallpresets () |
int | showmatchingpresets (const char *model, const char *firmware) |
void | show_presets (const ata_identify_device *drive) |
const drive_settings * | lookup_drive_apply_presets (const ata_identify_device *drive, ata_vendor_attr_defs &defs, firmwarebug_defs &firmwarebugs, std::string &dbversion) |
static parse_ptr | skip_white (parse_ptr src, const char *path, int &line) |
static parse_ptr | get_token (parse_ptr src, token_info &token, const char *path, int &line) |
static bool | parse_drive_database (parse_ptr src, drive_database &db, const char *path) |
bool | read_drive_database (const char *path) |
const char * | get_drivedb_path_add () |
static bool | read_default_drive_databases () |
static bool | init_default_attr_defs () |
bool | init_drive_database (bool use_default_db) |
const ata_vendor_attr_defs & | get_default_attr_defs () |
Variables | |
const char * | knowndrives_cpp_cvsid |
const drive_settings | builtin_knowndrives [] |
const unsigned | builtin_knowndrives_size |
static drive_database | knowndrives |
The drive database. | |
static ata_vendor_attr_defs | default_attr_defs |
#define FIRMWARE_STRING_LENGTH 8 |
Definition at line 32 of file knowndrives.cpp.
#define MODEL_STRING_LENGTH 40 |
Definition at line 31 of file knowndrives.cpp.
#define TABLEPRINTWIDTH 19 |
Definition at line 33 of file knowndrives.cpp.
typedef stdin_iterator parse_ptr |
Definition at line 653 of file knowndrives.cpp.
enum dbentry_type |
Enumerator | |
---|---|
DBENTRY_VERSION | |
DBENTRY_ATA_DEFAULT | |
DBENTRY_ATA | |
DBENTRY_USB |
Definition at line 137 of file knowndrives.cpp.
|
static |
Definition at line 180 of file knowndrives.cpp.
|
inlinestatic |
Definition at line 157 of file knowndrives.cpp.
const ata_vendor_attr_defs & get_default_attr_defs | ( | ) |
Definition at line 993 of file knowndrives.cpp.
const char * get_drivedb_path_add | ( | ) |
Definition at line 894 of file knowndrives.cpp.
|
static |
Definition at line 145 of file knowndrives.cpp.
|
static |
Definition at line 712 of file knowndrives.cpp.
|
static |
Definition at line 949 of file knowndrives.cpp.
bool init_drive_database | ( | bool | use_default_db | ) |
Definition at line 984 of file knowndrives.cpp.
|
static |
Definition at line 204 of file knowndrives.cpp.
const drive_settings * lookup_drive_apply_presets | ( | const ata_identify_device * | drive, |
ata_vendor_attr_defs & | defs, | ||
firmwarebug_defs & | firmwarebugs, | ||
std::string & | dbversion | ||
) |
Definition at line 584 of file knowndrives.cpp.
int lookup_usb_device | ( | int | vendor_id, |
int | product_id, | ||
int | bcd_device, | ||
usb_dev_info & | info, | ||
usb_dev_info & | info2 | ||
) |
Definition at line 314 of file knowndrives.cpp.
|
static |
Definition at line 192 of file knowndrives.cpp.
|
static |
Definition at line 244 of file knowndrives.cpp.
|
inlinestatic |
Definition at line 280 of file knowndrives.cpp.
|
static |
Definition at line 770 of file knowndrives.cpp.
|
inlinestatic |
Definition at line 287 of file knowndrives.cpp.
|
static |
Definition at line 301 of file knowndrives.cpp.
|
inlinestatic |
Definition at line 295 of file knowndrives.cpp.
|
static |
Definition at line 163 of file knowndrives.cpp.
|
static |
Definition at line 920 of file knowndrives.cpp.
bool read_drive_database | ( | const char * | path | ) |
Definition at line 878 of file knowndrives.cpp.
void show_presets | ( | const ata_identify_device * | drive | ) |
Definition at line 550 of file knowndrives.cpp.
int showallpresets | ( | ) |
Definition at line 492 of file knowndrives.cpp.
int showmatchingpresets | ( | const char * | model, |
const char * | firmware | ||
) |
Definition at line 517 of file knowndrives.cpp.
|
static |
Definition at line 370 of file knowndrives.cpp.
Definition at line 656 of file knowndrives.cpp.
const drive_settings builtin_knowndrives[] |
Definition at line 42 of file knowndrives.cpp.
const unsigned builtin_knowndrives_size |
Definition at line 46 of file knowndrives.cpp.
|
static |
Definition at line 946 of file knowndrives.cpp.
|
static |
The drive database.
Definition at line 134 of file knowndrives.cpp.
const char* knowndrives_cpp_cvsid |
Definition at line 28 of file knowndrives.cpp.